PluginProbe
Elementor Website Builder – more than just a page builder / 4.0.0-dev3
Elementor Website Builder – more than just a page builder v4.0.0-dev3
4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 All 452 releases
← All changes | assets/js/styleguide.js +2196 -1723 4.3.0-beta34.0.0-dev3 View file →
@@ -1,1765 +1,2238 @@
1 -(function(_wordpress_i18n) {
1 +/******/ (() => { // webpackBootstrap
2 +/******/ var __webpack_modules__ = ({
2 3
3 -//#region \0rolldown/runtime.js
4 - var __create = Object.create;
5 - var __defProp = Object.defineProperty;
6 - var __name = (target, value) => __defProp(target, "name", {
7 - value,
8 - configurable: true
9 - });
10 - var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
11 - var __getOwnPropNames = Object.getOwnPropertyNames;
12 - var __getProtoOf = Object.getPrototypeOf;
13 - var __hasOwnProp = Object.prototype.hasOwnProperty;
14 - var __esmMin = (fn, res, err) => () => {
15 - if (err) throw err[0];
16 - try {
17 - return fn && (res = fn(fn = 0)), res;
18 - } catch (e) {
19 - throw err = [e], e;
20 - }
21 - };
22 - var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
23 - var __exportAll = (all, no_symbols) => {
24 - let target = {};
25 - for (var name in all) {
26 - __defProp(target, name, {
27 - get: all[name],
28 - enumerable: true
29 - });
30 - }
31 - if (!no_symbols) {
32 - __defProp(target, Symbol.toStringTag, { value: "Module" });
33 - }
34 - return target;
35 - };
36 - var __copyProps = (to, from, except, desc) => {
37 - if (from && typeof from === "object" || typeof from === "function") {
38 - for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
39 - key = keys[i];
40 - if (!__hasOwnProp.call(to, key) && key !== except) {
41 - __defProp(to, key, {
42 - get: ((k) => from[k]).bind(null, key),
43 - enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
44 - });
45 - }
46 - }
47 - }
48 - return to;
49 - };
50 - var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
51 - value: mod,
52 - enumerable: true
53 - }) : target, mod));
4 +/***/ "../assets/dev/js/editor/components/dynamic-tags/control-behavior.js":
5 +/*!***************************************************************************!*\
6 + !*** ../assets/dev/js/editor/components/dynamic-tags/control-behavior.js ***!
7 + \***************************************************************************/
8 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
54 9
55 -//#endregion
10 +"use strict";
11 +/* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"];
56 12
57 -//#region node_modules/@babel/runtime/helpers/esm/classCallCheck.js
58 - function _classCallCheck(a, n) {
59 - if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
60 - }
61 - var init_classCallCheck = __esmMin((() => {}));
62 13
63 -//#endregion
64 -//#region node_modules/@babel/runtime/helpers/esm/typeof.js
65 - function _typeof(o) {
66 - "@babel/helpers - typeof";
67 - return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
68 - return typeof o;
69 - } : function(o) {
70 - return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
71 - }, _typeof(o);
72 - }
73 - var init_typeof = __esmMin((() => {}));
14 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
15 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
16 +var TagPanelView = __webpack_require__(/*! elementor-dynamic-tags/tag-panel-view */ "../assets/dev/js/editor/components/dynamic-tags/tag-panel-view.js");
17 +module.exports = Marionette.Behavior.extend({
18 + tagView: null,
19 + listenerAttached: false,
20 + initialize: function initialize() {
21 + if (!this.listenerAttached) {
22 + this.listenTo(this.view.options.container.settings, 'change:external:__dynamic__', this.onAfterExternalChange);
23 + this.listenerAttached = true;
24 + }
25 + },
26 + shouldRenderTools: function shouldRenderTools() {
27 + var hasDefault = this.getOption('dynamicSettings').default;
28 + if (hasDefault) {
29 + return false;
30 + }
31 + var isFeatureAvailableToUser = elementor.helpers.hasPro() && !elementor.helpers.hasProAndNotConnected(),
32 + hasTags = this.getOption('tags').length > 0;
33 + return !isFeatureAvailableToUser || hasTags;
34 + },
35 + renderTools: function renderTools() {
36 + var _this = this;
37 + if (!this.shouldRenderTools()) {
38 + return;
39 + }
40 + var $dynamicSwitcher = jQuery(Marionette.Renderer.render('#tmpl-elementor-control-dynamic-switcher'));
41 + $dynamicSwitcher.on('click', function (event) {
42 + return _this.onDynamicSwitcherClick(event);
43 + });
44 + this.$el.find('.elementor-control-dynamic-switcher-wrapper').append($dynamicSwitcher);
45 + this.ui.dynamicSwitcher = $dynamicSwitcher;
46 + if ('color' === this.view.model.get('type')) {
47 + if (this.view.colorPicker) {
48 + this.moveDynamicSwitcherToColorPicker();
49 + } else {
50 + setTimeout(function () {
51 + return _this.moveDynamicSwitcherToColorPicker();
52 + });
53 + }
54 + }
74 55
75 -//#endregion
76 -//#region node_modules/@babel/runtime/helpers/esm/toPrimitive.js
77 - function toPrimitive(t, r) {
78 - if ("object" != _typeof(t) || !t) return t;
79 - var e = t[Symbol.toPrimitive];
80 - if (void 0 !== e) {
81 - var i = e.call(t, r || "default");
82 - if ("object" != _typeof(i)) return i;
83 - throw new TypeError("@@toPrimitive must return a primitive value.");
84 - }
85 - return ("string" === r ? String : Number)(t);
86 - }
87 - var init_toPrimitive = __esmMin((() => {
88 - init_typeof();
89 - }));
56 + // Add a Tipsy Tooltip to the Dynamic Switcher
57 + this.ui.dynamicSwitcher.tipsy({
58 + title: function title() {
59 + return this.getAttribute('data-tooltip');
60 + },
61 + gravity: 's'
62 + });
63 + },
64 + moveDynamicSwitcherToColorPicker: function moveDynamicSwitcherToColorPicker() {
65 + var $colorPickerToolsContainer = this.view.colorPicker.$pickerToolsContainer;
66 + this.ui.dynamicSwitcher.removeClass('elementor-control-unit-1').addClass('e-control-tool');
67 + var $eyedropper = $colorPickerToolsContainer.find('.elementor-control-element-color-picker');
68 + if ($eyedropper.length) {
69 + this.ui.dynamicSwitcher.insertBefore($eyedropper);
70 + } else {
71 + $colorPickerToolsContainer.append(this.ui.dynamicSwitcher);
72 + }
73 + },
74 + toggleDynamicClass: function toggleDynamicClass() {
75 + this.$el.toggleClass('elementor-control-dynamic-value', this.isDynamicMode());
76 + },
77 + isDynamicMode: function isDynamicMode() {
78 + var dynamicSettings = this.view.container.settings.get('__dynamic__');
79 + return !!(dynamicSettings && dynamicSettings[this.view.model.get('name')]);
80 + },
81 + createTagsList: function createTagsList() {
82 + var tags = _.groupBy(this.getOption('tags'), 'group'),
83 + groups = elementor.dynamicTags.getConfig('groups'),
84 + $tagsList = this.ui.tagsList = jQuery('<div>', {
85 + class: 'elementor-tags-list'
86 + }),
87 + $tagsListInner = jQuery('<div>', {
88 + class: 'elementor-tags-list__inner'
89 + });
90 + $tagsList.append($tagsListInner);
91 + jQuery.each(groups, function (groupName) {
92 + var groupTags = tags[groupName];
93 + if (!groupTags) {
94 + return;
95 + }
96 + var group = this,
97 + $groupTitle = jQuery('<div>', {
98 + class: 'elementor-tags-list__group-title'
99 + }).text(group.title);
100 + $tagsListInner.append($groupTitle);
101 + groupTags.forEach(function (tag) {
102 + var $tag = jQuery('<div>', {
103 + class: 'elementor-tags-list__item'
104 + });
105 + $tag.text(tag.title).attr('data-tag-name', tag.name);
106 + $tagsListInner.append($tag);
107 + });
108 + });
90 109
91 -//#endregion
92 -//#region node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
93 - function toPropertyKey(t) {
94 - var i = toPrimitive(t, "string");
95 - return "symbol" == _typeof(i) ? i : i + "";
96 - }
97 - var init_toPropertyKey = __esmMin((() => {
98 - init_typeof();
99 - init_toPrimitive();
100 - }));
110 + // Create and inject pro dynamic teaser template if Pro is not installed
111 + if (!elementor.helpers.hasPro() && Object.keys(tags).length) {
112 + var proTeaser = Marionette.Renderer.render('#tmpl-elementor-dynamic-tags-promo', {
113 + promotionUrl: elementor.config.dynamicPromotionURL.replace('%s', this.view.model.get('name'))
114 + });
115 + $tagsListInner.append(proTeaser);
116 + }
117 + $tagsListInner.on('click', '.elementor-tags-list__item', this.onTagsListItemClick.bind(this));
118 + elementorCommon.elements.$body.append($tagsList);
119 + },
120 + getTagsList: function getTagsList() {
121 + if (!this.ui.tagsList) {
122 + this.createTagsList();
123 + }
124 + return this.ui.tagsList;
125 + },
126 + toggleTagsList: function toggleTagsList() {
127 + var $tagsList = this.getTagsList();
128 + if ($tagsList.is(':visible')) {
129 + $tagsList.hide();
130 + return;
131 + }
132 + var direction = elementorCommon.config.isRTL ? 'left' : 'right';
133 + $tagsList.show().position({
134 + my: "".concat(direction, " top"),
135 + at: "".concat(direction, " bottom+5"),
136 + of: this.ui.dynamicSwitcher
137 + });
138 + },
139 + setTagView: function setTagView(id, name, settings) {
140 + if (this.tagView) {
141 + this.tagView.destroy();
142 + }
143 + var tagView = this.tagView = new TagPanelView({
144 + id: id,
145 + name: name,
146 + settings: settings,
147 + controlName: this.view.model.get('name'),
148 + dynamicSettings: this.getOption('dynamicSettings')
149 + }),
150 + elementContainer = this.view.options.container,
151 + tagViewLabel = elementContainer.controls[tagView.options.controlName].label;
152 + tagView.options.container = new elementorModules.editor.Container({
153 + type: 'dynamic',
154 + id: id,
155 + model: tagView.model,
156 + settings: tagView.model,
157 + view: tagView,
158 + parent: elementContainer,
159 + label: elementContainer.label + ' ' + tagViewLabel,
160 + controls: tagView.model.options.controls,
161 + renderer: elementContainer
162 + });
163 + tagView.render();
164 + this.$el.find('.elementor-control-tag-area').after(tagView.el);
165 + this.listenTo(tagView, 'remove', this.onTagViewRemove.bind(this));
166 + },
167 + setDefaultTagView: function setDefaultTagView() {
168 + var tagData = elementor.dynamicTags.tagTextToTagData(this.getDynamicValue());
169 + this.setTagView(tagData.id, tagData.name, tagData.settings);
170 + },
171 + tagViewToTagText: function tagViewToTagText() {
172 + var tagView = this.tagView;
173 + return elementor.dynamicTags.tagDataToTagText(tagView.getOption('id'), tagView.getOption('name'), tagView.model);
174 + },
175 + getDynamicValue: function getDynamicValue() {
176 + return this.view.container.dynamic.get(this.view.model.get('name'));
177 + },
178 + destroyTagView: function destroyTagView() {
179 + if (this.tagView) {
180 + this.tagView.destroy();
181 + this.tagView = null;
182 + }
183 + },
184 + showPromotion: function showPromotion() {
185 + var hasProAndNotConnected = elementor.helpers.hasProAndNotConnected(),
186 + dialogOptions = {
187 + title: __('Dynamic Content', 'elementor'),
188 + content: __('Create more personalized and dynamic sites by populating data from various sources with dozens of dynamic tags to choose from.', 'elementor'),
189 + targetElement: this.ui.dynamicSwitcher,
190 + position: {
191 + blockStart: '-10'
192 + },
193 + actionButton: {
194 + url: hasProAndNotConnected ? elementorProEditorConfig.urls.connect : elementor.config.dynamicPromotionURL.replace('%s', this.view.model.get('name')),
195 + text: hasProAndNotConnected ? __('Connect & Activate', 'elementor') : __('Upgrade', 'elementor')
196 + }
197 + };
198 + elementor.promotion.showDialog(dialogOptions);
199 + },
200 + onRender: function onRender() {
201 + this.$el.addClass('elementor-control-dynamic');
202 + this.renderTools();
203 + this.toggleDynamicClass();
204 + if (this.isDynamicMode()) {
205 + this.setDefaultTagView();
206 + }
207 + },
208 + onDynamicSwitcherClick: function onDynamicSwitcherClick(event) {
209 + event.stopPropagation();
210 + if (this.getOption('tags').length) {
211 + this.toggleTagsList();
212 + } else {
213 + this.showPromotion();
214 + }
215 + },
216 + onTagsListItemClick: function onTagsListItemClick(event) {
217 + var $tag = jQuery(event.currentTarget);
218 + this.setTagView(elementorCommon.helpers.getUniqueId(), $tag.data('tagName'), {});
101 219
102 -//#endregion
103 -//#region node_modules/@babel/runtime/helpers/esm/createClass.js
104 - function _defineProperties(e, r) {
105 - for (var t = 0; t < r.length; t++) {
106 - var o = r[t];
107 - o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey(o.key), o);
108 - }
109 - }
110 - function _createClass(e, r, t) {
111 - return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e;
112 - }
113 - var init_createClass = __esmMin((() => {
114 - init_toPropertyKey();
115 - }));
220 + // If an element has an active global value, disable it before applying the dynamic value.
221 + if (this.view.getGlobalKey()) {
222 + this.view.triggerMethod('unset:global:value');
223 + }
224 + if (this.isDynamicMode()) {
225 + $e.run('document/dynamic/settings', {
226 + container: this.view.options.container,
227 + settings: (0, _defineProperty2.default)({}, this.view.model.get('name'), this.tagViewToTagText())
228 + });
229 + } else {
230 + $e.run('document/dynamic/enable', {
231 + container: this.view.options.container,
232 + settings: (0, _defineProperty2.default)({}, this.view.model.get('name'), this.tagViewToTagText())
233 + });
234 + }
235 + this.toggleDynamicClass();
236 + this.toggleTagsList();
237 + if (this.tagView.getTagConfig().settings_required) {
238 + this.tagView.showSettingsPopup();
239 + }
240 + },
241 + onTagViewRemove: function onTagViewRemove() {
242 + $e.run('document/dynamic/disable', {
243 + container: this.view.options.container,
244 + settings: (0, _defineProperty2.default)({}, this.view.model.get('name'), this.tagViewToTagText())
245 + });
246 + this.toggleDynamicClass();
247 + },
248 + onAfterExternalChange: function onAfterExternalChange() {
249 + this.destroyTagView();
250 + if (this.isDynamicMode()) {
251 + this.setDefaultTagView();
252 + }
253 + this.toggleDynamicClass();
254 + },
255 + onDestroy: function onDestroy() {
256 + this.destroyTagView();
257 + if (this.ui.tagsList) {
258 + this.ui.tagsList.remove();
259 + }
260 + }
261 +});
116 262
117 -//#endregion
118 -//#region node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
119 - function _assertThisInitialized(e) {
120 - if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
121 - return e;
122 - }
123 - var init_assertThisInitialized = __esmMin((() => {}));
263 +/***/ }),
124 264
125 -//#endregion
126 -//#region node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js
127 - function _possibleConstructorReturn(t, e) {
128 - if (e && ("object" == _typeof(e) || "function" == typeof e)) return e;
129 - if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
130 - return _assertThisInitialized(t);
131 - }
132 - var init_possibleConstructorReturn = __esmMin((() => {
133 - init_typeof();
134 - init_assertThisInitialized();
135 - }));
265 +/***/ "../assets/dev/js/editor/components/dynamic-tags/tag-controls-stack-empty.js":
266 +/*!***********************************************************************************!*\
267 + !*** ../assets/dev/js/editor/components/dynamic-tags/tag-controls-stack-empty.js ***!
268 + \***********************************************************************************/
269 +/***/ ((module) => {
136 270
137 -//#endregion
138 -//#region node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js
139 - function _getPrototypeOf(t) {
140 - return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t) {
141 - return t.__proto__ || Object.getPrototypeOf(t);
142 - }, _getPrototypeOf(t);
143 - }
144 - var init_getPrototypeOf = __esmMin((() => {}));
271 +"use strict";
145 272
146 -//#endregion
147 -//#region node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
148 - function _setPrototypeOf(t, e) {
149 - return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, e) {
150 - return t.__proto__ = e, t;
151 - }, _setPrototypeOf(t, e);
152 - }
153 - var init_setPrototypeOf = __esmMin((() => {}));
154 273
155 -//#endregion
156 -//#region node_modules/@babel/runtime/helpers/esm/inherits.js
157 - function _inherits(t, e) {
158 - if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
159 - t.prototype = Object.create(e && e.prototype, { constructor: {
160 - value: t,
161 - writable: !0,
162 - configurable: !0
163 - } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e);
164 - }
165 - var init_inherits = __esmMin((() => {
166 - init_setPrototypeOf();
167 - }));
274 +module.exports = Marionette.ItemView.extend({
275 + className: 'elementor-tag-controls-stack-empty',
276 + template: '#tmpl-elementor-tag-controls-stack-empty'
277 +});
168 278
169 -//#endregion
170 -//#region modules/styleguide/assets/js/commands/enable.js
171 - init_classCallCheck();
172 - init_createClass();
173 - init_possibleConstructorReturn();
174 - init_getPrototypeOf();
175 - init_inherits();
176 - function _callSuper$8(t, o, e) {
177 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$8() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
178 - }
179 - __name(_callSuper$8, "_callSuper");
180 - function _isNativeReflectConstruct$8() {
181 - try {
182 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
183 - } catch (t) {}
184 - return (_isNativeReflectConstruct$8 = function _isNativeReflectConstruct() {
185 - return !!t;
186 - })();
187 - }
188 - __name(_isNativeReflectConstruct$8, "_isNativeReflectConstruct");
189 - var Enable = /*#__PURE__*/ function(_$e$modules$CommandBa) {
190 - function Enable() {
191 - _classCallCheck(this, Enable);
192 - return _callSuper$8(this, Enable, arguments);
193 - }
194 - _inherits(Enable, _$e$modules$CommandBa);
195 - return _createClass(Enable, [{
196 - key: "apply",
197 - value: function apply(args) {
198 - $e.components.get("preview/styleguide").enableStyleguidePreview(args);
199 - }
200 - }]);
201 - }($e.modules.CommandBase);
279 +/***/ }),
202 280
203 -//#endregion
204 -//#region modules/styleguide/assets/js/commands/global-colors.js
205 - init_classCallCheck();
206 - init_createClass();
207 - init_possibleConstructorReturn();
208 - init_getPrototypeOf();
209 - init_inherits();
210 - function _callSuper$7(t, o, e) {
211 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$7() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
212 - }
213 - __name(_callSuper$7, "_callSuper");
214 - function _isNativeReflectConstruct$7() {
215 - try {
216 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
217 - } catch (t) {}
218 - return (_isNativeReflectConstruct$7 = function _isNativeReflectConstruct() {
219 - return !!t;
220 - })();
221 - }
222 - __name(_isNativeReflectConstruct$7, "_isNativeReflectConstruct");
223 - var GlobalColors = /*#__PURE__*/ function(_$e$modules$CommandBa) {
224 - function GlobalColors() {
225 - _classCallCheck(this, GlobalColors);
226 - return _callSuper$7(this, GlobalColors, arguments);
227 - }
228 - _inherits(GlobalColors, _$e$modules$CommandBa);
229 - return _createClass(GlobalColors, [{
230 - key: "apply",
231 - value: function apply() {
232 - $e.components.get("preview/styleguide").showStyleguidePreview();
233 - }
234 - }]);
235 - }($e.modules.CommandBase);
281 +/***/ "../assets/dev/js/editor/components/dynamic-tags/tag-controls-stack.js":
282 +/*!*****************************************************************************!*\
283 + !*** ../assets/dev/js/editor/components/dynamic-tags/tag-controls-stack.js ***!
284 + \*****************************************************************************/
285 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
236 286
237 -//#endregion
238 -//#region modules/styleguide/assets/js/commands/global-typography.js
239 - init_classCallCheck();
240 - init_createClass();
241 - init_possibleConstructorReturn();
242 - init_getPrototypeOf();
243 - init_inherits();
244 - function _callSuper$6(t, o, e) {
245 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$6() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
246 - }
247 - __name(_callSuper$6, "_callSuper");
248 - function _isNativeReflectConstruct$6() {
249 - try {
250 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
251 - } catch (t) {}
252 - return (_isNativeReflectConstruct$6 = function _isNativeReflectConstruct() {
253 - return !!t;
254 - })();
255 - }
256 - __name(_isNativeReflectConstruct$6, "_isNativeReflectConstruct");
257 - var GlobalTypography = /*#__PURE__*/ function(_$e$modules$CommandBa) {
258 - function GlobalTypography() {
259 - _classCallCheck(this, GlobalTypography);
260 - return _callSuper$6(this, GlobalTypography, arguments);
261 - }
262 - _inherits(GlobalTypography, _$e$modules$CommandBa);
263 - return _createClass(GlobalTypography, [{
264 - key: "apply",
265 - value: function apply() {
266 - $e.components.get("preview/styleguide").showStyleguidePreview();
267 - }
268 - }]);
269 - }($e.modules.CommandBase);
287 +"use strict";
270 288
271 -//#endregion
272 -//#region modules/styleguide/assets/js/commands/hide.js
273 - init_classCallCheck();
274 - init_createClass();
275 - init_possibleConstructorReturn();
276 - init_getPrototypeOf();
277 - init_inherits();
278 - function _callSuper$5(t, o, e) {
279 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$5() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
280 - }
281 - __name(_callSuper$5, "_callSuper");
282 - function _isNativeReflectConstruct$5() {
283 - try {
284 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
285 - } catch (t) {}
286 - return (_isNativeReflectConstruct$5 = function _isNativeReflectConstruct() {
287 - return !!t;
288 - })();
289 - }
290 - __name(_isNativeReflectConstruct$5, "_isNativeReflectConstruct");
291 - var Hide = /*#__PURE__*/ function(_$e$modules$CommandBa) {
292 - function Hide() {
293 - _classCallCheck(this, Hide);
294 - return _callSuper$5(this, Hide, arguments);
295 - }
296 - _inherits(Hide, _$e$modules$CommandBa);
297 - return _createClass(Hide, [{
298 - key: "apply",
299 - value: function apply() {
300 - $e.components.get("preview/styleguide").hideStyleguidePreview();
301 - }
302 - }]);
303 - }($e.modules.CommandBase);
304 289
305 -//#endregion
306 -//#region modules/styleguide/assets/js/commands/switcher-change.js
307 - init_classCallCheck();
308 - init_createClass();
309 - init_possibleConstructorReturn();
310 - init_getPrototypeOf();
311 - init_inherits();
312 - function _callSuper$4(t, o, e) {
313 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$4() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
314 - }
315 - __name(_callSuper$4, "_callSuper");
316 - function _isNativeReflectConstruct$4() {
317 - try {
318 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
319 - } catch (t) {}
320 - return (_isNativeReflectConstruct$4 = function _isNativeReflectConstruct() {
321 - return !!t;
322 - })();
323 - }
324 - __name(_isNativeReflectConstruct$4, "_isNativeReflectConstruct");
325 - var SwitcherChange = /*#__PURE__*/ function(_$e$modules$CommandBa) {
326 - function SwitcherChange() {
327 - _classCallCheck(this, SwitcherChange);
328 - return _callSuper$4(this, SwitcherChange, arguments);
329 - }
330 - _inherits(SwitcherChange, _$e$modules$CommandBa);
331 - return _createClass(SwitcherChange, [{
332 - key: "validateArgs",
333 - value: function validateArgs() {
334 - var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
335 - this.requireArgumentType("name", "string", args);
336 - this.requireArgumentType("value", "string", args);
337 - }
338 - }, {
339 - key: "apply",
340 - value: function apply(args) {
341 - if (args.name.includes("enable_styleguide_preview")) $e.components.get("preview/styleguide").enableStyleguidePreview({ value: args.value });
342 - }
343 - }]);
344 - }($e.modules.CommandBase);
290 +var EmptyView = __webpack_require__(/*! elementor-dynamic-tags/tag-controls-stack-empty */ "../assets/dev/js/editor/components/dynamic-tags/tag-controls-stack-empty.js");
291 +module.exports = elementorModules.editor.views.ControlsStack.extend({
292 + activeTab: 'content',
293 + template: _.noop,
294 + emptyView: EmptyView,
295 + isEmpty: function isEmpty() {
296 + // Ignore the section control
297 + return this.collection.length < 2;
298 + },
299 + childViewOptions: function childViewOptions() {
300 + return {
301 + container: this.options.container
302 + };
303 + },
304 + getNamespaceArray: function getNamespaceArray() {
305 + var currentPageView = elementor.getPanelView().getCurrentPageView(),
306 + eventNamespace = currentPageView.getNamespaceArray();
307 + eventNamespace.push(currentPageView.activeSection);
308 + eventNamespace.push(this.getOption('controlName'));
309 + eventNamespace.push(this.getOption('name'));
310 + return eventNamespace;
311 + },
312 + onRenderTemplate: function onRenderTemplate() {
313 + this.activateFirstSection();
314 + }
315 +});
345 316
346 -//#endregion
347 -//#region modules/styleguide/assets/js/commands/index.js
348 - var commands_exports = /* @__PURE__ */ __exportAll({
349 - Enable: () => Enable,
350 - GlobalColors: () => GlobalColors,
351 - GlobalTypography: () => GlobalTypography,
352 - Hide: () => Hide,
353 - SwitcherChange: () => SwitcherChange
354 - });
317 +/***/ }),
355 318
356 -//#endregion
357 -//#region node_modules/@babel/runtime/helpers/esm/superPropBase.js
358 - init_getPrototypeOf();
359 - function _superPropBase(t, o) {
360 - for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t)););
361 - return t;
362 - }
319 +/***/ "../assets/dev/js/editor/components/dynamic-tags/tag-panel-view.js":
320 +/*!*************************************************************************!*\
321 + !*** ../assets/dev/js/editor/components/dynamic-tags/tag-panel-view.js ***!
322 + \*************************************************************************/
323 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
363 324
364 -//#endregion
365 -//#region node_modules/@babel/runtime/helpers/esm/get.js
366 - function _get() {
367 - return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function(e, t, r) {
368 - var p = _superPropBase(e, t);
369 - if (p) {
370 - var n = Object.getOwnPropertyDescriptor(p, t);
371 - return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value;
372 - }
373 - }, _get.apply(null, arguments);
374 - }
325 +"use strict";
375 326
376 -//#endregion
377 -//#region node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
378 - function _arrayWithHoles(r) {
379 - if (Array.isArray(r)) return r;
380 - }
381 - var init_arrayWithHoles = __esmMin((() => {}));
382 327
383 -//#endregion
384 -//#region node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
385 - function _iterableToArrayLimit(r, l) {
386 - var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
387 - if (null != t) {
388 - var e;
389 - var n;
390 - var i;
391 - var u;
392 - var a = [];
393 - var f = !0;
394 - var o = !1;
395 - try {
396 - if (i = (t = t.call(r)).next, 0 === l) {
397 - if (Object(t) !== t) return;
398 - f = !1;
399 - } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
400 - } catch (r) {
401 - o = !0, n = r;
402 - } finally {
403 - try {
404 - if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
405 - } finally {
406 - if (o) throw n;
407 - }
408 - }
409 - return a;
410 - }
411 - }
412 - var init_iterableToArrayLimit = __esmMin((() => {}));
328 +var TagControlsStack = __webpack_require__(/*! elementor-dynamic-tags/tag-controls-stack */ "../assets/dev/js/editor/components/dynamic-tags/tag-controls-stack.js");
329 +module.exports = Marionette.ItemView.extend({
330 + className: 'elementor-dynamic-cover e-input-style',
331 + tagControlsStack: null,
332 + templateHelpers: function templateHelpers() {
333 + var helpers = {};
334 + if (this.model) {
335 + helpers.controls = this.model.options.controls;
336 + }
337 + return helpers;
338 + },
339 + ui: {
340 + remove: '.elementor-dynamic-cover__remove'
341 + },
342 + events: function events() {
343 + var events = {
344 + 'click @ui.remove': 'onRemoveClick'
345 + };
346 + if (this.hasSettings()) {
347 + events.click = 'onClick';
348 + }
349 + return events;
350 + },
351 + getTemplate: function getTemplate() {
352 + var config = this.getTagConfig(),
353 + templateFunction = Marionette.TemplateCache.get('#tmpl-elementor-control-dynamic-cover'),
354 + renderedTemplate = Marionette.Renderer.render(templateFunction, {
355 + hasSettings: this.hasSettings(),
356 + isRemovable: !this.getOption('dynamicSettings').default,
357 + title: config.title,
358 + content: config.panel_template
359 + });
360 + return Marionette.TemplateCache.prototype.compileTemplate(renderedTemplate.trim());
361 + },
362 + getTagConfig: function getTagConfig() {
363 + return elementor.dynamicTags.getConfig('tags.' + this.getOption('name'));
364 + },
365 + initSettingsPopup: function initSettingsPopup() {
366 + var settingsPopupOptions = {
367 + className: 'elementor-tag-settings-popup',
368 + position: {
369 + my: 'left top+5',
370 + at: 'left bottom',
371 + of: this.$el,
372 + autoRefresh: true
373 + },
374 + hide: {
375 + ignore: '.select2-container'
376 + }
377 + };
378 + var settingsPopup = elementorCommon.dialogsManager.createWidget('buttons', settingsPopupOptions);
379 + this.getSettingsPopup = function () {
380 + return settingsPopup;
381 + };
382 + },
383 + hasSettings: function hasSettings() {
384 + return !!Object.values(this.getTagConfig().controls).length;
385 + },
386 + showSettingsPopup: function showSettingsPopup() {
387 + if (!this.tagControlsStack) {
388 + this.initTagControlsStack();
389 + }
390 + var settingsPopup = this.getSettingsPopup();
391 + if (settingsPopup.isVisible()) {
392 + return;
393 + }
394 + settingsPopup.show();
395 + },
396 + initTagControlsStack: function initTagControlsStack() {
397 + this.tagControlsStack = new TagControlsStack({
398 + model: this.model,
399 + controls: this.model.controls,
400 + name: this.options.name,
401 + controlName: this.options.controlName,
402 + container: this.options.container,
403 + el: this.getSettingsPopup().getElements('message')[0]
404 + });
405 + this.tagControlsStack.render();
406 + },
407 + initModel: function initModel() {
408 + this.model = new elementorModules.editor.elements.models.BaseSettings(this.getOption('settings'), {
409 + controls: this.getTagConfig().controls
410 + });
411 + },
412 + initialize: function initialize() {
413 + // The `model` should always be available.
414 + this.initModel();
415 + if (!this.hasSettings()) {
416 + return;
417 + }
418 + this.initSettingsPopup();
419 + this.listenTo(this.model, 'change', this.render);
420 + },
421 + onClick: function onClick() {
422 + this.showSettingsPopup();
423 + },
424 + onRemoveClick: function onRemoveClick(event) {
425 + event.stopPropagation();
426 + this.destroy();
427 + this.trigger('remove');
428 + },
429 + onDestroy: function onDestroy() {
430 + if (this.hasSettings()) {
431 + this.getSettingsPopup().destroy();
432 + }
433 + if (this.tagControlsStack) {
434 + this.tagControlsStack.destroy();
435 + }
436 + }
437 +});
413 438
414 -//#endregion
415 -//#region node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
416 - function _arrayLikeToArray(r, a) {
417 - (null == a || a > r.length) && (a = r.length);
418 - for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
419 - return n;
420 - }
421 - var init_arrayLikeToArray = __esmMin((() => {}));
439 +/***/ }),
422 440
423 -//#endregion
424 -//#region node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
425 - function _unsupportedIterableToArray(r, a) {
426 - if (r) {
427 - if ("string" == typeof r) return _arrayLikeToArray(r, a);
428 - var t = {}.toString.call(r).slice(8, -1);
429 - return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
430 - }
431 - }
432 - var init_unsupportedIterableToArray = __esmMin((() => {
433 - init_arrayLikeToArray();
434 - }));
441 +/***/ "../assets/dev/js/editor/components/validator/base.js":
442 +/*!************************************************************!*\
443 + !*** ../assets/dev/js/editor/components/validator/base.js ***!
444 + \************************************************************/
445 +/***/ ((module) => {
435 446
436 -//#endregion
437 -//#region node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
438 - function _nonIterableRest() {
439 - throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
440 - }
441 - var init_nonIterableRest = __esmMin((() => {}));
447 +"use strict";
442 448
443 -//#endregion
444 -//#region node_modules/@babel/runtime/helpers/esm/slicedToArray.js
445 - function _slicedToArray(r, e) {
446 - return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
447 - }
448 - var init_slicedToArray = __esmMin((() => {
449 - init_arrayWithHoles();
450 - init_iterableToArrayLimit();
451 - init_unsupportedIterableToArray();
452 - init_nonIterableRest();
453 - }));
454 449
455 -//#endregion
456 -//#region node_modules/@babel/runtime/helpers/esm/defineProperty.js
457 - function _defineProperty(e, r, t) {
458 - return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
459 - value: t,
460 - enumerable: !0,
461 - configurable: !0,
462 - writable: !0
463 - }) : e[r] = t, e;
464 - }
465 - var init_defineProperty = __esmMin((() => {
466 - init_toPropertyKey();
467 - }));
450 +module.exports = elementorModules.Module.extend({
451 + errors: [],
452 + __construct: function __construct(settings) {
453 + var customValidationMethod = settings.customValidationMethod;
454 + if (customValidationMethod) {
455 + this.validationMethod = customValidationMethod;
456 + }
457 + },
458 + getDefaultSettings: function getDefaultSettings() {
459 + return {
460 + validationTerms: {}
461 + };
462 + },
463 + isValid: function isValid() {
464 + var validationErrors = this.validationMethod.apply(this, arguments);
465 + if (validationErrors.length) {
466 + this.errors = validationErrors;
467 + return false;
468 + }
469 + return true;
470 + },
471 + validationMethod: function validationMethod(newValue) {
472 + var validationTerms = this.getSettings('validationTerms'),
473 + errors = [];
474 + if (validationTerms.required) {
475 + if (!('' + newValue).length) {
476 + errors.push('Required value is empty');
477 + }
478 + }
479 + return errors;
480 + }
481 +});
468 482
469 -//#endregion
470 -//#region assets/dev/js/editor/components/validator/base.js
471 - var require_base$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
472 - module.exports = elementorModules.Module.extend({
473 - errors: [],
474 - __construct: function __construct(settings) {
475 - var customValidationMethod = settings.customValidationMethod;
476 - if (customValidationMethod) this.validationMethod = customValidationMethod;
477 - },
478 - getDefaultSettings: function getDefaultSettings() {
479 - return { validationTerms: {} };
480 - },
481 - isValid: function isValid() {
482 - var validationErrors = this.validationMethod.apply(this, arguments);
483 - if (validationErrors.length) {
484 - this.errors = validationErrors;
485 - return false;
486 - }
487 - return true;
488 - },
489 - validationMethod: function validationMethod(newValue) {
490 - var validationTerms = this.getSettings("validationTerms");
491 - var errors = [];
492 - if (validationTerms.required) {
493 - if (!("" + newValue).length) errors.push("Required value is empty");
494 - }
495 - return errors;
496 - }
497 - });
498 - }));
483 +/***/ }),
499 484
500 -//#endregion
501 -//#region assets/dev/js/editor/components/validator/number.js
502 - var require_number = /* @__PURE__ */ __commonJSMin(((exports, module) => {
503 - var Validator = require_base$1();
504 - module.exports = Validator.extend({ validationMethod: function validationMethod(newValue) {
505 - var validationTerms = this.getSettings("validationTerms");
506 - var errors = [];
507 - if (_.isFinite(newValue)) {
508 - if (void 0 !== validationTerms.min && newValue < validationTerms.min) errors.push("Value is less than minimum");
509 - if (void 0 !== validationTerms.max && newValue > validationTerms.max) errors.push("Value is greater than maximum");
510 - }
511 - return errors;
512 - } });
513 - }));
485 +/***/ "../assets/dev/js/editor/components/validator/breakpoint.js":
486 +/*!******************************************************************!*\
487 + !*** ../assets/dev/js/editor/components/validator/breakpoint.js ***!
488 + \******************************************************************/
489 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
514 490
515 -//#endregion
516 -//#region assets/dev/js/editor/components/validator/breakpoint.js
517 - function _callSuper$3(t, o, e) {
518 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$3() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
519 - }
520 - function _isNativeReflectConstruct$3() {
521 - try {
522 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
523 - } catch (t) {}
524 - return (_isNativeReflectConstruct$3 = function _isNativeReflectConstruct() {
525 - return !!t;
526 - })();
527 - }
528 - var NumberValidator, BreakpointValidator;
529 - var init_breakpoint = __esmMin((() => {
530 - init_classCallCheck();
531 - init_createClass();
532 - init_possibleConstructorReturn();
533 - init_getPrototypeOf();
534 - init_inherits();
535 - __name(_callSuper$3, "_callSuper");
536 - __name(_isNativeReflectConstruct$3, "_isNativeReflectConstruct");
537 - NumberValidator = require_number();
538 - BreakpointValidator = /*#__PURE__*/ function(_NumberValidator) {
539 - function BreakpointValidator() {
540 - _classCallCheck(this, BreakpointValidator);
541 - return _callSuper$3(this, BreakpointValidator, arguments);
542 - }
543 - _inherits(BreakpointValidator, _NumberValidator);
544 - return _createClass(BreakpointValidator, [
545 - {
546 - key: "getDefaultSettings",
547 - value: function getDefaultSettings() {
548 - return { validationTerms: { max: 5120 } };
549 - }
550 - },
551 - {
552 - key: "getPanelActiveBreakpoints",
553 - value: function getPanelActiveBreakpoints() {
554 - var panelBreakpoints = elementor.documents.currentDocument.config.settings.settings.active_breakpoints.map(function(breakpointName) {
555 - return breakpointName.replace("viewport_", "");
556 - });
557 - var panelActiveBreakpoints = {};
558 - panelBreakpoints.forEach(function(breakpointName) {
559 - panelActiveBreakpoints[breakpointName] = elementorFrontend.config.responsive.breakpoints[breakpointName];
560 - });
561 - return panelActiveBreakpoints;
562 - }
563 - },
564 - {
565 - key: "initBreakpointProperties",
566 - value: function initBreakpointProperties() {
567 - var _activeBreakpoints$br;
568 - var _activeBreakpoints$br2;
569 - var validationTerms = this.getSettings("validationTerms");
570 - var activeBreakpoints = this.getPanelActiveBreakpoints();
571 - var breakpointKeys = Object.keys(activeBreakpoints);
572 - this.breakpointIndex = breakpointKeys.indexOf(validationTerms.breakpointName);
573 - this.topBreakpoint = (_activeBreakpoints$br = activeBreakpoints[breakpointKeys[this.breakpointIndex + 1]]) === null || _activeBreakpoints$br === void 0 ? void 0 : _activeBreakpoints$br.value;
574 - this.bottomBreakpoint = (_activeBreakpoints$br2 = activeBreakpoints[breakpointKeys[this.breakpointIndex - 1]]) === null || _activeBreakpoints$br2 === void 0 ? void 0 : _activeBreakpoints$br2.value;
575 - }
576 - },
577 - {
578 - key: "validationMethod",
579 - value: function validationMethod(newValue) {
580 - var validationTerms = this.getSettings("validationTerms");
581 - var errors = NumberValidator.prototype.validationMethod.call(this, newValue);
582 - if (_.isFinite(newValue) || "" === newValue) {
583 - if (!this.validateMinMaxForBreakpoint(newValue, validationTerms)) errors.push("Value is not between the breakpoints above or under the edited breakpoint");
584 - }
585 - return errors;
586 - }
587 - },
588 - {
589 - key: "validateMinMaxForBreakpoint",
590 - value: function validateMinMaxForBreakpoint(newValue, validationTerms) {
591 - var breakpointDefaultValue = elementorFrontend.config.responsive.breakpoints[validationTerms.breakpointName].default_value;
592 - var isValid = true;
593 - this.initBreakpointProperties();
594 - if ("mobile" === validationTerms.breakpointName && 320 === this.bottomBreakpoint) this.bottomBreakpoint -= 1;
595 - if (this.bottomBreakpoint) {
596 - if ("" !== newValue && newValue <= this.bottomBreakpoint) isValid = false;
597 - if ("" === newValue && breakpointDefaultValue <= this.bottomBreakpoint) isValid = false;
598 - }
599 - if (this.topBreakpoint) {
600 - if ("" !== newValue && newValue >= this.topBreakpoint) isValid = false;
601 - if ("" === newValue && breakpointDefaultValue >= this.topBreakpoint) isValid = false;
602 - }
603 - return isValid;
604 - }
605 - }
606 - ]);
607 - }(NumberValidator);
608 - }));
491 +"use strict";
609 492
610 -//#endregion
611 -//#region assets/dev/js/editor/controls/base.js
612 - var require_base = /* @__PURE__ */ __commonJSMin(((exports, module) => {
613 - init_defineProperty();
614 - function ownKeys(e, r) {
615 - var t = Object.keys(e);
616 - if (Object.getOwnPropertySymbols) {
617 - var o = Object.getOwnPropertySymbols(e);
618 - r && (o = o.filter(function(r) {
619 - return Object.getOwnPropertyDescriptor(e, r).enumerable;
620 - })), t.push.apply(t, o);
621 - }
622 - return t;
623 - }
624 - function _objectSpread(e) {
625 - for (var r = 1; r < arguments.length; r++) {
626 - var t = null != arguments[r] ? arguments[r] : {};
627 - r % 2 ? ownKeys(Object(t), !0).forEach(function(r) {
628 - _defineProperty(e, r, t[r]);
629 - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r) {
630 - Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
631 - });
632 - }
633 - return e;
634 - }
635 - var ControlBaseView = Marionette.CompositeView.extend({
636 - ui: function ui() {
637 - return { controlTitle: ".elementor-control-title" };
638 - },
639 - behaviors: function behaviors() {
640 - return elementor.hooks.applyFilters("controls/base/behaviors", {}, this);
641 - },
642 - getBehavior: function getBehavior(name) {
643 - return this._behaviors[Object.keys(this.behaviors()).indexOf(name)];
644 - },
645 - className: function className() {
646 - var classes = "elementor-control elementor-control-" + this.model.get("name") + " elementor-control-type-" + this.model.get("type");
647 - var modelClasses = this.model.get("classes");
648 - var responsive = this.model.get("responsive");
649 - if (!_.isEmpty(modelClasses)) classes += " " + modelClasses;
650 - if (!_.isEmpty(responsive)) {
651 - var responsiveControlName = responsive.max || responsive.min;
652 - classes += " elementor-control-responsive-" + responsiveControlName;
653 - }
654 - return classes;
655 - },
656 - templateHelpers: function templateHelpers() {
657 - var controlData = { _cid: this.model.cid };
658 - return {
659 - view: this,
660 - data: _.extend({}, this.model.toJSON(), controlData)
661 - };
662 - },
663 - getTemplate: function getTemplate() {
664 - return Marionette.TemplateCache.get("#tmpl-elementor-control-" + this.model.get("type") + "-content");
665 - },
666 - initialize: function initialize(options) {
667 - var label = this.model.get("label");
668 - Object.defineProperty(this, "container", { get: function get() {
669 - if (!options.container) {
670 - var settingsModel = options.elementSettingsModel;
671 - var view = $e.components.get("document").utils.findViewById(settingsModel.id);
672 - if (view && view.getContainer) options.container = view.getContainer();
673 - else {
674 - if (!settingsModel.id) settingsModel.id = "bc-" + elementorCommon.helpers.getUniqueId();
675 - options.container = new elementorModules.editor.Container({
676 - type: "bc-container",
677 - id: settingsModel.id,
678 - model: settingsModel,
679 - settings: settingsModel,
680 - label,
681 - view: false,
682 - parent: false,
683 - renderer: false,
684 - controls: settingsModel.options.controls
685 - });
686 - }
687 - }
688 - return options.container;
689 - } });
690 - Object.defineProperty(this, "elementSettingsModel", { get: function get() {
691 - elementorDevTools.deprecation.deprecated("elementSettingsModel", "2.8.0", "container.settings");
692 - return options.container ? options.container.settings : options.elementSettingsModel;
693 - } });
694 - var controlType = this.model.get("type");
695 - var controlSettings = jQuery.extend(true, {}, elementor.config.controls[controlType], this.model.attributes);
696 - this.model.set(controlSettings);
697 - var settings = this.container ? this.container.settings : this.elementSettingsModel;
698 - this.listenTo(settings, "change", this.onAfterChange);
699 - if (this.model.attributes.responsive) {
700 - this.onDeviceModeChange = this.onDeviceModeChange.bind(this);
701 - elementor.listenTo(elementor.channels.deviceMode, "change", this.onDeviceModeChange);
702 - }
703 - },
704 - onDestroy: function onDestroy() {
705 - elementor.stopListening(elementor.channels.deviceMode, "change", this.onDeviceModeChange);
706 - },
707 - onDeviceModeChange: function onDeviceModeChange() {
708 - this.toggleControlVisibility();
709 - },
710 - onAfterChange: function onAfterChange() {
711 - this.toggleControlVisibility();
712 - },
713 - toggleControlVisibility: function toggleControlVisibility() {
714 - var settings = this.container ? this.container.settings : this.elementSettingsModel;
715 - var isVisible = elementor.helpers.isActiveControl(this.model, settings.attributes, settings.controls);
716 - this.$el.toggleClass("elementor-hidden-control", !isVisible);
717 - elementor.getPanelView().updateScrollbar();
718 - },
719 - onRender: function onRender() {
720 - var layoutType = this.model.get("label_block") ? "block" : "inline";
721 - var showLabel = this.model.get("show_label");
722 - var elClasses = "elementor-label-" + layoutType;
723 - elClasses += " elementor-control-separator-" + this.model.get("separator");
724 - if (!showLabel) elClasses += " elementor-control-hidden-label";
725 - this.$el.addClass(elClasses);
726 - this.toggleControlVisibility();
727 - },
728 - reRoute: function reRoute(controlActive) {
729 - $e.route($e.routes.getCurrent("panel"), this.getControlInRouteArgs(controlActive ? this.getControlPath() : ""), { history: false });
730 - },
731 - getControlInRouteArgs: function getControlInRouteArgs(path) {
732 - return _objectSpread(_objectSpread({}, $e.routes.getCurrentArgs("panel")), {}, { activeControl: path });
733 - },
734 - getControlPath: function getControlPath() {
735 - var controlPath = this.model.get("name");
736 - var parent = this._parent;
737 - while (!parent.$el.hasClass("elementor-controls-stack")) {
738 - controlPath = (parent.model.get("name") || parent.model.get("_id")) + "/" + controlPath;
739 - parent = parent._parent;
740 - }
741 - return controlPath;
742 - }
743 - });
744 - module.exports = ControlBaseView;
745 - }));
746 493
747 -//#endregion
748 -//#region assets/dev/js/editor/components/dynamic-tags/tag-controls-stack-empty.js
749 - var require_tag_controls_stack_empty = /* @__PURE__ */ __commonJSMin(((exports, module) => {
750 - module.exports = Marionette.ItemView.extend({
751 - className: "elementor-tag-controls-stack-empty",
752 - template: "#tmpl-elementor-tag-controls-stack-empty"
753 - });
754 - }));
494 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
495 +Object.defineProperty(exports, "__esModule", ({
496 + value: true
497 +}));
498 +exports["default"] = void 0;
499 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
500 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
501 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
502 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
503 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
504 +function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
505 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
506 +var NumberValidator = __webpack_require__(/*! elementor-validator/number */ "../assets/dev/js/editor/components/validator/number.js");
507 +var BreakpointValidator = exports["default"] = /*#__PURE__*/function (_NumberValidator) {
508 + function BreakpointValidator() {
509 + (0, _classCallCheck2.default)(this, BreakpointValidator);
510 + return _callSuper(this, BreakpointValidator, arguments);
511 + }
512 + (0, _inherits2.default)(BreakpointValidator, _NumberValidator);
513 + return (0, _createClass2.default)(BreakpointValidator, [{
514 + key: "getDefaultSettings",
515 + value: function getDefaultSettings() {
516 + return {
517 + validationTerms: {
518 + // Max width we allow in general
519 + max: 5120
520 + }
521 + };
522 + }
755 523
756 -//#endregion
757 -//#region assets/dev/js/editor/components/dynamic-tags/tag-controls-stack.js
758 - var require_tag_controls_stack = /* @__PURE__ */ __commonJSMin(((exports, module) => {
759 - var EmptyView = require_tag_controls_stack_empty();
760 - module.exports = elementorModules.editor.views.ControlsStack.extend({
761 - activeTab: "content",
762 - template: _.noop,
763 - emptyView: EmptyView,
764 - isEmpty: function isEmpty() {
765 - return this.collection.length < 2;
766 - },
767 - childViewOptions: function childViewOptions() {
768 - return { container: this.options.container };
769 - },
770 - getNamespaceArray: function getNamespaceArray() {
771 - var currentPageView = elementor.getPanelView().getCurrentPageView();
772 - var eventNamespace = currentPageView.getNamespaceArray();
773 - eventNamespace.push(currentPageView.activeSection);
774 - eventNamespace.push(this.getOption("controlName"));
775 - eventNamespace.push(this.getOption("name"));
776 - return eventNamespace;
777 - },
778 - onRenderTemplate: function onRenderTemplate() {
779 - this.activateFirstSection();
780 - }
781 - });
782 - }));
524 + /**
525 + * Get Panel Active Breakpoints
526 + *
527 + * Since the active kit used in the Site Settings panel could be a draft, we need to use the panel's active
528 + * breakpoints settings and not the elementorFrontend.config values (which come from the DB).
529 + *
530 + * @return {*} Object
531 + */
532 + }, {
533 + key: "getPanelActiveBreakpoints",
534 + value: function getPanelActiveBreakpoints() {
535 + var panelBreakpoints = elementor.documents.currentDocument.config.settings.settings.active_breakpoints.map(function (breakpointName) {
536 + return breakpointName.replace('viewport_', '');
537 + }),
538 + panelActiveBreakpoints = {};
539 + panelBreakpoints.forEach(function (breakpointName) {
540 + panelActiveBreakpoints[breakpointName] = elementorFrontend.config.responsive.breakpoints[breakpointName];
541 + });
542 + return panelActiveBreakpoints;
543 + }
544 + }, {
545 + key: "initBreakpointProperties",
546 + value: function initBreakpointProperties() {
547 + var _activeBreakpoints$br, _activeBreakpoints$br2;
548 + var validationTerms = this.getSettings('validationTerms'),
549 + activeBreakpoints = this.getPanelActiveBreakpoints(),
550 + breakpointKeys = Object.keys(activeBreakpoints);
551 + this.breakpointIndex = breakpointKeys.indexOf(validationTerms.breakpointName);
552 + this.topBreakpoint = (_activeBreakpoints$br = activeBreakpoints[breakpointKeys[this.breakpointIndex + 1]]) === null || _activeBreakpoints$br === void 0 ? void 0 : _activeBreakpoints$br.value;
553 + this.bottomBreakpoint = (_activeBreakpoints$br2 = activeBreakpoints[breakpointKeys[this.breakpointIndex - 1]]) === null || _activeBreakpoints$br2 === void 0 ? void 0 : _activeBreakpoints$br2.value;
554 + }
555 + }, {
556 + key: "validationMethod",
557 + value: function validationMethod(newValue) {
558 + var validationTerms = this.getSettings('validationTerms'),
559 + errors = NumberValidator.prototype.validationMethod.call(this, newValue);
783 560
784 -//#endregion
785 -//#region assets/dev/js/editor/components/dynamic-tags/tag-panel-view.js
786 - var require_tag_panel_view = /* @__PURE__ */ __commonJSMin(((exports, module) => {
787 - var TagControlsStack = require_tag_controls_stack();
788 - module.exports = Marionette.ItemView.extend({
789 - className: "elementor-dynamic-cover e-input-style",
790 - tagControlsStack: null,
791 - templateHelpers: function templateHelpers() {
792 - var helpers = {};
793 - if (this.model) helpers.controls = this.model.options.controls;
794 - return helpers;
795 - },
796 - ui: { remove: ".elementor-dynamic-cover__remove" },
797 - events: function events() {
798 - var events = { "click @ui.remove": "onRemoveClick" };
799 - if (this.hasSettings()) events.click = "onClick";
800 - return events;
801 - },
802 - getTemplate: function getTemplate() {
803 - var config = this.getTagConfig();
804 - var templateFunction = Marionette.TemplateCache.get("#tmpl-elementor-control-dynamic-cover");
805 - var renderedTemplate = Marionette.Renderer.render(templateFunction, {
806 - hasSettings: this.hasSettings(),
807 - isRemovable: !this.getOption("dynamicSettings").default,
808 - title: config.title,
809 - content: config.panel_template
810 - });
811 - return Marionette.TemplateCache.prototype.compileTemplate(renderedTemplate.trim());
812 - },
813 - getTagConfig: function getTagConfig() {
814 - return elementor.dynamicTags.getConfig("tags." + this.getOption("name"));
815 - },
816 - initSettingsPopup: function initSettingsPopup() {
817 - var settingsPopupOptions = {
818 - className: "elementor-tag-settings-popup",
819 - position: {
820 - my: "left top+5",
821 - at: "left bottom",
822 - of: this.$el,
823 - autoRefresh: true
824 - },
825 - hide: { ignore: ".select2-container" }
826 - };
827 - var settingsPopup = elementorCommon.dialogsManager.createWidget("buttons", settingsPopupOptions);
828 - this.getSettingsPopup = function() {
829 - return settingsPopup;
830 - };
831 - },
832 - hasSettings: function hasSettings() {
833 - return !!Object.values(this.getTagConfig().controls).length;
834 - },
835 - showSettingsPopup: function showSettingsPopup() {
836 - if (!this.tagControlsStack) this.initTagControlsStack();
837 - var settingsPopup = this.getSettingsPopup();
838 - if (settingsPopup.isVisible()) return;
839 - settingsPopup.show();
840 - },
841 - initTagControlsStack: function initTagControlsStack() {
842 - this.tagControlsStack = new TagControlsStack({
843 - model: this.model,
844 - controls: this.model.controls,
845 - name: this.options.name,
846 - controlName: this.options.controlName,
847 - container: this.options.container,
848 - el: this.getSettingsPopup().getElements("message")[0]
849 - });
850 - this.tagControlsStack.render();
851 - },
852 - initModel: function initModel() {
853 - this.model = new elementorModules.editor.elements.models.BaseSettings(this.getOption("settings"), { controls: this.getTagConfig().controls });
854 - },
855 - initialize: function initialize() {
856 - this.initModel();
857 - if (!this.hasSettings()) return;
858 - this.initSettingsPopup();
859 - this.listenTo(this.model, "change", this.render);
860 - },
861 - onClick: function onClick() {
862 - this.showSettingsPopup();
863 - },
864 - onRemoveClick: function onRemoveClick(event) {
865 - event.stopPropagation();
866 - this.destroy();
867 - this.trigger("remove");
868 - },
869 - onDestroy: function onDestroy() {
870 - if (this.hasSettings()) this.getSettingsPopup().destroy();
871 - if (this.tagControlsStack) this.tagControlsStack.destroy();
872 - }
873 - });
874 - }));
561 + // Validate both numeric and empty values, since breakpoints utilize default values when empty.
562 + if (_.isFinite(newValue) || '' === newValue) {
563 + if (!this.validateMinMaxForBreakpoint(newValue, validationTerms)) {
564 + errors.push('Value is not between the breakpoints above or under the edited breakpoint');
565 + }
566 + }
567 + return errors;
568 + }
569 + }, {
570 + key: "validateMinMaxForBreakpoint",
571 + value: function validateMinMaxForBreakpoint(newValue, validationTerms) {
572 + var breakpointDefaultValue = elementorFrontend.config.responsive.breakpoints[validationTerms.breakpointName].default_value;
573 + var isValid = true;
574 + this.initBreakpointProperties();
875 575
876 -//#endregion
877 -//#region assets/dev/js/editor/components/dynamic-tags/control-behavior.js
878 - var require_control_behavior = /* @__PURE__ */ __commonJSMin(((exports, module) => {
879 - init_defineProperty();
880 - var TagPanelView = require_tag_panel_view();
881 - module.exports = Marionette.Behavior.extend({
882 - tagView: null,
883 - listenerAttached: false,
884 - initialize: function initialize() {
885 - if (!this.listenerAttached) {
886 - this.listenTo(this.view.options.container.settings, "change:external:__dynamic__", this.onAfterExternalChange);
887 - this.listenerAttached = true;
888 - }
889 - },
890 - shouldRenderTools: function shouldRenderTools() {
891 - if (this.getOption("dynamicSettings").default) return false;
892 - var isFeatureAvailableToUser = elementor.helpers.hasPro() && !elementor.helpers.hasProAndNotConnected();
893 - var hasTags = this.getOption("tags").length > 0;
894 - return !isFeatureAvailableToUser || hasTags;
895 - },
896 - renderTools: function renderTools() {
897 - var _this = this;
898 - if (!this.shouldRenderTools()) return;
899 - var $dynamicSwitcher = jQuery(Marionette.Renderer.render("#tmpl-elementor-control-dynamic-switcher"));
900 - $dynamicSwitcher.on("click", function(event) {
901 - return _this.onDynamicSwitcherClick(event);
902 - });
903 - this.$el.find(".elementor-control-dynamic-switcher-wrapper").append($dynamicSwitcher);
904 - this.ui.dynamicSwitcher = $dynamicSwitcher;
905 - if ("color" === this.view.model.get("type")) if (this.view.colorPicker) this.moveDynamicSwitcherToColorPicker();
906 - else setTimeout(function() {
907 - return _this.moveDynamicSwitcherToColorPicker();
908 - });
909 - this.ui.dynamicSwitcher.tipsy({
910 - title: function title() {
911 - return this.getAttribute("data-tooltip");
912 - },
913 - gravity: "s"
914 - });
915 - },
916 - moveDynamicSwitcherToColorPicker: function moveDynamicSwitcherToColorPicker() {
917 - var $colorPickerToolsContainer = this.view.colorPicker.$pickerToolsContainer;
918 - this.ui.dynamicSwitcher.removeClass("elementor-control-unit-1").addClass("e-control-tool");
919 - var $eyedropper = $colorPickerToolsContainer.find(".elementor-control-element-color-picker");
920 - if ($eyedropper.length) this.ui.dynamicSwitcher.insertBefore($eyedropper);
921 - else $colorPickerToolsContainer.append(this.ui.dynamicSwitcher);
922 - },
923 - toggleDynamicClass: function toggleDynamicClass() {
924 - this.$el.toggleClass("elementor-control-dynamic-value", this.isDynamicMode());
925 - },
926 - isDynamicMode: function isDynamicMode() {
927 - var dynamicSettings = this.view.container.settings.get("__dynamic__");
928 - return !!(dynamicSettings && dynamicSettings[this.view.model.get("name")]);
929 - },
930 - createTagsList: function createTagsList() {
931 - var tags = _.groupBy(this.getOption("tags"), "group");
932 - var groups = elementor.dynamicTags.getConfig("groups");
933 - var $tagsList = this.ui.tagsList = jQuery("<div>", { class: "elementor-tags-list" });
934 - var $tagsListInner = jQuery("<div>", { class: "elementor-tags-list__inner" });
935 - $tagsList.append($tagsListInner);
936 - jQuery.each(groups, function(groupName) {
937 - var groupTags = tags[groupName];
938 - if (!groupTags) return;
939 - var group = this;
940 - var $groupTitle = jQuery("<div>", { class: "elementor-tags-list__group-title" }).text(group.title);
941 - $tagsListInner.append($groupTitle);
942 - groupTags.forEach(function(tag) {
943 - var $tag = jQuery("<div>", { class: "elementor-tags-list__item" });
944 - $tag.text(tag.title).attr("data-tag-name", tag.name);
945 - $tagsListInner.append($tag);
946 - });
947 - });
948 - if (!elementor.helpers.hasPro() && Object.keys(tags).length) {
949 - var proTeaser = Marionette.Renderer.render("#tmpl-elementor-dynamic-tags-promo", { promotionUrl: elementor.config.dynamicPromotionURL.replace("%s", this.view.model.get("name")) });
950 - $tagsListInner.append(proTeaser);
951 - }
952 - $tagsListInner.on("click", ".elementor-tags-list__item", this.onTagsListItemClick.bind(this));
953 - elementorCommon.elements.$body.append($tagsList);
954 - },
955 - getTagsList: function getTagsList() {
956 - if (!this.ui.tagsList) this.createTagsList();
957 - return this.ui.tagsList;
958 - },
959 - toggleTagsList: function toggleTagsList() {
960 - var $tagsList = this.getTagsList();
961 - if ($tagsList.is(":visible")) {
962 - $tagsList.hide();
963 - return;
964 - }
965 - var direction = elementorCommon.config.isRTL ? "left" : "right";
966 - $tagsList.show().position({
967 - my: "".concat(direction, " top"),
968 - at: "".concat(direction, " bottom+5"),
969 - of: this.ui.dynamicSwitcher
970 - });
971 - },
972 - setTagView: function setTagView(id, name, settings) {
973 - if (this.tagView) this.tagView.destroy();
974 - var tagView = this.tagView = new TagPanelView({
975 - id,
976 - name,
977 - settings,
978 - controlName: this.view.model.get("name"),
979 - dynamicSettings: this.getOption("dynamicSettings")
980 - });
981 - var elementContainer = this.view.options.container;
982 - var tagViewLabel = elementContainer.controls[tagView.options.controlName].label;
983 - tagView.options.container = new elementorModules.editor.Container({
984 - type: "dynamic",
985 - id,
986 - model: tagView.model,
987 - settings: tagView.model,
988 - view: tagView,
989 - parent: elementContainer,
990 - label: elementContainer.label + " " + tagViewLabel,
991 - controls: tagView.model.options.controls,
992 - renderer: elementContainer
993 - });
994 - tagView.render();
995 - this.$el.find(".elementor-control-tag-area").after(tagView.el);
996 - this.listenTo(tagView, "remove", this.onTagViewRemove.bind(this));
997 - },
998 - setDefaultTagView: function setDefaultTagView() {
999 - var tagData = elementor.dynamicTags.tagTextToTagData(this.getDynamicValue());
1000 - this.setTagView(tagData.id, tagData.name, tagData.settings);
1001 - },
1002 - tagViewToTagText: function tagViewToTagText() {
1003 - var tagView = this.tagView;
1004 - return elementor.dynamicTags.tagDataToTagText(tagView.getOption("id"), tagView.getOption("name"), tagView.model);
1005 - },
1006 - getDynamicValue: function getDynamicValue() {
1007 - return this.view.container.dynamic.get(this.view.model.get("name"));
1008 - },
1009 - destroyTagView: function destroyTagView() {
1010 - if (this.tagView) {
1011 - this.tagView.destroy();
1012 - this.tagView = null;
1013 - }
1014 - },
1015 - showPromotion: function showPromotion() {
1016 - var hasProAndNotConnected = elementor.helpers.hasProAndNotConnected();
1017 - var dialogOptions = {
1018 - title: (0, _wordpress_i18n.__)("Dynamic Content", "elementor"),
1019 - content: (0, _wordpress_i18n.__)("Create more personalized and dynamic sites by populating data from various sources with dozens of dynamic tags to choose from.", "elementor"),
1020 - targetElement: this.ui.dynamicSwitcher,
1021 - position: { blockStart: "-10" },
1022 - actionButton: {
1023 - url: hasProAndNotConnected ? elementorProEditorConfig.urls.connect : elementor.config.dynamicPromotionURL.replace("%s", this.view.model.get("name")),
1024 - text: hasProAndNotConnected ? (0, _wordpress_i18n.__)("Connect & Activate", "elementor") : (0, _wordpress_i18n.__)("Upgrade", "elementor")
1025 - }
1026 - };
1027 - elementor.promotion.showDialog(dialogOptions);
1028 - },
1029 - onRender: function onRender() {
1030 - this.$el.addClass("elementor-control-dynamic");
1031 - this.renderTools();
1032 - this.toggleDynamicClass();
1033 - if (this.isDynamicMode()) this.setDefaultTagView();
1034 - },
1035 - onDynamicSwitcherClick: function onDynamicSwitcherClick(event) {
1036 - event.stopPropagation();
1037 - if (this.getOption("tags").length) this.toggleTagsList();
1038 - else this.showPromotion();
1039 - },
1040 - onTagsListItemClick: function onTagsListItemClick(event) {
1041 - var $tag = jQuery(event.currentTarget);
1042 - this.setTagView(elementorCommon.helpers.getUniqueId(), $tag.data("tagName"), {});
1043 - if (this.view.getGlobalKey()) this.view.triggerMethod("unset:global:value");
1044 - if (this.isDynamicMode()) $e.run("document/dynamic/settings", {
1045 - container: this.view.options.container,
1046 - settings: _defineProperty({}, this.view.model.get("name"), this.tagViewToTagText())
1047 - });
1048 - else $e.run("document/dynamic/enable", {
1049 - container: this.view.options.container,
1050 - settings: _defineProperty({}, this.view.model.get("name"), this.tagViewToTagText())
1051 - });
1052 - this.toggleDynamicClass();
1053 - this.toggleTagsList();
1054 - if (this.tagView.getTagConfig().settings_required) this.tagView.showSettingsPopup();
1055 - },
1056 - onTagViewRemove: function onTagViewRemove() {
1057 - $e.run("document/dynamic/disable", {
1058 - container: this.view.options.container,
1059 - settings: _defineProperty({}, this.view.model.get("name"), this.tagViewToTagText())
1060 - });
1061 - this.toggleDynamicClass();
1062 - },
1063 - onAfterExternalChange: function onAfterExternalChange() {
1064 - this.destroyTagView();
1065 - if (this.isDynamicMode()) this.setDefaultTagView();
1066 - this.toggleDynamicClass();
1067 - },
1068 - onDestroy: function onDestroy() {
1069 - this.destroyTagView();
1070 - if (this.ui.tagsList) this.ui.tagsList.remove();
1071 - }
1072 - });
1073 - }));
576 + // Since the following comparison is <=, allow usage of the 320px value for the mobile breakpoint.
577 + if ('mobile' === validationTerms.breakpointName && 320 === this.bottomBreakpoint) {
578 + this.bottomBreakpoint -= 1;
579 + }
1074 580
1075 -//#endregion
1076 -//#region assets/dev/js/editor/controls/base-data.js
1077 - var require_base_data = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1078 - init_slicedToArray();
1079 - init_defineProperty();
1080 - init_breakpoint();
1081 - function _createForOfIteratorHelper(r, e) {
1082 - var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
1083 - if (!t) {
1084 - if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
1085 - t && (r = t);
1086 - var _n = 0;
1087 - var F = function F() {};
1088 - return {
1089 - s: F,
1090 - n: function n() {
1091 - return _n >= r.length ? { done: !0 } : {
1092 - done: !1,
1093 - value: r[_n++]
1094 - };
1095 - },
1096 - e: function e(r) {
1097 - throw r;
1098 - },
1099 - f: F
1100 - };
1101 - }
1102 - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1103 - }
1104 - var o;
1105 - var a = !0;
1106 - var u = !1;
1107 - return {
1108 - s: function s() {
1109 - t = t.call(r);
1110 - },
1111 - n: function n() {
1112 - var r = t.next();
1113 - return a = r.done, r;
1114 - },
1115 - e: function e(r) {
1116 - u = !0, o = r;
1117 - },
1118 - f: function f() {
1119 - try {
1120 - a || null == t.return || t.return();
1121 - } finally {
1122 - if (u) throw o;
1123 - }
1124 - }
1125 - };
1126 - }
1127 - function _unsupportedIterableToArray(r, a) {
1128 - if (r) {
1129 - if ("string" == typeof r) return _arrayLikeToArray(r, a);
1130 - var t = {}.toString.call(r).slice(8, -1);
1131 - return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
1132 - }
1133 - }
1134 - function _arrayLikeToArray(r, a) {
1135 - (null == a || a > r.length) && (a = r.length);
1136 - for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
1137 - return n;
1138 - }
1139 - var ControlBaseView = require_base();
1140 - var TagsBehavior = require_control_behavior();
1141 - var Validator = require_base$1();
1142 - var NumberValidator = require_number();
1143 - var ControlBaseDataView = ControlBaseView.extend({
1144 - validatorTypes: {
1145 - Base: Validator,
1146 - Number: NumberValidator,
1147 - Breakpoint: BreakpointValidator
1148 - },
1149 - ui: function ui() {
1150 - var ui = ControlBaseView.prototype.ui.apply(this, arguments);
1151 - _.extend(ui, {
1152 - input: "input[data-setting][type!=\"checkbox\"][type!=\"radio\"]",
1153 - checkbox: "input[data-setting][type=\"checkbox\"]",
1154 - radio: "input[data-setting][type=\"radio\"]",
1155 - select: "select[data-setting]",
1156 - textarea: "textarea[data-setting]",
1157 - responsiveSwitchersSibling: "".concat(ui.controlTitle, "[data-e-responsive-switcher-sibling!=\"false\"]"),
1158 - responsiveSwitchers: ".elementor-responsive-switcher",
1159 - contentEditable: "[contenteditable=\"true\"]"
1160 - });
1161 - return ui;
1162 - },
1163 - templateHelpers: function templateHelpers() {
1164 - var controlData = ControlBaseView.prototype.templateHelpers.apply(this, arguments);
1165 - controlData.data.controlValue = this.getControlValue();
1166 - return controlData;
1167 - },
1168 - events: function events() {
1169 - return {
1170 - "input @ui.input": "onBaseInputTextChange",
1171 - "change @ui.checkbox": "onBaseInputChange",
1172 - "change @ui.radio": "onBaseInputChange",
1173 - "input @ui.textarea": "onBaseInputTextChange",
1174 - "change @ui.select": "onBaseInputChange",
1175 - "input @ui.contentEditable": "onBaseInputTextChange",
1176 - "click @ui.responsiveSwitchers": "onResponsiveSwitchersClick"
1177 - };
1178 - },
1179 - behaviors: function behaviors() {
1180 - var behaviors = ControlBaseView.prototype.behaviors.apply(this, arguments);
1181 - var dynamicSettings = this.options.model.get("dynamic");
1182 - if (dynamicSettings && dynamicSettings.active) {
1183 - var tags = _.filter(elementor.dynamicTags.getConfig("tags"), function(tag) {
1184 - return tag.editable && _.intersection(tag.categories, dynamicSettings.categories).length;
1185 - });
1186 - if (tags.length || elementor.config.user.is_administrator) behaviors.tags = {
1187 - behaviorClass: TagsBehavior,
1188 - tags,
1189 - dynamicSettings
1190 - };
1191 - }
1192 - return behaviors;
1193 - },
1194 - initialize: function initialize() {
1195 - ControlBaseView.prototype.initialize.apply(this, arguments);
1196 - this.registerValidators();
1197 - if (this.model.get("responsive")) this.setPlaceholderFromParent();
1198 - if (void 0 === this.model.get("inherit_placeholders")) this.model.set("inherit_placeholders", true);
1199 - var settings = this.container ? this.container.settings : this.elementSettingsModel;
1200 - this.listenTo(settings, "change:external:" + this.model.get("name"), this.onAfterExternalChange);
1201 - },
1202 - getControlValue: function getControlValue() {
1203 - return this.container.settings.get(this.model.get("name"));
1204 - },
1205 - getGlobalKey: function getGlobalKey() {
1206 - return this.container.globals.get(this.model.get("name"));
1207 - },
1208 - getGlobalValue: function getGlobalValue() {
1209 - return this.globalValue;
1210 - },
1211 - getGlobalDefault: function getGlobalDefault() {
1212 - var controlGlobalArgs = this.model.get("global");
1213 - if (controlGlobalArgs !== null && controlGlobalArgs !== void 0 && controlGlobalArgs.default) {
1214 - if (!elementor.config.globals.defaults_enabled[this.getGlobalMeta().controlType]) return "";
1215 - var _$e$data$commandExtra = $e.data.commandExtractArgs(controlGlobalArgs.default);
1216 - var command = _$e$data$commandExtra.command;
1217 - var args = _$e$data$commandExtra.args;
1218 - var result = $e.data.getCache($e.components.get("globals"), command, args.query);
1219 - return result === null || result === void 0 ? void 0 : result.value;
1220 - }
1221 - return "";
1222 - },
1223 - getCurrentValue: function getCurrentValue() {
1224 - if (this.getGlobalKey() && !this.globalValue) return "";
1225 - if (this.globalValue) return this.globalValue;
1226 - var controlValue = this.getControlValue();
1227 - if (controlValue) return controlValue;
1228 - return this.getGlobalDefault();
1229 - },
1230 - isGlobalActive: function isGlobalActive() {
1231 - var _this$options$model$g;
1232 - return (_this$options$model$g = this.options.model.get("global")) === null || _this$options$model$g === void 0 ? void 0 : _this$options$model$g.active;
1233 - },
1234 - setValue: function setValue(value) {
1235 - this.setSettingsModel(value);
1236 - },
1237 - setSettingsModel: function setSettingsModel(value) {
1238 - var key = this.model.get("name");
1239 - $e.run("document/elements/settings", {
1240 - container: this.options.container,
1241 - settings: _defineProperty({}, key, value)
1242 - });
1243 - this.triggerMethod("settings:change");
1244 - },
1245 - applySavedValue: function applySavedValue() {
1246 - this.setInputValue("[data-setting=\"" + this.model.get("name") + "\"]", this.getControlValue());
1247 - },
1248 - getEditSettings: function getEditSettings(setting) {
1249 - var settings = this.getOption("elementEditSettings").toJSON();
1250 - if (setting) return settings[setting];
1251 - return settings;
1252 - },
1253 - setEditSetting: function setEditSetting(settingKey, settingValue) {
1254 - (this.getOption("elementEditSettings") || this.getOption("container").settings).set(settingKey, settingValue);
1255 - },
1256 - /**
1257 - * Get the placeholder for the current control.
1258 - *
1259 - * @return {*} placeholder
1260 - */
1261 - getControlPlaceholder: function getControlPlaceholder() {
1262 - var placeholder = this.model.get("placeholder");
1263 - if (this.model.get("responsive") && this.model.get("inherit_placeholders")) placeholder = placeholder || this.container.placeholders[this.model.get("name")];
1264 - return placeholder;
1265 - },
1266 - /**
1267 - * Get the responsive parent view if exists.
1268 - *
1269 - * @return {ControlBaseDataView|undefined} responsive parent view if exists
1270 - */
1271 - getResponsiveParentView: function getResponsiveParentView() {
1272 - var parent = this.model.get("parent");
1273 - try {
1274 - return parent && this.container.panel.getControlView(parent);
1275 - } catch (e) {}
1276 - },
1277 - /**
1278 - * Get the responsive children views if exists.
1279 - *
1280 - * @return {ControlBaseDataView|null} responsive children views if exists
1281 - */
1282 - getResponsiveChildrenViews: function getResponsiveChildrenViews() {
1283 - var children = this.model.get("inheritors");
1284 - var views = [];
1285 - try {
1286 - var _iterator = _createForOfIteratorHelper(children);
1287 - var _step;
1288 - try {
1289 - for (_iterator.s(); !(_step = _iterator.n()).done;) {
1290 - var child = _step.value;
1291 - views.push(this.container.panel.getControlView(child));
1292 - }
1293 - } catch (err) {
1294 - _iterator.e(err);
1295 - } finally {
1296 - _iterator.f();
1297 - }
1298 - } catch (e) {}
1299 - return views;
1300 - },
1301 - /**
1302 - * Get prepared placeholder from the responsive parent, and put it into current
1303 - * control model as placeholder.
1304 - */
1305 - setPlaceholderFromParent: function setPlaceholderFromParent() {
1306 - var parent = this.getResponsiveParentView();
1307 - if (parent) this.container.placeholders[this.model.get("name")] = parent.preparePlaceholderForChildren();
1308 - },
1309 - /**
1310 - * Returns the value of the current control if exists, or the parent value if not,
1311 - * so responsive children can set it as their placeholder. When there are multiple
1312 - * inputs, the inputs which are empty on this control will inherit their values
1313 - * from the responsive parent.
1314 - * For example, if on desktop the padding of all edges is 10, and on tablet only
1315 - * padding right and left is set to 15, the mobile control placeholder will
1316 - * eventually be: { top: 10, right: 15, left: 15, bottom: 10 }, because of the
1317 - * inheritance of multiple values.
1318 - *
1319 - * @return {*} value of the current control if exists, or the parent value if not
1320 - */
1321 - preparePlaceholderForChildren: function preparePlaceholderForChildren() {
1322 - var _this$getResponsivePa;
1323 - var cleanValue = this.getCleanControlValue();
1324 - var parentValue = (_this$getResponsivePa = this.getResponsiveParentView()) === null || _this$getResponsivePa === void 0 ? void 0 : _this$getResponsivePa.preparePlaceholderForChildren();
1325 - if (cleanValue instanceof Object) return Object.assign({}, parentValue, cleanValue);
1326 - return cleanValue || parentValue;
1327 - },
1328 - /**
1329 - * Start the re-rendering recursive chain from the responsive child of this
1330 - * control. It's useful when the current control value is changed and we want
1331 - * to update all responsive children. In this case, the re-rendering is supposed
1332 - * to be applied only from the responsive child of this control and on.
1333 - */
1334 - propagatePlaceholder: function propagatePlaceholder() {
1335 - var _iterator2 = _createForOfIteratorHelper(this.getResponsiveChildrenViews());
1336 - var _step2;
1337 - try {
1338 - for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) _step2.value.renderWithChildren();
1339 - } catch (err) {
1340 - _iterator2.e(err);
1341 - } finally {
1342 - _iterator2.f();
1343 - }
1344 - },
1345 - /**
1346 - * Re-render current control and trigger this method on the responsive child.
1347 - * The purpose of those actions is to recursively re-render all responsive
1348 - * children.
1349 - */
1350 - renderWithChildren: function renderWithChildren() {
1351 - this.render();
1352 - this.propagatePlaceholder();
1353 - },
1354 - /**
1355 - * Get control value without empty properties, and without default values.
1356 - *
1357 - * @return {{}} control value without empty properties, and without default values
1358 - */
1359 - getCleanControlValue: function getCleanControlValue() {
1360 - var value = this.getControlValue();
1361 - return value && value !== this.model.get("default") ? value : void 0;
1362 - },
1363 - onAfterChange: function onAfterChange(control) {
1364 - if (Object.keys(control.changed).includes(this.model.get("name"))) this.propagatePlaceholder();
1365 - ControlBaseView.prototype.onAfterChange.apply(this, arguments);
1366 - },
1367 - getInputValue: function getInputValue(input) {
1368 - var $input = this.$(input);
1369 - if ($input.is("[contenteditable=\"true\"]")) return $input.html();
1370 - var inputValue = $input.val();
1371 - var inputType = $input.attr("type");
1372 - if (-1 !== ["radio", "checkbox"].indexOf(inputType)) return $input.prop("checked") ? inputValue : "";
1373 - if ("number" === inputType && _.isFinite(inputValue)) return +inputValue;
1374 - if ("SELECT" === input.tagName && $input.prop("multiple") && null === inputValue) inputValue = [];
1375 - return inputValue;
1376 - },
1377 - setInputValue: function setInputValue(input, value) {
1378 - var $input = this.$(input);
1379 - var inputType = $input.attr("type");
1380 - if ("checkbox" === inputType) $input.prop("checked", !!value);
1381 - else if ("radio" === inputType) $input.filter("[value=\"" + value + "\"]").prop("checked", true);
1382 - else $input.val(value);
1383 - },
1384 - addValidator: function addValidator(validator) {
1385 - this.validators.push(validator);
1386 - },
1387 - registerValidators: function registerValidators() {
1388 - var _this = this;
1389 - this.validators = [];
1390 - var validationTerms = {};
1391 - if (this.model.get("required")) validationTerms.required = true;
1392 - if (!jQuery.isEmptyObject(validationTerms)) this.addValidator(new this.validatorTypes.Base({ validationTerms }));
1393 - var validators = this.model.get("validators");
1394 - if (validators) Object.entries(validators).forEach(function(_ref) {
1395 - var _ref2 = _slicedToArray(_ref, 2);
1396 - var key = _ref2[0];
1397 - var args = _ref2[1];
1398 - _this.addValidator(new _this.validatorTypes[key]({ validationTerms: args }));
1399 - });
1400 - },
1401 - onBeforeRender: function onBeforeRender() {
1402 - this.setPlaceholderFromParent();
1403 - },
1404 - onRender: function onRender() {
1405 - ControlBaseView.prototype.onRender.apply(this, arguments);
1406 - if (this.model.get("responsive")) this.renderResponsiveSwitchers();
1407 - this.applySavedValue();
1408 - this.triggerMethod("ready");
1409 - this.toggleControlVisibility();
1410 - this.addTooltip();
1411 - },
1412 - onBaseInputTextChange: function onBaseInputTextChange(event) {
1413 - this.onBaseInputChange(event);
1414 - },
1415 - onBaseInputChange: function onBaseInputChange(event) {
1416 - clearTimeout(this.correctionTimeout);
1417 - var input = event.currentTarget;
1418 - var value = this.getInputValue(input);
1419 - var validators = this.validators.slice(0);
1420 - var settingsValidators = this.container.settings.validators[this.model.get("name")];
1421 - if (settingsValidators) validators = validators.concat(settingsValidators);
1422 - if (validators) {
1423 - var oldValue = this.getControlValue(input.dataset.setting);
1424 - if (!validators.every(function(validator) {
1425 - return validator.isValid(value, oldValue);
1426 - })) {
1427 - this.correctionTimeout = setTimeout(this.setInputValue.bind(this, input, oldValue), 1200);
1428 - return;
1429 - }
1430 - }
1431 - this.updateElementModel(value, input);
1432 - this.triggerMethod("input:change", event);
1433 - },
1434 - onResponsiveSwitchersClick: function onResponsiveSwitchersClick(event) {
1435 - var $switcher = jQuery(event.currentTarget);
1436 - var device = $switcher.data("device");
1437 - var $switchersWrapper = this.ui.responsiveSwitchersWrapper;
1438 - var selectedOption = $switcher.index();
1439 - $switchersWrapper.toggleClass("elementor-responsive-switchers-open");
1440 - $switchersWrapper[0].style.setProperty("--selected-option", selectedOption);
1441 - this.triggerMethod("responsive:switcher:click", device);
1442 - elementor.changeDeviceMode(device);
1443 - },
1444 - renderResponsiveSwitchers: function renderResponsiveSwitchers() {
1445 - var templateHtml = Marionette.Renderer.render("#tmpl-elementor-control-responsive-switchers", this.model.attributes);
1446 - this.ui.responsiveSwitchersSibling.after(templateHtml);
1447 - this.ui.responsiveSwitchersWrapper = this.$el.find(".elementor-control-responsive-switchers");
1448 - },
1449 - onAfterExternalChange: function onAfterExternalChange() {
1450 - this.hideTooltip();
1451 - this.applySavedValue();
1452 - },
1453 - addTooltip: function addTooltip() {
1454 - this.ui.tooltipTargets = this.$el.find(".tooltip-target");
1455 - if (!this.ui.tooltipTargets.length) return;
1456 - this.ui.tooltipTargets.tipsy({
1457 - gravity: function gravity() {
1458 - var gravity = jQuery(this).data("tooltip-pos");
1459 - if (void 0 !== gravity) return gravity;
1460 - return "s";
1461 - },
1462 - title: function title() {
1463 - return this.getAttribute("data-tooltip");
1464 - }
1465 - });
1466 - },
1467 - hideTooltip: function hideTooltip() {
1468 - if (this.ui.tooltipTargets.length) this.ui.tooltipTargets.tipsy("hide");
1469 - },
1470 - updateElementModel: function updateElementModel(value) {
1471 - this.setValue(value);
1472 - }
1473 - }, {
1474 - getStyleValue: function getStyleValue(placeholder, controlValue, controlData) {
1475 - if ("DEFAULT" === placeholder) return controlData.default;
1476 - return controlValue;
1477 - },
1478 - onPasteStyle: function onPasteStyle() {
1479 - return true;
1480 - }
1481 - });
1482 - module.exports = ControlBaseDataView;
1483 - }));
581 + // If there is a breakpoint below the currently edited breakpoint
582 + if (this.bottomBreakpoint) {
583 + // Check that the new value is not under the bottom breakpoint's value.
584 + if ('' !== newValue && newValue <= this.bottomBreakpoint) {
585 + isValid = false;
586 + }
1484 587
1485 -//#endregion
1486 -//#region assets/dev/js/editor/controls/switcher.js
1487 - var require_switcher = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1488 - var ControlBaseDataView = require_base_data();
1489 - module.exports = ControlBaseDataView.extend({ setInputValue: function setInputValue(input, value) {
1490 - this.$(input).prop("checked", this.model.get("return_value") === value);
1491 - } }, { onPasteStyle: function onPasteStyle(control, clipboardValue) {
1492 - return !clipboardValue || clipboardValue === control.return_value;
1493 - } });
1494 - }));
588 + // If the new value is empty, check that the default breakpoint value is not below the bottom breakpoint.
589 + if ('' === newValue && breakpointDefaultValue <= this.bottomBreakpoint) {
590 + isValid = false;
591 + }
592 + }
1495 593
1496 -//#endregion
1497 -//#region modules/styleguide/assets/js/controls/switcher.js
1498 - init_classCallCheck();
1499 - init_createClass();
1500 - init_possibleConstructorReturn();
1501 - init_getPrototypeOf();
1502 - init_inherits();
1503 - var import_switcher = /* @__PURE__ */ __toESM(require_switcher());
1504 - var import_base_data = /* @__PURE__ */ __toESM(require_base_data());
1505 - function _callSuper$2(t, o, e) {
1506 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$2() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
1507 - }
1508 - __name(_callSuper$2, "_callSuper");
1509 - function _isNativeReflectConstruct$2() {
1510 - try {
1511 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
1512 - } catch (t) {}
1513 - return (_isNativeReflectConstruct$2 = function _isNativeReflectConstruct() {
1514 - return !!t;
1515 - })();
1516 - }
1517 - __name(_isNativeReflectConstruct$2, "_isNativeReflectConstruct");
1518 - function _superPropGet(t, o, e, r) {
1519 - var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e);
1520 - return 2 & r && "function" == typeof p ? function(t) {
1521 - return p.apply(e, t);
1522 - } : p;
1523 - }
1524 - var _default$1 = /*#__PURE__*/ function(_Switcher) {
1525 - function _default() {
1526 - _classCallCheck(this, _default);
1527 - return _callSuper$2(this, _default, arguments);
1528 - }
1529 - _inherits(_default, _Switcher);
1530 - return _createClass(_default, [
1531 - {
1532 - key: "initialize",
1533 - value: function initialize() {
1534 - import_base_data.default.prototype.initialize.apply(this, arguments);
1535 - this.$el.addClass("elementor-control-type-switcher");
1536 - }
1537 - },
1538 - {
1539 - key: "onBeforeRender",
1540 - value: function onBeforeRender() {
1541 - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
1542 - _superPropGet(_default, "onBeforeRender", this, 3)(args);
1543 - var actualValue = elementor.getPreferences("enable_styleguide_preview");
1544 - if (actualValue !== this.getCurrentValue()) this.setValue(actualValue);
1545 - }
1546 - },
1547 - {
1548 - key: "onBaseInputChange",
1549 - value: function onBaseInputChange(event) {
1550 - import_base_data.default.prototype.onBaseInputChange.apply(this, arguments);
1551 - var input = event.currentTarget;
1552 - var value = this.getInputValue(input);
1553 - if (this.model.get("on_change_command")) this.runCommand(value);
1554 - this.model.set("return_value", null);
1555 - }
1556 - },
1557 - {
1558 - key: "runCommand",
1559 - value: function runCommand(value) {
1560 - $e.run("preview/styleguide/switcher-change", {
1561 - name: this.model.get("name"),
1562 - value
1563 - });
1564 - }
1565 - }
1566 - ]);
1567 - }(import_switcher.default);
594 + // If there is a breakpoint above the currently edited breakpoint.
595 + if (this.topBreakpoint) {
596 + // Check that the value is not above the top breakpoint's value.
597 + if ('' !== newValue && newValue >= this.topBreakpoint) {
598 + isValid = false;
599 + }
1568 600
1569 -//#endregion
1570 -//#region modules/styleguide/assets/js/e-component.js
1571 - init_classCallCheck();
1572 - init_createClass();
1573 - init_possibleConstructorReturn();
1574 - init_getPrototypeOf();
1575 - init_inherits();
1576 - function _callSuper$1(t, o, e) {
1577 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$1() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
1578 - }
1579 - __name(_callSuper$1, "_callSuper");
1580 - function _isNativeReflectConstruct$1() {
1581 - try {
1582 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
1583 - } catch (t) {}
1584 - return (_isNativeReflectConstruct$1 = function _isNativeReflectConstruct() {
1585 - return !!t;
1586 - })();
1587 - }
1588 - __name(_isNativeReflectConstruct$1, "_isNativeReflectConstruct");
1589 - var _default = /*#__PURE__*/ function(_$e$modules$Component) {
1590 - function _default(args) {
1591 - var _this;
1592 - _classCallCheck(this, _default);
1593 - _this = _callSuper$1(this, _default, [args]);
1594 - elementor.addControlView("global-style-switcher", _default$1);
1595 - _this.registerStyleguideDialogType();
1596 - elementor.once("preview:loaded", function() {
1597 - _this.initModal();
1598 - });
1599 - return _this;
1600 - }
1601 - _inherits(_default, _$e$modules$Component);
1602 - return _createClass(_default, [
1603 - {
1604 - key: "getNamespace",
1605 - value: function getNamespace() {
1606 - return "preview/styleguide";
1607 - }
1608 - },
1609 - {
1610 - key: "defaultCommands",
1611 - value: function defaultCommands() {
1612 - return this.importCommands(commands_exports);
1613 - }
1614 - },
1615 - {
1616 - key: "registerStyleguideDialogType",
1617 - value: function registerStyleguideDialogType() {
1618 - DialogsManager.addWidgetType("styleguide", DialogsManager.getWidgetType("lightbox").extend("alert", { buildWidget: function buildWidget() {
1619 - DialogsManager.getWidgetType("lightbox").prototype.buildWidget.apply(this, arguments);
1620 - var $widgetContent = this.addElement("widgetContent");
1621 - var elements = this.getElements();
1622 - $widgetContent.append(elements.message);
1623 - elements.widget.html($widgetContent);
1624 - } }));
1625 - }
1626 - },
1627 - {
1628 - key: "initModal",
1629 - value: function initModal() {
1630 - var modal;
1631 - this.getModal = function() {
1632 - if (modal) return modal;
1633 - modal = elementorCommon.dialogsManager.createWidget("styleguide", {
1634 - id: "e-styleguide-preview-dialog",
1635 - message: "<div class=\"e-styleguide-preview-root\"></div>",
1636 - position: {
1637 - my: "center center",
1638 - at: "center center"
1639 - },
1640 - hide: {
1641 - onOutsideClick: false,
1642 - onEscKeyPress: false,
1643 - onClick: false,
1644 - onBackgroundClick: false
1645 - },
1646 - container: elementor.$previewContents.find("body")
1647 - });
1648 - return modal;
1649 - };
1650 - }
1651 - },
1652 - {
1653 - key: "showStyleguidePreview",
1654 - value: function showStyleguidePreview() {
1655 - var skipPreferencesCheck = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
1656 - if (this.getModal().isVisible() || !skipPreferencesCheck && !elementor.getPreferences("enable_styleguide_preview")) return;
1657 - this.getPreviewFrame().postMessage({ name: "elementor/styleguide/preview/show" }, "*");
1658 - this.getModal().show();
1659 - }
1660 - },
1661 - {
1662 - key: "hideStyleguidePreview",
1663 - value: function hideStyleguidePreview() {
1664 - this.getPreviewFrame().postMessage({ name: "elementor/styleguide/preview/hide" }, "*");
1665 - this.getModal().hide();
1666 - }
1667 - },
1668 - {
1669 - key: "enableStyleguidePreview",
1670 - value: function enableStyleguidePreview(options) {
1671 - if (options.value) this.showStyleguidePreview(true);
1672 - else this.hideStyleguidePreview();
1673 - $e.run("document/elements/settings", {
1674 - container: elementor.settings.editorPreferences.getEditedView().getContainer(),
1675 - settings: { enable_styleguide_preview: options.value },
1676 - options: { external: true }
1677 - });
1678 - }
1679 - },
1680 - {
1681 - key: "isInEditor",
1682 - value: function isInEditor() {
1683 - return !!window.elementor;
1684 - }
1685 - },
1686 - {
1687 - key: "getPreviewFrame",
1688 - value: function getPreviewFrame() {
1689 - return this.isInEditor() ? elementor.$preview[0].contentWindow : window;
1690 - }
1691 - }
1692 - ]);
1693 - }($e.modules.ComponentBase);
601 + // If the new value is empty, check that the default breakpoint value is not above the top breakpoint.
602 + if ('' === newValue && breakpointDefaultValue >= this.topBreakpoint) {
603 + isValid = false;
604 + }
605 + }
606 + return isValid;
607 + }
608 + }]);
609 +}(NumberValidator);
1694 610
1695 -//#endregion
1696 -//#region modules/styleguide/assets/js/styleguide.js
1697 - init_classCallCheck();
1698 - init_createClass();
1699 - init_possibleConstructorReturn();
1700 - init_getPrototypeOf();
1701 - init_inherits();
1702 - function _callSuper(t, o, e) {
1703 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
1704 - }
1705 - function _isNativeReflectConstruct() {
1706 - try {
1707 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
1708 - } catch (t) {}
1709 - return (_isNativeReflectConstruct = function _isNativeReflectConstruct() {
1710 - return !!t;
1711 - })();
1712 - }
1713 - new (/* @__PURE__ */ function(_elementorModules$edi) {
1714 - function Styleguide() {
1715 - _classCallCheck(this, Styleguide);
1716 - return _callSuper(this, Styleguide, arguments);
1717 - }
1718 - _inherits(Styleguide, _elementorModules$edi);
1719 - return _createClass(Styleguide, [
1720 - {
1721 - key: "onInit",
1722 - value: function onInit() {
1723 - $e.components.register(new _default());
1724 - this.addHooks();
1725 - }
1726 - },
1727 - {
1728 - key: "getGlobalRoutes",
1729 - value: function getGlobalRoutes() {
1730 - return {
1731 - "global-colors": "panel/global/global-colors",
1732 - "global-typography": "panel/global/global-typography"
1733 - };
1734 - }
1735 - },
1736 - {
1737 - key: "addHooks",
1738 - value: function addHooks() {
1739 - elementor.hooks.addAction("panel/global/tab/before-show", this.show.bind(this));
1740 - elementor.hooks.addAction("panel/global/tab/before-destroy", this.hide.bind(this));
1741 - }
1742 - },
1743 - {
1744 - key: "show",
1745 - value: function show(args) {
1746 - if (!args.id || !(args.id in this.getGlobalRoutes())) return;
1747 - $e.run("preview/styleguide/".concat(args.id));
1748 - }
1749 - },
1750 - {
1751 - key: "hide",
1752 - value: function hide(args) {
1753 - if (!args.id || !(args.id in this.getGlobalRoutes())) return;
1754 - if (Object.values(this.getGlobalRoutes()).some(function(route) {
1755 - return $e.routes.current.panel === route;
1756 - })) return;
1757 - $e.run("preview/styleguide/hide");
1758 - }
1759 - }
1760 - ]);
1761 - }(elementorModules.editor.utils.Module))();
611 +/***/ }),
1762 612
1763 -//#endregion
1764 -})(wp.i18n);
613 +/***/ "../assets/dev/js/editor/components/validator/number.js":
614 +/*!**************************************************************!*\
615 + !*** ../assets/dev/js/editor/components/validator/number.js ***!
616 + \**************************************************************/
617 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
618 +
619 +"use strict";
620 +
621 +
622 +var Validator = __webpack_require__(/*! elementor-validator/base */ "../assets/dev/js/editor/components/validator/base.js");
623 +module.exports = Validator.extend({
624 + validationMethod: function validationMethod(newValue) {
625 + var validationTerms = this.getSettings('validationTerms'),
626 + errors = [];
627 + if (_.isFinite(newValue)) {
628 + if (undefined !== validationTerms.min && newValue < validationTerms.min) {
629 + errors.push('Value is less than minimum');
630 + }
631 + if (undefined !== validationTerms.max && newValue > validationTerms.max) {
632 + errors.push('Value is greater than maximum');
633 + }
634 + }
635 + return errors;
636 + }
637 +});
638 +
639 +/***/ }),
640 +
641 +/***/ "../assets/dev/js/editor/controls/base-data.js":
642 +/*!*****************************************************!*\
643 + !*** ../assets/dev/js/editor/controls/base-data.js ***!
644 + \*****************************************************/
645 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
646 +
647 +"use strict";
648 +
649 +
650 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
651 +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
652 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
653 +var _breakpoint = _interopRequireDefault(__webpack_require__(/*! elementor-validator/breakpoint */ "../assets/dev/js/editor/components/validator/breakpoint.js"));
654 +function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
655 +function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
656 +function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
657 +var ControlBaseView = __webpack_require__(/*! elementor-controls/base */ "../assets/dev/js/editor/controls/base.js"),
658 + TagsBehavior = __webpack_require__(/*! elementor-dynamic-tags/control-behavior */ "../assets/dev/js/editor/components/dynamic-tags/control-behavior.js"),
659 + Validator = __webpack_require__(/*! elementor-validator/base */ "../assets/dev/js/editor/components/validator/base.js"),
660 + NumberValidator = __webpack_require__(/*! elementor-validator/number */ "../assets/dev/js/editor/components/validator/number.js"),
661 + ControlBaseDataView;
662 +ControlBaseDataView = ControlBaseView.extend({
663 + validatorTypes: {
664 + Base: Validator,
665 + Number: NumberValidator,
666 + Breakpoint: _breakpoint.default
667 + },
668 + ui: function ui() {
669 + var ui = ControlBaseView.prototype.ui.apply(this, arguments);
670 + _.extend(ui, {
671 + input: 'input[data-setting][type!="checkbox"][type!="radio"]',
672 + checkbox: 'input[data-setting][type="checkbox"]',
673 + radio: 'input[data-setting][type="radio"]',
674 + select: 'select[data-setting]',
675 + textarea: 'textarea[data-setting]',
676 + responsiveSwitchersSibling: "".concat(ui.controlTitle, "[data-e-responsive-switcher-sibling!=\"false\"]"),
677 + responsiveSwitchers: '.elementor-responsive-switcher',
678 + contentEditable: '[contenteditable="true"]'
679 + });
680 + return ui;
681 + },
682 + templateHelpers: function templateHelpers() {
683 + var controlData = ControlBaseView.prototype.templateHelpers.apply(this, arguments);
684 + controlData.data.controlValue = this.getControlValue();
685 + return controlData;
686 + },
687 + events: function events() {
688 + return {
689 + 'input @ui.input': 'onBaseInputTextChange',
690 + 'change @ui.checkbox': 'onBaseInputChange',
691 + 'change @ui.radio': 'onBaseInputChange',
692 + 'input @ui.textarea': 'onBaseInputTextChange',
693 + 'change @ui.select': 'onBaseInputChange',
694 + 'input @ui.contentEditable': 'onBaseInputTextChange',
695 + 'click @ui.responsiveSwitchers': 'onResponsiveSwitchersClick'
696 + };
697 + },
698 + behaviors: function behaviors() {
699 + var behaviors = ControlBaseView.prototype.behaviors.apply(this, arguments),
700 + dynamicSettings = this.options.model.get('dynamic');
701 + if (dynamicSettings && dynamicSettings.active) {
702 + var tags = _.filter(elementor.dynamicTags.getConfig('tags'), function (tag) {
703 + return tag.editable && _.intersection(tag.categories, dynamicSettings.categories).length;
704 + });
705 + if (tags.length || elementor.config.user.is_administrator) {
706 + behaviors.tags = {
707 + behaviorClass: TagsBehavior,
708 + tags: tags,
709 + dynamicSettings: dynamicSettings
710 + };
711 + }
712 + }
713 + return behaviors;
714 + },
715 + initialize: function initialize() {
716 + ControlBaseView.prototype.initialize.apply(this, arguments);
717 + this.registerValidators();
718 + if (this.model.get('responsive')) {
719 + this.setPlaceholderFromParent();
720 + }
721 + if (undefined === this.model.get('inherit_placeholders')) {
722 + this.model.set('inherit_placeholders', true);
723 + }
724 +
725 + // TODO: this.elementSettingsModel is deprecated since 2.8.0.
726 + var settings = this.container ? this.container.settings : this.elementSettingsModel;
727 + this.listenTo(settings, 'change:external:' + this.model.get('name'), this.onAfterExternalChange);
728 + },
729 + getControlValue: function getControlValue() {
730 + return this.container.settings.get(this.model.get('name'));
731 + },
732 + getGlobalKey: function getGlobalKey() {
733 + return this.container.globals.get(this.model.get('name'));
734 + },
735 + getGlobalValue: function getGlobalValue() {
736 + return this.globalValue;
737 + },
738 + getGlobalDefault: function getGlobalDefault() {
739 + var controlGlobalArgs = this.model.get('global');
740 + if (controlGlobalArgs !== null && controlGlobalArgs !== void 0 && controlGlobalArgs.default) {
741 + // If the control is a color/typography control and default colors/typography are disabled, don't return the global value.
742 + if (!elementor.config.globals.defaults_enabled[this.getGlobalMeta().controlType]) {
743 + return '';
744 + }
745 + var _$e$data$commandExtra = $e.data.commandExtractArgs(controlGlobalArgs.default),
746 + command = _$e$data$commandExtra.command,
747 + args = _$e$data$commandExtra.args,
748 + result = $e.data.getCache($e.components.get('globals'), command, args.query);
749 + return result === null || result === void 0 ? void 0 : result.value;
750 + }
751 +
752 + // No global default.
753 + return '';
754 + },
755 + getCurrentValue: function getCurrentValue() {
756 + if (this.getGlobalKey() && !this.globalValue) {
757 + return '';
758 + }
759 + if (this.globalValue) {
760 + return this.globalValue;
761 + }
762 + var controlValue = this.getControlValue();
763 + if (controlValue) {
764 + return controlValue;
765 + }
766 + return this.getGlobalDefault();
767 + },
768 + isGlobalActive: function isGlobalActive() {
769 + var _this$options$model$g;
770 + return (_this$options$model$g = this.options.model.get('global')) === null || _this$options$model$g === void 0 ? void 0 : _this$options$model$g.active;
771 + },
772 + setValue: function setValue(value) {
773 + this.setSettingsModel(value);
774 + },
775 + setSettingsModel: function setSettingsModel(value) {
776 + var key = this.model.get('name');
777 + $e.run('document/elements/settings', {
778 + container: this.options.container,
779 + settings: (0, _defineProperty2.default)({}, key, value)
780 + });
781 + this.triggerMethod('settings:change');
782 + },
783 + applySavedValue: function applySavedValue() {
784 + this.setInputValue('[data-setting="' + this.model.get('name') + '"]', this.getControlValue());
785 + },
786 + getEditSettings: function getEditSettings(setting) {
787 + var settings = this.getOption('elementEditSettings').toJSON();
788 + if (setting) {
789 + return settings[setting];
790 + }
791 + return settings;
792 + },
793 + setEditSetting: function setEditSetting(settingKey, settingValue) {
794 + var settings = this.getOption('elementEditSettings') || this.getOption('container').settings;
795 + settings.set(settingKey, settingValue);
796 + },
797 + /**
798 + * Get the placeholder for the current control.
799 + *
800 + * @return {*} placeholder
801 + */
802 + getControlPlaceholder: function getControlPlaceholder() {
803 + var placeholder = this.model.get('placeholder');
804 + if (this.model.get('responsive') && this.model.get('inherit_placeholders')) {
805 + placeholder = placeholder || this.container.placeholders[this.model.get('name')];
806 + }
807 + return placeholder;
808 + },
809 + /**
810 + * Get the responsive parent view if exists.
811 + *
812 + * @return {ControlBaseDataView|undefined} responsive parent view if exists
813 + */
814 + getResponsiveParentView: function getResponsiveParentView() {
815 + var parent = this.model.get('parent');
816 + try {
817 + return parent && this.container.panel.getControlView(parent);
818 + // eslint-disable-next-line no-empty
819 + } catch (e) {}
820 + },
821 + /**
822 + * Get the responsive children views if exists.
823 + *
824 + * @return {ControlBaseDataView|null} responsive children views if exists
825 + */
826 + getResponsiveChildrenViews: function getResponsiveChildrenViews() {
827 + var children = this.model.get('inheritors'),
828 + views = [];
829 + try {
830 + var _iterator = _createForOfIteratorHelper(children),
831 + _step;
832 + try {
833 + for (_iterator.s(); !(_step = _iterator.n()).done;) {
834 + var child = _step.value;
835 + views.push(this.container.panel.getControlView(child));
836 + }
837 + // eslint-disable-next-line no-empty
838 + } catch (err) {
839 + _iterator.e(err);
840 + } finally {
841 + _iterator.f();
842 + }
843 + } catch (e) {}
844 + return views;
845 + },
846 + /**
847 + * Get prepared placeholder from the responsive parent, and put it into current
848 + * control model as placeholder.
849 + */
850 + setPlaceholderFromParent: function setPlaceholderFromParent() {
851 + var parent = this.getResponsiveParentView();
852 + if (parent) {
853 + this.container.placeholders[this.model.get('name')] = parent.preparePlaceholderForChildren();
854 + }
855 + },
856 + /**
857 + * Returns the value of the current control if exists, or the parent value if not,
858 + * so responsive children can set it as their placeholder. When there are multiple
859 + * inputs, the inputs which are empty on this control will inherit their values
860 + * from the responsive parent.
861 + * For example, if on desktop the padding of all edges is 10, and on tablet only
862 + * padding right and left is set to 15, the mobile control placeholder will
863 + * eventually be: { top: 10, right: 15, left: 15, bottom: 10 }, because of the
864 + * inheritance of multiple values.
865 + *
866 + * @return {*} value of the current control if exists, or the parent value if not
867 + */
868 + preparePlaceholderForChildren: function preparePlaceholderForChildren() {
869 + var _this$getResponsivePa;
870 + var cleanValue = this.getCleanControlValue(),
871 + parentValue = (_this$getResponsivePa = this.getResponsiveParentView()) === null || _this$getResponsivePa === void 0 ? void 0 : _this$getResponsivePa.preparePlaceholderForChildren();
872 + if (cleanValue instanceof Object) {
873 + return Object.assign({}, parentValue, cleanValue);
874 + }
875 + return cleanValue || parentValue;
876 + },
877 + /**
878 + * Start the re-rendering recursive chain from the responsive child of this
879 + * control. It's useful when the current control value is changed and we want
880 + * to update all responsive children. In this case, the re-rendering is supposed
881 + * to be applied only from the responsive child of this control and on.
882 + */
883 + propagatePlaceholder: function propagatePlaceholder() {
884 + var children = this.getResponsiveChildrenViews();
885 + var _iterator2 = _createForOfIteratorHelper(children),
886 + _step2;
887 + try {
888 + for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
889 + var child = _step2.value;
890 + child.renderWithChildren();
891 + }
892 + } catch (err) {
893 + _iterator2.e(err);
894 + } finally {
895 + _iterator2.f();
896 + }
897 + },
898 + /**
899 + * Re-render current control and trigger this method on the responsive child.
900 + * The purpose of those actions is to recursively re-render all responsive
901 + * children.
902 + */
903 + renderWithChildren: function renderWithChildren() {
904 + this.render();
905 + this.propagatePlaceholder();
906 + },
907 + /**
908 + * Get control value without empty properties, and without default values.
909 + *
910 + * @return {{}} control value without empty properties, and without default values
911 + */
912 + getCleanControlValue: function getCleanControlValue() {
913 + var value = this.getControlValue();
914 + return value && value !== this.model.get('default') ? value : undefined;
915 + },
916 + onAfterChange: function onAfterChange(control) {
917 + if (Object.keys(control.changed).includes(this.model.get('name'))) {
918 + this.propagatePlaceholder();
919 + }
920 + ControlBaseView.prototype.onAfterChange.apply(this, arguments);
921 + },
922 + getInputValue: function getInputValue(input) {
923 + var $input = this.$(input);
924 + if ($input.is('[contenteditable="true"]')) {
925 + return $input.html();
926 + }
927 + var inputValue = $input.val(),
928 + inputType = $input.attr('type');
929 + if (-1 !== ['radio', 'checkbox'].indexOf(inputType)) {
930 + return $input.prop('checked') ? inputValue : '';
931 + }
932 + if ('number' === inputType && _.isFinite(inputValue)) {
933 + return +inputValue;
934 + }
935 +
936 + // Temp fix for jQuery (< 3.0) that return null instead of empty array
937 + if ('SELECT' === input.tagName && $input.prop('multiple') && null === inputValue) {
938 + inputValue = [];
939 + }
940 + return inputValue;
941 + },
942 + setInputValue: function setInputValue(input, value) {
943 + var $input = this.$(input),
944 + inputType = $input.attr('type');
945 + if ('checkbox' === inputType) {
946 + $input.prop('checked', !!value);
947 + } else if ('radio' === inputType) {
948 + $input.filter('[value="' + value + '"]').prop('checked', true);
949 + } else {
950 + $input.val(value);
951 + }
952 + },
953 + addValidator: function addValidator(validator) {
954 + this.validators.push(validator);
955 + },
956 + registerValidators: function registerValidators() {
957 + var _this = this;
958 + this.validators = [];
959 + var validationTerms = {};
960 + if (this.model.get('required')) {
961 + validationTerms.required = true;
962 + }
963 + if (!jQuery.isEmptyObject(validationTerms)) {
964 + this.addValidator(new this.validatorTypes.Base({
965 + validationTerms: validationTerms
966 + }));
967 + }
968 + var validators = this.model.get('validators');
969 + if (validators) {
970 + Object.entries(validators).forEach(function (_ref) {
971 + var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
972 + key = _ref2[0],
973 + args = _ref2[1];
974 + _this.addValidator(new _this.validatorTypes[key]({
975 + validationTerms: args
976 + }));
977 + });
978 + }
979 + },
980 + onBeforeRender: function onBeforeRender() {
981 + this.setPlaceholderFromParent();
982 + },
983 + onRender: function onRender() {
984 + ControlBaseView.prototype.onRender.apply(this, arguments);
985 + if (this.model.get('responsive')) {
986 + this.renderResponsiveSwitchers();
987 + }
988 + this.applySavedValue();
989 + this.triggerMethod('ready');
990 + this.toggleControlVisibility();
991 + this.addTooltip();
992 + },
993 + onBaseInputTextChange: function onBaseInputTextChange(event) {
994 + this.onBaseInputChange(event);
995 + },
996 + onBaseInputChange: function onBaseInputChange(event) {
997 + clearTimeout(this.correctionTimeout);
998 + var input = event.currentTarget,
999 + value = this.getInputValue(input),
1000 + validators = this.validators.slice(0),
1001 + settingsValidators = this.container.settings.validators[this.model.get('name')];
1002 + if (settingsValidators) {
1003 + validators = validators.concat(settingsValidators);
1004 + }
1005 + if (validators) {
1006 + var oldValue = this.getControlValue(input.dataset.setting);
1007 + var isValidValue = validators.every(function (validator) {
1008 + return validator.isValid(value, oldValue);
1009 + });
1010 + if (!isValidValue) {
1011 + this.correctionTimeout = setTimeout(this.setInputValue.bind(this, input, oldValue), 1200);
1012 + return;
1013 + }
1014 + }
1015 + this.updateElementModel(value, input);
1016 + this.triggerMethod('input:change', event);
1017 + },
1018 + onResponsiveSwitchersClick: function onResponsiveSwitchersClick(event) {
1019 + var $switcher = jQuery(event.currentTarget),
1020 + device = $switcher.data('device'),
1021 + $switchersWrapper = this.ui.responsiveSwitchersWrapper,
1022 + selectedOption = $switcher.index();
1023 + $switchersWrapper.toggleClass('elementor-responsive-switchers-open');
1024 + $switchersWrapper[0].style.setProperty('--selected-option', selectedOption);
1025 + this.triggerMethod('responsive:switcher:click', device);
1026 + elementor.changeDeviceMode(device);
1027 + },
1028 + renderResponsiveSwitchers: function renderResponsiveSwitchers() {
1029 + var templateHtml = Marionette.Renderer.render('#tmpl-elementor-control-responsive-switchers', this.model.attributes);
1030 + this.ui.responsiveSwitchersSibling.after(templateHtml);
1031 + this.ui.responsiveSwitchersWrapper = this.$el.find('.elementor-control-responsive-switchers');
1032 + },
1033 + onAfterExternalChange: function onAfterExternalChange() {
1034 + this.hideTooltip();
1035 + this.applySavedValue();
1036 + },
1037 + addTooltip: function addTooltip() {
1038 + this.ui.tooltipTargets = this.$el.find('.tooltip-target');
1039 + if (!this.ui.tooltipTargets.length) {
1040 + return;
1041 + }
1042 +
1043 + // Create tooltip on controls
1044 + this.ui.tooltipTargets.tipsy({
1045 + gravity: function gravity() {
1046 + // `n` for down, `s` for up
1047 + var gravity = jQuery(this).data('tooltip-pos');
1048 + if (undefined !== gravity) {
1049 + return gravity;
1050 + }
1051 + return 's';
1052 + },
1053 + title: function title() {
1054 + return this.getAttribute('data-tooltip');
1055 + }
1056 + });
1057 + },
1058 + hideTooltip: function hideTooltip() {
1059 + if (this.ui.tooltipTargets.length) {
1060 + this.ui.tooltipTargets.tipsy('hide');
1061 + }
1062 + },
1063 + updateElementModel: function updateElementModel(value) {
1064 + this.setValue(value);
1065 + }
1066 +}, {
1067 + // Static methods
1068 + getStyleValue: function getStyleValue(placeholder, controlValue, controlData) {
1069 + if ('DEFAULT' === placeholder) {
1070 + return controlData.default;
1071 + }
1072 + return controlValue;
1073 + },
1074 + onPasteStyle: function onPasteStyle() {
1075 + return true;
1076 + }
1077 +});
1078 +module.exports = ControlBaseDataView;
1079 +
1080 +/***/ }),
1081 +
1082 +/***/ "../assets/dev/js/editor/controls/base.js":
1083 +/*!************************************************!*\
1084 + !*** ../assets/dev/js/editor/controls/base.js ***!
1085 + \************************************************/
1086 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1087 +
1088 +"use strict";
1089 +
1090 +
1091 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1092 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
1093 +function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
1094 +function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
1095 +var ControlBaseView;
1096 +ControlBaseView = Marionette.CompositeView.extend({
1097 + ui: function ui() {
1098 + return {
1099 + controlTitle: '.elementor-control-title'
1100 + };
1101 + },
1102 + behaviors: function behaviors() {
1103 + var behaviors = {};
1104 + return elementor.hooks.applyFilters('controls/base/behaviors', behaviors, this);
1105 + },
1106 + getBehavior: function getBehavior(name) {
1107 + return this._behaviors[Object.keys(this.behaviors()).indexOf(name)];
1108 + },
1109 + className: function className() {
1110 + // TODO: Any better classes for that?
1111 + var classes = 'elementor-control elementor-control-' + this.model.get('name') + ' elementor-control-type-' + this.model.get('type'),
1112 + modelClasses = this.model.get('classes'),
1113 + responsive = this.model.get('responsive');
1114 + if (!_.isEmpty(modelClasses)) {
1115 + classes += ' ' + modelClasses;
1116 + }
1117 + if (!_.isEmpty(responsive)) {
1118 + var responsiveControlName = responsive.max || responsive.min;
1119 + classes += ' elementor-control-responsive-' + responsiveControlName;
1120 + }
1121 + return classes;
1122 + },
1123 + templateHelpers: function templateHelpers() {
1124 + var controlData = {
1125 + _cid: this.model.cid
1126 + };
1127 + return {
1128 + view: this,
1129 + data: _.extend({}, this.model.toJSON(), controlData)
1130 + };
1131 + },
1132 + getTemplate: function getTemplate() {
1133 + return Marionette.TemplateCache.get('#tmpl-elementor-control-' + this.model.get('type') + '-content');
1134 + },
1135 + initialize: function initialize(options) {
1136 + var label = this.model.get('label');
1137 +
1138 + // TODO: Temp backwards compatibility. since 2.8.0.
1139 + Object.defineProperty(this, 'container', {
1140 + get: function get() {
1141 + if (!options.container) {
1142 + var settingsModel = options.elementSettingsModel,
1143 + view = $e.components.get('document').utils.findViewById(settingsModel.id);
1144 +
1145 + // Element control.
1146 + if (view && view.getContainer) {
1147 + options.container = view.getContainer();
1148 + } else {
1149 + if (!settingsModel.id) {
1150 + settingsModel.id = 'bc-' + elementorCommon.helpers.getUniqueId();
1151 + }
1152 +
1153 + // Document/General/Other control.
1154 + options.container = new elementorModules.editor.Container({
1155 + type: 'bc-container',
1156 + id: settingsModel.id,
1157 + model: settingsModel,
1158 + settings: settingsModel,
1159 + label: label,
1160 + view: false,
1161 + parent: false,
1162 + renderer: false,
1163 + controls: settingsModel.options.controls
1164 + });
1165 + }
1166 + }
1167 + return options.container;
1168 + }
1169 + });
1170 +
1171 + // Use `defineProperty` because `get elementSettingsModel()` fails during the `Marionette.CompositeView.extend`.
1172 + Object.defineProperty(this, 'elementSettingsModel', {
1173 + get: function get() {
1174 + elementorDevTools.deprecation.deprecated('elementSettingsModel', '2.8.0', 'container.settings');
1175 + return options.container ? options.container.settings : options.elementSettingsModel;
1176 + }
1177 + });
1178 + var controlType = this.model.get('type'),
1179 + controlSettings = jQuery.extend(true, {}, elementor.config.controls[controlType], this.model.attributes);
1180 + this.model.set(controlSettings);
1181 +
1182 + // TODO: this.elementSettingsModel is deprecated since 2.8.0.
1183 + var settings = this.container ? this.container.settings : this.elementSettingsModel;
1184 + this.listenTo(settings, 'change', this.onAfterChange);
1185 + if (this.model.attributes.responsive) {
1186 + this.onDeviceModeChange = this.onDeviceModeChange.bind(this);
1187 + elementor.listenTo(elementor.channels.deviceMode, 'change', this.onDeviceModeChange);
1188 + }
1189 + },
1190 + onDestroy: function onDestroy() {
1191 + elementor.stopListening(elementor.channels.deviceMode, 'change', this.onDeviceModeChange);
1192 + },
1193 + onDeviceModeChange: function onDeviceModeChange() {
1194 + this.toggleControlVisibility();
1195 + },
1196 + onAfterChange: function onAfterChange() {
1197 + this.toggleControlVisibility();
1198 + },
1199 + toggleControlVisibility: function toggleControlVisibility() {
1200 + // TODO: this.elementSettingsModel is deprecated since 2.8.0.
1201 + var settings = this.container ? this.container.settings : this.elementSettingsModel;
1202 + var isVisible = elementor.helpers.isActiveControl(this.model, settings.attributes, settings.controls);
1203 + this.$el.toggleClass('elementor-hidden-control', !isVisible);
1204 + elementor.getPanelView().updateScrollbar();
1205 + },
1206 + onRender: function onRender() {
1207 + var layoutType = this.model.get('label_block') ? 'block' : 'inline',
1208 + showLabel = this.model.get('show_label'),
1209 + elClasses = 'elementor-label-' + layoutType;
1210 + elClasses += ' elementor-control-separator-' + this.model.get('separator');
1211 + if (!showLabel) {
1212 + elClasses += ' elementor-control-hidden-label';
1213 + }
1214 + this.$el.addClass(elClasses);
1215 + this.toggleControlVisibility();
1216 + },
1217 + reRoute: function reRoute(controlActive) {
1218 + $e.route($e.routes.getCurrent('panel'), this.getControlInRouteArgs(controlActive ? this.getControlPath() : ''), {
1219 + history: false
1220 + });
1221 + },
1222 + getControlInRouteArgs: function getControlInRouteArgs(path) {
1223 + return _objectSpread(_objectSpread({}, $e.routes.getCurrentArgs('panel')), {}, {
1224 + activeControl: path
1225 + });
1226 + },
1227 + getControlPath: function getControlPath() {
1228 + var controlPath = this.model.get('name'),
1229 + parent = this._parent;
1230 + while (!parent.$el.hasClass('elementor-controls-stack')) {
1231 + var parentName = parent.model.get('name') || parent.model.get('_id');
1232 + controlPath = parentName + '/' + controlPath;
1233 + parent = parent._parent;
1234 + }
1235 + return controlPath;
1236 + }
1237 +});
1238 +module.exports = ControlBaseView;
1239 +
1240 +/***/ }),
1241 +
1242 +/***/ "../assets/dev/js/editor/controls/switcher.js":
1243 +/*!****************************************************!*\
1244 + !*** ../assets/dev/js/editor/controls/switcher.js ***!
1245 + \****************************************************/
1246 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1247 +
1248 +"use strict";
1249 +
1250 +
1251 +var ControlBaseDataView = __webpack_require__(/*! elementor-controls/base-data */ "../assets/dev/js/editor/controls/base-data.js");
1252 +module.exports = ControlBaseDataView.extend({
1253 + setInputValue: function setInputValue(input, value) {
1254 + this.$(input).prop('checked', this.model.get('return_value') === value);
1255 + }
1256 +}, {
1257 + onPasteStyle: function onPasteStyle(control, clipboardValue) {
1258 + return !clipboardValue || clipboardValue === control.return_value;
1259 + }
1260 +});
1261 +
1262 +/***/ }),
1263 +
1264 +/***/ "../modules/styleguide/assets/js/commands/enable.js":
1265 +/*!**********************************************************!*\
1266 + !*** ../modules/styleguide/assets/js/commands/enable.js ***!
1267 + \**********************************************************/
1268 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1269 +
1270 +"use strict";
1271 +
1272 +
1273 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1274 +Object.defineProperty(exports, "__esModule", ({
1275 + value: true
1276 +}));
1277 +exports["default"] = exports.Enable = void 0;
1278 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
1279 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
1280 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
1281 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
1282 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
1283 +function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
1284 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
1285 +var Enable = exports.Enable = /*#__PURE__*/function (_$e$modules$CommandBa) {
1286 + function Enable() {
1287 + (0, _classCallCheck2.default)(this, Enable);
1288 + return _callSuper(this, Enable, arguments);
1289 + }
1290 + (0, _inherits2.default)(Enable, _$e$modules$CommandBa);
1291 + return (0, _createClass2.default)(Enable, [{
1292 + key: "apply",
1293 + value: function apply(args) {
1294 + $e.components.get('preview/styleguide').enableStyleguidePreview(args);
1295 + }
1296 + }]);
1297 +}($e.modules.CommandBase);
1298 +var _default = exports["default"] = Enable;
1299 +
1300 +/***/ }),
1301 +
1302 +/***/ "../modules/styleguide/assets/js/commands/global-colors.js":
1303 +/*!*****************************************************************!*\
1304 + !*** ../modules/styleguide/assets/js/commands/global-colors.js ***!
1305 + \*****************************************************************/
1306 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1307 +
1308 +"use strict";
1309 +
1310 +
1311 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1312 +Object.defineProperty(exports, "__esModule", ({
1313 + value: true
1314 +}));
1315 +exports["default"] = exports.GlobalColors = void 0;
1316 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
1317 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
1318 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
1319 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
1320 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
1321 +function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
1322 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
1323 +var GlobalColors = exports.GlobalColors = /*#__PURE__*/function (_$e$modules$CommandBa) {
1324 + function GlobalColors() {
1325 + (0, _classCallCheck2.default)(this, GlobalColors);
1326 + return _callSuper(this, GlobalColors, arguments);
1327 + }
1328 + (0, _inherits2.default)(GlobalColors, _$e$modules$CommandBa);
1329 + return (0, _createClass2.default)(GlobalColors, [{
1330 + key: "apply",
1331 + value: function apply() {
1332 + $e.components.get('preview/styleguide').showStyleguidePreview();
1333 + }
1334 + }]);
1335 +}($e.modules.CommandBase);
1336 +var _default = exports["default"] = GlobalColors;
1337 +
1338 +/***/ }),
1339 +
1340 +/***/ "../modules/styleguide/assets/js/commands/global-typography.js":
1341 +/*!*********************************************************************!*\
1342 + !*** ../modules/styleguide/assets/js/commands/global-typography.js ***!
1343 + \*********************************************************************/
1344 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1345 +
1346 +"use strict";
1347 +
1348 +
1349 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1350 +Object.defineProperty(exports, "__esModule", ({
1351 + value: true
1352 +}));
1353 +exports["default"] = exports.GlobalTypography = void 0;
1354 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
1355 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
1356 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
1357 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
1358 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
1359 +function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
1360 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
1361 +var GlobalTypography = exports.GlobalTypography = /*#__PURE__*/function (_$e$modules$CommandBa) {
1362 + function GlobalTypography() {
1363 + (0, _classCallCheck2.default)(this, GlobalTypography);
1364 + return _callSuper(this, GlobalTypography, arguments);
1365 + }
1366 + (0, _inherits2.default)(GlobalTypography, _$e$modules$CommandBa);
1367 + return (0, _createClass2.default)(GlobalTypography, [{
1368 + key: "apply",
1369 + value: function apply() {
1370 + $e.components.get('preview/styleguide').showStyleguidePreview();
1371 + }
1372 + }]);
1373 +}($e.modules.CommandBase);
1374 +var _default = exports["default"] = GlobalTypography;
1375 +
1376 +/***/ }),
1377 +
1378 +/***/ "../modules/styleguide/assets/js/commands/hide.js":
1379 +/*!********************************************************!*\
1380 + !*** ../modules/styleguide/assets/js/commands/hide.js ***!
1381 + \********************************************************/
1382 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1383 +
1384 +"use strict";
1385 +
1386 +
1387 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1388 +Object.defineProperty(exports, "__esModule", ({
1389 + value: true
1390 +}));
1391 +exports["default"] = exports.Hide = void 0;
1392 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
1393 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
1394 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
1395 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
1396 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
1397 +function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
1398 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
1399 +var Hide = exports.Hide = /*#__PURE__*/function (_$e$modules$CommandBa) {
1400 + function Hide() {
1401 + (0, _classCallCheck2.default)(this, Hide);
1402 + return _callSuper(this, Hide, arguments);
1403 + }
1404 + (0, _inherits2.default)(Hide, _$e$modules$CommandBa);
1405 + return (0, _createClass2.default)(Hide, [{
1406 + key: "apply",
1407 + value: function apply() {
1408 + $e.components.get('preview/styleguide').hideStyleguidePreview();
1409 + }
1410 + }]);
1411 +}($e.modules.CommandBase);
1412 +var _default = exports["default"] = Hide;
1413 +
1414 +/***/ }),
1415 +
1416 +/***/ "../modules/styleguide/assets/js/commands/index.js":
1417 +/*!*********************************************************!*\
1418 + !*** ../modules/styleguide/assets/js/commands/index.js ***!
1419 + \*********************************************************/
1420 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1421 +
1422 +"use strict";
1423 +
1424 +
1425 +Object.defineProperty(exports, "__esModule", ({
1426 + value: true
1427 +}));
1428 +Object.defineProperty(exports, "Enable", ({
1429 + enumerable: true,
1430 + get: function get() {
1431 + return _enable.Enable;
1432 + }
1433 +}));
1434 +Object.defineProperty(exports, "GlobalColors", ({
1435 + enumerable: true,
1436 + get: function get() {
1437 + return _globalColors.GlobalColors;
1438 + }
1439 +}));
1440 +Object.defineProperty(exports, "GlobalTypography", ({
1441 + enumerable: true,
1442 + get: function get() {
1443 + return _globalTypography.GlobalTypography;
1444 + }
1445 +}));
1446 +Object.defineProperty(exports, "Hide", ({
1447 + enumerable: true,
1448 + get: function get() {
1449 + return _hide.Hide;
1450 + }
1451 +}));
1452 +Object.defineProperty(exports, "SwitcherChange", ({
1453 + enumerable: true,
1454 + get: function get() {
1455 + return _switcherChange.SwitcherChange;
1456 + }
1457 +}));
1458 +var _enable = __webpack_require__(/*! ./enable */ "../modules/styleguide/assets/js/commands/enable.js");
1459 +var _globalColors = __webpack_require__(/*! ./global-colors */ "../modules/styleguide/assets/js/commands/global-colors.js");
1460 +var _globalTypography = __webpack_require__(/*! ./global-typography */ "../modules/styleguide/assets/js/commands/global-typography.js");
1461 +var _hide = __webpack_require__(/*! ./hide */ "../modules/styleguide/assets/js/commands/hide.js");
1462 +var _switcherChange = __webpack_require__(/*! ./switcher-change */ "../modules/styleguide/assets/js/commands/switcher-change.js");
1463 +
1464 +/***/ }),
1465 +
1466 +/***/ "../modules/styleguide/assets/js/commands/switcher-change.js":
1467 +/*!*******************************************************************!*\
1468 + !*** ../modules/styleguide/assets/js/commands/switcher-change.js ***!
1469 + \*******************************************************************/
1470 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1471 +
1472 +"use strict";
1473 +
1474 +
1475 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1476 +Object.defineProperty(exports, "__esModule", ({
1477 + value: true
1478 +}));
1479 +exports["default"] = exports.SwitcherChange = void 0;
1480 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
1481 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
1482 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
1483 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
1484 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
1485 +function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
1486 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
1487 +var SwitcherChange = exports.SwitcherChange = /*#__PURE__*/function (_$e$modules$CommandBa) {
1488 + function SwitcherChange() {
1489 + (0, _classCallCheck2.default)(this, SwitcherChange);
1490 + return _callSuper(this, SwitcherChange, arguments);
1491 + }
1492 + (0, _inherits2.default)(SwitcherChange, _$e$modules$CommandBa);
1493 + return (0, _createClass2.default)(SwitcherChange, [{
1494 + key: "validateArgs",
1495 + value: function validateArgs() {
1496 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1497 + this.requireArgumentType('name', 'string', args);
1498 + this.requireArgumentType('value', 'string', args);
1499 + }
1500 + }, {
1501 + key: "apply",
1502 + value: function apply(args) {
1503 + if (args.name.includes('enable_styleguide_preview')) {
1504 + $e.components.get('preview/styleguide').enableStyleguidePreview({
1505 + value: args.value
1506 + });
1507 + }
1508 + }
1509 + }]);
1510 +}($e.modules.CommandBase);
1511 +var _default = exports["default"] = SwitcherChange;
1512 +
1513 +/***/ }),
1514 +
1515 +/***/ "../modules/styleguide/assets/js/controls/switcher.js":
1516 +/*!************************************************************!*\
1517 + !*** ../modules/styleguide/assets/js/controls/switcher.js ***!
1518 + \************************************************************/
1519 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1520 +
1521 +"use strict";
1522 +
1523 +
1524 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1525 +Object.defineProperty(exports, "__esModule", ({
1526 + value: true
1527 +}));
1528 +exports["default"] = void 0;
1529 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
1530 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
1531 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
1532 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
1533 +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js"));
1534 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
1535 +var _switcher = _interopRequireDefault(__webpack_require__(/*! elementor-assets-js/editor/controls/switcher */ "../assets/dev/js/editor/controls/switcher.js"));
1536 +var _baseData = _interopRequireDefault(__webpack_require__(/*! elementor-controls/base-data */ "../assets/dev/js/editor/controls/base-data.js"));
1537 +function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
1538 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
1539 +function _superPropGet(t, o, e, r) { var p = (0, _get2.default)((0, _getPrototypeOf2.default)(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
1540 +var _default = exports["default"] = /*#__PURE__*/function (_Switcher) {
1541 + function _default() {
1542 + (0, _classCallCheck2.default)(this, _default);
1543 + return _callSuper(this, _default, arguments);
1544 + }
1545 + (0, _inherits2.default)(_default, _Switcher);
1546 + return (0, _createClass2.default)(_default, [{
1547 + key: "initialize",
1548 + value: function initialize() {
1549 + _baseData.default.prototype.initialize.apply(this, arguments);
1550 + this.$el.addClass('elementor-control-type-switcher');
1551 + }
1552 + }, {
1553 + key: "onBeforeRender",
1554 + value: function onBeforeRender() {
1555 + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1556 + args[_key] = arguments[_key];
1557 + }
1558 + _superPropGet(_default, "onBeforeRender", this, 3)(args);
1559 + var actualValue = elementor.getPreferences('enable_styleguide_preview');
1560 + if (actualValue !== this.getCurrentValue()) {
1561 + this.setValue(actualValue);
1562 + }
1563 + }
1564 + }, {
1565 + key: "onBaseInputChange",
1566 + value: function onBaseInputChange(event) {
1567 + _baseData.default.prototype.onBaseInputChange.apply(this, arguments);
1568 + var input = event.currentTarget,
1569 + value = this.getInputValue(input);
1570 + if (this.model.get('on_change_command')) {
1571 + this.runCommand(value);
1572 + }
1573 + this.model.set('return_value', null);
1574 + }
1575 + }, {
1576 + key: "runCommand",
1577 + value: function runCommand(value) {
1578 + $e.run('preview/styleguide/switcher-change', {
1579 + name: this.model.get('name'),
1580 + value: value
1581 + });
1582 + }
1583 + }]);
1584 +}(_switcher.default);
1585 +
1586 +/***/ }),
1587 +
1588 +/***/ "../modules/styleguide/assets/js/e-component.js":
1589 +/*!******************************************************!*\
1590 + !*** ../modules/styleguide/assets/js/e-component.js ***!
1591 + \******************************************************/
1592 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1593 +
1594 +"use strict";
1595 +
1596 +
1597 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1598 +var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js");
1599 +Object.defineProperty(exports, "__esModule", ({
1600 + value: true
1601 +}));
1602 +exports["default"] = void 0;
1603 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
1604 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
1605 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
1606 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
1607 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
1608 +var commands = _interopRequireWildcard(__webpack_require__(/*! ./commands */ "../modules/styleguide/assets/js/commands/index.js"));
1609 +var _switcher = _interopRequireDefault(__webpack_require__(/*! ./controls/switcher */ "../modules/styleguide/assets/js/controls/switcher.js"));
1610 +function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
1611 +function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
1612 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
1613 +var _default = exports["default"] = /*#__PURE__*/function (_$e$modules$Component) {
1614 + function _default(args) {
1615 + var _this;
1616 + (0, _classCallCheck2.default)(this, _default);
1617 + _this = _callSuper(this, _default, [args]);
1618 + elementor.addControlView('global-style-switcher', _switcher.default);
1619 + _this.registerStyleguideDialogType();
1620 + elementor.once('preview:loaded', function () {
1621 + _this.initModal();
1622 + });
1623 + return _this;
1624 + }
1625 + (0, _inherits2.default)(_default, _$e$modules$Component);
1626 + return (0, _createClass2.default)(_default, [{
1627 + key: "getNamespace",
1628 + value: function getNamespace() {
1629 + return 'preview/styleguide';
1630 + }
1631 + }, {
1632 + key: "defaultCommands",
1633 + value: function defaultCommands() {
1634 + return this.importCommands(commands);
1635 + }
1636 + }, {
1637 + key: "registerStyleguideDialogType",
1638 + value: function registerStyleguideDialogType() {
1639 + DialogsManager.addWidgetType('styleguide', DialogsManager.getWidgetType('lightbox').extend('alert', {
1640 + buildWidget: function buildWidget() {
1641 + DialogsManager.getWidgetType('lightbox').prototype.buildWidget.apply(this, arguments);
1642 + var $widgetContent = this.addElement('widgetContent'),
1643 + elements = this.getElements();
1644 + $widgetContent.append(elements.message);
1645 + elements.widget.html($widgetContent);
1646 + }
1647 + }));
1648 + }
1649 + }, {
1650 + key: "initModal",
1651 + value: function initModal() {
1652 + var modal;
1653 + this.getModal = function () {
1654 + if (modal) {
1655 + return modal;
1656 + }
1657 + modal = elementorCommon.dialogsManager.createWidget('styleguide', {
1658 + id: 'e-styleguide-preview-dialog',
1659 + message: "<div class=\"e-styleguide-preview-root\"></div>",
1660 + position: {
1661 + my: 'center center',
1662 + at: 'center center'
1663 + },
1664 + hide: {
1665 + onOutsideClick: false,
1666 + onEscKeyPress: false,
1667 + onClick: false,
1668 + onBackgroundClick: false
1669 + },
1670 + container: elementor.$previewContents.find('body')
1671 + });
1672 + return modal;
1673 + };
1674 + }
1675 +
1676 + /**
1677 + * Show the Styleguide Preview.
1678 + * If skipPreferences is true, it will not check the User Preferences before showing the dialog.
1679 + *
1680 + * @param {boolean} skipPreferencesCheck
1681 + */
1682 + }, {
1683 + key: "showStyleguidePreview",
1684 + value: function showStyleguidePreview() {
1685 + var skipPreferencesCheck = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
1686 + if (this.getModal().isVisible() || !skipPreferencesCheck && !elementor.getPreferences('enable_styleguide_preview')) {
1687 + return;
1688 + }
1689 + this.getPreviewFrame().postMessage({
1690 + name: 'elementor/styleguide/preview/show'
1691 + }, '*');
1692 + this.getModal().show();
1693 + }
1694 +
1695 + /**
1696 + * Hide the Styleguide Preview.
1697 + */
1698 + }, {
1699 + key: "hideStyleguidePreview",
1700 + value: function hideStyleguidePreview() {
1701 + this.getPreviewFrame().postMessage({
1702 + name: 'elementor/styleguide/preview/hide'
1703 + }, '*');
1704 + this.getModal().hide();
1705 + }
1706 +
1707 + /**
1708 + * Update the User Preferences to show the global settings.
1709 + * Triggered on switcher change at Global Colors / Global Typography panels.
1710 + *
1711 + * @param {Array} options
1712 + */
1713 + }, {
1714 + key: "enableStyleguidePreview",
1715 + value: function enableStyleguidePreview(options) {
1716 + if (options.value) {
1717 + this.showStyleguidePreview(true);
1718 + } else {
1719 + this.hideStyleguidePreview();
1720 + }
1721 + $e.run('document/elements/settings', {
1722 + container: elementor.settings.editorPreferences.getEditedView().getContainer(),
1723 + settings: {
1724 + enable_styleguide_preview: options.value
1725 + },
1726 + options: {
1727 + external: true
1728 + }
1729 + });
1730 + }
1731 +
1732 + /**
1733 + * Check if the current script context is the Editor.
1734 + *
1735 + * @return {boolean}
1736 + */
1737 + }, {
1738 + key: "isInEditor",
1739 + value: function isInEditor() {
1740 + return !!window.elementor;
1741 + }
1742 +
1743 + /**
1744 + * Get the Preview Frame.
1745 + *
1746 + * @return {Window}
1747 + */
1748 + }, {
1749 + key: "getPreviewFrame",
1750 + value: function getPreviewFrame() {
1751 + return this.isInEditor() ? elementor.$preview[0].contentWindow : window;
1752 + }
1753 + }]);
1754 +}($e.modules.ComponentBase);
1755 +
1756 +/***/ }),
1757 +
1758 +/***/ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js":
1759 +/*!******************************************************************!*\
1760 + !*** ../node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***!
1761 + \******************************************************************/
1762 +/***/ ((module) => {
1763 +
1764 +function _arrayLikeToArray(r, a) {
1765 + (null == a || a > r.length) && (a = r.length);
1766 + for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
1767 + return n;
1768 +}
1769 +module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
1770 +
1771 +/***/ }),
1772 +
1773 +/***/ "../node_modules/@babel/runtime/helpers/arrayWithHoles.js":
1774 +/*!****************************************************************!*\
1775 + !*** ../node_modules/@babel/runtime/helpers/arrayWithHoles.js ***!
1776 + \****************************************************************/
1777 +/***/ ((module) => {
1778 +
1779 +function _arrayWithHoles(r) {
1780 + if (Array.isArray(r)) return r;
1781 +}
1782 +module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
1783 +
1784 +/***/ }),
1785 +
1786 +/***/ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js":
1787 +/*!***********************************************************************!*\
1788 + !*** ../node_modules/@babel/runtime/helpers/assertThisInitialized.js ***!
1789 + \***********************************************************************/
1790 +/***/ ((module) => {
1791 +
1792 +function _assertThisInitialized(e) {
1793 + if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1794 + return e;
1795 +}
1796 +module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports;
1797 +
1798 +/***/ }),
1799 +
1800 +/***/ "../node_modules/@babel/runtime/helpers/classCallCheck.js":
1801 +/*!****************************************************************!*\
1802 + !*** ../node_modules/@babel/runtime/helpers/classCallCheck.js ***!
1803 + \****************************************************************/
1804 +/***/ ((module) => {
1805 +
1806 +function _classCallCheck(a, n) {
1807 + if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
1808 +}
1809 +module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
1810 +
1811 +/***/ }),
1812 +
1813 +/***/ "../node_modules/@babel/runtime/helpers/createClass.js":
1814 +/*!*************************************************************!*\
1815 + !*** ../node_modules/@babel/runtime/helpers/createClass.js ***!
1816 + \*************************************************************/
1817 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1818 +
1819 +var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/toPropertyKey.js");
1820 +function _defineProperties(e, r) {
1821 + for (var t = 0; t < r.length; t++) {
1822 + var o = r[t];
1823 + o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey(o.key), o);
1824 + }
1825 +}
1826 +function _createClass(e, r, t) {
1827 + return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
1828 + writable: !1
1829 + }), e;
1830 +}
1831 +module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
1832 +
1833 +/***/ }),
1834 +
1835 +/***/ "../node_modules/@babel/runtime/helpers/defineProperty.js":
1836 +/*!****************************************************************!*\
1837 + !*** ../node_modules/@babel/runtime/helpers/defineProperty.js ***!
1838 + \****************************************************************/
1839 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1840 +
1841 +var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/toPropertyKey.js");
1842 +function _defineProperty(e, r, t) {
1843 + return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
1844 + value: t,
1845 + enumerable: !0,
1846 + configurable: !0,
1847 + writable: !0
1848 + }) : e[r] = t, e;
1849 +}
1850 +module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
1851 +
1852 +/***/ }),
1853 +
1854 +/***/ "../node_modules/@babel/runtime/helpers/get.js":
1855 +/*!*****************************************************!*\
1856 + !*** ../node_modules/@babel/runtime/helpers/get.js ***!
1857 + \*****************************************************/
1858 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1859 +
1860 +var superPropBase = __webpack_require__(/*! ./superPropBase.js */ "../node_modules/@babel/runtime/helpers/superPropBase.js");
1861 +function _get() {
1862 + return module.exports = _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) {
1863 + var p = superPropBase(e, t);
1864 + if (p) {
1865 + var n = Object.getOwnPropertyDescriptor(p, t);
1866 + return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value;
1867 + }
1868 + }, module.exports.__esModule = true, module.exports["default"] = module.exports, _get.apply(null, arguments);
1869 +}
1870 +module.exports = _get, module.exports.__esModule = true, module.exports["default"] = module.exports;
1871 +
1872 +/***/ }),
1873 +
1874 +/***/ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js":
1875 +/*!****************************************************************!*\
1876 + !*** ../node_modules/@babel/runtime/helpers/getPrototypeOf.js ***!
1877 + \****************************************************************/
1878 +/***/ ((module) => {
1879 +
1880 +function _getPrototypeOf(t) {
1881 + return module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
1882 + return t.__proto__ || Object.getPrototypeOf(t);
1883 + }, module.exports.__esModule = true, module.exports["default"] = module.exports, _getPrototypeOf(t);
1884 +}
1885 +module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
1886 +
1887 +/***/ }),
1888 +
1889 +/***/ "../node_modules/@babel/runtime/helpers/inherits.js":
1890 +/*!**********************************************************!*\
1891 + !*** ../node_modules/@babel/runtime/helpers/inherits.js ***!
1892 + \**********************************************************/
1893 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1894 +
1895 +var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js");
1896 +function _inherits(t, e) {
1897 + if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
1898 + t.prototype = Object.create(e && e.prototype, {
1899 + constructor: {
1900 + value: t,
1901 + writable: !0,
1902 + configurable: !0
1903 + }
1904 + }), Object.defineProperty(t, "prototype", {
1905 + writable: !1
1906 + }), e && setPrototypeOf(t, e);
1907 +}
1908 +module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports;
1909 +
1910 +/***/ }),
1911 +
1912 +/***/ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js":
1913 +/*!***********************************************************************!*\
1914 + !*** ../node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
1915 + \***********************************************************************/
1916 +/***/ ((module) => {
1917 +
1918 +function _interopRequireDefault(e) {
1919 + return e && e.__esModule ? e : {
1920 + "default": e
1921 + };
1922 +}
1923 +module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
1924 +
1925 +/***/ }),
1926 +
1927 +/***/ "../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js":
1928 +/*!**********************************************************************!*\
1929 + !*** ../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***!
1930 + \**********************************************************************/
1931 +/***/ ((module) => {
1932 +
1933 +function _iterableToArrayLimit(r, l) {
1934 + var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
1935 + if (null != t) {
1936 + var e,
1937 + n,
1938 + i,
1939 + u,
1940 + a = [],
1941 + f = !0,
1942 + o = !1;
1943 + try {
1944 + if (i = (t = t.call(r)).next, 0 === l) {
1945 + if (Object(t) !== t) return;
1946 + f = !1;
1947 + } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
1948 + } catch (r) {
1949 + o = !0, n = r;
1950 + } finally {
1951 + try {
1952 + if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
1953 + } finally {
1954 + if (o) throw n;
1955 + }
1956 + }
1957 + return a;
1958 + }
1959 +}
1960 +module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports;
1961 +
1962 +/***/ }),
1963 +
1964 +/***/ "../node_modules/@babel/runtime/helpers/nonIterableRest.js":
1965 +/*!*****************************************************************!*\
1966 + !*** ../node_modules/@babel/runtime/helpers/nonIterableRest.js ***!
1967 + \*****************************************************************/
1968 +/***/ ((module) => {
1969 +
1970 +function _nonIterableRest() {
1971 + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1972 +}
1973 +module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports;
1974 +
1975 +/***/ }),
1976 +
1977 +/***/ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js":
1978 +/*!***************************************************************************!*\
1979 + !*** ../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js ***!
1980 + \***************************************************************************/
1981 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1982 +
1983 +var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
1984 +var assertThisInitialized = __webpack_require__(/*! ./assertThisInitialized.js */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js");
1985 +function _possibleConstructorReturn(t, e) {
1986 + if (e && ("object" == _typeof(e) || "function" == typeof e)) return e;
1987 + if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
1988 + return assertThisInitialized(t);
1989 +}
1990 +module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports;
1991 +
1992 +/***/ }),
1993 +
1994 +/***/ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js":
1995 +/*!****************************************************************!*\
1996 + !*** ../node_modules/@babel/runtime/helpers/setPrototypeOf.js ***!
1997 + \****************************************************************/
1998 +/***/ ((module) => {
1999 +
2000 +function _setPrototypeOf(t, e) {
2001 + return module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
2002 + return t.__proto__ = e, t;
2003 + }, module.exports.__esModule = true, module.exports["default"] = module.exports, _setPrototypeOf(t, e);
2004 +}
2005 +module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
2006 +
2007 +/***/ }),
2008 +
2009 +/***/ "../node_modules/@babel/runtime/helpers/slicedToArray.js":
2010 +/*!***************************************************************!*\
2011 + !*** ../node_modules/@babel/runtime/helpers/slicedToArray.js ***!
2012 + \***************************************************************/
2013 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2014 +
2015 +var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles.js */ "../node_modules/@babel/runtime/helpers/arrayWithHoles.js");
2016 +var iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit.js */ "../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js");
2017 +var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ "../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js");
2018 +var nonIterableRest = __webpack_require__(/*! ./nonIterableRest.js */ "../node_modules/@babel/runtime/helpers/nonIterableRest.js");
2019 +function _slicedToArray(r, e) {
2020 + return arrayWithHoles(r) || iterableToArrayLimit(r, e) || unsupportedIterableToArray(r, e) || nonIterableRest();
2021 +}
2022 +module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
2023 +
2024 +/***/ }),
2025 +
2026 +/***/ "../node_modules/@babel/runtime/helpers/superPropBase.js":
2027 +/*!***************************************************************!*\
2028 + !*** ../node_modules/@babel/runtime/helpers/superPropBase.js ***!
2029 + \***************************************************************/
2030 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2031 +
2032 +var getPrototypeOf = __webpack_require__(/*! ./getPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js");
2033 +function _superPropBase(t, o) {
2034 + for (; !{}.hasOwnProperty.call(t, o) && null !== (t = getPrototypeOf(t)););
2035 + return t;
2036 +}
2037 +module.exports = _superPropBase, module.exports.__esModule = true, module.exports["default"] = module.exports;
2038 +
2039 +/***/ }),
2040 +
2041 +/***/ "../node_modules/@babel/runtime/helpers/toPrimitive.js":
2042 +/*!*************************************************************!*\
2043 + !*** ../node_modules/@babel/runtime/helpers/toPrimitive.js ***!
2044 + \*************************************************************/
2045 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2046 +
2047 +var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
2048 +function toPrimitive(t, r) {
2049 + if ("object" != _typeof(t) || !t) return t;
2050 + var e = t[Symbol.toPrimitive];
2051 + if (void 0 !== e) {
2052 + var i = e.call(t, r || "default");
2053 + if ("object" != _typeof(i)) return i;
2054 + throw new TypeError("@@toPrimitive must return a primitive value.");
2055 + }
2056 + return ("string" === r ? String : Number)(t);
2057 +}
2058 +module.exports = toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
2059 +
2060 +/***/ }),
2061 +
2062 +/***/ "../node_modules/@babel/runtime/helpers/toPropertyKey.js":
2063 +/*!***************************************************************!*\
2064 + !*** ../node_modules/@babel/runtime/helpers/toPropertyKey.js ***!
2065 + \***************************************************************/
2066 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2067 +
2068 +var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
2069 +var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ "../node_modules/@babel/runtime/helpers/toPrimitive.js");
2070 +function toPropertyKey(t) {
2071 + var i = toPrimitive(t, "string");
2072 + return "symbol" == _typeof(i) ? i : i + "";
2073 +}
2074 +module.exports = toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
2075 +
2076 +/***/ }),
2077 +
2078 +/***/ "../node_modules/@babel/runtime/helpers/typeof.js":
2079 +/*!********************************************************!*\
2080 + !*** ../node_modules/@babel/runtime/helpers/typeof.js ***!
2081 + \********************************************************/
2082 +/***/ ((module) => {
2083 +
2084 +function _typeof(o) {
2085 + "@babel/helpers - typeof";
2086 +
2087 + return module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
2088 + return typeof o;
2089 + } : function (o) {
2090 + return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
2091 + }, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof(o);
2092 +}
2093 +module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
2094 +
2095 +/***/ }),
2096 +
2097 +/***/ "../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js":
2098 +/*!****************************************************************************!*\
2099 + !*** ../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***!
2100 + \****************************************************************************/
2101 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2102 +
2103 +var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js");
2104 +function _unsupportedIterableToArray(r, a) {
2105 + if (r) {
2106 + if ("string" == typeof r) return arrayLikeToArray(r, a);
2107 + var t = {}.toString.call(r).slice(8, -1);
2108 + return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? arrayLikeToArray(r, a) : void 0;
2109 + }
2110 +}
2111 +module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
2112 +
2113 +/***/ }),
2114 +
2115 +/***/ "@wordpress/i18n":
2116 +/*!**************************!*\
2117 + !*** external "wp.i18n" ***!
2118 + \**************************/
2119 +/***/ ((module) => {
2120 +
2121 +"use strict";
2122 +module.exports = wp.i18n;
2123 +
2124 +/***/ })
2125 +
2126 +/******/ });
2127 +/************************************************************************/
2128 +/******/ // The module cache
2129 +/******/ var __webpack_module_cache__ = {};
2130 +/******/
2131 +/******/ // The require function
2132 +/******/ function __webpack_require__(moduleId) {
2133 +/******/ // Check if module is in cache
2134 +/******/ var cachedModule = __webpack_module_cache__[moduleId];
2135 +/******/ if (cachedModule !== undefined) {
2136 +/******/ return cachedModule.exports;
2137 +/******/ }
2138 +/******/ // Create a new module (and put it into the cache)
2139 +/******/ var module = __webpack_module_cache__[moduleId] = {
2140 +/******/ // no module.id needed
2141 +/******/ // no module.loaded needed
2142 +/******/ exports: {}
2143 +/******/ };
2144 +/******/
2145 +/******/ // Execute the module function
2146 +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
2147 +/******/
2148 +/******/ // Return the exports of the module
2149 +/******/ return module.exports;
2150 +/******/ }
2151 +/******/
2152 +/************************************************************************/
2153 +var __webpack_exports__ = {};
2154 +// This entry needs to be wrapped in an IIFE because it needs to be in strict mode.
2155 +(() => {
2156 +"use strict";
2157 +/*!*****************************************************!*\
2158 + !*** ../modules/styleguide/assets/js/styleguide.js ***!
2159 + \*****************************************************/
2160 +
2161 +
2162 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2163 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
2164 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
2165 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
2166 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
2167 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
2168 +var _eComponent = _interopRequireDefault(__webpack_require__(/*! ./e-component */ "../modules/styleguide/assets/js/e-component.js"));
2169 +function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
2170 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
2171 +var Styleguide = /*#__PURE__*/function (_elementorModules$edi) {
2172 + function Styleguide() {
2173 + (0, _classCallCheck2.default)(this, Styleguide);
2174 + return _callSuper(this, Styleguide, arguments);
2175 + }
2176 + (0, _inherits2.default)(Styleguide, _elementorModules$edi);
2177 + return (0, _createClass2.default)(Styleguide, [{
2178 + key: "onInit",
2179 + value: function onInit() {
2180 + $e.components.register(new _eComponent.default());
2181 + this.addHooks();
2182 + }
2183 + }, {
2184 + key: "getGlobalRoutes",
2185 + value: function getGlobalRoutes() {
2186 + return {
2187 + 'global-colors': 'panel/global/global-colors',
2188 + 'global-typography': 'panel/global/global-typography'
2189 + };
2190 + }
2191 + }, {
2192 + key: "addHooks",
2193 + value: function addHooks() {
2194 + elementor.hooks.addAction('panel/global/tab/before-show', this.show.bind(this));
2195 + elementor.hooks.addAction('panel/global/tab/before-destroy', this.hide.bind(this));
2196 + }
2197 +
2198 + /**
2199 + * Function show() triggered before showing a new tab at the Globals panel.
2200 + *
2201 + * @param {Object} args
2202 + */
2203 + }, {
2204 + key: "show",
2205 + value: function show(args) {
2206 + if (!args.id || !(args.id in this.getGlobalRoutes())) {
2207 + return;
2208 + }
2209 + $e.run("preview/styleguide/".concat(args.id));
2210 + }
2211 +
2212 + /**
2213 + * Function hide() triggered before hiding a tab at the Globals panel.
2214 + *
2215 + * @param {Object} args
2216 + */
2217 + }, {
2218 + key: "hide",
2219 + value: function hide(args) {
2220 + if (!args.id || !(args.id in this.getGlobalRoutes())) {
2221 + return;
2222 + }
2223 + var isGlobalsRoute = Object.values(this.getGlobalRoutes()).some(function (route) {
2224 + return $e.routes.current.panel === route;
2225 + });
2226 + if (isGlobalsRoute) {
2227 + return;
2228 + }
2229 + $e.run('preview/styleguide/hide');
2230 + }
2231 + }]);
2232 +}(elementorModules.editor.utils.Module);
2233 +new Styleguide();
2234 +})();
2235 +
2236 +/******/ })()
2237 +;
1765 2238 //# sourceMappingURL=styleguide.js.map