PluginProbe
Elementor Website Builder – more than just a page builder / 3.32.0-dev3
Elementor Website Builder – more than just a page builder v3.32.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/web-cli.js +11719 -5813 4.3.0-beta33.32.0-dev3 View file →
@@ -1,5912 +1,11818 @@
1 -(function(_reduxjs_toolkit) {
1 +/*! elementor - v3.32.0 - 08-09-2025 */
2 +/******/ (() => { // webpackBootstrap
3 +/******/ var __webpack_modules__ = ({
2 4
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));
5 +/***/ "../assets/dev/js/editor/utils/is-instanceof.js":
6 +/*!******************************************************!*\
7 + !*** ../assets/dev/js/editor/utils/is-instanceof.js ***!
8 + \******************************************************/
9 +/***/ ((__unused_webpack_module, exports) => {
54 10
55 -//#endregion
11 +"use strict";
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 13
62 -//#endregion
63 -//#region node_modules/@babel/runtime/helpers/esm/typeof.js
64 - function _typeof(o) {
65 - "@babel/helpers - typeof";
66 - return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
67 - return typeof o;
68 - } : function(o) {
69 - return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
70 - }, _typeof(o);
71 - }
72 - var init_typeof = __esmMin((() => {}));
14 +Object.defineProperty(exports, "__esModule", ({
15 + value: true
16 +}));
17 +exports["default"] = void 0;
18 +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; } } }; }
19 +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; } }
20 +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; }
21 +/**
22 + * Some FileAPI objects such as FileList, DataTransferItem and DataTransferItemList has inconsistency with the retrieved
23 + * object (from events, etc.) and the actual JavaScript object so a regular instanceof doesn't work. This function can
24 + * check whether it's instanceof by using the objects constructor and prototype names.
25 + *
26 + * @param object
27 + * @param constructors
28 + * @return {boolean}
29 + */
30 +var _default = exports["default"] = function _default(object, constructors) {
31 + constructors = Array.isArray(constructors) ? constructors : [constructors];
32 + var _iterator = _createForOfIteratorHelper(constructors),
33 + _step;
34 + try {
35 + for (_iterator.s(); !(_step = _iterator.n()).done;) {
36 + var _constructor = _step.value;
37 + if (object.constructor.name === _constructor.prototype[Symbol.toStringTag]) {
38 + return true;
39 + }
40 + }
41 + } catch (err) {
42 + _iterator.e(err);
43 + } finally {
44 + _iterator.f();
45 + }
46 + return false;
47 +};
73 48
74 -//#endregion
75 -//#region node_modules/@babel/runtime/helpers/esm/toPrimitive.js
76 - init_typeof();
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 - }
49 +/***/ }),
87 50
88 -//#endregion
89 -//#region node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
90 - init_typeof();
91 - function toPropertyKey(t) {
92 - var i = toPrimitive(t, "string");
93 - return "symbol" == _typeof(i) ? i : i + "";
94 - }
51 +/***/ "../assets/dev/js/modules/imports/args-object.js":
52 +/*!*******************************************************!*\
53 + !*** ../assets/dev/js/modules/imports/args-object.js ***!
54 + \*******************************************************/
55 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
95 56
96 -//#endregion
97 -//#region node_modules/@babel/runtime/helpers/esm/createClass.js
98 - function _defineProperties(e, r) {
99 - for (var t = 0; t < r.length; t++) {
100 - var o = r[t];
101 - o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey(o.key), o);
102 - }
103 - }
104 - function _createClass(e, r, t) {
105 - return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e;
106 - }
57 +"use strict";
107 58
108 -//#endregion
109 -//#region node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
110 - function _assertThisInitialized(e) {
111 - if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
112 - return e;
113 - }
114 59
115 -//#endregion
116 -//#region node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js
117 - init_typeof();
118 - function _possibleConstructorReturn(t, e) {
119 - if (e && ("object" == _typeof(e) || "function" == typeof e)) return e;
120 - if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
121 - return _assertThisInitialized(t);
122 - }
60 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
61 +Object.defineProperty(exports, "__esModule", ({
62 + value: true
63 +}));
64 +exports["default"] = void 0;
65 +var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"));
66 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
67 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
68 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
69 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
70 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
71 +var _instanceType = _interopRequireDefault(__webpack_require__(/*! ./instance-type */ "../assets/dev/js/modules/imports/instance-type.js"));
72 +var _isInstanceof = _interopRequireDefault(__webpack_require__(/*! ../../editor/utils/is-instanceof */ "../assets/dev/js/editor/utils/is-instanceof.js"));
73 +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)); }
74 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
75 +var ArgsObject = exports["default"] = /*#__PURE__*/function (_InstanceType) {
76 + /**
77 + * Function constructor().
78 + *
79 + * Create ArgsObject.
80 + *
81 + * @param {{}} args
82 + */
83 + function ArgsObject(args) {
84 + var _this;
85 + (0, _classCallCheck2.default)(this, ArgsObject);
86 + _this = _callSuper(this, ArgsObject);
87 + _this.args = args;
88 + return _this;
89 + }
123 90
124 -//#endregion
125 -//#region node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js
126 - function _getPrototypeOf(t) {
127 - return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t) {
128 - return t.__proto__ || Object.getPrototypeOf(t);
129 - }, _getPrototypeOf(t);
130 - }
91 + /**
92 + * Function requireArgument().
93 + *
94 + * Validate property in args.
95 + *
96 + * @param {string} property
97 + * @param {{}} args
98 + *
99 + * @throws {Error}
100 + */
101 + (0, _inherits2.default)(ArgsObject, _InstanceType);
102 + return (0, _createClass2.default)(ArgsObject, [{
103 + key: "requireArgument",
104 + value: function requireArgument(property) {
105 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.args;
106 + if (!Object.prototype.hasOwnProperty.call(args, property)) {
107 + throw Error("".concat(property, " is required."));
108 + }
109 + }
131 110
132 -//#endregion
133 -//#region node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
134 - function _setPrototypeOf(t, e) {
135 - return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, e) {
136 - return t.__proto__ = e, t;
137 - }, _setPrototypeOf(t, e);
138 - }
111 + /**
112 + * Function requireArgumentType().
113 + *
114 + * Validate property in args using `type === typeof(args.whatever)`.
115 + *
116 + * @param {string} property
117 + * @param {string} type
118 + * @param {{}} args
119 + *
120 + * @throws {Error}
121 + */
122 + }, {
123 + key: "requireArgumentType",
124 + value: function requireArgumentType(property, type) {
125 + var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.args;
126 + this.requireArgument(property, args);
127 + if ((0, _typeof2.default)(args[property]) !== type) {
128 + throw Error("".concat(property, " invalid type: ").concat(type, "."));
129 + }
130 + }
139 131
140 -//#endregion
141 -//#region node_modules/@babel/runtime/helpers/esm/inherits.js
142 - function _inherits(t, e) {
143 - if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
144 - t.prototype = Object.create(e && e.prototype, { constructor: {
145 - value: t,
146 - writable: !0,
147 - configurable: !0
148 - } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e);
149 - }
132 + /**
133 + * Function requireArgumentInstance().
134 + *
135 + * Validate property in args using `args.whatever instanceof instance`.
136 + *
137 + * @param {string} property
138 + * @param {*} instance
139 + * @param {{}} args
140 + *
141 + * @throws {Error}
142 + */
143 + }, {
144 + key: "requireArgumentInstance",
145 + value: function requireArgumentInstance(property, instance) {
146 + var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.args;
147 + this.requireArgument(property, args);
148 + if (!(args[property] instanceof instance) && !(0, _isInstanceof.default)(args[property], instance)) {
149 + throw Error("".concat(property, " invalid instance."));
150 + }
151 + }
150 152
151 -//#endregion
152 -//#region node_modules/@babel/runtime/helpers/esm/defineProperty.js
153 - function _defineProperty(e, r, t) {
154 - return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
155 - value: t,
156 - enumerable: !0,
157 - configurable: !0,
158 - writable: !0
159 - }) : e[r] = t, e;
160 - }
153 + /**
154 + * Function requireArgumentConstructor().
155 + *
156 + * Validate property in args using `type === args.whatever.constructor`.
157 + *
158 + * @param {string} property
159 + * @param {*} type
160 + * @param {{}} args
161 + *
162 + * @throws {Error}
163 + */
164 + }, {
165 + key: "requireArgumentConstructor",
166 + value: function requireArgumentConstructor(property, type) {
167 + var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.args;
168 + this.requireArgument(property, args);
161 169
162 -//#endregion
163 -//#region node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
164 - function _arrayWithHoles(r) {
165 - if (Array.isArray(r)) return r;
166 - }
170 + // Note: Converting the constructor to string in order to avoid equation issues
171 + // due to different memory addresses between iframes (window.Object !== window.top.Object).
172 + if (args[property].constructor.toString() !== type.prototype.constructor.toString()) {
173 + throw Error("".concat(property, " invalid constructor type."));
174 + }
175 + }
176 + }], [{
177 + key: "getInstanceType",
178 + value: function getInstanceType() {
179 + return 'ArgsObject';
180 + }
181 + }]);
182 +}(_instanceType.default);
167 183
168 -//#endregion
169 -//#region node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
170 - function _iterableToArrayLimit(r, l) {
171 - var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
172 - if (null != t) {
173 - var e;
174 - var n;
175 - var i;
176 - var u;
177 - var a = [];
178 - var f = !0;
179 - var o = !1;
180 - try {
181 - if (i = (t = t.call(r)).next, 0 === l) {
182 - if (Object(t) !== t) return;
183 - f = !1;
184 - } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
185 - } catch (r) {
186 - o = !0, n = r;
187 - } finally {
188 - try {
189 - if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
190 - } finally {
191 - if (o) throw n;
192 - }
193 - }
194 - return a;
195 - }
196 - }
184 +/***/ }),
197 185
198 -//#endregion
199 -//#region node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
200 - function _arrayLikeToArray$2(r, a) {
201 - (null == a || a > r.length) && (a = r.length);
202 - for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
203 - return n;
204 - }
205 - __name(_arrayLikeToArray$2, "_arrayLikeToArray");
186 +/***/ "../assets/dev/js/modules/imports/instance-type.js":
187 +/*!*********************************************************!*\
188 + !*** ../assets/dev/js/modules/imports/instance-type.js ***!
189 + \*********************************************************/
190 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
206 191
207 -//#endregion
208 -//#region node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
209 - function _unsupportedIterableToArray$2(r, a) {
210 - if (r) {
211 - if ("string" == typeof r) return _arrayLikeToArray$2(r, a);
212 - var t = {}.toString.call(r).slice(8, -1);
213 - 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$2(r, a) : void 0;
214 - }
215 - }
216 - __name(_unsupportedIterableToArray$2, "_unsupportedIterableToArray");
192 +"use strict";
217 193
218 -//#endregion
219 -//#region node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
220 - function _nonIterableRest() {
221 - throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
222 - }
223 194
224 -//#endregion
225 -//#region node_modules/@babel/runtime/helpers/esm/slicedToArray.js
226 - function _slicedToArray(r, e) {
227 - return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray$2(r, e) || _nonIterableRest();
228 - }
195 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
196 +Object.defineProperty(exports, "__esModule", ({
197 + value: true
198 +}));
199 +exports["default"] = void 0;
200 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
201 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
202 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
203 +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js"));
204 +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; }
205 +var InstanceType = exports["default"] = /*#__PURE__*/function () {
206 + function InstanceType() {
207 + var _this = this;
208 + (0, _classCallCheck2.default)(this, InstanceType);
209 + // Since anonymous classes sometimes do not get validated by babel, do it manually.
210 + var target = this instanceof InstanceType ? this.constructor : void 0;
211 + var prototypes = [];
212 + while (target.__proto__ && target.__proto__.name) {
213 + prototypes.push(target.__proto__);
214 + target = target.__proto__;
215 + }
216 + prototypes.reverse().forEach(function (proto) {
217 + return _this instanceof proto;
218 + });
219 + }
220 + return (0, _createClass2.default)(InstanceType, null, [{
221 + key: Symbol.hasInstance,
222 + value: function value(target) {
223 + /**
224 + * This is function extending being called each time JS uses instanceOf, since babel use it each time it create new class
225 + * its give's opportunity to mange capabilities of instanceOf operator.
226 + * saving current class each time will give option later to handle instanceOf manually.
227 + */
228 + var result = _superPropGet(InstanceType, Symbol.hasInstance, this, 2)([target]);
229 229
230 -//#endregion
231 -//#region node_modules/@babel/runtime/helpers/esm/superPropBase.js
232 - function _superPropBase(t, o) {
233 - for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t)););
234 - return t;
235 - }
230 + // Act normal when validate a class, which does not have instance type.
231 + if (target && !target.constructor.getInstanceType) {
232 + return result;
233 + }
234 + if (target) {
235 + if (!target.instanceTypes) {
236 + target.instanceTypes = [];
237 + }
238 + if (!result) {
239 + if (this.getInstanceType() === target.constructor.getInstanceType()) {
240 + result = true;
241 + }
242 + }
243 + if (result) {
244 + var name = this.getInstanceType === InstanceType.getInstanceType ? 'BaseInstanceType' : this.getInstanceType();
245 + if (-1 === target.instanceTypes.indexOf(name)) {
246 + target.instanceTypes.push(name);
247 + }
248 + }
249 + }
250 + if (!result && target) {
251 + // Check if the given 'target', is instance of known types.
252 + result = target.instanceTypes && Array.isArray(target.instanceTypes) && -1 !== target.instanceTypes.indexOf(this.getInstanceType());
253 + }
254 + return result;
255 + }
256 + }, {
257 + key: "getInstanceType",
258 + value: function getInstanceType() {
259 + elementorModules.ForceMethodImplementation();
260 + }
261 + }]);
262 +}();
236 263
237 -//#endregion
238 -//#region node_modules/@babel/runtime/helpers/esm/get.js
239 - function _get() {
240 - return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function(e, t, r) {
241 - var p = _superPropBase(e, t);
242 - if (p) {
243 - var n = Object.getOwnPropertyDescriptor(p, t);
244 - return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value;
245 - }
246 - }, _get.apply(null, arguments);
247 - }
264 +/***/ }),
248 265
249 -//#endregion
250 -//#region assets/dev/js/modules/imports/instance-type.js
251 - function _superPropGet$5(t, o, e, r) {
252 - var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e);
253 - return 2 & r && "function" == typeof p ? function(t) {
254 - return p.apply(e, t);
255 - } : p;
256 - }
257 - __name(_superPropGet$5, "_superPropGet");
258 - var InstanceType = /*#__PURE__*/ function() {
259 - function InstanceType() {
260 - var _this = this;
261 - _classCallCheck(this, InstanceType);
262 - var target = this instanceof InstanceType ? this.constructor : void 0;
263 - var prototypes = [];
264 - while (target.__proto__ && target.__proto__.name) {
265 - prototypes.push(target.__proto__);
266 - target = target.__proto__;
267 - }
268 - prototypes.reverse().forEach(function(proto) {
269 - return _this instanceof proto;
270 - });
271 - }
272 - return _createClass(InstanceType, null, [{
273 - key: Symbol.hasInstance,
274 - value: function value(target) {
275 - /**
276 - * This is function extending being called each time JS uses instanceOf, since babel use it each time it create new class
277 - * its give's opportunity to mange capabilities of instanceOf operator.
278 - * saving current class each time will give option later to handle instanceOf manually.
279 - */
280 - var result = _superPropGet$5(InstanceType, Symbol.hasInstance, this, 2)([target]);
281 - if (target && !target.constructor.getInstanceType) return result;
282 - if (target) {
283 - if (!target.instanceTypes) target.instanceTypes = [];
284 - if (!result) {
285 - if (this.getInstanceType() === target.constructor.getInstanceType()) result = true;
286 - }
287 - if (result) {
288 - var name = this.getInstanceType === InstanceType.getInstanceType ? "BaseInstanceType" : this.getInstanceType();
289 - if (-1 === target.instanceTypes.indexOf(name)) target.instanceTypes.push(name);
290 - }
291 - }
292 - if (!result && target) result = target.instanceTypes && Array.isArray(target.instanceTypes) && -1 !== target.instanceTypes.indexOf(this.getInstanceType());
293 - return result;
294 - }
295 - }, {
296 - key: "getInstanceType",
297 - value: function getInstanceType() {
298 - elementorModules.ForceMethodImplementation();
299 - }
300 - }]);
301 - }();
266 +/***/ "../assets/dev/js/modules/imports/module.js":
267 +/*!**************************************************!*\
268 + !*** ../assets/dev/js/modules/imports/module.js ***!
269 + \**************************************************/
270 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
302 271
303 -//#endregion
304 -//#region assets/dev/js/editor/utils/is-instanceof.js
305 - function _createForOfIteratorHelper$1(r, e) {
306 - var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
307 - if (!t) {
308 - if (Array.isArray(r) || (t = _unsupportedIterableToArray$1(r)) || e && r && "number" == typeof r.length) {
309 - t && (r = t);
310 - var _n = 0;
311 - var F = function F() {};
312 - return {
313 - s: F,
314 - n: function n() {
315 - return _n >= r.length ? { done: !0 } : {
316 - done: !1,
317 - value: r[_n++]
318 - };
319 - },
320 - e: function e(r) {
321 - throw r;
322 - },
323 - f: F
324 - };
325 - }
326 - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
327 - }
328 - var o;
329 - var a = !0;
330 - var u = !1;
331 - return {
332 - s: function s() {
333 - t = t.call(r);
334 - },
335 - n: function n() {
336 - var r = t.next();
337 - return a = r.done, r;
338 - },
339 - e: function e(r) {
340 - u = !0, o = r;
341 - },
342 - f: function f() {
343 - try {
344 - a || null == t.return || t.return();
345 - } finally {
346 - if (u) throw o;
347 - }
348 - }
349 - };
350 - }
351 - __name(_createForOfIteratorHelper$1, "_createForOfIteratorHelper");
352 - function _unsupportedIterableToArray$1(r, a) {
353 - if (r) {
354 - if ("string" == typeof r) return _arrayLikeToArray$1(r, a);
355 - var t = {}.toString.call(r).slice(8, -1);
356 - 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$1(r, a) : void 0;
357 - }
358 - }
359 - __name(_unsupportedIterableToArray$1, "_unsupportedIterableToArray");
360 - function _arrayLikeToArray$1(r, a) {
361 - (null == a || a > r.length) && (a = r.length);
362 - for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
363 - return n;
364 - }
365 - __name(_arrayLikeToArray$1, "_arrayLikeToArray");
366 - /**
367 - * Some FileAPI objects such as FileList, DataTransferItem and DataTransferItemList has inconsistency with the retrieved
368 - * object (from events, etc.) and the actual JavaScript object so a regular instanceof doesn't work. This function can
369 - * check whether it's instanceof by using the objects constructor and prototype names.
370 - *
371 - * @param object
372 - * @param constructors
373 - * @return {boolean}
374 - */
375 - var is_instanceof_default = /* @__PURE__ */ __name((function(object, constructors) {
376 - constructors = Array.isArray(constructors) ? constructors : [constructors];
377 - var _iterator = _createForOfIteratorHelper$1(constructors);
378 - var _step;
379 - try {
380 - for (_iterator.s(); !(_step = _iterator.n()).done;) {
381 - var constructor = _step.value;
382 - if (object.constructor.name === constructor.prototype[Symbol.toStringTag]) return true;
383 - }
384 - } catch (err) {
385 - _iterator.e(err);
386 - } finally {
387 - _iterator.f();
388 - }
389 - return false;
390 - }), "default");
272 +"use strict";
391 273
392 -//#endregion
393 -//#region assets/dev/js/modules/imports/args-object.js
394 - init_typeof();
395 - function _callSuper$35(t, o, e) {
396 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$36() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
397 - }
398 - __name(_callSuper$35, "_callSuper");
399 - function _isNativeReflectConstruct$36() {
400 - try {
401 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
402 - } catch (t) {}
403 - return (_isNativeReflectConstruct$36 = function _isNativeReflectConstruct() {
404 - return !!t;
405 - })();
406 - }
407 - __name(_isNativeReflectConstruct$36, "_isNativeReflectConstruct");
408 - var ArgsObject = /*#__PURE__*/ function(_InstanceType) {
409 - /**
410 - * Function constructor().
411 - *
412 - * Create ArgsObject.
413 - *
414 - * @param {{}} args
415 - */
416 - function ArgsObject(args) {
417 - var _this;
418 - _classCallCheck(this, ArgsObject);
419 - _this = _callSuper$35(this, ArgsObject);
420 - _this.args = args;
421 - return _this;
422 - }
423 - /**
424 - * Function requireArgument().
425 - *
426 - * Validate property in args.
427 - *
428 - * @param {string} property
429 - * @param {{}} args
430 - *
431 - * @throws {Error}
432 - */
433 - _inherits(ArgsObject, _InstanceType);
434 - return _createClass(ArgsObject, [
435 - {
436 - key: "requireArgument",
437 - value: function requireArgument(property) {
438 - var args = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.args;
439 - if (!Object.prototype.hasOwnProperty.call(args, property)) throw Error("".concat(property, " is required."));
440 - }
441 - },
442 - {
443 - key: "requireArgumentType",
444 - value: function requireArgumentType(property, type) {
445 - var args = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : this.args;
446 - this.requireArgument(property, args);
447 - if (_typeof(args[property]) !== type) throw Error("".concat(property, " invalid type: ").concat(type, "."));
448 - }
449 - },
450 - {
451 - key: "requireArgumentInstance",
452 - value: function requireArgumentInstance(property, instance) {
453 - var args = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : this.args;
454 - this.requireArgument(property, args);
455 - if (!(args[property] instanceof instance) && !is_instanceof_default(args[property], instance)) throw Error("".concat(property, " invalid instance."));
456 - }
457 - },
458 - {
459 - key: "requireArgumentConstructor",
460 - value: function requireArgumentConstructor(property, type) {
461 - var args = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : this.args;
462 - this.requireArgument(property, args);
463 - if (args[property].constructor.toString() !== type.prototype.constructor.toString()) throw Error("".concat(property, " invalid constructor type."));
464 - }
465 - }
466 - ], [{
467 - key: "getInstanceType",
468 - value: function getInstanceType() {
469 - return "ArgsObject";
470 - }
471 - }]);
472 - }(InstanceType);
473 274
474 -//#endregion
475 -//#region modules/web-cli/assets/js/utils/console.js
476 - var Console = /*#__PURE__*/ function() {
477 - function Console() {
478 - _classCallCheck(this, Console);
479 - }
480 - return _createClass(Console, null, [{
481 - key: "error",
482 - value: function error(message) {
483 - if ($e.devTools) $e.devTools.log.error(message);
484 - if (!(message instanceof $e.modules.HookBreak)) console.error(message);
485 - }
486 - }, {
487 - key: "warn",
488 - value: function warn() {
489 - var _console;
490 - var style = "font-size: 12px; background-image: url(\"".concat(elementorWebCliConfig.urls.assets, "images/logo-icon.png\"); background-repeat: no-repeat; background-size: contain;");
491 - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
492 - args.unshift("%c %c", style, "");
493 - (_console = console).warn.apply(_console, args);
494 - }
495 - }]);
496 - }();
275 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
276 +var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"));
277 +var Module = function Module() {
278 + var $ = jQuery,
279 + instanceParams = arguments,
280 + self = this,
281 + events = {};
282 + var settings;
283 + var ensureClosureMethods = function ensureClosureMethods() {
284 + $.each(self, function (methodName) {
285 + var oldMethod = self[methodName];
286 + if ('function' !== typeof oldMethod) {
287 + return;
288 + }
289 + self[methodName] = function () {
290 + return oldMethod.apply(self, arguments);
291 + };
292 + });
293 + };
294 + var initSettings = function initSettings() {
295 + settings = self.getDefaultSettings();
296 + var instanceSettings = instanceParams[0];
297 + if (instanceSettings) {
298 + $.extend(true, settings, instanceSettings);
299 + }
300 + };
301 + var init = function init() {
302 + self.__construct.apply(self, instanceParams);
303 + ensureClosureMethods();
304 + initSettings();
305 + self.trigger('init');
306 + };
307 + this.getItems = function (items, itemKey) {
308 + if (itemKey) {
309 + var keyStack = itemKey.split('.'),
310 + currentKey = keyStack.splice(0, 1);
311 + if (!keyStack.length) {
312 + return items[currentKey];
313 + }
314 + if (!items[currentKey]) {
315 + return;
316 + }
317 + return this.getItems(items[currentKey], keyStack.join('.'));
318 + }
319 + return items;
320 + };
321 + this.getSettings = function (setting) {
322 + return this.getItems(settings, setting);
323 + };
324 + this.setSettings = function (settingKey, value, settingsContainer) {
325 + if (!settingsContainer) {
326 + settingsContainer = settings;
327 + }
328 + if ('object' === (0, _typeof2.default)(settingKey)) {
329 + $.extend(settingsContainer, settingKey);
330 + return self;
331 + }
332 + var keyStack = settingKey.split('.'),
333 + currentKey = keyStack.splice(0, 1);
334 + if (!keyStack.length) {
335 + settingsContainer[currentKey] = value;
336 + return self;
337 + }
338 + if (!settingsContainer[currentKey]) {
339 + settingsContainer[currentKey] = {};
340 + }
341 + return self.setSettings(keyStack.join('.'), value, settingsContainer[currentKey]);
342 + };
343 + this.getErrorMessage = function (type, functionName) {
344 + var message;
345 + switch (type) {
346 + case 'forceMethodImplementation':
347 + message = "The method '".concat(functionName, "' must to be implemented in the inheritor child.");
348 + break;
349 + default:
350 + message = 'An error occurs';
351 + }
352 + return message;
353 + };
497 354
498 -//#endregion
499 -//#region modules/web-cli/assets/js/utils/deprecation.js
355 + // TODO: This function should be deleted ?.
356 + this.forceMethodImplementation = function (functionName) {
357 + throw new Error(this.getErrorMessage('forceMethodImplementation', functionName));
358 + };
359 + this.on = function (eventName, callback) {
360 + if ('object' === (0, _typeof2.default)(eventName)) {
361 + $.each(eventName, function (singleEventName) {
362 + self.on(singleEventName, this);
363 + });
364 + return self;
365 + }
366 + var eventNames = eventName.split(' ');
367 + eventNames.forEach(function (singleEventName) {
368 + if (!events[singleEventName]) {
369 + events[singleEventName] = [];
370 + }
371 + events[singleEventName].push(callback);
372 + });
373 + return self;
374 + };
375 + this.off = function (eventName, callback) {
376 + if (!events[eventName]) {
377 + return self;
378 + }
379 + if (!callback) {
380 + delete events[eventName];
381 + return self;
382 + }
383 + var callbackIndex = events[eventName].indexOf(callback);
384 + if (-1 !== callbackIndex) {
385 + delete events[eventName][callbackIndex];
386 +
387 + // Reset array index (for next off on same event).
388 + events[eventName] = events[eventName].filter(function (val) {
389 + return val;
390 + });
391 + }
392 + return self;
393 + };
394 + this.trigger = function (eventName) {
395 + var methodName = 'on' + eventName[0].toUpperCase() + eventName.slice(1),
396 + params = Array.prototype.slice.call(arguments, 1);
397 + if (self[methodName]) {
398 + self[methodName].apply(self, params);
399 + }
400 + var callbacks = events[eventName];
401 + if (!callbacks) {
402 + return self;
403 + }
404 + $.each(callbacks, function (index, callback) {
405 + callback.apply(self, params);
406 + });
407 + return self;
408 + };
409 + init();
410 +};
411 +Module.prototype.__construct = function () {};
412 +Module.prototype.getDefaultSettings = function () {
413 + return {};
414 +};
415 +Module.prototype.getConstructorID = function () {
416 + return this.constructor.name;
417 +};
418 +Module.extend = function (properties) {
419 + var $ = jQuery,
420 + parent = this;
421 + var child = function child() {
422 + return parent.apply(this, arguments);
423 + };
424 + $.extend(child, parent);
425 + child.prototype = Object.create($.extend({}, parent.prototype, properties));
426 + child.prototype.constructor = child;
427 + child.__super__ = parent.prototype;
428 + return child;
429 +};
430 +module.exports = Module;
431 +
432 +/***/ }),
433 +
434 +/***/ "../modules/web-cli/assets/js/api.js":
435 +/*!*******************************************!*\
436 + !*** ../modules/web-cli/assets/js/api.js ***!
437 + \*******************************************/
438 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
439 +
440 +"use strict";
441 +
442 +
443 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
444 +var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js");
445 +Object.defineProperty(exports, "__esModule", ({
446 + value: true
447 +}));
448 +exports["default"] = void 0;
449 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
450 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
451 +var _backwardsCompatibility = _interopRequireDefault(__webpack_require__(/*! ./core/backwards-compatibility */ "../modules/web-cli/assets/js/core/backwards-compatibility.js"));
452 +var _commandBase = _interopRequireDefault(__webpack_require__(/*! ./modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js"));
453 +var _commandInternalBase = _interopRequireDefault(__webpack_require__(/*! ./modules/command-internal-base */ "../modules/web-cli/assets/js/modules/command-internal-base.js"));
454 +var _commandData = _interopRequireDefault(__webpack_require__(/*! ./modules/command-data */ "../modules/web-cli/assets/js/modules/command-data.js"));
455 +var _commands = _interopRequireDefault(__webpack_require__(/*! ./core/commands */ "../modules/web-cli/assets/js/core/commands.js"));
456 +var _commandsInternal = _interopRequireDefault(__webpack_require__(/*! ./core/commands-internal */ "../modules/web-cli/assets/js/core/commands-internal.js"));
457 +var _componentBase = _interopRequireDefault(__webpack_require__(/*! ./modules/component-base */ "../modules/web-cli/assets/js/modules/component-base.js"));
458 +var _componentModalBase = _interopRequireDefault(__webpack_require__(/*! ./modules/component-modal-base */ "../modules/web-cli/assets/js/modules/component-modal-base.js"));
459 +var _components = _interopRequireDefault(__webpack_require__(/*! ./core/components */ "../modules/web-cli/assets/js/core/components.js"));
460 +var _data = _interopRequireDefault(__webpack_require__(/*! ./core/data.js */ "../modules/web-cli/assets/js/core/data.js"));
461 +var _hashCommands = _interopRequireDefault(__webpack_require__(/*! ./extras/hash-commands */ "../modules/web-cli/assets/js/extras/hash-commands.js"));
462 +var _hookBreak = _interopRequireDefault(__webpack_require__(/*! ./modules/hook-break */ "../modules/web-cli/assets/js/modules/hook-break.js"));
463 +var _hooks = _interopRequireDefault(__webpack_require__(/*! ./core/hooks */ "../modules/web-cli/assets/js/core/hooks.js"));
464 +var _routes = _interopRequireDefault(__webpack_require__(/*! ./core/routes */ "../modules/web-cli/assets/js/core/routes.js"));
465 +var _shortcuts = _interopRequireDefault(__webpack_require__(/*! ./core/shortcuts */ "../modules/web-cli/assets/js/core/shortcuts.js"));
466 +var _store = _interopRequireDefault(__webpack_require__(/*! ./core/store */ "../modules/web-cli/assets/js/core/store.js"));
467 +var _uiStates = _interopRequireDefault(__webpack_require__(/*! ./core/ui-states */ "../modules/web-cli/assets/js/core/ui-states.js"));
468 +var hookData = _interopRequireWildcard(__webpack_require__(/*! ./modules/hooks/data/ */ "../modules/web-cli/assets/js/modules/hooks/data/index.js"));
469 +var hookUI = _interopRequireWildcard(__webpack_require__(/*! ./modules/hooks/ui */ "../modules/web-cli/assets/js/modules/hooks/ui/index.js"));
470 +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); }
471 +/* Alphabetical order */
472 +var API = exports["default"] = /*#__PURE__*/function () {
473 + /**
474 + * Function constructor().
475 + *
476 + * Create's 'elementor' api.
477 + */
478 + function API() {
479 + (0, _classCallCheck2.default)(this, API);
480 + this.components = new _components.default();
481 + this.commands = new _commands.default();
482 + this.commandsInternal = new _commandsInternal.default();
483 + this.hooks = new _hooks.default();
484 + this.routes = new _routes.default();
485 + this.shortcuts = new _shortcuts.default(jQuery(window));
486 + this.data = new _data.default();
487 + this.store = new _store.default();
488 + this.uiStates = new _uiStates.default();
489 + this.modules = {
490 + CommandBase: _commandBase.default,
491 + CommandInternalBase: _commandInternalBase.default,
492 + CommandData: _commandData.default,
493 + ComponentBase: _componentBase.default,
494 + ComponentModalBase: _componentModalBase.default,
495 + HookBreak: _hookBreak.default,
496 + hookData: hookData,
497 + hookUI: hookUI
498 + };
499 + this.extras = {
500 + hashCommands: new _hashCommands.default()
501 + };
502 +
503 + // Backwards compatibility should be last, in order to handle others.
504 + this.bc = new _backwardsCompatibility.default();
505 + }
506 +
507 + /**
508 + * Function run().
509 + *
510 + * Alias of `$e.commands.run()`.
511 + *
512 + * @param {string} command
513 + * @param {*} [args={}]
514 + *
515 + * @return {*} result
516 + */
517 + return (0, _createClass2.default)(API, [{
518 + key: "run",
519 + value: function run(command) {
520 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
521 + return $e.commands.run(command, args);
522 + }
523 +
524 + /**
525 + * Function internal().
526 + *
527 + * Alias of `$e.commandsInternal.run()`.
528 + *
529 + * @param {string} command
530 + * @param {*} [args={}]
531 + *
532 + * @return {boolean} result
533 + */
534 + }, {
535 + key: "internal",
536 + value: function internal(command) {
537 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
538 + return $e.commandsInternal.run(command, args);
539 + }
540 +
541 + /**
542 + * Function route().
543 + *
544 + * Alias of `$e.routes.to()`.
545 + *
546 + * @param {string} route
547 + * @param {*} [args={}]
548 + * @param {Object} [options]
549 + */
550 + }, {
551 + key: "route",
552 + value: function route(_route) {
553 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
554 + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
555 + history: true
556 + };
557 + return $e.routes.to(_route, args, options);
558 + }
559 +
560 + // TODO: shortcut();
561 + }]);
562 +}();
563 +
564 +/***/ }),
565 +
566 +/***/ "../modules/web-cli/assets/js/core/backwards-compatibility.js":
567 +/*!********************************************************************!*\
568 + !*** ../modules/web-cli/assets/js/core/backwards-compatibility.js ***!
569 + \********************************************************************/
570 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
571 +
572 +"use strict";
573 +
574 +
575 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
576 +Object.defineProperty(exports, "__esModule", ({
577 + value: true
578 +}));
579 +exports["default"] = void 0;
580 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
581 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
582 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
583 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
584 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
585 +var _componentBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/component-base */ "../modules/web-cli/assets/js/modules/component-base.js"));
586 +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)); }
587 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
588 +var BackwardsCompatibility = exports["default"] = /*#__PURE__*/function () {
589 + function BackwardsCompatibility() {
590 + (0, _classCallCheck2.default)(this, BackwardsCompatibility);
591 + }
592 + return (0, _createClass2.default)(BackwardsCompatibility, [{
593 + key: "ensureTab",
594 + value: function ensureTab(namespace, tabSlug) {
595 + var page = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
596 + var component = $e.components.get(namespace);
597 + if (!component) {
598 + var Component = /*#__PURE__*/function (_ComponentBase) {
599 + function Component() {
600 + (0, _classCallCheck2.default)(this, Component);
601 + return _callSuper(this, Component, arguments);
602 + }
603 + (0, _inherits2.default)(Component, _ComponentBase);
604 + return (0, _createClass2.default)(Component, [{
605 + key: "getNamespace",
606 + value: function getNamespace() {
607 + return namespace;
608 + }
609 + }, {
610 + key: "renderTab",
611 + value: function renderTab(tab) {
612 + elementor.getPanelView().setPage(page).activateTab(tab);
613 + }
614 + }]);
615 + }(_componentBase.default);
616 + component = $e.components.register(new Component());
617 + }
618 + if (!component.hasTab(tabSlug) && elementor.config.tabs[tabSlug]) {
619 + component.addTab(tabSlug, {
620 + title: elementor.config.tabs[tabSlug]
621 + });
622 + }
623 + }
624 + }]);
625 +}();
626 +
627 +/***/ }),
628 +
629 +/***/ "../modules/web-cli/assets/js/core/backwards-compatibility/commands.js":
630 +/*!*****************************************************************************!*\
631 + !*** ../modules/web-cli/assets/js/core/backwards-compatibility/commands.js ***!
632 + \*****************************************************************************/
633 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
634 +
635 +"use strict";
636 +
637 +
638 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
639 +Object.defineProperty(exports, "__esModule", ({
640 + value: true
641 +}));
642 +exports["default"] = void 0;
643 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
644 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
645 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
646 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
647 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
648 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
649 +var _module = _interopRequireDefault(__webpack_require__(/*! elementor-assets-js/modules/imports/module.js */ "../assets/dev/js/modules/imports/module.js"));
650 +var _deprecation = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/deprecation */ "../modules/web-cli/assets/js/utils/deprecation.js"));
651 +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)); }
652 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
653 +var CommandsBackwardsCompatibility = exports["default"] = /*#__PURE__*/function (_Module) {
654 + function CommandsBackwardsCompatibility() {
655 + var _this;
656 + (0, _classCallCheck2.default)(this, CommandsBackwardsCompatibility);
657 + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
658 + args[_key] = arguments[_key];
659 + }
660 + _this = _callSuper(this, CommandsBackwardsCompatibility, [].concat(args));
661 + (0, _defineProperty2.default)(_this, "on", function (eventName, callback) {
662 + if ('run' === eventName) {
663 + var componentName = _this.getConstructorID();
664 +
665 + // Regex takes the first letter and convert it to lower case.
666 + componentName = componentName.replace(/^./, function (val) {
667 + return val.toLowerCase();
668 + });
669 + _deprecation.default.deprecated("$e.".concat(componentName, ".on( 'run', ... )"), '3.0.0', "$e.".concat(componentName, ".on( 'run:before', ... )"));
670 + _this.onOrig('run:before', callback);
671 + return;
672 + }
673 + _this.onOrig(eventName, callback);
674 + });
675 + return _this;
676 + }
677 + (0, _inherits2.default)(CommandsBackwardsCompatibility, _Module);
678 + return (0, _createClass2.default)(CommandsBackwardsCompatibility, [{
679 + key: "__construct",
680 + value: function __construct() {
681 + this.onOrig = this.on;
682 + }
683 + }]);
684 +}(_module.default);
685 +
686 +/***/ }),
687 +
688 +/***/ "../modules/web-cli/assets/js/core/commands-internal.js":
689 +/*!**************************************************************!*\
690 + !*** ../modules/web-cli/assets/js/core/commands-internal.js ***!
691 + \**************************************************************/
692 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
693 +
694 +"use strict";
695 +
696 +
697 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
698 +Object.defineProperty(exports, "__esModule", ({
699 + value: true
700 +}));
701 +exports["default"] = void 0;
702 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
703 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
704 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
705 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
706 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
707 +var _commands = _interopRequireDefault(__webpack_require__(/*! ./commands.js */ "../modules/web-cli/assets/js/core/commands.js"));
708 +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)); }
709 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
710 +var CommandsInternal = exports["default"] = /*#__PURE__*/function (_Commands) {
711 + function CommandsInternal() {
712 + (0, _classCallCheck2.default)(this, CommandsInternal);
713 + return _callSuper(this, CommandsInternal, arguments);
714 + }
715 + (0, _inherits2.default)(CommandsInternal, _Commands);
716 + return (0, _createClass2.default)(CommandsInternal, [{
717 + key: "error",
718 + value: function error(message) {
719 + throw Error('Commands internal: ' + message);
720 + }
721 + }]);
722 +}(_commands.default);
723 +
724 +/***/ }),
725 +
726 +/***/ "../modules/web-cli/assets/js/core/commands.js":
727 +/*!*****************************************************!*\
728 + !*** ../modules/web-cli/assets/js/core/commands.js ***!
729 + \*****************************************************/
730 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
731 +
732 +"use strict";
733 +
734 +
735 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
736 +Object.defineProperty(exports, "__esModule", ({
737 + value: true
738 +}));
739 +exports["default"] = void 0;
740 +var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js"));
741 +var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js"));
742 +var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"));
743 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
744 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
745 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
746 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
747 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
748 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
749 +var _commands = _interopRequireDefault(__webpack_require__(/*! ./backwards-compatibility/commands */ "../modules/web-cli/assets/js/core/backwards-compatibility/commands.js"));
750 +var _commandBase = _interopRequireDefault(__webpack_require__(/*! ../modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js"));
751 +var _console = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/console */ "../modules/web-cli/assets/js/utils/console.js"));
752 +var _deprecation = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/deprecation */ "../modules/web-cli/assets/js/utils/deprecation.js"));
753 +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; }
754 +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; }
755 +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)); }
756 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
500 757 /**
501 - * @typedef {Object} Version
502 - * @property {number} major1 The first number
503 - * @property {number} major2 The second number
504 - * @property {number} minor The third number
505 - * @property {string} build The fourth number
506 - */
507 - var softDeprecated = function softDeprecated(name, version, replacement) {
508 - if (elementorWebCliConfig.isDebug) deprecatedMessage("soft", name, version, replacement);
509 - };
510 - var hardDeprecated = function hardDeprecated(name, version, replacement) {
511 - deprecatedMessage("hard", name, version, replacement);
512 - };
513 - var deprecatedMessage = function deprecatedMessage(type, name, version, replacement) {
514 - var message = "`".concat(name, "` is ").concat(type, " deprecated since ").concat(version);
515 - if (replacement) message += " - Use `".concat(replacement, "` instead");
516 - Console.warn(message);
517 - };
518 - var Deprecation = /*#__PURE__*/ function() {
519 - function Deprecation() {
520 - _classCallCheck(this, Deprecation);
521 - }
522 - return _createClass(Deprecation, null, [
523 - {
524 - key: "deprecated",
525 - value: function deprecated(name, version, replacement) {
526 - if (this.isHardDeprecated(version)) hardDeprecated(name, version, replacement);
527 - else softDeprecated(name, version, replacement);
528 - }
529 - },
530 - {
531 - key: "parseVersion",
532 - value: function parseVersion(version) {
533 - var versionParts = version.split(".");
534 - if (versionParts.length < 3 || versionParts.length > 4) throw new RangeError("Invalid Semantic Version string provided");
535 - var _versionParts = _slicedToArray(versionParts, 4);
536 - var major1 = _versionParts[0];
537 - var major2 = _versionParts[1];
538 - var minor = _versionParts[2];
539 - var _versionParts$ = _versionParts[3];
540 - return {
541 - major1: parseInt(major1),
542 - major2: parseInt(major2),
543 - minor: parseInt(minor),
544 - build: _versionParts$ === void 0 ? "" : _versionParts$
545 - };
546 - }
547 - },
548 - {
549 - key: "getTotalMajor",
550 - value: function getTotalMajor(versionObj) {
551 - var total = parseInt("".concat(versionObj.major1).concat(versionObj.major2, "0"));
552 - total = Number((total / 10).toFixed(0));
553 - if (versionObj.major2 > 9) total = versionObj.major2 - 9;
554 - return total;
555 - }
556 - },
557 - {
558 - key: "compareVersion",
559 - value: function compareVersion(version1, version2) {
560 - var _this = this;
561 - return [this.parseVersion(version1), this.parseVersion(version2)].map(function(versionObj) {
562 - return _this.getTotalMajor(versionObj);
563 - }).reduce(function(acc, major) {
564 - return acc - major;
565 - });
566 - }
567 - },
568 - {
569 - key: "isSoftDeprecated",
570 - value: function isSoftDeprecated(version) {
571 - return this.compareVersion(version, elementorWebCliConfig.version) <= 4;
572 - }
573 - },
574 - {
575 - key: "isHardDeprecated",
576 - value: function isHardDeprecated(version) {
577 - var total = this.compareVersion(version, elementorWebCliConfig.version);
578 - return total < 0 || total >= 8;
579 - }
580 - }
581 - ]);
582 - }();
758 + * @typedef {import('../modules/component-base')} ComponentBase
759 + */
760 +/**
761 + * @typedef {import('../modules/command-base')} CommandBase
762 + */
763 +/**
764 + * @typedef {{}} Component
765 + */
766 +var Commands = exports["default"] = /*#__PURE__*/function (_CommandsBackwardsCom) {
767 + /**
768 + * Function constructor().
769 + *
770 + * Create `$e.commands` API.
771 + *
772 + * @param {{}} args
773 + */
774 + function Commands() {
775 + var _this;
776 + (0, _classCallCheck2.default)(this, Commands);
777 + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
778 + args[_key] = arguments[_key];
779 + }
780 + _this = _callSuper(this, Commands, [].concat(args));
781 + _this.current = {};
782 + _this.currentArgs = {};
783 + _this.currentTrace = [];
784 + _this.commands = {};
785 + _this.components = {};
786 + Object.defineProperty(_this, 'classes', {
787 + get: function get() {
788 + _deprecation.default.deprecated('$e.commands.classes', '3.7.0', '$e.commands.getCommandClass(), $e.commandsInternal.getCommandClass(), $e.data.getCommandClass(), $e.routes.getCommandClass() according to the requested command infra-structure,');
789 + return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, $e.commands.commands), $e.commandsInternal.commands), $e.data.commands), $e.routes.commands);
790 + }
791 + });
792 + return _this;
793 + }
583 794
584 -//#endregion
585 -//#region modules/web-cli/assets/js/modules/command-infra.js
586 - function _callSuper$34(t, o, e) {
587 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$35() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
588 - }
589 - __name(_callSuper$34, "_callSuper");
590 - function _isNativeReflectConstruct$35() {
591 - try {
592 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
593 - } catch (t) {}
594 - return (_isNativeReflectConstruct$35 = function _isNativeReflectConstruct() {
595 - return !!t;
596 - })();
597 - }
598 - __name(_isNativeReflectConstruct$35, "_isNativeReflectConstruct");
599 - /**
600 - * @typedef {import('../modules/component-base')} ComponentBase
601 - */
602 - var CommandInfra = /*#__PURE__*/ function(_ArgsObject) {
603 - /**
604 - * Function constructor().
605 - *
606 - * Create Commands Base.
607 - *
608 - * @param {{}} args
609 - */
610 - function CommandInfra() {
611 - var _this;
612 - var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
613 - _classCallCheck(this, CommandInfra);
614 - _this = _callSuper$34(this, CommandInfra, [args]);
615 - if (!_this.constructor.registerConfig) throw RangeError("Doing it wrong: Each command type should have `registerConfig`.");
616 - _this.command = _this.constructor.getCommand();
617 - _this.component = _this.constructor.getComponent();
618 - _this.initialize(args);
619 - args = _this.args;
620 - _this.validateArgs(args);
621 - return _this;
622 - }
623 - /**
624 - * Function initialize().
625 - *
626 - * Initialize command, called after construction.
627 - *
628 - * @param {{}} args
629 - */
630 - _inherits(CommandInfra, _ArgsObject);
631 - return _createClass(CommandInfra, [
632 - {
633 - key: "currentCommand",
634 - get: function get() {
635 - Deprecation.deprecated("this.currentCommand", "3.7.0", "this.command");
636 - return this.command;
637 - }
638 - },
639 - {
640 - key: "initialize",
641 - value: function initialize() {
642 - arguments.length > 0 && arguments[0] !== void 0 && arguments[0];
643 - }
644 - },
645 - {
646 - key: "validateArgs",
647 - value: function validateArgs() {
648 - arguments.length > 0 && arguments[0] !== void 0 && arguments[0];
649 - }
650 - },
651 - {
652 - key: "apply",
653 - value: function apply() {
654 - arguments.length > 0 && arguments[0] !== void 0 && arguments[0];
655 - elementorModules.ForceMethodImplementation();
656 - }
657 - },
658 - {
659 - key: "run",
660 - value: function run() {
661 - return this.apply(this.args);
662 - }
663 - },
664 - {
665 - key: "onBeforeRun",
666 - value: function onBeforeRun() {
667 - arguments.length > 0 && arguments[0] !== void 0 && arguments[0];
668 - }
669 - },
670 - {
671 - key: "onAfterRun",
672 - value: function onAfterRun() {
673 - arguments.length > 0 && arguments[0] !== void 0 && arguments[0];
674 - arguments.length > 1 && arguments[1];
675 - }
676 - },
677 - {
678 - key: "onBeforeApply",
679 - value: function onBeforeApply() {
680 - arguments.length > 0 && arguments[0] !== void 0 && arguments[0];
681 - }
682 - },
683 - {
684 - key: "onAfterApply",
685 - value: function onAfterApply() {
686 - arguments.length > 0 && arguments[0] !== void 0 && arguments[0];
687 - arguments.length > 1 && arguments[1];
688 - }
689 - },
690 - {
691 - key: "onCatchApply",
692 - value: function onCatchApply(e) {}
693 - }
694 - ], [
695 - {
696 - key: "getInstanceType",
697 - value: function getInstanceType() {
698 - return "CommandInfra";
699 - }
700 - },
701 - {
702 - key: "getInfo",
703 - value: function getInfo() {
704 - return {};
705 - }
706 - },
707 - {
708 - key: "getCommand",
709 - value: function getCommand() {
710 - return this.registerConfig.command;
711 - }
712 - },
713 - {
714 - key: "getComponent",
715 - value: function getComponent() {
716 - return this.registerConfig.component;
717 - }
718 - },
719 - {
720 - key: "setRegisterConfig",
721 - value: function setRegisterConfig(config) {
722 - this.registerConfig = Object.freeze(config);
723 - }
724 - }
725 - ]);
726 - }(ArgsObject);
727 - /**
728 - * @type {Object}
729 - */
730 - _defineProperty(CommandInfra, "registerConfig", null);
795 + /**
796 + * @param {string} id
797 + * @return {CommandBase} command class
798 + */
799 + (0, _inherits2.default)(Commands, _CommandsBackwardsCom);
800 + return (0, _createClass2.default)(Commands, [{
801 + key: "getCommandClass",
802 + value: function getCommandClass(id) {
803 + return this.commands[id];
804 + }
731 805
732 -//#endregion
733 -//#region modules/web-cli/assets/js/modules/command-base.js
734 - function _callSuper$33(t, o, e) {
735 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$34() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
736 - }
737 - __name(_callSuper$33, "_callSuper");
738 - function _isNativeReflectConstruct$34() {
739 - try {
740 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
741 - } catch (t) {}
742 - return (_isNativeReflectConstruct$34 = function _isNativeReflectConstruct() {
743 - return !!t;
744 - })();
745 - }
746 - __name(_isNativeReflectConstruct$34, "_isNativeReflectConstruct");
747 - /**
748 - * @name $e.modules.CommandBase
749 - */
750 - var CommandBase = /*#__PURE__*/ function(_CommandInfra) {
751 - function CommandBase() {
752 - _classCallCheck(this, CommandBase);
753 - return _callSuper$33(this, CommandBase, arguments);
754 - }
755 - _inherits(CommandBase, _CommandInfra);
756 - return _createClass(CommandBase, [
757 - {
758 - key: "onBeforeRun",
759 - value: function onBeforeRun() {
760 - var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
761 - $e.hooks.runUIBefore(this.command, args);
762 - }
763 - },
764 - {
765 - key: "onAfterRun",
766 - value: function onAfterRun() {
767 - var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
768 - var result = arguments.length > 1 ? arguments[1] : void 0;
769 - $e.hooks.runUIAfter(this.command, args, result);
770 - }
771 - },
772 - {
773 - key: "onBeforeApply",
774 - value: function onBeforeApply() {
775 - var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
776 - $e.hooks.runDataDependency(this.command, args);
777 - }
778 - },
779 - {
780 - key: "onAfterApply",
781 - value: function onAfterApply() {
782 - var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
783 - var result = arguments.length > 1 ? arguments[1] : void 0;
784 - return $e.hooks.runDataAfter(this.command, args, result);
785 - }
786 - },
787 - {
788 - key: "onCatchApply",
789 - value: function onCatchApply(e) {
790 - this.runCatchHooks(e);
791 - }
792 - },
793 - {
794 - key: "runCatchHooks",
795 - value: function runCatchHooks(e) {
796 - $e.hooks.runDataCatch(this.command, this.args, e);
797 - $e.hooks.runUICatch(this.command, this.args, e);
798 - }
799 - },
800 - {
801 - key: "requireContainer",
802 - value: function requireContainer() {
803 - var _this = this;
804 - var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.args;
805 - Deprecation.deprecated("requireContainer()", "3.7.0", "Extend `$e.modules.editor.CommandContainerBase` or `$e.modules.editor.CommandContainerInternalBase`");
806 - if (!args.container && !args.containers) throw Error("container or containers are required.");
807 - if (args.container && args.containers) throw Error("container and containers cannot go together please select one of them.");
808 - (args.containers || [args.container]).forEach(function(container) {
809 - _this.requireArgumentInstance("container", elementorModules.editor.Container, { container });
810 - });
811 - }
812 - }
813 - ], [{
814 - key: "getInstanceType",
815 - value: function getInstanceType() {
816 - return "CommandBase";
817 - }
818 - }]);
819 - }(CommandInfra);
806 + /**
807 + * Function getAll().
808 + *
809 + * Receive all loaded commands.
810 + *
811 + * @return {string[]} commands
812 + */
813 + }, {
814 + key: "getAll",
815 + value: function getAll() {
816 + return Object.keys(this.commands).sort();
817 + }
820 818
821 -//#endregion
822 -//#region modules/web-cli/assets/js/modules/command-callback-base.js
823 - function _callSuper$32(t, o, e) {
824 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$33() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
825 - }
826 - __name(_callSuper$32, "_callSuper");
827 - function _isNativeReflectConstruct$33() {
828 - try {
829 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
830 - } catch (t) {}
831 - return (_isNativeReflectConstruct$33 = function _isNativeReflectConstruct() {
832 - return !!t;
833 - })();
834 - }
835 - __name(_isNativeReflectConstruct$33, "_isNativeReflectConstruct");
836 - /**
837 - * To support pure callbacks in the API(commands.js), to ensure they have registered with the proper context.
838 - */
839 - var CommandCallbackBase = /*#__PURE__*/ function(_CommandBase) {
840 - function CommandCallbackBase() {
841 - _classCallCheck(this, CommandCallbackBase);
842 - return _callSuper$32(this, CommandCallbackBase, arguments);
843 - }
844 - _inherits(CommandCallbackBase, _CommandBase);
845 - return _createClass(CommandCallbackBase, [{
846 - key: "apply",
847 - value: function apply() {
848 - var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
849 - return this.constructor.getCallback()(args);
850 - }
851 - }], [{
852 - key: "getInstanceType",
853 - value: function getInstanceType() {
854 - return "CommandCallbackBase";
855 - }
856 - }, {
857 - key: "getCallback",
858 - value: function getCallback() {
859 - return this.registerConfig.callback;
860 - }
861 - }]);
862 - }(CommandBase);
819 + /**
820 + * Function register().
821 + *
822 + * Register new command.
823 + *
824 + * @param {ComponentBase|string} component
825 + * @param {string} command
826 + * @param {Function} callback
827 + *
828 + * @return {Commands} commands
829 + */
830 + }, {
831 + key: "register",
832 + value: function register(component, command, callback) {
833 + var _this2 = this;
834 + var namespace;
835 + if ('string' === typeof component) {
836 + namespace = component;
837 + component = $e.components.get(namespace);
838 + if (!component) {
839 + this.error("'".concat(namespace, "' component is not exist."));
840 + }
841 + } else {
842 + namespace = component.getNamespace();
843 + }
844 + var fullCommand = namespace + (command ? '/' + command : '');
845 + if (this.commands[fullCommand]) {
846 + this.error("`".concat(fullCommand, "` is already registered."));
847 + }
848 + this.commands[fullCommand] = callback;
849 + this.components[fullCommand] = namespace;
850 + var shortcuts = component.getShortcuts(),
851 + shortcut = shortcuts[command];
852 + if (shortcut) {
853 + shortcut.command = fullCommand;
854 + shortcut.callback = function (event) {
855 + return _this2.runShortcut(fullCommand, event);
856 + };
857 + $e.shortcuts.register(shortcut.keys, shortcut);
858 + }
859 + return this;
860 + }
861 + }, {
862 + key: "unregister",
863 + value: function unregister(component, command) {
864 + var namespace;
865 + if ('string' === typeof component) {
866 + namespace = component;
867 + component = $e.components.get(namespace);
868 + if (!component) {
869 + this.error("'".concat(namespace, "' component is not exist."));
870 + }
871 + } else {
872 + namespace = component.getNamespace();
873 + }
874 + var fullCommand = namespace + (command ? '/' + command : '');
875 + if (!this.commands[fullCommand]) {
876 + this.error("`".concat(fullCommand, "` not exist."));
877 + }
878 + delete this.commands[fullCommand];
879 + delete this.components[fullCommand];
880 + var shortcuts = component.getShortcuts(),
881 + shortcut = shortcuts[command];
882 + if (shortcut) {
883 + $e.shortcuts.unregister(shortcut.keys, shortcut);
884 + }
885 + return this;
886 + }
863 887
864 -//#endregion
865 -//#region assets/dev/js/modules/imports/module.js
866 - var require_module = /* @__PURE__ */ __commonJSMin(((exports, module) => {
867 - init_typeof();
868 - var Module = function Module() {
869 - var $ = jQuery;
870 - var instanceParams = arguments;
871 - var self = this;
872 - var events = {};
873 - var settings;
874 - var ensureClosureMethods = function ensureClosureMethods() {
875 - $.each(self, function(methodName) {
876 - var oldMethod = self[methodName];
877 - if ("function" !== typeof oldMethod) return;
878 - self[methodName] = function() {
879 - return oldMethod.apply(self, arguments);
880 - };
881 - });
882 - };
883 - var initSettings = function initSettings() {
884 - settings = self.getDefaultSettings();
885 - var instanceSettings = instanceParams[0];
886 - if (instanceSettings) $.extend(true, settings, instanceSettings);
887 - };
888 - var init = function init() {
889 - self.__construct.apply(self, instanceParams);
890 - ensureClosureMethods();
891 - initSettings();
892 - self.trigger("init");
893 - };
894 - this.getItems = function(items, itemKey) {
895 - if (itemKey) {
896 - var keyStack = itemKey.split(".");
897 - var currentKey = keyStack.splice(0, 1);
898 - if (!keyStack.length) return items[currentKey];
899 - if (!items[currentKey]) return;
900 - return this.getItems(items[currentKey], keyStack.join("."));
901 - }
902 - return items;
903 - };
904 - this.getSettings = function(setting) {
905 - return this.getItems(settings, setting);
906 - };
907 - this.setSettings = function(settingKey, value, settingsContainer) {
908 - if (!settingsContainer) settingsContainer = settings;
909 - if ("object" === _typeof(settingKey)) {
910 - $.extend(settingsContainer, settingKey);
911 - return self;
912 - }
913 - var keyStack = settingKey.split(".");
914 - var currentKey = keyStack.splice(0, 1);
915 - if (!keyStack.length) {
916 - settingsContainer[currentKey] = value;
917 - return self;
918 - }
919 - if (!settingsContainer[currentKey]) settingsContainer[currentKey] = {};
920 - return self.setSettings(keyStack.join("."), value, settingsContainer[currentKey]);
921 - };
922 - this.getErrorMessage = function(type, functionName) {
923 - var message;
924 - switch (type) {
925 - case "forceMethodImplementation":
926 - message = "The method '".concat(functionName, "' must to be implemented in the inheritor child.");
927 - break;
928 - default: message = "An error occurs";
929 - }
930 - return message;
931 - };
932 - this.forceMethodImplementation = function(functionName) {
933 - throw new Error(this.getErrorMessage("forceMethodImplementation", functionName));
934 - };
935 - this.on = function(eventName, callback) {
936 - if ("object" === _typeof(eventName)) {
937 - $.each(eventName, function(singleEventName) {
938 - self.on(singleEventName, this);
939 - });
940 - return self;
941 - }
942 - eventName.split(" ").forEach(function(singleEventName) {
943 - if (!events[singleEventName]) events[singleEventName] = [];
944 - events[singleEventName].push(callback);
945 - });
946 - return self;
947 - };
948 - this.off = function(eventName, callback) {
949 - if (!events[eventName]) return self;
950 - if (!callback) {
951 - delete events[eventName];
952 - return self;
953 - }
954 - var callbackIndex = events[eventName].indexOf(callback);
955 - if (-1 !== callbackIndex) {
956 - delete events[eventName][callbackIndex];
957 - events[eventName] = events[eventName].filter(function(val) {
958 - return val;
959 - });
960 - }
961 - return self;
962 - };
963 - this.trigger = function(eventName) {
964 - var methodName = "on" + eventName[0].toUpperCase() + eventName.slice(1);
965 - var params = Array.prototype.slice.call(arguments, 1);
966 - if (self[methodName]) self[methodName].apply(self, params);
967 - var callbacks = events[eventName];
968 - if (!callbacks) return self;
969 - $.each(callbacks, function(index, callback) {
970 - callback.apply(self, params);
971 - });
972 - return self;
973 - };
974 - init();
975 - };
976 - Module.prototype.__construct = function() {};
977 - Module.prototype.getDefaultSettings = function() {
978 - return {};
979 - };
980 - Module.prototype.getConstructorID = function() {
981 - return this.constructor.name;
982 - };
983 - Module.extend = function(properties) {
984 - var $ = jQuery;
985 - var parent = this;
986 - var child = function child() {
987 - return parent.apply(this, arguments);
988 - };
989 - $.extend(child, parent);
990 - child.prototype = Object.create($.extend({}, parent.prototype, properties));
991 - child.prototype.constructor = child;
992 - child.__super__ = parent.prototype;
993 - return child;
994 - };
995 - module.exports = Module;
996 - }));
888 + /**
889 + * Function getComponent().
890 + *
891 + * Receive Component of the command.
892 + *
893 + * @param {string} command
894 + *
895 + * @return {Component} component
896 + */
897 + }, {
898 + key: "getComponent",
899 + value: function getComponent(command) {
900 + var namespace = this.components[command];
901 + return $e.components.get(namespace);
902 + }
997 903
998 -//#endregion
999 -//#region node_modules/@babel/runtime/helpers/esm/isNativeFunction.js
1000 -var import_module = /* @__PURE__ */ __toESM(require_module());
1001 - function _isNativeFunction(t) {
1002 - try {
1003 - return -1 !== Function.toString.call(t).indexOf("[native code]");
1004 - } catch (n) {
1005 - return "function" == typeof t;
1006 - }
1007 - }
904 + /**
905 + * Function is().
906 + *
907 + * Checks if current running command is the same parameter command.
908 + *
909 + * @param {string} command
910 + *
911 + * @return {boolean} is this command the same as the one passed in the arguments
912 + */
913 + }, {
914 + key: "is",
915 + value: function is(command) {
916 + var component = this.getComponent(command);
917 + if (!component) {
918 + return false;
919 + }
920 + return command === this.current[component.getServiceName()];
921 + }
1008 922
1009 -//#endregion
1010 -//#region node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js
1011 - function _isNativeReflectConstruct$32() {
1012 - try {
1013 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
1014 - } catch (t) {}
1015 - return (_isNativeReflectConstruct$32 = function _isNativeReflectConstruct() {
1016 - return !!t;
1017 - })();
1018 - }
1019 - __name(_isNativeReflectConstruct$32, "_isNativeReflectConstruct");
923 + /**
924 + * Function isCurrentFirstTrace().
925 + *
926 + * Checks if parameter command is the first command in trace that currently running.
927 + *
928 + * @param {string} command
929 + *
930 + * @return {boolean} is parameter command the first command in trace that currently running
931 + */
932 + }, {
933 + key: "isCurrentFirstTrace",
934 + value: function isCurrentFirstTrace(command) {
935 + return command === this.getCurrentFirstTrace();
936 + }
1020 937
1021 -//#endregion
1022 -//#region node_modules/@babel/runtime/helpers/esm/construct.js
1023 - function _construct(t, e, r) {
1024 - if (_isNativeReflectConstruct$32()) return Reflect.construct.apply(null, arguments);
1025 - var o = [null];
1026 - o.push.apply(o, e);
1027 - var p = new (t.bind.apply(t, o))();
1028 - return r && _setPrototypeOf(p, r.prototype), p;
1029 - }
938 + /**
939 + * Function getCurrent().
940 + *
941 + * Receive currently running components and its commands.
942 + *
943 + * @param {string} container
944 + *
945 + * @return {{}|boolean|*} currently running components
946 + */
947 + }, {
948 + key: "getCurrent",
949 + value: function getCurrent() {
950 + var container = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
951 + if (container) {
952 + if (!this.current[container]) {
953 + return false;
954 + }
955 + return this.current[container];
956 + }
957 + return this.current;
958 + }
1030 959
1031 -//#endregion
1032 -//#region node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js
1033 - function _wrapNativeSuper(t) {
1034 - var r = "function" == typeof Map ? /* @__PURE__ */ new Map() : void 0;
1035 - return _wrapNativeSuper = function _wrapNativeSuper(t) {
1036 - if (null === t || !_isNativeFunction(t)) return t;
1037 - if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function");
1038 - if (void 0 !== r) {
1039 - if (r.has(t)) return r.get(t);
1040 - r.set(t, Wrapper);
1041 - }
1042 - function Wrapper() {
1043 - return _construct(t, arguments, _getPrototypeOf(this).constructor);
1044 - }
1045 - return Wrapper.prototype = Object.create(t.prototype, { constructor: {
1046 - value: Wrapper,
1047 - enumerable: !1,
1048 - writable: !0,
1049 - configurable: !0
1050 - } }), _setPrototypeOf(Wrapper, t);
1051 - }, _wrapNativeSuper(t);
1052 - }
960 + /**
961 + * Function getCurrentArgs().
962 + *
963 + * Receive currently running command args.
964 + *
965 + * @param {string} container
966 + *
967 + * @return {{}|boolean|*} current arguments
968 + */
969 + }, {
970 + key: "getCurrentArgs",
971 + value: function getCurrentArgs() {
972 + var container = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
973 + if (container) {
974 + if (!this.currentArgs[container]) {
975 + return false;
976 + }
977 + return this.currentArgs[container];
978 + }
979 + return this.currentArgs;
980 + }
1053 981
1054 -//#endregion
1055 -//#region modules/web-cli/assets/js/utils/force-method-implementation.js
1056 - function _callSuper$31(t, o, e) {
1057 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$31() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
1058 - }
1059 - __name(_callSuper$31, "_callSuper");
1060 - function _isNativeReflectConstruct$31() {
1061 - try {
1062 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
1063 - } catch (t) {}
1064 - return (_isNativeReflectConstruct$31 = function _isNativeReflectConstruct() {
1065 - return !!t;
1066 - })();
1067 - }
1068 - __name(_isNativeReflectConstruct$31, "_isNativeReflectConstruct");
1069 - var ForceMethodImplementation = /*#__PURE__*/ function(_Error) {
1070 - function ForceMethodImplementation() {
1071 - var _this;
1072 - var info = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1073 - _classCallCheck(this, ForceMethodImplementation);
1074 - _this = _callSuper$31(this, ForceMethodImplementation, ["".concat(info.isStatic ? "static " : "").concat(info.fullName, "() should be implemented, please provide '").concat(info.functionName || info.fullName, "' functionality.")]);
1075 - Error.captureStackTrace(_this, ForceMethodImplementation);
1076 - return _this;
1077 - }
1078 - _inherits(ForceMethodImplementation, _Error);
1079 - return _createClass(ForceMethodImplementation);
1080 - }(/*#__PURE__*/ _wrapNativeSuper(Error));
1081 - var force_method_implementation_default = /* @__PURE__ */ __name((function() {
1082 - var caller = Error().stack.split("\n")[2].trim();
1083 - var callerName = caller.startsWith("at new") ? "constructor" : caller.split(" ")[1];
1084 - var info = {};
1085 - info.functionName = callerName;
1086 - info.fullName = callerName;
1087 - if (info.functionName.includes(".")) {
1088 - var parts = info.functionName.split(".");
1089 - info.className = parts[0];
1090 - info.functionName = parts[1];
1091 - } else info.isStatic = true;
1092 - throw new ForceMethodImplementation(info);
1093 - }), "default");
982 + /**
983 + * Function getCurrentFirst().
984 + *
985 + * Receive first command that currently running.
986 + *
987 + * @return {string} first running command
988 + */
989 + }, {
990 + key: "getCurrentFirst",
991 + value: function getCurrentFirst() {
992 + return Object.values(this.current)[0];
993 + }
1094 994
1095 -//#endregion
1096 -//#region modules/web-cli/assets/js/modules/component-base.js
1097 - function ownKeys$3(e, r) {
1098 - var t = Object.keys(e);
1099 - if (Object.getOwnPropertySymbols) {
1100 - var o = Object.getOwnPropertySymbols(e);
1101 - r && (o = o.filter(function(r) {
1102 - return Object.getOwnPropertyDescriptor(e, r).enumerable;
1103 - })), t.push.apply(t, o);
1104 - }
1105 - return t;
1106 - }
1107 - __name(ownKeys$3, "ownKeys");
1108 - function _objectSpread$3(e) {
1109 - for (var r = 1; r < arguments.length; r++) {
1110 - var t = null != arguments[r] ? arguments[r] : {};
1111 - r % 2 ? ownKeys$3(Object(t), !0).forEach(function(r) {
1112 - _defineProperty(e, r, t[r]);
1113 - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function(r) {
1114 - Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
1115 - });
1116 - }
1117 - return e;
1118 - }
1119 - __name(_objectSpread$3, "_objectSpread");
1120 - function _callSuper$30(t, o, e) {
1121 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$30() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
1122 - }
1123 - __name(_callSuper$30, "_callSuper");
1124 - function _isNativeReflectConstruct$30() {
1125 - try {
1126 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
1127 - } catch (t) {}
1128 - return (_isNativeReflectConstruct$30 = function _isNativeReflectConstruct() {
1129 - return !!t;
1130 - })();
1131 - }
1132 - __name(_isNativeReflectConstruct$30, "_isNativeReflectConstruct");
1133 - /**
1134 - * @typedef {import('./command-infra')} CommandInfra
1135 - * @typedef {import('./hook-base')} HookBase
1136 - * @typedef {import('../core/states/ui-state-base')} UiStateBase
1137 - */
1138 - var ComponentBase = /*#__PURE__*/ function(_Module) {
1139 - function ComponentBase() {
1140 - _classCallCheck(this, ComponentBase);
1141 - return _callSuper$30(this, ComponentBase, arguments);
1142 - }
1143 - _inherits(ComponentBase, _Module);
1144 - return _createClass(ComponentBase, [
1145 - {
1146 - key: "__construct",
1147 - value: function __construct() {
1148 - var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1149 - if (args.manager) this.manager = args.manager;
1150 - this.commands = this.defaultCommands();
1151 - this.commandsInternal = this.defaultCommandsInternal();
1152 - this.hooks = this.defaultHooks();
1153 - this.routes = this.defaultRoutes();
1154 - this.tabs = this.defaultTabs();
1155 - this.shortcuts = this.defaultShortcuts();
1156 - this.utils = this.defaultUtils();
1157 - this.data = this.defaultData();
1158 - this.uiStates = this.defaultUiStates();
1159 - this.states = this.defaultStates();
1160 - this.defaultRoute = "";
1161 - this.currentTab = "";
1162 - }
1163 - },
1164 - {
1165 - key: "registerAPI",
1166 - value: function registerAPI() {
1167 - var _this = this;
1168 - Object.entries(this.getTabs()).forEach(function(tab) {
1169 - return _this.registerTabRoute(tab[0]);
1170 - });
1171 - Object.entries(this.getRoutes()).forEach(function(_ref) {
1172 - var _ref2 = _slicedToArray(_ref, 2);
1173 - var route = _ref2[0];
1174 - var callback = _ref2[1];
1175 - return _this.registerRoute(route, callback);
1176 - });
1177 - Object.entries(this.getCommands()).forEach(function(_ref3) {
1178 - var _ref4 = _slicedToArray(_ref3, 2);
1179 - var command = _ref4[0];
1180 - var callback = _ref4[1];
1181 - return _this.registerCommand(command, callback);
1182 - });
1183 - Object.entries(this.getCommandsInternal()).forEach(function(_ref5) {
1184 - var _ref6 = _slicedToArray(_ref5, 2);
1185 - var command = _ref6[0];
1186 - var callback = _ref6[1];
1187 - return _this.registerCommandInternal(command, callback);
1188 - });
1189 - Object.values(this.getHooks()).forEach(function(instance) {
1190 - return _this.registerHook(instance);
1191 - });
1192 - Object.entries(this.getData()).forEach(function(_ref7) {
1193 - var _ref8 = _slicedToArray(_ref7, 2);
1194 - var command = _ref8[0];
1195 - var callback = _ref8[1];
1196 - return _this.registerData(command, callback);
1197 - });
1198 - Object.values(this.getUiStates()).forEach(function(instance) {
1199 - return _this.registerUiState(instance);
1200 - });
1201 - Object.entries(this.getStates()).forEach(function(_ref9) {
1202 - var _ref0 = _slicedToArray(_ref9, 2);
1203 - var id = _ref0[0];
1204 - var state = _ref0[1];
1205 - return _this.registerState(id, state);
1206 - });
1207 - }
1208 - },
1209 - {
1210 - key: "getNamespace",
1211 - value: function getNamespace() {
1212 - force_method_implementation_default();
1213 - }
1214 - },
1215 - {
1216 - key: "getRootContainer",
1217 - value: function getRootContainer() {
1218 - Deprecation.deprecated("getRootContainer()", "3.7.0", "getServiceName()");
1219 - return this.getServiceName();
1220 - }
1221 - },
1222 - {
1223 - key: "getServiceName",
1224 - value: function getServiceName() {
1225 - return this.getNamespace().split("/")[0];
1226 - }
1227 - },
1228 - {
1229 - key: "store",
1230 - get: function get() {
1231 - return $e.store.get(this.getNamespace());
1232 - }
1233 - },
1234 - {
1235 - key: "defaultTabs",
1236 - value: function defaultTabs() {
1237 - return {};
1238 - }
1239 - },
1240 - {
1241 - key: "defaultRoutes",
1242 - value: function defaultRoutes() {
1243 - return {};
1244 - }
1245 - },
1246 - {
1247 - key: "defaultCommands",
1248 - value: function defaultCommands() {
1249 - return {};
1250 - }
1251 - },
1252 - {
1253 - key: "defaultCommandsInternal",
1254 - value: function defaultCommandsInternal() {
1255 - return {};
1256 - }
1257 - },
1258 - {
1259 - key: "defaultHooks",
1260 - value: function defaultHooks() {
1261 - return {};
1262 - }
1263 - },
1264 - {
1265 - key: "defaultUiStates",
1266 - value: function defaultUiStates() {
1267 - return {};
1268 - }
1269 - },
1270 - {
1271 - key: "defaultStates",
1272 - value: function defaultStates() {
1273 - return {};
1274 - }
1275 - },
1276 - {
1277 - key: "defaultShortcuts",
1278 - value: function defaultShortcuts() {
1279 - return {};
1280 - }
1281 - },
1282 - {
1283 - key: "defaultUtils",
1284 - value: function defaultUtils() {
1285 - return {};
1286 - }
1287 - },
1288 - {
1289 - key: "defaultData",
1290 - value: function defaultData() {
1291 - return {};
1292 - }
1293 - },
1294 - {
1295 - key: "getCommands",
1296 - value: function getCommands() {
1297 - return this.commands;
1298 - }
1299 - },
1300 - {
1301 - key: "getCommandsInternal",
1302 - value: function getCommandsInternal() {
1303 - return this.commandsInternal;
1304 - }
1305 - },
1306 - {
1307 - key: "getHooks",
1308 - value: function getHooks() {
1309 - return this.hooks;
1310 - }
1311 - },
1312 - {
1313 - key: "getUiStates",
1314 - value: function getUiStates() {
1315 - return this.uiStates;
1316 - }
1317 - },
1318 - {
1319 - key: "getStates",
1320 - value: function getStates() {
1321 - return this.states;
1322 - }
1323 - },
1324 - {
1325 - key: "getRoutes",
1326 - value: function getRoutes() {
1327 - return this.routes;
1328 - }
1329 - },
1330 - {
1331 - key: "getTabs",
1332 - value: function getTabs() {
1333 - return this.tabs;
1334 - }
1335 - },
1336 - {
1337 - key: "getShortcuts",
1338 - value: function getShortcuts() {
1339 - return this.shortcuts;
1340 - }
1341 - },
1342 - {
1343 - key: "getData",
1344 - value: function getData() {
1345 - return this.data;
1346 - }
1347 - },
1348 - {
1349 - key: "registerCommand",
1350 - value: function registerCommand(command, context) {
1351 - var commandsType = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "default";
1352 - var commandsManager;
1353 - switch (commandsType) {
1354 - case "default":
1355 - commandsManager = $e.commands;
1356 - break;
1357 - case "internal":
1358 - commandsManager = $e.commandsInternal;
1359 - break;
1360 - case "data":
1361 - commandsManager = $e.data;
1362 - break;
1363 - default: throw new Error("Invalid commands type: '".concat(command, "'"));
1364 - }
1365 - var fullCommand = this.getNamespace() + "/" + command;
1366 - var instanceType = context.getInstanceType ? context.getInstanceType() : false;
1367 - var registerConfig = {
1368 - command: fullCommand,
1369 - component: this
1370 - };
1371 - if (!instanceType) {
1372 - if ($e.devTools) $e.devTools.log.warn("Attach command-callback-base, on command: '".concat(fullCommand, "', context is unknown type."));
1373 - registerConfig.callback = context;
1374 - context = /*#__PURE__*/ function(_CommandCallbackBase) {
1375 - function context() {
1376 - _classCallCheck(this, context);
1377 - return _callSuper$30(this, context, arguments);
1378 - }
1379 - _inherits(context, _CommandCallbackBase);
1380 - return _createClass(context);
1381 - }(CommandCallbackBase);
1382 - }
1383 - context.setRegisterConfig(registerConfig);
1384 - commandsManager.register(this, command, context);
1385 - }
1386 - },
1387 - {
1388 - key: "registerHook",
1389 - value: function registerHook(instance) {
1390 - return instance.register();
1391 - }
1392 - },
1393 - {
1394 - key: "registerCommandInternal",
1395 - value: function registerCommandInternal(command, context) {
1396 - this.registerCommand(command, context, "internal");
1397 - }
1398 - },
1399 - {
1400 - key: "registerUiState",
1401 - value: function registerUiState(instance) {
1402 - $e.uiStates.register(instance);
1403 - }
1404 - },
1405 - {
1406 - key: "registerState",
1407 - value: function registerState(id, stateConfig) {
1408 - id = this.getNamespace() + (id ? "/".concat(id) : "");
1409 - var slice = (0, _reduxjs_toolkit.createSlice)(_objectSpread$3(_objectSpread$3({}, stateConfig), {}, { name: id }));
1410 - $e.store.register(id, slice);
1411 - }
1412 - },
1413 - {
1414 - key: "registerRoute",
1415 - value: function registerRoute(route, callback) {
1416 - $e.routes.register(this, route, callback);
1417 - }
1418 - },
1419 - {
1420 - key: "registerData",
1421 - value: function registerData(command, context) {
1422 - this.registerCommand(command, context, "data");
1423 - }
1424 - },
1425 - {
1426 - key: "unregisterRoute",
1427 - value: function unregisterRoute(route) {
1428 - $e.routes.unregister(this, route);
1429 - }
1430 - },
1431 - {
1432 - key: "registerTabRoute",
1433 - value: function registerTabRoute(tab) {
1434 - var _this2 = this;
1435 - this.registerRoute(tab, function(args) {
1436 - return _this2.activateTab(tab, args);
1437 - });
1438 - }
1439 - },
1440 - {
1441 - key: "dependency",
1442 - value: function dependency() {
1443 - return true;
1444 - }
1445 - },
1446 - {
1447 - key: "open",
1448 - value: function open() {
1449 - return true;
1450 - }
1451 - },
1452 - {
1453 - key: "close",
1454 - value: function close() {
1455 - if (!this.isOpen) return false;
1456 - this.isOpen = false;
1457 - this.inactivate();
1458 - $e.routes.clearCurrent(this.getNamespace());
1459 - $e.routes.clearHistory(this.getServiceName());
1460 - return true;
1461 - }
1462 - },
1463 - {
1464 - key: "activate",
1465 - value: function activate() {
1466 - $e.components.activate(this.getNamespace());
1467 - }
1468 - },
1469 - {
1470 - key: "inactivate",
1471 - value: function inactivate() {
1472 - $e.components.inactivate(this.getNamespace());
1473 - }
1474 - },
1475 - {
1476 - key: "isActive",
1477 - value: function isActive() {
1478 - return $e.components.isActive(this.getNamespace());
1479 - }
1480 - },
1481 - {
1482 - key: "onRoute",
1483 - value: function onRoute(route) {
1484 - this.toggleRouteClass(route, true);
1485 - this.toggleHistoryClass();
1486 - this.activate();
1487 - this.trigger("route/open", route);
1488 - }
1489 - },
1490 - {
1491 - key: "onCloseRoute",
1492 - value: function onCloseRoute(route) {
1493 - this.toggleRouteClass(route, false);
1494 - this.inactivate();
1495 - this.trigger("route/close", route);
1496 - }
1497 - },
1498 - {
1499 - key: "setDefaultRoute",
1500 - value: function setDefaultRoute(route) {
1501 - this.defaultRoute = this.getNamespace() + "/" + route;
1502 - }
1503 - },
1504 - {
1505 - key: "getDefaultRoute",
1506 - value: function getDefaultRoute() {
1507 - return this.defaultRoute;
1508 - }
1509 - },
1510 - {
1511 - key: "removeTab",
1512 - value: function removeTab(tab) {
1513 - delete this.tabs[tab];
1514 - this.unregisterRoute(tab);
1515 - }
1516 - },
1517 - {
1518 - key: "hasTab",
1519 - value: function hasTab(tab) {
1520 - return !!this.tabs[tab];
1521 - }
1522 - },
1523 - {
1524 - key: "addTab",
1525 - value: function addTab(tab, args, position) {
1526 - var _this3 = this;
1527 - this.tabs[tab] = args;
1528 - if ("undefined" !== typeof position) {
1529 - var newTabs = {};
1530 - var ids = Object.keys(this.tabs);
1531 - ids.pop();
1532 - ids.splice(position, 0, tab);
1533 - ids.forEach(function(id) {
1534 - newTabs[id] = _this3.tabs[id];
1535 - });
1536 - this.tabs = newTabs;
1537 - }
1538 - this.registerTabRoute(tab);
1539 - }
1540 - },
1541 - {
1542 - key: "getTabsWrapperSelector",
1543 - value: function getTabsWrapperSelector() {
1544 - return "";
1545 - }
1546 - },
1547 - {
1548 - key: "getTabRoute",
1549 - value: function getTabRoute(tab) {
1550 - return this.getNamespace() + "/" + tab;
1551 - }
1552 - },
1553 - {
1554 - key: "renderTab",
1555 - value: function renderTab(tab) {}
1556 - },
1557 - {
1558 - key: "activateTab",
1559 - value: function activateTab(tab, args) {
1560 - var _this4 = this;
1561 - this.renderTab(tab, args);
1562 - jQuery(this.getTabsWrapperSelector() + " .elementor-component-tab").off("click").on("click", function(event) {
1563 - $e.route(_this4.getTabRoute(event.currentTarget.dataset.tab), args);
1564 - }).removeClass("elementor-active").filter("[data-tab=\"" + tab + "\"]").addClass("elementor-active");
1565 - }
1566 - },
1567 - {
1568 - key: "getActiveTabConfig",
1569 - value: function getActiveTabConfig() {
1570 - return this.tabs[this.currentTab] || {};
1571 - }
1572 - },
1573 - {
1574 - key: "getBodyClass",
1575 - value: function getBodyClass(route) {
1576 - return "e-route-" + route.replace(/\//g, "-");
1577 - }
1578 - },
1579 - {
1580 - key: "normalizeCommandName",
1581 - value: function normalizeCommandName(commandName) {
1582 - return commandName.replace(/[A-Z]/g, function(match, offset) {
1583 - return (offset > 0 ? "-" : "") + match.toLowerCase();
1584 - });
1585 - }
1586 - },
1587 - {
1588 - key: "importCommands",
1589 - value: function importCommands(commandsFromImport) {
1590 - var _this5 = this;
1591 - var commands = {};
1592 - Object.entries(commandsFromImport).forEach(function(_ref1) {
1593 - var _ref10 = _slicedToArray(_ref1, 2);
1594 - var className = _ref10[0];
1595 - var Class = _ref10[1];
1596 - var command = _this5.normalizeCommandName(className);
1597 - commands[command] = Class;
1598 - });
1599 - return commands;
1600 - }
1601 - },
1602 - {
1603 - key: "importHooks",
1604 - value: function importHooks(hooksFromImport) {
1605 - var hooks = {};
1606 - for (var key in hooksFromImport) {
1607 - var hook = new hooksFromImport[key]();
1608 - hooks[hook.getId()] = hook;
1609 - }
1610 - return hooks;
1611 - }
1612 - },
1613 - {
1614 - key: "importUiStates",
1615 - value: function importUiStates(statesFromImport) {
1616 - var _this6 = this;
1617 - var uiStates = {};
1618 - Object.values(statesFromImport).forEach(function(className) {
1619 - var uiState = new className(_this6);
1620 - uiStates[uiState.getId()] = uiState;
1621 - });
1622 - return uiStates;
1623 - }
1624 - },
1625 - {
1626 - key: "setUiState",
1627 - value: function setUiState(state, value) {
1628 - $e.uiStates.set("".concat(this.getNamespace(), "/").concat(state), value);
1629 - }
1630 - },
1631 - {
1632 - key: "toggleRouteClass",
1633 - value: function toggleRouteClass(route, state) {
1634 - document.body.classList.toggle(this.getBodyClass(route), state);
1635 - }
1636 - },
1637 - {
1638 - key: "toggleHistoryClass",
1639 - value: function toggleHistoryClass() {
1640 - document.body.classList.toggle("e-routes-has-history", !!$e.routes.getHistory(this.getServiceName()).length);
1641 - }
1642 - }
1643 - ]);
1644 - }(import_module.default);
995 + /**
996 + * Function getCurrentLast().
997 + *
998 + * Receive last command that currently running.
999 + *
1000 + * @return {string} last running command
1001 + */
1002 + }, {
1003 + key: "getCurrentLast",
1004 + value: function getCurrentLast() {
1005 + var current = Object.values(this.current);
1006 + return current[current.length - 1];
1007 + }
1645 1008
1646 -//#endregion
1647 -//#region modules/web-cli/assets/js/core/backwards-compatibility.js
1648 - function _callSuper$29(t, o, e) {
1649 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$29() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
1650 - }
1651 - __name(_callSuper$29, "_callSuper");
1652 - function _isNativeReflectConstruct$29() {
1653 - try {
1654 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
1655 - } catch (t) {}
1656 - return (_isNativeReflectConstruct$29 = function _isNativeReflectConstruct() {
1657 - return !!t;
1658 - })();
1659 - }
1660 - __name(_isNativeReflectConstruct$29, "_isNativeReflectConstruct");
1661 - var BackwardsCompatibility = /*#__PURE__*/ function() {
1662 - function BackwardsCompatibility() {
1663 - _classCallCheck(this, BackwardsCompatibility);
1664 - }
1665 - return _createClass(BackwardsCompatibility, [{
1666 - key: "ensureTab",
1667 - value: function ensureTab(namespace, tabSlug) {
1668 - var page = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "";
1669 - var component = $e.components.get(namespace);
1670 - if (!component) {
1671 - var Component = /*#__PURE__*/ function(_ComponentBase) {
1672 - function Component() {
1673 - _classCallCheck(this, Component);
1674 - return _callSuper$29(this, Component, arguments);
1675 - }
1676 - _inherits(Component, _ComponentBase);
1677 - return _createClass(Component, [{
1678 - key: "getNamespace",
1679 - value: function getNamespace() {
1680 - return namespace;
1681 - }
1682 - }, {
1683 - key: "renderTab",
1684 - value: function renderTab(tab) {
1685 - elementor.getPanelView().setPage(page).activateTab(tab);
1686 - }
1687 - }]);
1688 - }(ComponentBase);
1689 - component = $e.components.register(new Component());
1690 - }
1691 - if (!component.hasTab(tabSlug) && elementor.config.tabs[tabSlug]) component.addTab(tabSlug, { title: elementor.config.tabs[tabSlug] });
1692 - }
1693 - }]);
1694 - }();
1009 + /**
1010 + * Function getCurrentFirstTrace().
1011 + *
1012 + * Receive first command in trace that currently running
1013 + *
1014 + * @return {string} first command in trace
1015 + */
1016 + }, {
1017 + key: "getCurrentFirstTrace",
1018 + value: function getCurrentFirstTrace() {
1019 + return this.currentTrace[0];
1020 + }
1695 1021
1696 -//#endregion
1697 -//#region modules/web-cli/assets/js/modules/command-internal-base.js
1698 - function _callSuper$28(t, o, e) {
1699 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$28() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
1700 - }
1701 - __name(_callSuper$28, "_callSuper");
1702 - function _isNativeReflectConstruct$28() {
1703 - try {
1704 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
1705 - } catch (t) {}
1706 - return (_isNativeReflectConstruct$28 = function _isNativeReflectConstruct() {
1707 - return !!t;
1708 - })();
1709 - }
1710 - __name(_isNativeReflectConstruct$28, "_isNativeReflectConstruct");
1711 - /**
1712 - * @name $e.modules.CommandInternalBase
1713 - */
1714 - var CommandInternalBase = /*#__PURE__*/ function(_CommandBase) {
1715 - function CommandInternalBase(args) {
1716 - var commandsAPI = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : $e.commandsInternal;
1717 - _classCallCheck(this, CommandInternalBase);
1718 - return _callSuper$28(this, CommandInternalBase, [args, commandsAPI]);
1719 - }
1720 - _inherits(CommandInternalBase, _CommandBase);
1721 - return _createClass(CommandInternalBase, null, [{
1722 - key: "getInstanceType",
1723 - value: function getInstanceType() {
1724 - return "CommandInternalBase";
1725 - }
1726 - }]);
1727 - }(CommandBase);
1022 + /**
1023 + * Function beforeRun().
1024 + *
1025 + * Responsible to add current command to trace and trigger 'run:before' event.
1026 + * Run before command.
1027 + *
1028 + * @param {string} command
1029 + * @param {{}} args
1030 + * @param {boolean} [addTrace=true]
1031 + */
1032 + }, {
1033 + key: "beforeRun",
1034 + value: function beforeRun(command) {
1035 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1036 + var addTrace = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
1037 + var component = this.getComponent(command),
1038 + container = component.getServiceName();
1039 + if (addTrace) {
1040 + this.addCurrentTrace(container, command, args);
1041 + }
1042 + if (args.onBefore) {
1043 + args.onBefore.apply(component, [args]);
1044 + }
1045 + this.trigger('run:before', component, command, args);
1046 + window.dispatchEvent(new CustomEvent('elementor/commands/run/before', {
1047 + detail: {
1048 + command: command,
1049 + args: args
1050 + }
1051 + }));
1052 + }
1728 1053
1729 -//#endregion
1730 -//#region modules/web-cli/assets/js/core/data/errors/base-error.js
1731 - function ownKeys$2(e, r) {
1732 - var t = Object.keys(e);
1733 - if (Object.getOwnPropertySymbols) {
1734 - var o = Object.getOwnPropertySymbols(e);
1735 - r && (o = o.filter(function(r) {
1736 - return Object.getOwnPropertyDescriptor(e, r).enumerable;
1737 - })), t.push.apply(t, o);
1738 - }
1739 - return t;
1740 - }
1741 - __name(ownKeys$2, "ownKeys");
1742 - function _objectSpread$2(e) {
1743 - for (var r = 1; r < arguments.length; r++) {
1744 - var t = null != arguments[r] ? arguments[r] : {};
1745 - r % 2 ? ownKeys$2(Object(t), !0).forEach(function(r) {
1746 - _defineProperty(e, r, t[r]);
1747 - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function(r) {
1748 - Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
1749 - });
1750 - }
1751 - return e;
1752 - }
1753 - __name(_objectSpread$2, "_objectSpread");
1754 - function _callSuper$27(t, o, e) {
1755 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$27() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
1756 - }
1757 - __name(_callSuper$27, "_callSuper");
1758 - function _isNativeReflectConstruct$27() {
1759 - try {
1760 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
1761 - } catch (t) {}
1762 - return (_isNativeReflectConstruct$27 = function _isNativeReflectConstruct() {
1763 - return !!t;
1764 - })();
1765 - }
1766 - __name(_isNativeReflectConstruct$27, "_isNativeReflectConstruct");
1767 - var BaseError = /*#__PURE__*/ function(_Error) {
1768 - /**
1769 - * Error constructor.
1770 - *
1771 - * @param {string} message
1772 - * @param {string} code
1773 - * @param {*} data
1774 - */
1775 - function BaseError() {
1776 - var _this;
1777 - var message = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
1778 - var code = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
1779 - var data = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
1780 - _classCallCheck(this, BaseError);
1781 - _this = _callSuper$27(this, BaseError, [message]);
1782 - /**
1783 - * The server error code.
1784 - *
1785 - * @type {string}
1786 - */
1787 - _defineProperty(_this, "code", "");
1788 - /**
1789 - * Additional data about the current error.
1790 - *
1791 - * @type {*[]}
1792 - */
1793 - _defineProperty(_this, "data", []);
1794 - _this.code = code;
1795 - _this.data = data;
1796 - return _this;
1797 - }
1798 - /**
1799 - * Notify a message when the error occurs.
1800 - */
1801 - _inherits(BaseError, _Error);
1802 - return _createClass(BaseError, [{
1803 - key: "notify",
1804 - value: function notify() {
1805 - Console.error(_objectSpread$2({ message: this.message }, this));
1806 - }
1807 - }], [{
1808 - key: "create",
1809 - value: function create(message) {
1810 - var code = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
1811 - var data = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
1812 - return new this(message, code, data);
1813 - }
1814 - }, {
1815 - key: "getHTTPErrorCode",
1816 - value: function getHTTPErrorCode() {
1817 - force_method_implementation_default();
1818 - }
1819 - }]);
1820 - }(/*#__PURE__*/ _wrapNativeSuper(Error));
1054 + /**
1055 + * Function validateRun().
1056 + *
1057 + * Responsible to validate if the run is even possible.
1058 + * Runs immediately after entering `run()`.
1059 + *
1060 + * @param {string} command
1061 + * @param {*} args
1062 + *
1063 + * @return {boolean} dependency result
1064 + */
1065 + }, {
1066 + key: "validateRun",
1067 + value: function validateRun(command) {
1068 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1069 + if (!this.commands[command]) {
1070 + this.error("`".concat(command, "` not found."));
1071 + }
1072 + return this.getComponent(command).dependency(command, args);
1073 + }
1821 1074
1822 -//#endregion
1823 -//#region modules/web-cli/assets/js/core/data/errors/default-error.js
1824 - function _callSuper$26(t, o, e) {
1825 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$26() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
1826 - }
1827 - __name(_callSuper$26, "_callSuper");
1828 - function _isNativeReflectConstruct$26() {
1829 - try {
1830 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
1831 - } catch (t) {}
1832 - return (_isNativeReflectConstruct$26 = function _isNativeReflectConstruct() {
1833 - return !!t;
1834 - })();
1835 - }
1836 - __name(_isNativeReflectConstruct$26, "_isNativeReflectConstruct");
1837 - var DefaultError = /*#__PURE__*/ function(_BaseError) {
1838 - function DefaultError() {
1839 - _classCallCheck(this, DefaultError);
1840 - return _callSuper$26(this, DefaultError, arguments);
1841 - }
1842 - _inherits(DefaultError, _BaseError);
1843 - return _createClass(DefaultError, null, [{
1844 - key: "getHTTPErrorCode",
1845 - value: function getHTTPErrorCode() {
1846 - return 501;
1847 - }
1848 - }]);
1849 - }(BaseError);
1075 + /**
1076 + * Function run().
1077 + *
1078 + * Runs a command.
1079 + *
1080 + * @param {string} command
1081 + * @param {{}} args
1082 + *
1083 + * @return {boolean|*} results
1084 + */
1085 + }, {
1086 + key: "run",
1087 + value: function run(command) {
1088 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1089 + if (!this.validateRun(command, args)) {
1090 + return false;
1091 + }
1092 + this.beforeRun(command, args);
1850 1093
1851 -//#endregion
1852 -//#region modules/web-cli/assets/js/core/data/errors/error-404.js
1853 - function _callSuper$25(t, o, e) {
1854 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$25() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
1855 - }
1856 - __name(_callSuper$25, "_callSuper");
1857 - function _isNativeReflectConstruct$25() {
1858 - try {
1859 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
1860 - } catch (t) {}
1861 - return (_isNativeReflectConstruct$25 = function _isNativeReflectConstruct() {
1862 - return !!t;
1863 - })();
1864 - }
1865 - __name(_isNativeReflectConstruct$25, "_isNativeReflectConstruct");
1866 - var Error404 = /*#__PURE__*/ function(_BaseError) {
1867 - function Error404() {
1868 - _classCallCheck(this, Error404);
1869 - return _callSuper$25(this, Error404, arguments);
1870 - }
1871 - _inherits(Error404, _BaseError);
1872 - return _createClass(Error404, [{
1873 - key: "notify",
1874 - value: function notify() {
1875 - Console.warn(this.message);
1876 - }
1877 - }], [{
1878 - key: "getHTTPErrorCode",
1879 - value: function getHTTPErrorCode() {
1880 - return 404;
1881 - }
1882 - }]);
1883 - }(BaseError);
1094 + // Get command class or callback.
1095 + var context = this.commands[command];
1884 1096
1885 -//#endregion
1886 -//#region modules/web-cli/assets/js/core/data/errors/index.js
1887 - var errors_exports = /* @__PURE__ */ __exportAll({
1888 - DefaultError: () => DefaultError,
1889 - Error404: () => Error404
1890 - });
1097 + // Is it command-base based class?
1098 + if (context.getInstanceType) {
1099 + context = new context(args);
1100 + }
1101 + var currentComponent = this.getComponent(command);
1891 1102
1892 -//#endregion
1893 -//#region modules/web-cli/assets/js/modules/command-data.js
1894 - function _callSuper$24(t, o, e) {
1895 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$24() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
1896 - }
1897 - __name(_callSuper$24, "_callSuper");
1898 - function _isNativeReflectConstruct$24() {
1899 - try {
1900 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
1901 - } catch (t) {}
1902 - return (_isNativeReflectConstruct$24 = function _isNativeReflectConstruct() {
1903 - return !!t;
1904 - })();
1905 - }
1906 - __name(_isNativeReflectConstruct$24, "_isNativeReflectConstruct");
1907 - /**
1908 - * @name $e.modules.CommandData
1909 - */
1910 - /**
1911 - * @typedef {('create'|'delete'|'get'|'update'|'options')} DataTypes
1912 - */
1913 - /**
1914 - * @typedef {{}} RequestData
1915 - */
1916 - /**
1917 - * @typedef {import('../core/data/errors/base-error')} BaseError
1918 - */
1919 - var CommandData = /*#__PURE__*/ function(_CommandBase) {
1920 - function CommandData(args) {
1921 - var _this$args$options;
1922 - var _this;
1923 - var commandsAPI = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : $e.data;
1924 - _classCallCheck(this, CommandData);
1925 - _this = _callSuper$24(this, CommandData, [args, commandsAPI]);
1926 - /**
1927 - * Data returned from remote.
1928 - *
1929 - * @type {*}
1930 - */
1931 - _defineProperty(_this, "data", void 0);
1932 - /**
1933 - * Fetch type.
1934 - *
1935 - * @type {DataTypes}
1936 - */
1937 - _defineProperty(_this, "type", void 0);
1938 - if ((_this$args$options = _this.args.options) !== null && _this$args$options !== void 0 && _this$args$options.type) _this.type = _this.args.options.type;
1939 - return _this;
1940 - }
1941 - /**
1942 - * Function getEndpointFormat().
1943 - *
1944 - * @return {null|string} endpoint format
1945 - */
1946 - _inherits(CommandData, _CommandBase);
1947 - return _createClass(CommandData, [
1948 - {
1949 - key: "getApplyMethods",
1950 - value: function getApplyMethods() {
1951 - var type = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.type;
1952 - var before;
1953 - var after;
1954 - switch (type) {
1955 - case "create":
1956 - before = this.applyBeforeCreate;
1957 - after = this.applyAfterCreate;
1958 - break;
1959 - case "delete":
1960 - before = this.applyBeforeDelete;
1961 - after = this.applyAfterDelete;
1962 - break;
1963 - case "get":
1964 - before = this.applyBeforeGet;
1965 - after = this.applyAfterGet;
1966 - break;
1967 - case "update":
1968 - before = this.applyBeforeUpdate;
1969 - after = this.applyAfterUpdate;
1970 - break;
1971 - case "options":
1972 - before = this.applyBeforeOptions;
1973 - after = this.applyAfterOptions;
1974 - break;
1975 - default: return false;
1976 - }
1977 - return {
1978 - before: before.bind(this),
1979 - after: after.bind(this)
1980 - };
1981 - }
1982 - },
1983 - {
1984 - key: "getRequestData",
1985 - value: function getRequestData() {
1986 - return {
1987 - type: this.type,
1988 - args: this.args,
1989 - timestamp: (/* @__PURE__ */ new Date()).getTime(),
1990 - component: this.component,
1991 - command: this.command,
1992 - endpoint: $e.data.commandToEndpoint(this.command, JSON.parse(JSON.stringify(this.args)), this.constructor.getEndpointFormat())
1993 - };
1994 - }
1995 - },
1996 - {
1997 - key: "apply",
1998 - value: function apply() {
1999 - var _this2 = this;
2000 - var applyMethods = this.getApplyMethods();
2001 - this.args = applyMethods.before(this.args);
2002 - var requestData = this.getRequestData();
2003 - return $e.data.fetch(requestData).then(function(data) {
2004 - _this2.data = data;
2005 - _this2.data = applyMethods.after(data, _this2.args);
2006 - _this2.data = { data: _this2.data };
2007 - _this2.data = Object.assign({ __requestData__: requestData }, _this2.data);
2008 - return _this2.data;
2009 - });
2010 - }
2011 - },
2012 - {
2013 - key: "applyBeforeCreate",
2014 - value: function applyBeforeCreate() {
2015 - return arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2016 - }
2017 - },
2018 - {
2019 - key: "applyAfterCreate",
2020 - value: function applyAfterCreate(data) {
2021 - arguments.length > 1 && arguments[1] !== void 0 && arguments[1];
2022 - return data;
2023 - }
2024 - },
2025 - {
2026 - key: "applyBeforeDelete",
2027 - value: function applyBeforeDelete() {
2028 - return arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2029 - }
2030 - },
2031 - {
2032 - key: "applyAfterDelete",
2033 - value: function applyAfterDelete(data) {
2034 - arguments.length > 1 && arguments[1] !== void 0 && arguments[1];
2035 - return data;
2036 - }
2037 - },
2038 - {
2039 - key: "applyBeforeGet",
2040 - value: function applyBeforeGet() {
2041 - return arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2042 - }
2043 - },
2044 - {
2045 - key: "applyAfterGet",
2046 - value: function applyAfterGet(data) {
2047 - arguments.length > 1 && arguments[1] !== void 0 && arguments[1];
2048 - return data;
2049 - }
2050 - },
2051 - {
2052 - key: "applyBeforeUpdate",
2053 - value: function applyBeforeUpdate() {
2054 - return arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2055 - }
2056 - },
2057 - {
2058 - key: "applyAfterUpdate",
2059 - value: function applyAfterUpdate(data) {
2060 - arguments.length > 1 && arguments[1] !== void 0 && arguments[1];
2061 - return data;
2062 - }
2063 - },
2064 - {
2065 - key: "applyBeforeOptions",
2066 - value: function applyBeforeOptions() {
2067 - return arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2068 - }
2069 - },
2070 - {
2071 - key: "applyAfterOptions",
2072 - value: function applyAfterOptions(data) {
2073 - arguments.length > 1 && arguments[1] !== void 0 && arguments[1];
2074 - return data;
2075 - }
2076 - },
2077 - {
2078 - key: "applyAfterCatch",
2079 - value: function applyAfterCatch(e) {
2080 - e.notify();
2081 - }
2082 - },
2083 - {
2084 - key: "onCatchApply",
2085 - value: function onCatchApply(e) {
2086 - var _e;
2087 - var httpErrorCode = ((_e = e) === null || _e === void 0 || (_e = _e.data) === null || _e === void 0 ? void 0 : _e.status) || 501;
2088 - var dataError = Object.values(errors_exports).find(function(error) {
2089 - return error.getHTTPErrorCode() === httpErrorCode;
2090 - });
2091 - if (!dataError) dataError = DefaultError;
2092 - e = dataError.create(e.message, e.code, e.data || []);
2093 - this.runCatchHooks(e);
2094 - this.applyAfterCatch(e);
2095 - }
2096 - }
2097 - ], [{
2098 - key: "getInstanceType",
2099 - value: function getInstanceType() {
2100 - return "CommandData";
2101 - }
2102 - }, {
2103 - key: "getEndpointFormat",
2104 - value: function getEndpointFormat() {
2105 - return null;
2106 - }
2107 - }]);
2108 - }(CommandBase);
1103 + // Is simple callback? (e.g. a route)
1104 + if (!(context instanceof _commandBase.default)) {
1105 + var results = context.apply(currentComponent, [args]);
1106 + this.afterRun(command, args, results);
1107 + return results;
1108 + }
1109 + if (!this.validateInstanceScope(context, currentComponent, command)) {
1110 + return this.removeCurrentTrace(currentComponent);
1111 + }
1112 + return this.runInstance(context);
1113 + }
2109 1114
2110 -//#endregion
2111 -//#region node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js
2112 - function asyncGeneratorStep(n, t, e, r, o, a, c) {
2113 - try {
2114 - var i = n[a](c);
2115 - var u = i.value;
2116 - } catch (n) {
2117 - e(n);
2118 - return;
2119 - }
2120 - i.done ? t(u) : Promise.resolve(u).then(r, o);
2121 - }
2122 - function _asyncToGenerator(n) {
2123 - return function() {
2124 - var t = this;
2125 - var e = arguments;
2126 - return new Promise(function(r, o) {
2127 - var a = n.apply(t, e);
2128 - function _next(n) {
2129 - asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
2130 - }
2131 - function _throw(n) {
2132 - asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
2133 - }
2134 - _next(void 0);
2135 - });
2136 - };
2137 - }
1115 + /**
1116 + * Function runInstance().
1117 + *
1118 + * @param {CommandBase} instance
1119 + *
1120 + * @return {boolean|Promise<*>}
1121 + */
1122 + }, {
1123 + key: "runInstance",
1124 + value: function runInstance(instance) {
1125 + var results = null;
2138 1126
2139 -//#endregion
2140 -//#region node_modules/@babel/runtime/helpers/OverloadYield.js
2141 - var require_OverloadYield = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2142 - function _OverloadYield(e, d) {
2143 - this.v = e, this.k = d;
2144 - }
2145 - module.exports = _OverloadYield, module.exports.__esModule = true, module.exports["default"] = module.exports;
2146 - }));
1127 + // For UI Hooks.
1128 + instance.onBeforeRun(instance.args);
1129 + try {
1130 + // For data hooks.
1131 + instance.onBeforeApply(instance.args);
1132 + results = instance.run();
1133 + } catch (e) {
1134 + this.catchApply(e, instance);
1135 + if (e instanceof $e.modules.HookBreak) {
1136 + this.removeCurrentTrace(instance.component);
1137 + return false;
1138 + }
1139 + }
1140 + return this.applyRunAfter(instance, results);
1141 + }
2147 1142
2148 -//#endregion
2149 -//#region node_modules/@babel/runtime/helpers/regeneratorDefine.js
2150 - var require_regeneratorDefine = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2151 - function _regeneratorDefine(e, r, n, t) {
2152 - var i = Object.defineProperty;
2153 - try {
2154 - i({}, "", {});
2155 - } catch (e) {
2156 - i = 0;
2157 - }
2158 - module.exports = _regeneratorDefine = function regeneratorDefine(e, r, n, t) {
2159 - function o(r, n) {
2160 - _regeneratorDefine(e, r, function(e) {
2161 - return this._invoke(r, n, e);
2162 - });
2163 - }
2164 - r ? i ? i(e, r, {
2165 - value: n,
2166 - enumerable: !t,
2167 - configurable: !t,
2168 - writable: !t
2169 - }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2));
2170 - }, module.exports.__esModule = true, module.exports["default"] = module.exports, _regeneratorDefine(e, r, n, t);
2171 - }
2172 - module.exports = _regeneratorDefine, module.exports.__esModule = true, module.exports["default"] = module.exports;
2173 - }));
1143 + /**
1144 + * Function applyRunAfter().
1145 + *
1146 + * Responsible for applying everything that need to be run after each command runs.
1147 + * Called on run() after runInstance(), to manipulate results & apply 'after' hooks.
1148 + *
1149 + * @param {CommandBase} instance
1150 + * @param {*} result
1151 + *
1152 + * @return {Promise<*>|*}
1153 + */
1154 + }, {
1155 + key: "applyRunAfter",
1156 + value: function applyRunAfter(instance, result) {
1157 + var _this3 = this;
1158 + // TODO: Temp code determine if it's a jQuery deferred object.
1159 + if (result && 'object' === (0, _typeof2.default)(result) && result.promise && result.then && result.fail) {
1160 + var handleJQueryDeferred = function handleJQueryDeferred(_result) {
1161 + _result.fail(function (e) {
1162 + _this3.catchApply(e, instance);
1163 + _this3.afterRun(instance.command, instance.args, e);
1164 + });
1165 + return _result.done(function (__result) {
1166 + return _this3.applyRunAfterAsyncResult(instance, __result);
1167 + });
1168 + };
1169 + return handleJQueryDeferred(result);
1170 + } else if (result instanceof Promise) {
1171 + return this.applyRunAfterAsync(instance, result);
1172 + }
1173 + this.applyRunAfterSync(instance, result);
1174 + return result;
1175 + }
2174 1176
2175 -//#endregion
2176 -//#region node_modules/@babel/runtime/helpers/regenerator.js
2177 - var require_regenerator$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2178 - var regeneratorDefine = require_regeneratorDefine();
2179 - function _regenerator() {
2180 - /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
2181 - var e;
2182 - var t;
2183 - var r = "function" == typeof Symbol ? Symbol : {};
2184 - var n = r.iterator || "@@iterator";
2185 - var o = r.toStringTag || "@@toStringTag";
2186 - function i(r, n, o, i) {
2187 - var c = n && n.prototype instanceof Generator ? n : Generator;
2188 - var u = Object.create(c.prototype);
2189 - return regeneratorDefine(u, "_invoke", function(r, n, o) {
2190 - var i;
2191 - var c;
2192 - var u;
2193 - var f = 0;
2194 - var p = o || [];
2195 - var y = !1;
2196 - var G = {
2197 - p: 0,
2198 - n: 0,
2199 - v: e,
2200 - a: d,
2201 - f: d.bind(e, 4),
2202 - d: function d(t, r) {
2203 - return i = t, c = 0, u = e, G.n = r, a;
2204 - }
2205 - };
2206 - function d(r, n) {
2207 - for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {
2208 - var o;
2209 - var i = p[t];
2210 - var d = G.p;
2211 - var l = i[2];
2212 - r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0));
2213 - }
2214 - if (o || r > 1) return a;
2215 - throw y = !0, n;
2216 - }
2217 - return function(o, p, l) {
2218 - if (f > 1) throw TypeError("Generator is already running");
2219 - for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) {
2220 - i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);
2221 - try {
2222 - if (f = 2, i) {
2223 - if (c || (o = "next"), t = i[o]) {
2224 - if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");
2225 - if (!t.done) return t;
2226 - u = t.value, c < 2 && (c = 0);
2227 - } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1);
2228 - i = e;
2229 - } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;
2230 - } catch (t) {
2231 - i = e, c = 1, u = t;
2232 - } finally {
2233 - f = 1;
2234 - }
2235 - }
2236 - return {
2237 - value: t,
2238 - done: y
2239 - };
2240 - };
2241 - }(r, o, i), !0), u;
2242 - }
2243 - var a = {};
2244 - function Generator() {}
2245 - function GeneratorFunction() {}
2246 - function GeneratorFunctionPrototype() {}
2247 - t = Object.getPrototypeOf;
2248 - var c = [][n] ? t(t([][n]())) : (regeneratorDefine(t = {}, n, function() {
2249 - return this;
2250 - }), t);
2251 - var u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);
2252 - function f(e) {
2253 - return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e;
2254 - }
2255 - return GeneratorFunction.prototype = GeneratorFunctionPrototype, regeneratorDefine(u, "constructor", GeneratorFunctionPrototype), regeneratorDefine(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", regeneratorDefine(GeneratorFunctionPrototype, o, "GeneratorFunction"), regeneratorDefine(u), regeneratorDefine(u, o, "Generator"), regeneratorDefine(u, n, function() {
2256 - return this;
2257 - }), regeneratorDefine(u, "toString", function() {
2258 - return "[object Generator]";
2259 - }), (module.exports = _regenerator = function _regenerator() {
2260 - return {
2261 - w: i,
2262 - m: f
2263 - };
2264 - }, module.exports.__esModule = true, module.exports["default"] = module.exports)();
2265 - }
2266 - module.exports = _regenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
2267 - }));
1177 + /**
1178 + * Function applyRunAfterSync().
1179 + *
1180 + * Responsible to handle simple(synchronous) 'run after' behavior.
1181 + * Called on applyRunAfterSync() after runInstance(), to handle results.
1182 + *
1183 + * @param {CommandBase} instance
1184 + * @param {*} result
1185 + */
1186 + }, {
1187 + key: "applyRunAfterSync",
1188 + value: function applyRunAfterSync(instance, result) {
1189 + // Run Data hooks.
1190 + instance.onAfterApply(instance.args, result);
2268 1191
2269 -//#endregion
2270 -//#region node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js
2271 - var require_regeneratorAsyncIterator = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2272 - var OverloadYield = require_OverloadYield();
2273 - var regeneratorDefine = require_regeneratorDefine();
2274 - function AsyncIterator(t, e) {
2275 - function n(r, o, i, f) {
2276 - try {
2277 - var c = t[r](o);
2278 - var u = c.value;
2279 - return u instanceof OverloadYield ? e.resolve(u.v).then(function(t) {
2280 - n("next", t, i, f);
2281 - }, function(t) {
2282 - n("throw", t, i, f);
2283 - }) : e.resolve(u).then(function(t) {
2284 - c.value = t, i(c);
2285 - }, function(t) {
2286 - return n("throw", t, i, f);
2287 - });
2288 - } catch (t) {
2289 - f(t);
2290 - }
2291 - }
2292 - var r;
2293 - this.next || (regeneratorDefine(AsyncIterator.prototype), regeneratorDefine(AsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function() {
2294 - return this;
2295 - })), regeneratorDefine(this, "_invoke", function(t, o, i) {
2296 - function f() {
2297 - return new e(function(e, r) {
2298 - n(t, i, e, r);
2299 - });
2300 - }
2301 - return r = r ? r.then(f, f) : f();
2302 - }, !0);
2303 - }
2304 - module.exports = AsyncIterator, module.exports.__esModule = true, module.exports["default"] = module.exports;
2305 - }));
1192 + // For UI hooks.
1193 + instance.onAfterRun(instance.args, result);
1194 + this.afterRun(instance.command, instance.args, result);
1195 + }
2306 1196
2307 -//#endregion
2308 -//#region node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js
2309 - var require_regeneratorAsyncGen = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2310 - var regenerator = require_regenerator$1();
2311 - var regeneratorAsyncIterator = require_regeneratorAsyncIterator();
2312 - function _regeneratorAsyncGen(r, e, t, o, n) {
2313 - return new regeneratorAsyncIterator(regenerator().w(r, e, t, o), n || Promise);
2314 - }
2315 - module.exports = _regeneratorAsyncGen, module.exports.__esModule = true, module.exports["default"] = module.exports;
2316 - }));
1197 + /**
1198 + * Function applyRunAfterAsync().
1199 + *
1200 + * Await for promise result.
1201 + * Called on applyRunAfter() after runInstance().
1202 + *
1203 + * @param {CommandBase} instance
1204 + * @param {*} result
1205 + */
1206 + }, {
1207 + key: "applyRunAfterAsync",
1208 + value: function applyRunAfterAsync(instance, result) {
1209 + var _this4 = this;
1210 + // Override initial result ( promise ) to await onAfter promises, first!.
1211 + return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
1212 + return _regenerator.default.wrap(function (_context) {
1213 + while (1) switch (_context.prev = _context.next) {
1214 + case 0:
1215 + _context.next = 1;
1216 + return result.catch(function (e) {
1217 + _this4.catchApply(e, instance);
1218 + _this4.afterRun(instance.command, instance.args, e);
1219 + });
1220 + case 1:
1221 + _context.next = 2;
1222 + return result.then(function (_result) {
1223 + return _this4.applyRunAfterAsyncResult(instance, _result);
1224 + });
1225 + case 2:
1226 + return _context.abrupt("return", result);
1227 + case 3:
1228 + case "end":
1229 + return _context.stop();
1230 + }
1231 + }, _callee);
1232 + }))();
1233 + }
2317 1234
2318 -//#endregion
2319 -//#region node_modules/@babel/runtime/helpers/regeneratorAsync.js
2320 - var require_regeneratorAsync = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2321 - var regeneratorAsyncGen = require_regeneratorAsyncGen();
2322 - function _regeneratorAsync(n, e, r, t, o) {
2323 - var a = regeneratorAsyncGen(n, e, r, t, o);
2324 - return a.next().then(function(n) {
2325 - return n.done ? n.value : a.next();
2326 - });
2327 - }
2328 - module.exports = _regeneratorAsync, module.exports.__esModule = true, module.exports["default"] = module.exports;
2329 - }));
1235 + /**
1236 + * Function applyRunAfterAsyncResult().
1237 + *
1238 + * Responsible to await all promises results.
1239 + * Called on applyRunAfterAsync() after runInstance(), to handle async results.
1240 + * Awaits all the promises, before releasing the command.
1241 + *
1242 + * @param {CommandBase} instance
1243 + * @param {*} result
1244 + */
1245 + }, {
1246 + key: "applyRunAfterAsyncResult",
1247 + value: (function () {
1248 + var _applyRunAfterAsyncResult = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2(instance, result) {
1249 + var results, promises;
1250 + return _regenerator.default.wrap(function (_context2) {
1251 + while (1) switch (_context2.prev = _context2.next) {
1252 + case 0:
1253 + // Run Data hooks.
1254 + results = instance.onAfterApply(instance.args, result), promises = Array.isArray(results) ? results.flat().filter(function (filtered) {
1255 + return filtered instanceof Promise;
1256 + }) : [];
1257 + if (!promises.length) {
1258 + _context2.next = 1;
1259 + break;
1260 + }
1261 + _context2.next = 1;
1262 + return Promise.all(promises);
1263 + case 1:
1264 + // For UI hooks.
1265 + instance.onAfterRun(instance.args, result);
1266 + this.afterRun(instance.command, instance.args, result);
1267 + case 2:
1268 + case "end":
1269 + return _context2.stop();
1270 + }
1271 + }, _callee2, this);
1272 + }));
1273 + function applyRunAfterAsyncResult(_x, _x2) {
1274 + return _applyRunAfterAsyncResult.apply(this, arguments);
1275 + }
1276 + return applyRunAfterAsyncResult;
1277 + }()
1278 + /**
1279 + * Function afterRun().
1280 + *
1281 + * Responsible to to clear command from trace, and run 'run:after' event.
1282 + * Method fired after the command runs.
1283 + *
1284 + * @param {string} command
1285 + * @param {{}} args
1286 + * @param {*} results
1287 + * @param {boolean} [removeTrace=true]
1288 + */
1289 + )
1290 + }, {
1291 + key: "afterRun",
1292 + value: function afterRun(command, args) {
1293 + var results = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
1294 + var removeTrace = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
1295 + var component = this.getComponent(command);
1296 + if (args.onAfter) {
1297 + args.onAfter.apply(component, [args, results]);
1298 + }
1299 + this.trigger('run:after', component, command, args, results);
1300 + window.dispatchEvent(new CustomEvent('elementor/commands/run/after', {
1301 + detail: {
1302 + command: command,
1303 + args: args
1304 + }
1305 + }));
1306 + if (removeTrace) {
1307 + this.removeCurrentTrace(component);
1308 + }
1309 + }
2330 1310
2331 -//#endregion
2332 -//#region node_modules/@babel/runtime/helpers/regeneratorKeys.js
2333 - var require_regeneratorKeys = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2334 - function _regeneratorKeys(e) {
2335 - var n = Object(e);
2336 - var r = [];
2337 - for (var t in n) r.unshift(t);
2338 - return function e() {
2339 - for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = !1, e;
2340 - return e.done = !0, e;
2341 - };
2342 - }
2343 - module.exports = _regeneratorKeys, module.exports.__esModule = true, module.exports["default"] = module.exports;
2344 - }));
1311 + /**
1312 + * @param {Error} e
1313 + * @param {CommandBase} instance
1314 + */
1315 + }, {
1316 + key: "catchApply",
1317 + value: function catchApply(e, instance) {
1318 + instance.onCatchApply(e);
1319 + _console.default.error(e);
1320 + }
2345 1321
2346 -//#endregion
2347 -//#region node_modules/@babel/runtime/helpers/typeof.js
2348 - var require_typeof = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2349 - function _typeof(o) {
2350 - "@babel/helpers - typeof";
2351 - return module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
2352 - return typeof o;
2353 - } : function(o) {
2354 - return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
2355 - }, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof(o);
2356 - }
2357 - module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
2358 - }));
1322 + /**
1323 + * Function runShortcut().
1324 + *
1325 + * Run shortcut.
1326 + *
1327 + * It's separated in order to allow override.
1328 + *
1329 + * @param {string} command
1330 + * @param {*} event
1331 + *
1332 + * @return {boolean|*} result
1333 + */
1334 + }, {
1335 + key: "runShortcut",
1336 + value: function runShortcut(command, event) {
1337 + return this.run(command, event);
1338 + }
1339 + }, {
1340 + key: "validateInstanceScope",
1341 + value: function validateInstanceScope(instance, currentComponent, command) {
1342 + if (!(instance instanceof _commandBase.default)) {
1343 + this.error("invalid instance, command: '".concat(command, "' "));
1344 + }
2359 1345
2360 -//#endregion
2361 -//#region node_modules/@babel/runtime/helpers/regeneratorValues.js
2362 - var require_regeneratorValues = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2363 - var _typeof = require_typeof()["default"];
2364 - function _regeneratorValues(e) {
2365 - if (null != e) {
2366 - var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"];
2367 - var r = 0;
2368 - if (t) return t.call(e);
2369 - if ("function" == typeof e.next) return e;
2370 - if (!isNaN(e.length)) return { next: function next() {
2371 - return e && r >= e.length && (e = void 0), {
2372 - value: e && e[r++],
2373 - done: !e
2374 - };
2375 - } };
2376 - }
2377 - throw new TypeError(_typeof(e) + " is not iterable");
2378 - }
2379 - module.exports = _regeneratorValues, module.exports.__esModule = true, module.exports["default"] = module.exports;
2380 - }));
1346 + // In case of different scope.
1347 + if (currentComponent !== instance.component) {
1348 + if ($e.devTools) {
1349 + $e.devTools.log.warn("Command: '".concat(command, "' registerArgs.component: '").concat(instance.component.getNamespace(), "' while current component is: '").concat(currentComponent.getNamespace(), "'"));
1350 + }
1351 + return false;
1352 + }
1353 + return true;
1354 + }
1355 + }, {
1356 + key: "addCurrentTrace",
1357 + value: function addCurrentTrace(container, command, args) {
1358 + this.currentTrace.push(command);
1359 + Commands.trace.push(command);
1360 + this.attachCurrent(container, command, args);
1361 + }
1362 + }, {
1363 + key: "removeCurrentTrace",
1364 + value: function removeCurrentTrace(currentComponent) {
1365 + var container = currentComponent.getServiceName();
1366 + this.currentTrace.pop();
1367 + Commands.trace.pop();
1368 + this.detachCurrent(container);
1369 + }
1370 + }, {
1371 + key: "attachCurrent",
1372 + value: function attachCurrent(container, command, args) {
1373 + this.current[container] = command;
1374 + this.currentArgs[container] = args;
1375 + }
1376 + }, {
1377 + key: "detachCurrent",
1378 + value: function detachCurrent(container) {
1379 + delete this.current[container];
1380 + delete this.currentArgs[container];
1381 + }
2381 1382
2382 -//#endregion
2383 -//#region node_modules/@babel/runtime/helpers/regeneratorRuntime.js
2384 - var require_regeneratorRuntime = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2385 - var OverloadYield = require_OverloadYield();
2386 - var regenerator = require_regenerator$1();
2387 - var regeneratorAsync = require_regeneratorAsync();
2388 - var regeneratorAsyncGen = require_regeneratorAsyncGen();
2389 - var regeneratorAsyncIterator = require_regeneratorAsyncIterator();
2390 - var regeneratorKeys = require_regeneratorKeys();
2391 - var regeneratorValues = require_regeneratorValues();
2392 - function _regeneratorRuntime() {
2393 - "use strict";
2394 - var r = regenerator();
2395 - var e = r.m(_regeneratorRuntime);
2396 - var t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor;
2397 - function n(r) {
2398 - var e = "function" == typeof r && r.constructor;
2399 - return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name));
2400 - }
2401 - var o = {
2402 - "throw": 1,
2403 - "return": 2,
2404 - "break": 3,
2405 - "continue": 3
2406 - };
2407 - function a(r) {
2408 - var e;
2409 - var t;
2410 - return function(n) {
2411 - e || (e = {
2412 - stop: function stop() {
2413 - return t(n.a, 2);
2414 - },
2415 - "catch": function _catch() {
2416 - return n.v;
2417 - },
2418 - abrupt: function abrupt(r, e) {
2419 - return t(n.a, o[r], e);
2420 - },
2421 - delegateYield: function delegateYield(r, o, a) {
2422 - return e.resultName = o, t(n.d, regeneratorValues(r), a);
2423 - },
2424 - finish: function finish(r) {
2425 - return t(n.f, r);
2426 - }
2427 - }, t = function t(r, _t, o) {
2428 - n.p = e.prev, n.n = e.next;
2429 - try {
2430 - return r(_t, o);
2431 - } finally {
2432 - e.next = n.n;
2433 - }
2434 - }), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n;
2435 - try {
2436 - return r.call(this, e);
2437 - } finally {
2438 - n.p = e.prev, n.n = e.next;
2439 - }
2440 - };
2441 - }
2442 - return (module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
2443 - return {
2444 - wrap: function wrap(e, t, n, o) {
2445 - return r.w(a(e), t, n, o && o.reverse());
2446 - },
2447 - isGeneratorFunction: n,
2448 - mark: r.m,
2449 - awrap: function awrap(r, e) {
2450 - return new OverloadYield(r, e);
2451 - },
2452 - AsyncIterator: regeneratorAsyncIterator,
2453 - async: function async(r, e, t, o, u) {
2454 - return (n(e) ? regeneratorAsyncGen : regeneratorAsync)(a(r), e, t, o, u);
2455 - },
2456 - keys: regeneratorKeys,
2457 - values: regeneratorValues
2458 - };
2459 - }, module.exports.__esModule = true, module.exports["default"] = module.exports)();
2460 - }
2461 - module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
2462 - }));
1383 + /**
1384 + * Function error().
1385 + *
1386 + * Throws error.
1387 + *
1388 + * @throws {Error}
1389 + *
1390 + * @param {string} message
1391 + */
1392 + }, {
1393 + key: "error",
1394 + value: function error(message) {
1395 + throw Error("Commands: ".concat(message));
1396 + }
1397 + }]);
1398 +}(_commands.default);
1399 +(0, _defineProperty2.default)(Commands, "trace", []);
2463 1400
2464 -//#endregion
2465 -//#region node_modules/@babel/runtime/regenerator/index.js
2466 - var require_regenerator = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2467 - var runtime = require_regeneratorRuntime()();
2468 - module.exports = runtime;
2469 - try {
2470 - regeneratorRuntime = runtime;
2471 - } catch (accidentalStrictMode) {
2472 - if (typeof globalThis === "object") globalThis.regeneratorRuntime = runtime;
2473 - else Function("r", "regeneratorRuntime = r")(runtime);
2474 - }
2475 - }));
1401 +/***/ }),
2476 1402
2477 -//#endregion
2478 -//#region modules/web-cli/assets/js/core/backwards-compatibility/commands.js
2479 -var import_regenerator = /* @__PURE__ */ __toESM(require_regenerator());
2480 - function _callSuper$23(t, o, e) {
2481 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$23() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
2482 - }
2483 - __name(_callSuper$23, "_callSuper");
2484 - function _isNativeReflectConstruct$23() {
2485 - try {
2486 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
2487 - } catch (t) {}
2488 - return (_isNativeReflectConstruct$23 = function _isNativeReflectConstruct() {
2489 - return !!t;
2490 - })();
2491 - }
2492 - __name(_isNativeReflectConstruct$23, "_isNativeReflectConstruct");
2493 - var CommandsBackwardsCompatibility = /*#__PURE__*/ function(_Module) {
2494 - function CommandsBackwardsCompatibility() {
2495 - var _this;
2496 - _classCallCheck(this, CommandsBackwardsCompatibility);
2497 - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
2498 - _this = _callSuper$23(this, CommandsBackwardsCompatibility, [].concat(args));
2499 - _defineProperty(_this, "on", function(eventName, callback) {
2500 - if ("run" === eventName) {
2501 - var componentName = _this.getConstructorID();
2502 - componentName = componentName.replace(/^./, function(val) {
2503 - return val.toLowerCase();
2504 - });
2505 - Deprecation.deprecated("$e.".concat(componentName, ".on( 'run', ... )"), "3.0.0", "$e.".concat(componentName, ".on( 'run:before', ... )"));
2506 - _this.onOrig("run:before", callback);
2507 - return;
2508 - }
2509 - _this.onOrig(eventName, callback);
2510 - });
2511 - return _this;
2512 - }
2513 - _inherits(CommandsBackwardsCompatibility, _Module);
2514 - return _createClass(CommandsBackwardsCompatibility, [{
2515 - key: "__construct",
2516 - value: function __construct() {
2517 - this.onOrig = this.on;
2518 - }
2519 - }]);
2520 - }(import_module.default);
1403 +/***/ "../modules/web-cli/assets/js/core/components.js":
1404 +/*!*******************************************************!*\
1405 + !*** ../modules/web-cli/assets/js/core/components.js ***!
1406 + \*******************************************************/
1407 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2521 1408
2522 -//#endregion
2523 -//#region modules/web-cli/assets/js/core/commands.js
2524 - init_typeof();
2525 - function ownKeys$1(e, r) {
2526 - var t = Object.keys(e);
2527 - if (Object.getOwnPropertySymbols) {
2528 - var o = Object.getOwnPropertySymbols(e);
2529 - r && (o = o.filter(function(r) {
2530 - return Object.getOwnPropertyDescriptor(e, r).enumerable;
2531 - })), t.push.apply(t, o);
2532 - }
2533 - return t;
2534 - }
2535 - __name(ownKeys$1, "ownKeys");
2536 - function _objectSpread$1(e) {
2537 - for (var r = 1; r < arguments.length; r++) {
2538 - var t = null != arguments[r] ? arguments[r] : {};
2539 - r % 2 ? ownKeys$1(Object(t), !0).forEach(function(r) {
2540 - _defineProperty(e, r, t[r]);
2541 - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function(r) {
2542 - Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
2543 - });
2544 - }
2545 - return e;
2546 - }
2547 - __name(_objectSpread$1, "_objectSpread");
2548 - function _callSuper$22(t, o, e) {
2549 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$22() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
2550 - }
2551 - __name(_callSuper$22, "_callSuper");
2552 - function _isNativeReflectConstruct$22() {
2553 - try {
2554 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
2555 - } catch (t) {}
2556 - return (_isNativeReflectConstruct$22 = function _isNativeReflectConstruct() {
2557 - return !!t;
2558 - })();
2559 - }
2560 - __name(_isNativeReflectConstruct$22, "_isNativeReflectConstruct");
2561 - /**
2562 - * @typedef {import('../modules/component-base')} ComponentBase
2563 - */
2564 - /**
2565 - * @typedef {import('../modules/command-base')} CommandBase
2566 - */
2567 - /**
2568 - * @typedef {{}} Component
2569 - */
2570 - var Commands = /*#__PURE__*/ function(_CommandsBackwardsCom) {
2571 - /**
2572 - * Function constructor().
2573 - *
2574 - * Create `$e.commands` API.
2575 - *
2576 - * @param {{}} args
2577 - */
2578 - function Commands() {
2579 - var _this;
2580 - _classCallCheck(this, Commands);
2581 - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
2582 - _this = _callSuper$22(this, Commands, [].concat(args));
2583 - _this.current = {};
2584 - _this.currentArgs = {};
2585 - _this.currentTrace = [];
2586 - _this.commands = {};
2587 - _this.components = {};
2588 - Object.defineProperty(_this, "classes", { get: function get() {
2589 - Deprecation.deprecated("$e.commands.classes", "3.7.0", "$e.commands.getCommandClass(), $e.commandsInternal.getCommandClass(), $e.data.getCommandClass(), $e.routes.getCommandClass() according to the requested command infra-structure,");
2590 - return _objectSpread$1(_objectSpread$1(_objectSpread$1(_objectSpread$1({}, $e.commands.commands), $e.commandsInternal.commands), $e.data.commands), $e.routes.commands);
2591 - } });
2592 - return _this;
2593 - }
2594 - /**
2595 - * @param {string} id
2596 - * @return {CommandBase} command class
2597 - */
2598 - _inherits(Commands, _CommandsBackwardsCom);
2599 - return _createClass(Commands, [
2600 - {
2601 - key: "getCommandClass",
2602 - value: function getCommandClass(id) {
2603 - return this.commands[id];
2604 - }
2605 - },
2606 - {
2607 - key: "getAll",
2608 - value: function getAll() {
2609 - return Object.keys(this.commands).sort();
2610 - }
2611 - },
2612 - {
2613 - key: "register",
2614 - value: function register(component, command, callback) {
2615 - var _this2 = this;
2616 - var namespace;
2617 - if ("string" === typeof component) {
2618 - namespace = component;
2619 - component = $e.components.get(namespace);
2620 - if (!component) this.error("'".concat(namespace, "' component is not exist."));
2621 - } else namespace = component.getNamespace();
2622 - var fullCommand = namespace + (command ? "/" + command : "");
2623 - if (this.commands[fullCommand]) this.error("`".concat(fullCommand, "` is already registered."));
2624 - this.commands[fullCommand] = callback;
2625 - this.components[fullCommand] = namespace;
2626 - var shortcut = component.getShortcuts()[command];
2627 - if (shortcut) {
2628 - shortcut.command = fullCommand;
2629 - shortcut.callback = function(event) {
2630 - return _this2.runShortcut(fullCommand, event);
2631 - };
2632 - $e.shortcuts.register(shortcut.keys, shortcut);
2633 - }
2634 - return this;
2635 - }
2636 - },
2637 - {
2638 - key: "unregister",
2639 - value: function unregister(component, command) {
2640 - var namespace;
2641 - if ("string" === typeof component) {
2642 - namespace = component;
2643 - component = $e.components.get(namespace);
2644 - if (!component) this.error("'".concat(namespace, "' component is not exist."));
2645 - } else namespace = component.getNamespace();
2646 - var fullCommand = namespace + (command ? "/" + command : "");
2647 - if (!this.commands[fullCommand]) this.error("`".concat(fullCommand, "` not exist."));
2648 - delete this.commands[fullCommand];
2649 - delete this.components[fullCommand];
2650 - var shortcut = component.getShortcuts()[command];
2651 - if (shortcut) $e.shortcuts.unregister(shortcut.keys, shortcut);
2652 - return this;
2653 - }
2654 - },
2655 - {
2656 - key: "getComponent",
2657 - value: function getComponent(command) {
2658 - var namespace = this.components[command];
2659 - return $e.components.get(namespace);
2660 - }
2661 - },
2662 - {
2663 - key: "is",
2664 - value: function is(command) {
2665 - var component = this.getComponent(command);
2666 - if (!component) return false;
2667 - return command === this.current[component.getServiceName()];
2668 - }
2669 - },
2670 - {
2671 - key: "isCurrentFirstTrace",
2672 - value: function isCurrentFirstTrace(command) {
2673 - return command === this.getCurrentFirstTrace();
2674 - }
2675 - },
2676 - {
2677 - key: "getCurrent",
2678 - value: function getCurrent() {
2679 - var container = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
2680 - if (container) {
2681 - if (!this.current[container]) return false;
2682 - return this.current[container];
2683 - }
2684 - return this.current;
2685 - }
2686 - },
2687 - {
2688 - key: "getCurrentArgs",
2689 - value: function getCurrentArgs() {
2690 - var container = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
2691 - if (container) {
2692 - if (!this.currentArgs[container]) return false;
2693 - return this.currentArgs[container];
2694 - }
2695 - return this.currentArgs;
2696 - }
2697 - },
2698 - {
2699 - key: "getCurrentFirst",
2700 - value: function getCurrentFirst() {
2701 - return Object.values(this.current)[0];
2702 - }
2703 - },
2704 - {
2705 - key: "getCurrentLast",
2706 - value: function getCurrentLast() {
2707 - var current = Object.values(this.current);
2708 - return current[current.length - 1];
2709 - }
2710 - },
2711 - {
2712 - key: "getCurrentFirstTrace",
2713 - value: function getCurrentFirstTrace() {
2714 - return this.currentTrace[0];
2715 - }
2716 - },
2717 - {
2718 - key: "beforeRun",
2719 - value: function beforeRun(command) {
2720 - var args = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
2721 - var addTrace = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true;
2722 - var component = this.getComponent(command);
2723 - var container = component.getServiceName();
2724 - if (addTrace) this.addCurrentTrace(container, command, args);
2725 - if (args.onBefore) args.onBefore.apply(component, [args]);
2726 - this.trigger("run:before", component, command, args);
2727 - window.dispatchEvent(new CustomEvent("elementor/commands/run/before", { detail: {
2728 - command,
2729 - args
2730 - } }));
2731 - }
2732 - },
2733 - {
2734 - key: "validateRun",
2735 - value: function validateRun(command) {
2736 - var args = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
2737 - if (!this.commands[command]) this.error("`".concat(command, "` not found."));
2738 - return this.getComponent(command).dependency(command, args);
2739 - }
2740 - },
2741 - {
2742 - key: "run",
2743 - value: function run(command) {
2744 - var args = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
2745 - if (!this.validateRun(command, args)) return false;
2746 - this.beforeRun(command, args);
2747 - var context = this.commands[command];
2748 - if (context.getInstanceType) context = new context(args);
2749 - var currentComponent = this.getComponent(command);
2750 - if (!(context instanceof CommandBase)) {
2751 - var results = context.apply(currentComponent, [args]);
2752 - this.afterRun(command, args, results);
2753 - return results;
2754 - }
2755 - if (!this.validateInstanceScope(context, currentComponent, command)) return this.removeCurrentTrace(currentComponent);
2756 - return this.runInstance(context);
2757 - }
2758 - },
2759 - {
2760 - key: "runInstance",
2761 - value: function runInstance(instance) {
2762 - var results = null;
2763 - instance.onBeforeRun(instance.args);
2764 - try {
2765 - instance.onBeforeApply(instance.args);
2766 - results = instance.run();
2767 - } catch (e) {
2768 - this.catchApply(e, instance);
2769 - if (e instanceof $e.modules.HookBreak) {
2770 - this.removeCurrentTrace(instance.component);
2771 - return false;
2772 - }
2773 - }
2774 - return this.applyRunAfter(instance, results);
2775 - }
2776 - },
2777 - {
2778 - key: "applyRunAfter",
2779 - value: function applyRunAfter(instance, result) {
2780 - var _this3 = this;
2781 - if (result && "object" === _typeof(result) && result.promise && result.then && result.fail) return function handleJQueryDeferred(_result) {
2782 - _result.fail(function(e) {
2783 - _this3.catchApply(e, instance);
2784 - _this3.afterRun(instance.command, instance.args, e);
2785 - });
2786 - return _result.done(function(__result) {
2787 - return _this3.applyRunAfterAsyncResult(instance, __result);
2788 - });
2789 - }(result);
2790 - else if (result instanceof Promise) return this.applyRunAfterAsync(instance, result);
2791 - this.applyRunAfterSync(instance, result);
2792 - return result;
2793 - }
2794 - },
2795 - {
2796 - key: "applyRunAfterSync",
2797 - value: function applyRunAfterSync(instance, result) {
2798 - instance.onAfterApply(instance.args, result);
2799 - instance.onAfterRun(instance.args, result);
2800 - this.afterRun(instance.command, instance.args, result);
2801 - }
2802 - },
2803 - {
2804 - key: "applyRunAfterAsync",
2805 - value: function applyRunAfterAsync(instance, result) {
2806 - var _this4 = this;
2807 - return _asyncToGenerator(/*#__PURE__*/ import_regenerator.default.mark(function _callee() {
2808 - return import_regenerator.default.wrap(function(_context) {
2809 - while (1) switch (_context.prev = _context.next) {
2810 - case 0:
2811 - _context.next = 1;
2812 - return result.catch(function(e) {
2813 - _this4.catchApply(e, instance);
2814 - _this4.afterRun(instance.command, instance.args, e);
2815 - });
2816 - case 1:
2817 - _context.next = 2;
2818 - return result.then(function(_result) {
2819 - return _this4.applyRunAfterAsyncResult(instance, _result);
2820 - });
2821 - case 2: return _context.abrupt("return", result);
2822 - case 3:
2823 - case "end": return _context.stop();
2824 - }
2825 - }, _callee);
2826 - }))();
2827 - }
2828 - },
2829 - {
2830 - key: "applyRunAfterAsyncResult",
2831 - value: function() {
2832 - var _applyRunAfterAsyncResult = _asyncToGenerator(/*#__PURE__*/ import_regenerator.default.mark(function _callee2(instance, result) {
2833 - var results;
2834 - var promises;
2835 - return import_regenerator.default.wrap(function(_context2) {
2836 - while (1) switch (_context2.prev = _context2.next) {
2837 - case 0:
2838 - results = instance.onAfterApply(instance.args, result), promises = Array.isArray(results) ? results.flat().filter(function(filtered) {
2839 - return filtered instanceof Promise;
2840 - }) : [];
2841 - if (!promises.length) {
2842 - _context2.next = 1;
2843 - break;
2844 - }
2845 - _context2.next = 1;
2846 - return Promise.all(promises);
2847 - case 1:
2848 - instance.onAfterRun(instance.args, result);
2849 - this.afterRun(instance.command, instance.args, result);
2850 - case 2:
2851 - case "end": return _context2.stop();
2852 - }
2853 - }, _callee2, this);
2854 - }));
2855 - function applyRunAfterAsyncResult(_x, _x2) {
2856 - return _applyRunAfterAsyncResult.apply(this, arguments);
2857 - }
2858 - return applyRunAfterAsyncResult;
2859 - }()
2860 - },
2861 - {
2862 - key: "afterRun",
2863 - value: function afterRun(command, args) {
2864 - var results = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : void 0;
2865 - var removeTrace = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : true;
2866 - var component = this.getComponent(command);
2867 - if (args.onAfter) args.onAfter.apply(component, [args, results]);
2868 - this.trigger("run:after", component, command, args, results);
2869 - window.dispatchEvent(new CustomEvent("elementor/commands/run/after", { detail: {
2870 - command,
2871 - args
2872 - } }));
2873 - if (removeTrace) this.removeCurrentTrace(component);
2874 - }
2875 - },
2876 - {
2877 - key: "catchApply",
2878 - value: function catchApply(e, instance) {
2879 - instance.onCatchApply(e);
2880 - Console.error(e);
2881 - }
2882 - },
2883 - {
2884 - key: "runShortcut",
2885 - value: function runShortcut(command, event) {
2886 - return this.run(command, event);
2887 - }
2888 - },
2889 - {
2890 - key: "validateInstanceScope",
2891 - value: function validateInstanceScope(instance, currentComponent, command) {
2892 - if (!(instance instanceof CommandBase)) this.error("invalid instance, command: '".concat(command, "' "));
2893 - if (currentComponent !== instance.component) {
2894 - if ($e.devTools) $e.devTools.log.warn("Command: '".concat(command, "' registerArgs.component: '").concat(instance.component.getNamespace(), "' while current component is: '").concat(currentComponent.getNamespace(), "'"));
2895 - return false;
2896 - }
2897 - return true;
2898 - }
2899 - },
2900 - {
2901 - key: "addCurrentTrace",
2902 - value: function addCurrentTrace(container, command, args) {
2903 - this.currentTrace.push(command);
2904 - Commands.trace.push(command);
2905 - this.attachCurrent(container, command, args);
2906 - }
2907 - },
2908 - {
2909 - key: "removeCurrentTrace",
2910 - value: function removeCurrentTrace(currentComponent) {
2911 - var container = currentComponent.getServiceName();
2912 - this.currentTrace.pop();
2913 - Commands.trace.pop();
2914 - this.detachCurrent(container);
2915 - }
2916 - },
2917 - {
2918 - key: "attachCurrent",
2919 - value: function attachCurrent(container, command, args) {
2920 - this.current[container] = command;
2921 - this.currentArgs[container] = args;
2922 - }
2923 - },
2924 - {
2925 - key: "detachCurrent",
2926 - value: function detachCurrent(container) {
2927 - delete this.current[container];
2928 - delete this.currentArgs[container];
2929 - }
2930 - },
2931 - {
2932 - key: "error",
2933 - value: function error(message) {
2934 - throw Error("Commands: ".concat(message));
2935 - }
2936 - }
2937 - ]);
2938 - }(CommandsBackwardsCompatibility);
2939 - _defineProperty(Commands, "trace", []);
1409 +"use strict";
2940 1410
2941 -//#endregion
2942 -//#region modules/web-cli/assets/js/core/commands-internal.js
2943 - function _callSuper$21(t, o, e) {
2944 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$21() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
2945 - }
2946 - __name(_callSuper$21, "_callSuper");
2947 - function _isNativeReflectConstruct$21() {
2948 - try {
2949 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
2950 - } catch (t) {}
2951 - return (_isNativeReflectConstruct$21 = function _isNativeReflectConstruct() {
2952 - return !!t;
2953 - })();
2954 - }
2955 - __name(_isNativeReflectConstruct$21, "_isNativeReflectConstruct");
2956 - var CommandsInternal = /*#__PURE__*/ function(_Commands) {
2957 - function CommandsInternal() {
2958 - _classCallCheck(this, CommandsInternal);
2959 - return _callSuper$21(this, CommandsInternal, arguments);
2960 - }
2961 - _inherits(CommandsInternal, _Commands);
2962 - return _createClass(CommandsInternal, [{
2963 - key: "error",
2964 - value: function error(message) {
2965 - throw Error("Commands internal: " + message);
2966 - }
2967 - }]);
2968 - }(Commands);
2969 1411
2970 -//#endregion
2971 -//#region modules/web-cli/assets/js/modules/commands/close.js
2972 - function _callSuper$20(t, o, e) {
2973 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$20() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
2974 - }
2975 - __name(_callSuper$20, "_callSuper");
2976 - function _isNativeReflectConstruct$20() {
2977 - try {
2978 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
2979 - } catch (t) {}
2980 - return (_isNativeReflectConstruct$20 = function _isNativeReflectConstruct() {
2981 - return !!t;
2982 - })();
2983 - }
2984 - __name(_isNativeReflectConstruct$20, "_isNativeReflectConstruct");
2985 - var Close = /*#__PURE__*/ function(_CommandBase) {
2986 - function Close() {
2987 - _classCallCheck(this, Close);
2988 - return _callSuper$20(this, Close, arguments);
2989 - }
2990 - _inherits(Close, _CommandBase);
2991 - return _createClass(Close, [{
2992 - key: "apply",
2993 - value: function apply() {
2994 - this.component.close();
2995 - }
2996 - }]);
2997 - }(CommandBase);
1412 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1413 +Object.defineProperty(exports, "__esModule", ({
1414 + value: true
1415 +}));
1416 +exports["default"] = void 0;
1417 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
1418 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
1419 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
1420 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
1421 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
1422 +var _module = _interopRequireDefault(__webpack_require__(/*! elementor-assets-js/modules/imports/module.js */ "../assets/dev/js/modules/imports/module.js"));
1423 +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)); }
1424 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
1425 +/**
1426 + * @typedef {{}} Component
1427 + */
1428 +var _default = exports["default"] = /*#__PURE__*/function (_Module) {
1429 + function _default() {
1430 + var _this;
1431 + (0, _classCallCheck2.default)(this, _default);
1432 + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1433 + args[_key] = arguments[_key];
1434 + }
1435 + _this = _callSuper(this, _default, [].concat(args));
1436 + _this.components = {};
1437 + _this.activeComponents = {};
1438 + return _this;
1439 + }
1440 + (0, _inherits2.default)(_default, _Module);
1441 + return (0, _createClass2.default)(_default, [{
1442 + key: "getAll",
1443 + value: function getAll() {
1444 + return Object.keys(this.components).sort();
1445 + }
1446 + }, {
1447 + key: "register",
1448 + value: function register(component) {
1449 + if (this.components[component.getNamespace()]) {
1450 + return;
1451 + }
1452 + component.registerAPI();
1453 + this.components[component.getNamespace()] = component;
1454 + return component;
1455 + }
2998 1456
2999 -//#endregion
3000 -//#region modules/web-cli/assets/js/modules/commands/open.js
3001 - function _callSuper$19(t, o, e) {
3002 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$19() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
3003 - }
3004 - __name(_callSuper$19, "_callSuper");
3005 - function _isNativeReflectConstruct$19() {
3006 - try {
3007 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
3008 - } catch (t) {}
3009 - return (_isNativeReflectConstruct$19 = function _isNativeReflectConstruct() {
3010 - return !!t;
3011 - })();
3012 - }
3013 - __name(_isNativeReflectConstruct$19, "_isNativeReflectConstruct");
3014 - var Open = /*#__PURE__*/ function(_CommandBase) {
3015 - function Open() {
3016 - _classCallCheck(this, Open);
3017 - return _callSuper$19(this, Open, arguments);
3018 - }
3019 - _inherits(Open, _CommandBase);
3020 - return _createClass(Open, [{
3021 - key: "apply",
3022 - value: function apply() {
3023 - $e.route(this.component.getNamespace());
3024 - }
3025 - }]);
3026 - }(CommandBase);
1457 + /**
1458 + * @param {string} id
1459 + * @return {Component} component
1460 + */
1461 + }, {
1462 + key: "get",
1463 + value: function get(id) {
1464 + return this.components[id];
1465 + }
1466 + }, {
1467 + key: "getActive",
1468 + value: function getActive() {
1469 + return this.activeComponents;
1470 + }
1471 + }, {
1472 + key: "activate",
1473 + value: function activate(namespace) {
1474 + // Add as last.
1475 + this.inactivate(namespace);
1476 + this.activeComponents[namespace] = true;
1477 + }
1478 + }, {
1479 + key: "inactivate",
1480 + value: function inactivate(namespace) {
1481 + delete this.activeComponents[namespace];
1482 + }
1483 + }, {
1484 + key: "isActive",
1485 + value: function isActive(namespace) {
1486 + return !!this.activeComponents[namespace];
1487 + }
1488 + }]);
1489 +}(_module.default);
3027 1490
3028 -//#endregion
3029 -//#region modules/web-cli/assets/js/modules/commands/toggle.js
3030 - function _callSuper$18(t, o, e) {
3031 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$18() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
3032 - }
3033 - __name(_callSuper$18, "_callSuper");
3034 - function _isNativeReflectConstruct$18() {
3035 - try {
3036 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
3037 - } catch (t) {}
3038 - return (_isNativeReflectConstruct$18 = function _isNativeReflectConstruct() {
3039 - return !!t;
3040 - })();
3041 - }
3042 - __name(_isNativeReflectConstruct$18, "_isNativeReflectConstruct");
3043 - var Toggle = /*#__PURE__*/ function(_CommandBase) {
3044 - function Toggle() {
3045 - _classCallCheck(this, Toggle);
3046 - return _callSuper$18(this, Toggle, arguments);
3047 - }
3048 - _inherits(Toggle, _CommandBase);
3049 - return _createClass(Toggle, [{
3050 - key: "apply",
3051 - value: function apply() {
3052 - if (this.component.isOpen) this.component.close();
3053 - else $e.route(this.component.getNamespace());
3054 - }
3055 - }]);
3056 - }(CommandBase);
1491 +/***/ }),
3057 1492
3058 -//#endregion
3059 -//#region modules/web-cli/assets/js/modules/commands/index.js
3060 - var commands_exports = /* @__PURE__ */ __exportAll({
3061 - Close: () => Close,
3062 - Open: () => Open,
3063 - Toggle: () => Toggle
3064 - });
1493 +/***/ "../modules/web-cli/assets/js/core/data.js":
1494 +/*!*************************************************!*\
1495 + !*** ../modules/web-cli/assets/js/core/data.js ***!
1496 + \*************************************************/
1497 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
3065 1498
3066 -//#endregion
3067 -//#region modules/web-cli/assets/js/modules/component-modal-base.js
3068 - function _callSuper$17(t, o, e) {
3069 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$17() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
3070 - }
3071 - __name(_callSuper$17, "_callSuper");
3072 - function _isNativeReflectConstruct$17() {
3073 - try {
3074 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
3075 - } catch (t) {}
3076 - return (_isNativeReflectConstruct$17 = function _isNativeReflectConstruct() {
3077 - return !!t;
3078 - })();
3079 - }
3080 - __name(_isNativeReflectConstruct$17, "_isNativeReflectConstruct");
3081 - function _superPropGet$4(t, o, e, r) {
3082 - var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e);
3083 - return 2 & r && "function" == typeof p ? function(t) {
3084 - return p.apply(e, t);
3085 - } : p;
3086 - }
3087 - __name(_superPropGet$4, "_superPropGet");
3088 - var ComponentModalBase = /*#__PURE__*/ function(_ComponentBase) {
3089 - function ComponentModalBase() {
3090 - _classCallCheck(this, ComponentModalBase);
3091 - return _callSuper$17(this, ComponentModalBase, arguments);
3092 - }
3093 - _inherits(ComponentModalBase, _ComponentBase);
3094 - return _createClass(ComponentModalBase, [
3095 - {
3096 - key: "registerAPI",
3097 - value: function registerAPI() {
3098 - var _this = this;
3099 - _superPropGet$4(ComponentModalBase, "registerAPI", this, 3)([]);
3100 - $e.shortcuts.register("esc", {
3101 - scopes: [this.getNamespace()],
3102 - callback: function callback() {
3103 - return _this.close();
3104 - }
3105 - });
3106 - }
3107 - },
3108 - {
3109 - key: "defaultCommands",
3110 - value: function defaultCommands() {
3111 - return this.importCommands(commands_exports);
3112 - }
3113 - },
3114 - {
3115 - key: "defaultRoutes",
3116 - value: function defaultRoutes() {
3117 - return { "": function _() {} };
3118 - }
3119 - },
3120 - {
3121 - key: "open",
3122 - value: function open() {
3123 - var _this2 = this;
3124 - if (!this.layout) {
3125 - var layout = this.getModalLayout();
3126 - this.layout = new layout({ component: this });
3127 - this.layout.getModal().on("hide", function() {
3128 - return _this2.close();
3129 - });
3130 - }
3131 - this.layout.showModal();
3132 - return true;
3133 - }
3134 - },
3135 - {
3136 - key: "close",
3137 - value: function close() {
3138 - if (!_superPropGet$4(ComponentModalBase, "close", this, 3)([])) return false;
3139 - elementor.hooks.applyFilters("component/modal/close", this.layout.getModal().hide.bind(this.layout.getModal()), this)();
3140 - return true;
3141 - }
3142 - },
3143 - {
3144 - key: "getModalLayout",
3145 - value: function getModalLayout() {
3146 - force_method_implementation_default();
3147 - }
3148 - }
3149 - ]);
3150 - }(ComponentBase);
1499 +"use strict";
3151 1500
3152 -//#endregion
3153 -//#region modules/web-cli/assets/js/core/components.js
3154 - function _callSuper$16(t, o, e) {
3155 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$16() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
3156 - }
3157 - __name(_callSuper$16, "_callSuper");
3158 - function _isNativeReflectConstruct$16() {
3159 - try {
3160 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
3161 - } catch (t) {}
3162 - return (_isNativeReflectConstruct$16 = function _isNativeReflectConstruct() {
3163 - return !!t;
3164 - })();
3165 - }
3166 - __name(_isNativeReflectConstruct$16, "_isNativeReflectConstruct");
3167 - /**
3168 - * @typedef {{}} Component
3169 - */
3170 - var _default = /*#__PURE__*/ function(_Module) {
3171 - function _default() {
3172 - var _this;
3173 - _classCallCheck(this, _default);
3174 - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
3175 - _this = _callSuper$16(this, _default, [].concat(args));
3176 - _this.components = {};
3177 - _this.activeComponents = {};
3178 - return _this;
3179 - }
3180 - _inherits(_default, _Module);
3181 - return _createClass(_default, [
3182 - {
3183 - key: "getAll",
3184 - value: function getAll() {
3185 - return Object.keys(this.components).sort();
3186 - }
3187 - },
3188 - {
3189 - key: "register",
3190 - value: function register(component) {
3191 - if (this.components[component.getNamespace()]) return;
3192 - component.registerAPI();
3193 - this.components[component.getNamespace()] = component;
3194 - return component;
3195 - }
3196 - },
3197 - {
3198 - key: "get",
3199 - value: function get(id) {
3200 - return this.components[id];
3201 - }
3202 - },
3203 - {
3204 - key: "getActive",
3205 - value: function getActive() {
3206 - return this.activeComponents;
3207 - }
3208 - },
3209 - {
3210 - key: "activate",
3211 - value: function activate(namespace) {
3212 - this.inactivate(namespace);
3213 - this.activeComponents[namespace] = true;
3214 - }
3215 - },
3216 - {
3217 - key: "inactivate",
3218 - value: function inactivate(namespace) {
3219 - delete this.activeComponents[namespace];
3220 - }
3221 - },
3222 - {
3223 - key: "isActive",
3224 - value: function isActive(namespace) {
3225 - return !!this.activeComponents[namespace];
3226 - }
3227 - }
3228 - ]);
3229 - }(import_module.default);
3230 1501
3231 -//#endregion
3232 -//#region modules/web-cli/assets/js/core/data/storages/base-storage.js
1502 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1503 +Object.defineProperty(exports, "__esModule", ({
1504 + value: true
1505 +}));
1506 +exports["default"] = exports.READABLE = exports.EDITABLE = exports.DELETABLE = exports.CREATABLE = exports.ALLMETHODS = void 0;
1507 +var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js"));
1508 +var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js"));
1509 +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
1510 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
1511 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
1512 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
1513 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
1514 +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js"));
1515 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
1516 +var _argsObject = _interopRequireDefault(__webpack_require__(/*! elementor-assets-js/modules/imports/args-object */ "../assets/dev/js/modules/imports/args-object.js"));
1517 +var _commands = _interopRequireDefault(__webpack_require__(/*! ./commands.js */ "../modules/web-cli/assets/js/core/commands.js"));
1518 +var _cache = _interopRequireDefault(__webpack_require__(/*! ./data/cache */ "../modules/web-cli/assets/js/core/data/cache.js"));
1519 +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)); }
1520 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
1521 +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; }
3233 1522 /**
3234 - * TODO: Merge all storage's to one.
3235 - * Using this technique give's the ability to use JSDOC from 'window.storage'.
3236 - *
3237 - * @implements {Storage}
3238 - */
3239 - var BaseStorage = /*#__PURE__*/ function() {
3240 - /**
3241 - * Create storage wrapper.
3242 - *
3243 - * @param {Storage} provider
3244 - */
3245 - function BaseStorage(provider) {
3246 - _classCallCheck(this, BaseStorage);
3247 - if (BaseStorage === (this instanceof BaseStorage ? this.constructor : void 0)) throw new TypeError("Cannot construct BaseStorage instances directly");
3248 - this.provider = provider;
3249 - }
3250 - return _createClass(BaseStorage, [
3251 - {
3252 - key: "clear",
3253 - value: function clear() {
3254 - return this.provider.clear();
3255 - }
3256 - },
3257 - {
3258 - key: "getItem",
3259 - value: function getItem(key) {
3260 - var result = this.provider.getItem(key);
3261 - if (null !== result) return JSON.parse(result);
3262 - return result;
3263 - }
3264 - },
3265 - {
3266 - key: "key",
3267 - value: function key(index) {
3268 - return this.provider.key(index);
3269 - }
3270 - },
3271 - {
3272 - key: "removeItem",
3273 - value: function removeItem(key) {
3274 - return this.provider.removeItem(key);
3275 - }
3276 - },
3277 - {
3278 - key: "setItem",
3279 - value: function setItem(key, value) {
3280 - return this.provider.setItem(key, JSON.stringify(value));
3281 - }
3282 - },
3283 - {
3284 - key: "getAll",
3285 - value: function getAll() {
3286 - var _this = this;
3287 - var keys = Object.keys(this.provider);
3288 - var result = {};
3289 - keys.forEach(function(key) {
3290 - result[key] = _this.getItem(key);
3291 - });
3292 - return result;
3293 - }
3294 - }
3295 - ]);
3296 - }();
1523 + * @typedef {('create'|'delete'|'get'|'update'|'options')} DataTypes
1524 + */
1525 +/**
1526 + * @typedef {import('../modules/component-base')} ComponentBase
1527 + */
1528 +/**
1529 + * @typedef {{}} RequestInfo
1530 + */
3297 1531
3298 -//#endregion
3299 -//#region modules/web-cli/assets/js/core/data/storages/base-prefix-storage.js
3300 - function _callSuper$15(t, o, e) {
3301 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$15() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
3302 - }
3303 - __name(_callSuper$15, "_callSuper");
3304 - function _isNativeReflectConstruct$15() {
3305 - try {
3306 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
3307 - } catch (t) {}
3308 - return (_isNativeReflectConstruct$15 = function _isNativeReflectConstruct() {
3309 - return !!t;
3310 - })();
3311 - }
3312 - __name(_isNativeReflectConstruct$15, "_isNativeReflectConstruct");
3313 - function _superPropGet$3(t, o, e, r) {
3314 - var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e);
3315 - return 2 & r && "function" == typeof p ? function(t) {
3316 - return p.apply(e, t);
3317 - } : p;
3318 - }
3319 - __name(_superPropGet$3, "_superPropGet");
3320 - var BasePrefixStorage = /*#__PURE__*/ function(_BaseStorage) {
3321 - function BasePrefixStorage() {
3322 - _classCallCheck(this, BasePrefixStorage);
3323 - return _callSuper$15(this, BasePrefixStorage, arguments);
3324 - }
3325 - _inherits(BasePrefixStorage, _BaseStorage);
3326 - return _createClass(BasePrefixStorage, [
3327 - {
3328 - key: "clear",
3329 - value: function clear() {
3330 - var _this = this;
3331 - Object.keys(this.getAll()).forEach(function(key) {
3332 - return _this.removeItem(key);
3333 - });
3334 - }
3335 - },
3336 - {
3337 - key: "getItem",
3338 - value: function getItem(key) {
3339 - return _superPropGet$3(BasePrefixStorage, "getItem", this, 3)([BasePrefixStorage.DEFAULT_KEY_PREFIX + key]);
3340 - }
3341 - },
3342 - {
3343 - key: "removeItem",
3344 - value: function removeItem(key) {
3345 - return _superPropGet$3(BasePrefixStorage, "removeItem", this, 3)([BasePrefixStorage.DEFAULT_KEY_PREFIX + key]);
3346 - }
3347 - },
3348 - {
3349 - key: "setItem",
3350 - value: function setItem(key, value) {
3351 - return _superPropGet$3(BasePrefixStorage, "setItem", this, 3)([BasePrefixStorage.DEFAULT_KEY_PREFIX + key, value]);
3352 - }
3353 - },
3354 - {
3355 - key: "getAll",
3356 - value: function getAll() {
3357 - var _this2 = this;
3358 - var DEFAULT_KEY_PREFIX = BasePrefixStorage.DEFAULT_KEY_PREFIX;
3359 - var keys = Object.keys(this.provider);
3360 - var result = {};
3361 - keys.forEach(function(key) {
3362 - if (key.startsWith(DEFAULT_KEY_PREFIX)) {
3363 - key = key.replace(DEFAULT_KEY_PREFIX, "");
3364 - result[key] = _this2.getItem(key);
3365 - }
3366 - });
3367 - return result;
3368 - }
3369 - }
3370 - ]);
3371 - }(BaseStorage);
3372 - _defineProperty(BasePrefixStorage, "DEFAULT_KEY_PREFIX", "e_");
1532 +/**
1533 + * @typedef {{}} RequestData
1534 + * @property {ComponentBase} component component
1535 + * @property {string} command command
1536 + * @property {{}} args arguments
1537 + * @property {DataTypes} type type
1538 + * @property {number} timestamp timestamp
1539 + * @property {string} endpoint endpoint
1540 + *
1541 + * @property {string} [baseEndpointURL] baseEndpointURL
1542 + * @property {string} [namespace] namespace
1543 + * @property {string} [version] version
1544 + * @property {('hit'|'miss')} [cache] cache
1545 + */
3373 1546
3374 -//#endregion
3375 -//#region modules/web-cli/assets/js/core/data/storages/local-storage.js
3376 - function _callSuper$14(t, o, e) {
3377 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$14() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
3378 - }
3379 - __name(_callSuper$14, "_callSuper");
3380 - function _isNativeReflectConstruct$14() {
3381 - try {
3382 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
3383 - } catch (t) {}
3384 - return (_isNativeReflectConstruct$14 = function _isNativeReflectConstruct() {
3385 - return !!t;
3386 - })();
3387 - }
3388 - __name(_isNativeReflectConstruct$14, "_isNativeReflectConstruct");
3389 - var LocalStorage = /*#__PURE__*/ function(_BasePrefixStorage) {
3390 - function LocalStorage() {
3391 - _classCallCheck(this, LocalStorage);
3392 - return _callSuper$14(this, LocalStorage, [localStorage]);
3393 - }
3394 - _inherits(LocalStorage, _BasePrefixStorage);
3395 - return _createClass(LocalStorage, [{
3396 - key: "debug",
3397 - value: function debug() {
3398 - var entries = this.getAll();
3399 - var ordered = {};
3400 - Object.keys(entries).sort().forEach(function(key) {
3401 - ordered[key] = entries[key];
3402 - });
3403 - return ordered;
3404 - }
3405 - }]);
3406 - }(BasePrefixStorage);
1547 +/**
1548 + * @typedef {Object} ExtractedCommand
1549 + * @property {string} command command
1550 + * @property {Object} args arguments
1551 + */
3407 1552
3408 -//#endregion
3409 -//#region modules/web-cli/assets/js/core/data/cache.js
3410 - init_typeof();
3411 - /**
3412 - * @typedef {{}} RequestData
3413 - */
3414 - /**
3415 - * @typedef {import('../data')} Data
3416 - */
3417 - /**
3418 - * TODO: Search common logic, create functions to reduce code size.
3419 - */
3420 - var Cache = /*#__PURE__*/ function() {
3421 - /**
3422 - * Function constructor().
3423 - *
3424 - * Create cache.
3425 - *
3426 - * @param {Data} manager
3427 - */
3428 - function Cache(manager) {
3429 - _classCallCheck(this, Cache);
3430 - this.manager = manager;
3431 - this.storage = new LocalStorage();
3432 - }
3433 - /**
3434 - * Function getAsync().
3435 - *
3436 - * Receive from cache. the difference between getAsync() and get() is that receive return it as promise...
3437 - * to fake fetch mechanism.
3438 - *
3439 - * @param {RequestData} requestData
3440 - *
3441 - * @return {(Promise|boolean)} request data
3442 - */
3443 - return _createClass(Cache, [
3444 - {
3445 - key: "getAsync",
3446 - value: function getAsync(requestData) {
3447 - var data = this.get(requestData);
3448 - if (null !== data) {
3449 - requestData.cache = "hit";
3450 - return new Promise(function(resolve) {
3451 - resolve(data);
3452 - });
3453 - }
3454 - return false;
3455 - }
3456 - },
3457 - {
3458 - key: "set",
3459 - value: function set(requestData, data) {
3460 - $e.data.validateRequestData(requestData);
3461 - var componentName = requestData.component.getNamespace();
3462 - var pureEndpoint = requestData.endpoint.replace(componentName + "/", "");
3463 - var pureEndpointParts = pureEndpoint.split("/");
3464 - var newData = {};
3465 - if (pureEndpointParts.length && pureEndpoint !== componentName) {
3466 - var result = pureEndpointParts.reduce(function(accumulator, pureEndpointPart) {
3467 - accumulator[pureEndpointPart] = {};
3468 - return accumulator[pureEndpointPart];
3469 - }, newData);
3470 - Object.assign(result, data);
3471 - } else newData = data;
3472 - var oldData = this.storage.getItem(componentName);
3473 - if (oldData !== null) newData = jQuery.extend(true, oldData, newData);
3474 - this.storage.setItem(componentName, newData);
3475 - }
3476 - },
3477 - {
3478 - key: "get",
3479 - value: function get(requestData) {
3480 - $e.data.validateRequestData(requestData);
3481 - var componentName = requestData.component.getNamespace();
3482 - var componentData = this.storage.getItem(componentName);
3483 - if (componentData !== null) {
3484 - if (componentName === requestData.endpoint) return componentData;
3485 - return requestData.endpoint.replace(requestData.component.getNamespace() + "/", "").split("/").reduce(function(accumulator, endpointPart) {
3486 - if (accumulator && accumulator[endpointPart]) return accumulator[endpointPart];
3487 - }, componentData) || null;
3488 - }
3489 - return null;
3490 - }
3491 - },
3492 - {
3493 - key: "update",
3494 - value: function update(requestData) {
3495 - $e.data.validateRequestData(requestData, true);
3496 - var endpoint = requestData.endpoint;
3497 - var response = {};
3498 - Object.entries(this.storage.getAll()).forEach(function(_ref) {
3499 - var _ref2 = _slicedToArray(_ref, 2);
3500 - var endpointKey = _ref2[0];
3501 - var endpointValue = _ref2[1];
3502 - if (endpointValue && endpoint.includes(endpointKey)) {
3503 - var oldData = endpointValue;
3504 - var pureEndpointParts = requestData.endpoint.replace(requestData.component.getNamespace() + "/", "").split("/");
3505 - if (1 === pureEndpointParts.length && endpointKey === requestData.endpoint && endpointKey === requestData.component.getNamespace()) response = jQuery.extend(true, oldData, requestData.args.data);
3506 - else {
3507 - var oldSpecificData = pureEndpointParts.reduce(function(accumulator, pureEndpointPart) {
3508 - return accumulator[pureEndpointPart];
3509 - }, oldData);
3510 - response = jQuery.extend(true, oldSpecificData, requestData.args.data);
3511 - }
3512 - }
3513 - });
3514 - if (0 === Object.values(response).length) return false;
3515 - this.set(requestData, response);
3516 - return true;
3517 - }
3518 - },
3519 - {
3520 - key: "delete",
3521 - value: function _delete(requestData) {
3522 - $e.data.validateRequestData(requestData);
3523 - var result = false;
3524 - var componentName = requestData.component.getNamespace();
3525 - if (componentName !== requestData.endpoint) {
3526 - var oldData = this.storage.getItem(componentName);
3527 - var newData = {};
3528 - if (null === oldData) return false;
3529 - var pureEndpointParts = requestData.endpoint.replace(componentName + "/", "").split("/");
3530 - var lastEndpointPart = pureEndpointParts[pureEndpointParts.length - 1];
3531 - pureEndpointParts.reduce(function(accumulator, pureEndpointPart) {
3532 - if (pureEndpointPart === lastEndpointPart) accumulator[pureEndpointPart] = null;
3533 - else accumulator[pureEndpointPart] = {};
3534 - return accumulator[pureEndpointPart];
3535 - }, newData);
3536 - if (Object.keys(oldData).length) {
3537 - var _deleteKeys = function deleteKeys(target, nullsObject) {
3538 - if (nullsObject) Object.keys(nullsObject).forEach(function(key) {
3539 - if (nullsObject[key] && "object" === _typeof(nullsObject[key])) _deleteKeys(target[key], nullsObject[key]);
3540 - else if (null === nullsObject[key]) {
3541 - delete target[key];
3542 - result = true;
3543 - }
3544 - });
3545 - else Object.keys(target).forEach(function(key) {
3546 - return delete target[key];
3547 - });
3548 - return target;
3549 - };
3550 - this.storage.setItem(componentName, _deleteKeys(oldData, newData));
3551 - }
3552 - } else for (var key in this.storage.getAll()) if (key === requestData.endpoint) {
3553 - this.storage.removeItem(requestData.endpoint);
3554 - result = true;
3555 - break;
3556 - }
3557 - return result;
3558 - }
3559 - }
3560 - ]);
3561 - }();
1553 +// TODO: Return it from the server. Original at WP_REST_Server.
1554 +var READABLE = exports.READABLE = ['GET'],
1555 + CREATABLE = exports.CREATABLE = ['POST'],
1556 + EDITABLE = exports.EDITABLE = ['POST', 'PUT', 'PATCH'],
1557 + DELETABLE = exports.DELETABLE = ['DELETE'],
1558 + ALLMETHODS = exports.ALLMETHODS = ['GET', 'POST', 'PUT', 'PATCH', 'DELETE'];
1559 +var Data = exports["default"] = /*#__PURE__*/function (_Commands) {
1560 + function Data() {
1561 + var _this;
1562 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1563 + (0, _classCallCheck2.default)(this, Data);
1564 + _this = _callSuper(this, Data, [args]);
1565 + _this.args = Object.assign(args, {
1566 + namespace: 'elementor',
1567 + version: '1',
1568 + baseEndpointURL: elementorWebCliConfig.urls.rest
1569 + });
1570 + _this.cache = new _cache.default(_this);
1571 + _this.validatedRequests = {};
1572 + _this.commandFormats = {};
1573 + return _this;
1574 + }
3562 1575
3563 -//#endregion
3564 -//#region modules/web-cli/assets/js/core/data.js
3565 - function _callSuper$13(t, o, e) {
3566 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$13() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
3567 - }
3568 - __name(_callSuper$13, "_callSuper");
3569 - function _isNativeReflectConstruct$13() {
3570 - try {
3571 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
3572 - } catch (t) {}
3573 - return (_isNativeReflectConstruct$13 = function _isNativeReflectConstruct() {
3574 - return !!t;
3575 - })();
3576 - }
3577 - __name(_isNativeReflectConstruct$13, "_isNativeReflectConstruct");
3578 - function _superPropGet$2(t, o, e, r) {
3579 - var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e);
3580 - return 2 & r && "function" == typeof p ? function(t) {
3581 - return p.apply(e, t);
3582 - } : p;
3583 - }
3584 - __name(_superPropGet$2, "_superPropGet");
3585 - /**
3586 - * @typedef {('create'|'delete'|'get'|'update'|'options')} DataTypes
3587 - */
3588 - /**
3589 - * @typedef {import('../modules/component-base')} ComponentBase
3590 - */
3591 - /**
3592 - * @typedef {{}} RequestInfo
3593 - */
3594 - /**
3595 - * @typedef {{}} RequestData
3596 - * @property {ComponentBase} component component
3597 - * @property {string} command command
3598 - * @property {{}} args arguments
3599 - * @property {DataTypes} type type
3600 - * @property {number} timestamp timestamp
3601 - * @property {string} endpoint endpoint
3602 - *
3603 - * @property {string} [baseEndpointURL] baseEndpointURL
3604 - * @property {string} [namespace] namespace
3605 - * @property {string} [version] version
3606 - * @property {('hit'|'miss')} [cache] cache
3607 - */
3608 - /**
3609 - * @typedef {Object} ExtractedCommand
3610 - * @property {string} command command
3611 - * @property {Object} args arguments
3612 - */
3613 - var READABLE = ["GET"];
3614 - var CREATABLE = ["POST"];
3615 - var EDITABLE = [
3616 - "POST",
3617 - "PUT",
3618 - "PATCH"
3619 - ];
3620 - var DELETABLE = ["DELETE"];
3621 - var Data$1 = /*#__PURE__*/ function(_Commands) {
3622 - function Data() {
3623 - var _this;
3624 - var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
3625 - _classCallCheck(this, Data);
3626 - _this = _callSuper$13(this, Data, [args]);
3627 - _this.args = Object.assign(args, {
3628 - namespace: "elementor",
3629 - version: "1",
3630 - baseEndpointURL: elementorWebCliConfig.urls.rest
3631 - });
3632 - _this.cache = new Cache(_this);
3633 - _this.validatedRequests = {};
3634 - _this.commandFormats = {};
3635 - return _this;
3636 - }
3637 - /**
3638 - * Function getHTTPMethod().
3639 - *
3640 - * Returns HTTP Method by type.
3641 - *
3642 - * @param {DataTypes} type
3643 - *
3644 - * @return {string|boolean} HTTP Method
3645 - */
3646 - _inherits(Data, _Commands);
3647 - return _createClass(Data, [
3648 - {
3649 - key: "getHTTPMethod",
3650 - value: function getHTTPMethod(type) {
3651 - switch (type) {
3652 - case "create": return "POST";
3653 - case "delete": return "DELETE";
3654 - case "get": return "GET";
3655 - case "update": return "PUT";
3656 - case "options": return "OPTIONS";
3657 - }
3658 - return false;
3659 - }
3660 - },
3661 - {
3662 - key: "getAllowedMethods",
3663 - value: function getAllowedMethods(type) {
3664 - switch (type) {
3665 - case "create": return CREATABLE;
3666 - case "delete": return DELETABLE;
3667 - case "get": return READABLE;
3668 - case "update": return EDITABLE;
3669 - case "options": return ["OPTIONS"];
3670 - }
3671 - return false;
3672 - }
3673 - },
3674 - {
3675 - key: "getEndpointURL",
3676 - value: function getEndpointURL(requestData) {
3677 - var endpoint = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : requestData.endpoint;
3678 - var _requestData$baseEndp = requestData.baseEndpointURL;
3679 - var baseEndpointURL = _requestData$baseEndp === void 0 ? this.args.baseEndpointURL : _requestData$baseEndp;
3680 - var _requestData$namespac = requestData.namespace;
3681 - var namespace = _requestData$namespac === void 0 ? this.args.namespace : _requestData$namespac;
3682 - var _requestData$version = requestData.version;
3683 - var version = _requestData$version === void 0 ? this.args.version : _requestData$version;
3684 - return "".concat(baseEndpointURL).concat(namespace, "/v").concat(version, "/") + endpoint;
3685 - }
3686 - },
3687 - {
3688 - key: "commandToEndpoint",
3689 - value: function commandToEndpoint(command, args) {
3690 - var format = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null;
3691 - var endpoint = command;
3692 - if ((args !== null && args !== void 0 && args.query ? Object.values(args.query).length : 0) && format && format.includes("/{")) format.split("/").filter(function(str) {
3693 - return "{" === str.charAt(0);
3694 - }).forEach(function(param) {
3695 - param = param.replace("{", "");
3696 - param = param.replace("}", "");
3697 - var formatted = Object.entries(args.query).find(function(_ref) {
3698 - return _slicedToArray(_ref, 1)[0] === param;
3699 - });
3700 - if (!formatted) return;
3701 - var key = formatted[0];
3702 - var value = formatted[1].toString();
3703 - format = format.replace(new RegExp("{" + param + "}", "g"), value);
3704 - delete args.query[key];
3705 - });
3706 - if (format) endpoint = format;
3707 - if (format && endpoint.includes("/{")) endpoint = endpoint.substring(0, endpoint.indexOf("/{"));
3708 - if (args.query && Object.values(args.query).length) {
3709 - var queryEntries = Object.entries(args.query).sort(function(_ref3, _ref4) {
3710 - return _slicedToArray(_ref3, 1)[0] - _slicedToArray(_ref4, 1)[0];
3711 - });
3712 - if (queryEntries.length) {
3713 - endpoint += "?";
3714 - queryEntries.forEach(function(_ref7) {
3715 - var _ref8 = _slicedToArray(_ref7, 2);
3716 - var name = _ref8[0];
3717 - var value = _ref8[1];
3718 - value = "".concat(value).replace(/\//g, "%2F");
3719 - endpoint += name + "=" + value + "&";
3720 - });
3721 - }
3722 - endpoint = endpoint.replace(/&$/, "");
3723 - }
3724 - return endpoint;
3725 - }
3726 - },
3727 - {
3728 - key: "commandExtractArgs",
3729 - value: function commandExtractArgs(command) {
3730 - var _command;
3731 - var args = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
3732 - if ((_command = command) !== null && _command !== void 0 && _command.includes("?")) {
3733 - if (!args.query) args.query = {};
3734 - var commandParts = command.split("?");
3735 - var pureCommand = commandParts[0];
3736 - var queryString = commandParts[1];
3737 - var query = new URLSearchParams(queryString);
3738 - Object.assign(args.query, Object.fromEntries(query));
3739 - command = pureCommand;
3740 - }
3741 - return {
3742 - command,
3743 - args
3744 - };
3745 - }
3746 - },
3747 - {
3748 - key: "validateRequestData",
3749 - value: function validateRequestData(requestData) {
3750 - var requireArgsData = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
3751 - if (requestData.timestamp && this.validatedRequests[requestData.timestamp]) return;
3752 - var argsObject = new ArgsObject(requestData);
3753 - argsObject.requireArgument("component");
3754 - argsObject.requireArgumentType("command", "string");
3755 - argsObject.requireArgumentType("endpoint", "string");
3756 - if (requireArgsData) argsObject.requireArgumentType("data", "object", requestData.args);
3757 - if (!requestData.timestamp) requestData.timestamp = (/* @__PURE__ */ new Date()).getTime();
3758 - this.validatedRequests[requestData.timestamp] = true;
3759 - }
3760 - },
3761 - {
3762 - key: "prepareHeaders",
3763 - value: function prepareHeaders(requestData) {
3764 - var _requestData$args;
3765 - var type = requestData.type;
3766 - var nonce = elementorWebCliConfig.nonce;
3767 - var params = {
3768 - signal: (_requestData$args = requestData.args) === null || _requestData$args === void 0 || (_requestData$args = _requestData$args.options) === null || _requestData$args === void 0 ? void 0 : _requestData$args.signal,
3769 - credentials: "include"
3770 - };
3771 - var headers = { "X-WP-Nonce": nonce };
3772 - /**
3773 - * Translate:
3774 - * 'create, delete, get, update' to HTTP Methods:
3775 - * 'GET, POST, PUT, PATCH, DELETE'
3776 - */
3777 - var allowedMethods = this.getAllowedMethods(type);
3778 - var method = this.getHTTPMethod(type);
3779 - if ("GET" === method) Object.assign(params, { headers });
3780 - else if (allowedMethods) {
3781 - var _requestData$args2;
3782 - var _requestData$args3;
3783 - if (["POST", "PUT"].includes(method) && !((_requestData$args2 = requestData.args) !== null && _requestData$args2 !== void 0 && _requestData$args2.data)) throw Error("Invalid requestData.args.data");
3784 - Object.assign(headers, { "Content-Type": "application/json" });
3785 - if ((_requestData$args3 = requestData.args) !== null && _requestData$args3 !== void 0 && _requestData$args3.headers) Object.assign(headers, requestData.args.headers);
3786 - Object.assign(params, {
3787 - method,
3788 - headers,
3789 - body: "application/json" === headers["Content-Type"] ? JSON.stringify(requestData.args.data) : requestData.args.data
3790 - });
3791 - } else throw Error("Invalid type: '".concat(type, "'"));
3792 - return params;
3793 - }
3794 - },
3795 - {
3796 - key: "prepareEndpoint",
3797 - value: function prepareEndpoint(requestData) {
3798 - var splitEndpoint = requestData.endpoint.split("?");
3799 - var endpoint = splitEndpoint.shift();
3800 - var endpointAddress = this.getEndpointURL(requestData, endpoint);
3801 - if (splitEndpoint.length) {
3802 - var separator = endpointAddress.includes("?") ? "&" : "?";
3803 - endpointAddress += separator + splitEndpoint.pop();
3804 - }
3805 - return endpointAddress;
3806 - }
3807 - },
3808 - {
3809 - key: "fetch",
3810 - value: function fetch(requestData) {
3811 - var _requestData$args$opt;
3812 - var _this2 = this;
3813 - var fetchAPI = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : window.fetch;
3814 - requestData.cache = "miss";
3815 - var refresh = (_requestData$args$opt = requestData.args.options) === null || _requestData$args$opt === void 0 ? void 0 : _requestData$args$opt.refresh;
3816 - var getCache = "get" === requestData.type && !refresh;
3817 - var saveCache = ["create", "get"].includes(requestData.type) && !refresh;
3818 - if (getCache) {
3819 - var cachePromise = this.cache.getAsync(requestData);
3820 - if (cachePromise) return cachePromise;
3821 - }
3822 - var params = this.prepareHeaders(requestData);
3823 - return new Promise(/*#__PURE__*/ function() {
3824 - var _ref9 = _asyncToGenerator(/*#__PURE__*/ import_regenerator.default.mark(function _callee2(resolve, reject) {
3825 - var endpoint;
3826 - var request;
3827 - var response;
3828 - var _t;
3829 - return import_regenerator.default.wrap(function(_context2) {
3830 - while (1) switch (_context2.prev = _context2.next) {
3831 - case 0:
3832 - _context2.prev = 0;
3833 - endpoint = _this2.prepareEndpoint(requestData);
3834 - request = fetchAPI(endpoint, params);
3835 - _context2.next = 1;
3836 - return request.then(/*#__PURE__*/ function() {
3837 - var _ref0 = _asyncToGenerator(/*#__PURE__*/ import_regenerator.default.mark(function _callee(_response) {
3838 - return import_regenerator.default.wrap(function(_context) {
3839 - while (1) switch (_context.prev = _context.next) {
3840 - case 0:
3841 - if (_response.ok) {
3842 - _context.next = 3;
3843 - break;
3844 - }
3845 - if (!_response.headers.get("content-type").includes("application/json")) {
3846 - _context.next = 2;
3847 - break;
3848 - }
3849 - _context.next = 1;
3850 - return _response.json();
3851 - case 1: _response = _context.sent;
3852 - case 2: throw _response;
3853 - case 3: return _context.abrupt("return", _response.json());
3854 - case 4:
3855 - case "end": return _context.stop();
3856 - }
3857 - }, _callee);
3858 - }));
3859 - return function(_x3) {
3860 - return _ref0.apply(this, arguments);
3861 - };
3862 - }());
3863 - case 1:
3864 - response = _context2.sent;
3865 - if (saveCache) _this2.cache.set(requestData, response);
3866 - resolve(response);
3867 - _context2.next = 3;
3868 - break;
3869 - case 2:
3870 - _context2.prev = 2;
3871 - _t = _context2["catch"](0);
3872 - reject(_t);
3873 - case 3:
3874 - case "end": return _context2.stop();
3875 - }
3876 - }, _callee2, null, [[0, 2]]);
3877 - }));
3878 - return function(_x, _x2) {
3879 - return _ref9.apply(this, arguments);
3880 - };
3881 - }());
3882 - }
3883 - },
3884 - {
3885 - key: "getCache",
3886 - value: function getCache(component, command) {
3887 - var args = { query: arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {} };
3888 - return this.cache.get({
3889 - endpoint: this.commandToEndpoint(command, args, this.commandFormats[command]),
3890 - component,
3891 - command,
3892 - args
3893 - });
3894 - }
3895 - },
3896 - {
3897 - key: "setCache",
3898 - value: function setCache(component, command, query, data) {
3899 - var args = { query };
3900 - this.cache.set({
3901 - endpoint: this.commandToEndpoint(command, args, this.commandFormats[command]),
3902 - component,
3903 - command,
3904 - args
3905 - }, data);
3906 - }
3907 - },
3908 - {
3909 - key: "updateCache",
3910 - value: function updateCache(component, command, query, data) {
3911 - var args = {
3912 - query,
3913 - data
3914 - };
3915 - this.cache.update({
3916 - endpoint: this.commandToEndpoint(command, args, this.commandFormats[command]),
3917 - component,
3918 - command,
3919 - args
3920 - });
3921 - }
3922 - },
3923 - {
3924 - key: "deleteCache",
3925 - value: function deleteCache(component, command) {
3926 - var args = { query: arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {} };
3927 - this.cache.delete({
3928 - endpoint: this.commandToEndpoint(command, args, this.commandFormats[command]),
3929 - component,
3930 - command,
3931 - args
3932 - });
3933 - }
3934 - },
3935 - {
3936 - key: "registerFormat",
3937 - value: function registerFormat(command, format) {
3938 - this.commandFormats[command] = format;
3939 - }
3940 - },
3941 - {
3942 - key: "create",
3943 - value: function create(command, data) {
3944 - var query = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
3945 - var options = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
3946 - return this.run("create", command, {
3947 - query,
3948 - options,
3949 - data
3950 - });
3951 - }
3952 - },
3953 - {
3954 - key: "delete",
3955 - value: function _delete(command) {
3956 - var query = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
3957 - var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
3958 - return this.run("delete", command, {
3959 - query,
3960 - options
3961 - });
3962 - }
3963 - },
3964 - {
3965 - key: "get",
3966 - value: function get(command) {
3967 - var query = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
3968 - var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
3969 - return this.run("get", command, {
3970 - query,
3971 - options
3972 - });
3973 - }
3974 - },
3975 - {
3976 - key: "update",
3977 - value: function update(command, data) {
3978 - var query = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
3979 - var options = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
3980 - return this.run("update", command, {
3981 - query,
3982 - options,
3983 - data
3984 - });
3985 - }
3986 - },
3987 - {
3988 - key: "options",
3989 - value: function options(command, query) {
3990 - var _options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
3991 - return this.run("options", command, {
3992 - query,
3993 - options: _options
3994 - });
3995 - }
3996 - },
3997 - {
3998 - key: "register",
3999 - value: function register(component, command, callback) {
4000 - _superPropGet$2(Data, "register", this, 3)([
4001 - component,
4002 - command,
4003 - callback
4004 - ]);
4005 - var fullCommandName = component.getNamespace() + "/" + command;
4006 - var commandInstance = $e.data.getCommandClass(fullCommandName);
4007 - var format = commandInstance !== null && commandInstance !== void 0 && commandInstance.getEndpointFormat ? commandInstance.getEndpointFormat() : false;
4008 - if (format) $e.data.registerFormat(fullCommandName, format);
4009 - return this;
4010 - }
4011 - },
4012 - {
4013 - key: "run",
4014 - value: function run(type, command, args) {
4015 - args.options.type = type;
4016 - var _this$commandExtractA = this.commandExtractArgs(command, args);
4017 - command = _this$commandExtractA.command;
4018 - args = _this$commandExtractA.args;
4019 - return _superPropGet$2(Data, "run", this, 3)([command, args]);
4020 - }
4021 - },
4022 - {
4023 - key: "error",
4024 - value: function error(message) {
4025 - throw Error("Data commands: " + message);
4026 - }
4027 - }
4028 - ]);
4029 - }(Commands);
1576 + /**
1577 + * Function getHTTPMethod().
1578 + *
1579 + * Returns HTTP Method by type.
1580 + *
1581 + * @param {DataTypes} type
1582 + *
1583 + * @return {string|boolean} HTTP Method
1584 + */
1585 + (0, _inherits2.default)(Data, _Commands);
1586 + return (0, _createClass2.default)(Data, [{
1587 + key: "getHTTPMethod",
1588 + value: function getHTTPMethod(type) {
1589 + switch (type) {
1590 + case 'create':
1591 + return 'POST';
1592 + case 'delete':
1593 + return 'DELETE';
1594 + case 'get':
1595 + return 'GET';
1596 + case 'update':
1597 + return 'PUT';
1598 + case 'options':
1599 + return 'OPTIONS';
1600 + }
1601 + return false;
1602 + }
4030 1603
4031 -//#endregion
4032 -//#region modules/web-cli/assets/js/extras/hash-commands.js
4033 - function _createForOfIteratorHelper(r, e) {
4034 - var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
4035 - if (!t) {
4036 - if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
4037 - t && (r = t);
4038 - var _n = 0;
4039 - var F = function F() {};
4040 - return {
4041 - s: F,
4042 - n: function n() {
4043 - return _n >= r.length ? { done: !0 } : {
4044 - done: !1,
4045 - value: r[_n++]
4046 - };
4047 - },
4048 - e: function e(r) {
4049 - throw r;
4050 - },
4051 - f: F
4052 - };
4053 - }
4054 - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
4055 - }
4056 - var o;
4057 - var a = !0;
4058 - var u = !1;
4059 - return {
4060 - s: function s() {
4061 - t = t.call(r);
4062 - },
4063 - n: function n() {
4064 - var r = t.next();
4065 - return a = r.done, r;
4066 - },
4067 - e: function e(r) {
4068 - u = !0, o = r;
4069 - },
4070 - f: function f() {
4071 - try {
4072 - a || null == t.return || t.return();
4073 - } finally {
4074 - if (u) throw o;
4075 - }
4076 - }
4077 - };
4078 - }
4079 - function _unsupportedIterableToArray(r, a) {
4080 - if (r) {
4081 - if ("string" == typeof r) return _arrayLikeToArray(r, a);
4082 - var t = {}.toString.call(r).slice(8, -1);
4083 - 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;
4084 - }
4085 - }
4086 - function _arrayLikeToArray(r, a) {
4087 - (null == a || a > r.length) && (a = r.length);
4088 - for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
4089 - return n;
4090 - }
4091 - var HashCommands = /*#__PURE__*/ function() {
4092 - function HashCommands() {
4093 - _classCallCheck(this, HashCommands);
4094 - /**
4095 - * Cannot be static since it uses callback(s) that are available only after '$e' is initialized.
4096 - */
4097 - _defineProperty(this, "dispatchersList", {
4098 - "e:run": {
4099 - runner: function runner() {
4100 - return $e.run;
4101 - },
4102 - isSafe: function isSafe(command) {
4103 - var _$e$commands$getComma;
4104 - return (_$e$commands$getComma = $e.commands.getCommandClass(command)) === null || _$e$commands$getComma === void 0 ? void 0 : _$e$commands$getComma.getInfo().isSafe;
4105 - },
4106 - isSafeWithArgs: function isSafeWithArgs(command) {
4107 - var _$e$commands$getComma2;
4108 - return (_$e$commands$getComma2 = $e.commands.getCommandClass(command)) === null || _$e$commands$getComma2 === void 0 ? void 0 : _$e$commands$getComma2.getInfo().isSafeWithArgs;
4109 - }
4110 - },
4111 - "e:route": {
4112 - runner: function runner() {
4113 - return $e.route;
4114 - },
4115 - isSafe: function isSafe() {
4116 - return true;
4117 - },
4118 - isSafeWithArgs: function isSafeWithArgs() {
4119 - return false;
4120 - }
4121 - }
4122 - });
4123 - /**
4124 - * @typedef HashCommand
4125 - * @property {string} method method
4126 - * @property {string} command command
4127 - * @property {Object} args arguments
4128 - */
4129 - /**
4130 - * List of current loaded hash commands.
4131 - *
4132 - * @type {Array.<HashCommand>}
4133 - */
4134 - _defineProperty(this, "commands", []);
4135 - this.commands = this.get();
4136 - }
4137 - /**
4138 - * Function get().
4139 - *
4140 - * Get API requests that comes from hash ( eg #e:run ).
4141 - *
4142 - * @param {string} hash
4143 - *
4144 - * @return {Array.<HashCommand>} API requests
4145 - */
4146 - return _createClass(HashCommands, [
4147 - {
4148 - key: "get",
4149 - value: function get() {
4150 - var _this = this;
4151 - var hash = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : location.hash;
4152 - var result = [];
4153 - if (hash) hash.substr(1).split("&").forEach(function(hashItem) {
4154 - var _hashItem$split2 = _slicedToArray(hashItem.split("?"), 2);
4155 - var rawCommand = _hashItem$split2[0];
4156 - var rawArgs = _hashItem$split2[1];
4157 - var hashParts = rawCommand.split(":");
4158 - if (3 !== hashParts.length) return;
4159 - var method = hashParts[0] + ":" + hashParts[1];
4160 - if (_this.dispatchersList[method]) {
4161 - var command = hashParts[2];
4162 - var args = _this.parseCommandArgs(rawArgs);
4163 - result.push({
4164 - method,
4165 - command,
4166 - args
4167 - });
4168 - }
4169 - });
4170 - return result;
4171 - }
4172 - },
4173 - {
4174 - key: "run",
4175 - value: function() {
4176 - var _run = _asyncToGenerator(/*#__PURE__*/ import_regenerator.default.mark(function _callee() {
4177 - var commands;
4178 - var _iterator;
4179 - var _step;
4180 - var hashCommand;
4181 - var dispatcher;
4182 - var _iterator2;
4183 - var _step2;
4184 - var _hashCommand;
4185 - var _dispatcher;
4186 - var _args = arguments;
4187 - var _t;
4188 - var _t2;
4189 - return import_regenerator.default.wrap(function(_context) {
4190 - while (1) switch (_context.prev = _context.next) {
4191 - case 0:
4192 - commands = _args.length > 0 && _args[0] !== void 0 ? _args[0] : this.commands;
4193 - _iterator = _createForOfIteratorHelper(commands);
4194 - _context.prev = 1;
4195 - _iterator.s();
4196 - case 2:
4197 - if ((_step = _iterator.n()).done) {
4198 - _context.next = 5;
4199 - break;
4200 - }
4201 - hashCommand = _step.value;
4202 - dispatcher = this.dispatchersList[hashCommand.method];
4203 - if (dispatcher) {
4204 - _context.next = 3;
4205 - break;
4206 - }
4207 - return _context.abrupt("return", Promise.reject(new Error("No dispatcher found for the command: `".concat(hashCommand.command, "`."))));
4208 - case 3:
4209 - if (dispatcher.isSafe(hashCommand.command)) {
4210 - _context.next = 4;
4211 - break;
4212 - }
4213 - return _context.abrupt("return", Promise.reject(new Error("Attempting to run unsafe or non exist command: `".concat(hashCommand.command, "`."))));
4214 - case 4:
4215 - _context.next = 2;
4216 - break;
4217 - case 5:
4218 - _context.next = 7;
4219 - break;
4220 - case 6:
4221 - _context.prev = 6;
4222 - _t = _context["catch"](1);
4223 - _iterator.e(_t);
4224 - case 7:
4225 - _context.prev = 7;
4226 - _iterator.f();
4227 - return _context.finish(7);
4228 - case 8:
4229 - _iterator2 = _createForOfIteratorHelper(commands);
4230 - _context.prev = 9;
4231 - _iterator2.s();
4232 - case 10:
4233 - if ((_step2 = _iterator2.n()).done) {
4234 - _context.next = 12;
4235 - break;
4236 - }
4237 - _hashCommand = _step2.value;
4238 - _dispatcher = this.dispatchersList[_hashCommand.method];
4239 - _context.next = 11;
4240 - return _dispatcher.runner()(_hashCommand.command, _dispatcher.isSafeWithArgs(_hashCommand.command) ? _hashCommand.args : void 0);
4241 - case 11:
4242 - _context.next = 10;
4243 - break;
4244 - case 12:
4245 - _context.next = 14;
4246 - break;
4247 - case 13:
4248 - _context.prev = 13;
4249 - _t2 = _context["catch"](9);
4250 - _iterator2.e(_t2);
4251 - case 14:
4252 - _context.prev = 14;
4253 - _iterator2.f();
4254 - return _context.finish(14);
4255 - case 15:
4256 - case "end": return _context.stop();
4257 - }
4258 - }, _callee, this, [[
4259 - 1,
4260 - 6,
4261 - 7,
4262 - 8
4263 - ], [
4264 - 9,
4265 - 13,
4266 - 14,
4267 - 15
4268 - ]]);
4269 - }));
4270 - function run() {
4271 - return _run.apply(this, arguments);
4272 - }
4273 - return run;
4274 - }()
4275 - },
4276 - {
4277 - key: "runOnce",
4278 - value: function runOnce() {
4279 - var _this2 = this;
4280 - this.run(this.commands).then(function() {
4281 - _this2.commands = [];
4282 - });
4283 - }
4284 - },
4285 - {
4286 - key: "parseCommandArgs",
4287 - value: function parseCommandArgs(rawArgs) {
4288 - try {
4289 - return JSON.parse(decodeURI(rawArgs || "{}"));
4290 - } catch (e) {
4291 - Console.warn("Hash commands JSON args cannot be parsed. \n\n", e);
4292 - return {};
4293 - }
4294 - }
4295 - }
4296 - ]);
4297 - }();
1604 + /**
1605 + * Function getAllowedMethods().
1606 + *
1607 + * Returns allowed HTTP methods by type.
1608 + *
1609 + * @param {DataTypes} type
1610 + *
1611 + * @return {[string]|boolean} allowed HTTP methods
1612 + */
1613 + }, {
1614 + key: "getAllowedMethods",
1615 + value: function getAllowedMethods(type) {
1616 + switch (type) {
1617 + case 'create':
1618 + return CREATABLE;
1619 + case 'delete':
1620 + return DELETABLE;
1621 + case 'get':
1622 + return READABLE;
1623 + case 'update':
1624 + return EDITABLE;
1625 + case 'options':
1626 + return ['OPTIONS'];
1627 + }
1628 + return false;
1629 + }
4298 1630
4299 -//#endregion
4300 -//#region modules/web-cli/assets/js/modules/hook-break.js
4301 - function _callSuper$12(t, o, e) {
4302 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$12() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
4303 - }
4304 - __name(_callSuper$12, "_callSuper");
4305 - function _isNativeReflectConstruct$12() {
4306 - try {
4307 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
4308 - } catch (t) {}
4309 - return (_isNativeReflectConstruct$12 = function _isNativeReflectConstruct() {
4310 - return !!t;
4311 - })();
4312 - }
4313 - __name(_isNativeReflectConstruct$12, "_isNativeReflectConstruct");
4314 - var HookBreak = /*#__PURE__*/ function(_Error) {
4315 - function HookBreak() {
4316 - _classCallCheck(this, HookBreak);
4317 - return _callSuper$12(this, HookBreak, ["HookBreak"]);
4318 - }
4319 - _inherits(HookBreak, _Error);
4320 - return _createClass(HookBreak);
4321 - }(/*#__PURE__*/ _wrapNativeSuper(Error));
1631 + /**
1632 + * Function getEndpointURL().
1633 + *
1634 + * Get remote endpoint address.
1635 + *
1636 + * @param {RequestData} requestData
1637 + * @param {string} [endpoint=requestData.endpoint]
1638 + *
1639 + * @return {string} endpoint address
1640 + */
1641 + }, {
1642 + key: "getEndpointURL",
1643 + value: function getEndpointURL(requestData) {
1644 + var endpoint = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : requestData.endpoint;
1645 + // Allow to request data override default namespace and args.
1646 + var _requestData$baseEndp = requestData.baseEndpointURL,
1647 + baseEndpointURL = _requestData$baseEndp === void 0 ? this.args.baseEndpointURL : _requestData$baseEndp,
1648 + _requestData$namespac = requestData.namespace,
1649 + namespace = _requestData$namespac === void 0 ? this.args.namespace : _requestData$namespac,
1650 + _requestData$version = requestData.version,
1651 + version = _requestData$version === void 0 ? this.args.version : _requestData$version;
1652 + return "".concat(baseEndpointURL).concat(namespace, "/v").concat(version, "/") + endpoint;
1653 + }
4322 1654
4323 -//#endregion
4324 -//#region modules/web-cli/assets/js/core/hooks/base.js
4325 - function _callSuper$11(t, o, e) {
4326 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$11() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
4327 - }
4328 - __name(_callSuper$11, "_callSuper");
4329 - function _isNativeReflectConstruct$11() {
4330 - try {
4331 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
4332 - } catch (t) {}
4333 - return (_isNativeReflectConstruct$11 = function _isNativeReflectConstruct() {
4334 - return !!t;
4335 - })();
4336 - }
4337 - __name(_isNativeReflectConstruct$11, "_isNativeReflectConstruct");
4338 - /**
4339 - * @typedef {import('../../modules/hook-base')} HookBase
4340 - */
4341 - var HooksBase = /*#__PURE__*/ function(_Module) {
4342 - /**
4343 - * Function constructor().
4344 - *
4345 - * Create hooks base.
4346 - *
4347 - * @param {{}} args
4348 - */
4349 - function HooksBase() {
4350 - var _this;
4351 - _classCallCheck(this, HooksBase);
4352 - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
4353 - _this = _callSuper$11(this, HooksBase, [].concat(args));
4354 - /**
4355 - * Current command.
4356 - *
4357 - * @type {string}
4358 - */
4359 - _this.current = "";
4360 - /**
4361 - * Array of ids which in use.
4362 - *
4363 - * @type {Array}
4364 - */
4365 - _this.usedIds = [];
4366 - /**
4367 - * Object of callbacks that was bound by container type.
4368 - *
4369 - * @type {{}}
4370 - */
4371 - _this.callbacks = {
4372 - after: {},
4373 - catch: {}
4374 - };
4375 - /**
4376 - * Object of depth.
4377 - *
4378 - * @type {{}}
4379 - */
4380 - _this.depth = {
4381 - after: {},
4382 - catch: {}
4383 - };
4384 - _this.callbacksFlatList = {};
4385 - return _this;
4386 - }
4387 - _inherits(HooksBase, _Module);
4388 - return _createClass(HooksBase, [
4389 - {
4390 - key: "activate",
4391 - value: function activate() {
4392 - Object.values(this.getAll(true)).forEach(function(callback) {
4393 - callback.activate();
4394 - });
4395 - }
4396 - },
4397 - {
4398 - key: "deactivate",
4399 - value: function deactivate() {
4400 - Object.values(this.getAll(true)).forEach(function(callback) {
4401 - callback.deactivate();
4402 - });
4403 - }
4404 - },
4405 - {
4406 - key: "getType",
4407 - value: function getType() {
4408 - force_method_implementation_default();
4409 - }
4410 - },
4411 - {
4412 - key: "get",
4413 - value: function get(id) {
4414 - return this.callbacksFlatList[id];
4415 - }
4416 - },
4417 - {
4418 - key: "getAll",
4419 - value: function getAll() {
4420 - var _this2 = this;
4421 - if (arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false) return this.callbacksFlatList;
4422 - var result = {};
4423 - Object.keys(this.callbacks).forEach(function(event) {
4424 - if (!result[event]) result[event] = [];
4425 - Object.keys(_this2.callbacks[event]).forEach(function(command) {
4426 - result[event].push({
4427 - command,
4428 - callbacks: _this2.callbacks[event][command]
4429 - });
4430 - });
4431 - });
4432 - return result;
4433 - }
4434 - },
4435 - {
4436 - key: "getCurrent",
4437 - value: function getCurrent() {
4438 - return this.current;
4439 - }
4440 - },
4441 - {
4442 - key: "getUsedIds",
4443 - value: function getUsedIds() {
4444 - return this.usedIds;
4445 - }
4446 - },
4447 - {
4448 - key: "getCallbacks",
4449 - value: function getCallbacks(event, command, args) {
4450 - var _args$containers = args.containers;
4451 - var containers = _args$containers === void 0 ? [args.container] : _args$containers;
4452 - var containerType = containers[0] ? containers[0].type : false;
4453 - var callbacks = [];
4454 - if (this.callbacks[event] && this.callbacks[event][command]) {
4455 - if (containerType && this.callbacks[event][command][containerType]) callbacks = callbacks.concat(this.callbacks[event][command][containerType]);
4456 - if (this.callbacks[event][command].all) callbacks = callbacks.concat(this.callbacks[event][command].all);
4457 - }
4458 - if (callbacks.length) return callbacks;
4459 - return false;
4460 - }
4461 - },
4462 - {
4463 - key: "checkEvent",
4464 - value: function checkEvent(event) {
4465 - if (-1 === Object.keys(this.callbacks).indexOf(event)) throw Error("".concat(this.getType(), ": '").concat(event, "' is not available."));
4466 - }
4467 - },
4468 - {
4469 - key: "checkInstance",
4470 - value: function checkInstance(instance) {
4471 - if (instance.getType() !== this.getType()) throw new Error("invalid instance, please use: 'elementor-api/modules/hook-base.js'. ");
4472 - }
4473 - },
4474 - {
4475 - key: "checkId",
4476 - value: function checkId(id) {
4477 - if (-1 !== this.usedIds.indexOf(id)) throw Error("id: '".concat(id, "' is already in use."));
4478 - }
4479 - },
4480 - {
4481 - key: "shouldRun",
4482 - value: function shouldRun(callbacks) {
4483 - return !!callbacks && callbacks.length;
4484 - }
4485 - },
4486 - {
4487 - key: "register",
4488 - value: function register(event, instance) {
4489 - var command = instance.getCommand();
4490 - var id = instance.getId();
4491 - var containerType = instance.getContainerType();
4492 - this.checkEvent(event);
4493 - this.checkInstance(instance);
4494 - this.checkId(id);
4495 - return this.registerCallback(id, event, command, instance, containerType);
4496 - }
4497 - },
4498 - {
4499 - key: "registerCallback",
4500 - value: function registerCallback(id, event, command, instance, containerType) {
4501 - if (!this.callbacks[event][command]) this.callbacks[event][command] = [];
4502 - this.usedIds.push(id);
4503 - if (!this.callbacks[event][command]) this.callbacks[event][command] = {};
4504 - var callback = {
4505 - id,
4506 - callback: instance.run.bind(instance),
4507 - isActive: true,
4508 - activate: function activate() {
4509 - this.isActive = true;
4510 - },
4511 - deactivate: function deactivate() {
4512 - this.isActive = false;
4513 - }
4514 - };
4515 - if (containerType) {
4516 - if (!this.callbacks[event][command][containerType]) this.callbacks[event][command][containerType] = [];
4517 - this.callbacks[event][command][containerType].push(callback);
4518 - } else {
4519 - if (!this.callbacks[event][command].all) this.callbacks[event][command].all = [];
4520 - this.callbacks[event][command].all.push(callback);
4521 - }
4522 - this.callbacksFlatList[callback.id] = callback;
4523 - return callback;
4524 - }
4525 - },
4526 - {
4527 - key: "run",
4528 - value: function run(event, command, args) {
4529 - var result = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : void 0;
4530 - var callbacks = this.getCallbacks(event, command, args);
4531 - if (this.shouldRun(callbacks)) {
4532 - this.current = command;
4533 - this.onRun(command, args, event);
4534 - return this.runCallbacks(event, command, callbacks, args, result);
4535 - }
4536 - return false;
4537 - }
4538 - },
4539 - {
4540 - key: "runCallbacks",
4541 - value: function runCallbacks(event, command, callbacks, args, result) {
4542 - var callbacksResult = [];
4543 - for (var i in callbacks) {
4544 - var callback = callbacks[i];
4545 - if (!callback.isActive) continue;
4546 - if (void 0 === this.depth[event][callback.id]) this.depth[event][callback.id] = 0;
4547 - this.depth[event][callback.id]++;
4548 - if (1 === this.depth[event][callback.id]) {
4549 - this.onCallback(command, args, event, callback.id);
4550 - try {
4551 - var callbackResult = this.runCallback(event, callback, args, result);
4552 - if (!callbackResult) throw Error("Callback failed, event: '".concat(event, "'"));
4553 - callbacksResult.push(callbackResult);
4554 - } catch (e) {
4555 - if (e instanceof $e.modules.HookBreak) throw e;
4556 - Console.error(e);
4557 - }
4558 - }
4559 - this.depth[event][callback.id]--;
4560 - }
4561 - return callbacksResult;
4562 - }
4563 - },
4564 - {
4565 - key: "runCallback",
4566 - value: function runCallback(event, callback, args, result) {
4567 - force_method_implementation_default();
4568 - }
4569 - },
4570 - {
4571 - key: "onRun",
4572 - value: function onRun(command, args, event) {
4573 - force_method_implementation_default();
4574 - }
4575 - },
4576 - {
4577 - key: "onCallback",
4578 - value: function onCallback(command, args, event, id) {
4579 - force_method_implementation_default();
4580 - }
4581 - }
4582 - ]);
4583 - }(import_module.default);
1655 + /**
1656 + * Function commandToEndpoint().
1657 + *
1658 + * Convert command to endpoint.
1659 + *
1660 + * For example `component/command/{arg}` => `controller/endpoint/8`.
1661 + *
1662 + * TODO: Find a better solution.
1663 + *
1664 + * @param {string} command
1665 + * @param {{}} args
1666 + * @param {string|null} [format]
1667 + *
1668 + * @return {string} endpoint
1669 + */
1670 + }, {
1671 + key: "commandToEndpoint",
1672 + value: function commandToEndpoint(command, args) {
1673 + var format = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
1674 + var endpoint = command;
1675 + var argsQueryLength = args !== null && args !== void 0 && args.query ? Object.values(args.query).length : 0;
1676 + if (argsQueryLength && format && format.includes('/{')) {
1677 + // Means command includes magic query arguments ( controller/endpoint/{whatever} ).
1678 + var magicParams = format.split('/').filter(function (str) {
1679 + return '{' === str.charAt(0);
1680 + });
1681 + magicParams.forEach(function (param) {
1682 + // Remove the '{', '}'.
1683 + param = param.replace('{', '');
1684 + param = param.replace('}', '');
1685 + var formatted = Object.entries(args.query).find(function (_ref) {
1686 + var _ref2 = (0, _slicedToArray2.default)(_ref, 1),
1687 + key = _ref2[0];
1688 + return key === param;
1689 + });
1690 + if (!formatted) {
1691 + return;
1692 + }
1693 + var key = formatted[0],
1694 + value = formatted[1].toString();
4584 1695
4585 -//#endregion
4586 -//#region modules/web-cli/assets/js/core/hooks/data.js
4587 - function _callSuper$10(t, o, e) {
4588 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$10() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
4589 - }
4590 - __name(_callSuper$10, "_callSuper");
4591 - function _isNativeReflectConstruct$10() {
4592 - try {
4593 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
4594 - } catch (t) {}
4595 - return (_isNativeReflectConstruct$10 = function _isNativeReflectConstruct() {
4596 - return !!t;
4597 - })();
4598 - }
4599 - __name(_isNativeReflectConstruct$10, "_isNativeReflectConstruct");
4600 - function _superPropGet$1(t, o, e, r) {
4601 - var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e);
4602 - return 2 & r && "function" == typeof p ? function(t) {
4603 - return p.apply(e, t);
4604 - } : p;
4605 - }
4606 - __name(_superPropGet$1, "_superPropGet");
4607 - var Data = /*#__PURE__*/ function(_HooksBase) {
4608 - function Data() {
4609 - var _this;
4610 - _classCallCheck(this, Data);
4611 - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
4612 - _this = _callSuper$10(this, Data, [].concat(args));
4613 - _this.callbacks.dependency = {};
4614 - _this.depth.dependency = {};
4615 - return _this;
4616 - }
4617 - _inherits(Data, _HooksBase);
4618 - return _createClass(Data, [
4619 - {
4620 - key: "getType",
4621 - value: function getType() {
4622 - return "data";
4623 - }
4624 - },
4625 - {
4626 - key: "runCallback",
4627 - value: function runCallback(event, callback, args, result) {
4628 - switch (event) {
4629 - case "dependency":
4630 - if (!callback.callback(args)) {
4631 - this.depth[event][callback.id]--;
4632 - throw new $e.modules.HookBreak();
4633 - }
4634 - return true;
4635 - case "catch":
4636 - case "after":
4637 - /**
4638 - * When handling HOOK which is data after (not breakable),
4639 - * even the result of the callback is negative, it is required to return positive,
4640 - * since result of runCallback determine if the callback succeeded.
4641 - */
4642 - return callback.callback(args, result) || "after" === event;
4643 - }
4644 - return false;
4645 - }
4646 - },
4647 - {
4648 - key: "shouldRun",
4649 - value: function shouldRun(callbacks) {
4650 - return _superPropGet$1(Data, "shouldRun", this, 3)([callbacks]) && elementor.documents.getCurrent().history.getActive();
4651 - }
4652 - },
4653 - {
4654 - key: "onRun",
4655 - value: function onRun(command, args, event) {
4656 - if (!$e.devTools) return;
4657 - $e.devTools.log.callbacks().run(this.getType(), command, args, event);
4658 - }
4659 - },
4660 - {
4661 - key: "onCallback",
4662 - value: function onCallback(command, args, event, id) {
4663 - if (!$e.devTools) return;
4664 - $e.devTools.log.callbacks().callback(this.getType(), command, args, event, id);
4665 - }
4666 - }
4667 - ]);
4668 - }(HooksBase);
1696 + // Replace magic params with values.
1697 + format = format.replace(new RegExp('{' + param + '}', 'g'), value);
1698 + delete args.query[key];
1699 + });
1700 + }
1701 + if (format) {
1702 + endpoint = format;
1703 + }
4669 1704
4670 -//#endregion
4671 -//#region modules/web-cli/assets/js/core/hooks/ui.js
4672 - function _callSuper$9(t, o, e) {
4673 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$9() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
4674 - }
4675 - __name(_callSuper$9, "_callSuper");
4676 - function _isNativeReflectConstruct$9() {
4677 - try {
4678 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
4679 - } catch (t) {}
4680 - return (_isNativeReflectConstruct$9 = function _isNativeReflectConstruct() {
4681 - return !!t;
4682 - })();
4683 - }
4684 - __name(_isNativeReflectConstruct$9, "_isNativeReflectConstruct");
4685 - var Ui = /*#__PURE__*/ function(_HooksBase) {
4686 - function Ui() {
4687 - var _this;
4688 - _classCallCheck(this, Ui);
4689 - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
4690 - _this = _callSuper$9(this, Ui, [].concat(args));
4691 - _this.callbacks.before = {};
4692 - _this.depth.before = {};
4693 - return _this;
4694 - }
4695 - _inherits(Ui, _HooksBase);
4696 - return _createClass(Ui, [
4697 - {
4698 - key: "getType",
4699 - value: function getType() {
4700 - return "ui";
4701 - }
4702 - },
4703 - {
4704 - key: "runCallback",
4705 - value: function runCallback(event, callback, args, result) {
4706 - switch (event) {
4707 - case "before":
4708 - callback.callback(args);
4709 - break;
4710 - case "catch":
4711 - case "after":
4712 - callback.callback(args, result);
4713 - break;
4714 - default: return false;
4715 - }
4716 - return true;
4717 - }
4718 - },
4719 - {
4720 - key: "onRun",
4721 - value: function onRun(command, args, event) {
4722 - if (!$e.devTools) return;
4723 - $e.devTools.log.callbacks().run(this.getType(), command, args, event);
4724 - }
4725 - },
4726 - {
4727 - key: "onCallback",
4728 - value: function onCallback(command, args, event, id) {
4729 - if (!$e.devTools) return;
4730 - $e.devTools.log.callbacks().callback(this.getType(), command, args, event, id);
4731 - }
4732 - }
4733 - ]);
4734 - }(HooksBase);
1705 + // If requested magic param does not exist in args, need to remove it to have fixed endpoint.
1706 + // eg: 'documents/{documentId}/elements/{elementId}' and args { documentId: 4123 }.
1707 + // result: 'documents/4123/elements'
1708 + if (format && endpoint.includes('/{')) {
1709 + endpoint = endpoint.substring(0, endpoint.indexOf('/{'));
1710 + }
1711 + if (args.query && Object.values(args.query).length) {
1712 + // Sorting since the endpoint later will be used as key to store the cache.
1713 + var queryEntries = Object.entries(args.query).sort(function (_ref3, _ref4) {
1714 + var _ref5 = (0, _slicedToArray2.default)(_ref3, 1),
1715 + aKey = _ref5[0];
1716 + var _ref6 = (0, _slicedToArray2.default)(_ref4, 1),
1717 + bKey = _ref6[0];
1718 + return aKey - bKey;
1719 + } // Sort by param name.
1720 + );
4735 1721
4736 -//#endregion
4737 -//#region modules/web-cli/assets/js/core/hooks.js
1722 + // `args.query` will become a part of GET params.
1723 + if (queryEntries.length) {
1724 + endpoint += '?';
1725 + queryEntries.forEach(function (_ref7) {
1726 + var _ref8 = (0, _slicedToArray2.default)(_ref7, 2),
1727 + name = _ref8[0],
1728 + value = _ref8[1];
1729 + // Replace the character '/' with the encoded version,
1730 + // mostly because when saving this endpoint value to the cache it splits the url base on the '/' character.
1731 + value = "".concat(value).replace(/\//g, '%2F');
1732 + endpoint += name + '=' + value + '&';
1733 + });
1734 + }
1735 +
1736 + // If last character is '&' remove it.
1737 + endpoint = endpoint.replace(/&$/, '');
1738 + }
1739 + return endpoint;
1740 + }
1741 +
1742 + /**
1743 + * Function commandExtractArgs().
1744 + *
1745 + * If the command have query convert it to args.
1746 + *
1747 + * @param {string} command
1748 + * @param {Object} args
1749 + *
1750 + * @return {ExtractedCommand} command
1751 + */
1752 + }, {
1753 + key: "commandExtractArgs",
1754 + value: function commandExtractArgs(command) {
1755 + var _command;
1756 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1757 + if ((_command = command) !== null && _command !== void 0 && _command.includes('?')) {
1758 + if (!args.query) {
1759 + args.query = {};
1760 + }
1761 + var commandParts = command.split('?'),
1762 + pureCommand = commandParts[0],
1763 + queryString = commandParts[1],
1764 + query = new URLSearchParams(queryString);
1765 + Object.assign(args.query, Object.fromEntries(query));
1766 + command = pureCommand;
1767 + }
1768 + return {
1769 + command: command,
1770 + args: args
1771 + };
1772 + }
1773 +
1774 + /**
1775 + * Function validateRequestData().
1776 + *
1777 + * Validate request data requirements.
1778 + *
1779 + * @param {RequestData} requestData
1780 + * @param {boolean} [requireArgsData]
1781 + */
1782 + }, {
1783 + key: "validateRequestData",
1784 + value: function validateRequestData(requestData) {
1785 + var requireArgsData = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
1786 + // Do not validate if its already valid.
1787 + if (requestData.timestamp && this.validatedRequests[requestData.timestamp]) {
1788 + return;
1789 + }
1790 + var argsObject = new _argsObject.default(requestData);
1791 + argsObject.requireArgument('component');
1792 + argsObject.requireArgumentType('command', 'string');
1793 + argsObject.requireArgumentType('endpoint', 'string');
1794 + if (requireArgsData) {
1795 + argsObject.requireArgumentType('data', 'object', requestData.args);
1796 + }
1797 +
1798 + // Ensure timestamp.
1799 + if (!requestData.timestamp) {
1800 + requestData.timestamp = new Date().getTime();
1801 + }
1802 + this.validatedRequests[requestData.timestamp] = true;
1803 + }
1804 +
1805 + /**
1806 + * Function prepareHeaders().
1807 + *
1808 + * Prepare the headers for each request.
1809 + *
1810 + * @param {RequestData} requestData
1811 + *
1812 + * @return {{}} params
1813 + */
1814 + }, {
1815 + key: "prepareHeaders",
1816 + value: function prepareHeaders(requestData) {
1817 + var _requestData$args;
1818 + var type = requestData.type,
1819 + nonce = elementorWebCliConfig.nonce,
1820 + params = {
1821 + signal: (_requestData$args = requestData.args) === null || _requestData$args === void 0 || (_requestData$args = _requestData$args.options) === null || _requestData$args === void 0 ? void 0 : _requestData$args.signal,
1822 + credentials: 'include' // Cookies is required for wp reset.
1823 + },
1824 + headers = {
1825 + 'X-WP-Nonce': nonce
1826 + };
1827 +
1828 + /**
1829 + * Translate:
1830 + * 'create, delete, get, update' to HTTP Methods:
1831 + * 'GET, POST, PUT, PATCH, DELETE'
1832 + */
1833 + var allowedMethods = this.getAllowedMethods(type),
1834 + method = this.getHTTPMethod(type);
1835 + if ('GET' === method) {
1836 + Object.assign(params, {
1837 + headers: headers
1838 + });
1839 + } else if (allowedMethods) {
1840 + var _requestData$args2, _requestData$args3;
1841 + if (['POST', 'PUT'].includes(method) && !((_requestData$args2 = requestData.args) !== null && _requestData$args2 !== void 0 && _requestData$args2.data)) {
1842 + throw Error('Invalid requestData.args.data');
1843 + }
1844 + Object.assign(headers, {
1845 + 'Content-Type': 'application/json'
1846 + });
1847 + if ((_requestData$args3 = requestData.args) !== null && _requestData$args3 !== void 0 && _requestData$args3.headers) {
1848 + Object.assign(headers, requestData.args.headers);
1849 + }
1850 + Object.assign(params, {
1851 + method: method,
1852 + headers: headers,
1853 + body: 'application/json' === headers['Content-Type'] ? JSON.stringify(requestData.args.data) : requestData.args.data
1854 + });
1855 + } else {
1856 + throw Error("Invalid type: '".concat(type, "'"));
1857 + }
1858 + return params;
1859 + }
1860 +
1861 + /**
1862 + * Function prepareEndpoint().
1863 + *
1864 + * This method response for building a final endpoint,
1865 + * the main problem is with plain permalink mode + command with query params that creates a weird url,
1866 + * the current method should fix it.
1867 + *
1868 + * @param {RequestData} requestData
1869 + *
1870 + * @return {string} Endpoint URL
1871 + */
1872 + }, {
1873 + key: "prepareEndpoint",
1874 + value: function prepareEndpoint(requestData) {
1875 + var splitEndpoint = requestData.endpoint.split('?'),
1876 + endpoint = splitEndpoint.shift();
1877 + var endpointAddress = this.getEndpointURL(requestData, endpoint);
1878 + if (splitEndpoint.length) {
1879 + var separator = endpointAddress.includes('?') ? '&' : '?';
1880 + endpointAddress += separator + splitEndpoint.pop();
1881 + }
1882 + return endpointAddress;
1883 + }
1884 +
1885 + /**
1886 + * Function fetch().
1887 + *
1888 + * @param {RequestData} requestData
1889 + * @param {function(RequestInfo,*) : Promise<Response> } [fetchAPI]
1890 + *
1891 + * @return {Promise<Response>} response
1892 + */
1893 + }, {
1894 + key: "fetch",
1895 + value: function fetch(requestData) {
1896 + var _requestData$args$opt,
1897 + _this2 = this;
1898 + var fetchAPI = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window.fetch;
1899 + requestData.cache = 'miss';
1900 + var refresh = (_requestData$args$opt = requestData.args.options) === null || _requestData$args$opt === void 0 ? void 0 : _requestData$args$opt.refresh,
1901 + getCache = 'get' === requestData.type && !refresh,
1902 + saveCache = ['create', 'get'].includes(requestData.type) && !refresh;
1903 + if (getCache) {
1904 + var cachePromise = this.cache.getAsync(requestData);
1905 + if (cachePromise) {
1906 + return cachePromise;
1907 + }
1908 + }
1909 + var params = this.prepareHeaders(requestData);
1910 + // eslint-disable-next-line no-async-promise-executor
1911 + return new Promise(/*#__PURE__*/function () {
1912 + var _ref9 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2(resolve, reject) {
1913 + var endpoint, request, response, _t;
1914 + return _regenerator.default.wrap(function (_context2) {
1915 + while (1) switch (_context2.prev = _context2.next) {
1916 + case 0:
1917 + _context2.prev = 0;
1918 + endpoint = _this2.prepareEndpoint(requestData);
1919 + request = fetchAPI(endpoint, params);
1920 + _context2.next = 1;
1921 + return request.then(/*#__PURE__*/function () {
1922 + var _ref0 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee(_response) {
1923 + return _regenerator.default.wrap(function (_context) {
1924 + while (1) switch (_context.prev = _context.next) {
1925 + case 0:
1926 + if (_response.ok) {
1927 + _context.next = 3;
1928 + break;
1929 + }
1930 + if (!_response.headers.get('content-type').includes('application/json')) {
1931 + _context.next = 2;
1932 + break;
1933 + }
1934 + _context.next = 1;
1935 + return _response.json();
1936 + case 1:
1937 + _response = _context.sent;
1938 + case 2:
1939 + throw _response;
1940 + case 3:
1941 + return _context.abrupt("return", _response.json());
1942 + case 4:
1943 + case "end":
1944 + return _context.stop();
1945 + }
1946 + }, _callee);
1947 + }));
1948 + return function (_x3) {
1949 + return _ref0.apply(this, arguments);
1950 + };
1951 + }());
1952 + case 1:
1953 + response = _context2.sent;
1954 + // At this point, it got the resolved response from remote.
1955 + // So load cache, and resolve it.
1956 + if (saveCache) {
1957 + _this2.cache.set(requestData, response);
1958 + }
1959 + resolve(response);
1960 + _context2.next = 3;
1961 + break;
1962 + case 2:
1963 + _context2.prev = 2;
1964 + _t = _context2["catch"](0);
1965 + reject(_t);
1966 + case 3:
1967 + case "end":
1968 + return _context2.stop();
1969 + }
1970 + }, _callee2, null, [[0, 2]]);
1971 + }));
1972 + return function (_x, _x2) {
1973 + return _ref9.apply(this, arguments);
1974 + };
1975 + }());
1976 + }
1977 +
1978 + /**
1979 + * Function getCache().
1980 + *
1981 + * @param {ComponentBase} component
1982 + * @param {string} command
1983 + * @param {{}} query
1984 + *
1985 + * @return {{}} cache object
1986 + */
1987 + }, {
1988 + key: "getCache",
1989 + value: function getCache(component, command) {
1990 + var query = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
1991 + var args = {
1992 + query: query
1993 + };
1994 + return this.cache.get({
1995 + endpoint: this.commandToEndpoint(command, args, this.commandFormats[command]),
1996 + component: component,
1997 + command: command,
1998 + args: args
1999 + });
2000 + }
2001 +
2002 + /**
2003 + * Function setCache().
2004 + *
2005 + * @param {ComponentBase} component
2006 + * @param {string} command
2007 + * @param {{}} query
2008 + * @param {*} data
2009 + */
2010 + }, {
2011 + key: "setCache",
2012 + value: function setCache(component, command, query, data) {
2013 + var args = {
2014 + query: query
2015 + };
2016 + this.cache.set({
2017 + endpoint: this.commandToEndpoint(command, args, this.commandFormats[command]),
2018 + component: component,
2019 + command: command,
2020 + args: args
2021 + }, data);
2022 + }
2023 +
2024 + /**
2025 + * Function updateCache().
2026 + *
2027 + * The difference between 'setCache' and 'updateCache' is update will only modify exist values.
2028 + * and 'setCache' will create or update.
2029 + *
2030 + * @param {ComponentBase} component
2031 + * @param {string} command
2032 + * @param {{}} query
2033 + * @param {*} data
2034 + */
2035 + }, {
2036 + key: "updateCache",
2037 + value: function updateCache(component, command, query, data) {
2038 + var args = {
2039 + query: query,
2040 + data: data
2041 + };
2042 + this.cache.update({
2043 + endpoint: this.commandToEndpoint(command, args, this.commandFormats[command]),
2044 + component: component,
2045 + command: command,
2046 + args: args
2047 + });
2048 + }
2049 +
2050 + /**
2051 + * Function deleteCache().
2052 + *
2053 + * @param {ComponentBase} component
2054 + * @param {string} command
2055 + * @param {{}} query
2056 + */
2057 + }, {
2058 + key: "deleteCache",
2059 + value: function deleteCache(component, command) {
2060 + var query = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
2061 + var args = {
2062 + query: query
2063 + };
2064 + this.cache.delete({
2065 + endpoint: this.commandToEndpoint(command, args, this.commandFormats[command]),
2066 + component: component,
2067 + command: command,
2068 + args: args
2069 + });
2070 + }
2071 +
2072 + /**
2073 + * Function registerFormat().
2074 + *
2075 + * Register's format for each command.
2076 + *
2077 + * @param {string} command
2078 + * @param {string} format
2079 + */
2080 + }, {
2081 + key: "registerFormat",
2082 + value: function registerFormat(command, format) {
2083 + this.commandFormats[command] = format;
2084 + }
2085 +
2086 + /**
2087 + * Function create().
2088 + *
2089 + * Run a command, that will be translated as endpoint for creating new data.
2090 + *
2091 + * @param {string} command
2092 + * @param {*} data
2093 + * @param {{}} query
2094 + * @param {{}} options
2095 + *
2096 + * @return {*} result
2097 + */
2098 + }, {
2099 + key: "create",
2100 + value: function create(command, data) {
2101 + var query = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
2102 + var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
2103 + return this.run('create', command, {
2104 + query: query,
2105 + options: options,
2106 + data: data
2107 + });
2108 + }
2109 +
2110 + /**
2111 + * Function delete().
2112 + *
2113 + * Run a command, that will be translated as endpoint for deleting data.
2114 + *
2115 + * @param {string} command
2116 + * @param {{}} query
2117 + * @param {{}} options
2118 + *
2119 + * @return {*} result
2120 + */
2121 + }, {
2122 + key: "delete",
2123 + value: function _delete(command) {
2124 + var query = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2125 + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
2126 + return this.run('delete', command, {
2127 + query: query,
2128 + options: options
2129 + });
2130 + }
2131 +
2132 + /**
2133 + * Function get().
2134 + *
2135 + * Run a command, that will be translated as endpoint for getting data.
2136 + *
2137 + * @param {string} command
2138 + * @param {{}} query
2139 + * @param {{}} options
2140 + *
2141 + * @return {*} result
2142 + */
2143 + }, {
2144 + key: "get",
2145 + value: function get(command) {
2146 + var query = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2147 + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
2148 + return this.run('get', command, {
2149 + query: query,
2150 + options: options
2151 + });
2152 + }
2153 +
2154 + /**
2155 + * Function update().
2156 + *
2157 + * Run a command, that will be translated as endpoint for updating data.
2158 + *
2159 + * @param {string} command
2160 + * @param {*} data
2161 + * @param {{}} query
2162 + * @param {{}} options
2163 + *
2164 + * @return {*} result
2165 + */
2166 + }, {
2167 + key: "update",
2168 + value: function update(command, data) {
2169 + var query = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
2170 + var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
2171 + return this.run('update', command, {
2172 + query: query,
2173 + options: options,
2174 + data: data
2175 + });
2176 + }
2177 +
2178 + /**
2179 + * Function options().
2180 + *
2181 + * Run a command, that will be translated as endpoint for requesting options/information about specific endpoint.
2182 + *
2183 + * @param {string} command
2184 + * @param {{}} query
2185 + * @param {{}} options
2186 + *
2187 + * @return {*} result
2188 + */
2189 + }, {
2190 + key: "options",
2191 + value: function options(command, query) {
2192 + var _options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
2193 + return this.run('options', command, {
2194 + query: query,
2195 + options: _options
2196 + });
2197 + }
2198 + }, {
2199 + key: "register",
2200 + value: function register(component, command, callback) {
2201 + _superPropGet(Data, "register", this, 3)([component, command, callback]);
2202 + var fullCommandName = component.getNamespace() + '/' + command,
2203 + commandInstance = $e.data.getCommandClass(fullCommandName),
2204 + format = commandInstance !== null && commandInstance !== void 0 && commandInstance.getEndpointFormat ? commandInstance.getEndpointFormat() : false;
2205 + if (format) {
2206 + $e.data.registerFormat(fullCommandName, format);
2207 + }
2208 + return this;
2209 + }
2210 +
2211 + /**
2212 + * TODO: Add JSDOC typedef for args ( query and options ).
2213 + *
2214 + * @param {DataTypes} type
2215 + * @param {string} command
2216 + * @param {{}} args
2217 + *
2218 + * @override
2219 + */
2220 + }, {
2221 + key: "run",
2222 + value: function run(type, command, args) {
2223 + args.options.type = type;
2224 + var _this$commandExtractA = this.commandExtractArgs(command, args);
2225 + command = _this$commandExtractA.command;
2226 + args = _this$commandExtractA.args;
2227 + return _superPropGet(Data, "run", this, 3)([command, args]);
2228 + }
2229 + }, {
2230 + key: "error",
2231 + value: function error(message) {
2232 + throw Error('Data commands: ' + message);
2233 + }
2234 + }]);
2235 +}(_commands.default);
2236 +
2237 +/***/ }),
2238 +
2239 +/***/ "../modules/web-cli/assets/js/core/data/cache.js":
2240 +/*!*******************************************************!*\
2241 + !*** ../modules/web-cli/assets/js/core/data/cache.js ***!
2242 + \*******************************************************/
2243 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2244 +
2245 +"use strict";
2246 +
2247 +
2248 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2249 +Object.defineProperty(exports, "__esModule", ({
2250 + value: true
2251 +}));
2252 +exports["default"] = void 0;
2253 +var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"));
2254 +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
2255 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
2256 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
2257 +var _localStorage = _interopRequireDefault(__webpack_require__(/*! ./storages/local-storage */ "../modules/web-cli/assets/js/core/data/storages/local-storage.js"));
4738 2258 /**
4739 - * @typedef {import('../modules/hook-base')} HookBase
4740 - */
4741 - var Hooks = /*#__PURE__*/ function() {
4742 - function Hooks() {
4743 - _classCallCheck(this, Hooks);
4744 - _defineProperty(this, "data", new Data());
4745 - _defineProperty(this, "ui", new Ui());
4746 - }
4747 - return _createClass(Hooks, [
4748 - {
4749 - key: "activate",
4750 - value: function activate() {
4751 - this.getTypes().forEach(function(hooksType) {
4752 - hooksType.activate();
4753 - });
4754 - }
4755 - },
4756 - {
4757 - key: "deactivate",
4758 - value: function deactivate() {
4759 - this.getTypes().forEach(function(hooksType) {
4760 - hooksType.deactivate();
4761 - });
4762 - }
4763 - },
4764 - {
4765 - key: "getAll",
4766 - value: function getAll() {
4767 - var flat = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
4768 - var result = {};
4769 - this.getTypes().forEach(function(hooksType) {
4770 - result[hooksType.getType()] = hooksType.getAll(flat);
4771 - });
4772 - return result;
4773 - }
4774 - },
4775 - {
4776 - key: "getTypes",
4777 - value: function getTypes() {
4778 - return [this.data, this.ui];
4779 - }
4780 - },
4781 - {
4782 - key: "getType",
4783 - value: function getType(type) {
4784 - return this.getTypes().find(function(hooks) {
4785 - return type === hooks.getType();
4786 - });
4787 - }
4788 - },
4789 - {
4790 - key: "register",
4791 - value: function register(type, event, instance) {
4792 - return this.getType(type).register(event, instance);
4793 - }
4794 - },
4795 - {
4796 - key: "run",
4797 - value: function run(type, event, command, args) {
4798 - var result = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : void 0;
4799 - return this.getType(type).run(event, command, args, result);
4800 - }
4801 - },
4802 - {
4803 - key: "registerDataAfter",
4804 - value: function registerDataAfter(instance) {
4805 - return this.register("data", "after", instance);
4806 - }
4807 - },
4808 - {
4809 - key: "registerDataCatch",
4810 - value: function registerDataCatch(instance) {
4811 - return this.register("data", "catch", instance);
4812 - }
4813 - },
4814 - {
4815 - key: "registerDataDependency",
4816 - value: function registerDataDependency(instance) {
4817 - return this.register("data", "dependency", instance);
4818 - }
4819 - },
4820 - {
4821 - key: "registerUIAfter",
4822 - value: function registerUIAfter(instance) {
4823 - return this.register("ui", "after", instance);
4824 - }
4825 - },
4826 - {
4827 - key: "registerUICatch",
4828 - value: function registerUICatch(instance) {
4829 - return this.register("ui", "catch", instance);
4830 - }
4831 - },
4832 - {
4833 - key: "registerUIBefore",
4834 - value: function registerUIBefore(instance) {
4835 - return this.register("ui", "before", instance);
4836 - }
4837 - },
4838 - {
4839 - key: "runDataAfter",
4840 - value: function runDataAfter(command, args, result) {
4841 - return this.run("data", "after", command, args, result);
4842 - }
4843 - },
4844 - {
4845 - key: "runDataCatch",
4846 - value: function runDataCatch(command, args, error) {
4847 - return this.run("data", "catch", command, args, error);
4848 - }
4849 - },
4850 - {
4851 - key: "runDataDependency",
4852 - value: function runDataDependency(command, args) {
4853 - return this.run("data", "dependency", command, args);
4854 - }
4855 - },
4856 - {
4857 - key: "runUIAfter",
4858 - value: function runUIAfter(command, args, result) {
4859 - return this.run("ui", "after", command, args, result);
4860 - }
4861 - },
4862 - {
4863 - key: "runUICatch",
4864 - value: function runUICatch(command, args, e) {
4865 - return this.run("ui", "catch", command, args, e);
4866 - }
4867 - },
4868 - {
4869 - key: "runUIBefore",
4870 - value: function runUIBefore(command, args) {
4871 - return this.run("ui", "before", command, args);
4872 - }
4873 - }
4874 - ]);
4875 - }();
2259 + * @typedef {{}} RequestData
2260 + */
2261 +/**
2262 + * @typedef {import('../data')} Data
2263 + */
2264 +/**
2265 + * TODO: Search common logic, create functions to reduce code size.
2266 + */
2267 +var Cache = exports["default"] = /*#__PURE__*/function () {
2268 + /**
2269 + * Function constructor().
2270 + *
2271 + * Create cache.
2272 + *
2273 + * @param {Data} manager
2274 + */
2275 + function Cache(manager) {
2276 + (0, _classCallCheck2.default)(this, Cache);
2277 + this.manager = manager;
2278 + this.storage = new _localStorage.default();
2279 + }
4876 2280
4877 -//#endregion
4878 -//#region modules/web-cli/assets/js/core/routes.js
4879 - function _callSuper$8(t, o, e) {
4880 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$8() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
4881 - }
4882 - __name(_callSuper$8, "_callSuper");
4883 - function _isNativeReflectConstruct$8() {
4884 - try {
4885 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
4886 - } catch (t) {}
4887 - return (_isNativeReflectConstruct$8 = function _isNativeReflectConstruct() {
4888 - return !!t;
4889 - })();
4890 - }
4891 - __name(_isNativeReflectConstruct$8, "_isNativeReflectConstruct");
4892 - function _superPropGet(t, o, e, r) {
4893 - var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e);
4894 - return 2 & r && "function" == typeof p ? function(t) {
4895 - return p.apply(e, t);
4896 - } : p;
4897 - }
4898 - var Routes = /*#__PURE__*/ function(_Commands) {
4899 - function Routes() {
4900 - var _this;
4901 - _classCallCheck(this, Routes);
4902 - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
4903 - _this = _callSuper$8(this, Routes, [].concat(args));
4904 - _this.savedStates = {};
4905 - _this.historyPerComponent = {};
4906 - return _this;
4907 - }
4908 - _inherits(Routes, _Commands);
4909 - return _createClass(Routes, [
4910 - {
4911 - key: "refreshContainer",
4912 - value: function refreshContainer(container) {
4913 - var currentRoute = this.getCurrent(container);
4914 - var currentArgs = this.getCurrentArgs(container);
4915 - this.clearCurrent(container);
4916 - this.to(currentRoute, currentArgs);
4917 - }
4918 - },
4919 - {
4920 - key: "getHistory",
4921 - value: function getHistory() {
4922 - var namespaceRoot = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
4923 - if (namespaceRoot) return this.historyPerComponent[namespaceRoot] || [];
4924 - return this.historyPerComponent;
4925 - }
4926 - },
4927 - {
4928 - key: "clearHistory",
4929 - value: function clearHistory(namespaceRoot) {
4930 - delete this.historyPerComponent[namespaceRoot];
4931 - }
4932 - },
4933 - {
4934 - key: "clearCurrent",
4935 - value: function clearCurrent(container) {
4936 - var route = this.current[container];
4937 - if (!route) return;
4938 - this.detachCurrent(container);
4939 - this.getComponent(route).onCloseRoute(route);
4940 - this.dispatchOnClose(route);
4941 - }
4942 - },
4943 - {
4944 - key: "clear",
4945 - value: function clear() {
4946 - var _this2 = this;
4947 - Object.keys(this.current).forEach(function(container) {
4948 - return _this2.clearCurrent(container);
4949 - });
4950 - }
4951 - },
4952 - {
4953 - key: "saveState",
4954 - value: function saveState(container) {
4955 - this.savedStates[container] = {
4956 - route: this.current[container],
4957 - args: this.currentArgs[container]
4958 - };
4959 - return this;
4960 - }
4961 - },
4962 - {
4963 - key: "restoreState",
4964 - value: function restoreState(container) {
4965 - if (!this.savedStates[container]) return false;
4966 - this.to(this.savedStates[container].route, this.savedStates[container].args);
4967 - return true;
4968 - }
4969 - },
4970 - {
4971 - key: "validateRun",
4972 - value: function validateRun(route) {
4973 - var args = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
4974 - if (!_superPropGet(Routes, "validateRun", this, 3)([route, args])) return false;
4975 - if (this.is(route, args) && !args.refresh) return false;
4976 - var component = this.getComponent(route);
4977 - if (!component.isOpen || args.reOpen) component.isOpen = component.open(args);
4978 - return component.isOpen;
4979 - }
4980 - },
4981 - {
4982 - key: "beforeRun",
4983 - value: function beforeRun(route, args) {
4984 - var container = this.getComponent(route).getServiceName();
4985 - var oldRoute = this.current[container];
4986 - if (oldRoute) this.getComponent(oldRoute).onCloseRoute(oldRoute);
4987 - Commands.trace.push(route);
4988 - _superPropGet(Routes, "beforeRun", this, 3)([
4989 - route,
4990 - args,
4991 - false
4992 - ]);
4993 - this.attachCurrent(container, route, args);
4994 - if (oldRoute) this.dispatchOnClose(oldRoute);
4995 - }
4996 - },
4997 - {
4998 - key: "to",
4999 - value: function to(route, args) {
5000 - var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : { history: true };
5001 - this.run(route, args);
5002 - var namespaceRoot = this.getComponent(route).getServiceName();
5003 - if (options.history) {
5004 - if (!this.historyPerComponent[namespaceRoot]) this.historyPerComponent[namespaceRoot] = [];
5005 - this.historyPerComponent[namespaceRoot].push({
5006 - route,
5007 - args
5008 - });
5009 - }
5010 - }
5011 - },
5012 - {
5013 - key: "back",
5014 - value: function back(namespaceRoot) {
5015 - var history = this.getHistory(namespaceRoot);
5016 - history.pop();
5017 - var last = history.pop();
5018 - if (!last) return;
5019 - this.to(last.route, last.args);
5020 - }
5021 - },
5022 - {
5023 - key: "runShortcut",
5024 - value: function runShortcut(command) {
5025 - this.to(command);
5026 - }
5027 - },
5028 - {
5029 - key: "afterRun",
5030 - value: function afterRun(route, args) {
5031 - var results = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : void 0;
5032 - this.getComponent(route).onRoute(route, args);
5033 - this.dispatchOnOpen(route);
5034 - _superPropGet(Routes, "afterRun", this, 3)([
5035 - route,
5036 - args,
5037 - results,
5038 - false
5039 - ]);
5040 - Commands.trace.pop();
5041 - }
5042 - },
5043 - {
5044 - key: "is",
5045 - value: function is(route) {
5046 - var args = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
5047 - if (!_superPropGet(Routes, "is", this, 3)([route])) return false;
5048 - var container = this.getComponent(route).getServiceName();
5049 - return _.isEqual(args, this.currentArgs[container]);
5050 - }
5051 - },
5052 - {
5053 - key: "isPartOf",
5054 - value: function isPartOf(route) {
5055 - /**
5056 - * Check against current command hierarchically.
5057 - * For example `is( 'panel' )` will be true for `panel/elements`
5058 - * `is( 'panel/editor' )` will be true for `panel/editor/style`
5059 - */
5060 - var container = route.split("/")[0];
5061 - var toCheck = [];
5062 - var currentParts = this.current[container] ? this.current[container].split("/") : [];
5063 - var match = false;
5064 - currentParts.forEach(function(part) {
5065 - toCheck.push(part);
5066 - if (toCheck.join("/") === route) match = true;
5067 - });
5068 - return match;
5069 - }
5070 - },
5071 - {
5072 - key: "error",
5073 - value: function error(message) {
5074 - throw Error("Routes: " + message);
5075 - }
5076 - },
5077 - {
5078 - key: "dispatchOnOpen",
5079 - value: function dispatchOnOpen(route) {
5080 - window.dispatchEvent(new CustomEvent("elementor/routes/open", { detail: { route } }));
5081 - }
5082 - },
5083 - {
5084 - key: "dispatchOnClose",
5085 - value: function dispatchOnClose(route) {
5086 - window.dispatchEvent(new CustomEvent("elementor/routes/close", { detail: { route } }));
5087 - }
5088 - }
5089 - ]);
5090 - }(Commands);
2281 + /**
2282 + * Function getAsync().
2283 + *
2284 + * Receive from cache. the difference between getAsync() and get() is that receive return it as promise...
2285 + * to fake fetch mechanism.
2286 + *
2287 + * @param {RequestData} requestData
2288 + *
2289 + * @return {(Promise|boolean)} request data
2290 + */
2291 + return (0, _createClass2.default)(Cache, [{
2292 + key: "getAsync",
2293 + value: function getAsync(requestData) {
2294 + var data = this.get(requestData);
2295 + if (null !== data) {
2296 + // If data comes from cache, add 'cache = hit' to requestData.
2297 + requestData.cache = 'hit';
2298 + return new Promise(function (resolve) {
2299 + resolve(data);
2300 + });
2301 + }
5091 2302
5092 -//#endregion
5093 -//#region modules/web-cli/assets/js/utils/environment.js
5094 - var matchUserAgent = function matchUserAgent(UserAgentStr) {
5095 - return userAgent.indexOf(UserAgentStr) >= 0;
5096 - };
5097 - var userAgent = navigator.userAgent;
5098 - var isOpera = !!window.opr && !!opr.addons || !!window.opera || matchUserAgent(" OPR/");
5099 - var isFirefox = matchUserAgent("Firefox");
5100 - var isSafari = /^((?!chrome|android).)*safari/i.test(userAgent) || /constructor/i.test(window.HTMLElement) || function(p) {
5101 - return "[object SafariRemoteNotification]" === p.toString();
5102 - }(!window.safari || typeof safari !== "undefined" && safari.pushNotification);
5103 - var isIE = /Trident|MSIE/.test(userAgent) && !!document.documentMode;
5104 - var isEdge = !isIE && !!window.StyleMedia || matchUserAgent("Edg");
5105 - var isChrome = !!window.chrome && matchUserAgent("Chrome") && !(isEdge || isOpera);
5106 - var isBlink = matchUserAgent("Chrome") && !!window.CSS;
5107 - var environment = {
5108 - appleWebkit: matchUserAgent("AppleWebKit") && !isBlink,
5109 - blink: isBlink,
5110 - chrome: isChrome,
5111 - edge: isEdge,
5112 - firefox: isFirefox,
5113 - ie: isIE,
5114 - mac: matchUserAgent("Macintosh"),
5115 - opera: isOpera,
5116 - safari: isSafari,
5117 - webkit: matchUserAgent("AppleWebKit")
5118 - };
2303 + // TODO: Check if possible, always return promise and reject it.
2304 + return false;
2305 + }
5119 2306
5120 -//#endregion
5121 -//#region modules/web-cli/assets/js/core/shortcuts.js
5122 - var Shortcuts = /*#__PURE__*/ function() {
5123 - function Shortcuts($window) {
5124 - _classCallCheck(this, Shortcuts);
5125 - this.specialKeys = {
5126 - 13: "enter",
5127 - 27: "esc",
5128 - 38: "up",
5129 - 40: "down",
5130 - 46: "del",
5131 - 191: "?"
5132 - };
5133 - this.component = "";
5134 - this.handlers = {};
5135 - this.bindListener($window);
5136 - }
5137 - return _createClass(Shortcuts, [
5138 - {
5139 - key: "bindListener",
5140 - value: function bindListener($window) {
5141 - var _this = this;
5142 - $window.on("keydown", function(event) {
5143 - return _this.handle(event);
5144 - });
5145 - }
5146 - },
5147 - {
5148 - key: "getAll",
5149 - value: function getAll() {
5150 - var shortcuts = {};
5151 - jQuery.each(this.handlers, function(key, handler) {
5152 - jQuery.each(handler, function(index, config) {
5153 - shortcuts[config.command] = key;
5154 - });
5155 - });
5156 - return shortcuts;
5157 - }
5158 - },
5159 - {
5160 - key: "register",
5161 - value: function register(shortcuts, args) {
5162 - var _this2 = this;
5163 - shortcuts.replace(" ", "").split(",").forEach(function(shortcut) {
5164 - if (!_this2.handlers[shortcut]) _this2.handlers[shortcut] = [];
5165 - _this2.handlers[shortcut].push(args);
5166 - });
5167 - }
5168 - },
5169 - {
5170 - key: "unregister",
5171 - value: function unregister(shortcuts, args) {
5172 - var _this3 = this;
5173 - shortcuts.replace(" ", "").split(",").forEach(function(shortcut) {
5174 - _this3.handlers[shortcut].forEach(function(index, handler) {
5175 - if (args === handler) delete _this3.handlers[shortcut][index];
5176 - });
5177 - });
5178 - }
5179 - },
5180 - {
5181 - key: "handle",
5182 - value: function handle(event) {
5183 - var handlers = this.getHandlersByPriority(event);
5184 - if (!handlers) return;
5185 - var filteredHandlers = handlers.filter(function(handler) {
5186 - if (handler.exclude && -1 !== handler.exclude.indexOf("input")) {
5187 - var $target = jQuery(event.target);
5188 - if ($target.is(":input, .elementor-input") || $target.closest("[contenteditable=\"true\"]").length) return false;
5189 - }
5190 - if (handler.dependency && !handler.dependency(event)) return false;
5191 - if (!handler.allowAltKey && event.altKey) return false;
5192 - return true;
5193 - });
5194 - if (!filteredHandlers.length) return;
5195 - if (1 < filteredHandlers.length && elementorWebCliConfig.isDebug) Console.warn("Multiple handlers for shortcut.", filteredHandlers, event);
5196 - event.preventDefault();
5197 - filteredHandlers[0].callback(event);
5198 - }
5199 - },
5200 - {
5201 - key: "isControlEvent",
5202 - value: function isControlEvent(event) {
5203 - return event[environment.mac ? "metaKey" : "ctrlKey"];
5204 - }
5205 - },
5206 - {
5207 - key: "getEventShortcut",
5208 - value: function getEventShortcut(event) {
5209 - var shortcut = [];
5210 - if (event.altKey) shortcut.push("alt");
5211 - if (this.isControlEvent(event)) shortcut.push("ctrl");
5212 - if (event.shiftKey) shortcut.push("shift");
5213 - if (this.specialKeys[event.which]) shortcut.push(this.specialKeys[event.which]);
5214 - else shortcut.push(String.fromCharCode(event.which).toLowerCase());
5215 - return shortcut.join("+");
5216 - }
5217 - },
5218 - {
5219 - key: "isActiveScope",
5220 - value: function isActiveScope(scopes) {
5221 - var activeComponents = Object.keys($e.components.activeComponents);
5222 - var activeComponent = activeComponents[activeComponents.length - 1];
5223 - var component = $e.components.get(activeComponent);
5224 - if (!component) return false;
5225 - var namespace = component.getNamespace();
5226 - if (scopes.some(function(scope) {
5227 - return namespace === scope;
5228 - })) return true;
5229 - var namespaceRoot = component.getServiceName();
5230 - return scopes.some(function(scope) {
5231 - return namespaceRoot === scope;
5232 - });
5233 - }
5234 - },
5235 - {
5236 - key: "getHandlersByPriority",
5237 - value: function getHandlersByPriority(event) {
5238 - var _this4 = this;
5239 - var handlers = this.handlers[this.getEventShortcut(event)];
5240 - if (!handlers) return false;
5241 - var inCurrentScope = handlers.filter(function(handler) {
5242 - return handler.scopes && _this4.isActiveScope(handler.scopes);
5243 - });
5244 - if (inCurrentScope.length) return inCurrentScope;
5245 - var noScope = handlers.filter(function(handler) {
5246 - return !handler.scopes;
5247 - });
5248 - if (noScope.length) return noScope;
5249 - }
5250 - }
5251 - ]);
5252 - }();
2307 + /**
2308 + * Function set().
2309 + *
2310 + * set data to cache.
2311 + *
2312 + * The difference between set() and update() is that set, will modify the data anyway...
2313 + * when update() will only modify exist objects/values.
2314 + *
2315 + * @param {RequestData} requestData
2316 + * @param {*} data
2317 + */
2318 + }, {
2319 + key: "set",
2320 + value: function set(requestData, data) {
2321 + $e.data.validateRequestData(requestData);
2322 + var componentName = requestData.component.getNamespace(),
2323 + pureEndpoint = requestData.endpoint.replace(componentName + '/', ''),
2324 + pureEndpointParts = pureEndpoint.split('/');
2325 + var newData = {};
5253 2326
5254 -//#endregion
5255 -//#region modules/web-cli/assets/js/core/store.js
5256 - function ownKeys(e, r) {
5257 - var t = Object.keys(e);
5258 - if (Object.getOwnPropertySymbols) {
5259 - var o = Object.getOwnPropertySymbols(e);
5260 - r && (o = o.filter(function(r) {
5261 - return Object.getOwnPropertyDescriptor(e, r).enumerable;
5262 - })), t.push.apply(t, o);
5263 - }
5264 - return t;
5265 - }
5266 - function _objectSpread(e) {
5267 - for (var r = 1; r < arguments.length; r++) {
5268 - var t = null != arguments[r] ? arguments[r] : {};
5269 - r % 2 ? ownKeys(Object(t), !0).forEach(function(r) {
5270 - _defineProperty(e, r, t[r]);
5271 - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r) {
5272 - Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
5273 - });
5274 - }
5275 - return e;
5276 - }
5277 - /**
5278 - * @typedef {Promise.resolve(elementorVendors.reduxToolkit).Slice} Slice
5279 - */
5280 - /**
5281 - * @typedef {Promise.resolve(elementorVendors.reduxToolkit).EnhancedStore} EnhancedStore
5282 - */
5283 - /**
5284 - * @typedef {Promise.resolve(elementorVendors.reduxToolkit).AnyAction} AnyAction
5285 - */
5286 - /**
5287 - * @typedef {Promise.resolve(elementorVendors.reduxToolkit).ThunkMiddlewareFor} ThunkMiddlewareFor
5288 - */
5289 - var Store = /*#__PURE__*/ function() {
5290 - /**
5291 - * Initialize the Store.
5292 - *
5293 - * @return {void}
5294 - */
5295 - function Store() {
5296 - _classCallCheck(this, Store);
5297 - /**
5298 - * @type {Object}
5299 - */
5300 - _defineProperty(this, "slices", {});
5301 - /**
5302 - * @type {EnhancedStore<{}, AnyAction, [ThunkMiddlewareFor<{}>]>}
5303 - */
5304 - _defineProperty(this, "reduxStore", void 0);
5305 - this.slices = {};
5306 - this.reduxStore = this.createStore();
5307 - }
5308 - /**
5309 - * Create a Redux Store object.
5310 - *
5311 - * @return {EnhancedStore<{}, AnyAction, [ThunkMiddlewareFor<{}>]>} store
5312 - */
5313 - return _createClass(Store, [
5314 - {
5315 - key: "createStore",
5316 - value: function createStore() {
5317 - return (0, _reduxjs_toolkit.configureStore)({ reducer: function reducer() {} });
5318 - }
5319 - },
5320 - {
5321 - key: "injectReducer",
5322 - value: function injectReducer(id, newReducer) {
5323 - var prevReducers = this.getReducers();
5324 - this.reduxStore.replaceReducer((0, _reduxjs_toolkit.combineReducers)(_objectSpread(_objectSpread({}, prevReducers), {}, _defineProperty({}, id, newReducer))));
5325 - }
5326 - },
5327 - {
5328 - key: "register",
5329 - value: function register(sliceId, instance) {
5330 - if (this.slices[sliceId]) throw "Slice with ID '".concat(sliceId, "' already exists.");
5331 - this.slices[sliceId] = instance;
5332 - this.injectReducer(sliceId, instance.reducer);
5333 - }
5334 - },
5335 - {
5336 - key: "get",
5337 - value: function get(sliceId) {
5338 - return this.slices[sliceId];
5339 - }
5340 - },
5341 - {
5342 - key: "getAllSlices",
5343 - value: function getAllSlices() {
5344 - return this.slices;
5345 - }
5346 - },
5347 - {
5348 - key: "getAll",
5349 - value: function getAll() {
5350 - return Object.keys(this.slices).sort();
5351 - }
5352 - },
5353 - {
5354 - key: "getReducers",
5355 - value: function getReducers() {
5356 - return Object.entries(this.slices).reduce(function(reducers, _ref) {
5357 - var _ref2 = _slicedToArray(_ref, 2);
5358 - var key = _ref2[0];
5359 - var slice = _ref2[1];
5360 - return _objectSpread(_objectSpread({}, reducers), {}, _defineProperty({}, key, slice.reducer));
5361 - }, {});
5362 - }
5363 - },
5364 - {
5365 - key: "getReduxStore",
5366 - value: function getReduxStore() {
5367 - return this.reduxStore;
5368 - }
5369 - },
5370 - {
5371 - key: "dispatch",
5372 - value: function dispatch() {
5373 - var _this$reduxStore;
5374 - return (_this$reduxStore = this.reduxStore).dispatch.apply(_this$reduxStore, arguments);
5375 - }
5376 - },
5377 - {
5378 - key: "getState",
5379 - value: function getState() {
5380 - var sliceId = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null;
5381 - var state = this.reduxStore.getState();
5382 - return sliceId ? state[sliceId] : state;
5383 - }
5384 - },
5385 - {
5386 - key: "replaceReducer",
5387 - value: function replaceReducer() {
5388 - var _this$reduxStore2;
5389 - return (_this$reduxStore2 = this.reduxStore).replaceReducer.apply(_this$reduxStore2, arguments);
5390 - }
5391 - },
5392 - {
5393 - key: "subscribe",
5394 - value: function subscribe() {
5395 - var _this$reduxStore3;
5396 - return (_this$reduxStore3 = this.reduxStore).subscribe.apply(_this$reduxStore3, arguments);
5397 - }
5398 - }
5399 - ]);
5400 - }();
2327 + // Example of working with reaming endpoint part(s) can be found at 'cache.spec.js' test: 'load(): deep'.
2328 + // Analyze reaming endpoint.
2329 + if (pureEndpointParts.length && pureEndpoint !== componentName) {
2330 + // Using reaming endpoint parts, to build new data object.
2331 + var result = pureEndpointParts.reduce(function (accumulator, pureEndpointPart) {
2332 + accumulator[pureEndpointPart] = {};
2333 + return accumulator[pureEndpointPart];
2334 + }, newData);
5401 2335
5402 -//#endregion
5403 -//#region modules/web-cli/assets/js/core/ui-states.js
2336 + // 'result' is equal to 'newData' with a deeper pointer, build based on 'pureEndpointParts' ( will effect newData ).
2337 + Object.assign(result, data);
2338 + } else {
2339 + newData = data;
2340 + }
2341 + var oldData = this.storage.getItem(componentName);
2342 +
2343 + // When have old data, merge it recursively with newData using jQuery.extend().
2344 + if (oldData !== null) {
2345 + newData = jQuery.extend(true, oldData, newData);
2346 + }
2347 + this.storage.setItem(componentName, newData);
2348 + }
2349 +
2350 + /**
2351 + * Function get().
2352 + *
2353 + * Get from exist storage.
2354 + *
2355 + * @param {RequestData} requestData
2356 + *
2357 + * @return {{}} data
2358 + */
2359 + }, {
2360 + key: "get",
2361 + value: function get(requestData) {
2362 + $e.data.validateRequestData(requestData);
2363 + var componentName = requestData.component.getNamespace(),
2364 + componentData = this.storage.getItem(componentName);
2365 + if (componentData !== null) {
2366 + if (componentName === requestData.endpoint) {
2367 + return componentData;
2368 + }
2369 +
2370 + // Example of working with reaming endpoint part(s) can be found at 'cache.spec.js' test: 'get(): complex'.
2371 + // Analyze reaming endpoint (Using reduce over endpoint parts, build the right index).
2372 + var pureEndpoint = requestData.endpoint.replace(requestData.component.getNamespace() + '/', ''),
2373 + pureEndpointParts = pureEndpoint.split('/'),
2374 + // eslint-disable-next-line array-callback-return
2375 + result = pureEndpointParts.reduce(function (accumulator, endpointPart) {
2376 + if (accumulator && accumulator[endpointPart]) {
2377 + return accumulator[endpointPart];
2378 + }
2379 + }, componentData);
2380 +
2381 + // Since $e.data.cache.receive will reject only if null is the result.
2382 + return result || null;
2383 + }
2384 + return null;
2385 + }
2386 +
2387 + /**
2388 + * Function update().
2389 + *
2390 + * Update only already exist storage, runs over all storage
2391 + *
2392 + * @param {RequestData} requestData
2393 + *
2394 + * @return {boolean} is updated
2395 + */
2396 + }, {
2397 + key: "update",
2398 + value: function update(requestData) {
2399 + $e.data.validateRequestData(requestData, true);
2400 + var endpoint = requestData.endpoint;
2401 + var response = {};
2402 +
2403 + // Simulate response from cache.
2404 + Object.entries(this.storage.getAll()).forEach(function (_ref) {
2405 + var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
2406 + endpointKey = _ref2[0],
2407 + /* String*/endpointValue = _ref2[1];
2408 + if (endpointValue && endpoint.includes(endpointKey)) {
2409 + // Assuming it is a specific endpoint.
2410 + var oldData = endpointValue,
2411 + pureEndpoint = requestData.endpoint.replace(requestData.component.getNamespace() + '/', ''),
2412 + pureEndpointParts = pureEndpoint.split('/'),
2413 + isComponentUpdate = 1 === pureEndpointParts.length && endpointKey === requestData.endpoint && endpointKey === requestData.component.getNamespace();
2414 +
2415 + // Component update or specific update?
2416 + if (isComponentUpdate) {
2417 + response = jQuery.extend(true, oldData, requestData.args.data);
2418 + } else {
2419 + var oldSpecificData = pureEndpointParts.reduce(function (accumulator, pureEndpointPart) {
2420 + return accumulator[pureEndpointPart];
2421 + }, oldData);
2422 + response = jQuery.extend(true, oldSpecificData, requestData.args.data);
2423 + }
2424 + }
2425 + });
2426 +
2427 + // If response not found.
2428 + if (0 === Object.values(response).length) {
2429 + return false;
2430 + }
2431 +
2432 + // Update cache.
2433 + this.set(requestData, response);
2434 + return true;
2435 + }
2436 +
2437 + /**
2438 + * Function delete().
2439 + *
2440 + * Delete endpoint from storage.
2441 + *
2442 + * @param {RequestData} requestData
2443 + *
2444 + * @return {boolean} is deleted
2445 + */
2446 + }, {
2447 + key: "delete",
2448 + value: function _delete(requestData) {
2449 + $e.data.validateRequestData(requestData);
2450 + var result = false;
2451 + var componentName = requestData.component.getNamespace();
2452 + if (componentName !== requestData.endpoint) {
2453 + var oldData = this.storage.getItem(componentName),
2454 + newData = {};
2455 + if (null === oldData) {
2456 + return false;
2457 + }
2458 + var pureEndpoint = requestData.endpoint.replace(componentName + '/', ''),
2459 + pureEndpointParts = pureEndpoint.split('/'),
2460 + lastEndpointPart = pureEndpointParts[pureEndpointParts.length - 1];
2461 + pureEndpointParts.reduce(function (accumulator, pureEndpointPart) {
2462 + if (pureEndpointPart === lastEndpointPart) {
2463 + // Null, means delete.
2464 + accumulator[pureEndpointPart] = null;
2465 + } else {
2466 + accumulator[pureEndpointPart] = {};
2467 + }
2468 + return accumulator[pureEndpointPart];
2469 + }, newData);
2470 + if (Object.keys(oldData).length) {
2471 + var _deleteKeys = function deleteKeys(target, nullsObject) {
2472 + if (nullsObject) {
2473 + Object.keys(nullsObject).forEach(function (key) {
2474 + if (nullsObject[key] && 'object' === (0, _typeof2.default)(nullsObject[key])) {
2475 + _deleteKeys(target[key], nullsObject[key]);
2476 + } else if (null === nullsObject[key]) {
2477 + delete target[key];
2478 + result = true;
2479 + }
2480 + });
2481 + } else {
2482 + // Means need to clear all the object.
2483 + Object.keys(target).forEach(function (key) {
2484 + return delete target[key];
2485 + });
2486 + }
2487 + return target;
2488 + };
2489 + this.storage.setItem(componentName, _deleteKeys(oldData, newData));
2490 + }
2491 + } else {
2492 + for (var key in this.storage.getAll()) {
2493 + if (key === requestData.endpoint) {
2494 + this.storage.removeItem(requestData.endpoint);
2495 + result = true;
2496 + break;
2497 + }
2498 + }
2499 + }
2500 + return result;
2501 + }
2502 + }]);
2503 +}();
2504 +
2505 +/***/ }),
2506 +
2507 +/***/ "../modules/web-cli/assets/js/core/data/errors/base-error.js":
2508 +/*!*******************************************************************!*\
2509 + !*** ../modules/web-cli/assets/js/core/data/errors/base-error.js ***!
2510 + \*******************************************************************/
2511 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2512 +
2513 +"use strict";
2514 +
2515 +
2516 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2517 +Object.defineProperty(exports, "__esModule", ({
2518 + value: true
2519 +}));
2520 +exports["default"] = void 0;
2521 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
2522 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
2523 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
2524 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
2525 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
2526 +var _wrapNativeSuper2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ "../node_modules/@babel/runtime/helpers/wrapNativeSuper.js"));
2527 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
2528 +var _console = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/console */ "../modules/web-cli/assets/js/utils/console.js"));
2529 +var _forceMethodImplementation = _interopRequireDefault(__webpack_require__(/*! ../../../utils/force-method-implementation */ "../modules/web-cli/assets/js/utils/force-method-implementation.js"));
2530 +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; }
2531 +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; }
2532 +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)); }
2533 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
2534 +var BaseError = exports["default"] = /*#__PURE__*/function (_Error) {
2535 + /**
2536 + * Error constructor.
2537 + *
2538 + * @param {string} message
2539 + * @param {string} code
2540 + * @param {*} data
2541 + */
2542 + function BaseError() {
2543 + var _this;
2544 + var message = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
2545 + var code = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
2546 + var data = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
2547 + (0, _classCallCheck2.default)(this, BaseError);
2548 + _this = _callSuper(this, BaseError, [message]);
2549 + /**
2550 + * The server error code.
2551 + *
2552 + * @type {string}
2553 + */
2554 + (0, _defineProperty2.default)(_this, "code", '');
2555 + /**
2556 + * Additional data about the current error.
2557 + *
2558 + * @type {*[]}
2559 + */
2560 + (0, _defineProperty2.default)(_this, "data", []);
2561 + _this.code = code;
2562 + _this.data = data;
2563 + return _this;
2564 + }
2565 +
2566 + /**
2567 + * Notify a message when the error occurs.
2568 + */
2569 + (0, _inherits2.default)(BaseError, _Error);
2570 + return (0, _createClass2.default)(BaseError, [{
2571 + key: "notify",
2572 + value: function notify() {
2573 + _console.default.error(_objectSpread({
2574 + message: this.message
2575 + }, this));
2576 + }
2577 + }], [{
2578 + key: "create",
2579 + value:
2580 + /**
2581 + * Static helper function to create the error.
2582 + *
2583 + * @param {string} message
2584 + * @param {string} code
2585 + * @param {*} data
2586 + * @return {BaseError} error
2587 + */
2588 + function create(message) {
2589 + var code = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
2590 + var data = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
2591 + return new this(message, code, data);
2592 + }
2593 +
2594 + /**
2595 + * Returns the status code of the error.
2596 + */
2597 + }, {
2598 + key: "getHTTPErrorCode",
2599 + value: function getHTTPErrorCode() {
2600 + (0, _forceMethodImplementation.default)();
2601 + }
2602 + }]);
2603 +}(/*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
2604 +
2605 +/***/ }),
2606 +
2607 +/***/ "../modules/web-cli/assets/js/core/data/errors/default-error.js":
2608 +/*!**********************************************************************!*\
2609 + !*** ../modules/web-cli/assets/js/core/data/errors/default-error.js ***!
2610 + \**********************************************************************/
2611 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2612 +
2613 +"use strict";
2614 +
2615 +
2616 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2617 +Object.defineProperty(exports, "__esModule", ({
2618 + value: true
2619 +}));
2620 +exports["default"] = exports.DefaultError = void 0;
2621 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
2622 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
2623 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
2624 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
2625 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
2626 +var _baseError = _interopRequireDefault(__webpack_require__(/*! ./base-error */ "../modules/web-cli/assets/js/core/data/errors/base-error.js"));
2627 +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)); }
2628 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
2629 +var DefaultError = exports.DefaultError = /*#__PURE__*/function (_BaseError) {
2630 + function DefaultError() {
2631 + (0, _classCallCheck2.default)(this, DefaultError);
2632 + return _callSuper(this, DefaultError, arguments);
2633 + }
2634 + (0, _inherits2.default)(DefaultError, _BaseError);
2635 + return (0, _createClass2.default)(DefaultError, null, [{
2636 + key: "getHTTPErrorCode",
2637 + value: function getHTTPErrorCode() {
2638 + return 501;
2639 + }
2640 + }]);
2641 +}(_baseError.default);
2642 +var _default = exports["default"] = DefaultError;
2643 +
2644 +/***/ }),
2645 +
2646 +/***/ "../modules/web-cli/assets/js/core/data/errors/error-404.js":
2647 +/*!******************************************************************!*\
2648 + !*** ../modules/web-cli/assets/js/core/data/errors/error-404.js ***!
2649 + \******************************************************************/
2650 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2651 +
2652 +"use strict";
2653 +
2654 +
2655 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2656 +Object.defineProperty(exports, "__esModule", ({
2657 + value: true
2658 +}));
2659 +exports["default"] = exports.Error404 = void 0;
2660 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
2661 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
2662 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
2663 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
2664 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
2665 +var _baseError = _interopRequireDefault(__webpack_require__(/*! ./base-error */ "../modules/web-cli/assets/js/core/data/errors/base-error.js"));
2666 +var _console = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/console */ "../modules/web-cli/assets/js/utils/console.js"));
2667 +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)); }
2668 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
2669 +var Error404 = exports.Error404 = /*#__PURE__*/function (_BaseError) {
2670 + function Error404() {
2671 + (0, _classCallCheck2.default)(this, Error404);
2672 + return _callSuper(this, Error404, arguments);
2673 + }
2674 + (0, _inherits2.default)(Error404, _BaseError);
2675 + return (0, _createClass2.default)(Error404, [{
2676 + key: "notify",
2677 + value: function notify() {
2678 + _console.default.warn(this.message);
2679 + }
2680 + }], [{
2681 + key: "getHTTPErrorCode",
2682 + value: function getHTTPErrorCode() {
2683 + return 404;
2684 + }
2685 + }]);
2686 +}(_baseError.default);
2687 +var _default = exports["default"] = Error404;
2688 +
2689 +/***/ }),
2690 +
2691 +/***/ "../modules/web-cli/assets/js/core/data/errors/index.js":
2692 +/*!**************************************************************!*\
2693 + !*** ../modules/web-cli/assets/js/core/data/errors/index.js ***!
2694 + \**************************************************************/
2695 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2696 +
2697 +"use strict";
2698 +
2699 +
2700 +Object.defineProperty(exports, "__esModule", ({
2701 + value: true
2702 +}));
2703 +Object.defineProperty(exports, "DefaultError", ({
2704 + enumerable: true,
2705 + get: function get() {
2706 + return _defaultError.DefaultError;
2707 + }
2708 +}));
2709 +Object.defineProperty(exports, "Error404", ({
2710 + enumerable: true,
2711 + get: function get() {
2712 + return _error.Error404;
2713 + }
2714 +}));
2715 +var _defaultError = __webpack_require__(/*! ./default-error */ "../modules/web-cli/assets/js/core/data/errors/default-error.js");
2716 +var _error = __webpack_require__(/*! ./error-404 */ "../modules/web-cli/assets/js/core/data/errors/error-404.js");
2717 +
2718 +/***/ }),
2719 +
2720 +/***/ "../modules/web-cli/assets/js/core/data/storages/base-prefix-storage.js":
2721 +/*!******************************************************************************!*\
2722 + !*** ../modules/web-cli/assets/js/core/data/storages/base-prefix-storage.js ***!
2723 + \******************************************************************************/
2724 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2725 +
2726 +"use strict";
2727 +
2728 +
2729 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2730 +Object.defineProperty(exports, "__esModule", ({
2731 + value: true
2732 +}));
2733 +exports["default"] = void 0;
2734 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
2735 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
2736 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
2737 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
2738 +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js"));
2739 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
2740 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
2741 +var _baseStorage = _interopRequireDefault(__webpack_require__(/*! elementor-api/core/data/storages/base-storage */ "../modules/web-cli/assets/js/core/data/storages/base-storage.js"));
2742 +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)); }
2743 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
2744 +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; }
2745 +var BasePrefixStorage = exports["default"] = /*#__PURE__*/function (_BaseStorage) {
2746 + function BasePrefixStorage() {
2747 + (0, _classCallCheck2.default)(this, BasePrefixStorage);
2748 + return _callSuper(this, BasePrefixStorage, arguments);
2749 + }
2750 + (0, _inherits2.default)(BasePrefixStorage, _BaseStorage);
2751 + return (0, _createClass2.default)(BasePrefixStorage, [{
2752 + key: "clear",
2753 + value: function clear() {
2754 + var _this = this;
2755 + Object.keys(this.getAll()).forEach(function (key) {
2756 + return _this.removeItem(key);
2757 + });
2758 + }
2759 + }, {
2760 + key: "getItem",
2761 + value: function getItem(key) {
2762 + return _superPropGet(BasePrefixStorage, "getItem", this, 3)([BasePrefixStorage.DEFAULT_KEY_PREFIX + key]);
2763 + }
2764 + }, {
2765 + key: "removeItem",
2766 + value: function removeItem(key) {
2767 + return _superPropGet(BasePrefixStorage, "removeItem", this, 3)([BasePrefixStorage.DEFAULT_KEY_PREFIX + key]);
2768 + }
2769 + }, {
2770 + key: "setItem",
2771 + value: function setItem(key, value) {
2772 + return _superPropGet(BasePrefixStorage, "setItem", this, 3)([BasePrefixStorage.DEFAULT_KEY_PREFIX + key, value]);
2773 + }
2774 + }, {
2775 + key: "getAll",
2776 + value: function getAll() {
2777 + var _this2 = this;
2778 + var DEFAULT_KEY_PREFIX = BasePrefixStorage.DEFAULT_KEY_PREFIX,
2779 + keys = Object.keys(this.provider),
2780 + result = {};
2781 + keys.forEach(function (key) {
2782 + if (key.startsWith(DEFAULT_KEY_PREFIX)) {
2783 + key = key.replace(DEFAULT_KEY_PREFIX, '');
2784 + result[key] = _this2.getItem(key);
2785 + }
2786 + });
2787 + return result;
2788 + }
2789 + }]);
2790 +}(_baseStorage.default);
2791 +(0, _defineProperty2.default)(BasePrefixStorage, "DEFAULT_KEY_PREFIX", 'e_');
2792 +
2793 +/***/ }),
2794 +
2795 +/***/ "../modules/web-cli/assets/js/core/data/storages/base-storage.js":
2796 +/*!***********************************************************************!*\
2797 + !*** ../modules/web-cli/assets/js/core/data/storages/base-storage.js ***!
2798 + \***********************************************************************/
2799 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2800 +
2801 +"use strict";
2802 +
2803 +
2804 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2805 +Object.defineProperty(exports, "__esModule", ({
2806 + value: true
2807 +}));
2808 +exports["default"] = void 0;
2809 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
2810 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
5404 2811 /**
5405 - * @typedef {import('./states/ui-state-base')} UiStateBase
5406 - */
5407 - var UiStates = /*#__PURE__*/ function() {
5408 - /**
5409 - * Initialize the State Manager.
5410 - *
5411 - * @return {void}
5412 - */
5413 - function UiStates() {
5414 - _classCallCheck(this, UiStates);
5415 - this.states = {};
5416 - }
5417 - /**
5418 - * Register a new state.
5419 - *
5420 - * @param {UiStateBase} instance - State instance.
5421 - */
5422 - return _createClass(UiStates, [
5423 - {
5424 - key: "register",
5425 - value: function register(instance) {
5426 - var stateId = instance.getPrefixedId();
5427 - if (this.states[stateId]) throw "State '".concat(stateId, "' already exists.");
5428 - this.states[stateId] = instance;
5429 - }
5430 - },
5431 - {
5432 - key: "getAll",
5433 - value: function getAll() {
5434 - var states = {};
5435 - Object.entries(this.states).forEach(function(_ref) {
5436 - var _ref2 = _slicedToArray(_ref, 2);
5437 - var id = _ref2[0];
5438 - var options = _ref2[1].getOptions();
5439 - states[id] = Object.keys(options);
5440 - });
5441 - return states;
5442 - }
5443 - },
5444 - {
5445 - key: "get",
5446 - value: function get(state) {
5447 - if (state) return this.states[state];
5448 - return this.states;
5449 - }
5450 - },
5451 - {
5452 - key: "set",
5453 - value: function set(state, value) {
5454 - if (!this.get(state)) throw "State '".concat(state, "' doesn't exist.");
5455 - var oldValue = this.getCurrent(state);
5456 - var classPrefix = "e-ui-state--".concat(state.replaceAll("/", "-"));
5457 - var oldStateClass = "".concat(classPrefix, "__").concat(oldValue);
5458 - var newStateClass = "".concat(classPrefix, "__").concat(value);
5459 - var scopes = this.get(state).getScopes();
5460 - this.get(state).set(value);
5461 - scopes.forEach(function(scope) {
5462 - scope.classList.remove(oldStateClass);
5463 - if (value) scope.classList.add(newStateClass);
5464 - var event = new CustomEvent("e-ui-state:".concat(state), { detail: {
5465 - oldValue,
5466 - newValue: value
5467 - } });
5468 - scope.dispatchEvent(event);
5469 - });
5470 - }
5471 - },
5472 - {
5473 - key: "remove",
5474 - value: function remove(state) {
5475 - this.set(state, "");
5476 - }
5477 - },
5478 - {
5479 - key: "getCurrent",
5480 - value: function getCurrent(state) {
5481 - var _this$get;
5482 - return (_this$get = this.get(state)) === null || _this$get === void 0 ? void 0 : _this$get.getCurrent();
5483 - }
5484 - }
5485 - ]);
5486 - }();
2812 + * TODO: Merge all storage's to one.
2813 + * Using this technique give's the ability to use JSDOC from 'window.storage'.
2814 + *
2815 + * @implements {Storage}
2816 + */
2817 +var BaseStorage = exports["default"] = /*#__PURE__*/function () {
2818 + /**
2819 + * Create storage wrapper.
2820 + *
2821 + * @param {Storage} provider
2822 + */
2823 + function BaseStorage(provider) {
2824 + (0, _classCallCheck2.default)(this, BaseStorage);
2825 + if (BaseStorage === (this instanceof BaseStorage ? this.constructor : void 0)) {
2826 + throw new TypeError('Cannot construct BaseStorage instances directly');
2827 + }
2828 + this.provider = provider;
2829 + }
2830 + return (0, _createClass2.default)(BaseStorage, [{
2831 + key: "clear",
2832 + value: function clear() {
2833 + return this.provider.clear();
2834 + }
2835 + }, {
2836 + key: "getItem",
2837 + value: function getItem(key) {
2838 + var result = this.provider.getItem(key);
2839 + if (null !== result) {
2840 + return JSON.parse(result);
2841 + }
2842 + return result;
2843 + }
2844 + }, {
2845 + key: "key",
2846 + value: function key(index) {
2847 + return this.provider.key(index);
2848 + }
2849 + }, {
2850 + key: "removeItem",
2851 + value: function removeItem(key) {
2852 + return this.provider.removeItem(key);
2853 + }
2854 + }, {
2855 + key: "setItem",
2856 + value: function setItem(key, value) {
2857 + return this.provider.setItem(key, JSON.stringify(value));
2858 + }
2859 + }, {
2860 + key: "getAll",
2861 + value: function getAll() {
2862 + var _this = this;
2863 + var keys = Object.keys(this.provider),
2864 + result = {};
2865 + keys.forEach(function (key) {
2866 + result[key] = _this.getItem(key);
2867 + });
2868 + return result;
2869 + }
2870 + }]);
2871 +}();
5487 2872
5488 -//#endregion
5489 -//#region modules/web-cli/assets/js/modules/hook-base.js
5490 - var HookBase = /*#__PURE__*/ function() {
5491 - /**
5492 - * Function constructor().
5493 - *
5494 - * Create callback base.
5495 - */
5496 - function HookBase() {
5497 - _classCallCheck(this, HookBase);
5498 - /**
5499 - * Callback type, eg ( hook, event ).
5500 - *
5501 - * @type {string}
5502 - */
5503 - _defineProperty(this, "type", void 0);
5504 - /**
5505 - * Full command address, that will hook the callback.
5506 - *
5507 - * @type {string}
5508 - */
5509 - _defineProperty(this, "command", void 0);
5510 - /**
5511 - * Unique id of the callback.
5512 - *
5513 - * @type {string}
5514 - */
5515 - _defineProperty(this, "id", void 0);
5516 - this.initialize();
5517 - this.type = this.getType();
5518 - this.command = this.getCommand();
5519 - this.id = this.getId();
5520 - }
5521 - /**
5522 - * Function initialize().
5523 - *
5524 - * Called after creation of the base, used for initialize extras.
5525 - * Without expending constructor.
5526 - */
5527 - return _createClass(HookBase, [
5528 - {
5529 - key: "initialize",
5530 - value: function initialize() {}
5531 - },
5532 - {
5533 - key: "register",
5534 - value: function register() {
5535 - force_method_implementation_default();
5536 - }
5537 - },
5538 - {
5539 - key: "getType",
5540 - value: function getType() {
5541 - force_method_implementation_default();
5542 - }
5543 - },
5544 - {
5545 - key: "getCommand",
5546 - value: function getCommand() {
5547 - force_method_implementation_default();
5548 - }
5549 - },
5550 - {
5551 - key: "getId",
5552 - value: function getId() {
5553 - force_method_implementation_default();
5554 - }
5555 - },
5556 - {
5557 - key: "getContainerType",
5558 - value: function getContainerType() {}
5559 - },
5560 - {
5561 - key: "getConditions",
5562 - value: function getConditions() {
5563 - arguments.length > 0 && arguments[0] !== void 0 && arguments[0];
5564 - arguments.length > 1 && arguments[1];
5565 - return true;
5566 - }
5567 - },
5568 - {
5569 - key: "apply",
5570 - value: function apply(args) {
5571 - force_method_implementation_default();
5572 - }
5573 - },
5574 - {
5575 - key: "run",
5576 - value: function run() {
5577 - var _ref$options = (arguments.length <= 0 ? void 0 : arguments[0]).options;
5578 - var options = _ref$options === void 0 ? {} : _ref$options;
5579 - if (options.callbacks && false === options.callbacks[this.id]) return true;
5580 - if (this.getConditions.apply(this, arguments)) {
5581 - if ($e.devTools) $e.devTools.log.callbacks().active(this.type, this.command, this.id);
5582 - return this.apply.apply(this, arguments);
5583 - }
5584 - return true;
5585 - }
5586 - }
5587 - ]);
5588 - }();
2873 +/***/ }),
5589 2874
5590 -//#endregion
5591 -//#region modules/web-cli/assets/js/modules/hooks/data/base.js
5592 - function _callSuper$7(t, o, e) {
5593 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$7() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
5594 - }
5595 - __name(_callSuper$7, "_callSuper");
5596 - function _isNativeReflectConstruct$7() {
5597 - try {
5598 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
5599 - } catch (t) {}
5600 - return (_isNativeReflectConstruct$7 = function _isNativeReflectConstruct() {
5601 - return !!t;
5602 - })();
5603 - }
5604 - __name(_isNativeReflectConstruct$7, "_isNativeReflectConstruct");
5605 - var Base$1 = /*#__PURE__*/ function(_HookBase) {
5606 - function Base() {
5607 - _classCallCheck(this, Base);
5608 - return _callSuper$7(this, Base, arguments);
5609 - }
5610 - _inherits(Base, _HookBase);
5611 - return _createClass(Base, [{
5612 - key: "getType",
5613 - value: function getType() {
5614 - return "data";
5615 - }
5616 - }]);
5617 - }(HookBase);
2875 +/***/ "../modules/web-cli/assets/js/core/data/storages/local-storage.js":
2876 +/*!************************************************************************!*\
2877 + !*** ../modules/web-cli/assets/js/core/data/storages/local-storage.js ***!
2878 + \************************************************************************/
2879 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5618 2880
5619 -//#endregion
5620 -//#region modules/web-cli/assets/js/modules/hooks/data/after.js
5621 - function _callSuper$6(t, o, e) {
5622 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$6() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
5623 - }
5624 - __name(_callSuper$6, "_callSuper");
5625 - function _isNativeReflectConstruct$6() {
5626 - try {
5627 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
5628 - } catch (t) {}
5629 - return (_isNativeReflectConstruct$6 = function _isNativeReflectConstruct() {
5630 - return !!t;
5631 - })();
5632 - }
5633 - __name(_isNativeReflectConstruct$6, "_isNativeReflectConstruct");
5634 - var After$1 = /*#__PURE__*/ function(_Base) {
5635 - function After() {
5636 - _classCallCheck(this, After);
5637 - return _callSuper$6(this, After, arguments);
5638 - }
5639 - _inherits(After, _Base);
5640 - return _createClass(After, [{
5641 - key: "register",
5642 - value: function register() {
5643 - $e.hooks.registerDataAfter(this);
5644 - }
5645 - }]);
5646 - }(Base$1);
2881 +"use strict";
5647 2882
5648 -//#endregion
5649 -//#region modules/web-cli/assets/js/modules/hooks/data/catch.js
5650 - function _callSuper$5(t, o, e) {
5651 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$5() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
5652 - }
5653 - __name(_callSuper$5, "_callSuper");
5654 - function _isNativeReflectConstruct$5() {
5655 - try {
5656 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
5657 - } catch (t) {}
5658 - return (_isNativeReflectConstruct$5 = function _isNativeReflectConstruct() {
5659 - return !!t;
5660 - })();
5661 - }
5662 - __name(_isNativeReflectConstruct$5, "_isNativeReflectConstruct");
5663 - var Catch$1 = /*#__PURE__*/ function(_Base) {
5664 - function Catch() {
5665 - _classCallCheck(this, Catch);
5666 - return _callSuper$5(this, Catch, arguments);
5667 - }
5668 - _inherits(Catch, _Base);
5669 - return _createClass(Catch, [{
5670 - key: "register",
5671 - value: function register() {
5672 - $e.hooks.registerDataCatch(this);
5673 - }
5674 - }]);
5675 - }(Base$1);
5676 2883
5677 -//#endregion
5678 -//#region modules/web-cli/assets/js/modules/hooks/data/dependency.js
5679 - function _callSuper$4(t, o, e) {
5680 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$4() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
5681 - }
5682 - __name(_callSuper$4, "_callSuper");
5683 - function _isNativeReflectConstruct$4() {
5684 - try {
5685 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
5686 - } catch (t) {}
5687 - return (_isNativeReflectConstruct$4 = function _isNativeReflectConstruct() {
5688 - return !!t;
5689 - })();
5690 - }
5691 - __name(_isNativeReflectConstruct$4, "_isNativeReflectConstruct");
5692 - var Dependency = /*#__PURE__*/ function(_Base) {
5693 - function Dependency() {
5694 - _classCallCheck(this, Dependency);
5695 - return _callSuper$4(this, Dependency, arguments);
5696 - }
5697 - _inherits(Dependency, _Base);
5698 - return _createClass(Dependency, [{
5699 - key: "register",
5700 - value: function register() {
5701 - $e.hooks.registerDataDependency(this);
5702 - }
5703 - }]);
5704 - }(Base$1);
2884 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2885 +Object.defineProperty(exports, "__esModule", ({
2886 + value: true
2887 +}));
2888 +exports["default"] = void 0;
2889 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
2890 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
2891 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
2892 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
2893 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
2894 +var _basePrefixStorage = _interopRequireDefault(__webpack_require__(/*! ./base-prefix-storage */ "../modules/web-cli/assets/js/core/data/storages/base-prefix-storage.js"));
2895 +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)); }
2896 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
2897 +var LocalStorage = exports["default"] = /*#__PURE__*/function (_BasePrefixStorage) {
2898 + function LocalStorage() {
2899 + (0, _classCallCheck2.default)(this, LocalStorage);
2900 + return _callSuper(this, LocalStorage, [localStorage]);
2901 + }
2902 + (0, _inherits2.default)(LocalStorage, _BasePrefixStorage);
2903 + return (0, _createClass2.default)(LocalStorage, [{
2904 + key: "debug",
2905 + value: function debug() {
2906 + var entries = this.getAll(),
2907 + ordered = {};
2908 + Object.keys(entries).sort().forEach(function (key) {
2909 + var value = entries[key];
2910 + ordered[key] = value;
2911 + });
2912 + return ordered;
2913 + }
2914 + }]);
2915 +}(_basePrefixStorage.default);
5705 2916
5706 -//#endregion
5707 -//#region modules/web-cli/assets/js/modules/hooks/data/index.js
5708 - var data_exports = /* @__PURE__ */ __exportAll({
5709 - After: () => After$1,
5710 - Base: () => Base$1,
5711 - Catch: () => Catch$1,
5712 - Dependency: () => Dependency
5713 - });
2917 +/***/ }),
5714 2918
5715 -//#endregion
5716 -//#region modules/web-cli/assets/js/modules/hooks/ui/base.js
5717 - function _callSuper$3(t, o, e) {
5718 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$3() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
5719 - }
5720 - __name(_callSuper$3, "_callSuper");
5721 - function _isNativeReflectConstruct$3() {
5722 - try {
5723 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
5724 - } catch (t) {}
5725 - return (_isNativeReflectConstruct$3 = function _isNativeReflectConstruct() {
5726 - return !!t;
5727 - })();
5728 - }
5729 - __name(_isNativeReflectConstruct$3, "_isNativeReflectConstruct");
5730 - var Base = /*#__PURE__*/ function(_HookBase) {
5731 - function Base() {
5732 - _classCallCheck(this, Base);
5733 - return _callSuper$3(this, Base, arguments);
5734 - }
5735 - _inherits(Base, _HookBase);
5736 - return _createClass(Base, [{
5737 - key: "getType",
5738 - value: function getType() {
5739 - return "ui";
5740 - }
5741 - }]);
5742 - }(HookBase);
2919 +/***/ "../modules/web-cli/assets/js/core/hooks.js":
2920 +/*!**************************************************!*\
2921 + !*** ../modules/web-cli/assets/js/core/hooks.js ***!
2922 + \**************************************************/
2923 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5743 2924
5744 -//#endregion
5745 -//#region modules/web-cli/assets/js/modules/hooks/ui/after.js
5746 - function _callSuper$2(t, o, e) {
5747 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$2() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
5748 - }
5749 - __name(_callSuper$2, "_callSuper");
5750 - function _isNativeReflectConstruct$2() {
5751 - try {
5752 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
5753 - } catch (t) {}
5754 - return (_isNativeReflectConstruct$2 = function _isNativeReflectConstruct() {
5755 - return !!t;
5756 - })();
5757 - }
5758 - __name(_isNativeReflectConstruct$2, "_isNativeReflectConstruct");
5759 - var After = /*#__PURE__*/ function(_Base) {
5760 - function After() {
5761 - _classCallCheck(this, After);
5762 - return _callSuper$2(this, After, arguments);
5763 - }
5764 - _inherits(After, _Base);
5765 - return _createClass(After, [{
5766 - key: "register",
5767 - value: function register() {
5768 - $e.hooks.registerUIAfter(this);
5769 - }
5770 - }]);
5771 - }(Base);
2925 +"use strict";
5772 2926
5773 -//#endregion
5774 -//#region modules/web-cli/assets/js/modules/hooks/ui/before.js
5775 - function _callSuper$1(t, o, e) {
5776 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$1() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
5777 - }
5778 - __name(_callSuper$1, "_callSuper");
5779 - function _isNativeReflectConstruct$1() {
5780 - try {
5781 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
5782 - } catch (t) {}
5783 - return (_isNativeReflectConstruct$1 = function _isNativeReflectConstruct() {
5784 - return !!t;
5785 - })();
5786 - }
5787 - __name(_isNativeReflectConstruct$1, "_isNativeReflectConstruct");
5788 - var Before = /*#__PURE__*/ function(_Base) {
5789 - function Before() {
5790 - _classCallCheck(this, Before);
5791 - return _callSuper$1(this, Before, arguments);
5792 - }
5793 - _inherits(Before, _Base);
5794 - return _createClass(Before, [{
5795 - key: "register",
5796 - value: function register() {
5797 - $e.hooks.registerUIBefore(this);
5798 - }
5799 - }]);
5800 - }(Base);
5801 2927
5802 -//#endregion
5803 -//#region modules/web-cli/assets/js/modules/hooks/ui/catch.js
5804 - function _callSuper(t, o, e) {
5805 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
5806 - }
5807 - function _isNativeReflectConstruct() {
5808 - try {
5809 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
5810 - } catch (t) {}
5811 - return (_isNativeReflectConstruct = function _isNativeReflectConstruct() {
5812 - return !!t;
5813 - })();
5814 - }
5815 - var Catch = /*#__PURE__*/ function(_Base) {
5816 - function Catch() {
5817 - _classCallCheck(this, Catch);
5818 - return _callSuper(this, Catch, arguments);
5819 - }
5820 - _inherits(Catch, _Base);
5821 - return _createClass(Catch, [{
5822 - key: "register",
5823 - value: function register() {
5824 - $e.hooks.registerUICatch(this);
5825 - }
5826 - }]);
5827 - }(Base);
2928 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2929 +Object.defineProperty(exports, "__esModule", ({
2930 + value: true
2931 +}));
2932 +exports["default"] = void 0;
2933 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
2934 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
2935 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
2936 +var _data = _interopRequireDefault(__webpack_require__(/*! ./hooks/data.js */ "../modules/web-cli/assets/js/core/hooks/data.js"));
2937 +var _ui = _interopRequireDefault(__webpack_require__(/*! ./hooks/ui.js */ "../modules/web-cli/assets/js/core/hooks/ui.js"));
2938 +/**
2939 + * @typedef {import('../modules/hook-base')} HookBase
2940 + */
2941 +var Hooks = exports["default"] = /*#__PURE__*/function () {
2942 + function Hooks() {
2943 + (0, _classCallCheck2.default)(this, Hooks);
2944 + (0, _defineProperty2.default)(this, "data", new _data.default());
2945 + (0, _defineProperty2.default)(this, "ui", new _ui.default());
2946 + }
2947 + return (0, _createClass2.default)(Hooks, [{
2948 + key: "activate",
2949 + value:
2950 + /**
2951 + * Function activate().
2952 + *
2953 + * Activate all hooks.
2954 + */
2955 + function activate() {
2956 + this.getTypes().forEach(function (hooksType) {
2957 + hooksType.activate();
2958 + });
2959 + }
5828 2960
5829 -//#endregion
5830 -//#region modules/web-cli/assets/js/modules/hooks/ui/index.js
5831 - var ui_exports = /* @__PURE__ */ __exportAll({
5832 - After: () => After,
5833 - Base: () => Base,
5834 - Before: () => Before,
5835 - Catch: () => Catch
5836 - });
2961 + /**
2962 + * Function deactivate().
2963 + *
2964 + * Deactivate all hooks.
2965 + */
2966 + }, {
2967 + key: "deactivate",
2968 + value: function deactivate() {
2969 + this.getTypes().forEach(function (hooksType) {
2970 + hooksType.deactivate();
2971 + });
2972 + }
2973 + }, {
2974 + key: "getAll",
2975 + value: function getAll() {
2976 + var flat = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
2977 + var result = {};
2978 + this.getTypes().forEach(function (hooksType) {
2979 + result[hooksType.getType()] = hooksType.getAll(flat);
2980 + });
2981 + return result;
2982 + }
2983 + }, {
2984 + key: "getTypes",
2985 + value: function getTypes() {
2986 + return [this.data, this.ui];
2987 + }
2988 + }, {
2989 + key: "getType",
2990 + value: function getType(type) {
2991 + return this.getTypes().find(function (hooks) {
2992 + return type === hooks.getType();
2993 + });
2994 + }
5837 2995
5838 -//#endregion
5839 -//#region modules/web-cli/assets/js/api.js
5840 - var API = /*#__PURE__*/ function() {
5841 - /**
5842 - * Function constructor().
5843 - *
5844 - * Create's 'elementor' api.
5845 - */
5846 - function API() {
5847 - _classCallCheck(this, API);
5848 - this.components = new _default();
5849 - this.commands = new Commands();
5850 - this.commandsInternal = new CommandsInternal();
5851 - this.hooks = new Hooks();
5852 - this.routes = new Routes();
5853 - this.shortcuts = new Shortcuts(jQuery(window));
5854 - this.data = new Data$1();
5855 - this.store = new Store();
5856 - this.uiStates = new UiStates();
5857 - this.modules = {
5858 - CommandBase,
5859 - CommandInternalBase,
5860 - CommandData,
5861 - ComponentBase,
5862 - ComponentModalBase,
5863 - HookBreak,
5864 - hookData: data_exports,
5865 - hookUI: ui_exports
5866 - };
5867 - this.extras = { hashCommands: new HashCommands() };
5868 - this.bc = new BackwardsCompatibility();
5869 - }
5870 - /**
5871 - * Function run().
5872 - *
5873 - * Alias of `$e.commands.run()`.
5874 - *
5875 - * @param {string} command
5876 - * @param {*} [args={}]
5877 - *
5878 - * @return {*} result
5879 - */
5880 - return _createClass(API, [
5881 - {
5882 - key: "run",
5883 - value: function run(command) {
5884 - var args = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
5885 - return $e.commands.run(command, args);
5886 - }
5887 - },
5888 - {
5889 - key: "internal",
5890 - value: function internal(command) {
5891 - var args = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
5892 - return $e.commandsInternal.run(command, args);
5893 - }
5894 - },
5895 - {
5896 - key: "route",
5897 - value: function route(_route) {
5898 - var args = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
5899 - var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : { history: true };
5900 - return $e.routes.to(_route, args, options);
5901 - }
5902 - }
5903 - ]);
5904 - }();
2996 + /**
2997 + * Function register().
2998 + *
2999 + * Register hook.
3000 + *
3001 + * @param {string} type
3002 + * @param {string} event
3003 + * @param {HookBase} instance
3004 + *
3005 + * @return {{}} Created callback
3006 + */
3007 + }, {
3008 + key: "register",
3009 + value: function register(type, event, instance) {
3010 + return this.getType(type).register(event, instance);
3011 + }
5905 3012
5906 -//#endregion
5907 -//#region modules/web-cli/assets/js/index.js
5908 - window.$e = new API();
3013 + /**
3014 + * Function run().
3015 + *
3016 + * Run's a hook.
3017 + *
3018 + * @param {string} type
3019 + * @param {string} event
3020 + * @param {string} command
3021 + * @param {{}} args
3022 + * @param {*} result
3023 + *
3024 + * @return {boolean} result
3025 + */
3026 + }, {
3027 + key: "run",
3028 + value: function run(type, event, command, args) {
3029 + var result = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : undefined;
3030 + return this.getType(type).run(event, command, args, result);
3031 + }
5909 3032
5910 -//#endregion
5911 -})(elementorVendors.reduxToolkit);
3033 + /**
3034 + * Function registerDataAfter().
3035 + *
3036 + * Register data hook that's run after the command.
3037 + *
3038 + * @param {HookBase} instance
3039 + *
3040 + * @return {{}} callback
3041 + */
3042 + }, {
3043 + key: "registerDataAfter",
3044 + value: function registerDataAfter(instance) {
3045 + return this.register('data', 'after', instance);
3046 + }
3047 +
3048 + /**
3049 + * Function registerDataCatch().
3050 + *
3051 + * Register data hook that's run when the command fails.
3052 + *
3053 + * @param {HookBase} instance
3054 + *
3055 + * @return {{}} callback
3056 + */
3057 + }, {
3058 + key: "registerDataCatch",
3059 + value: function registerDataCatch(instance) {
3060 + return this.register('data', 'catch', instance);
3061 + }
3062 +
3063 + /**
3064 + * Function registerDataDependency().
3065 + *
3066 + * Register data hook that's run before the command as dependency.
3067 + *
3068 + * @param {HookBase} instance
3069 + *
3070 + * @return {{}} callback
3071 + */
3072 + }, {
3073 + key: "registerDataDependency",
3074 + value: function registerDataDependency(instance) {
3075 + return this.register('data', 'dependency', instance);
3076 + }
3077 +
3078 + /**
3079 + * Function registerUIAfter().
3080 + *
3081 + * Register UI hook that's run after the commands run.
3082 + *
3083 + * @param {HookBase} instance
3084 + *
3085 + * @return {{}} callback
3086 + */
3087 + }, {
3088 + key: "registerUIAfter",
3089 + value: function registerUIAfter(instance) {
3090 + return this.register('ui', 'after', instance);
3091 + }
3092 +
3093 + /**
3094 + * Function registerUICatch().
3095 + *
3096 + * Register UI hook that's run when the command fails.
3097 + *
3098 + * @param {HookBase} instance
3099 + *
3100 + * @return {{}} callback
3101 + */
3102 + }, {
3103 + key: "registerUICatch",
3104 + value: function registerUICatch(instance) {
3105 + return this.register('ui', 'catch', instance);
3106 + }
3107 +
3108 + /**
3109 + * Function registerUIBefore().
3110 + *
3111 + * Register UI hook that's run before the command.
3112 + *
3113 + * @param {HookBase} instance
3114 + *
3115 + * @return {{}} callback
3116 + */
3117 + }, {
3118 + key: "registerUIBefore",
3119 + value: function registerUIBefore(instance) {
3120 + return this.register('ui', 'before', instance);
3121 + }
3122 +
3123 + /**
3124 + * Function runDataAfter().
3125 + *
3126 + * Run data hook that's run after the command.
3127 + *
3128 + * @param {string} command
3129 + * @param {{}} args
3130 + * @param {*} result
3131 + *
3132 + * @return {boolean} result
3133 + */
3134 + }, {
3135 + key: "runDataAfter",
3136 + value: function runDataAfter(command, args, result) {
3137 + return this.run('data', 'after', command, args, result);
3138 + }
3139 +
3140 + /**
3141 + * Function runDataCatch().
3142 + *
3143 + * Run data hook that's run when the command fails.
3144 + *
3145 + * @param {string} command
3146 + * @param {{}} args
3147 + * @param {*} error
3148 + *
3149 + * @return {boolean} result
3150 + */
3151 + }, {
3152 + key: "runDataCatch",
3153 + value: function runDataCatch(command, args, error) {
3154 + return this.run('data', 'catch', command, args, error);
3155 + }
3156 +
3157 + /**
3158 + * Function runDataDependency().
3159 + *
3160 + * Run data hook that's run before the command as dependency.
3161 + *
3162 + * @param {string} command
3163 + * @param {{}} args
3164 + *
3165 + * @return {boolean} result
3166 + */
3167 + }, {
3168 + key: "runDataDependency",
3169 + value: function runDataDependency(command, args) {
3170 + return this.run('data', 'dependency', command, args);
3171 + }
3172 +
3173 + /**
3174 + * Function runUIAfter().
3175 + *
3176 + * Run UI hook that's run after the commands run.
3177 + *
3178 + * @param {string} command
3179 + * @param {{}} args
3180 + * @param {*} result
3181 + *
3182 + * @return {boolean} result
3183 + */
3184 + }, {
3185 + key: "runUIAfter",
3186 + value: function runUIAfter(command, args, result) {
3187 + return this.run('ui', 'after', command, args, result);
3188 + }
3189 +
3190 + /**
3191 + * Function runUICatch().
3192 + *
3193 + * Run UI hook that's run when the command fails.
3194 + *
3195 + * @param {string} command
3196 + * @param {{}} args
3197 + * @param {*} e
3198 + *
3199 + * @return {boolean} result
3200 + */
3201 + }, {
3202 + key: "runUICatch",
3203 + value: function runUICatch(command, args, e) {
3204 + return this.run('ui', 'catch', command, args, e);
3205 + }
3206 +
3207 + /**
3208 + * Function runUIBefore().
3209 + *
3210 + * Run UI hook that's run before the command.
3211 + *
3212 + * @param {string} command
3213 + * @param {{}} args
3214 + *
3215 + * @return {boolean} result
3216 + */
3217 + }, {
3218 + key: "runUIBefore",
3219 + value: function runUIBefore(command, args) {
3220 + return this.run('ui', 'before', command, args);
3221 + }
3222 + }]);
3223 +}();
3224 +
3225 +/***/ }),
3226 +
3227 +/***/ "../modules/web-cli/assets/js/core/hooks/base.js":
3228 +/*!*******************************************************!*\
3229 + !*** ../modules/web-cli/assets/js/core/hooks/base.js ***!
3230 + \*******************************************************/
3231 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
3232 +
3233 +"use strict";
3234 +
3235 +
3236 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
3237 +Object.defineProperty(exports, "__esModule", ({
3238 + value: true
3239 +}));
3240 +exports["default"] = void 0;
3241 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
3242 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
3243 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
3244 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
3245 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
3246 +var _console = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/console */ "../modules/web-cli/assets/js/utils/console.js"));
3247 +var _module = _interopRequireDefault(__webpack_require__(/*! elementor-assets-js/modules/imports/module.js */ "../assets/dev/js/modules/imports/module.js"));
3248 +var _forceMethodImplementation = _interopRequireDefault(__webpack_require__(/*! ../../utils/force-method-implementation */ "../modules/web-cli/assets/js/utils/force-method-implementation.js"));
3249 +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)); }
3250 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
3251 +/**
3252 + * @typedef {import('../../modules/hook-base')} HookBase
3253 + */
3254 +var HooksBase = exports["default"] = /*#__PURE__*/function (_Module) {
3255 + /**
3256 + * Function constructor().
3257 + *
3258 + * Create hooks base.
3259 + *
3260 + * @param {{}} args
3261 + */
3262 + function HooksBase() {
3263 + var _this;
3264 + (0, _classCallCheck2.default)(this, HooksBase);
3265 + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
3266 + args[_key] = arguments[_key];
3267 + }
3268 + _this = _callSuper(this, HooksBase, [].concat(args));
3269 +
3270 + /**
3271 + * Current command.
3272 + *
3273 + * @type {string}
3274 + */
3275 + _this.current = '';
3276 +
3277 + /**
3278 + * Array of ids which in use.
3279 + *
3280 + * @type {Array}
3281 + */
3282 + _this.usedIds = [];
3283 +
3284 + /**
3285 + * Object of callbacks that was bound by container type.
3286 + *
3287 + * @type {{}}
3288 + */
3289 + _this.callbacks = {
3290 + after: {},
3291 + catch: {}
3292 + };
3293 +
3294 + /**
3295 + * Object of depth.
3296 + *
3297 + * @type {{}}
3298 + */
3299 + _this.depth = {
3300 + after: {},
3301 + catch: {}
3302 + };
3303 + _this.callbacksFlatList = {};
3304 + return _this;
3305 + }
3306 + (0, _inherits2.default)(HooksBase, _Module);
3307 + return (0, _createClass2.default)(HooksBase, [{
3308 + key: "activate",
3309 + value: function activate() {
3310 + Object.values(this.getAll(true)).forEach(function (callback) {
3311 + callback.activate();
3312 + });
3313 + }
3314 + }, {
3315 + key: "deactivate",
3316 + value: function deactivate() {
3317 + Object.values(this.getAll(true)).forEach(function (callback) {
3318 + callback.deactivate();
3319 + });
3320 + }
3321 +
3322 + // eslint-disable-next-line jsdoc/require-returns-check
3323 + /**
3324 + * Function getType().
3325 + *
3326 + * Returns type eg: ( event, hook, etc ... ).
3327 + *
3328 + * @return {string} type
3329 + */
3330 + }, {
3331 + key: "getType",
3332 + value: function getType() {
3333 + (0, _forceMethodImplementation.default)();
3334 + }
3335 + }, {
3336 + key: "get",
3337 + value: function get(id) {
3338 + return this.callbacksFlatList[id];
3339 + }
3340 +
3341 + /**
3342 + * Function getAll().
3343 + *
3344 + * Return all possible callbacks.
3345 + *
3346 + * @param {boolean} flat
3347 + *
3348 + * @return {{}} all callbacks
3349 + */
3350 + }, {
3351 + key: "getAll",
3352 + value: function getAll() {
3353 + var _this2 = this;
3354 + var flat = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
3355 + if (flat) {
3356 + return this.callbacksFlatList;
3357 + }
3358 + var result = {};
3359 + Object.keys(this.callbacks).forEach(function (event) {
3360 + if (!result[event]) {
3361 + result[event] = [];
3362 + }
3363 + Object.keys(_this2.callbacks[event]).forEach(function (command) {
3364 + result[event].push({
3365 + command: command,
3366 + callbacks: _this2.callbacks[event][command]
3367 + });
3368 + });
3369 + });
3370 + return result;
3371 + }
3372 +
3373 + /**
3374 + * Function getCurrent();
3375 + *
3376 + * Return current command.
3377 + *
3378 + * @return {string} current command
3379 + */
3380 + }, {
3381 + key: "getCurrent",
3382 + value: function getCurrent() {
3383 + return this.current;
3384 + }
3385 +
3386 + /**
3387 + * Function getUsedIds().
3388 + *
3389 + * Returns the current used ids.
3390 + *
3391 + * @return {Array} used IDs
3392 + */
3393 + }, {
3394 + key: "getUsedIds",
3395 + value: function getUsedIds() {
3396 + return this.usedIds;
3397 + }
3398 +
3399 + /**
3400 + * Function getCallbacks().
3401 + *
3402 + * Get available callbacks for specific event and command.
3403 + *
3404 + * @param {string} event
3405 + * @param {string} command
3406 + * @param {*} args
3407 + * @return {(Array | boolean)} callbacks
3408 + */
3409 + }, {
3410 + key: "getCallbacks",
3411 + value: function getCallbacks(event, command, args) {
3412 + var _args$containers = args.containers,
3413 + containers = _args$containers === void 0 ? [args.container] : _args$containers,
3414 + containerType = containers[0] ? containers[0].type : false;
3415 + var callbacks = [];
3416 + if (this.callbacks[event] && this.callbacks[event][command]) {
3417 + if (containerType && this.callbacks[event][command][containerType]) {
3418 + callbacks = callbacks.concat(this.callbacks[event][command][containerType]);
3419 + }
3420 + if (this.callbacks[event][command].all) {
3421 + callbacks = callbacks.concat(this.callbacks[event][command].all);
3422 + }
3423 + }
3424 + if (callbacks.length) {
3425 + return callbacks;
3426 + }
3427 + return false;
3428 + }
3429 +
3430 + /**
3431 + * Function checkEvent().
3432 + *
3433 + * Validate if the event is available.
3434 + *
3435 + * @param {string} event
3436 + */
3437 + }, {
3438 + key: "checkEvent",
3439 + value: function checkEvent(event) {
3440 + if (-1 === Object.keys(this.callbacks).indexOf(event)) {
3441 + throw Error("".concat(this.getType(), ": '").concat(event, "' is not available."));
3442 + }
3443 + }
3444 +
3445 + /**
3446 + * Function checkInstance().
3447 + *
3448 + * Validate given instance.
3449 + *
3450 + * @param {HookBase} instance
3451 + */
3452 + }, {
3453 + key: "checkInstance",
3454 + value: function checkInstance(instance) {
3455 + if (instance.getType() !== this.getType()) {
3456 + throw new Error("invalid instance, please use: 'elementor-api/modules/hook-base.js'. ");
3457 + }
3458 + }
3459 +
3460 + /**
3461 + * Function checkId().
3462 + *
3463 + * Validate if the id is not used before.
3464 + *
3465 + * @param {string} id
3466 + */
3467 + }, {
3468 + key: "checkId",
3469 + value: function checkId(id) {
3470 + if (-1 !== this.usedIds.indexOf(id)) {
3471 + throw Error("id: '".concat(id, "' is already in use."));
3472 + }
3473 + }
3474 +
3475 + /**
3476 + * Function shouldRun().
3477 + *
3478 + * Determine if the event should run.
3479 + *
3480 + * @param {Array} callbacks
3481 + *
3482 + * @return {boolean} true if there are callbacks, otherwise false
3483 + *
3484 + * @throws {Error}
3485 + */
3486 + }, {
3487 + key: "shouldRun",
3488 + value: function shouldRun(callbacks) {
3489 + return !!callbacks && callbacks.length;
3490 + }
3491 +
3492 + /**
3493 + * Function register().
3494 + *
3495 + * Register the callback instance.
3496 + *
3497 + * @param {string} event
3498 + * @param {HookBase} instance
3499 + *
3500 + * @return {{}} Created callback
3501 + */
3502 + }, {
3503 + key: "register",
3504 + value: function register(event, instance) {
3505 + var command = instance.getCommand(),
3506 + id = instance.getId(),
3507 + containerType = instance.getContainerType();
3508 + this.checkEvent(event);
3509 + this.checkInstance(instance);
3510 + this.checkId(id);
3511 + return this.registerCallback(id, event, command, instance, containerType);
3512 + }
3513 +
3514 + /**
3515 + * Function registerCallback().
3516 + *
3517 + * Register callback.
3518 + *
3519 + * @param {string} id
3520 + * @param {string} event
3521 + * @param {string} command
3522 + * @param {HookBase} instance
3523 + * @param {string} containerType
3524 + *
3525 + * TODO: Consider replace with typedef.
3526 + * @return {{callback: *, id: *, isActive: boolean}} callback
3527 + */
3528 + }, {
3529 + key: "registerCallback",
3530 + value: function registerCallback(id, event, command, instance, containerType) {
3531 + if (!this.callbacks[event][command]) {
3532 + this.callbacks[event][command] = [];
3533 + }
3534 +
3535 + // Save used id(s).
3536 + this.usedIds.push(id);
3537 + if (!this.callbacks[event][command]) {
3538 + this.callbacks[event][command] = {};
3539 + }
3540 +
3541 + // TODO: Create HookCallback class/type.
3542 + var callback = {
3543 + id: id,
3544 + callback: instance.run.bind(instance),
3545 + isActive: true,
3546 + activate: function activate() {
3547 + this.isActive = true;
3548 + },
3549 + deactivate: function deactivate() {
3550 + this.isActive = false;
3551 + }
3552 + };
3553 + if (containerType) {
3554 + if (!this.callbacks[event][command][containerType]) {
3555 + this.callbacks[event][command][containerType] = [];
3556 + }
3557 + this.callbacks[event][command][containerType].push(callback);
3558 + } else {
3559 + if (!this.callbacks[event][command].all) {
3560 + this.callbacks[event][command].all = [];
3561 + }
3562 + this.callbacks[event][command].all.push(callback);
3563 + }
3564 + this.callbacksFlatList[callback.id] = callback;
3565 + return callback;
3566 + }
3567 +
3568 + /**
3569 + * Function run().
3570 + *
3571 + * Run the callbacks.
3572 + *
3573 + * @param {string} event
3574 + * @param {string} command
3575 + * @param {{}} args
3576 + * @param {*} result
3577 + *
3578 + * @return {*} results
3579 + */
3580 + }, {
3581 + key: "run",
3582 + value: function run(event, command, args) {
3583 + var result = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined;
3584 + var callbacks = this.getCallbacks(event, command, args);
3585 + if (this.shouldRun(callbacks)) {
3586 + this.current = command;
3587 + this.onRun(command, args, event);
3588 + return this.runCallbacks(event, command, callbacks, args, result);
3589 + }
3590 + return false;
3591 + }
3592 +
3593 + /**
3594 + * Function runCallbacks().
3595 + *
3596 + * Run's the given callbacks.
3597 + *
3598 + * @param {string} event
3599 + * @param {string} command
3600 + * @param {Array} callbacks
3601 + * @param {{}} args
3602 + * @param {[]} result
3603 + */
3604 + }, {
3605 + key: "runCallbacks",
3606 + value: function runCallbacks(event, command, callbacks, args, result) {
3607 + var callbacksResult = [];
3608 + for (var i in callbacks) {
3609 + var callback = callbacks[i];
3610 + if (!callback.isActive) {
3611 + continue;
3612 + }
3613 +
3614 + // If not exist, set zero.
3615 + if (undefined === this.depth[event][callback.id]) {
3616 + this.depth[event][callback.id] = 0;
3617 + }
3618 + this.depth[event][callback.id]++;
3619 +
3620 + // Prevent recursive hooks.
3621 + if (1 === this.depth[event][callback.id]) {
3622 + this.onCallback(command, args, event, callback.id);
3623 + try {
3624 + var callbackResult = this.runCallback(event, callback, args, result);
3625 + if (!callbackResult) {
3626 + throw Error("Callback failed, event: '".concat(event, "'"));
3627 + }
3628 + callbacksResult.push(callbackResult);
3629 + } catch (e) {
3630 + // If its 'Hook-Break' then parent `try {}` will handle it.
3631 + if (e instanceof $e.modules.HookBreak) {
3632 + throw e;
3633 + }
3634 + _console.default.error(e);
3635 + }
3636 + }
3637 + this.depth[event][callback.id]--;
3638 + }
3639 + return callbacksResult;
3640 + }
3641 +
3642 + // eslint-disable-next-line jsdoc/require-returns-check
3643 + /**
3644 + * Function runCallback().
3645 + *
3646 + * Run's the given callback.
3647 + *
3648 + * @param {string} event
3649 + * @param {{}} callback
3650 + * @param {{}} args
3651 + * @param {*} result
3652 + *
3653 + * @return {*} results
3654 + *
3655 + * @throws {Error}
3656 + */
3657 + }, {
3658 + key: "runCallback",
3659 + value: function runCallback(event, callback, args, result) {
3660 + // eslint-disable-line no-unused-vars
3661 + (0, _forceMethodImplementation.default)();
3662 + }
3663 +
3664 + /**
3665 + * Function onRun().
3666 + *
3667 + * Called before run a set of callbacks.
3668 + *
3669 + * @param {string} command
3670 + * @param {{}} args
3671 + * @param {string} event
3672 + *
3673 + * @throws {Error}
3674 + */
3675 + }, {
3676 + key: "onRun",
3677 + value: function onRun(command, args, event) {
3678 + // eslint-disable-line no-unused-vars
3679 + (0, _forceMethodImplementation.default)();
3680 + }
3681 +
3682 + /**
3683 + * Function onCallback().
3684 + *
3685 + * Called before a single callback.
3686 + *
3687 + * @param {string} command
3688 + * @param {{}} args
3689 + * @param {string} event
3690 + * @param {string} id
3691 + *
3692 + * @throws {Error}
3693 + */
3694 + }, {
3695 + key: "onCallback",
3696 + value: function onCallback(command, args, event, id) {
3697 + // eslint-disable-line no-unused-vars
3698 + (0, _forceMethodImplementation.default)();
3699 + }
3700 + }]);
3701 +}(_module.default);
3702 +
3703 +/***/ }),
3704 +
3705 +/***/ "../modules/web-cli/assets/js/core/hooks/data.js":
3706 +/*!*******************************************************!*\
3707 + !*** ../modules/web-cli/assets/js/core/hooks/data.js ***!
3708 + \*******************************************************/
3709 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
3710 +
3711 +"use strict";
3712 +
3713 +
3714 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
3715 +Object.defineProperty(exports, "__esModule", ({
3716 + value: true
3717 +}));
3718 +exports["default"] = void 0;
3719 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
3720 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
3721 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
3722 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
3723 +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js"));
3724 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
3725 +var _base = _interopRequireDefault(__webpack_require__(/*! ./base.js */ "../modules/web-cli/assets/js/core/hooks/base.js"));
3726 +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)); }
3727 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
3728 +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; }
3729 +var Data = exports["default"] = /*#__PURE__*/function (_HooksBase) {
3730 + function Data() {
3731 + var _this;
3732 + (0, _classCallCheck2.default)(this, Data);
3733 + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
3734 + args[_key] = arguments[_key];
3735 + }
3736 + _this = _callSuper(this, Data, [].concat(args));
3737 + _this.callbacks.dependency = {};
3738 + _this.depth.dependency = {};
3739 + return _this;
3740 + }
3741 + (0, _inherits2.default)(Data, _HooksBase);
3742 + return (0, _createClass2.default)(Data, [{
3743 + key: "getType",
3744 + value: function getType() {
3745 + return 'data';
3746 + }
3747 + }, {
3748 + key: "runCallback",
3749 + value: function runCallback(event, callback, args, result) {
3750 + switch (event) {
3751 + case 'dependency':
3752 + {
3753 + // If callback returns false and its dependency, then 'Hook-Break'.
3754 + if (!callback.callback(args)) {
3755 + this.depth[event][callback.id]--;
3756 +
3757 + // Throw custom break to be catch by the base for 'Safe' exit.
3758 + throw new $e.modules.HookBreak();
3759 + }
3760 + return true;
3761 + }
3762 + case 'catch':
3763 + case 'after':
3764 + {
3765 + /**
3766 + * When handling HOOK which is data after (not breakable),
3767 + * even the result of the callback is negative, it is required to return positive,
3768 + * since result of runCallback determine if the callback succeeded.
3769 + */
3770 + return callback.callback(args, result) || 'after' === event;
3771 + }
3772 + }
3773 + return false;
3774 + }
3775 + }, {
3776 + key: "shouldRun",
3777 + value: function shouldRun(callbacks) {
3778 + return _superPropGet(Data, "shouldRun", this, 3)([callbacks]) && elementor.documents.getCurrent().history.getActive();
3779 + }
3780 + }, {
3781 + key: "onRun",
3782 + value: function onRun(command, args, event) {
3783 + if (!$e.devTools) {
3784 + return;
3785 + }
3786 + $e.devTools.log.callbacks().run(this.getType(), command, args, event);
3787 + }
3788 + }, {
3789 + key: "onCallback",
3790 + value: function onCallback(command, args, event, id) {
3791 + if (!$e.devTools) {
3792 + return;
3793 + }
3794 + $e.devTools.log.callbacks().callback(this.getType(), command, args, event, id);
3795 + }
3796 + }]);
3797 +}(_base.default);
3798 +
3799 +/***/ }),
3800 +
3801 +/***/ "../modules/web-cli/assets/js/core/hooks/ui.js":
3802 +/*!*****************************************************!*\
3803 + !*** ../modules/web-cli/assets/js/core/hooks/ui.js ***!
3804 + \*****************************************************/
3805 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
3806 +
3807 +"use strict";
3808 +
3809 +
3810 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
3811 +Object.defineProperty(exports, "__esModule", ({
3812 + value: true
3813 +}));
3814 +exports["default"] = void 0;
3815 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
3816 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
3817 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
3818 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
3819 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
3820 +var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/core/hooks/base.js"));
3821 +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)); }
3822 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
3823 +var Ui = exports["default"] = /*#__PURE__*/function (_HooksBase) {
3824 + function Ui() {
3825 + var _this;
3826 + (0, _classCallCheck2.default)(this, Ui);
3827 + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
3828 + args[_key] = arguments[_key];
3829 + }
3830 + _this = _callSuper(this, Ui, [].concat(args));
3831 + _this.callbacks.before = {};
3832 + _this.depth.before = {};
3833 + return _this;
3834 + }
3835 + (0, _inherits2.default)(Ui, _HooksBase);
3836 + return (0, _createClass2.default)(Ui, [{
3837 + key: "getType",
3838 + value: function getType() {
3839 + return 'ui';
3840 + }
3841 + }, {
3842 + key: "runCallback",
3843 + value: function runCallback(event, callback, args, result) {
3844 + switch (event) {
3845 + case 'before':
3846 + callback.callback(args);
3847 + break;
3848 + case 'catch':
3849 + case 'after':
3850 + callback.callback(args, result);
3851 + break;
3852 + default:
3853 + return false;
3854 + }
3855 + return true;
3856 + }
3857 + }, {
3858 + key: "onRun",
3859 + value: function onRun(command, args, event) {
3860 + if (!$e.devTools) {
3861 + return;
3862 + }
3863 + $e.devTools.log.callbacks().run(this.getType(), command, args, event);
3864 + }
3865 + }, {
3866 + key: "onCallback",
3867 + value: function onCallback(command, args, event, id) {
3868 + if (!$e.devTools) {
3869 + return;
3870 + }
3871 + $e.devTools.log.callbacks().callback(this.getType(), command, args, event, id);
3872 + }
3873 + }]);
3874 +}(_base.default);
3875 +
3876 +/***/ }),
3877 +
3878 +/***/ "../modules/web-cli/assets/js/core/routes.js":
3879 +/*!***************************************************!*\
3880 + !*** ../modules/web-cli/assets/js/core/routes.js ***!
3881 + \***************************************************/
3882 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
3883 +
3884 +"use strict";
3885 +
3886 +
3887 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
3888 +Object.defineProperty(exports, "__esModule", ({
3889 + value: true
3890 +}));
3891 +exports["default"] = void 0;
3892 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
3893 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
3894 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
3895 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
3896 +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js"));
3897 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
3898 +var _commands = _interopRequireDefault(__webpack_require__(/*! ./commands */ "../modules/web-cli/assets/js/core/commands.js"));
3899 +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)); }
3900 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
3901 +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; }
3902 +var Routes = exports["default"] = /*#__PURE__*/function (_Commands) {
3903 + function Routes() {
3904 + var _this;
3905 + (0, _classCallCheck2.default)(this, Routes);
3906 + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
3907 + args[_key] = arguments[_key];
3908 + }
3909 + _this = _callSuper(this, Routes, [].concat(args));
3910 + _this.savedStates = {};
3911 + _this.historyPerComponent = {};
3912 + return _this;
3913 + }
3914 + (0, _inherits2.default)(Routes, _Commands);
3915 + return (0, _createClass2.default)(Routes, [{
3916 + key: "refreshContainer",
3917 + value: function refreshContainer(container) {
3918 + var currentRoute = this.getCurrent(container),
3919 + currentArgs = this.getCurrentArgs(container);
3920 + this.clearCurrent(container);
3921 + this.to(currentRoute, currentArgs);
3922 + }
3923 + }, {
3924 + key: "getHistory",
3925 + value: function getHistory() {
3926 + var namespaceRoot = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
3927 + if (namespaceRoot) {
3928 + return this.historyPerComponent[namespaceRoot] || [];
3929 + }
3930 + return this.historyPerComponent;
3931 + }
3932 + }, {
3933 + key: "clearHistory",
3934 + value: function clearHistory(namespaceRoot) {
3935 + delete this.historyPerComponent[namespaceRoot];
3936 + }
3937 + }, {
3938 + key: "clearCurrent",
3939 + value: function clearCurrent(container) {
3940 + var route = this.current[container];
3941 + if (!route) {
3942 + return;
3943 + }
3944 + this.detachCurrent(container);
3945 + this.getComponent(route).onCloseRoute(route);
3946 + this.dispatchOnClose(route);
3947 + }
3948 + }, {
3949 + key: "clear",
3950 + value: function clear() {
3951 + var _this2 = this;
3952 + Object.keys(this.current).forEach(function (container) {
3953 + return _this2.clearCurrent(container);
3954 + });
3955 + }
3956 + }, {
3957 + key: "saveState",
3958 + value: function saveState(container) {
3959 + this.savedStates[container] = {
3960 + route: this.current[container],
3961 + args: this.currentArgs[container]
3962 + };
3963 + return this;
3964 + }
3965 + }, {
3966 + key: "restoreState",
3967 + value: function restoreState(container) {
3968 + if (!this.savedStates[container]) {
3969 + return false;
3970 + }
3971 + this.to(this.savedStates[container].route, this.savedStates[container].args);
3972 + return true;
3973 + }
3974 + }, {
3975 + key: "validateRun",
3976 + value: function validateRun(route) {
3977 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
3978 + if (!_superPropGet(Routes, "validateRun", this, 3)([route, args])) {
3979 + return false;
3980 + }
3981 + if (this.is(route, args) && !args.refresh) {
3982 + return false;
3983 + }
3984 + var component = this.getComponent(route);
3985 + if (!component.isOpen || args.reOpen) {
3986 + component.isOpen = component.open(args);
3987 + }
3988 + return component.isOpen;
3989 + }
3990 +
3991 + /**
3992 + * @override
3993 + */
3994 + }, {
3995 + key: "beforeRun",
3996 + value: function beforeRun(route, args) {
3997 + var component = this.getComponent(route),
3998 + container = component.getServiceName(),
3999 + oldRoute = this.current[container];
4000 + if (oldRoute) {
4001 + this.getComponent(oldRoute).onCloseRoute(oldRoute);
4002 + }
4003 + _commands.default.trace.push(route);
4004 + _superPropGet(Routes, "beforeRun", this, 3)([route, args, false]);
4005 + this.attachCurrent(container, route, args);
4006 +
4007 + // In the previous condition, `$e.routes.is()` resolves the old route as active (because the actual route
4008 + // switching happens inside `this.attachCurrent()`), so we can't use it there.
4009 + if (oldRoute) {
4010 + this.dispatchOnClose(oldRoute);
4011 + }
4012 + }
4013 + }, {
4014 + key: "to",
4015 + value: function to(route, args) {
4016 + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
4017 + history: true
4018 + };
4019 + this.run(route, args);
4020 + var namespaceRoot = this.getComponent(route).getServiceName();
4021 + if (options.history) {
4022 + if (!this.historyPerComponent[namespaceRoot]) {
4023 + this.historyPerComponent[namespaceRoot] = [];
4024 + }
4025 + this.historyPerComponent[namespaceRoot].push({
4026 + route: route,
4027 + args: args
4028 + });
4029 + }
4030 + }
4031 + }, {
4032 + key: "back",
4033 + value: function back(namespaceRoot) {
4034 + var history = this.getHistory(namespaceRoot);
4035 +
4036 + // Remove current;
4037 + history.pop();
4038 + var last = history.pop();
4039 + if (!last) {
4040 + return;
4041 + }
4042 + this.to(last.route, last.args);
4043 + }
4044 +
4045 + // Don't use the event object.
4046 + }, {
4047 + key: "runShortcut",
4048 + value: function runShortcut(command) {
4049 + this.to(command);
4050 + }
4051 +
4052 + // Don't clear current route.
4053 + }, {
4054 + key: "afterRun",
4055 + value: function afterRun(route, args) {
4056 + var results = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
4057 + var component = this.getComponent(route);
4058 + component.onRoute(route, args);
4059 + this.dispatchOnOpen(route);
4060 + _superPropGet(Routes, "afterRun", this, 3)([route, args, results, false]);
4061 + _commands.default.trace.pop();
4062 + }
4063 + }, {
4064 + key: "is",
4065 + value: function is(route) {
4066 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
4067 + if (!_superPropGet(Routes, "is", this, 3)([route])) {
4068 + return false;
4069 + }
4070 + var container = this.getComponent(route).getServiceName();
4071 + return _.isEqual(args, this.currentArgs[container]);
4072 + }
4073 + }, {
4074 + key: "isPartOf",
4075 + value: function isPartOf(route) {
4076 + /**
4077 + * Check against current command hierarchically.
4078 + * For example `is( 'panel' )` will be true for `panel/elements`
4079 + * `is( 'panel/editor' )` will be true for `panel/editor/style`
4080 + */
4081 + var parts = route.split('/'),
4082 + container = parts[0],
4083 + toCheck = [],
4084 + currentParts = this.current[container] ? this.current[container].split('/') : [];
4085 + var match = false;
4086 + currentParts.forEach(function (part) {
4087 + toCheck.push(part);
4088 + if (toCheck.join('/') === route) {
4089 + match = true;
4090 + }
4091 + });
4092 + return match;
4093 + }
4094 + }, {
4095 + key: "error",
4096 + value: function error(message) {
4097 + throw Error('Routes: ' + message);
4098 + }
4099 + }, {
4100 + key: "dispatchOnOpen",
4101 + value: function dispatchOnOpen(route) {
4102 + window.dispatchEvent(new CustomEvent('elementor/routes/open', {
4103 + detail: {
4104 + route: route
4105 + }
4106 + }));
4107 + }
4108 + }, {
4109 + key: "dispatchOnClose",
4110 + value: function dispatchOnClose(route) {
4111 + window.dispatchEvent(new CustomEvent('elementor/routes/close', {
4112 + detail: {
4113 + route: route
4114 + }
4115 + }));
4116 + }
4117 + }]);
4118 +}(_commands.default);
4119 +
4120 +/***/ }),
4121 +
4122 +/***/ "../modules/web-cli/assets/js/core/shortcuts.js":
4123 +/*!******************************************************!*\
4124 + !*** ../modules/web-cli/assets/js/core/shortcuts.js ***!
4125 + \******************************************************/
4126 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4127 +
4128 +"use strict";
4129 +
4130 +
4131 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
4132 +Object.defineProperty(exports, "__esModule", ({
4133 + value: true
4134 +}));
4135 +exports["default"] = void 0;
4136 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
4137 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
4138 +var _environment = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/environment */ "../modules/web-cli/assets/js/utils/environment.js"));
4139 +var _console = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/console */ "../modules/web-cli/assets/js/utils/console.js"));
4140 +var Shortcuts = exports["default"] = /*#__PURE__*/function () {
4141 + function Shortcuts($window) {
4142 + (0, _classCallCheck2.default)(this, Shortcuts);
4143 + this.specialKeys = {
4144 + 13: 'enter',
4145 + 27: 'esc',
4146 + 38: 'up',
4147 + 40: 'down',
4148 + 46: 'del',
4149 + 191: '?'
4150 + };
4151 + this.component = '';
4152 + this.handlers = {};
4153 + this.bindListener($window);
4154 + }
4155 + return (0, _createClass2.default)(Shortcuts, [{
4156 + key: "bindListener",
4157 + value: function bindListener($window) {
4158 + var _this = this;
4159 + $window.on('keydown', function (event) {
4160 + return _this.handle(event);
4161 + });
4162 + }
4163 + }, {
4164 + key: "getAll",
4165 + value: function getAll() {
4166 + var shortcuts = {};
4167 + jQuery.each(this.handlers, function (key, handler) {
4168 + jQuery.each(handler, function (index, config) {
4169 + shortcuts[config.command] = key;
4170 + });
4171 + });
4172 + return shortcuts;
4173 + }
4174 +
4175 + /**
4176 + * @param {string} shortcuts
4177 + * @param {Object} args
4178 + * @param {Function} args.callback Required
4179 + * @param {string} args.component Optional
4180 + * @param {Function} args.dependency Optional
4181 + * @param {Array} args.exclude Optional
4182 + * @param {boolean} args.allowAltKey Optional
4183 + */
4184 + }, {
4185 + key: "register",
4186 + value: function register(shortcuts, args) {
4187 + var _this2 = this;
4188 + shortcuts.replace(' ', '').split(',').forEach(function (shortcut) {
4189 + if (!_this2.handlers[shortcut]) {
4190 + _this2.handlers[shortcut] = [];
4191 + }
4192 + _this2.handlers[shortcut].push(args);
4193 + });
4194 + }
4195 + }, {
4196 + key: "unregister",
4197 + value: function unregister(shortcuts, args) {
4198 + var _this3 = this;
4199 + shortcuts.replace(' ', '').split(',').forEach(function (shortcut) {
4200 + _this3.handlers[shortcut].forEach(function (index, handler) {
4201 + if (args === handler) {
4202 + delete _this3.handlers[shortcut][index];
4203 + }
4204 + });
4205 + });
4206 + }
4207 + }, {
4208 + key: "handle",
4209 + value: function handle(event) {
4210 + var handlers = this.getHandlersByPriority(event);
4211 + if (!handlers) {
4212 + return;
4213 + }
4214 + var filteredHandlers = handlers.filter(function (handler) {
4215 + if (handler.exclude && -1 !== handler.exclude.indexOf('input')) {
4216 + var $target = jQuery(event.target);
4217 + if ($target.is(':input, .elementor-input') || $target.closest('[contenteditable="true"]').length) {
4218 + return false;
4219 + }
4220 + }
4221 + if (handler.dependency && !handler.dependency(event)) {
4222 + return false;
4223 + }
4224 +
4225 + // Fix for some keyboard sources that consider alt key as ctrl key
4226 + if (!handler.allowAltKey && event.altKey) {
4227 + return false;
4228 + }
4229 + return true;
4230 + });
4231 + if (!filteredHandlers.length) {
4232 + return;
4233 + }
4234 + if (1 < filteredHandlers.length && elementorWebCliConfig.isDebug) {
4235 + _console.default.warn('Multiple handlers for shortcut.', filteredHandlers, event);
4236 + }
4237 + event.preventDefault();
4238 + filteredHandlers[0].callback(event);
4239 + }
4240 + }, {
4241 + key: "isControlEvent",
4242 + value: function isControlEvent(event) {
4243 + return event[_environment.default.mac ? 'metaKey' : 'ctrlKey'];
4244 + }
4245 + }, {
4246 + key: "getEventShortcut",
4247 + value: function getEventShortcut(event) {
4248 + var shortcut = [];
4249 + if (event.altKey) {
4250 + shortcut.push('alt');
4251 + }
4252 + if (this.isControlEvent(event)) {
4253 + shortcut.push('ctrl');
4254 + }
4255 + if (event.shiftKey) {
4256 + shortcut.push('shift');
4257 + }
4258 + if (this.specialKeys[event.which]) {
4259 + shortcut.push(this.specialKeys[event.which]);
4260 + } else {
4261 + shortcut.push(String.fromCharCode(event.which).toLowerCase());
4262 + }
4263 + return shortcut.join('+');
4264 + }
4265 + }, {
4266 + key: "isActiveScope",
4267 + value: function isActiveScope(scopes) {
4268 + var activeComponents = Object.keys($e.components.activeComponents),
4269 + activeComponent = activeComponents[activeComponents.length - 1],
4270 + component = $e.components.get(activeComponent);
4271 + if (!component) {
4272 + return false;
4273 + }
4274 + var namespace = component.getNamespace();
4275 + var filteredByNamespace = scopes.some(function (scope) {
4276 + return namespace === scope;
4277 + });
4278 + if (filteredByNamespace) {
4279 + return true;
4280 + }
4281 +
4282 + // Else filter by namespaceRoot.
4283 + var namespaceRoot = component.getServiceName();
4284 + return scopes.some(function (scope) {
4285 + return namespaceRoot === scope;
4286 + });
4287 + }
4288 + }, {
4289 + key: "getHandlersByPriority",
4290 + value: function getHandlersByPriority(event) {
4291 + var _this4 = this;
4292 + var handlers = this.handlers[this.getEventShortcut(event)];
4293 + if (!handlers) {
4294 + return false;
4295 + }
4296 +
4297 + // TODO: Prioritize current scope before roo scope.
4298 + var inCurrentScope = handlers.filter(function (handler) {
4299 + return handler.scopes && _this4.isActiveScope(handler.scopes);
4300 + });
4301 + if (inCurrentScope.length) {
4302 + return inCurrentScope;
4303 + }
4304 + var noScope = handlers.filter(function (handler) {
4305 + return !handler.scopes;
4306 + });
4307 + if (noScope.length) {
4308 + return noScope;
4309 + }
4310 + }
4311 + }]);
4312 +}();
4313 +
4314 +/***/ }),
4315 +
4316 +/***/ "../modules/web-cli/assets/js/core/store.js":
4317 +/*!**************************************************!*\
4318 + !*** ../modules/web-cli/assets/js/core/store.js ***!
4319 + \**************************************************/
4320 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4321 +
4322 +"use strict";
4323 +
4324 +
4325 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
4326 +Object.defineProperty(exports, "__esModule", ({
4327 + value: true
4328 +}));
4329 +exports["default"] = void 0;
4330 +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
4331 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
4332 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
4333 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
4334 +var _toolkit = __webpack_require__(/*! @reduxjs/toolkit */ "../node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js");
4335 +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; }
4336 +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; }
4337 +/**
4338 + * @typedef {import('@reduxjs/toolkit').Slice} Slice
4339 + */
4340 +/**
4341 + * @typedef {import('@reduxjs/toolkit').EnhancedStore} EnhancedStore
4342 + */
4343 +/**
4344 + * @typedef {import('@reduxjs/toolkit').AnyAction} AnyAction
4345 + */
4346 +/**
4347 + * @typedef {import('@reduxjs/toolkit').ThunkMiddlewareFor} ThunkMiddlewareFor
4348 + */
4349 +var Store = exports["default"] = /*#__PURE__*/function () {
4350 + /**
4351 + * Initialize the Store.
4352 + *
4353 + * @return {void}
4354 + */
4355 + function Store() {
4356 + (0, _classCallCheck2.default)(this, Store);
4357 + /**
4358 + * @type {Object}
4359 + */
4360 + (0, _defineProperty2.default)(this, "slices", {});
4361 + /**
4362 + * @type {EnhancedStore<{}, AnyAction, [ThunkMiddlewareFor<{}>]>}
4363 + */
4364 + (0, _defineProperty2.default)(this, "reduxStore", void 0);
4365 + this.slices = {};
4366 + this.reduxStore = this.createStore();
4367 + }
4368 +
4369 + /**
4370 + * Create a Redux Store object.
4371 + *
4372 + * @return {EnhancedStore<{}, AnyAction, [ThunkMiddlewareFor<{}>]>} store
4373 + */
4374 + return (0, _createClass2.default)(Store, [{
4375 + key: "createStore",
4376 + value: function createStore() {
4377 + return (0, _toolkit.configureStore)({
4378 + // Use an empty function instead of empty object since an empty object
4379 + // isn't a valid reducer value.
4380 + reducer: function reducer() {}
4381 + });
4382 + }
4383 +
4384 + /**
4385 + * Inject a new reducer.
4386 + *
4387 + * See: https://redux.js.org/usage/code-splitting#defining-an-injectreducer-function
4388 + *
4389 + * @param {string} id - Reducer unique ID.
4390 + * @param {Function} newReducer - New reducer to inject.
4391 + *
4392 + * @return {void}
4393 + */
4394 + }, {
4395 + key: "injectReducer",
4396 + value: function injectReducer(id, newReducer) {
4397 + var prevReducers = this.getReducers();
4398 + this.reduxStore.replaceReducer((0, _toolkit.combineReducers)(_objectSpread(_objectSpread({}, prevReducers), {}, (0, _defineProperty2.default)({}, id, newReducer))));
4399 + }
4400 +
4401 + /**
4402 + * Register a Redux Store slice.
4403 + *
4404 + * @param {string} sliceId - Slice unique ID.
4405 + * @param {Slice} instance - Slice object to add.
4406 + *
4407 + * @return {void}
4408 + */
4409 + }, {
4410 + key: "register",
4411 + value: function register(sliceId, instance) {
4412 + if (this.slices[sliceId]) {
4413 + throw "Slice with ID '".concat(sliceId, "' already exists.");
4414 + }
4415 + this.slices[sliceId] = instance;
4416 + this.injectReducer(sliceId, instance.reducer);
4417 + }
4418 +
4419 + /**
4420 + * Get a specific slice.
4421 + *
4422 + * @param {string|null} sliceId - Slice ID to get.
4423 + *
4424 + * @return {Slice} slice
4425 + */
4426 + }, {
4427 + key: "get",
4428 + value: function get(sliceId) {
4429 + return this.slices[sliceId];
4430 + }
4431 +
4432 + /**
4433 + * Get all slices.
4434 + *
4435 + * @return {Object} slices
4436 + */
4437 + }, {
4438 + key: "getAllSlices",
4439 + value: function getAllSlices() {
4440 + return this.slices;
4441 + }
4442 +
4443 + /**
4444 + * Get All slices.
4445 + *
4446 + * @return {Object} slices
4447 + */
4448 + }, {
4449 + key: "getAll",
4450 + value: function getAll() {
4451 + return Object.keys(this.slices).sort();
4452 + }
4453 +
4454 + /**
4455 + * Return the current reducers.
4456 + *
4457 + * @return {Object} reducers
4458 + */
4459 + }, {
4460 + key: "getReducers",
4461 + value: function getReducers() {
4462 + return Object.entries(this.slices).reduce(function (reducers, _ref) {
4463 + var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
4464 + key = _ref2[0],
4465 + slice = _ref2[1];
4466 + return _objectSpread(_objectSpread({}, reducers), {}, (0, _defineProperty2.default)({}, key, slice.reducer));
4467 + }, {});
4468 + }
4469 +
4470 + /**
4471 + * Get the actual Redux store object.
4472 + *
4473 + * @return {Object} redux store object
4474 + */
4475 + }, {
4476 + key: "getReduxStore",
4477 + value: function getReduxStore() {
4478 + return this.reduxStore;
4479 + }
4480 +
4481 + /**
4482 + * Proxy to Redux's `dispatch()` function.
4483 + *
4484 + * @return {*} the dispatched action
4485 + */
4486 + }, {
4487 + key: "dispatch",
4488 + value: function dispatch() {
4489 + var _this$reduxStore;
4490 + return (_this$reduxStore = this.reduxStore).dispatch.apply(_this$reduxStore, arguments);
4491 + }
4492 +
4493 + /**
4494 + * Proxy to Redux's `getState()` function, with the ability to get a specific slice.
4495 + *
4496 + * @param {string|null} sliceId
4497 + *
4498 + * @return {*} The current state tree of the application
4499 + */
4500 + }, {
4501 + key: "getState",
4502 + value: function getState() {
4503 + var sliceId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
4504 + var state = this.reduxStore.getState();
4505 + return sliceId ? state[sliceId] : state;
4506 + }
4507 +
4508 + /**
4509 + * Proxy to Redux's `replaceReducer()` function.
4510 + * TODO: Do we want that?
4511 + *
4512 + * @return {*} undefined
4513 + */
4514 + }, {
4515 + key: "replaceReducer",
4516 + value: function replaceReducer() {
4517 + var _this$reduxStore2;
4518 + return (_this$reduxStore2 = this.reduxStore).replaceReducer.apply(_this$reduxStore2, arguments);
4519 + }
4520 +
4521 + /**
4522 + * Proxy to Redux's `subscribe()` function.
4523 + *
4524 + * @return {*} A function that unsubscribes the change listener
4525 + */
4526 + }, {
4527 + key: "subscribe",
4528 + value: function subscribe() {
4529 + var _this$reduxStore3;
4530 + return (_this$reduxStore3 = this.reduxStore).subscribe.apply(_this$reduxStore3, arguments);
4531 + }
4532 + }]);
4533 +}();
4534 +
4535 +/***/ }),
4536 +
4537 +/***/ "../modules/web-cli/assets/js/core/ui-states.js":
4538 +/*!******************************************************!*\
4539 + !*** ../modules/web-cli/assets/js/core/ui-states.js ***!
4540 + \******************************************************/
4541 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4542 +
4543 +"use strict";
4544 +
4545 +
4546 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
4547 +Object.defineProperty(exports, "__esModule", ({
4548 + value: true
4549 +}));
4550 +exports["default"] = void 0;
4551 +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
4552 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
4553 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
4554 +/**
4555 + * @typedef {import('./states/ui-state-base')} UiStateBase
4556 + */
4557 +var UiStates = exports["default"] = /*#__PURE__*/function () {
4558 + /**
4559 + * Initialize the State Manager.
4560 + *
4561 + * @return {void}
4562 + */
4563 + function UiStates() {
4564 + (0, _classCallCheck2.default)(this, UiStates);
4565 + this.states = {};
4566 + }
4567 +
4568 + /**
4569 + * Register a new state.
4570 + *
4571 + * @param {UiStateBase} instance - State instance.
4572 + */
4573 + return (0, _createClass2.default)(UiStates, [{
4574 + key: "register",
4575 + value: function register(instance) {
4576 + var stateId = instance.getPrefixedId();
4577 + if (this.states[stateId]) {
4578 + throw "State '".concat(stateId, "' already exists.");
4579 + }
4580 + this.states[stateId] = instance;
4581 + }
4582 +
4583 + /**
4584 + * Get all existing states with their options:
4585 + *
4586 + * {
4587 + * 'state-id': [
4588 + * 'option-1',
4589 + * 'option-2',
4590 + * 'option-3',
4591 + * ],
4592 + * }
4593 + *
4594 + * @return {Object} all existing states
4595 + */
4596 + }, {
4597 + key: "getAll",
4598 + value: function getAll() {
4599 + var states = {};
4600 + Object.entries(this.states).forEach(function (_ref) {
4601 + var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
4602 + id = _ref2[0],
4603 + instance = _ref2[1];
4604 + var options = instance.getOptions();
4605 + states[id] = Object.keys(options);
4606 + });
4607 + return states;
4608 + }
4609 +
4610 + /**
4611 + * Get the state value, or return all of them if no `state` is set.
4612 + *
4613 + * @param {string} state - State ID.
4614 + *
4615 + * @return {UiStateBase} state value
4616 + */
4617 + }, {
4618 + key: "get",
4619 + value: function get(state) {
4620 + if (state) {
4621 + return this.states[state];
4622 + }
4623 + return this.states;
4624 + }
4625 +
4626 + /**
4627 + * Set the current state value and trigger its callbacks & events.
4628 + * This function triggers a `e-ui-state:${ stateID }` event to the scope, with `oldValue` & `newValue`
4629 + * under `e.detail`.
4630 + * Additionally, it adds a `e-ui-state--${ stateID }__${ value }` class to the scope element.
4631 + *
4632 + * @param {string} state - State ID.
4633 + * @param {string} value - New state value.
4634 + *
4635 + * @return {void}
4636 + */
4637 + }, {
4638 + key: "set",
4639 + value: function set(state, value) {
4640 + // Invalid state or option.
4641 + if (!this.get(state)) {
4642 + throw "State '".concat(state, "' doesn't exist.");
4643 + }
4644 + var oldValue = this.getCurrent(state),
4645 + classPrefix = "e-ui-state--".concat(state.replaceAll('/', '-')),
4646 + oldStateClass = "".concat(classPrefix, "__").concat(oldValue),
4647 + newStateClass = "".concat(classPrefix, "__").concat(value),
4648 + scopes = this.get(state).getScopes();
4649 +
4650 + // Set the current state to the new value.
4651 + this.get(state).set(value);
4652 + scopes.forEach(function (scope) {
4653 + scope.classList.remove(oldStateClass);
4654 +
4655 + // Set the new class only if there is a value (i.e. it's not a state removal action).
4656 + if (value) {
4657 + scope.classList.add(newStateClass);
4658 + }
4659 +
4660 + // Dispatch a custom state-change event to the scope.
4661 + var event = new CustomEvent("e-ui-state:".concat(state), {
4662 + detail: {
4663 + oldValue: oldValue,
4664 + newValue: value
4665 + }
4666 + });
4667 + scope.dispatchEvent(event);
4668 + });
4669 + }
4670 +
4671 + /**
4672 + * Remove a state.
4673 + *
4674 + * @param {string} state - State ID.
4675 + *
4676 + * @return {void}
4677 + */
4678 + }, {
4679 + key: "remove",
4680 + value: function remove(state) {
4681 + this.set(state, '');
4682 + }
4683 +
4684 + /**
4685 + * Get the current state value.
4686 + *
4687 + * @param {string} state - State ID.
4688 + *
4689 + * @return {string} current state value
4690 + */
4691 + }, {
4692 + key: "getCurrent",
4693 + value: function getCurrent(state) {
4694 + var _this$get;
4695 + return (_this$get = this.get(state)) === null || _this$get === void 0 ? void 0 : _this$get.getCurrent();
4696 + }
4697 + }]);
4698 +}();
4699 +
4700 +/***/ }),
4701 +
4702 +/***/ "../modules/web-cli/assets/js/extras/hash-commands.js":
4703 +/*!************************************************************!*\
4704 + !*** ../modules/web-cli/assets/js/extras/hash-commands.js ***!
4705 + \************************************************************/
4706 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4707 +
4708 +"use strict";
4709 +
4710 +
4711 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
4712 +Object.defineProperty(exports, "__esModule", ({
4713 + value: true
4714 +}));
4715 +exports["default"] = void 0;
4716 +var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js"));
4717 +var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js"));
4718 +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
4719 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
4720 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
4721 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
4722 +var _console = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/console */ "../modules/web-cli/assets/js/utils/console.js"));
4723 +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; } } }; }
4724 +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; } }
4725 +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; }
4726 +var HashCommands = exports["default"] = /*#__PURE__*/function () {
4727 + function HashCommands() {
4728 + (0, _classCallCheck2.default)(this, HashCommands);
4729 + /**
4730 + * Cannot be static since it uses callback(s) that are available only after '$e' is initialized.
4731 + */
4732 + (0, _defineProperty2.default)(this, "dispatchersList", {
4733 + 'e:run': {
4734 + runner: function runner() {
4735 + return $e.run;
4736 + },
4737 + isSafe: function isSafe(command) {
4738 + var _$e$commands$getComma;
4739 + return (_$e$commands$getComma = $e.commands.getCommandClass(command)) === null || _$e$commands$getComma === void 0 ? void 0 : _$e$commands$getComma.getInfo().isSafe;
4740 + },
4741 + isSafeWithArgs: function isSafeWithArgs(command) {
4742 + var _$e$commands$getComma2;
4743 + return (_$e$commands$getComma2 = $e.commands.getCommandClass(command)) === null || _$e$commands$getComma2 === void 0 ? void 0 : _$e$commands$getComma2.getInfo().isSafeWithArgs;
4744 + }
4745 + },
4746 + 'e:route': {
4747 + runner: function runner() {
4748 + return $e.route;
4749 + },
4750 + isSafe: function isSafe() {
4751 + return true;
4752 + },
4753 + isSafeWithArgs: function isSafeWithArgs() {
4754 + return false;
4755 + }
4756 + }
4757 + });
4758 + /**
4759 + * @typedef HashCommand
4760 + * @property {string} method method
4761 + * @property {string} command command
4762 + * @property {Object} args arguments
4763 + */
4764 + /**
4765 + * List of current loaded hash commands.
4766 + *
4767 + * @type {Array.<HashCommand>}
4768 + */
4769 + (0, _defineProperty2.default)(this, "commands", []);
4770 + this.commands = this.get();
4771 + }
4772 +
4773 + /**
4774 + * Function get().
4775 + *
4776 + * Get API requests that comes from hash ( eg #e:run ).
4777 + *
4778 + * @param {string} hash
4779 + *
4780 + * @return {Array.<HashCommand>} API requests
4781 + */
4782 + return (0, _createClass2.default)(HashCommands, [{
4783 + key: "get",
4784 + value: function get() {
4785 + var _this = this;
4786 + var hash = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : location.hash;
4787 + var result = [];
4788 + if (hash) {
4789 + // Remove first '#' and split each '&'.
4790 + var hashList = hash.substr(1).split('&');
4791 + hashList.forEach(function (hashItem) {
4792 + // eslint-disable-next-line @wordpress/no-unused-vars-before-return
4793 + var _hashItem$split = hashItem.split('?'),
4794 + _hashItem$split2 = (0, _slicedToArray2.default)(_hashItem$split, 2),
4795 + rawCommand = _hashItem$split2[0],
4796 + rawArgs = _hashItem$split2[1];
4797 + var hashParts = rawCommand.split(':');
4798 + if (3 !== hashParts.length) {
4799 + return;
4800 + }
4801 + var method = hashParts[0] + ':' + hashParts[1],
4802 + dispatcher = _this.dispatchersList[method];
4803 + if (dispatcher) {
4804 + var command = hashParts[2],
4805 + args = _this.parseCommandArgs(rawArgs);
4806 + result.push({
4807 + method: method,
4808 + command: command,
4809 + args: args
4810 + });
4811 + }
4812 + });
4813 + }
4814 + return result;
4815 + }
4816 +
4817 + /**
4818 + * Function run().
4819 + *
4820 + * Run API requests that comes from hash ( eg #e:run ).
4821 + *
4822 + * @param {Array.<HashCommand>} [commands=this.commands]
4823 + */
4824 + }, {
4825 + key: "run",
4826 + value: (function () {
4827 + var _run = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
4828 + var commands,
4829 + _iterator,
4830 + _step,
4831 + hashCommand,
4832 + dispatcher,
4833 + _iterator2,
4834 + _step2,
4835 + _hashCommand,
4836 + _dispatcher,
4837 + _args = arguments,
4838 + _t,
4839 + _t2;
4840 + return _regenerator.default.wrap(function (_context) {
4841 + while (1) switch (_context.prev = _context.next) {
4842 + case 0:
4843 + commands = _args.length > 0 && _args[0] !== undefined ? _args[0] : this.commands;
4844 + // To allow validate the run first.
4845 + _iterator = _createForOfIteratorHelper(commands);
4846 + _context.prev = 1;
4847 + _iterator.s();
4848 + case 2:
4849 + if ((_step = _iterator.n()).done) {
4850 + _context.next = 5;
4851 + break;
4852 + }
4853 + hashCommand = _step.value;
4854 + dispatcher = this.dispatchersList[hashCommand.method];
4855 + if (dispatcher) {
4856 + _context.next = 3;
4857 + break;
4858 + }
4859 + return _context.abrupt("return", Promise.reject(new Error("No dispatcher found for the command: `".concat(hashCommand.command, "`."))));
4860 + case 3:
4861 + if (dispatcher.isSafe(hashCommand.command)) {
4862 + _context.next = 4;
4863 + break;
4864 + }
4865 + return _context.abrupt("return", Promise.reject(new Error("Attempting to run unsafe or non exist command: `".concat(hashCommand.command, "`."))));
4866 + case 4:
4867 + _context.next = 2;
4868 + break;
4869 + case 5:
4870 + _context.next = 7;
4871 + break;
4872 + case 6:
4873 + _context.prev = 6;
4874 + _t = _context["catch"](1);
4875 + _iterator.e(_t);
4876 + case 7:
4877 + _context.prev = 7;
4878 + _iterator.f();
4879 + return _context.finish(7);
4880 + case 8:
4881 + // This logic will run the promises by sequence (will wait for dispatcher to finish, before run again).
4882 + _iterator2 = _createForOfIteratorHelper(commands);
4883 + _context.prev = 9;
4884 + _iterator2.s();
4885 + case 10:
4886 + if ((_step2 = _iterator2.n()).done) {
4887 + _context.next = 12;
4888 + break;
4889 + }
4890 + _hashCommand = _step2.value;
4891 + _dispatcher = this.dispatchersList[_hashCommand.method];
4892 + _context.next = 11;
4893 + return _dispatcher.runner()(_hashCommand.command, _dispatcher.isSafeWithArgs(_hashCommand.command) ? _hashCommand.args : undefined);
4894 + case 11:
4895 + _context.next = 10;
4896 + break;
4897 + case 12:
4898 + _context.next = 14;
4899 + break;
4900 + case 13:
4901 + _context.prev = 13;
4902 + _t2 = _context["catch"](9);
4903 + _iterator2.e(_t2);
4904 + case 14:
4905 + _context.prev = 14;
4906 + _iterator2.f();
4907 + return _context.finish(14);
4908 + case 15:
4909 + case "end":
4910 + return _context.stop();
4911 + }
4912 + }, _callee, this, [[1, 6, 7, 8], [9, 13, 14, 15]]);
4913 + }));
4914 + function run() {
4915 + return _run.apply(this, arguments);
4916 + }
4917 + return run;
4918 + }()
4919 + /**
4920 + * Function runOnce().
4921 + *
4922 + * Do same as `run` but clear `this.commands` before leaving.
4923 + */
4924 + )
4925 + }, {
4926 + key: "runOnce",
4927 + value: function runOnce() {
4928 + var _this2 = this;
4929 + this.run(this.commands).then(function () {
4930 + _this2.commands = [];
4931 + });
4932 + }
4933 +
4934 + /**
4935 + * Takes a args in form of JSON and parse it.
4936 + *
4937 + * @param {string} rawArgs
4938 + * @return {Object} args in as an object
4939 + */
4940 + }, {
4941 + key: "parseCommandArgs",
4942 + value: function parseCommandArgs(rawArgs) {
4943 + try {
4944 + return JSON.parse(decodeURI(rawArgs || '{}'));
4945 + } catch (e) {
4946 + _console.default.warn('Hash commands JSON args cannot be parsed. \n\n', e);
4947 + return {};
4948 + }
4949 + }
4950 + }]);
4951 +}();
4952 +
4953 +/***/ }),
4954 +
4955 +/***/ "../modules/web-cli/assets/js/modules/command-base.js":
4956 +/*!************************************************************!*\
4957 + !*** ../modules/web-cli/assets/js/modules/command-base.js ***!
4958 + \************************************************************/
4959 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4960 +
4961 +"use strict";
4962 +
4963 +
4964 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
4965 +Object.defineProperty(exports, "__esModule", ({
4966 + value: true
4967 +}));
4968 +exports["default"] = void 0;
4969 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
4970 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
4971 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
4972 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
4973 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
4974 +var _commandInfra = _interopRequireDefault(__webpack_require__(/*! ./command-infra */ "../modules/web-cli/assets/js/modules/command-infra.js"));
4975 +var _deprecation = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/deprecation */ "../modules/web-cli/assets/js/utils/deprecation.js"));
4976 +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)); }
4977 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
4978 +/**
4979 + * @name $e.modules.CommandBase
4980 + */
4981 +var CommandBase = exports["default"] = /*#__PURE__*/function (_CommandInfra) {
4982 + function CommandBase() {
4983 + (0, _classCallCheck2.default)(this, CommandBase);
4984 + return _callSuper(this, CommandBase, arguments);
4985 + }
4986 + (0, _inherits2.default)(CommandBase, _CommandInfra);
4987 + return (0, _createClass2.default)(CommandBase, [{
4988 + key: "onBeforeRun",
4989 + value: function onBeforeRun() {
4990 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
4991 + $e.hooks.runUIBefore(this.command, args);
4992 + }
4993 + }, {
4994 + key: "onAfterRun",
4995 + value: function onAfterRun() {
4996 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
4997 + var result = arguments.length > 1 ? arguments[1] : undefined;
4998 + $e.hooks.runUIAfter(this.command, args, result);
4999 + }
5000 + }, {
5001 + key: "onBeforeApply",
5002 + value: function onBeforeApply() {
5003 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
5004 + $e.hooks.runDataDependency(this.command, args);
5005 + }
5006 + }, {
5007 + key: "onAfterApply",
5008 + value: function onAfterApply() {
5009 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
5010 + var result = arguments.length > 1 ? arguments[1] : undefined;
5011 + return $e.hooks.runDataAfter(this.command, args, result);
5012 + }
5013 + }, {
5014 + key: "onCatchApply",
5015 + value: function onCatchApply(e) {
5016 + this.runCatchHooks(e);
5017 + }
5018 +
5019 + /**
5020 + * Run all the catch hooks.
5021 + *
5022 + * @param {Error} e
5023 + */
5024 + }, {
5025 + key: "runCatchHooks",
5026 + value: function runCatchHooks(e) {
5027 + $e.hooks.runDataCatch(this.command, this.args, e);
5028 + $e.hooks.runUICatch(this.command, this.args, e);
5029 + }
5030 +
5031 + /**
5032 + * TODO - Remove - Backwards compatibility.
5033 + *
5034 + * Function requireContainer().
5035 + *
5036 + * Validate `arg.container` & `arg.containers`.
5037 + *
5038 + * @param {{}} args
5039 + * @deprecated since 3.7.0, extend `$e.modules.editor.CommandContainerBase` or `$e.modules.editor.CommandContainerInternalBase` instead.
5040 + *
5041 + * @throws {Error}
5042 + */
5043 + }, {
5044 + key: "requireContainer",
5045 + value: function requireContainer() {
5046 + var _this = this;
5047 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.args;
5048 + _deprecation.default.deprecated('requireContainer()', '3.7.0', 'Extend `$e.modules.editor.CommandContainerBase` or `$e.modules.editor.CommandContainerInternalBase`');
5049 + if (!args.container && !args.containers) {
5050 + throw Error('container or containers are required.');
5051 + }
5052 + if (args.container && args.containers) {
5053 + throw Error('container and containers cannot go together please select one of them.');
5054 + }
5055 + var containers = args.containers || [args.container];
5056 + containers.forEach(function (container) {
5057 + _this.requireArgumentInstance('container', elementorModules.editor.Container, {
5058 + container: container
5059 + });
5060 + });
5061 + }
5062 + }], [{
5063 + key: "getInstanceType",
5064 + value: function getInstanceType() {
5065 + return 'CommandBase';
5066 + }
5067 + }]);
5068 +}(_commandInfra.default);
5069 +
5070 +/***/ }),
5071 +
5072 +/***/ "../modules/web-cli/assets/js/modules/command-callback-base.js":
5073 +/*!*********************************************************************!*\
5074 + !*** ../modules/web-cli/assets/js/modules/command-callback-base.js ***!
5075 + \*********************************************************************/
5076 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5077 +
5078 +"use strict";
5079 +
5080 +
5081 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
5082 +Object.defineProperty(exports, "__esModule", ({
5083 + value: true
5084 +}));
5085 +exports["default"] = void 0;
5086 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
5087 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
5088 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
5089 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
5090 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
5091 +var _commandBase = _interopRequireDefault(__webpack_require__(/*! ./command-base */ "../modules/web-cli/assets/js/modules/command-base.js"));
5092 +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)); }
5093 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
5094 +/**
5095 + * To support pure callbacks in the API(commands.js), to ensure they have registered with the proper context.
5096 + */
5097 +var CommandCallbackBase = exports["default"] = /*#__PURE__*/function (_CommandBase) {
5098 + function CommandCallbackBase() {
5099 + (0, _classCallCheck2.default)(this, CommandCallbackBase);
5100 + return _callSuper(this, CommandCallbackBase, arguments);
5101 + }
5102 + (0, _inherits2.default)(CommandCallbackBase, _CommandBase);
5103 + return (0, _createClass2.default)(CommandCallbackBase, [{
5104 + key: "apply",
5105 + value: function apply() {
5106 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
5107 + return this.constructor.getCallback()(args);
5108 + }
5109 + }], [{
5110 + key: "getInstanceType",
5111 + value: function getInstanceType() {
5112 + return 'CommandCallbackBase';
5113 + }
5114 +
5115 + /**
5116 + * Get original callback of the command.
5117 + *
5118 + * Support pure callbacks ( Non command-base ).
5119 + *
5120 + * @return {()=>{}} Command Results.
5121 + */
5122 + }, {
5123 + key: "getCallback",
5124 + value: function getCallback() {
5125 + return this.registerConfig.callback;
5126 + }
5127 + }]);
5128 +}(_commandBase.default);
5129 +
5130 +/***/ }),
5131 +
5132 +/***/ "../modules/web-cli/assets/js/modules/command-data.js":
5133 +/*!************************************************************!*\
5134 + !*** ../modules/web-cli/assets/js/modules/command-data.js ***!
5135 + \************************************************************/
5136 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5137 +
5138 +"use strict";
5139 +
5140 +
5141 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
5142 +var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js");
5143 +Object.defineProperty(exports, "__esModule", ({
5144 + value: true
5145 +}));
5146 +exports["default"] = void 0;
5147 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
5148 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
5149 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
5150 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
5151 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
5152 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
5153 +var _commandBase = _interopRequireDefault(__webpack_require__(/*! ./command-base */ "../modules/web-cli/assets/js/modules/command-base.js"));
5154 +var errors = _interopRequireWildcard(__webpack_require__(/*! ../core/data/errors/ */ "../modules/web-cli/assets/js/core/data/errors/index.js"));
5155 +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); }
5156 +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)); }
5157 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
5158 +/**
5159 + * @name $e.modules.CommandData
5160 + */
5161 +/**
5162 + * @typedef {('create'|'delete'|'get'|'update'|'options')} DataTypes
5163 + */
5164 +/**
5165 + * @typedef {{}} RequestData
5166 + */
5167 +/**
5168 + * @typedef {import('../core/data/errors/base-error')} BaseError
5169 + */
5170 +var CommandData = exports["default"] = /*#__PURE__*/function (_CommandBase) {
5171 + function CommandData(args) {
5172 + var _this$args$options;
5173 + var _this;
5174 + var commandsAPI = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : $e.data;
5175 + (0, _classCallCheck2.default)(this, CommandData);
5176 + _this = _callSuper(this, CommandData, [args, commandsAPI]);
5177 + /**
5178 + * Data returned from remote.
5179 + *
5180 + * @type {*}
5181 + */
5182 + (0, _defineProperty2.default)(_this, "data", void 0);
5183 + /**
5184 + * Fetch type.
5185 + *
5186 + * @type {DataTypes}
5187 + */
5188 + (0, _defineProperty2.default)(_this, "type", void 0);
5189 + if ((_this$args$options = _this.args.options) !== null && _this$args$options !== void 0 && _this$args$options.type) {
5190 + _this.type = _this.args.options.type;
5191 + }
5192 + return _this;
5193 + }
5194 +
5195 + /**
5196 + * Function getEndpointFormat().
5197 + *
5198 + * @return {null|string} endpoint format
5199 + */
5200 + (0, _inherits2.default)(CommandData, _CommandBase);
5201 + return (0, _createClass2.default)(CommandData, [{
5202 + key: "getApplyMethods",
5203 + value:
5204 + /**
5205 + * @param {DataTypes} type
5206 + *
5207 + * @return {boolean|{before: (function(*=): {}), after: (function({}, *=): {})}} apply methods
5208 + */
5209 + function getApplyMethods() {
5210 + var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.type;
5211 + var before, after;
5212 + switch (type) {
5213 + case 'create':
5214 + before = this.applyBeforeCreate;
5215 + after = this.applyAfterCreate;
5216 + break;
5217 + case 'delete':
5218 + before = this.applyBeforeDelete;
5219 + after = this.applyAfterDelete;
5220 + break;
5221 + case 'get':
5222 + before = this.applyBeforeGet;
5223 + after = this.applyAfterGet;
5224 + break;
5225 + case 'update':
5226 + before = this.applyBeforeUpdate;
5227 + after = this.applyAfterUpdate;
5228 + break;
5229 + case 'options':
5230 + before = this.applyBeforeOptions;
5231 + after = this.applyAfterOptions;
5232 + break;
5233 + default:
5234 + return false;
5235 + }
5236 + return {
5237 + before: before.bind(this),
5238 + after: after.bind(this)
5239 + };
5240 + }
5241 +
5242 + /**
5243 + * Function getRequestData().
5244 + *
5245 + * @return {RequestData} request data
5246 + */
5247 + }, {
5248 + key: "getRequestData",
5249 + value: function getRequestData() {
5250 + return {
5251 + type: this.type,
5252 + args: this.args,
5253 + timestamp: new Date().getTime(),
5254 + component: this.component,
5255 + command: this.command,
5256 + endpoint: $e.data.commandToEndpoint(this.command, JSON.parse(JSON.stringify(this.args)), this.constructor.getEndpointFormat())
5257 + };
5258 + }
5259 + }, {
5260 + key: "apply",
5261 + value: function apply() {
5262 + var _this2 = this;
5263 + var applyMethods = this.getApplyMethods();
5264 +
5265 + // Run 'before' method.
5266 + this.args = applyMethods.before(this.args);
5267 + var requestData = this.getRequestData();
5268 + return $e.data.fetch(requestData).then(function (data) {
5269 + _this2.data = data;
5270 +
5271 + // Run 'after' method.
5272 + _this2.data = applyMethods.after(data, _this2.args);
5273 + _this2.data = {
5274 + data: _this2.data
5275 + };
5276 +
5277 + // Append requestData.
5278 + _this2.data = Object.assign({
5279 + __requestData__: requestData
5280 + }, _this2.data);
5281 + return _this2.data;
5282 + });
5283 + }
5284 +
5285 + /**
5286 + * @param {*} [args={}]
5287 + * @return {{}} filtered args
5288 + */
5289 + }, {
5290 + key: "applyBeforeCreate",
5291 + value: function applyBeforeCreate() {
5292 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
5293 + return args;
5294 + }
5295 +
5296 + /**
5297 + * @param {{}} data
5298 + * @param {*} [args={}]
5299 + * @return {{}} filtered result
5300 + */
5301 + }, {
5302 + key: "applyAfterCreate",
5303 + value: function applyAfterCreate(data) {
5304 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
5305 + // eslint-disable-line no-unused-vars
5306 + return data;
5307 + }
5308 +
5309 + /**
5310 + * @param {*} [args={}]
5311 + * @return {{}} filtered args
5312 + */
5313 + }, {
5314 + key: "applyBeforeDelete",
5315 + value: function applyBeforeDelete() {
5316 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
5317 + return args;
5318 + }
5319 +
5320 + /**
5321 + * @param {{}} data
5322 + * @param {*} [args={}]
5323 + * @return {{}} filtered result
5324 + */
5325 + }, {
5326 + key: "applyAfterDelete",
5327 + value: function applyAfterDelete(data) {
5328 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
5329 + // eslint-disable-line no-unused-vars
5330 + return data;
5331 + }
5332 +
5333 + /**
5334 + * @param {*} [args={}]
5335 + * @return {{}} filtered args
5336 + */
5337 + }, {
5338 + key: "applyBeforeGet",
5339 + value: function applyBeforeGet() {
5340 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
5341 + return args;
5342 + }
5343 +
5344 + /**
5345 + * @param {{}} data
5346 + * @param {*} [args={}]
5347 + * @return {{}} filtered result
5348 + */
5349 + }, {
5350 + key: "applyAfterGet",
5351 + value: function applyAfterGet(data) {
5352 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
5353 + // eslint-disable-line no-unused-vars
5354 + return data;
5355 + }
5356 +
5357 + /**
5358 + * @param {*} [args={}]
5359 + * @return {{}} filtered args
5360 + */
5361 + }, {
5362 + key: "applyBeforeUpdate",
5363 + value: function applyBeforeUpdate() {
5364 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
5365 + return args;
5366 + }
5367 +
5368 + /**
5369 + * @param {{}} data
5370 + * @param {*} [args={}]
5371 + * @return {{}} filtered result
5372 + */
5373 + }, {
5374 + key: "applyAfterUpdate",
5375 + value: function applyAfterUpdate(data) {
5376 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
5377 + // eslint-disable-line no-unused-vars
5378 + return data;
5379 + }
5380 +
5381 + /**
5382 + * @param {*} [args={}]
5383 + * @return {{}} filtered args
5384 + */
5385 + }, {
5386 + key: "applyBeforeOptions",
5387 + value: function applyBeforeOptions() {
5388 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
5389 + return args;
5390 + }
5391 +
5392 + /**
5393 + * @param {{}} data
5394 + * @param {*} [args={}]
5395 + * @return {{}} filtered result
5396 + */
5397 + }, {
5398 + key: "applyAfterOptions",
5399 + value: function applyAfterOptions(data) {
5400 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
5401 + // eslint-disable-line no-unused-vars
5402 + return data;
5403 + }
5404 +
5405 + /**
5406 + * @param {BaseError} e
5407 + */
5408 + }, {
5409 + key: "applyAfterCatch",
5410 + value: function applyAfterCatch(e) {
5411 + e.notify();
5412 + }
5413 + }, {
5414 + key: "onCatchApply",
5415 + value: function onCatchApply(e) {
5416 + var _e;
5417 + // TODO: If the errors that returns from the server is consistent remove the '?' from 'e'
5418 + var httpErrorCode = ((_e = e) === null || _e === void 0 || (_e = _e.data) === null || _e === void 0 ? void 0 : _e.status) || 501;
5419 + var dataError = Object.values(errors).find(function (error) {
5420 + return error.getHTTPErrorCode() === httpErrorCode;
5421 + });
5422 + if (!dataError) {
5423 + dataError = errors.DefaultError;
5424 + }
5425 + e = dataError.create(e.message, e.code, e.data || []);
5426 + this.runCatchHooks(e);
5427 + this.applyAfterCatch(e);
5428 + }
5429 + }], [{
5430 + key: "getInstanceType",
5431 + value: function getInstanceType() {
5432 + return 'CommandData';
5433 + }
5434 + }, {
5435 + key: "getEndpointFormat",
5436 + value: function getEndpointFormat() {
5437 + return null;
5438 + }
5439 + }]);
5440 +}(_commandBase.default);
5441 +
5442 +/***/ }),
5443 +
5444 +/***/ "../modules/web-cli/assets/js/modules/command-infra.js":
5445 +/*!*************************************************************!*\
5446 + !*** ../modules/web-cli/assets/js/modules/command-infra.js ***!
5447 + \*************************************************************/
5448 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5449 +
5450 +"use strict";
5451 +
5452 +
5453 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
5454 +Object.defineProperty(exports, "__esModule", ({
5455 + value: true
5456 +}));
5457 +exports["default"] = void 0;
5458 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
5459 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
5460 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
5461 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
5462 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
5463 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
5464 +var _argsObject = _interopRequireDefault(__webpack_require__(/*! elementor-assets-js/modules/imports/args-object */ "../assets/dev/js/modules/imports/args-object.js"));
5465 +var _deprecation = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/deprecation */ "../modules/web-cli/assets/js/utils/deprecation.js"));
5466 +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)); }
5467 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
5468 +/**
5469 + * @typedef {import('../modules/component-base')} ComponentBase
5470 + */
5471 +var CommandInfra = exports["default"] = /*#__PURE__*/function (_ArgsObject) {
5472 + /**
5473 + * Function constructor().
5474 + *
5475 + * Create Commands Base.
5476 + *
5477 + * @param {{}} args
5478 + */
5479 + function CommandInfra() {
5480 + var _this;
5481 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
5482 + (0, _classCallCheck2.default)(this, CommandInfra);
5483 + _this = _callSuper(this, CommandInfra, [args]);
5484 + if (!_this.constructor.registerConfig) {
5485 + throw RangeError('Doing it wrong: Each command type should have `registerConfig`.');
5486 + }
5487 +
5488 + // Acknowledge self about which command it run.
5489 + _this.command = _this.constructor.getCommand();
5490 +
5491 + // Assign instance of current component.
5492 + _this.component = _this.constructor.getComponent();
5493 +
5494 + // Who ever need do something before without `super` the constructor can use `initialize` method.
5495 + _this.initialize(args);
5496 +
5497 + // Refresh args, maybe the changed via `initialize`.
5498 + args = _this.args;
5499 +
5500 + // Validate args before run.
5501 + _this.validateArgs(args);
5502 + return _this;
5503 + }
5504 +
5505 + /**
5506 + * Function initialize().
5507 + *
5508 + * Initialize command, called after construction.
5509 + *
5510 + * @param {{}} args
5511 + */
5512 + (0, _inherits2.default)(CommandInfra, _ArgsObject);
5513 + return (0, _createClass2.default)(CommandInfra, [{
5514 + key: "currentCommand",
5515 + get:
5516 + /**
5517 + * @deprecated since 3.7.0, use `this.command` instead.
5518 + */
5519 + function get() {
5520 + _deprecation.default.deprecated('this.currentCommand', '3.7.0', 'this.command');
5521 + return this.command;
5522 + }
5523 + }, {
5524 + key: "initialize",
5525 + value: function initialize() {
5526 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
5527 + } // eslint-disable-line no-unused-vars
5528 +
5529 + /**
5530 + * Function validateArgs().
5531 + *
5532 + * Validate command arguments.
5533 + *
5534 + * @param {{}} args
5535 + */
5536 + }, {
5537 + key: "validateArgs",
5538 + value: function validateArgs() {
5539 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
5540 + } // eslint-disable-line no-unused-vars
5541 +
5542 + // eslint-disable-next-line jsdoc/require-returns-check
5543 + /**
5544 + * Function apply().
5545 + *
5546 + * Do the actual command.
5547 + *
5548 + * @param {{}} args
5549 + *
5550 + * @return {*} Command results.
5551 + */
5552 + }, {
5553 + key: "apply",
5554 + value: function apply() {
5555 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
5556 + // eslint-disable-line no-unused-vars
5557 + elementorModules.ForceMethodImplementation();
5558 + }
5559 +
5560 + /**
5561 + * Function run().
5562 + *
5563 + * Run command with history & hooks.
5564 + *
5565 + * @return {*} Command results.
5566 + */
5567 + }, {
5568 + key: "run",
5569 + value: function run() {
5570 + return this.apply(this.args);
5571 + }
5572 +
5573 + /**
5574 + * Function onBeforeRun.
5575 + *
5576 + * Called before run().
5577 + *
5578 + * @param {{}} args
5579 + */
5580 + }, {
5581 + key: "onBeforeRun",
5582 + value: function onBeforeRun() {
5583 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
5584 + } // eslint-disable-line no-unused-vars
5585 +
5586 + /**
5587 + * Function onAfterRun.
5588 + *
5589 + * Called after run().
5590 + *
5591 + * @param {{}} args
5592 + * @param {*} result
5593 + */
5594 + }, {
5595 + key: "onAfterRun",
5596 + value: function onAfterRun() {
5597 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
5598 + var result = arguments.length > 1 ? arguments[1] : undefined;
5599 + } // eslint-disable-line no-unused-vars
5600 +
5601 + /**
5602 + * Function onBeforeApply.
5603 + *
5604 + * Called before apply().
5605 + *
5606 + * @param {{}} args
5607 + */
5608 + }, {
5609 + key: "onBeforeApply",
5610 + value: function onBeforeApply() {
5611 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
5612 + } // eslint-disable-line no-unused-vars
5613 +
5614 + /**
5615 + * Function onAfterApply.
5616 + *
5617 + * Called after apply().
5618 + *
5619 + * @param {{}} args
5620 + * @param {*} result
5621 + */
5622 + }, {
5623 + key: "onAfterApply",
5624 + value: function onAfterApply() {
5625 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
5626 + var result = arguments.length > 1 ? arguments[1] : undefined;
5627 + } // eslint-disable-line no-unused-vars
5628 +
5629 + /**
5630 + * Function onCatchApply.
5631 + *
5632 + * Called after apply() failed.
5633 + *
5634 + * @param {Error} e
5635 + */
5636 + }, {
5637 + key: "onCatchApply",
5638 + value: function onCatchApply(e) {} // eslint-disable-line no-unused-vars
5639 + }], [{
5640 + key: "getInstanceType",
5641 + value: function getInstanceType() {
5642 + return 'CommandInfra';
5643 + }
5644 +
5645 + /**
5646 + * Get info of command.
5647 + *
5648 + * @return {Object} Extra information about the command.
5649 + */
5650 + }, {
5651 + key: "getInfo",
5652 + value: function getInfo() {
5653 + return {};
5654 + }
5655 +
5656 + /**
5657 + * @return {string} Self command name.
5658 + */
5659 + }, {
5660 + key: "getCommand",
5661 + value: function getCommand() {
5662 + return this.registerConfig.command;
5663 + }
5664 +
5665 + /**
5666 + * @return {ComponentBase} Self component
5667 + */
5668 + }, {
5669 + key: "getComponent",
5670 + value: function getComponent() {
5671 + return this.registerConfig.component;
5672 + }
5673 + }, {
5674 + key: "setRegisterConfig",
5675 + value: function setRegisterConfig(config) {
5676 + this.registerConfig = Object.freeze(config);
5677 + }
5678 + }]);
5679 +}(_argsObject.default);
5680 +/**
5681 + * @type {Object}
5682 + */
5683 +(0, _defineProperty2.default)(CommandInfra, "registerConfig", null);
5684 +
5685 +/***/ }),
5686 +
5687 +/***/ "../modules/web-cli/assets/js/modules/command-internal-base.js":
5688 +/*!*********************************************************************!*\
5689 + !*** ../modules/web-cli/assets/js/modules/command-internal-base.js ***!
5690 + \*********************************************************************/
5691 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5692 +
5693 +"use strict";
5694 +
5695 +
5696 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
5697 +Object.defineProperty(exports, "__esModule", ({
5698 + value: true
5699 +}));
5700 +exports["default"] = void 0;
5701 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
5702 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
5703 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
5704 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
5705 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
5706 +var _commandBase = _interopRequireDefault(__webpack_require__(/*! ./command-base */ "../modules/web-cli/assets/js/modules/command-base.js"));
5707 +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)); }
5708 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
5709 +/**
5710 + * @name $e.modules.CommandInternalBase
5711 + */
5712 +var CommandInternalBase = exports["default"] = /*#__PURE__*/function (_CommandBase) {
5713 + function CommandInternalBase(args) {
5714 + var commandsAPI = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : $e.commandsInternal;
5715 + (0, _classCallCheck2.default)(this, CommandInternalBase);
5716 + return _callSuper(this, CommandInternalBase, [args, commandsAPI]);
5717 + }
5718 + (0, _inherits2.default)(CommandInternalBase, _CommandBase);
5719 + return (0, _createClass2.default)(CommandInternalBase, null, [{
5720 + key: "getInstanceType",
5721 + value: function getInstanceType() {
5722 + return 'CommandInternalBase';
5723 + }
5724 + }]);
5725 +}(_commandBase.default);
5726 +
5727 +/***/ }),
5728 +
5729 +/***/ "../modules/web-cli/assets/js/modules/commands/close.js":
5730 +/*!**************************************************************!*\
5731 + !*** ../modules/web-cli/assets/js/modules/commands/close.js ***!
5732 + \**************************************************************/
5733 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5734 +
5735 +"use strict";
5736 +
5737 +
5738 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
5739 +Object.defineProperty(exports, "__esModule", ({
5740 + value: true
5741 +}));
5742 +exports["default"] = exports.Close = void 0;
5743 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
5744 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
5745 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
5746 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
5747 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
5748 +var _commandBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js"));
5749 +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)); }
5750 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
5751 +var Close = exports.Close = /*#__PURE__*/function (_CommandBase) {
5752 + function Close() {
5753 + (0, _classCallCheck2.default)(this, Close);
5754 + return _callSuper(this, Close, arguments);
5755 + }
5756 + (0, _inherits2.default)(Close, _CommandBase);
5757 + return (0, _createClass2.default)(Close, [{
5758 + key: "apply",
5759 + value: function apply() {
5760 + this.component.close();
5761 + }
5762 + }]);
5763 +}(_commandBase.default);
5764 +var _default = exports["default"] = Close;
5765 +
5766 +/***/ }),
5767 +
5768 +/***/ "../modules/web-cli/assets/js/modules/commands/index.js":
5769 +/*!**************************************************************!*\
5770 + !*** ../modules/web-cli/assets/js/modules/commands/index.js ***!
5771 + \**************************************************************/
5772 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5773 +
5774 +"use strict";
5775 +
5776 +
5777 +Object.defineProperty(exports, "__esModule", ({
5778 + value: true
5779 +}));
5780 +Object.defineProperty(exports, "Close", ({
5781 + enumerable: true,
5782 + get: function get() {
5783 + return _close.Close;
5784 + }
5785 +}));
5786 +Object.defineProperty(exports, "Open", ({
5787 + enumerable: true,
5788 + get: function get() {
5789 + return _open.Open;
5790 + }
5791 +}));
5792 +Object.defineProperty(exports, "Toggle", ({
5793 + enumerable: true,
5794 + get: function get() {
5795 + return _toggle.Toggle;
5796 + }
5797 +}));
5798 +var _close = __webpack_require__(/*! ./close */ "../modules/web-cli/assets/js/modules/commands/close.js");
5799 +var _open = __webpack_require__(/*! ./open */ "../modules/web-cli/assets/js/modules/commands/open.js");
5800 +var _toggle = __webpack_require__(/*! ./toggle */ "../modules/web-cli/assets/js/modules/commands/toggle.js");
5801 +
5802 +/***/ }),
5803 +
5804 +/***/ "../modules/web-cli/assets/js/modules/commands/open.js":
5805 +/*!*************************************************************!*\
5806 + !*** ../modules/web-cli/assets/js/modules/commands/open.js ***!
5807 + \*************************************************************/
5808 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5809 +
5810 +"use strict";
5811 +
5812 +
5813 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
5814 +Object.defineProperty(exports, "__esModule", ({
5815 + value: true
5816 +}));
5817 +exports["default"] = exports.Open = void 0;
5818 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
5819 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
5820 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
5821 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
5822 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
5823 +var _commandBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js"));
5824 +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)); }
5825 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
5826 +var Open = exports.Open = /*#__PURE__*/function (_CommandBase) {
5827 + function Open() {
5828 + (0, _classCallCheck2.default)(this, Open);
5829 + return _callSuper(this, Open, arguments);
5830 + }
5831 + (0, _inherits2.default)(Open, _CommandBase);
5832 + return (0, _createClass2.default)(Open, [{
5833 + key: "apply",
5834 + value: function apply() {
5835 + $e.route(this.component.getNamespace());
5836 + }
5837 + }]);
5838 +}(_commandBase.default);
5839 +var _default = exports["default"] = Open;
5840 +
5841 +/***/ }),
5842 +
5843 +/***/ "../modules/web-cli/assets/js/modules/commands/toggle.js":
5844 +/*!***************************************************************!*\
5845 + !*** ../modules/web-cli/assets/js/modules/commands/toggle.js ***!
5846 + \***************************************************************/
5847 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5848 +
5849 +"use strict";
5850 +
5851 +
5852 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
5853 +Object.defineProperty(exports, "__esModule", ({
5854 + value: true
5855 +}));
5856 +exports["default"] = exports.Toggle = void 0;
5857 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
5858 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
5859 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
5860 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
5861 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
5862 +var _commandBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js"));
5863 +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)); }
5864 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
5865 +var Toggle = exports.Toggle = /*#__PURE__*/function (_CommandBase) {
5866 + function Toggle() {
5867 + (0, _classCallCheck2.default)(this, Toggle);
5868 + return _callSuper(this, Toggle, arguments);
5869 + }
5870 + (0, _inherits2.default)(Toggle, _CommandBase);
5871 + return (0, _createClass2.default)(Toggle, [{
5872 + key: "apply",
5873 + value: function apply() {
5874 + if (this.component.isOpen) {
5875 + this.component.close();
5876 + } else {
5877 + $e.route(this.component.getNamespace());
5878 + }
5879 + }
5880 + }]);
5881 +}(_commandBase.default);
5882 +var _default = exports["default"] = Toggle;
5883 +
5884 +/***/ }),
5885 +
5886 +/***/ "../modules/web-cli/assets/js/modules/component-base.js":
5887 +/*!**************************************************************!*\
5888 + !*** ../modules/web-cli/assets/js/modules/component-base.js ***!
5889 + \**************************************************************/
5890 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5891 +
5892 +"use strict";
5893 +
5894 +
5895 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
5896 +Object.defineProperty(exports, "__esModule", ({
5897 + value: true
5898 +}));
5899 +exports["default"] = void 0;
5900 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
5901 +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
5902 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
5903 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
5904 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
5905 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
5906 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
5907 +var _commandCallbackBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-callback-base */ "../modules/web-cli/assets/js/modules/command-callback-base.js"));
5908 +var _toolkit = __webpack_require__(/*! @reduxjs/toolkit */ "../node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js");
5909 +var _module = _interopRequireDefault(__webpack_require__(/*! elementor/assets/dev/js/modules/imports/module.js */ "../assets/dev/js/modules/imports/module.js"));
5910 +var _forceMethodImplementation = _interopRequireDefault(__webpack_require__(/*! ../utils/force-method-implementation */ "../modules/web-cli/assets/js/utils/force-method-implementation.js"));
5911 +var _deprecation = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/deprecation */ "../modules/web-cli/assets/js/utils/deprecation.js"));
5912 +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; }
5913 +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; }
5914 +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)); }
5915 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
5916 +/**
5917 + * @typedef {import('./command-infra')} CommandInfra
5918 + * @typedef {import('./hook-base')} HookBase
5919 + * @typedef {import('../core/states/ui-state-base')} UiStateBase
5920 + */
5921 +var ComponentBase = exports["default"] = /*#__PURE__*/function (_Module) {
5922 + function ComponentBase() {
5923 + (0, _classCallCheck2.default)(this, ComponentBase);
5924 + return _callSuper(this, ComponentBase, arguments);
5925 + }
5926 + (0, _inherits2.default)(ComponentBase, _Module);
5927 + return (0, _createClass2.default)(ComponentBase, [{
5928 + key: "__construct",
5929 + value: function __construct() {
5930 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
5931 + if (args.manager) {
5932 + this.manager = args.manager;
5933 + }
5934 + this.commands = this.defaultCommands();
5935 + this.commandsInternal = this.defaultCommandsInternal();
5936 + this.hooks = this.defaultHooks();
5937 + this.routes = this.defaultRoutes();
5938 + this.tabs = this.defaultTabs();
5939 + this.shortcuts = this.defaultShortcuts();
5940 + this.utils = this.defaultUtils();
5941 + this.data = this.defaultData();
5942 + this.uiStates = this.defaultUiStates();
5943 + this.states = this.defaultStates();
5944 + this.defaultRoute = '';
5945 + this.currentTab = '';
5946 + }
5947 + }, {
5948 + key: "registerAPI",
5949 + value: function registerAPI() {
5950 + var _this = this;
5951 + Object.entries(this.getTabs()).forEach(function (tab) {
5952 + return _this.registerTabRoute(tab[0]);
5953 + });
5954 + Object.entries(this.getRoutes()).forEach(function (_ref) {
5955 + var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
5956 + route = _ref2[0],
5957 + callback = _ref2[1];
5958 + return _this.registerRoute(route, callback);
5959 + });
5960 + Object.entries(this.getCommands()).forEach(function (_ref3) {
5961 + var _ref4 = (0, _slicedToArray2.default)(_ref3, 2),
5962 + command = _ref4[0],
5963 + callback = _ref4[1];
5964 + return _this.registerCommand(command, callback);
5965 + });
5966 + Object.entries(this.getCommandsInternal()).forEach(function (_ref5) {
5967 + var _ref6 = (0, _slicedToArray2.default)(_ref5, 2),
5968 + command = _ref6[0],
5969 + callback = _ref6[1];
5970 + return _this.registerCommandInternal(command, callback);
5971 + });
5972 + Object.values(this.getHooks()).forEach(function (instance) {
5973 + return _this.registerHook(instance);
5974 + });
5975 + Object.entries(this.getData()).forEach(function (_ref7) {
5976 + var _ref8 = (0, _slicedToArray2.default)(_ref7, 2),
5977 + command = _ref8[0],
5978 + callback = _ref8[1];
5979 + return _this.registerData(command, callback);
5980 + });
5981 + Object.values(this.getUiStates()).forEach(function (instance) {
5982 + return _this.registerUiState(instance);
5983 + });
5984 + Object.entries(this.getStates()).forEach(function (_ref9) {
5985 + var _ref0 = (0, _slicedToArray2.default)(_ref9, 2),
5986 + id = _ref0[0],
5987 + state = _ref0[1];
5988 + return _this.registerState(id, state);
5989 + });
5990 + }
5991 +
5992 + // eslint-disable-next-line jsdoc/require-returns-check
5993 + /**
5994 + * @return {string} namespace
5995 + */
5996 + }, {
5997 + key: "getNamespace",
5998 + value: function getNamespace() {
5999 + (0, _forceMethodImplementation.default)();
6000 + }
6001 +
6002 + /**
6003 + * @deprecated since 3.7.0, use `getServiceName()` instead.
6004 + */
6005 + }, {
6006 + key: "getRootContainer",
6007 + value: function getRootContainer() {
6008 + _deprecation.default.deprecated('getRootContainer()', '3.7.0', 'getServiceName()');
6009 + return this.getServiceName();
6010 + }
6011 + }, {
6012 + key: "getServiceName",
6013 + value: function getServiceName() {
6014 + return this.getNamespace().split('/')[0];
6015 + }
6016 + }, {
6017 + key: "store",
6018 + get: function get() {
6019 + return $e.store.get(this.getNamespace());
6020 + }
6021 + }, {
6022 + key: "defaultTabs",
6023 + value: function defaultTabs() {
6024 + return {};
6025 + }
6026 + }, {
6027 + key: "defaultRoutes",
6028 + value: function defaultRoutes() {
6029 + return {};
6030 + }
6031 + }, {
6032 + key: "defaultCommands",
6033 + value: function defaultCommands() {
6034 + return {};
6035 + }
6036 + }, {
6037 + key: "defaultCommandsInternal",
6038 + value: function defaultCommandsInternal() {
6039 + return {};
6040 + }
6041 + }, {
6042 + key: "defaultHooks",
6043 + value: function defaultHooks() {
6044 + return {};
6045 + }
6046 +
6047 + /**
6048 + * Get the component's default UI states.
6049 + *
6050 + * @return {Object} default UI states
6051 + */
6052 + }, {
6053 + key: "defaultUiStates",
6054 + value: function defaultUiStates() {
6055 + return {};
6056 + }
6057 +
6058 + /**
6059 + * Get the component's Redux slice settings.
6060 + *
6061 + * @return {Object} Redux slice settings
6062 + */
6063 + }, {
6064 + key: "defaultStates",
6065 + value: function defaultStates() {
6066 + return {};
6067 + }
6068 + }, {
6069 + key: "defaultShortcuts",
6070 + value: function defaultShortcuts() {
6071 + return {};
6072 + }
6073 + }, {
6074 + key: "defaultUtils",
6075 + value: function defaultUtils() {
6076 + return {};
6077 + }
6078 + }, {
6079 + key: "defaultData",
6080 + value: function defaultData() {
6081 + return {};
6082 + }
6083 + }, {
6084 + key: "getCommands",
6085 + value: function getCommands() {
6086 + return this.commands;
6087 + }
6088 + }, {
6089 + key: "getCommandsInternal",
6090 + value: function getCommandsInternal() {
6091 + return this.commandsInternal;
6092 + }
6093 + }, {
6094 + key: "getHooks",
6095 + value: function getHooks() {
6096 + return this.hooks;
6097 + }
6098 +
6099 + /**
6100 + * Retrieve the component's UI states.
6101 + *
6102 + * @return {Object} UI states
6103 + */
6104 + }, {
6105 + key: "getUiStates",
6106 + value: function getUiStates() {
6107 + return this.uiStates;
6108 + }
6109 +
6110 + /**
6111 + * Retrieve the component's Redux Slice.
6112 + *
6113 + * @return {Object} Redux Slice
6114 + */
6115 + }, {
6116 + key: "getStates",
6117 + value: function getStates() {
6118 + return this.states;
6119 + }
6120 + }, {
6121 + key: "getRoutes",
6122 + value: function getRoutes() {
6123 + return this.routes;
6124 + }
6125 + }, {
6126 + key: "getTabs",
6127 + value: function getTabs() {
6128 + return this.tabs;
6129 + }
6130 + }, {
6131 + key: "getShortcuts",
6132 + value: function getShortcuts() {
6133 + return this.shortcuts;
6134 + }
6135 + }, {
6136 + key: "getData",
6137 + value: function getData() {
6138 + return this.data;
6139 + }
6140 +
6141 + /**
6142 + * @param {string} command
6143 + * @param {(()=>{}|CommandInfra)} context
6144 + * @param {'default'|'internal'|'data'} commandsType
6145 + */
6146 + }, {
6147 + key: "registerCommand",
6148 + value: function registerCommand(command, context) {
6149 + var commandsType = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'default';
6150 + var commandsManager;
6151 + switch (commandsType) {
6152 + case 'default':
6153 + commandsManager = $e.commands;
6154 + break;
6155 + case 'internal':
6156 + commandsManager = $e.commandsInternal;
6157 + break;
6158 + case 'data':
6159 + commandsManager = $e.data;
6160 + break;
6161 + default:
6162 + throw new Error("Invalid commands type: '".concat(command, "'"));
6163 + }
6164 + var fullCommand = this.getNamespace() + '/' + command,
6165 + instanceType = context.getInstanceType ? context.getInstanceType() : false,
6166 + registerConfig = {
6167 + command: fullCommand,
6168 + component: this
6169 + };
6170 +
6171 + // Support pure callback.
6172 + if (!instanceType) {
6173 + if ($e.devTools) {
6174 + $e.devTools.log.warn("Attach command-callback-base, on command: '".concat(fullCommand, "', context is unknown type."));
6175 + }
6176 + registerConfig.callback = context;
6177 +
6178 + // Unique class.
6179 + context = /*#__PURE__*/function (_CommandCallbackBase) {
6180 + function context() {
6181 + (0, _classCallCheck2.default)(this, context);
6182 + return _callSuper(this, context, arguments);
6183 + }
6184 + (0, _inherits2.default)(context, _CommandCallbackBase);
6185 + return (0, _createClass2.default)(context);
6186 + }(_commandCallbackBase.default);
6187 + }
6188 + context.setRegisterConfig(registerConfig);
6189 + commandsManager.register(this, command, context);
6190 + }
6191 +
6192 + /**
6193 + * @param {HookBase} instance
6194 + */
6195 + }, {
6196 + key: "registerHook",
6197 + value: function registerHook(instance) {
6198 + return instance.register();
6199 + }
6200 + }, {
6201 + key: "registerCommandInternal",
6202 + value: function registerCommandInternal(command, context) {
6203 + this.registerCommand(command, context, 'internal');
6204 + }
6205 +
6206 + /**
6207 + * Register a UI state.
6208 + *
6209 + * @param {UiStateBase} instance - UI state instance.
6210 + *
6211 + * @return {void}
6212 + */
6213 + }, {
6214 + key: "registerUiState",
6215 + value: function registerUiState(instance) {
6216 + $e.uiStates.register(instance);
6217 + }
6218 +
6219 + /**
6220 + * Register a Redux Slice.
6221 + *
6222 + * @param {string} id - State id.
6223 + * @param {Object} stateConfig - The state config.
6224 + *
6225 + * @return {void}
6226 + */
6227 + }, {
6228 + key: "registerState",
6229 + value: function registerState(id, stateConfig) {
6230 + id = this.getNamespace() + (id ? "/".concat(id) : '');
6231 + var slice = (0, _toolkit.createSlice)(_objectSpread(_objectSpread({}, stateConfig), {}, {
6232 + name: id
6233 + }));
6234 + $e.store.register(id, slice);
6235 + }
6236 + }, {
6237 + key: "registerRoute",
6238 + value: function registerRoute(route, callback) {
6239 + $e.routes.register(this, route, callback);
6240 + }
6241 + }, {
6242 + key: "registerData",
6243 + value: function registerData(command, context) {
6244 + this.registerCommand(command, context, 'data');
6245 + }
6246 + }, {
6247 + key: "unregisterRoute",
6248 + value: function unregisterRoute(route) {
6249 + $e.routes.unregister(this, route);
6250 + }
6251 + }, {
6252 + key: "registerTabRoute",
6253 + value: function registerTabRoute(tab) {
6254 + var _this2 = this;
6255 + this.registerRoute(tab, function (args) {
6256 + return _this2.activateTab(tab, args);
6257 + });
6258 + }
6259 + }, {
6260 + key: "dependency",
6261 + value: function dependency() {
6262 + return true;
6263 + }
6264 + }, {
6265 + key: "open",
6266 + value: function open() {
6267 + return true;
6268 + }
6269 + }, {
6270 + key: "close",
6271 + value: function close() {
6272 + if (!this.isOpen) {
6273 + return false;
6274 + }
6275 + this.isOpen = false;
6276 + this.inactivate();
6277 + $e.routes.clearCurrent(this.getNamespace());
6278 + $e.routes.clearHistory(this.getServiceName());
6279 + return true;
6280 + }
6281 + }, {
6282 + key: "activate",
6283 + value: function activate() {
6284 + $e.components.activate(this.getNamespace());
6285 + }
6286 + }, {
6287 + key: "inactivate",
6288 + value: function inactivate() {
6289 + $e.components.inactivate(this.getNamespace());
6290 + }
6291 + }, {
6292 + key: "isActive",
6293 + value: function isActive() {
6294 + return $e.components.isActive(this.getNamespace());
6295 + }
6296 + }, {
6297 + key: "onRoute",
6298 + value: function onRoute(route) {
6299 + this.toggleRouteClass(route, true);
6300 + this.toggleHistoryClass();
6301 + this.activate();
6302 + this.trigger('route/open', route);
6303 + }
6304 + }, {
6305 + key: "onCloseRoute",
6306 + value: function onCloseRoute(route) {
6307 + this.toggleRouteClass(route, false);
6308 + this.inactivate();
6309 + this.trigger('route/close', route);
6310 + }
6311 + }, {
6312 + key: "setDefaultRoute",
6313 + value: function setDefaultRoute(route) {
6314 + this.defaultRoute = this.getNamespace() + '/' + route;
6315 + }
6316 + }, {
6317 + key: "getDefaultRoute",
6318 + value: function getDefaultRoute() {
6319 + return this.defaultRoute;
6320 + }
6321 + }, {
6322 + key: "removeTab",
6323 + value: function removeTab(tab) {
6324 + delete this.tabs[tab];
6325 + this.unregisterRoute(tab);
6326 + }
6327 + }, {
6328 + key: "hasTab",
6329 + value: function hasTab(tab) {
6330 + return !!this.tabs[tab];
6331 + }
6332 + }, {
6333 + key: "addTab",
6334 + value: function addTab(tab, args, position) {
6335 + var _this3 = this;
6336 + this.tabs[tab] = args;
6337 + // It can be 0.
6338 + if ('undefined' !== typeof position) {
6339 + var newTabs = {};
6340 + var ids = Object.keys(this.tabs);
6341 + // Remove new tab
6342 + ids.pop();
6343 +
6344 + // Add it to position.
6345 + ids.splice(position, 0, tab);
6346 + ids.forEach(function (id) {
6347 + newTabs[id] = _this3.tabs[id];
6348 + });
6349 + this.tabs = newTabs;
6350 + }
6351 + this.registerTabRoute(tab);
6352 + }
6353 + }, {
6354 + key: "getTabsWrapperSelector",
6355 + value: function getTabsWrapperSelector() {
6356 + return '';
6357 + }
6358 + }, {
6359 + key: "getTabRoute",
6360 + value: function getTabRoute(tab) {
6361 + return this.getNamespace() + '/' + tab;
6362 + }
6363 + }, {
6364 + key: "renderTab",
6365 + value: function renderTab(tab) {} // eslint-disable-line
6366 + }, {
6367 + key: "activateTab",
6368 + value: function activateTab(tab, args) {
6369 + var _this4 = this;
6370 + this.renderTab(tab, args);
6371 + jQuery(this.getTabsWrapperSelector() + ' .elementor-component-tab').off('click').on('click', function (event) {
6372 + $e.route(_this4.getTabRoute(event.currentTarget.dataset.tab), args);
6373 + }).removeClass('elementor-active').filter('[data-tab="' + tab + '"]').addClass('elementor-active');
6374 + }
6375 + }, {
6376 + key: "getActiveTabConfig",
6377 + value: function getActiveTabConfig() {
6378 + return this.tabs[this.currentTab] || {};
6379 + }
6380 + }, {
6381 + key: "getBodyClass",
6382 + value: function getBodyClass(route) {
6383 + return 'e-route-' + route.replace(/\//g, '-');
6384 + }
6385 +
6386 + /**
6387 + * If command includes uppercase character convert it to lowercase and add `-`.
6388 + * e.g: `CopyAll` is converted to `copy-all`.
6389 + *
6390 + * @param {string} commandName
6391 + */
6392 + }, {
6393 + key: "normalizeCommandName",
6394 + value: function normalizeCommandName(commandName) {
6395 + return commandName.replace(/[A-Z]/g, function (match, offset) {
6396 + return (offset > 0 ? '-' : '') + match.toLowerCase();
6397 + });
6398 + }
6399 +
6400 + /**
6401 + * @param {{}} commandsFromImport
6402 + * @return {{}} imported commands
6403 + */
6404 + }, {
6405 + key: "importCommands",
6406 + value: function importCommands(commandsFromImport) {
6407 + var _this5 = this;
6408 + var commands = {};
6409 +
6410 + // Convert `Commands` to `ComponentBase` workable format.
6411 + Object.entries(commandsFromImport).forEach(function (_ref1) {
6412 + var _ref10 = (0, _slicedToArray2.default)(_ref1, 2),
6413 + className = _ref10[0],
6414 + Class = _ref10[1];
6415 + var command = _this5.normalizeCommandName(className);
6416 + commands[command] = Class;
6417 + });
6418 + return commands;
6419 + }
6420 + }, {
6421 + key: "importHooks",
6422 + value: function importHooks(hooksFromImport) {
6423 + var hooks = {};
6424 + for (var key in hooksFromImport) {
6425 + var hook = new hooksFromImport[key]();
6426 + hooks[hook.getId()] = hook;
6427 + }
6428 + return hooks;
6429 + }
6430 +
6431 + /**
6432 + * Import & initialize the component's UI states.
6433 + * Should be used inside `defaultUiState()`.
6434 + *
6435 + * @param {Object} statesFromImport - UI states from import.
6436 + *
6437 + * @return {Object} UI States
6438 + */
6439 + }, {
6440 + key: "importUiStates",
6441 + value: function importUiStates(statesFromImport) {
6442 + var _this6 = this;
6443 + var uiStates = {};
6444 + Object.values(statesFromImport).forEach(function (className) {
6445 + var uiState = new className(_this6);
6446 + uiStates[uiState.getId()] = uiState;
6447 + });
6448 + return uiStates;
6449 + }
6450 +
6451 + /**
6452 + * Set a UI state value.
6453 + * TODO: Should we provide such function? Maybe the developer should implicitly pass the full state ID?
6454 + *
6455 + * @param {string} state - Non-prefixed state ID.
6456 + * @param {*} value - New state value.
6457 + *
6458 + * @return {void}
6459 + */
6460 + }, {
6461 + key: "setUiState",
6462 + value: function setUiState(state, value) {
6463 + $e.uiStates.set("".concat(this.getNamespace(), "/").concat(state), value);
6464 + }
6465 + }, {
6466 + key: "toggleRouteClass",
6467 + value: function toggleRouteClass(route, state) {
6468 + document.body.classList.toggle(this.getBodyClass(route), state);
6469 + }
6470 + }, {
6471 + key: "toggleHistoryClass",
6472 + value: function toggleHistoryClass() {
6473 + document.body.classList.toggle('e-routes-has-history', !!$e.routes.getHistory(this.getServiceName()).length);
6474 + }
6475 + }]);
6476 +}(_module.default);
6477 +
6478 +/***/ }),
6479 +
6480 +/***/ "../modules/web-cli/assets/js/modules/component-modal-base.js":
6481 +/*!********************************************************************!*\
6482 + !*** ../modules/web-cli/assets/js/modules/component-modal-base.js ***!
6483 + \********************************************************************/
6484 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6485 +
6486 +"use strict";
6487 +
6488 +
6489 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
6490 +var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js");
6491 +Object.defineProperty(exports, "__esModule", ({
6492 + value: true
6493 +}));
6494 +exports["default"] = void 0;
6495 +var _readOnlyError2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/readOnlyError */ "../node_modules/@babel/runtime/helpers/readOnlyError.js"));
6496 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
6497 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
6498 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
6499 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
6500 +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js"));
6501 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
6502 +var _componentBase = _interopRequireDefault(__webpack_require__(/*! ./component-base */ "../modules/web-cli/assets/js/modules/component-base.js"));
6503 +var commands = _interopRequireWildcard(__webpack_require__(/*! ./commands/ */ "../modules/web-cli/assets/js/modules/commands/index.js"));
6504 +var _forceMethodImplementation = _interopRequireDefault(__webpack_require__(/*! ../utils/force-method-implementation */ "../modules/web-cli/assets/js/utils/force-method-implementation.js"));
6505 +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); }
6506 +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)); }
6507 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
6508 +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; }
6509 +var ComponentModalBase = exports["default"] = /*#__PURE__*/function (_ComponentBase) {
6510 + function ComponentModalBase() {
6511 + (0, _classCallCheck2.default)(this, ComponentModalBase);
6512 + return _callSuper(this, ComponentModalBase, arguments);
6513 + }
6514 + (0, _inherits2.default)(ComponentModalBase, _ComponentBase);
6515 + return (0, _createClass2.default)(ComponentModalBase, [{
6516 + key: "registerAPI",
6517 + value: function registerAPI() {
6518 + var _this = this;
6519 + _superPropGet(ComponentModalBase, "registerAPI", this, 3)([]);
6520 + $e.shortcuts.register('esc', {
6521 + scopes: [this.getNamespace()],
6522 + callback: function callback() {
6523 + return _this.close();
6524 + }
6525 + });
6526 + }
6527 + }, {
6528 + key: "defaultCommands",
6529 + value: function defaultCommands() {
6530 + return this.importCommands(commands);
6531 + }
6532 + }, {
6533 + key: "defaultRoutes",
6534 + value: function defaultRoutes() {
6535 + return {
6536 + '': function _() {/* Nothing to do, it's already rendered. */}
6537 + };
6538 + }
6539 + }, {
6540 + key: "open",
6541 + value: function open() {
6542 + var _this2 = this;
6543 + if (!this.layout) {
6544 + var layout = this.getModalLayout();
6545 + this.layout = new layout({
6546 + component: this
6547 + });
6548 + this.layout.getModal().on('hide', function () {
6549 + return _this2.close();
6550 + });
6551 + }
6552 + this.layout.showModal();
6553 + return true;
6554 + }
6555 + }, {
6556 + key: "close",
6557 + value: function close() {
6558 + if (!_superPropGet(ComponentModalBase, "close", this, 3)([])) {
6559 + return false;
6560 + }
6561 + var close = elementor.hooks.applyFilters('component/modal/close', this.layout.getModal().hide.bind(this.layout.getModal()), this);
6562 + close();
6563 + return true;
6564 + }
6565 + }, {
6566 + key: "getModalLayout",
6567 + value: function getModalLayout() {
6568 + (0, _forceMethodImplementation.default)();
6569 + }
6570 + }]);
6571 +}(_componentBase.default);
6572 +
6573 +/***/ }),
6574 +
6575 +/***/ "../modules/web-cli/assets/js/modules/hook-base.js":
6576 +/*!*********************************************************!*\
6577 + !*** ../modules/web-cli/assets/js/modules/hook-base.js ***!
6578 + \*********************************************************/
6579 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6580 +
6581 +"use strict";
6582 +
6583 +
6584 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
6585 +Object.defineProperty(exports, "__esModule", ({
6586 + value: true
6587 +}));
6588 +exports["default"] = void 0;
6589 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
6590 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
6591 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
6592 +var _forceMethodImplementation = _interopRequireDefault(__webpack_require__(/*! ../utils/force-method-implementation */ "../modules/web-cli/assets/js/utils/force-method-implementation.js"));
6593 +var HookBase = exports["default"] = /*#__PURE__*/function () {
6594 + /**
6595 + * Function constructor().
6596 + *
6597 + * Create callback base.
6598 + */
6599 + function HookBase() {
6600 + (0, _classCallCheck2.default)(this, HookBase);
6601 + /**
6602 + * Callback type, eg ( hook, event ).
6603 + *
6604 + * @type {string}
6605 + */
6606 + (0, _defineProperty2.default)(this, "type", void 0);
6607 + /**
6608 + * Full command address, that will hook the callback.
6609 + *
6610 + * @type {string}
6611 + */
6612 + (0, _defineProperty2.default)(this, "command", void 0);
6613 + /**
6614 + * Unique id of the callback.
6615 + *
6616 + * @type {string}
6617 + */
6618 + (0, _defineProperty2.default)(this, "id", void 0);
6619 + this.initialize();
6620 + this.type = this.getType();
6621 + this.command = this.getCommand();
6622 + this.id = this.getId();
6623 + }
6624 +
6625 + /**
6626 + * Function initialize().
6627 + *
6628 + * Called after creation of the base, used for initialize extras.
6629 + * Without expending constructor.
6630 + */
6631 + return (0, _createClass2.default)(HookBase, [{
6632 + key: "initialize",
6633 + value: function initialize() {}
6634 +
6635 + /**
6636 + * Function register().
6637 + *
6638 + * Used to register the callback.
6639 + *
6640 + * @throws {Error}
6641 + */
6642 + }, {
6643 + key: "register",
6644 + value: function register() {
6645 + (0, _forceMethodImplementation.default)();
6646 + }
6647 +
6648 + // eslint-disable-next-line jsdoc/require-returns-check
6649 + /**
6650 + * Function getType().
6651 + *
6652 + * Get type eg: ( hook, event, etc ... ).
6653 + *
6654 + * @return {string} type
6655 + *
6656 + * @throws {Error}
6657 + */
6658 + }, {
6659 + key: "getType",
6660 + value: function getType() {
6661 + (0, _forceMethodImplementation.default)();
6662 + }
6663 +
6664 + // eslint-disable-next-line jsdoc/require-returns-check
6665 + /**
6666 + * Function getCommand().
6667 + *
6668 + * Returns the full command path for callback binding.
6669 + *
6670 + * Supports array of strings ( commands ).
6671 + *
6672 + * @return {string} command
6673 + *
6674 + * @throws {Error}
6675 + */
6676 + }, {
6677 + key: "getCommand",
6678 + value: function getCommand() {
6679 + (0, _forceMethodImplementation.default)();
6680 + }
6681 +
6682 + // eslint-disable-next-line jsdoc/require-returns-check
6683 + /**
6684 + * Function getId().
6685 + *
6686 + * Returns command id for the hook (should be unique).
6687 + *
6688 + * @return {string} id
6689 + *
6690 + * @throws {Error}
6691 + */
6692 + }, {
6693 + key: "getId",
6694 + value: function getId() {
6695 + (0, _forceMethodImplementation.default)();
6696 + }
6697 +
6698 + // eslint-disable-next-line jsdoc/require-returns-check
6699 + /**
6700 + * Function getContainerType().
6701 + *
6702 + * Bind eContainer type to callback.
6703 + *
6704 + * Used to gain performance.
6705 + *
6706 + * @return {string} type
6707 + */
6708 + }, {
6709 + key: "getContainerType",
6710 + value: function getContainerType() {}
6711 +
6712 + /**
6713 + * Function getConditions().
6714 + *
6715 + * Condition for running the callback, if true, call to apply().
6716 + *
6717 + * @param {*} [args={}]
6718 + * @param {*} [result=*]
6719 + *
6720 + * @return {boolean} conditions
6721 + */
6722 + }, {
6723 + key: "getConditions",
6724 + value: function getConditions() {
6725 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
6726 + var result = arguments.length > 1 ? arguments[1] : undefined;
6727 + // eslint-disable-line no-unused-vars
6728 + return true;
6729 + }
6730 +
6731 + // eslint-disable-next-line jsdoc/require-returns-check
6732 + /**
6733 + * Function apply().
6734 + *
6735 + * Apply the callback, ( The actual affect of the callback ).
6736 + *
6737 + * @param {*} [args={}]
6738 + *
6739 + * @return {*} results
6740 + */
6741 + }, {
6742 + key: "apply",
6743 + value: function apply(args) {
6744 + // eslint-disable-line no-unused-vars
6745 + (0, _forceMethodImplementation.default)();
6746 + }
6747 +
6748 + /**
6749 + * Function run().
6750 + *
6751 + * Run the callback.
6752 + *
6753 + * @param {*} args
6754 + *
6755 + * @return {*} results
6756 + */
6757 + }, {
6758 + key: "run",
6759 + value: function run() {
6760 + var _ref = arguments.length <= 0 ? undefined : arguments[0],
6761 + _ref$options = _ref.options,
6762 + options = _ref$options === void 0 ? {} : _ref$options;
6763 +
6764 + // Disable callback if requested by args.options.
6765 + if (options.callbacks && false === options.callbacks[this.id]) {
6766 + return true;
6767 + }
6768 + if (this.getConditions.apply(this, arguments)) {
6769 + if ($e.devTools) {
6770 + $e.devTools.log.callbacks().active(this.type, this.command, this.id);
6771 + }
6772 + return this.apply.apply(this, arguments);
6773 + }
6774 + return true;
6775 + }
6776 + }]);
6777 +}();
6778 +
6779 +/***/ }),
6780 +
6781 +/***/ "../modules/web-cli/assets/js/modules/hook-break.js":
6782 +/*!**********************************************************!*\
6783 + !*** ../modules/web-cli/assets/js/modules/hook-break.js ***!
6784 + \**********************************************************/
6785 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6786 +
6787 +"use strict";
6788 +
6789 +
6790 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
6791 +Object.defineProperty(exports, "__esModule", ({
6792 + value: true
6793 +}));
6794 +exports["default"] = void 0;
6795 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
6796 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
6797 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
6798 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
6799 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
6800 +var _wrapNativeSuper2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ "../node_modules/@babel/runtime/helpers/wrapNativeSuper.js"));
6801 +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)); }
6802 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
6803 +var HookBreak = exports["default"] = /*#__PURE__*/function (_Error) {
6804 + function HookBreak() {
6805 + (0, _classCallCheck2.default)(this, HookBreak);
6806 + return _callSuper(this, HookBreak, ['HookBreak']);
6807 + }
6808 + (0, _inherits2.default)(HookBreak, _Error);
6809 + return (0, _createClass2.default)(HookBreak);
6810 +}(/*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
6811 +
6812 +/***/ }),
6813 +
6814 +/***/ "../modules/web-cli/assets/js/modules/hooks/data/after.js":
6815 +/*!****************************************************************!*\
6816 + !*** ../modules/web-cli/assets/js/modules/hooks/data/after.js ***!
6817 + \****************************************************************/
6818 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6819 +
6820 +"use strict";
6821 +
6822 +
6823 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
6824 +Object.defineProperty(exports, "__esModule", ({
6825 + value: true
6826 +}));
6827 +exports["default"] = exports.After = void 0;
6828 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
6829 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
6830 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
6831 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
6832 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
6833 +var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/data/base.js"));
6834 +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)); }
6835 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
6836 +var After = exports.After = /*#__PURE__*/function (_Base) {
6837 + function After() {
6838 + (0, _classCallCheck2.default)(this, After);
6839 + return _callSuper(this, After, arguments);
6840 + }
6841 + (0, _inherits2.default)(After, _Base);
6842 + return (0, _createClass2.default)(After, [{
6843 + key: "register",
6844 + value: function register() {
6845 + $e.hooks.registerDataAfter(this);
6846 + }
6847 + }]);
6848 +}(_base.default);
6849 +var _default = exports["default"] = After;
6850 +
6851 +/***/ }),
6852 +
6853 +/***/ "../modules/web-cli/assets/js/modules/hooks/data/base.js":
6854 +/*!***************************************************************!*\
6855 + !*** ../modules/web-cli/assets/js/modules/hooks/data/base.js ***!
6856 + \***************************************************************/
6857 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6858 +
6859 +"use strict";
6860 +
6861 +
6862 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
6863 +Object.defineProperty(exports, "__esModule", ({
6864 + value: true
6865 +}));
6866 +exports["default"] = exports.Base = void 0;
6867 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
6868 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
6869 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
6870 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
6871 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
6872 +var _hookBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/hook-base */ "../modules/web-cli/assets/js/modules/hook-base.js"));
6873 +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)); }
6874 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
6875 +var Base = exports.Base = /*#__PURE__*/function (_HookBase) {
6876 + function Base() {
6877 + (0, _classCallCheck2.default)(this, Base);
6878 + return _callSuper(this, Base, arguments);
6879 + }
6880 + (0, _inherits2.default)(Base, _HookBase);
6881 + return (0, _createClass2.default)(Base, [{
6882 + key: "getType",
6883 + value: function getType() {
6884 + return 'data';
6885 + }
6886 + }]);
6887 +}(_hookBase.default);
6888 +var _default = exports["default"] = Base;
6889 +
6890 +/***/ }),
6891 +
6892 +/***/ "../modules/web-cli/assets/js/modules/hooks/data/catch.js":
6893 +/*!****************************************************************!*\
6894 + !*** ../modules/web-cli/assets/js/modules/hooks/data/catch.js ***!
6895 + \****************************************************************/
6896 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6897 +
6898 +"use strict";
6899 +
6900 +
6901 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
6902 +Object.defineProperty(exports, "__esModule", ({
6903 + value: true
6904 +}));
6905 +exports["default"] = exports.Catch = void 0;
6906 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
6907 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
6908 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
6909 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
6910 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
6911 +var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/data/base.js"));
6912 +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)); }
6913 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
6914 +var Catch = exports.Catch = /*#__PURE__*/function (_Base) {
6915 + function Catch() {
6916 + (0, _classCallCheck2.default)(this, Catch);
6917 + return _callSuper(this, Catch, arguments);
6918 + }
6919 + (0, _inherits2.default)(Catch, _Base);
6920 + return (0, _createClass2.default)(Catch, [{
6921 + key: "register",
6922 + value: function register() {
6923 + $e.hooks.registerDataCatch(this);
6924 + }
6925 + }]);
6926 +}(_base.default);
6927 +var _default = exports["default"] = Catch;
6928 +
6929 +/***/ }),
6930 +
6931 +/***/ "../modules/web-cli/assets/js/modules/hooks/data/dependency.js":
6932 +/*!*********************************************************************!*\
6933 + !*** ../modules/web-cli/assets/js/modules/hooks/data/dependency.js ***!
6934 + \*********************************************************************/
6935 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6936 +
6937 +"use strict";
6938 +
6939 +
6940 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
6941 +Object.defineProperty(exports, "__esModule", ({
6942 + value: true
6943 +}));
6944 +exports["default"] = exports.Dependency = void 0;
6945 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
6946 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
6947 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
6948 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
6949 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
6950 +var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/data/base.js"));
6951 +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)); }
6952 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
6953 +var Dependency = exports.Dependency = /*#__PURE__*/function (_Base) {
6954 + function Dependency() {
6955 + (0, _classCallCheck2.default)(this, Dependency);
6956 + return _callSuper(this, Dependency, arguments);
6957 + }
6958 + (0, _inherits2.default)(Dependency, _Base);
6959 + return (0, _createClass2.default)(Dependency, [{
6960 + key: "register",
6961 + value: function register() {
6962 + $e.hooks.registerDataDependency(this);
6963 + }
6964 + }]);
6965 +}(_base.default);
6966 +var _default = exports["default"] = Dependency;
6967 +
6968 +/***/ }),
6969 +
6970 +/***/ "../modules/web-cli/assets/js/modules/hooks/data/index.js":
6971 +/*!****************************************************************!*\
6972 + !*** ../modules/web-cli/assets/js/modules/hooks/data/index.js ***!
6973 + \****************************************************************/
6974 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6975 +
6976 +"use strict";
6977 +
6978 +
6979 +Object.defineProperty(exports, "__esModule", ({
6980 + value: true
6981 +}));
6982 +Object.defineProperty(exports, "After", ({
6983 + enumerable: true,
6984 + get: function get() {
6985 + return _after.After;
6986 + }
6987 +}));
6988 +Object.defineProperty(exports, "Base", ({
6989 + enumerable: true,
6990 + get: function get() {
6991 + return _base.Base;
6992 + }
6993 +}));
6994 +Object.defineProperty(exports, "Catch", ({
6995 + enumerable: true,
6996 + get: function get() {
6997 + return _catch.Catch;
6998 + }
6999 +}));
7000 +Object.defineProperty(exports, "Dependency", ({
7001 + enumerable: true,
7002 + get: function get() {
7003 + return _dependency.Dependency;
7004 + }
7005 +}));
7006 +var _after = __webpack_require__(/*! ./after */ "../modules/web-cli/assets/js/modules/hooks/data/after.js");
7007 +var _base = __webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/data/base.js");
7008 +var _catch = __webpack_require__(/*! ./catch */ "../modules/web-cli/assets/js/modules/hooks/data/catch.js");
7009 +var _dependency = __webpack_require__(/*! ./dependency */ "../modules/web-cli/assets/js/modules/hooks/data/dependency.js");
7010 +
7011 +/***/ }),
7012 +
7013 +/***/ "../modules/web-cli/assets/js/modules/hooks/ui/after.js":
7014 +/*!**************************************************************!*\
7015 + !*** ../modules/web-cli/assets/js/modules/hooks/ui/after.js ***!
7016 + \**************************************************************/
7017 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7018 +
7019 +"use strict";
7020 +
7021 +
7022 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
7023 +Object.defineProperty(exports, "__esModule", ({
7024 + value: true
7025 +}));
7026 +exports["default"] = exports.After = void 0;
7027 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
7028 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
7029 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
7030 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
7031 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
7032 +var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/ui/base.js"));
7033 +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)); }
7034 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
7035 +var After = exports.After = /*#__PURE__*/function (_Base) {
7036 + function After() {
7037 + (0, _classCallCheck2.default)(this, After);
7038 + return _callSuper(this, After, arguments);
7039 + }
7040 + (0, _inherits2.default)(After, _Base);
7041 + return (0, _createClass2.default)(After, [{
7042 + key: "register",
7043 + value: function register() {
7044 + $e.hooks.registerUIAfter(this);
7045 + }
7046 + }]);
7047 +}(_base.default);
7048 +var _default = exports["default"] = After;
7049 +
7050 +/***/ }),
7051 +
7052 +/***/ "../modules/web-cli/assets/js/modules/hooks/ui/base.js":
7053 +/*!*************************************************************!*\
7054 + !*** ../modules/web-cli/assets/js/modules/hooks/ui/base.js ***!
7055 + \*************************************************************/
7056 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7057 +
7058 +"use strict";
7059 +
7060 +
7061 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
7062 +Object.defineProperty(exports, "__esModule", ({
7063 + value: true
7064 +}));
7065 +exports["default"] = exports.Base = void 0;
7066 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
7067 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
7068 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
7069 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
7070 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
7071 +var _hookBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/hook-base */ "../modules/web-cli/assets/js/modules/hook-base.js"));
7072 +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)); }
7073 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
7074 +var Base = exports.Base = /*#__PURE__*/function (_HookBase) {
7075 + function Base() {
7076 + (0, _classCallCheck2.default)(this, Base);
7077 + return _callSuper(this, Base, arguments);
7078 + }
7079 + (0, _inherits2.default)(Base, _HookBase);
7080 + return (0, _createClass2.default)(Base, [{
7081 + key: "getType",
7082 + value: function getType() {
7083 + return 'ui';
7084 + }
7085 + }]);
7086 +}(_hookBase.default);
7087 +var _default = exports["default"] = Base;
7088 +
7089 +/***/ }),
7090 +
7091 +/***/ "../modules/web-cli/assets/js/modules/hooks/ui/before.js":
7092 +/*!***************************************************************!*\
7093 + !*** ../modules/web-cli/assets/js/modules/hooks/ui/before.js ***!
7094 + \***************************************************************/
7095 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7096 +
7097 +"use strict";
7098 +
7099 +
7100 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
7101 +Object.defineProperty(exports, "__esModule", ({
7102 + value: true
7103 +}));
7104 +exports["default"] = exports.Before = void 0;
7105 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
7106 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
7107 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
7108 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
7109 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
7110 +var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/ui/base.js"));
7111 +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)); }
7112 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
7113 +var Before = exports.Before = /*#__PURE__*/function (_Base) {
7114 + function Before() {
7115 + (0, _classCallCheck2.default)(this, Before);
7116 + return _callSuper(this, Before, arguments);
7117 + }
7118 + (0, _inherits2.default)(Before, _Base);
7119 + return (0, _createClass2.default)(Before, [{
7120 + key: "register",
7121 + value: function register() {
7122 + $e.hooks.registerUIBefore(this);
7123 + }
7124 + }]);
7125 +}(_base.default);
7126 +var _default = exports["default"] = Before;
7127 +
7128 +/***/ }),
7129 +
7130 +/***/ "../modules/web-cli/assets/js/modules/hooks/ui/catch.js":
7131 +/*!**************************************************************!*\
7132 + !*** ../modules/web-cli/assets/js/modules/hooks/ui/catch.js ***!
7133 + \**************************************************************/
7134 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7135 +
7136 +"use strict";
7137 +
7138 +
7139 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
7140 +Object.defineProperty(exports, "__esModule", ({
7141 + value: true
7142 +}));
7143 +exports["default"] = exports.Catch = void 0;
7144 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
7145 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
7146 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
7147 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
7148 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
7149 +var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/ui/base.js"));
7150 +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)); }
7151 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
7152 +var Catch = exports.Catch = /*#__PURE__*/function (_Base) {
7153 + function Catch() {
7154 + (0, _classCallCheck2.default)(this, Catch);
7155 + return _callSuper(this, Catch, arguments);
7156 + }
7157 + (0, _inherits2.default)(Catch, _Base);
7158 + return (0, _createClass2.default)(Catch, [{
7159 + key: "register",
7160 + value: function register() {
7161 + $e.hooks.registerUICatch(this);
7162 + }
7163 + }]);
7164 +}(_base.default);
7165 +var _default = exports["default"] = Catch;
7166 +
7167 +/***/ }),
7168 +
7169 +/***/ "../modules/web-cli/assets/js/modules/hooks/ui/index.js":
7170 +/*!**************************************************************!*\
7171 + !*** ../modules/web-cli/assets/js/modules/hooks/ui/index.js ***!
7172 + \**************************************************************/
7173 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7174 +
7175 +"use strict";
7176 +
7177 +
7178 +Object.defineProperty(exports, "__esModule", ({
7179 + value: true
7180 +}));
7181 +Object.defineProperty(exports, "After", ({
7182 + enumerable: true,
7183 + get: function get() {
7184 + return _after.After;
7185 + }
7186 +}));
7187 +Object.defineProperty(exports, "Base", ({
7188 + enumerable: true,
7189 + get: function get() {
7190 + return _base.Base;
7191 + }
7192 +}));
7193 +Object.defineProperty(exports, "Before", ({
7194 + enumerable: true,
7195 + get: function get() {
7196 + return _before.Before;
7197 + }
7198 +}));
7199 +Object.defineProperty(exports, "Catch", ({
7200 + enumerable: true,
7201 + get: function get() {
7202 + return _catch.Catch;
7203 + }
7204 +}));
7205 +var _after = __webpack_require__(/*! ./after */ "../modules/web-cli/assets/js/modules/hooks/ui/after.js");
7206 +var _base = __webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/ui/base.js");
7207 +var _before = __webpack_require__(/*! ./before */ "../modules/web-cli/assets/js/modules/hooks/ui/before.js");
7208 +var _catch = __webpack_require__(/*! ./catch */ "../modules/web-cli/assets/js/modules/hooks/ui/catch.js");
7209 +
7210 +/***/ }),
7211 +
7212 +/***/ "../modules/web-cli/assets/js/utils/console.js":
7213 +/*!*****************************************************!*\
7214 + !*** ../modules/web-cli/assets/js/utils/console.js ***!
7215 + \*****************************************************/
7216 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7217 +
7218 +"use strict";
7219 +
7220 +
7221 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
7222 +Object.defineProperty(exports, "__esModule", ({
7223 + value: true
7224 +}));
7225 +exports["default"] = void 0;
7226 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
7227 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
7228 +var Console = exports["default"] = /*#__PURE__*/function () {
7229 + function Console() {
7230 + (0, _classCallCheck2.default)(this, Console);
7231 + }
7232 + return (0, _createClass2.default)(Console, null, [{
7233 + key: "error",
7234 + value: function error(message) {
7235 + // Show an error if devTools is available.
7236 + if ($e.devTools) {
7237 + $e.devTools.log.error(message);
7238 + }
7239 +
7240 + // If not a 'Hook-Break' then show error.
7241 + if (!(message instanceof $e.modules.HookBreak)) {
7242 + // eslint-disable-next-line no-console
7243 + console.error(message);
7244 + }
7245 + }
7246 + }, {
7247 + key: "warn",
7248 + value: function warn() {
7249 + var _console;
7250 + var style = "font-size: 12px; background-image: url(\"".concat(elementorWebCliConfig.urls.assets, "images/logo-icon.png\"); background-repeat: no-repeat; background-size: contain;");
7251 + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
7252 + args[_key] = arguments[_key];
7253 + }
7254 + args.unshift('%c %c', style, '');
7255 + (_console = console).warn.apply(_console, args); // eslint-disable-line no-console
7256 + }
7257 + }]);
7258 +}();
7259 +
7260 +/***/ }),
7261 +
7262 +/***/ "../modules/web-cli/assets/js/utils/deprecation.js":
7263 +/*!*********************************************************!*\
7264 + !*** ../modules/web-cli/assets/js/utils/deprecation.js ***!
7265 + \*********************************************************/
7266 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7267 +
7268 +"use strict";
7269 +
7270 +
7271 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
7272 +Object.defineProperty(exports, "__esModule", ({
7273 + value: true
7274 +}));
7275 +exports["default"] = void 0;
7276 +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
7277 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
7278 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
7279 +var _console = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/console */ "../modules/web-cli/assets/js/utils/console.js"));
7280 +// Copied from `modules/dev-tools/assets/js/deprecation.js`
7281 +/**
7282 + * @typedef {Object} Version
7283 + * @property {number} major1 The first number
7284 + * @property {number} major2 The second number
7285 + * @property {number} minor The third number
7286 + * @property {string} build The fourth number
7287 + */
7288 +
7289 +var softDeprecated = function softDeprecated(name, version, replacement) {
7290 + if (elementorWebCliConfig.isDebug) {
7291 + deprecatedMessage('soft', name, version, replacement);
7292 + }
7293 +};
7294 +var hardDeprecated = function hardDeprecated(name, version, replacement) {
7295 + deprecatedMessage('hard', name, version, replacement);
7296 +};
7297 +var deprecatedMessage = function deprecatedMessage(type, name, version, replacement) {
7298 + var message = "`".concat(name, "` is ").concat(type, " deprecated since ").concat(version);
7299 + if (replacement) {
7300 + message += " - Use `".concat(replacement, "` instead");
7301 + }
7302 + _console.default.warn(message);
7303 +};
7304 +var Deprecation = exports["default"] = /*#__PURE__*/function () {
7305 + function Deprecation() {
7306 + (0, _classCallCheck2.default)(this, Deprecation);
7307 + }
7308 + return (0, _createClass2.default)(Deprecation, null, [{
7309 + key: "deprecated",
7310 + value: function deprecated(name, version, replacement) {
7311 + if (this.isHardDeprecated(version)) {
7312 + hardDeprecated(name, version, replacement);
7313 + } else {
7314 + softDeprecated(name, version, replacement);
7315 + }
7316 + }
7317 +
7318 + /**
7319 + * @param {string} version
7320 + *
7321 + * @return {Version}
7322 + */
7323 + }, {
7324 + key: "parseVersion",
7325 + value: function parseVersion(version) {
7326 + var versionParts = version.split('.');
7327 + if (versionParts.length < 3 || versionParts.length > 4) {
7328 + throw new RangeError('Invalid Semantic Version string provided');
7329 + }
7330 + var _versionParts = (0, _slicedToArray2.default)(versionParts, 4),
7331 + major1 = _versionParts[0],
7332 + major2 = _versionParts[1],
7333 + minor = _versionParts[2],
7334 + _versionParts$ = _versionParts[3],
7335 + build = _versionParts$ === void 0 ? '' : _versionParts$;
7336 + return {
7337 + major1: parseInt(major1),
7338 + major2: parseInt(major2),
7339 + minor: parseInt(minor),
7340 + build: build
7341 + };
7342 + }
7343 +
7344 + /**
7345 + * Get total of major.
7346 + *
7347 + * Since `get_total_major` cannot determine how much really versions between 2.9.0 and 3.3.0 if there is 2.10.0 version for example,
7348 + * versions with major2 more then 9 will be added to total.
7349 + *
7350 + * @param {Version} versionObj
7351 + *
7352 + * @return {number}
7353 + */
7354 + }, {
7355 + key: "getTotalMajor",
7356 + value: function getTotalMajor(versionObj) {
7357 + var total = parseInt("".concat(versionObj.major1).concat(versionObj.major2, "0"));
7358 + total = Number((total / 10).toFixed(0));
7359 + if (versionObj.major2 > 9) {
7360 + total = versionObj.major2 - 9;
7361 + }
7362 + return total;
7363 + }
7364 +
7365 + /**
7366 + * @param {string} version1
7367 + * @param {string} version2
7368 + *
7369 + * @return {number}
7370 + */
7371 + }, {
7372 + key: "compareVersion",
7373 + value: function compareVersion(version1, version2) {
7374 + var _this = this;
7375 + return [this.parseVersion(version1), this.parseVersion(version2)].map(function (versionObj) {
7376 + return _this.getTotalMajor(versionObj);
7377 + }).reduce(function (acc, major) {
7378 + return acc - major;
7379 + });
7380 + }
7381 +
7382 + /**
7383 + * @param {string} version
7384 + *
7385 + * @return {boolean}
7386 + */
7387 + }, {
7388 + key: "isSoftDeprecated",
7389 + value: function isSoftDeprecated(version) {
7390 + var total = this.compareVersion(version, elementorWebCliConfig.version);
7391 + return total <= 4;
7392 + }
7393 +
7394 + /**
7395 + * @param {string} version
7396 + * @return {boolean}
7397 + */
7398 + }, {
7399 + key: "isHardDeprecated",
7400 + value: function isHardDeprecated(version) {
7401 + var total = this.compareVersion(version, elementorWebCliConfig.version);
7402 + return total < 0 || total >= 8;
7403 + }
7404 + }]);
7405 +}();
7406 +
7407 +/***/ }),
7408 +
7409 +/***/ "../modules/web-cli/assets/js/utils/environment.js":
7410 +/*!*********************************************************!*\
7411 + !*** ../modules/web-cli/assets/js/utils/environment.js ***!
7412 + \*********************************************************/
7413 +/***/ ((__unused_webpack_module, exports) => {
7414 +
7415 +"use strict";
7416 +
7417 +
7418 +Object.defineProperty(exports, "__esModule", ({
7419 + value: true
7420 +}));
7421 +exports["default"] = void 0;
7422 +// TODO: Copied from `core/common/assets/js/utils/environment.js`.
7423 +var matchUserAgent = function matchUserAgent(UserAgentStr) {
7424 + return userAgent.indexOf(UserAgentStr) >= 0;
7425 + },
7426 + userAgent = navigator.userAgent,
7427 + // Solution influenced by https://stackoverflow.com/questions/9847580/how-to-detect-safari-chrome-ie-firefox-and-opera-browser
7428 +
7429 + // Opera 8.0+
7430 + isOpera = !!window.opr && !!opr.addons || !!window.opera || matchUserAgent(' OPR/'),
7431 + // Firefox 1.0+
7432 + isFirefox = matchUserAgent('Firefox'),
7433 + // Safari 3.0+ "[object HTMLElementConstructor]"
7434 + isSafari = /^((?!chrome|android).)*safari/i.test(userAgent) || /constructor/i.test(window.HTMLElement) || function (p) {
7435 + return '[object SafariRemoteNotification]' === p.toString();
7436 + }(!window.safari || typeof safari !== 'undefined' && safari.pushNotification),
7437 + // Internet Explorer 6-11
7438 + isIE = /Trident|MSIE/.test(userAgent) && (/* @cc_on!@*/ false || !!document.documentMode),
7439 + // Edge 20+
7440 + isEdge = !isIE && !!window.StyleMedia || matchUserAgent('Edg'),
7441 + // Google Chrome (Not accurate)
7442 + isChrome = !!window.chrome && matchUserAgent('Chrome') && !(isEdge || isOpera),
7443 + // Blink engine
7444 + isBlink = matchUserAgent('Chrome') && !!window.CSS,
7445 + // Apple Webkit engine
7446 + isAppleWebkit = matchUserAgent('AppleWebKit') && !isBlink,
7447 + environment = {
7448 + appleWebkit: isAppleWebkit,
7449 + blink: isBlink,
7450 + chrome: isChrome,
7451 + edge: isEdge,
7452 + firefox: isFirefox,
7453 + ie: isIE,
7454 + mac: matchUserAgent('Macintosh'),
7455 + opera: isOpera,
7456 + safari: isSafari,
7457 + webkit: matchUserAgent('AppleWebKit')
7458 + };
7459 +var _default = exports["default"] = environment;
7460 +
7461 +/***/ }),
7462 +
7463 +/***/ "../modules/web-cli/assets/js/utils/force-method-implementation.js":
7464 +/*!*************************************************************************!*\
7465 + !*** ../modules/web-cli/assets/js/utils/force-method-implementation.js ***!
7466 + \*************************************************************************/
7467 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7468 +
7469 +"use strict";
7470 +
7471 +
7472 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
7473 +Object.defineProperty(exports, "__esModule", ({
7474 + value: true
7475 +}));
7476 +exports["default"] = exports.ForceMethodImplementation = void 0;
7477 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
7478 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
7479 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
7480 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
7481 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
7482 +var _wrapNativeSuper2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ "../node_modules/@babel/runtime/helpers/wrapNativeSuper.js"));
7483 +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)); }
7484 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
7485 +// TODO: Copied from `assets/dev/js/modules/imports/force-method-implementation.js`;
7486 +var ForceMethodImplementation = exports.ForceMethodImplementation = /*#__PURE__*/function (_Error) {
7487 + function ForceMethodImplementation() {
7488 + var _this;
7489 + var info = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7490 + (0, _classCallCheck2.default)(this, ForceMethodImplementation);
7491 + _this = _callSuper(this, ForceMethodImplementation, ["".concat(info.isStatic ? 'static ' : '').concat(info.fullName, "() should be implemented, please provide '").concat(info.functionName || info.fullName, "' functionality.")]);
7492 + Error.captureStackTrace(_this, ForceMethodImplementation);
7493 + return _this;
7494 + }
7495 + (0, _inherits2.default)(ForceMethodImplementation, _Error);
7496 + return (0, _createClass2.default)(ForceMethodImplementation);
7497 +}(/*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
7498 +var _default = exports["default"] = function _default() {
7499 + var stack = Error().stack,
7500 + caller = stack.split('\n')[2].trim(),
7501 + callerName = caller.startsWith('at new') ? 'constructor' : caller.split(' ')[1],
7502 + info = {};
7503 + info.functionName = callerName;
7504 + info.fullName = callerName;
7505 + if (info.functionName.includes('.')) {
7506 + var parts = info.functionName.split('.');
7507 + info.className = parts[0];
7508 + info.functionName = parts[1];
7509 + } else {
7510 + info.isStatic = true;
7511 + }
7512 + throw new ForceMethodImplementation(info);
7513 +};
7514 +
7515 +/***/ }),
7516 +
7517 +/***/ "../node_modules/@babel/runtime/helpers/OverloadYield.js":
7518 +/*!***************************************************************!*\
7519 + !*** ../node_modules/@babel/runtime/helpers/OverloadYield.js ***!
7520 + \***************************************************************/
7521 +/***/ ((module) => {
7522 +
7523 +function _OverloadYield(e, d) {
7524 + this.v = e, this.k = d;
7525 +}
7526 +module.exports = _OverloadYield, module.exports.__esModule = true, module.exports["default"] = module.exports;
7527 +
7528 +/***/ }),
7529 +
7530 +/***/ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js":
7531 +/*!******************************************************************!*\
7532 + !*** ../node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***!
7533 + \******************************************************************/
7534 +/***/ ((module) => {
7535 +
7536 +function _arrayLikeToArray(r, a) {
7537 + (null == a || a > r.length) && (a = r.length);
7538 + for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
7539 + return n;
7540 +}
7541 +module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
7542 +
7543 +/***/ }),
7544 +
7545 +/***/ "../node_modules/@babel/runtime/helpers/arrayWithHoles.js":
7546 +/*!****************************************************************!*\
7547 + !*** ../node_modules/@babel/runtime/helpers/arrayWithHoles.js ***!
7548 + \****************************************************************/
7549 +/***/ ((module) => {
7550 +
7551 +function _arrayWithHoles(r) {
7552 + if (Array.isArray(r)) return r;
7553 +}
7554 +module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
7555 +
7556 +/***/ }),
7557 +
7558 +/***/ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js":
7559 +/*!***********************************************************************!*\
7560 + !*** ../node_modules/@babel/runtime/helpers/assertThisInitialized.js ***!
7561 + \***********************************************************************/
7562 +/***/ ((module) => {
7563 +
7564 +function _assertThisInitialized(e) {
7565 + if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
7566 + return e;
7567 +}
7568 +module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports;
7569 +
7570 +/***/ }),
7571 +
7572 +/***/ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js":
7573 +/*!******************************************************************!*\
7574 + !*** ../node_modules/@babel/runtime/helpers/asyncToGenerator.js ***!
7575 + \******************************************************************/
7576 +/***/ ((module) => {
7577 +
7578 +function asyncGeneratorStep(n, t, e, r, o, a, c) {
7579 + try {
7580 + var i = n[a](c),
7581 + u = i.value;
7582 + } catch (n) {
7583 + return void e(n);
7584 + }
7585 + i.done ? t(u) : Promise.resolve(u).then(r, o);
7586 +}
7587 +function _asyncToGenerator(n) {
7588 + return function () {
7589 + var t = this,
7590 + e = arguments;
7591 + return new Promise(function (r, o) {
7592 + var a = n.apply(t, e);
7593 + function _next(n) {
7594 + asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
7595 + }
7596 + function _throw(n) {
7597 + asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
7598 + }
7599 + _next(void 0);
7600 + });
7601 + };
7602 +}
7603 +module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
7604 +
7605 +/***/ }),
7606 +
7607 +/***/ "../node_modules/@babel/runtime/helpers/classCallCheck.js":
7608 +/*!****************************************************************!*\
7609 + !*** ../node_modules/@babel/runtime/helpers/classCallCheck.js ***!
7610 + \****************************************************************/
7611 +/***/ ((module) => {
7612 +
7613 +function _classCallCheck(a, n) {
7614 + if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
7615 +}
7616 +module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
7617 +
7618 +/***/ }),
7619 +
7620 +/***/ "../node_modules/@babel/runtime/helpers/construct.js":
7621 +/*!***********************************************************!*\
7622 + !*** ../node_modules/@babel/runtime/helpers/construct.js ***!
7623 + \***********************************************************/
7624 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
7625 +
7626 +var isNativeReflectConstruct = __webpack_require__(/*! ./isNativeReflectConstruct.js */ "../node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js");
7627 +var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js");
7628 +function _construct(t, e, r) {
7629 + if (isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
7630 + var o = [null];
7631 + o.push.apply(o, e);
7632 + var p = new (t.bind.apply(t, o))();
7633 + return r && setPrototypeOf(p, r.prototype), p;
7634 +}
7635 +module.exports = _construct, module.exports.__esModule = true, module.exports["default"] = module.exports;
7636 +
7637 +/***/ }),
7638 +
7639 +/***/ "../node_modules/@babel/runtime/helpers/createClass.js":
7640 +/*!*************************************************************!*\
7641 + !*** ../node_modules/@babel/runtime/helpers/createClass.js ***!
7642 + \*************************************************************/
7643 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
7644 +
7645 +var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/toPropertyKey.js");
7646 +function _defineProperties(e, r) {
7647 + for (var t = 0; t < r.length; t++) {
7648 + var o = r[t];
7649 + o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey(o.key), o);
7650 + }
7651 +}
7652 +function _createClass(e, r, t) {
7653 + return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
7654 + writable: !1
7655 + }), e;
7656 +}
7657 +module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
7658 +
7659 +/***/ }),
7660 +
7661 +/***/ "../node_modules/@babel/runtime/helpers/defineProperty.js":
7662 +/*!****************************************************************!*\
7663 + !*** ../node_modules/@babel/runtime/helpers/defineProperty.js ***!
7664 + \****************************************************************/
7665 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
7666 +
7667 +var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/toPropertyKey.js");
7668 +function _defineProperty(e, r, t) {
7669 + return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
7670 + value: t,
7671 + enumerable: !0,
7672 + configurable: !0,
7673 + writable: !0
7674 + }) : e[r] = t, e;
7675 +}
7676 +module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
7677 +
7678 +/***/ }),
7679 +
7680 +/***/ "../node_modules/@babel/runtime/helpers/esm/defineProperty.js":
7681 +/*!********************************************************************!*\
7682 + !*** ../node_modules/@babel/runtime/helpers/esm/defineProperty.js ***!
7683 + \********************************************************************/
7684 +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
7685 +
7686 +"use strict";
7687 +__webpack_require__.r(__webpack_exports__);
7688 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
7689 +/* harmony export */ "default": () => (/* binding */ _defineProperty)
7690 +/* harmony export */ });
7691 +/* harmony import */ var _toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js");
7692 +
7693 +function _defineProperty(e, r, t) {
7694 + return (r = (0,_toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__["default"])(r)) in e ? Object.defineProperty(e, r, {
7695 + value: t,
7696 + enumerable: !0,
7697 + configurable: !0,
7698 + writable: !0
7699 + }) : e[r] = t, e;
7700 +}
7701 +
7702 +
7703 +/***/ }),
7704 +
7705 +/***/ "../node_modules/@babel/runtime/helpers/esm/objectSpread2.js":
7706 +/*!*******************************************************************!*\
7707 + !*** ../node_modules/@babel/runtime/helpers/esm/objectSpread2.js ***!
7708 + \*******************************************************************/
7709 +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
7710 +
7711 +"use strict";
7712 +__webpack_require__.r(__webpack_exports__);
7713 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
7714 +/* harmony export */ "default": () => (/* binding */ _objectSpread2)
7715 +/* harmony export */ });
7716 +/* harmony import */ var _defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defineProperty.js */ "../node_modules/@babel/runtime/helpers/esm/defineProperty.js");
7717 +
7718 +function ownKeys(e, r) {
7719 + var t = Object.keys(e);
7720 + if (Object.getOwnPropertySymbols) {
7721 + var o = Object.getOwnPropertySymbols(e);
7722 + r && (o = o.filter(function (r) {
7723 + return Object.getOwnPropertyDescriptor(e, r).enumerable;
7724 + })), t.push.apply(t, o);
7725 + }
7726 + return t;
7727 +}
7728 +function _objectSpread2(e) {
7729 + for (var r = 1; r < arguments.length; r++) {
7730 + var t = null != arguments[r] ? arguments[r] : {};
7731 + r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
7732 + (0,_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(e, r, t[r]);
7733 + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
7734 + Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
7735 + });
7736 + }
7737 + return e;
7738 +}
7739 +
7740 +
7741 +/***/ }),
7742 +
7743 +/***/ "../node_modules/@babel/runtime/helpers/esm/toPrimitive.js":
7744 +/*!*****************************************************************!*\
7745 + !*** ../node_modules/@babel/runtime/helpers/esm/toPrimitive.js ***!
7746 + \*****************************************************************/
7747 +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
7748 +
7749 +"use strict";
7750 +__webpack_require__.r(__webpack_exports__);
7751 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
7752 +/* harmony export */ "default": () => (/* binding */ toPrimitive)
7753 +/* harmony export */ });
7754 +/* harmony import */ var _typeof_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/esm/typeof.js");
7755 +
7756 +function toPrimitive(t, r) {
7757 + if ("object" != (0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__["default"])(t) || !t) return t;
7758 + var e = t[Symbol.toPrimitive];
7759 + if (void 0 !== e) {
7760 + var i = e.call(t, r || "default");
7761 + if ("object" != (0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__["default"])(i)) return i;
7762 + throw new TypeError("@@toPrimitive must return a primitive value.");
7763 + }
7764 + return ("string" === r ? String : Number)(t);
7765 +}
7766 +
7767 +
7768 +/***/ }),
7769 +
7770 +/***/ "../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js":
7771 +/*!*******************************************************************!*\
7772 + !*** ../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js ***!
7773 + \*******************************************************************/
7774 +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
7775 +
7776 +"use strict";
7777 +__webpack_require__.r(__webpack_exports__);
7778 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
7779 +/* harmony export */ "default": () => (/* binding */ toPropertyKey)
7780 +/* harmony export */ });
7781 +/* harmony import */ var _typeof_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/esm/typeof.js");
7782 +/* harmony import */ var _toPrimitive_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toPrimitive.js */ "../node_modules/@babel/runtime/helpers/esm/toPrimitive.js");
7783 +
7784 +
7785 +function toPropertyKey(t) {
7786 + var i = (0,_toPrimitive_js__WEBPACK_IMPORTED_MODULE_1__["default"])(t, "string");
7787 + return "symbol" == (0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__["default"])(i) ? i : i + "";
7788 +}
7789 +
7790 +
7791 +/***/ }),
7792 +
7793 +/***/ "../node_modules/@babel/runtime/helpers/esm/typeof.js":
7794 +/*!************************************************************!*\
7795 + !*** ../node_modules/@babel/runtime/helpers/esm/typeof.js ***!
7796 + \************************************************************/
7797 +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
7798 +
7799 +"use strict";
7800 +__webpack_require__.r(__webpack_exports__);
7801 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
7802 +/* harmony export */ "default": () => (/* binding */ _typeof)
7803 +/* harmony export */ });
7804 +function _typeof(o) {
7805 + "@babel/helpers - typeof";
7806 +
7807 + return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
7808 + return typeof o;
7809 + } : function (o) {
7810 + return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
7811 + }, _typeof(o);
7812 +}
7813 +
7814 +
7815 +/***/ }),
7816 +
7817 +/***/ "../node_modules/@babel/runtime/helpers/get.js":
7818 +/*!*****************************************************!*\
7819 + !*** ../node_modules/@babel/runtime/helpers/get.js ***!
7820 + \*****************************************************/
7821 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
7822 +
7823 +var superPropBase = __webpack_require__(/*! ./superPropBase.js */ "../node_modules/@babel/runtime/helpers/superPropBase.js");
7824 +function _get() {
7825 + return module.exports = _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) {
7826 + var p = superPropBase(e, t);
7827 + if (p) {
7828 + var n = Object.getOwnPropertyDescriptor(p, t);
7829 + return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value;
7830 + }
7831 + }, module.exports.__esModule = true, module.exports["default"] = module.exports, _get.apply(null, arguments);
7832 +}
7833 +module.exports = _get, module.exports.__esModule = true, module.exports["default"] = module.exports;
7834 +
7835 +/***/ }),
7836 +
7837 +/***/ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js":
7838 +/*!****************************************************************!*\
7839 + !*** ../node_modules/@babel/runtime/helpers/getPrototypeOf.js ***!
7840 + \****************************************************************/
7841 +/***/ ((module) => {
7842 +
7843 +function _getPrototypeOf(t) {
7844 + return module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
7845 + return t.__proto__ || Object.getPrototypeOf(t);
7846 + }, module.exports.__esModule = true, module.exports["default"] = module.exports, _getPrototypeOf(t);
7847 +}
7848 +module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
7849 +
7850 +/***/ }),
7851 +
7852 +/***/ "../node_modules/@babel/runtime/helpers/inherits.js":
7853 +/*!**********************************************************!*\
7854 + !*** ../node_modules/@babel/runtime/helpers/inherits.js ***!
7855 + \**********************************************************/
7856 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
7857 +
7858 +var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js");
7859 +function _inherits(t, e) {
7860 + if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
7861 + t.prototype = Object.create(e && e.prototype, {
7862 + constructor: {
7863 + value: t,
7864 + writable: !0,
7865 + configurable: !0
7866 + }
7867 + }), Object.defineProperty(t, "prototype", {
7868 + writable: !1
7869 + }), e && setPrototypeOf(t, e);
7870 +}
7871 +module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports;
7872 +
7873 +/***/ }),
7874 +
7875 +/***/ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js":
7876 +/*!***********************************************************************!*\
7877 + !*** ../node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
7878 + \***********************************************************************/
7879 +/***/ ((module) => {
7880 +
7881 +function _interopRequireDefault(e) {
7882 + return e && e.__esModule ? e : {
7883 + "default": e
7884 + };
7885 +}
7886 +module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
7887 +
7888 +/***/ }),
7889 +
7890 +/***/ "../node_modules/@babel/runtime/helpers/isNativeFunction.js":
7891 +/*!******************************************************************!*\
7892 + !*** ../node_modules/@babel/runtime/helpers/isNativeFunction.js ***!
7893 + \******************************************************************/
7894 +/***/ ((module) => {
7895 +
7896 +function _isNativeFunction(t) {
7897 + try {
7898 + return -1 !== Function.toString.call(t).indexOf("[native code]");
7899 + } catch (n) {
7900 + return "function" == typeof t;
7901 + }
7902 +}
7903 +module.exports = _isNativeFunction, module.exports.__esModule = true, module.exports["default"] = module.exports;
7904 +
7905 +/***/ }),
7906 +
7907 +/***/ "../node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js":
7908 +/*!**************************************************************************!*\
7909 + !*** ../node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js ***!
7910 + \**************************************************************************/
7911 +/***/ ((module) => {
7912 +
7913 +function _isNativeReflectConstruct() {
7914 + try {
7915 + var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
7916 + } catch (t) {}
7917 + return (module.exports = _isNativeReflectConstruct = function _isNativeReflectConstruct() {
7918 + return !!t;
7919 + }, module.exports.__esModule = true, module.exports["default"] = module.exports)();
7920 +}
7921 +module.exports = _isNativeReflectConstruct, module.exports.__esModule = true, module.exports["default"] = module.exports;
7922 +
7923 +/***/ }),
7924 +
7925 +/***/ "../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js":
7926 +/*!**********************************************************************!*\
7927 + !*** ../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***!
7928 + \**********************************************************************/
7929 +/***/ ((module) => {
7930 +
7931 +function _iterableToArrayLimit(r, l) {
7932 + var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
7933 + if (null != t) {
7934 + var e,
7935 + n,
7936 + i,
7937 + u,
7938 + a = [],
7939 + f = !0,
7940 + o = !1;
7941 + try {
7942 + if (i = (t = t.call(r)).next, 0 === l) {
7943 + if (Object(t) !== t) return;
7944 + f = !1;
7945 + } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
7946 + } catch (r) {
7947 + o = !0, n = r;
7948 + } finally {
7949 + try {
7950 + if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
7951 + } finally {
7952 + if (o) throw n;
7953 + }
7954 + }
7955 + return a;
7956 + }
7957 +}
7958 +module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports;
7959 +
7960 +/***/ }),
7961 +
7962 +/***/ "../node_modules/@babel/runtime/helpers/nonIterableRest.js":
7963 +/*!*****************************************************************!*\
7964 + !*** ../node_modules/@babel/runtime/helpers/nonIterableRest.js ***!
7965 + \*****************************************************************/
7966 +/***/ ((module) => {
7967 +
7968 +function _nonIterableRest() {
7969 + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
7970 +}
7971 +module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports;
7972 +
7973 +/***/ }),
7974 +
7975 +/***/ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js":
7976 +/*!***************************************************************************!*\
7977 + !*** ../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js ***!
7978 + \***************************************************************************/
7979 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
7980 +
7981 +var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
7982 +var assertThisInitialized = __webpack_require__(/*! ./assertThisInitialized.js */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js");
7983 +function _possibleConstructorReturn(t, e) {
7984 + if (e && ("object" == _typeof(e) || "function" == typeof e)) return e;
7985 + if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
7986 + return assertThisInitialized(t);
7987 +}
7988 +module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports;
7989 +
7990 +/***/ }),
7991 +
7992 +/***/ "../node_modules/@babel/runtime/helpers/readOnlyError.js":
7993 +/*!***************************************************************!*\
7994 + !*** ../node_modules/@babel/runtime/helpers/readOnlyError.js ***!
7995 + \***************************************************************/
7996 +/***/ ((module) => {
7997 +
7998 +function _readOnlyError(r) {
7999 + throw new TypeError('"' + r + '" is read-only');
8000 +}
8001 +module.exports = _readOnlyError, module.exports.__esModule = true, module.exports["default"] = module.exports;
8002 +
8003 +/***/ }),
8004 +
8005 +/***/ "../node_modules/@babel/runtime/helpers/regenerator.js":
8006 +/*!*************************************************************!*\
8007 + !*** ../node_modules/@babel/runtime/helpers/regenerator.js ***!
8008 + \*************************************************************/
8009 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
8010 +
8011 +var regeneratorDefine = __webpack_require__(/*! ./regeneratorDefine.js */ "../node_modules/@babel/runtime/helpers/regeneratorDefine.js");
8012 +function _regenerator() {
8013 + /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
8014 + var e,
8015 + t,
8016 + r = "function" == typeof Symbol ? Symbol : {},
8017 + n = r.iterator || "@@iterator",
8018 + o = r.toStringTag || "@@toStringTag";
8019 + function i(r, n, o, i) {
8020 + var c = n && n.prototype instanceof Generator ? n : Generator,
8021 + u = Object.create(c.prototype);
8022 + return regeneratorDefine(u, "_invoke", function (r, n, o) {
8023 + var i,
8024 + c,
8025 + u,
8026 + f = 0,
8027 + p = o || [],
8028 + y = !1,
8029 + G = {
8030 + p: 0,
8031 + n: 0,
8032 + v: e,
8033 + a: d,
8034 + f: d.bind(e, 4),
8035 + d: function d(t, r) {
8036 + return i = t, c = 0, u = e, G.n = r, a;
8037 + }
8038 + };
8039 + function d(r, n) {
8040 + for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {
8041 + var o,
8042 + i = p[t],
8043 + d = G.p,
8044 + l = i[2];
8045 + r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0));
8046 + }
8047 + if (o || r > 1) return a;
8048 + throw y = !0, n;
8049 + }
8050 + return function (o, p, l) {
8051 + if (f > 1) throw TypeError("Generator is already running");
8052 + for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) {
8053 + i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);
8054 + try {
8055 + if (f = 2, i) {
8056 + if (c || (o = "next"), t = i[o]) {
8057 + if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");
8058 + if (!t.done) return t;
8059 + u = t.value, c < 2 && (c = 0);
8060 + } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1);
8061 + i = e;
8062 + } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;
8063 + } catch (t) {
8064 + i = e, c = 1, u = t;
8065 + } finally {
8066 + f = 1;
8067 + }
8068 + }
8069 + return {
8070 + value: t,
8071 + done: y
8072 + };
8073 + };
8074 + }(r, o, i), !0), u;
8075 + }
8076 + var a = {};
8077 + function Generator() {}
8078 + function GeneratorFunction() {}
8079 + function GeneratorFunctionPrototype() {}
8080 + t = Object.getPrototypeOf;
8081 + var c = [][n] ? t(t([][n]())) : (regeneratorDefine(t = {}, n, function () {
8082 + return this;
8083 + }), t),
8084 + u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);
8085 + function f(e) {
8086 + return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e;
8087 + }
8088 + return GeneratorFunction.prototype = GeneratorFunctionPrototype, regeneratorDefine(u, "constructor", GeneratorFunctionPrototype), regeneratorDefine(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", regeneratorDefine(GeneratorFunctionPrototype, o, "GeneratorFunction"), regeneratorDefine(u), regeneratorDefine(u, o, "Generator"), regeneratorDefine(u, n, function () {
8089 + return this;
8090 + }), regeneratorDefine(u, "toString", function () {
8091 + return "[object Generator]";
8092 + }), (module.exports = _regenerator = function _regenerator() {
8093 + return {
8094 + w: i,
8095 + m: f
8096 + };
8097 + }, module.exports.__esModule = true, module.exports["default"] = module.exports)();
8098 +}
8099 +module.exports = _regenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
8100 +
8101 +/***/ }),
8102 +
8103 +/***/ "../node_modules/@babel/runtime/helpers/regeneratorAsync.js":
8104 +/*!******************************************************************!*\
8105 + !*** ../node_modules/@babel/runtime/helpers/regeneratorAsync.js ***!
8106 + \******************************************************************/
8107 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
8108 +
8109 +var regeneratorAsyncGen = __webpack_require__(/*! ./regeneratorAsyncGen.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js");
8110 +function _regeneratorAsync(n, e, r, t, o) {
8111 + var a = regeneratorAsyncGen(n, e, r, t, o);
8112 + return a.next().then(function (n) {
8113 + return n.done ? n.value : a.next();
8114 + });
8115 +}
8116 +module.exports = _regeneratorAsync, module.exports.__esModule = true, module.exports["default"] = module.exports;
8117 +
8118 +/***/ }),
8119 +
8120 +/***/ "../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js":
8121 +/*!*********************************************************************!*\
8122 + !*** ../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js ***!
8123 + \*********************************************************************/
8124 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
8125 +
8126 +var regenerator = __webpack_require__(/*! ./regenerator.js */ "../node_modules/@babel/runtime/helpers/regenerator.js");
8127 +var regeneratorAsyncIterator = __webpack_require__(/*! ./regeneratorAsyncIterator.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js");
8128 +function _regeneratorAsyncGen(r, e, t, o, n) {
8129 + return new regeneratorAsyncIterator(regenerator().w(r, e, t, o), n || Promise);
8130 +}
8131 +module.exports = _regeneratorAsyncGen, module.exports.__esModule = true, module.exports["default"] = module.exports;
8132 +
8133 +/***/ }),
8134 +
8135 +/***/ "../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js":
8136 +/*!**************************************************************************!*\
8137 + !*** ../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js ***!
8138 + \**************************************************************************/
8139 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
8140 +
8141 +var OverloadYield = __webpack_require__(/*! ./OverloadYield.js */ "../node_modules/@babel/runtime/helpers/OverloadYield.js");
8142 +var regeneratorDefine = __webpack_require__(/*! ./regeneratorDefine.js */ "../node_modules/@babel/runtime/helpers/regeneratorDefine.js");
8143 +function AsyncIterator(t, e) {
8144 + function n(r, o, i, f) {
8145 + try {
8146 + var c = t[r](o),
8147 + u = c.value;
8148 + return u instanceof OverloadYield ? e.resolve(u.v).then(function (t) {
8149 + n("next", t, i, f);
8150 + }, function (t) {
8151 + n("throw", t, i, f);
8152 + }) : e.resolve(u).then(function (t) {
8153 + c.value = t, i(c);
8154 + }, function (t) {
8155 + return n("throw", t, i, f);
8156 + });
8157 + } catch (t) {
8158 + f(t);
8159 + }
8160 + }
8161 + var r;
8162 + this.next || (regeneratorDefine(AsyncIterator.prototype), regeneratorDefine(AsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function () {
8163 + return this;
8164 + })), regeneratorDefine(this, "_invoke", function (t, o, i) {
8165 + function f() {
8166 + return new e(function (e, r) {
8167 + n(t, i, e, r);
8168 + });
8169 + }
8170 + return r = r ? r.then(f, f) : f();
8171 + }, !0);
8172 +}
8173 +module.exports = AsyncIterator, module.exports.__esModule = true, module.exports["default"] = module.exports;
8174 +
8175 +/***/ }),
8176 +
8177 +/***/ "../node_modules/@babel/runtime/helpers/regeneratorDefine.js":
8178 +/*!*******************************************************************!*\
8179 + !*** ../node_modules/@babel/runtime/helpers/regeneratorDefine.js ***!
8180 + \*******************************************************************/
8181 +/***/ ((module) => {
8182 +
8183 +function _regeneratorDefine(e, r, n, t) {
8184 + var i = Object.defineProperty;
8185 + try {
8186 + i({}, "", {});
8187 + } catch (e) {
8188 + i = 0;
8189 + }
8190 + module.exports = _regeneratorDefine = function regeneratorDefine(e, r, n, t) {
8191 + if (r) i ? i(e, r, {
8192 + value: n,
8193 + enumerable: !t,
8194 + configurable: !t,
8195 + writable: !t
8196 + }) : e[r] = n;else {
8197 + var o = function o(r, n) {
8198 + _regeneratorDefine(e, r, function (e) {
8199 + return this._invoke(r, n, e);
8200 + });
8201 + };
8202 + o("next", 0), o("throw", 1), o("return", 2);
8203 + }
8204 + }, module.exports.__esModule = true, module.exports["default"] = module.exports, _regeneratorDefine(e, r, n, t);
8205 +}
8206 +module.exports = _regeneratorDefine, module.exports.__esModule = true, module.exports["default"] = module.exports;
8207 +
8208 +/***/ }),
8209 +
8210 +/***/ "../node_modules/@babel/runtime/helpers/regeneratorKeys.js":
8211 +/*!*****************************************************************!*\
8212 + !*** ../node_modules/@babel/runtime/helpers/regeneratorKeys.js ***!
8213 + \*****************************************************************/
8214 +/***/ ((module) => {
8215 +
8216 +function _regeneratorKeys(e) {
8217 + var n = Object(e),
8218 + r = [];
8219 + for (var t in n) r.unshift(t);
8220 + return function e() {
8221 + for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = !1, e;
8222 + return e.done = !0, e;
8223 + };
8224 +}
8225 +module.exports = _regeneratorKeys, module.exports.__esModule = true, module.exports["default"] = module.exports;
8226 +
8227 +/***/ }),
8228 +
8229 +/***/ "../node_modules/@babel/runtime/helpers/regeneratorRuntime.js":
8230 +/*!********************************************************************!*\
8231 + !*** ../node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***!
8232 + \********************************************************************/
8233 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
8234 +
8235 +var OverloadYield = __webpack_require__(/*! ./OverloadYield.js */ "../node_modules/@babel/runtime/helpers/OverloadYield.js");
8236 +var regenerator = __webpack_require__(/*! ./regenerator.js */ "../node_modules/@babel/runtime/helpers/regenerator.js");
8237 +var regeneratorAsync = __webpack_require__(/*! ./regeneratorAsync.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsync.js");
8238 +var regeneratorAsyncGen = __webpack_require__(/*! ./regeneratorAsyncGen.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js");
8239 +var regeneratorAsyncIterator = __webpack_require__(/*! ./regeneratorAsyncIterator.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js");
8240 +var regeneratorKeys = __webpack_require__(/*! ./regeneratorKeys.js */ "../node_modules/@babel/runtime/helpers/regeneratorKeys.js");
8241 +var regeneratorValues = __webpack_require__(/*! ./regeneratorValues.js */ "../node_modules/@babel/runtime/helpers/regeneratorValues.js");
8242 +function _regeneratorRuntime() {
8243 + "use strict";
8244 +
8245 + var r = regenerator(),
8246 + e = r.m(_regeneratorRuntime),
8247 + t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor;
8248 + function n(r) {
8249 + var e = "function" == typeof r && r.constructor;
8250 + return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name));
8251 + }
8252 + var o = {
8253 + "throw": 1,
8254 + "return": 2,
8255 + "break": 3,
8256 + "continue": 3
8257 + };
8258 + function a(r) {
8259 + var e, t;
8260 + return function (n) {
8261 + e || (e = {
8262 + stop: function stop() {
8263 + return t(n.a, 2);
8264 + },
8265 + "catch": function _catch() {
8266 + return n.v;
8267 + },
8268 + abrupt: function abrupt(r, e) {
8269 + return t(n.a, o[r], e);
8270 + },
8271 + delegateYield: function delegateYield(r, o, a) {
8272 + return e.resultName = o, t(n.d, regeneratorValues(r), a);
8273 + },
8274 + finish: function finish(r) {
8275 + return t(n.f, r);
8276 + }
8277 + }, t = function t(r, _t, o) {
8278 + n.p = e.prev, n.n = e.next;
8279 + try {
8280 + return r(_t, o);
8281 + } finally {
8282 + e.next = n.n;
8283 + }
8284 + }), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n;
8285 + try {
8286 + return r.call(this, e);
8287 + } finally {
8288 + n.p = e.prev, n.n = e.next;
8289 + }
8290 + };
8291 + }
8292 + return (module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
8293 + return {
8294 + wrap: function wrap(e, t, n, o) {
8295 + return r.w(a(e), t, n, o && o.reverse());
8296 + },
8297 + isGeneratorFunction: n,
8298 + mark: r.m,
8299 + awrap: function awrap(r, e) {
8300 + return new OverloadYield(r, e);
8301 + },
8302 + AsyncIterator: regeneratorAsyncIterator,
8303 + async: function async(r, e, t, o, u) {
8304 + return (n(e) ? regeneratorAsyncGen : regeneratorAsync)(a(r), e, t, o, u);
8305 + },
8306 + keys: regeneratorKeys,
8307 + values: regeneratorValues
8308 + };
8309 + }, module.exports.__esModule = true, module.exports["default"] = module.exports)();
8310 +}
8311 +module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
8312 +
8313 +/***/ }),
8314 +
8315 +/***/ "../node_modules/@babel/runtime/helpers/regeneratorValues.js":
8316 +/*!*******************************************************************!*\
8317 + !*** ../node_modules/@babel/runtime/helpers/regeneratorValues.js ***!
8318 + \*******************************************************************/
8319 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
8320 +
8321 +var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
8322 +function _regeneratorValues(e) {
8323 + if (null != e) {
8324 + var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"],
8325 + r = 0;
8326 + if (t) return t.call(e);
8327 + if ("function" == typeof e.next) return e;
8328 + if (!isNaN(e.length)) return {
8329 + next: function next() {
8330 + return e && r >= e.length && (e = void 0), {
8331 + value: e && e[r++],
8332 + done: !e
8333 + };
8334 + }
8335 + };
8336 + }
8337 + throw new TypeError(_typeof(e) + " is not iterable");
8338 +}
8339 +module.exports = _regeneratorValues, module.exports.__esModule = true, module.exports["default"] = module.exports;
8340 +
8341 +/***/ }),
8342 +
8343 +/***/ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js":
8344 +/*!****************************************************************!*\
8345 + !*** ../node_modules/@babel/runtime/helpers/setPrototypeOf.js ***!
8346 + \****************************************************************/
8347 +/***/ ((module) => {
8348 +
8349 +function _setPrototypeOf(t, e) {
8350 + return module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
8351 + return t.__proto__ = e, t;
8352 + }, module.exports.__esModule = true, module.exports["default"] = module.exports, _setPrototypeOf(t, e);
8353 +}
8354 +module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
8355 +
8356 +/***/ }),
8357 +
8358 +/***/ "../node_modules/@babel/runtime/helpers/slicedToArray.js":
8359 +/*!***************************************************************!*\
8360 + !*** ../node_modules/@babel/runtime/helpers/slicedToArray.js ***!
8361 + \***************************************************************/
8362 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
8363 +
8364 +var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles.js */ "../node_modules/@babel/runtime/helpers/arrayWithHoles.js");
8365 +var iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit.js */ "../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js");
8366 +var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ "../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js");
8367 +var nonIterableRest = __webpack_require__(/*! ./nonIterableRest.js */ "../node_modules/@babel/runtime/helpers/nonIterableRest.js");
8368 +function _slicedToArray(r, e) {
8369 + return arrayWithHoles(r) || iterableToArrayLimit(r, e) || unsupportedIterableToArray(r, e) || nonIterableRest();
8370 +}
8371 +module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
8372 +
8373 +/***/ }),
8374 +
8375 +/***/ "../node_modules/@babel/runtime/helpers/superPropBase.js":
8376 +/*!***************************************************************!*\
8377 + !*** ../node_modules/@babel/runtime/helpers/superPropBase.js ***!
8378 + \***************************************************************/
8379 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
8380 +
8381 +var getPrototypeOf = __webpack_require__(/*! ./getPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js");
8382 +function _superPropBase(t, o) {
8383 + for (; !{}.hasOwnProperty.call(t, o) && null !== (t = getPrototypeOf(t)););
8384 + return t;
8385 +}
8386 +module.exports = _superPropBase, module.exports.__esModule = true, module.exports["default"] = module.exports;
8387 +
8388 +/***/ }),
8389 +
8390 +/***/ "../node_modules/@babel/runtime/helpers/toPrimitive.js":
8391 +/*!*************************************************************!*\
8392 + !*** ../node_modules/@babel/runtime/helpers/toPrimitive.js ***!
8393 + \*************************************************************/
8394 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
8395 +
8396 +var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
8397 +function toPrimitive(t, r) {
8398 + if ("object" != _typeof(t) || !t) return t;
8399 + var e = t[Symbol.toPrimitive];
8400 + if (void 0 !== e) {
8401 + var i = e.call(t, r || "default");
8402 + if ("object" != _typeof(i)) return i;
8403 + throw new TypeError("@@toPrimitive must return a primitive value.");
8404 + }
8405 + return ("string" === r ? String : Number)(t);
8406 +}
8407 +module.exports = toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
8408 +
8409 +/***/ }),
8410 +
8411 +/***/ "../node_modules/@babel/runtime/helpers/toPropertyKey.js":
8412 +/*!***************************************************************!*\
8413 + !*** ../node_modules/@babel/runtime/helpers/toPropertyKey.js ***!
8414 + \***************************************************************/
8415 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
8416 +
8417 +var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
8418 +var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ "../node_modules/@babel/runtime/helpers/toPrimitive.js");
8419 +function toPropertyKey(t) {
8420 + var i = toPrimitive(t, "string");
8421 + return "symbol" == _typeof(i) ? i : i + "";
8422 +}
8423 +module.exports = toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
8424 +
8425 +/***/ }),
8426 +
8427 +/***/ "../node_modules/@babel/runtime/helpers/typeof.js":
8428 +/*!********************************************************!*\
8429 + !*** ../node_modules/@babel/runtime/helpers/typeof.js ***!
8430 + \********************************************************/
8431 +/***/ ((module) => {
8432 +
8433 +function _typeof(o) {
8434 + "@babel/helpers - typeof";
8435 +
8436 + return module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
8437 + return typeof o;
8438 + } : function (o) {
8439 + return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
8440 + }, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof(o);
8441 +}
8442 +module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
8443 +
8444 +/***/ }),
8445 +
8446 +/***/ "../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js":
8447 +/*!****************************************************************************!*\
8448 + !*** ../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***!
8449 + \****************************************************************************/
8450 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
8451 +
8452 +var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js");
8453 +function _unsupportedIterableToArray(r, a) {
8454 + if (r) {
8455 + if ("string" == typeof r) return arrayLikeToArray(r, a);
8456 + var t = {}.toString.call(r).slice(8, -1);
8457 + 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;
8458 + }
8459 +}
8460 +module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
8461 +
8462 +/***/ }),
8463 +
8464 +/***/ "../node_modules/@babel/runtime/helpers/wrapNativeSuper.js":
8465 +/*!*****************************************************************!*\
8466 + !*** ../node_modules/@babel/runtime/helpers/wrapNativeSuper.js ***!
8467 + \*****************************************************************/
8468 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
8469 +
8470 +var getPrototypeOf = __webpack_require__(/*! ./getPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js");
8471 +var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js");
8472 +var isNativeFunction = __webpack_require__(/*! ./isNativeFunction.js */ "../node_modules/@babel/runtime/helpers/isNativeFunction.js");
8473 +var construct = __webpack_require__(/*! ./construct.js */ "../node_modules/@babel/runtime/helpers/construct.js");
8474 +function _wrapNativeSuper(t) {
8475 + var r = "function" == typeof Map ? new Map() : void 0;
8476 + return module.exports = _wrapNativeSuper = function _wrapNativeSuper(t) {
8477 + if (null === t || !isNativeFunction(t)) return t;
8478 + if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function");
8479 + if (void 0 !== r) {
8480 + if (r.has(t)) return r.get(t);
8481 + r.set(t, Wrapper);
8482 + }
8483 + function Wrapper() {
8484 + return construct(t, arguments, getPrototypeOf(this).constructor);
8485 + }
8486 + return Wrapper.prototype = Object.create(t.prototype, {
8487 + constructor: {
8488 + value: Wrapper,
8489 + enumerable: !1,
8490 + writable: !0,
8491 + configurable: !0
8492 + }
8493 + }), setPrototypeOf(Wrapper, t);
8494 + }, module.exports.__esModule = true, module.exports["default"] = module.exports, _wrapNativeSuper(t);
8495 +}
8496 +module.exports = _wrapNativeSuper, module.exports.__esModule = true, module.exports["default"] = module.exports;
8497 +
8498 +/***/ }),
8499 +
8500 +/***/ "../node_modules/@babel/runtime/regenerator/index.js":
8501 +/*!***********************************************************!*\
8502 + !*** ../node_modules/@babel/runtime/regenerator/index.js ***!
8503 + \***********************************************************/
8504 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
8505 +
8506 +// TODO(Babel 8): Remove this file.
8507 +
8508 +var runtime = __webpack_require__(/*! ../helpers/regeneratorRuntime */ "../node_modules/@babel/runtime/helpers/regeneratorRuntime.js")();
8509 +module.exports = runtime;
8510 +
8511 +// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
8512 +try {
8513 + regeneratorRuntime = runtime;
8514 +} catch (accidentalStrictMode) {
8515 + if (typeof globalThis === "object") {
8516 + globalThis.regeneratorRuntime = runtime;
8517 + } else {
8518 + Function("r", "regeneratorRuntime = r")(runtime);
8519 + }
8520 +}
8521 +
8522 +
8523 +/***/ }),
8524 +
8525 +/***/ "../node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js":
8526 +/*!******************************************************************!*\
8527 + !*** ../node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js ***!
8528 + \******************************************************************/
8529 +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8530 +
8531 +"use strict";
8532 +__webpack_require__.r(__webpack_exports__);
8533 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
8534 +/* harmony export */ EnhancerArray: () => (/* binding */ EnhancerArray),
8535 +/* harmony export */ MiddlewareArray: () => (/* binding */ MiddlewareArray),
8536 +/* harmony export */ SHOULD_AUTOBATCH: () => (/* binding */ SHOULD_AUTOBATCH),
8537 +/* harmony export */ TaskAbortError: () => (/* binding */ TaskAbortError),
8538 +/* harmony export */ __DO_NOT_USE__ActionTypes: () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_0__.__DO_NOT_USE__ActionTypes),
8539 +/* harmony export */ addListener: () => (/* binding */ addListener),
8540 +/* harmony export */ applyMiddleware: () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_0__.applyMiddleware),
8541 +/* harmony export */ autoBatchEnhancer: () => (/* binding */ autoBatchEnhancer),
8542 +/* harmony export */ bindActionCreators: () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_0__.bindActionCreators),
8543 +/* harmony export */ clearAllListeners: () => (/* binding */ clearAllListeners),
8544 +/* harmony export */ combineReducers: () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_0__.combineReducers),
8545 +/* harmony export */ compose: () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_0__.compose),
8546 +/* harmony export */ configureStore: () => (/* binding */ configureStore),
8547 +/* harmony export */ createAction: () => (/* binding */ createAction),
8548 +/* harmony export */ createActionCreatorInvariantMiddleware: () => (/* binding */ createActionCreatorInvariantMiddleware),
8549 +/* harmony export */ createAsyncThunk: () => (/* binding */ createAsyncThunk),
8550 +/* harmony export */ createDraftSafeSelector: () => (/* binding */ createDraftSafeSelector),
8551 +/* harmony export */ createEntityAdapter: () => (/* binding */ createEntityAdapter),
8552 +/* harmony export */ createImmutableStateInvariantMiddleware: () => (/* binding */ createImmutableStateInvariantMiddleware),
8553 +/* harmony export */ createListenerMiddleware: () => (/* binding */ createListenerMiddleware),
8554 +/* harmony export */ createNextState: () => (/* reexport safe */ immer__WEBPACK_IMPORTED_MODULE_2__["default"]),
8555 +/* harmony export */ createReducer: () => (/* binding */ createReducer),
8556 +/* harmony export */ createSelector: () => (/* reexport safe */ reselect__WEBPACK_IMPORTED_MODULE_1__.createSelector),
8557 +/* harmony export */ createSerializableStateInvariantMiddleware: () => (/* binding */ createSerializableStateInvariantMiddleware),
8558 +/* harmony export */ createSlice: () => (/* binding */ createSlice),
8559 +/* harmony export */ createStore: () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_0__.createStore),
8560 +/* harmony export */ current: () => (/* reexport safe */ immer__WEBPACK_IMPORTED_MODULE_2__.current),
8561 +/* harmony export */ findNonSerializableValue: () => (/* binding */ findNonSerializableValue),
8562 +/* harmony export */ freeze: () => (/* reexport safe */ immer__WEBPACK_IMPORTED_MODULE_2__.freeze),
8563 +/* harmony export */ getDefaultMiddleware: () => (/* binding */ getDefaultMiddleware),
8564 +/* harmony export */ getType: () => (/* binding */ getType),
8565 +/* harmony export */ isAction: () => (/* binding */ isAction),
8566 +/* harmony export */ isActionCreator: () => (/* binding */ isActionCreator),
8567 +/* harmony export */ isAllOf: () => (/* binding */ isAllOf),
8568 +/* harmony export */ isAnyOf: () => (/* binding */ isAnyOf),
8569 +/* harmony export */ isAsyncThunkAction: () => (/* binding */ isAsyncThunkAction),
8570 +/* harmony export */ isDraft: () => (/* reexport safe */ immer__WEBPACK_IMPORTED_MODULE_2__.isDraft),
8571 +/* harmony export */ isFluxStandardAction: () => (/* binding */ isFSA),
8572 +/* harmony export */ isFulfilled: () => (/* binding */ isFulfilled),
8573 +/* harmony export */ isImmutableDefault: () => (/* binding */ isImmutableDefault),
8574 +/* harmony export */ isPending: () => (/* binding */ isPending),
8575 +/* harmony export */ isPlain: () => (/* binding */ isPlain),
8576 +/* harmony export */ isPlainObject: () => (/* binding */ isPlainObject),
8577 +/* harmony export */ isRejected: () => (/* binding */ isRejected),
8578 +/* harmony export */ isRejectedWithValue: () => (/* binding */ isRejectedWithValue),
8579 +/* harmony export */ legacy_createStore: () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_0__.legacy_createStore),
8580 +/* harmony export */ miniSerializeError: () => (/* binding */ miniSerializeError),
8581 +/* harmony export */ nanoid: () => (/* binding */ nanoid),
8582 +/* harmony export */ original: () => (/* reexport safe */ immer__WEBPACK_IMPORTED_MODULE_2__.original),
8583 +/* harmony export */ prepareAutoBatched: () => (/* binding */ prepareAutoBatched),
8584 +/* harmony export */ removeListener: () => (/* binding */ removeListener),
8585 +/* harmony export */ unwrapResult: () => (/* binding */ unwrapResult)
8586 +/* harmony export */ });
8587 +/* harmony import */ var immer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! immer */ "../node_modules/immer/dist/immer.esm.mjs");
8588 +/* harmony import */ var redux__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! redux */ "../node_modules/redux/es/redux.js");
8589 +/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! reselect */ "../node_modules/reselect/es/index.js");
8590 +/* harmony import */ var redux_thunk__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! redux-thunk */ "../node_modules/redux-thunk/es/index.js");
8591 +var __extends = (undefined && undefined.__extends) || (function () {
8592 + var extendStatics = function (d, b) {
8593 + extendStatics = Object.setPrototypeOf ||
8594 + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
8595 + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
8596 + return extendStatics(d, b);
8597 + };
8598 + return function (d, b) {
8599 + if (typeof b !== "function" && b !== null)
8600 + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
8601 + extendStatics(d, b);
8602 + function __() { this.constructor = d; }
8603 + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
8604 + };
8605 +})();
8606 +var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
8607 + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
8608 + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
8609 + function verb(n) { return function (v) { return step([n, v]); }; }
8610 + function step(op) {
8611 + if (f) throw new TypeError("Generator is already executing.");
8612 + while (_) try {
8613 + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
8614 + if (y = 0, t) op = [op[0] & 2, t.value];
8615 + switch (op[0]) {
8616 + case 0: case 1: t = op; break;
8617 + case 4: _.label++; return { value: op[1], done: false };
8618 + case 5: _.label++; y = op[1]; op = [0]; continue;
8619 + case 7: op = _.ops.pop(); _.trys.pop(); continue;
8620 + default:
8621 + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
8622 + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
8623 + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
8624 + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
8625 + if (t[2]) _.ops.pop();
8626 + _.trys.pop(); continue;
8627 + }
8628 + op = body.call(thisArg, _);
8629 + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
8630 + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
8631 + }
8632 +};
8633 +var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from) {
8634 + for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
8635 + to[j] = from[i];
8636 + return to;
8637 +};
8638 +var __defProp = Object.defineProperty;
8639 +var __defProps = Object.defineProperties;
8640 +var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
8641 +var __getOwnPropSymbols = Object.getOwnPropertySymbols;
8642 +var __hasOwnProp = Object.prototype.hasOwnProperty;
8643 +var __propIsEnum = Object.prototype.propertyIsEnumerable;
8644 +var __defNormalProp = function (obj, key, value) { return key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value: value }) : obj[key] = value; };
8645 +var __spreadValues = function (a, b) {
8646 + for (var prop in b || (b = {}))
8647 + if (__hasOwnProp.call(b, prop))
8648 + __defNormalProp(a, prop, b[prop]);
8649 + if (__getOwnPropSymbols)
8650 + for (var _i = 0, _c = __getOwnPropSymbols(b); _i < _c.length; _i++) {
8651 + var prop = _c[_i];
8652 + if (__propIsEnum.call(b, prop))
8653 + __defNormalProp(a, prop, b[prop]);
8654 + }
8655 + return a;
8656 +};
8657 +var __spreadProps = function (a, b) { return __defProps(a, __getOwnPropDescs(b)); };
8658 +var __async = function (__this, __arguments, generator) {
8659 + return new Promise(function (resolve, reject) {
8660 + var fulfilled = function (value) {
8661 + try {
8662 + step(generator.next(value));
8663 + }
8664 + catch (e) {
8665 + reject(e);
8666 + }
8667 + };
8668 + var rejected = function (value) {
8669 + try {
8670 + step(generator.throw(value));
8671 + }
8672 + catch (e) {
8673 + reject(e);
8674 + }
8675 + };
8676 + var step = function (x) { return x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); };
8677 + step((generator = generator.apply(__this, __arguments)).next());
8678 + });
8679 +};
8680 +// src/index.ts
8681 +
8682 +
8683 +
8684 +
8685 +// src/createDraftSafeSelector.ts
8686 +
8687 +
8688 +var createDraftSafeSelector = function () {
8689 + var args = [];
8690 + for (var _i = 0; _i < arguments.length; _i++) {
8691 + args[_i] = arguments[_i];
8692 + }
8693 + var selector = reselect__WEBPACK_IMPORTED_MODULE_1__.createSelector.apply(void 0, args);
8694 + var wrappedSelector = function (value) {
8695 + var rest = [];
8696 + for (var _i = 1; _i < arguments.length; _i++) {
8697 + rest[_i - 1] = arguments[_i];
8698 + }
8699 + return selector.apply(void 0, __spreadArray([(0,immer__WEBPACK_IMPORTED_MODULE_2__.isDraft)(value) ? (0,immer__WEBPACK_IMPORTED_MODULE_2__.current)(value) : value], rest));
8700 + };
8701 + return wrappedSelector;
8702 +};
8703 +// src/configureStore.ts
8704 +
8705 +// src/devtoolsExtension.ts
8706 +
8707 +var composeWithDevTools = typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ : function () {
8708 + if (arguments.length === 0)
8709 + return void 0;
8710 + if (typeof arguments[0] === "object")
8711 + return redux__WEBPACK_IMPORTED_MODULE_0__.compose;
8712 + return redux__WEBPACK_IMPORTED_MODULE_0__.compose.apply(null, arguments);
8713 +};
8714 +var devToolsEnhancer = typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__ : function () {
8715 + return function (noop2) {
8716 + return noop2;
8717 + };
8718 +};
8719 +// src/isPlainObject.ts
8720 +function isPlainObject(value) {
8721 + if (typeof value !== "object" || value === null)
8722 + return false;
8723 + var proto = Object.getPrototypeOf(value);
8724 + if (proto === null)
8725 + return true;
8726 + var baseProto = proto;
8727 + while (Object.getPrototypeOf(baseProto) !== null) {
8728 + baseProto = Object.getPrototypeOf(baseProto);
8729 + }
8730 + return proto === baseProto;
8731 +}
8732 +// src/getDefaultMiddleware.ts
8733 +
8734 +// src/tsHelpers.ts
8735 +var hasMatchFunction = function (v) {
8736 + return v && typeof v.match === "function";
8737 +};
8738 +// src/createAction.ts
8739 +function createAction(type, prepareAction) {
8740 + function actionCreator() {
8741 + var args = [];
8742 + for (var _i = 0; _i < arguments.length; _i++) {
8743 + args[_i] = arguments[_i];
8744 + }
8745 + if (prepareAction) {
8746 + var prepared = prepareAction.apply(void 0, args);
8747 + if (!prepared) {
8748 + throw new Error("prepareAction did not return an object");
8749 + }
8750 + return __spreadValues(__spreadValues({
8751 + type: type,
8752 + payload: prepared.payload
8753 + }, "meta" in prepared && { meta: prepared.meta }), "error" in prepared && { error: prepared.error });
8754 + }
8755 + return { type: type, payload: args[0] };
8756 + }
8757 + actionCreator.toString = function () { return "" + type; };
8758 + actionCreator.type = type;
8759 + actionCreator.match = function (action) { return action.type === type; };
8760 + return actionCreator;
8761 +}
8762 +function isAction(action) {
8763 + return isPlainObject(action) && "type" in action;
8764 +}
8765 +function isActionCreator(action) {
8766 + return typeof action === "function" && "type" in action && hasMatchFunction(action);
8767 +}
8768 +function isFSA(action) {
8769 + return isAction(action) && typeof action.type === "string" && Object.keys(action).every(isValidKey);
8770 +}
8771 +function isValidKey(key) {
8772 + return ["type", "payload", "error", "meta"].indexOf(key) > -1;
8773 +}
8774 +function getType(actionCreator) {
8775 + return "" + actionCreator;
8776 +}
8777 +// src/actionCreatorInvariantMiddleware.ts
8778 +function getMessage(type) {
8779 + var splitType = type ? ("" + type).split("/") : [];
8780 + var actionName = splitType[splitType.length - 1] || "actionCreator";
8781 + return "Detected an action creator with type \"" + (type || "unknown") + "\" being dispatched. \nMake sure you're calling the action creator before dispatching, i.e. `dispatch(" + actionName + "())` instead of `dispatch(" + actionName + ")`. This is necessary even if the action has no payload.";
8782 +}
8783 +function createActionCreatorInvariantMiddleware(options) {
8784 + if (options === void 0) { options = {}; }
8785 + if (false) // removed by dead control flow
8786 +{}
8787 + var _c = options.isActionCreator, isActionCreator2 = _c === void 0 ? isActionCreator : _c;
8788 + return function () { return function (next) { return function (action) {
8789 + if (isActionCreator2(action)) {
8790 + console.warn(getMessage(action.type));
8791 + }
8792 + return next(action);
8793 + }; }; };
8794 +}
8795 +// src/utils.ts
8796 +
8797 +function getTimeMeasureUtils(maxDelay, fnName) {
8798 + var elapsed = 0;
8799 + return {
8800 + measureTime: function (fn) {
8801 + var started = Date.now();
8802 + try {
8803 + return fn();
8804 + }
8805 + finally {
8806 + var finished = Date.now();
8807 + elapsed += finished - started;
8808 + }
8809 + },
8810 + warnIfExceeded: function () {
8811 + if (elapsed > maxDelay) {
8812 + console.warn(fnName + " took " + elapsed + "ms, which is more than the warning threshold of " + maxDelay + "ms. \nIf your state or actions are very large, you may want to disable the middleware as it might cause too much of a slowdown in development mode. See https://redux-toolkit.js.org/api/getDefaultMiddleware for instructions.\nIt is disabled in production builds, so you don't need to worry about that.");
8813 + }
8814 + }
8815 + };
8816 +}
8817 +var MiddlewareArray = /** @class */ (function (_super) {
8818 + __extends(MiddlewareArray, _super);
8819 + function MiddlewareArray() {
8820 + var args = [];
8821 + for (var _i = 0; _i < arguments.length; _i++) {
8822 + args[_i] = arguments[_i];
8823 + }
8824 + var _this = _super.apply(this, args) || this;
8825 + Object.setPrototypeOf(_this, MiddlewareArray.prototype);
8826 + return _this;
8827 + }
8828 + Object.defineProperty(MiddlewareArray, Symbol.species, {
8829 + get: function () {
8830 + return MiddlewareArray;
8831 + },
8832 + enumerable: false,
8833 + configurable: true
8834 + });
8835 + MiddlewareArray.prototype.concat = function () {
8836 + var arr = [];
8837 + for (var _i = 0; _i < arguments.length; _i++) {
8838 + arr[_i] = arguments[_i];
8839 + }
8840 + return _super.prototype.concat.apply(this, arr);
8841 + };
8842 + MiddlewareArray.prototype.prepend = function () {
8843 + var arr = [];
8844 + for (var _i = 0; _i < arguments.length; _i++) {
8845 + arr[_i] = arguments[_i];
8846 + }
8847 + if (arr.length === 1 && Array.isArray(arr[0])) {
8848 + return new (MiddlewareArray.bind.apply(MiddlewareArray, __spreadArray([void 0], arr[0].concat(this))))();
8849 + }
8850 + return new (MiddlewareArray.bind.apply(MiddlewareArray, __spreadArray([void 0], arr.concat(this))))();
8851 + };
8852 + return MiddlewareArray;
8853 +}(Array));
8854 +var EnhancerArray = /** @class */ (function (_super) {
8855 + __extends(EnhancerArray, _super);
8856 + function EnhancerArray() {
8857 + var args = [];
8858 + for (var _i = 0; _i < arguments.length; _i++) {
8859 + args[_i] = arguments[_i];
8860 + }
8861 + var _this = _super.apply(this, args) || this;
8862 + Object.setPrototypeOf(_this, EnhancerArray.prototype);
8863 + return _this;
8864 + }
8865 + Object.defineProperty(EnhancerArray, Symbol.species, {
8866 + get: function () {
8867 + return EnhancerArray;
8868 + },
8869 + enumerable: false,
8870 + configurable: true
8871 + });
8872 + EnhancerArray.prototype.concat = function () {
8873 + var arr = [];
8874 + for (var _i = 0; _i < arguments.length; _i++) {
8875 + arr[_i] = arguments[_i];
8876 + }
8877 + return _super.prototype.concat.apply(this, arr);
8878 + };
8879 + EnhancerArray.prototype.prepend = function () {
8880 + var arr = [];
8881 + for (var _i = 0; _i < arguments.length; _i++) {
8882 + arr[_i] = arguments[_i];
8883 + }
8884 + if (arr.length === 1 && Array.isArray(arr[0])) {
8885 + return new (EnhancerArray.bind.apply(EnhancerArray, __spreadArray([void 0], arr[0].concat(this))))();
8886 + }
8887 + return new (EnhancerArray.bind.apply(EnhancerArray, __spreadArray([void 0], arr.concat(this))))();
8888 + };
8889 + return EnhancerArray;
8890 +}(Array));
8891 +function freezeDraftable(val) {
8892 + return (0,immer__WEBPACK_IMPORTED_MODULE_2__.isDraftable)(val) ? (0,immer__WEBPACK_IMPORTED_MODULE_2__["default"])(val, function () {
8893 + }) : val;
8894 +}
8895 +// src/immutableStateInvariantMiddleware.ts
8896 +var isProduction = "development" === "production";
8897 +var prefix = "Invariant failed";
8898 +function invariant(condition, message) {
8899 + if (condition) {
8900 + return;
8901 + }
8902 + if (isProduction) {
8903 + throw new Error(prefix);
8904 + }
8905 + throw new Error(prefix + ": " + (message || ""));
8906 +}
8907 +function stringify(obj, serializer, indent, decycler) {
8908 + return JSON.stringify(obj, getSerialize(serializer, decycler), indent);
8909 +}
8910 +function getSerialize(serializer, decycler) {
8911 + var stack = [], keys = [];
8912 + if (!decycler)
8913 + decycler = function (_, value) {
8914 + if (stack[0] === value)
8915 + return "[Circular ~]";
8916 + return "[Circular ~." + keys.slice(0, stack.indexOf(value)).join(".") + "]";
8917 + };
8918 + return function (key, value) {
8919 + if (stack.length > 0) {
8920 + var thisPos = stack.indexOf(this);
8921 + ~thisPos ? stack.splice(thisPos + 1) : stack.push(this);
8922 + ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key);
8923 + if (~stack.indexOf(value))
8924 + value = decycler.call(this, key, value);
8925 + }
8926 + else
8927 + stack.push(value);
8928 + return serializer == null ? value : serializer.call(this, key, value);
8929 + };
8930 +}
8931 +function isImmutableDefault(value) {
8932 + return typeof value !== "object" || value == null || Object.isFrozen(value);
8933 +}
8934 +function trackForMutations(isImmutable, ignorePaths, obj) {
8935 + var trackedProperties = trackProperties(isImmutable, ignorePaths, obj);
8936 + return {
8937 + detectMutations: function () {
8938 + return detectMutations(isImmutable, ignorePaths, trackedProperties, obj);
8939 + }
8940 + };
8941 +}
8942 +function trackProperties(isImmutable, ignorePaths, obj, path, checkedObjects) {
8943 + if (ignorePaths === void 0) { ignorePaths = []; }
8944 + if (path === void 0) { path = ""; }
8945 + if (checkedObjects === void 0) { checkedObjects = new Set(); }
8946 + var tracked = { value: obj };
8947 + if (!isImmutable(obj) && !checkedObjects.has(obj)) {
8948 + checkedObjects.add(obj);
8949 + tracked.children = {};
8950 + for (var key in obj) {
8951 + var childPath = path ? path + "." + key : key;
8952 + if (ignorePaths.length && ignorePaths.indexOf(childPath) !== -1) {
8953 + continue;
8954 + }
8955 + tracked.children[key] = trackProperties(isImmutable, ignorePaths, obj[key], childPath);
8956 + }
8957 + }
8958 + return tracked;
8959 +}
8960 +function detectMutations(isImmutable, ignoredPaths, trackedProperty, obj, sameParentRef, path) {
8961 + if (ignoredPaths === void 0) { ignoredPaths = []; }
8962 + if (sameParentRef === void 0) { sameParentRef = false; }
8963 + if (path === void 0) { path = ""; }
8964 + var prevObj = trackedProperty ? trackedProperty.value : void 0;
8965 + var sameRef = prevObj === obj;
8966 + if (sameParentRef && !sameRef && !Number.isNaN(obj)) {
8967 + return { wasMutated: true, path: path };
8968 + }
8969 + if (isImmutable(prevObj) || isImmutable(obj)) {
8970 + return { wasMutated: false };
8971 + }
8972 + var keysToDetect = {};
8973 + for (var key in trackedProperty.children) {
8974 + keysToDetect[key] = true;
8975 + }
8976 + for (var key in obj) {
8977 + keysToDetect[key] = true;
8978 + }
8979 + var hasIgnoredPaths = ignoredPaths.length > 0;
8980 + var _loop_1 = function (key) {
8981 + var nestedPath = path ? path + "." + key : key;
8982 + if (hasIgnoredPaths) {
8983 + var hasMatches = ignoredPaths.some(function (ignored) {
8984 + if (ignored instanceof RegExp) {
8985 + return ignored.test(nestedPath);
8986 + }
8987 + return nestedPath === ignored;
8988 + });
8989 + if (hasMatches) {
8990 + return "continue";
8991 + }
8992 + }
8993 + var result = detectMutations(isImmutable, ignoredPaths, trackedProperty.children[key], obj[key], sameRef, nestedPath);
8994 + if (result.wasMutated) {
8995 + return { value: result };
8996 + }
8997 + };
8998 + for (var key in keysToDetect) {
8999 + var state_1 = _loop_1(key);
9000 + if (typeof state_1 === "object")
9001 + return state_1.value;
9002 + }
9003 + return { wasMutated: false };
9004 +}
9005 +function createImmutableStateInvariantMiddleware(options) {
9006 + if (options === void 0) { options = {}; }
9007 + if (false) // removed by dead control flow
9008 +{}
9009 + var _c = options.isImmutable, isImmutable = _c === void 0 ? isImmutableDefault : _c, ignoredPaths = options.ignoredPaths, _d = options.warnAfter, warnAfter = _d === void 0 ? 32 : _d, ignore = options.ignore;
9010 + ignoredPaths = ignoredPaths || ignore;
9011 + var track = trackForMutations.bind(null, isImmutable, ignoredPaths);
9012 + return function (_c) {
9013 + var getState = _c.getState;
9014 + var state = getState();
9015 + var tracker = track(state);
9016 + var result;
9017 + return function (next) { return function (action) {
9018 + var measureUtils = getTimeMeasureUtils(warnAfter, "ImmutableStateInvariantMiddleware");
9019 + measureUtils.measureTime(function () {
9020 + state = getState();
9021 + result = tracker.detectMutations();
9022 + tracker = track(state);
9023 + invariant(!result.wasMutated, "A state mutation was detected between dispatches, in the path '" + (result.path || "") + "'. This may cause incorrect behavior. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)");
9024 + });
9025 + var dispatchedAction = next(action);
9026 + measureUtils.measureTime(function () {
9027 + state = getState();
9028 + result = tracker.detectMutations();
9029 + tracker = track(state);
9030 + result.wasMutated && invariant(!result.wasMutated, "A state mutation was detected inside a dispatch, in the path: " + (result.path || "") + ". Take a look at the reducer(s) handling the action " + stringify(action) + ". (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)");
9031 + });
9032 + measureUtils.warnIfExceeded();
9033 + return dispatchedAction;
9034 + }; };
9035 + };
9036 +}
9037 +// src/serializableStateInvariantMiddleware.ts
9038 +function isPlain(val) {
9039 + var type = typeof val;
9040 + return val == null || type === "string" || type === "boolean" || type === "number" || Array.isArray(val) || isPlainObject(val);
9041 +}
9042 +function findNonSerializableValue(value, path, isSerializable, getEntries, ignoredPaths, cache) {
9043 + if (path === void 0) { path = ""; }
9044 + if (isSerializable === void 0) { isSerializable = isPlain; }
9045 + if (ignoredPaths === void 0) { ignoredPaths = []; }
9046 + var foundNestedSerializable;
9047 + if (!isSerializable(value)) {
9048 + return {
9049 + keyPath: path || "<root>",
9050 + value: value
9051 + };
9052 + }
9053 + if (typeof value !== "object" || value === null) {
9054 + return false;
9055 + }
9056 + if (cache == null ? void 0 : cache.has(value))
9057 + return false;
9058 + var entries = getEntries != null ? getEntries(value) : Object.entries(value);
9059 + var hasIgnoredPaths = ignoredPaths.length > 0;
9060 + var _loop_2 = function (key, nestedValue) {
9061 + var nestedPath = path ? path + "." + key : key;
9062 + if (hasIgnoredPaths) {
9063 + var hasMatches = ignoredPaths.some(function (ignored) {
9064 + if (ignored instanceof RegExp) {
9065 + return ignored.test(nestedPath);
9066 + }
9067 + return nestedPath === ignored;
9068 + });
9069 + if (hasMatches) {
9070 + return "continue";
9071 + }
9072 + }
9073 + if (!isSerializable(nestedValue)) {
9074 + return { value: {
9075 + keyPath: nestedPath,
9076 + value: nestedValue
9077 + } };
9078 + }
9079 + if (typeof nestedValue === "object") {
9080 + foundNestedSerializable = findNonSerializableValue(nestedValue, nestedPath, isSerializable, getEntries, ignoredPaths, cache);
9081 + if (foundNestedSerializable) {
9082 + return { value: foundNestedSerializable };
9083 + }
9084 + }
9085 + };
9086 + for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {
9087 + var _c = entries_1[_i], key = _c[0], nestedValue = _c[1];
9088 + var state_2 = _loop_2(key, nestedValue);
9089 + if (typeof state_2 === "object")
9090 + return state_2.value;
9091 + }
9092 + if (cache && isNestedFrozen(value))
9093 + cache.add(value);
9094 + return false;
9095 +}
9096 +function isNestedFrozen(value) {
9097 + if (!Object.isFrozen(value))
9098 + return false;
9099 + for (var _i = 0, _c = Object.values(value); _i < _c.length; _i++) {
9100 + var nestedValue = _c[_i];
9101 + if (typeof nestedValue !== "object" || nestedValue === null)
9102 + continue;
9103 + if (!isNestedFrozen(nestedValue))
9104 + return false;
9105 + }
9106 + return true;
9107 +}
9108 +function createSerializableStateInvariantMiddleware(options) {
9109 + if (options === void 0) { options = {}; }
9110 + if (false) // removed by dead control flow
9111 +{}
9112 + var _c = options.isSerializable, isSerializable = _c === void 0 ? isPlain : _c, getEntries = options.getEntries, _d = options.ignoredActions, ignoredActions = _d === void 0 ? [] : _d, _e = options.ignoredActionPaths, ignoredActionPaths = _e === void 0 ? ["meta.arg", "meta.baseQueryMeta"] : _e, _f = options.ignoredPaths, ignoredPaths = _f === void 0 ? [] : _f, _g = options.warnAfter, warnAfter = _g === void 0 ? 32 : _g, _h = options.ignoreState, ignoreState = _h === void 0 ? false : _h, _j = options.ignoreActions, ignoreActions = _j === void 0 ? false : _j, _k = options.disableCache, disableCache = _k === void 0 ? false : _k;
9113 + var cache = !disableCache && WeakSet ? new WeakSet() : void 0;
9114 + return function (storeAPI) { return function (next) { return function (action) {
9115 + var result = next(action);
9116 + var measureUtils = getTimeMeasureUtils(warnAfter, "SerializableStateInvariantMiddleware");
9117 + if (!ignoreActions && !(ignoredActions.length && ignoredActions.indexOf(action.type) !== -1)) {
9118 + measureUtils.measureTime(function () {
9119 + var foundActionNonSerializableValue = findNonSerializableValue(action, "", isSerializable, getEntries, ignoredActionPaths, cache);
9120 + if (foundActionNonSerializableValue) {
9121 + var keyPath = foundActionNonSerializableValue.keyPath, value = foundActionNonSerializableValue.value;
9122 + console.error("A non-serializable value was detected in an action, in the path: `" + keyPath + "`. Value:", value, "\nTake a look at the logic that dispatched this action: ", action, "\n(See https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants)", "\n(To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)");
9123 + }
9124 + });
9125 + }
9126 + if (!ignoreState) {
9127 + measureUtils.measureTime(function () {
9128 + var state = storeAPI.getState();
9129 + var foundStateNonSerializableValue = findNonSerializableValue(state, "", isSerializable, getEntries, ignoredPaths, cache);
9130 + if (foundStateNonSerializableValue) {
9131 + var keyPath = foundStateNonSerializableValue.keyPath, value = foundStateNonSerializableValue.value;
9132 + console.error("A non-serializable value was detected in the state, in the path: `" + keyPath + "`. Value:", value, "\nTake a look at the reducer(s) handling this action type: " + action.type + ".\n(See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)");
9133 + }
9134 + });
9135 + measureUtils.warnIfExceeded();
9136 + }
9137 + return result;
9138 + }; }; };
9139 +}
9140 +// src/getDefaultMiddleware.ts
9141 +function isBoolean(x) {
9142 + return typeof x === "boolean";
9143 +}
9144 +function curryGetDefaultMiddleware() {
9145 + return function curriedGetDefaultMiddleware(options) {
9146 + return getDefaultMiddleware(options);
9147 + };
9148 +}
9149 +function getDefaultMiddleware(options) {
9150 + if (options === void 0) { options = {}; }
9151 + var _c = options.thunk, thunk = _c === void 0 ? true : _c, _d = options.immutableCheck, immutableCheck = _d === void 0 ? true : _d, _e = options.serializableCheck, serializableCheck = _e === void 0 ? true : _e, _f = options.actionCreatorCheck, actionCreatorCheck = _f === void 0 ? true : _f;
9152 + var middlewareArray = new MiddlewareArray();
9153 + if (thunk) {
9154 + if (isBoolean(thunk)) {
9155 + middlewareArray.push(redux_thunk__WEBPACK_IMPORTED_MODULE_3__["default"]);
9156 + }
9157 + else {
9158 + middlewareArray.push(redux_thunk__WEBPACK_IMPORTED_MODULE_3__["default"].withExtraArgument(thunk.extraArgument));
9159 + }
9160 + }
9161 + if (true) {
9162 + if (immutableCheck) {
9163 + var immutableOptions = {};
9164 + if (!isBoolean(immutableCheck)) {
9165 + immutableOptions = immutableCheck;
9166 + }
9167 + middlewareArray.unshift(createImmutableStateInvariantMiddleware(immutableOptions));
9168 + }
9169 + if (serializableCheck) {
9170 + var serializableOptions = {};
9171 + if (!isBoolean(serializableCheck)) {
9172 + serializableOptions = serializableCheck;
9173 + }
9174 + middlewareArray.push(createSerializableStateInvariantMiddleware(serializableOptions));
9175 + }
9176 + if (actionCreatorCheck) {
9177 + var actionCreatorOptions = {};
9178 + if (!isBoolean(actionCreatorCheck)) {
9179 + actionCreatorOptions = actionCreatorCheck;
9180 + }
9181 + middlewareArray.unshift(createActionCreatorInvariantMiddleware(actionCreatorOptions));
9182 + }
9183 + }
9184 + return middlewareArray;
9185 +}
9186 +// src/configureStore.ts
9187 +var IS_PRODUCTION = "development" === "production";
9188 +function configureStore(options) {
9189 + var curriedGetDefaultMiddleware = curryGetDefaultMiddleware();
9190 + var _c = options || {}, _d = _c.reducer, reducer = _d === void 0 ? void 0 : _d, _e = _c.middleware, middleware = _e === void 0 ? curriedGetDefaultMiddleware() : _e, _f = _c.devTools, devTools = _f === void 0 ? true : _f, _g = _c.preloadedState, preloadedState = _g === void 0 ? void 0 : _g, _h = _c.enhancers, enhancers = _h === void 0 ? void 0 : _h;
9191 + var rootReducer;
9192 + if (typeof reducer === "function") {
9193 + rootReducer = reducer;
9194 + }
9195 + else if (isPlainObject(reducer)) {
9196 + rootReducer = (0,redux__WEBPACK_IMPORTED_MODULE_0__.combineReducers)(reducer);
9197 + }
9198 + else {
9199 + throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');
9200 + }
9201 + var finalMiddleware = middleware;
9202 + if (typeof finalMiddleware === "function") {
9203 + finalMiddleware = finalMiddleware(curriedGetDefaultMiddleware);
9204 + if (!IS_PRODUCTION && !Array.isArray(finalMiddleware)) {
9205 + throw new Error("when using a middleware builder function, an array of middleware must be returned");
9206 + }
9207 + }
9208 + if (!IS_PRODUCTION && finalMiddleware.some(function (item) { return typeof item !== "function"; })) {
9209 + throw new Error("each middleware provided to configureStore must be a function");
9210 + }
9211 + var middlewareEnhancer = redux__WEBPACK_IMPORTED_MODULE_0__.applyMiddleware.apply(void 0, finalMiddleware);
9212 + var finalCompose = redux__WEBPACK_IMPORTED_MODULE_0__.compose;
9213 + if (devTools) {
9214 + finalCompose = composeWithDevTools(__spreadValues({
9215 + trace: !IS_PRODUCTION
9216 + }, typeof devTools === "object" && devTools));
9217 + }
9218 + var defaultEnhancers = new EnhancerArray(middlewareEnhancer);
9219 + var storeEnhancers = defaultEnhancers;
9220 + if (Array.isArray(enhancers)) {
9221 + storeEnhancers = __spreadArray([middlewareEnhancer], enhancers);
9222 + }
9223 + else if (typeof enhancers === "function") {
9224 + storeEnhancers = enhancers(defaultEnhancers);
9225 + }
9226 + var composedEnhancer = finalCompose.apply(void 0, storeEnhancers);
9227 + return (0,redux__WEBPACK_IMPORTED_MODULE_0__.createStore)(rootReducer, preloadedState, composedEnhancer);
9228 +}
9229 +// src/createReducer.ts
9230 +
9231 +// src/mapBuilders.ts
9232 +function executeReducerBuilderCallback(builderCallback) {
9233 + var actionsMap = {};
9234 + var actionMatchers = [];
9235 + var defaultCaseReducer;
9236 + var builder = {
9237 + addCase: function (typeOrActionCreator, reducer) {
9238 + if (true) {
9239 + if (actionMatchers.length > 0) {
9240 + throw new Error("`builder.addCase` should only be called before calling `builder.addMatcher`");
9241 + }
9242 + if (defaultCaseReducer) {
9243 + throw new Error("`builder.addCase` should only be called before calling `builder.addDefaultCase`");
9244 + }
9245 + }
9246 + var type = typeof typeOrActionCreator === "string" ? typeOrActionCreator : typeOrActionCreator.type;
9247 + if (!type) {
9248 + throw new Error("`builder.addCase` cannot be called with an empty action type");
9249 + }
9250 + if (type in actionsMap) {
9251 + throw new Error("`builder.addCase` cannot be called with two reducers for the same action type");
9252 + }
9253 + actionsMap[type] = reducer;
9254 + return builder;
9255 + },
9256 + addMatcher: function (matcher, reducer) {
9257 + if (true) {
9258 + if (defaultCaseReducer) {
9259 + throw new Error("`builder.addMatcher` should only be called before calling `builder.addDefaultCase`");
9260 + }
9261 + }
9262 + actionMatchers.push({ matcher: matcher, reducer: reducer });
9263 + return builder;
9264 + },
9265 + addDefaultCase: function (reducer) {
9266 + if (true) {
9267 + if (defaultCaseReducer) {
9268 + throw new Error("`builder.addDefaultCase` can only be called once");
9269 + }
9270 + }
9271 + defaultCaseReducer = reducer;
9272 + return builder;
9273 + }
9274 + };
9275 + builderCallback(builder);
9276 + return [actionsMap, actionMatchers, defaultCaseReducer];
9277 +}
9278 +// src/createReducer.ts
9279 +function isStateFunction(x) {
9280 + return typeof x === "function";
9281 +}
9282 +var hasWarnedAboutObjectNotation = false;
9283 +function createReducer(initialState, mapOrBuilderCallback, actionMatchers, defaultCaseReducer) {
9284 + if (actionMatchers === void 0) { actionMatchers = []; }
9285 + if (true) {
9286 + if (typeof mapOrBuilderCallback === "object") {
9287 + if (!hasWarnedAboutObjectNotation) {
9288 + hasWarnedAboutObjectNotation = true;
9289 + console.warn("The object notation for `createReducer` is deprecated, and will be removed in RTK 2.0. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer");
9290 + }
9291 + }
9292 + }
9293 + var _c = typeof mapOrBuilderCallback === "function" ? executeReducerBuilderCallback(mapOrBuilderCallback) : [mapOrBuilderCallback, actionMatchers, defaultCaseReducer], actionsMap = _c[0], finalActionMatchers = _c[1], finalDefaultCaseReducer = _c[2];
9294 + var getInitialState;
9295 + if (isStateFunction(initialState)) {
9296 + getInitialState = function () { return freezeDraftable(initialState()); };
9297 + }
9298 + else {
9299 + var frozenInitialState_1 = freezeDraftable(initialState);
9300 + getInitialState = function () { return frozenInitialState_1; };
9301 + }
9302 + function reducer(state, action) {
9303 + if (state === void 0) { state = getInitialState(); }
9304 + var caseReducers = __spreadArray([
9305 + actionsMap[action.type]
9306 + ], finalActionMatchers.filter(function (_c) {
9307 + var matcher = _c.matcher;
9308 + return matcher(action);
9309 + }).map(function (_c) {
9310 + var reducer2 = _c.reducer;
9311 + return reducer2;
9312 + }));
9313 + if (caseReducers.filter(function (cr) { return !!cr; }).length === 0) {
9314 + caseReducers = [finalDefaultCaseReducer];
9315 + }
9316 + return caseReducers.reduce(function (previousState, caseReducer) {
9317 + if (caseReducer) {
9318 + if ((0,immer__WEBPACK_IMPORTED_MODULE_2__.isDraft)(previousState)) {
9319 + var draft = previousState;
9320 + var result = caseReducer(draft, action);
9321 + if (result === void 0) {
9322 + return previousState;
9323 + }
9324 + return result;
9325 + }
9326 + else if (!(0,immer__WEBPACK_IMPORTED_MODULE_2__.isDraftable)(previousState)) {
9327 + var result = caseReducer(previousState, action);
9328 + if (result === void 0) {
9329 + if (previousState === null) {
9330 + return previousState;
9331 + }
9332 + throw Error("A case reducer on a non-draftable value must not return undefined");
9333 + }
9334 + return result;
9335 + }
9336 + else {
9337 + return (0,immer__WEBPACK_IMPORTED_MODULE_2__["default"])(previousState, function (draft) {
9338 + return caseReducer(draft, action);
9339 + });
9340 + }
9341 + }
9342 + return previousState;
9343 + }, state);
9344 + }
9345 + reducer.getInitialState = getInitialState;
9346 + return reducer;
9347 +}
9348 +// src/createSlice.ts
9349 +var hasWarnedAboutObjectNotation2 = false;
9350 +function getType2(slice, actionKey) {
9351 + return slice + "/" + actionKey;
9352 +}
9353 +function createSlice(options) {
9354 + var name = options.name;
9355 + if (!name) {
9356 + throw new Error("`name` is a required option for createSlice");
9357 + }
9358 + if (typeof process !== "undefined" && "development" === "development") {
9359 + if (options.initialState === void 0) {
9360 + console.error("You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`");
9361 + }
9362 + }
9363 + var initialState = typeof options.initialState == "function" ? options.initialState : freezeDraftable(options.initialState);
9364 + var reducers = options.reducers || {};
9365 + var reducerNames = Object.keys(reducers);
9366 + var sliceCaseReducersByName = {};
9367 + var sliceCaseReducersByType = {};
9368 + var actionCreators = {};
9369 + reducerNames.forEach(function (reducerName) {
9370 + var maybeReducerWithPrepare = reducers[reducerName];
9371 + var type = getType2(name, reducerName);
9372 + var caseReducer;
9373 + var prepareCallback;
9374 + if ("reducer" in maybeReducerWithPrepare) {
9375 + caseReducer = maybeReducerWithPrepare.reducer;
9376 + prepareCallback = maybeReducerWithPrepare.prepare;
9377 + }
9378 + else {
9379 + caseReducer = maybeReducerWithPrepare;
9380 + }
9381 + sliceCaseReducersByName[reducerName] = caseReducer;
9382 + sliceCaseReducersByType[type] = caseReducer;
9383 + actionCreators[reducerName] = prepareCallback ? createAction(type, prepareCallback) : createAction(type);
9384 + });
9385 + function buildReducer() {
9386 + if (true) {
9387 + if (typeof options.extraReducers === "object") {
9388 + if (!hasWarnedAboutObjectNotation2) {
9389 + hasWarnedAboutObjectNotation2 = true;
9390 + console.warn("The object notation for `createSlice.extraReducers` is deprecated, and will be removed in RTK 2.0. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice");
9391 + }
9392 + }
9393 + }
9394 + var _c = typeof options.extraReducers === "function" ? executeReducerBuilderCallback(options.extraReducers) : [options.extraReducers], _d = _c[0], extraReducers = _d === void 0 ? {} : _d, _e = _c[1], actionMatchers = _e === void 0 ? [] : _e, _f = _c[2], defaultCaseReducer = _f === void 0 ? void 0 : _f;
9395 + var finalCaseReducers = __spreadValues(__spreadValues({}, extraReducers), sliceCaseReducersByType);
9396 + return createReducer(initialState, function (builder) {
9397 + for (var key in finalCaseReducers) {
9398 + builder.addCase(key, finalCaseReducers[key]);
9399 + }
9400 + for (var _i = 0, actionMatchers_1 = actionMatchers; _i < actionMatchers_1.length; _i++) {
9401 + var m = actionMatchers_1[_i];
9402 + builder.addMatcher(m.matcher, m.reducer);
9403 + }
9404 + if (defaultCaseReducer) {
9405 + builder.addDefaultCase(defaultCaseReducer);
9406 + }
9407 + });
9408 + }
9409 + var _reducer;
9410 + return {
9411 + name: name,
9412 + reducer: function (state, action) {
9413 + if (!_reducer)
9414 + _reducer = buildReducer();
9415 + return _reducer(state, action);
9416 + },
9417 + actions: actionCreators,
9418 + caseReducers: sliceCaseReducersByName,
9419 + getInitialState: function () {
9420 + if (!_reducer)
9421 + _reducer = buildReducer();
9422 + return _reducer.getInitialState();
9423 + }
9424 + };
9425 +}
9426 +// src/entities/entity_state.ts
9427 +function getInitialEntityState() {
9428 + return {
9429 + ids: [],
9430 + entities: {}
9431 + };
9432 +}
9433 +function createInitialStateFactory() {
9434 + function getInitialState(additionalState) {
9435 + if (additionalState === void 0) { additionalState = {}; }
9436 + return Object.assign(getInitialEntityState(), additionalState);
9437 + }
9438 + return { getInitialState: getInitialState };
9439 +}
9440 +// src/entities/state_selectors.ts
9441 +function createSelectorsFactory() {
9442 + function getSelectors(selectState) {
9443 + var selectIds = function (state) { return state.ids; };
9444 + var selectEntities = function (state) { return state.entities; };
9445 + var selectAll = createDraftSafeSelector(selectIds, selectEntities, function (ids, entities) { return ids.map(function (id) { return entities[id]; }); });
9446 + var selectId = function (_, id) { return id; };
9447 + var selectById = function (entities, id) { return entities[id]; };
9448 + var selectTotal = createDraftSafeSelector(selectIds, function (ids) { return ids.length; });
9449 + if (!selectState) {
9450 + return {
9451 + selectIds: selectIds,
9452 + selectEntities: selectEntities,
9453 + selectAll: selectAll,
9454 + selectTotal: selectTotal,
9455 + selectById: createDraftSafeSelector(selectEntities, selectId, selectById)
9456 + };
9457 + }
9458 + var selectGlobalizedEntities = createDraftSafeSelector(selectState, selectEntities);
9459 + return {
9460 + selectIds: createDraftSafeSelector(selectState, selectIds),
9461 + selectEntities: selectGlobalizedEntities,
9462 + selectAll: createDraftSafeSelector(selectState, selectAll),
9463 + selectTotal: createDraftSafeSelector(selectState, selectTotal),
9464 + selectById: createDraftSafeSelector(selectGlobalizedEntities, selectId, selectById)
9465 + };
9466 + }
9467 + return { getSelectors: getSelectors };
9468 +}
9469 +// src/entities/state_adapter.ts
9470 +
9471 +function createSingleArgumentStateOperator(mutator) {
9472 + var operator = createStateOperator(function (_, state) { return mutator(state); });
9473 + return function operation(state) {
9474 + return operator(state, void 0);
9475 + };
9476 +}
9477 +function createStateOperator(mutator) {
9478 + return function operation(state, arg) {
9479 + function isPayloadActionArgument(arg2) {
9480 + return isFSA(arg2);
9481 + }
9482 + var runMutator = function (draft) {
9483 + if (isPayloadActionArgument(arg)) {
9484 + mutator(arg.payload, draft);
9485 + }
9486 + else {
9487 + mutator(arg, draft);
9488 + }
9489 + };
9490 + if ((0,immer__WEBPACK_IMPORTED_MODULE_2__.isDraft)(state)) {
9491 + runMutator(state);
9492 + return state;
9493 + }
9494 + else {
9495 + return (0,immer__WEBPACK_IMPORTED_MODULE_2__["default"])(state, runMutator);
9496 + }
9497 + };
9498 +}
9499 +// src/entities/utils.ts
9500 +function selectIdValue(entity, selectId) {
9501 + var key = selectId(entity);
9502 + if ( true && key === void 0) {
9503 + console.warn("The entity passed to the `selectId` implementation returned undefined.", "You should probably provide your own `selectId` implementation.", "The entity that was passed:", entity, "The `selectId` implementation:", selectId.toString());
9504 + }
9505 + return key;
9506 +}
9507 +function ensureEntitiesArray(entities) {
9508 + if (!Array.isArray(entities)) {
9509 + entities = Object.values(entities);
9510 + }
9511 + return entities;
9512 +}
9513 +function splitAddedUpdatedEntities(newEntities, selectId, state) {
9514 + newEntities = ensureEntitiesArray(newEntities);
9515 + var added = [];
9516 + var updated = [];
9517 + for (var _i = 0, newEntities_1 = newEntities; _i < newEntities_1.length; _i++) {
9518 + var entity = newEntities_1[_i];
9519 + var id = selectIdValue(entity, selectId);
9520 + if (id in state.entities) {
9521 + updated.push({ id: id, changes: entity });
9522 + }
9523 + else {
9524 + added.push(entity);
9525 + }
9526 + }
9527 + return [added, updated];
9528 +}
9529 +// src/entities/unsorted_state_adapter.ts
9530 +function createUnsortedStateAdapter(selectId) {
9531 + function addOneMutably(entity, state) {
9532 + var key = selectIdValue(entity, selectId);
9533 + if (key in state.entities) {
9534 + return;
9535 + }
9536 + state.ids.push(key);
9537 + state.entities[key] = entity;
9538 + }
9539 + function addManyMutably(newEntities, state) {
9540 + newEntities = ensureEntitiesArray(newEntities);
9541 + for (var _i = 0, newEntities_2 = newEntities; _i < newEntities_2.length; _i++) {
9542 + var entity = newEntities_2[_i];
9543 + addOneMutably(entity, state);
9544 + }
9545 + }
9546 + function setOneMutably(entity, state) {
9547 + var key = selectIdValue(entity, selectId);
9548 + if (!(key in state.entities)) {
9549 + state.ids.push(key);
9550 + }
9551 + state.entities[key] = entity;
9552 + }
9553 + function setManyMutably(newEntities, state) {
9554 + newEntities = ensureEntitiesArray(newEntities);
9555 + for (var _i = 0, newEntities_3 = newEntities; _i < newEntities_3.length; _i++) {
9556 + var entity = newEntities_3[_i];
9557 + setOneMutably(entity, state);
9558 + }
9559 + }
9560 + function setAllMutably(newEntities, state) {
9561 + newEntities = ensureEntitiesArray(newEntities);
9562 + state.ids = [];
9563 + state.entities = {};
9564 + addManyMutably(newEntities, state);
9565 + }
9566 + function removeOneMutably(key, state) {
9567 + return removeManyMutably([key], state);
9568 + }
9569 + function removeManyMutably(keys, state) {
9570 + var didMutate = false;
9571 + keys.forEach(function (key) {
9572 + if (key in state.entities) {
9573 + delete state.entities[key];
9574 + didMutate = true;
9575 + }
9576 + });
9577 + if (didMutate) {
9578 + state.ids = state.ids.filter(function (id) { return id in state.entities; });
9579 + }
9580 + }
9581 + function removeAllMutably(state) {
9582 + Object.assign(state, {
9583 + ids: [],
9584 + entities: {}
9585 + });
9586 + }
9587 + function takeNewKey(keys, update, state) {
9588 + var original2 = state.entities[update.id];
9589 + var updated = Object.assign({}, original2, update.changes);
9590 + var newKey = selectIdValue(updated, selectId);
9591 + var hasNewKey = newKey !== update.id;
9592 + if (hasNewKey) {
9593 + keys[update.id] = newKey;
9594 + delete state.entities[update.id];
9595 + }
9596 + state.entities[newKey] = updated;
9597 + return hasNewKey;
9598 + }
9599 + function updateOneMutably(update, state) {
9600 + return updateManyMutably([update], state);
9601 + }
9602 + function updateManyMutably(updates, state) {
9603 + var newKeys = {};
9604 + var updatesPerEntity = {};
9605 + updates.forEach(function (update) {
9606 + if (update.id in state.entities) {
9607 + updatesPerEntity[update.id] = {
9608 + id: update.id,
9609 + changes: __spreadValues(__spreadValues({}, updatesPerEntity[update.id] ? updatesPerEntity[update.id].changes : null), update.changes)
9610 + };
9611 + }
9612 + });
9613 + updates = Object.values(updatesPerEntity);
9614 + var didMutateEntities = updates.length > 0;
9615 + if (didMutateEntities) {
9616 + var didMutateIds = updates.filter(function (update) { return takeNewKey(newKeys, update, state); }).length > 0;
9617 + if (didMutateIds) {
9618 + state.ids = Object.keys(state.entities);
9619 + }
9620 + }
9621 + }
9622 + function upsertOneMutably(entity, state) {
9623 + return upsertManyMutably([entity], state);
9624 + }
9625 + function upsertManyMutably(newEntities, state) {
9626 + var _c = splitAddedUpdatedEntities(newEntities, selectId, state), added = _c[0], updated = _c[1];
9627 + updateManyMutably(updated, state);
9628 + addManyMutably(added, state);
9629 + }
9630 + return {
9631 + removeAll: createSingleArgumentStateOperator(removeAllMutably),
9632 + addOne: createStateOperator(addOneMutably),
9633 + addMany: createStateOperator(addManyMutably),
9634 + setOne: createStateOperator(setOneMutably),
9635 + setMany: createStateOperator(setManyMutably),
9636 + setAll: createStateOperator(setAllMutably),
9637 + updateOne: createStateOperator(updateOneMutably),
9638 + updateMany: createStateOperator(updateManyMutably),
9639 + upsertOne: createStateOperator(upsertOneMutably),
9640 + upsertMany: createStateOperator(upsertManyMutably),
9641 + removeOne: createStateOperator(removeOneMutably),
9642 + removeMany: createStateOperator(removeManyMutably)
9643 + };
9644 +}
9645 +// src/entities/sorted_state_adapter.ts
9646 +function createSortedStateAdapter(selectId, sort) {
9647 + var _c = createUnsortedStateAdapter(selectId), removeOne = _c.removeOne, removeMany = _c.removeMany, removeAll = _c.removeAll;
9648 + function addOneMutably(entity, state) {
9649 + return addManyMutably([entity], state);
9650 + }
9651 + function addManyMutably(newEntities, state) {
9652 + newEntities = ensureEntitiesArray(newEntities);
9653 + var models = newEntities.filter(function (model) { return !(selectIdValue(model, selectId) in state.entities); });
9654 + if (models.length !== 0) {
9655 + merge(models, state);
9656 + }
9657 + }
9658 + function setOneMutably(entity, state) {
9659 + return setManyMutably([entity], state);
9660 + }
9661 + function setManyMutably(newEntities, state) {
9662 + newEntities = ensureEntitiesArray(newEntities);
9663 + if (newEntities.length !== 0) {
9664 + merge(newEntities, state);
9665 + }
9666 + }
9667 + function setAllMutably(newEntities, state) {
9668 + newEntities = ensureEntitiesArray(newEntities);
9669 + state.entities = {};
9670 + state.ids = [];
9671 + addManyMutably(newEntities, state);
9672 + }
9673 + function updateOneMutably(update, state) {
9674 + return updateManyMutably([update], state);
9675 + }
9676 + function updateManyMutably(updates, state) {
9677 + var appliedUpdates = false;
9678 + for (var _i = 0, updates_1 = updates; _i < updates_1.length; _i++) {
9679 + var update = updates_1[_i];
9680 + var entity = state.entities[update.id];
9681 + if (!entity) {
9682 + continue;
9683 + }
9684 + appliedUpdates = true;
9685 + Object.assign(entity, update.changes);
9686 + var newId = selectId(entity);
9687 + if (update.id !== newId) {
9688 + delete state.entities[update.id];
9689 + state.entities[newId] = entity;
9690 + }
9691 + }
9692 + if (appliedUpdates) {
9693 + resortEntities(state);
9694 + }
9695 + }
9696 + function upsertOneMutably(entity, state) {
9697 + return upsertManyMutably([entity], state);
9698 + }
9699 + function upsertManyMutably(newEntities, state) {
9700 + var _c = splitAddedUpdatedEntities(newEntities, selectId, state), added = _c[0], updated = _c[1];
9701 + updateManyMutably(updated, state);
9702 + addManyMutably(added, state);
9703 + }
9704 + function areArraysEqual(a, b) {
9705 + if (a.length !== b.length) {
9706 + return false;
9707 + }
9708 + for (var i = 0; i < a.length && i < b.length; i++) {
9709 + if (a[i] === b[i]) {
9710 + continue;
9711 + }
9712 + return false;
9713 + }
9714 + return true;
9715 + }
9716 + function merge(models, state) {
9717 + models.forEach(function (model) {
9718 + state.entities[selectId(model)] = model;
9719 + });
9720 + resortEntities(state);
9721 + }
9722 + function resortEntities(state) {
9723 + var allEntities = Object.values(state.entities);
9724 + allEntities.sort(sort);
9725 + var newSortedIds = allEntities.map(selectId);
9726 + var ids = state.ids;
9727 + if (!areArraysEqual(ids, newSortedIds)) {
9728 + state.ids = newSortedIds;
9729 + }
9730 + }
9731 + return {
9732 + removeOne: removeOne,
9733 + removeMany: removeMany,
9734 + removeAll: removeAll,
9735 + addOne: createStateOperator(addOneMutably),
9736 + updateOne: createStateOperator(updateOneMutably),
9737 + upsertOne: createStateOperator(upsertOneMutably),
9738 + setOne: createStateOperator(setOneMutably),
9739 + setMany: createStateOperator(setManyMutably),
9740 + setAll: createStateOperator(setAllMutably),
9741 + addMany: createStateOperator(addManyMutably),
9742 + updateMany: createStateOperator(updateManyMutably),
9743 + upsertMany: createStateOperator(upsertManyMutably)
9744 + };
9745 +}
9746 +// src/entities/create_adapter.ts
9747 +function createEntityAdapter(options) {
9748 + if (options === void 0) { options = {}; }
9749 + var _c = __spreadValues({
9750 + sortComparer: false,
9751 + selectId: function (instance) { return instance.id; }
9752 + }, options), selectId = _c.selectId, sortComparer = _c.sortComparer;
9753 + var stateFactory = createInitialStateFactory();
9754 + var selectorsFactory = createSelectorsFactory();
9755 + var stateAdapter = sortComparer ? createSortedStateAdapter(selectId, sortComparer) : createUnsortedStateAdapter(selectId);
9756 + return __spreadValues(__spreadValues(__spreadValues({
9757 + selectId: selectId,
9758 + sortComparer: sortComparer
9759 + }, stateFactory), selectorsFactory), stateAdapter);
9760 +}
9761 +// src/nanoid.ts
9762 +var urlAlphabet = "ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW";
9763 +var nanoid = function (size) {
9764 + if (size === void 0) { size = 21; }
9765 + var id = "";
9766 + var i = size;
9767 + while (i--) {
9768 + id += urlAlphabet[Math.random() * 64 | 0];
9769 + }
9770 + return id;
9771 +};
9772 +// src/createAsyncThunk.ts
9773 +var commonProperties = [
9774 + "name",
9775 + "message",
9776 + "stack",
9777 + "code"
9778 +];
9779 +var RejectWithValue = /** @class */ (function () {
9780 + function RejectWithValue(payload, meta) {
9781 + this.payload = payload;
9782 + this.meta = meta;
9783 + }
9784 + return RejectWithValue;
9785 +}());
9786 +var FulfillWithMeta = /** @class */ (function () {
9787 + function FulfillWithMeta(payload, meta) {
9788 + this.payload = payload;
9789 + this.meta = meta;
9790 + }
9791 + return FulfillWithMeta;
9792 +}());
9793 +var miniSerializeError = function (value) {
9794 + if (typeof value === "object" && value !== null) {
9795 + var simpleError = {};
9796 + for (var _i = 0, commonProperties_1 = commonProperties; _i < commonProperties_1.length; _i++) {
9797 + var property = commonProperties_1[_i];
9798 + if (typeof value[property] === "string") {
9799 + simpleError[property] = value[property];
9800 + }
9801 + }
9802 + return simpleError;
9803 + }
9804 + return { message: String(value) };
9805 +};
9806 +var createAsyncThunk = (function () {
9807 + function createAsyncThunk2(typePrefix, payloadCreator, options) {
9808 + var fulfilled = createAction(typePrefix + "/fulfilled", function (payload, requestId, arg, meta) { return ({
9809 + payload: payload,
9810 + meta: __spreadProps(__spreadValues({}, meta || {}), {
9811 + arg: arg,
9812 + requestId: requestId,
9813 + requestStatus: "fulfilled"
9814 + })
9815 + }); });
9816 + var pending = createAction(typePrefix + "/pending", function (requestId, arg, meta) { return ({
9817 + payload: void 0,
9818 + meta: __spreadProps(__spreadValues({}, meta || {}), {
9819 + arg: arg,
9820 + requestId: requestId,
9821 + requestStatus: "pending"
9822 + })
9823 + }); });
9824 + var rejected = createAction(typePrefix + "/rejected", function (error, requestId, arg, payload, meta) { return ({
9825 + payload: payload,
9826 + error: (options && options.serializeError || miniSerializeError)(error || "Rejected"),
9827 + meta: __spreadProps(__spreadValues({}, meta || {}), {
9828 + arg: arg,
9829 + requestId: requestId,
9830 + rejectedWithValue: !!payload,
9831 + requestStatus: "rejected",
9832 + aborted: (error == null ? void 0 : error.name) === "AbortError",
9833 + condition: (error == null ? void 0 : error.name) === "ConditionError"
9834 + })
9835 + }); });
9836 + var displayedWarning = false;
9837 + var AC = typeof AbortController !== "undefined" ? AbortController : /** @class */ (function () {
9838 + function class_1() {
9839 + this.signal = {
9840 + aborted: false,
9841 + addEventListener: function () {
9842 + },
9843 + dispatchEvent: function () {
9844 + return false;
9845 + },
9846 + onabort: function () {
9847 + },
9848 + removeEventListener: function () {
9849 + },
9850 + reason: void 0,
9851 + throwIfAborted: function () {
9852 + }
9853 + };
9854 + }
9855 + class_1.prototype.abort = function () {
9856 + if (true) {
9857 + if (!displayedWarning) {
9858 + displayedWarning = true;
9859 + console.info("This platform does not implement AbortController. \nIf you want to use the AbortController to react to `abort` events, please consider importing a polyfill like 'abortcontroller-polyfill/dist/abortcontroller-polyfill-only'.");
9860 + }
9861 + }
9862 + };
9863 + return class_1;
9864 + }());
9865 + function actionCreator(arg) {
9866 + return function (dispatch, getState, extra) {
9867 + var requestId = (options == null ? void 0 : options.idGenerator) ? options.idGenerator(arg) : nanoid();
9868 + var abortController = new AC();
9869 + var abortReason;
9870 + var started = false;
9871 + function abort(reason) {
9872 + abortReason = reason;
9873 + abortController.abort();
9874 + }
9875 + var promise2 = function () {
9876 + return __async(this, null, function () {
9877 + var _a, _b, finalAction, conditionResult, abortedPromise, err_1, skipDispatch;
9878 + return __generator(this, function (_c) {
9879 + switch (_c.label) {
9880 + case 0:
9881 + _c.trys.push([0, 4, , 5]);
9882 + conditionResult = (_a = options == null ? void 0 : options.condition) == null ? void 0 : _a.call(options, arg, { getState: getState, extra: extra });
9883 + if (!isThenable(conditionResult)) return [3 /*break*/, 2];
9884 + return [4 /*yield*/, conditionResult];
9885 + case 1:
9886 + conditionResult = _c.sent();
9887 + _c.label = 2;
9888 + case 2:
9889 + if (conditionResult === false || abortController.signal.aborted) {
9890 + throw {
9891 + name: "ConditionError",
9892 + message: "Aborted due to condition callback returning false."
9893 + };
9894 + }
9895 + started = true;
9896 + abortedPromise = new Promise(function (_, reject) { return abortController.signal.addEventListener("abort", function () { return reject({
9897 + name: "AbortError",
9898 + message: abortReason || "Aborted"
9899 + }); }); });
9900 + dispatch(pending(requestId, arg, (_b = options == null ? void 0 : options.getPendingMeta) == null ? void 0 : _b.call(options, { requestId: requestId, arg: arg }, { getState: getState, extra: extra })));
9901 + return [4 /*yield*/, Promise.race([
9902 + abortedPromise,
9903 + Promise.resolve(payloadCreator(arg, {
9904 + dispatch: dispatch,
9905 + getState: getState,
9906 + extra: extra,
9907 + requestId: requestId,
9908 + signal: abortController.signal,
9909 + abort: abort,
9910 + rejectWithValue: function (value, meta) {
9911 + return new RejectWithValue(value, meta);
9912 + },
9913 + fulfillWithValue: function (value, meta) {
9914 + return new FulfillWithMeta(value, meta);
9915 + }
9916 + })).then(function (result) {
9917 + if (result instanceof RejectWithValue) {
9918 + throw result;
9919 + }
9920 + if (result instanceof FulfillWithMeta) {
9921 + return fulfilled(result.payload, requestId, arg, result.meta);
9922 + }
9923 + return fulfilled(result, requestId, arg);
9924 + })
9925 + ])];
9926 + case 3:
9927 + finalAction = _c.sent();
9928 + return [3 /*break*/, 5];
9929 + case 4:
9930 + err_1 = _c.sent();
9931 + finalAction = err_1 instanceof RejectWithValue ? rejected(null, requestId, arg, err_1.payload, err_1.meta) : rejected(err_1, requestId, arg);
9932 + return [3 /*break*/, 5];
9933 + case 5:
9934 + skipDispatch = options && !options.dispatchConditionRejection && rejected.match(finalAction) && finalAction.meta.condition;
9935 + if (!skipDispatch) {
9936 + dispatch(finalAction);
9937 + }
9938 + return [2 /*return*/, finalAction];
9939 + }
9940 + });
9941 + });
9942 + }();
9943 + return Object.assign(promise2, {
9944 + abort: abort,
9945 + requestId: requestId,
9946 + arg: arg,
9947 + unwrap: function () {
9948 + return promise2.then(unwrapResult);
9949 + }
9950 + });
9951 + };
9952 + }
9953 + return Object.assign(actionCreator, {
9954 + pending: pending,
9955 + rejected: rejected,
9956 + fulfilled: fulfilled,
9957 + typePrefix: typePrefix
9958 + });
9959 + }
9960 + createAsyncThunk2.withTypes = function () { return createAsyncThunk2; };
9961 + return createAsyncThunk2;
9962 +})();
9963 +function unwrapResult(action) {
9964 + if (action.meta && action.meta.rejectedWithValue) {
9965 + throw action.payload;
9966 + }
9967 + if (action.error) {
9968 + throw action.error;
9969 + }
9970 + return action.payload;
9971 +}
9972 +function isThenable(value) {
9973 + return value !== null && typeof value === "object" && typeof value.then === "function";
9974 +}
9975 +// src/matchers.ts
9976 +var matches = function (matcher, action) {
9977 + if (hasMatchFunction(matcher)) {
9978 + return matcher.match(action);
9979 + }
9980 + else {
9981 + return matcher(action);
9982 + }
9983 +};
9984 +function isAnyOf() {
9985 + var matchers = [];
9986 + for (var _i = 0; _i < arguments.length; _i++) {
9987 + matchers[_i] = arguments[_i];
9988 + }
9989 + return function (action) {
9990 + return matchers.some(function (matcher) { return matches(matcher, action); });
9991 + };
9992 +}
9993 +function isAllOf() {
9994 + var matchers = [];
9995 + for (var _i = 0; _i < arguments.length; _i++) {
9996 + matchers[_i] = arguments[_i];
9997 + }
9998 + return function (action) {
9999 + return matchers.every(function (matcher) { return matches(matcher, action); });
10000 + };
10001 +}
10002 +function hasExpectedRequestMetadata(action, validStatus) {
10003 + if (!action || !action.meta)
10004 + return false;
10005 + var hasValidRequestId = typeof action.meta.requestId === "string";
10006 + var hasValidRequestStatus = validStatus.indexOf(action.meta.requestStatus) > -1;
10007 + return hasValidRequestId && hasValidRequestStatus;
10008 +}
10009 +function isAsyncThunkArray(a) {
10010 + return typeof a[0] === "function" && "pending" in a[0] && "fulfilled" in a[0] && "rejected" in a[0];
10011 +}
10012 +function isPending() {
10013 + var asyncThunks = [];
10014 + for (var _i = 0; _i < arguments.length; _i++) {
10015 + asyncThunks[_i] = arguments[_i];
10016 + }
10017 + if (asyncThunks.length === 0) {
10018 + return function (action) { return hasExpectedRequestMetadata(action, ["pending"]); };
10019 + }
10020 + if (!isAsyncThunkArray(asyncThunks)) {
10021 + return isPending()(asyncThunks[0]);
10022 + }
10023 + return function (action) {
10024 + var matchers = asyncThunks.map(function (asyncThunk) { return asyncThunk.pending; });
10025 + var combinedMatcher = isAnyOf.apply(void 0, matchers);
10026 + return combinedMatcher(action);
10027 + };
10028 +}
10029 +function isRejected() {
10030 + var asyncThunks = [];
10031 + for (var _i = 0; _i < arguments.length; _i++) {
10032 + asyncThunks[_i] = arguments[_i];
10033 + }
10034 + if (asyncThunks.length === 0) {
10035 + return function (action) { return hasExpectedRequestMetadata(action, ["rejected"]); };
10036 + }
10037 + if (!isAsyncThunkArray(asyncThunks)) {
10038 + return isRejected()(asyncThunks[0]);
10039 + }
10040 + return function (action) {
10041 + var matchers = asyncThunks.map(function (asyncThunk) { return asyncThunk.rejected; });
10042 + var combinedMatcher = isAnyOf.apply(void 0, matchers);
10043 + return combinedMatcher(action);
10044 + };
10045 +}
10046 +function isRejectedWithValue() {
10047 + var asyncThunks = [];
10048 + for (var _i = 0; _i < arguments.length; _i++) {
10049 + asyncThunks[_i] = arguments[_i];
10050 + }
10051 + var hasFlag = function (action) {
10052 + return action && action.meta && action.meta.rejectedWithValue;
10053 + };
10054 + if (asyncThunks.length === 0) {
10055 + return function (action) {
10056 + var combinedMatcher = isAllOf(isRejected.apply(void 0, asyncThunks), hasFlag);
10057 + return combinedMatcher(action);
10058 + };
10059 + }
10060 + if (!isAsyncThunkArray(asyncThunks)) {
10061 + return isRejectedWithValue()(asyncThunks[0]);
10062 + }
10063 + return function (action) {
10064 + var combinedMatcher = isAllOf(isRejected.apply(void 0, asyncThunks), hasFlag);
10065 + return combinedMatcher(action);
10066 + };
10067 +}
10068 +function isFulfilled() {
10069 + var asyncThunks = [];
10070 + for (var _i = 0; _i < arguments.length; _i++) {
10071 + asyncThunks[_i] = arguments[_i];
10072 + }
10073 + if (asyncThunks.length === 0) {
10074 + return function (action) { return hasExpectedRequestMetadata(action, ["fulfilled"]); };
10075 + }
10076 + if (!isAsyncThunkArray(asyncThunks)) {
10077 + return isFulfilled()(asyncThunks[0]);
10078 + }
10079 + return function (action) {
10080 + var matchers = asyncThunks.map(function (asyncThunk) { return asyncThunk.fulfilled; });
10081 + var combinedMatcher = isAnyOf.apply(void 0, matchers);
10082 + return combinedMatcher(action);
10083 + };
10084 +}
10085 +function isAsyncThunkAction() {
10086 + var asyncThunks = [];
10087 + for (var _i = 0; _i < arguments.length; _i++) {
10088 + asyncThunks[_i] = arguments[_i];
10089 + }
10090 + if (asyncThunks.length === 0) {
10091 + return function (action) { return hasExpectedRequestMetadata(action, ["pending", "fulfilled", "rejected"]); };
10092 + }
10093 + if (!isAsyncThunkArray(asyncThunks)) {
10094 + return isAsyncThunkAction()(asyncThunks[0]);
10095 + }
10096 + return function (action) {
10097 + var matchers = [];
10098 + for (var _i = 0, asyncThunks_1 = asyncThunks; _i < asyncThunks_1.length; _i++) {
10099 + var asyncThunk = asyncThunks_1[_i];
10100 + matchers.push(asyncThunk.pending, asyncThunk.rejected, asyncThunk.fulfilled);
10101 + }
10102 + var combinedMatcher = isAnyOf.apply(void 0, matchers);
10103 + return combinedMatcher(action);
10104 + };
10105 +}
10106 +// src/listenerMiddleware/utils.ts
10107 +var assertFunction = function (func, expected) {
10108 + if (typeof func !== "function") {
10109 + throw new TypeError(expected + " is not a function");
10110 + }
10111 +};
10112 +var noop = function () {
10113 +};
10114 +var catchRejection = function (promise2, onError) {
10115 + if (onError === void 0) { onError = noop; }
10116 + promise2.catch(onError);
10117 + return promise2;
10118 +};
10119 +var addAbortSignalListener = function (abortSignal, callback) {
10120 + abortSignal.addEventListener("abort", callback, { once: true });
10121 + return function () { return abortSignal.removeEventListener("abort", callback); };
10122 +};
10123 +var abortControllerWithReason = function (abortController, reason) {
10124 + var signal = abortController.signal;
10125 + if (signal.aborted) {
10126 + return;
10127 + }
10128 + if (!("reason" in signal)) {
10129 + Object.defineProperty(signal, "reason", {
10130 + enumerable: true,
10131 + value: reason,
10132 + configurable: true,
10133 + writable: true
10134 + });
10135 + }
10136 + ;
10137 + abortController.abort(reason);
10138 +};
10139 +// src/listenerMiddleware/exceptions.ts
10140 +var task = "task";
10141 +var listener = "listener";
10142 +var completed = "completed";
10143 +var cancelled = "cancelled";
10144 +var taskCancelled = "task-" + cancelled;
10145 +var taskCompleted = "task-" + completed;
10146 +var listenerCancelled = listener + "-" + cancelled;
10147 +var listenerCompleted = listener + "-" + completed;
10148 +var TaskAbortError = /** @class */ (function () {
10149 + function TaskAbortError(code) {
10150 + this.code = code;
10151 + this.name = "TaskAbortError";
10152 + this.message = task + " " + cancelled + " (reason: " + code + ")";
10153 + }
10154 + return TaskAbortError;
10155 +}());
10156 +// src/listenerMiddleware/task.ts
10157 +var validateActive = function (signal) {
10158 + if (signal.aborted) {
10159 + throw new TaskAbortError(signal.reason);
10160 + }
10161 +};
10162 +function raceWithSignal(signal, promise2) {
10163 + var cleanup = noop;
10164 + return new Promise(function (resolve, reject) {
10165 + var notifyRejection = function () { return reject(new TaskAbortError(signal.reason)); };
10166 + if (signal.aborted) {
10167 + notifyRejection();
10168 + return;
10169 + }
10170 + cleanup = addAbortSignalListener(signal, notifyRejection);
10171 + promise2.finally(function () { return cleanup(); }).then(resolve, reject);
10172 + }).finally(function () {
10173 + cleanup = noop;
10174 + });
10175 +}
10176 +var runTask = function (task2, cleanUp) { return __async(void 0, null, function () {
10177 + var value, error_1;
10178 + return __generator(this, function (_c) {
10179 + switch (_c.label) {
10180 + case 0:
10181 + _c.trys.push([0, 3, 4, 5]);
10182 + return [4 /*yield*/, Promise.resolve()];
10183 + case 1:
10184 + _c.sent();
10185 + return [4 /*yield*/, task2()];
10186 + case 2:
10187 + value = _c.sent();
10188 + return [2 /*return*/, {
10189 + status: "ok",
10190 + value: value
10191 + }];
10192 + case 3:
10193 + error_1 = _c.sent();
10194 + return [2 /*return*/, {
10195 + status: error_1 instanceof TaskAbortError ? "cancelled" : "rejected",
10196 + error: error_1
10197 + }];
10198 + case 4:
10199 + cleanUp == null ? void 0 : cleanUp();
10200 + return [7 /*endfinally*/];
10201 + case 5: return [2 /*return*/];
10202 + }
10203 + });
10204 +}); };
10205 +var createPause = function (signal) {
10206 + return function (promise2) {
10207 + return catchRejection(raceWithSignal(signal, promise2).then(function (output) {
10208 + validateActive(signal);
10209 + return output;
10210 + }));
10211 + };
10212 +};
10213 +var createDelay = function (signal) {
10214 + var pause = createPause(signal);
10215 + return function (timeoutMs) {
10216 + return pause(new Promise(function (resolve) { return setTimeout(resolve, timeoutMs); }));
10217 + };
10218 +};
10219 +// src/listenerMiddleware/index.ts
10220 +var assign = Object.assign;
10221 +var INTERNAL_NIL_TOKEN = {};
10222 +var alm = "listenerMiddleware";
10223 +var createFork = function (parentAbortSignal, parentBlockingPromises) {
10224 + var linkControllers = function (controller) { return addAbortSignalListener(parentAbortSignal, function () { return abortControllerWithReason(controller, parentAbortSignal.reason); }); };
10225 + return function (taskExecutor, opts) {
10226 + assertFunction(taskExecutor, "taskExecutor");
10227 + var childAbortController = new AbortController();
10228 + linkControllers(childAbortController);
10229 + var result = runTask(function () { return __async(void 0, null, function () {
10230 + var result2;
10231 + return __generator(this, function (_c) {
10232 + switch (_c.label) {
10233 + case 0:
10234 + validateActive(parentAbortSignal);
10235 + validateActive(childAbortController.signal);
10236 + return [4 /*yield*/, taskExecutor({
10237 + pause: createPause(childAbortController.signal),
10238 + delay: createDelay(childAbortController.signal),
10239 + signal: childAbortController.signal
10240 + })];
10241 + case 1:
10242 + result2 = _c.sent();
10243 + validateActive(childAbortController.signal);
10244 + return [2 /*return*/, result2];
10245 + }
10246 + });
10247 + }); }, function () { return abortControllerWithReason(childAbortController, taskCompleted); });
10248 + if (opts == null ? void 0 : opts.autoJoin) {
10249 + parentBlockingPromises.push(result);
10250 + }
10251 + return {
10252 + result: createPause(parentAbortSignal)(result),
10253 + cancel: function () {
10254 + abortControllerWithReason(childAbortController, taskCancelled);
10255 + }
10256 + };
10257 + };
10258 +};
10259 +var createTakePattern = function (startListening, signal) {
10260 + var take = function (predicate, timeout) { return __async(void 0, null, function () {
10261 + var unsubscribe, tuplePromise, promises, output;
10262 + return __generator(this, function (_c) {
10263 + switch (_c.label) {
10264 + case 0:
10265 + validateActive(signal);
10266 + unsubscribe = function () {
10267 + };
10268 + tuplePromise = new Promise(function (resolve, reject) {
10269 + var stopListening = startListening({
10270 + predicate: predicate,
10271 + effect: function (action, listenerApi) {
10272 + listenerApi.unsubscribe();
10273 + resolve([
10274 + action,
10275 + listenerApi.getState(),
10276 + listenerApi.getOriginalState()
10277 + ]);
10278 + }
10279 + });
10280 + unsubscribe = function () {
10281 + stopListening();
10282 + reject();
10283 + };
10284 + });
10285 + promises = [
10286 + tuplePromise
10287 + ];
10288 + if (timeout != null) {
10289 + promises.push(new Promise(function (resolve) { return setTimeout(resolve, timeout, null); }));
10290 + }
10291 + _c.label = 1;
10292 + case 1:
10293 + _c.trys.push([1, , 3, 4]);
10294 + return [4 /*yield*/, raceWithSignal(signal, Promise.race(promises))];
10295 + case 2:
10296 + output = _c.sent();
10297 + validateActive(signal);
10298 + return [2 /*return*/, output];
10299 + case 3:
10300 + unsubscribe();
10301 + return [7 /*endfinally*/];
10302 + case 4: return [2 /*return*/];
10303 + }
10304 + });
10305 + }); };
10306 + return function (predicate, timeout) { return catchRejection(take(predicate, timeout)); };
10307 +};
10308 +var getListenerEntryPropsFrom = function (options) {
10309 + var type = options.type, actionCreator = options.actionCreator, matcher = options.matcher, predicate = options.predicate, effect = options.effect;
10310 + if (type) {
10311 + predicate = createAction(type).match;
10312 + }
10313 + else if (actionCreator) {
10314 + type = actionCreator.type;
10315 + predicate = actionCreator.match;
10316 + }
10317 + else if (matcher) {
10318 + predicate = matcher;
10319 + }
10320 + else if (predicate) {
10321 + }
10322 + else {
10323 + throw new Error("Creating or removing a listener requires one of the known fields for matching an action");
10324 + }
10325 + assertFunction(effect, "options.listener");
10326 + return { predicate: predicate, type: type, effect: effect };
10327 +};
10328 +var createListenerEntry = function (options) {
10329 + var _c = getListenerEntryPropsFrom(options), type = _c.type, predicate = _c.predicate, effect = _c.effect;
10330 + var id = nanoid();
10331 + var entry = {
10332 + id: id,
10333 + effect: effect,
10334 + type: type,
10335 + predicate: predicate,
10336 + pending: new Set(),
10337 + unsubscribe: function () {
10338 + throw new Error("Unsubscribe not initialized");
10339 + }
10340 + };
10341 + return entry;
10342 +};
10343 +var cancelActiveListeners = function (entry) {
10344 + entry.pending.forEach(function (controller) {
10345 + abortControllerWithReason(controller, listenerCancelled);
10346 + });
10347 +};
10348 +var createClearListenerMiddleware = function (listenerMap) {
10349 + return function () {
10350 + listenerMap.forEach(cancelActiveListeners);
10351 + listenerMap.clear();
10352 + };
10353 +};
10354 +var safelyNotifyError = function (errorHandler, errorToNotify, errorInfo) {
10355 + try {
10356 + errorHandler(errorToNotify, errorInfo);
10357 + }
10358 + catch (errorHandlerError) {
10359 + setTimeout(function () {
10360 + throw errorHandlerError;
10361 + }, 0);
10362 + }
10363 +};
10364 +var addListener = createAction(alm + "/add");
10365 +var clearAllListeners = createAction(alm + "/removeAll");
10366 +var removeListener = createAction(alm + "/remove");
10367 +var defaultErrorHandler = function () {
10368 + var args = [];
10369 + for (var _i = 0; _i < arguments.length; _i++) {
10370 + args[_i] = arguments[_i];
10371 + }
10372 + console.error.apply(console, __spreadArray([alm + "/error"], args));
10373 +};
10374 +function createListenerMiddleware(middlewareOptions) {
10375 + var _this = this;
10376 + if (middlewareOptions === void 0) { middlewareOptions = {}; }
10377 + var listenerMap = new Map();
10378 + var extra = middlewareOptions.extra, _c = middlewareOptions.onError, onError = _c === void 0 ? defaultErrorHandler : _c;
10379 + assertFunction(onError, "onError");
10380 + var insertEntry = function (entry) {
10381 + entry.unsubscribe = function () { return listenerMap.delete(entry.id); };
10382 + listenerMap.set(entry.id, entry);
10383 + return function (cancelOptions) {
10384 + entry.unsubscribe();
10385 + if (cancelOptions == null ? void 0 : cancelOptions.cancelActive) {
10386 + cancelActiveListeners(entry);
10387 + }
10388 + };
10389 + };
10390 + var findListenerEntry = function (comparator) {
10391 + for (var _i = 0, _c = Array.from(listenerMap.values()); _i < _c.length; _i++) {
10392 + var entry = _c[_i];
10393 + if (comparator(entry)) {
10394 + return entry;
10395 + }
10396 + }
10397 + return void 0;
10398 + };
10399 + var startListening = function (options) {
10400 + var entry = findListenerEntry(function (existingEntry) { return existingEntry.effect === options.effect; });
10401 + if (!entry) {
10402 + entry = createListenerEntry(options);
10403 + }
10404 + return insertEntry(entry);
10405 + };
10406 + var stopListening = function (options) {
10407 + var _c = getListenerEntryPropsFrom(options), type = _c.type, effect = _c.effect, predicate = _c.predicate;
10408 + var entry = findListenerEntry(function (entry2) {
10409 + var matchPredicateOrType = typeof type === "string" ? entry2.type === type : entry2.predicate === predicate;
10410 + return matchPredicateOrType && entry2.effect === effect;
10411 + });
10412 + if (entry) {
10413 + entry.unsubscribe();
10414 + if (options.cancelActive) {
10415 + cancelActiveListeners(entry);
10416 + }
10417 + }
10418 + return !!entry;
10419 + };
10420 + var notifyListener = function (entry, action, api, getOriginalState) { return __async(_this, null, function () {
10421 + var internalTaskController, take, autoJoinPromises, listenerError_1;
10422 + return __generator(this, function (_c) {
10423 + switch (_c.label) {
10424 + case 0:
10425 + internalTaskController = new AbortController();
10426 + take = createTakePattern(startListening, internalTaskController.signal);
10427 + autoJoinPromises = [];
10428 + _c.label = 1;
10429 + case 1:
10430 + _c.trys.push([1, 3, 4, 6]);
10431 + entry.pending.add(internalTaskController);
10432 + return [4 /*yield*/, Promise.resolve(entry.effect(action, assign({}, api, {
10433 + getOriginalState: getOriginalState,
10434 + condition: function (predicate, timeout) { return take(predicate, timeout).then(Boolean); },
10435 + take: take,
10436 + delay: createDelay(internalTaskController.signal),
10437 + pause: createPause(internalTaskController.signal),
10438 + extra: extra,
10439 + signal: internalTaskController.signal,
10440 + fork: createFork(internalTaskController.signal, autoJoinPromises),
10441 + unsubscribe: entry.unsubscribe,
10442 + subscribe: function () {
10443 + listenerMap.set(entry.id, entry);
10444 + },
10445 + cancelActiveListeners: function () {
10446 + entry.pending.forEach(function (controller, _, set) {
10447 + if (controller !== internalTaskController) {
10448 + abortControllerWithReason(controller, listenerCancelled);
10449 + set.delete(controller);
10450 + }
10451 + });
10452 + }
10453 + })))];
10454 + case 2:
10455 + _c.sent();
10456 + return [3 /*break*/, 6];
10457 + case 3:
10458 + listenerError_1 = _c.sent();
10459 + if (!(listenerError_1 instanceof TaskAbortError)) {
10460 + safelyNotifyError(onError, listenerError_1, {
10461 + raisedBy: "effect"
10462 + });
10463 + }
10464 + return [3 /*break*/, 6];
10465 + case 4: return [4 /*yield*/, Promise.allSettled(autoJoinPromises)];
10466 + case 5:
10467 + _c.sent();
10468 + abortControllerWithReason(internalTaskController, listenerCompleted);
10469 + entry.pending.delete(internalTaskController);
10470 + return [7 /*endfinally*/];
10471 + case 6: return [2 /*return*/];
10472 + }
10473 + });
10474 + }); };
10475 + var clearListenerMiddleware = createClearListenerMiddleware(listenerMap);
10476 + var middleware = function (api) { return function (next) { return function (action) {
10477 + if (!isAction(action)) {
10478 + return next(action);
10479 + }
10480 + if (addListener.match(action)) {
10481 + return startListening(action.payload);
10482 + }
10483 + if (clearAllListeners.match(action)) {
10484 + clearListenerMiddleware();
10485 + return;
10486 + }
10487 + if (removeListener.match(action)) {
10488 + return stopListening(action.payload);
10489 + }
10490 + var originalState = api.getState();
10491 + var getOriginalState = function () {
10492 + if (originalState === INTERNAL_NIL_TOKEN) {
10493 + throw new Error(alm + ": getOriginalState can only be called synchronously");
10494 + }
10495 + return originalState;
10496 + };
10497 + var result;
10498 + try {
10499 + result = next(action);
10500 + if (listenerMap.size > 0) {
10501 + var currentState = api.getState();
10502 + var listenerEntries = Array.from(listenerMap.values());
10503 + for (var _i = 0, listenerEntries_1 = listenerEntries; _i < listenerEntries_1.length; _i++) {
10504 + var entry = listenerEntries_1[_i];
10505 + var runListener = false;
10506 + try {
10507 + runListener = entry.predicate(action, currentState, originalState);
10508 + }
10509 + catch (predicateError) {
10510 + runListener = false;
10511 + safelyNotifyError(onError, predicateError, {
10512 + raisedBy: "predicate"
10513 + });
10514 + }
10515 + if (!runListener) {
10516 + continue;
10517 + }
10518 + notifyListener(entry, action, api, getOriginalState);
10519 + }
10520 + }
10521 + }
10522 + finally {
10523 + originalState = INTERNAL_NIL_TOKEN;
10524 + }
10525 + return result;
10526 + }; }; };
10527 + return {
10528 + middleware: middleware,
10529 + startListening: startListening,
10530 + stopListening: stopListening,
10531 + clearListeners: clearListenerMiddleware
10532 + };
10533 +}
10534 +// src/autoBatchEnhancer.ts
10535 +var SHOULD_AUTOBATCH = "RTK_autoBatch";
10536 +var prepareAutoBatched = function () { return function (payload) {
10537 + var _c;
10538 + return ({
10539 + payload: payload,
10540 + meta: (_c = {}, _c[SHOULD_AUTOBATCH] = true, _c)
10541 + });
10542 +}; };
10543 +var promise;
10544 +var queueMicrotaskShim = typeof queueMicrotask === "function" ? queueMicrotask.bind(typeof window !== "undefined" ? window : typeof __webpack_require__.g !== "undefined" ? __webpack_require__.g : globalThis) : function (cb) { return (promise || (promise = Promise.resolve())).then(cb).catch(function (err) { return setTimeout(function () {
10545 + throw err;
10546 +}, 0); }); };
10547 +var createQueueWithTimer = function (timeout) {
10548 + return function (notify) {
10549 + setTimeout(notify, timeout);
10550 + };
10551 +};
10552 +var rAF = typeof window !== "undefined" && window.requestAnimationFrame ? window.requestAnimationFrame : createQueueWithTimer(10);
10553 +var autoBatchEnhancer = function (options) {
10554 + if (options === void 0) { options = { type: "raf" }; }
10555 + return function (next) { return function () {
10556 + var args = [];
10557 + for (var _i = 0; _i < arguments.length; _i++) {
10558 + args[_i] = arguments[_i];
10559 + }
10560 + var store = next.apply(void 0, args);
10561 + var notifying = true;
10562 + var shouldNotifyAtEndOfTick = false;
10563 + var notificationQueued = false;
10564 + var listeners = new Set();
10565 + var queueCallback = options.type === "tick" ? queueMicrotaskShim : options.type === "raf" ? rAF : options.type === "callback" ? options.queueNotification : createQueueWithTimer(options.timeout);
10566 + var notifyListeners = function () {
10567 + notificationQueued = false;
10568 + if (shouldNotifyAtEndOfTick) {
10569 + shouldNotifyAtEndOfTick = false;
10570 + listeners.forEach(function (l) { return l(); });
10571 + }
10572 + };
10573 + return Object.assign({}, store, {
10574 + subscribe: function (listener2) {
10575 + var wrappedListener = function () { return notifying && listener2(); };
10576 + var unsubscribe = store.subscribe(wrappedListener);
10577 + listeners.add(listener2);
10578 + return function () {
10579 + unsubscribe();
10580 + listeners.delete(listener2);
10581 + };
10582 + },
10583 + dispatch: function (action) {
10584 + var _a;
10585 + try {
10586 + notifying = !((_a = action == null ? void 0 : action.meta) == null ? void 0 : _a[SHOULD_AUTOBATCH]);
10587 + shouldNotifyAtEndOfTick = !notifying;
10588 + if (shouldNotifyAtEndOfTick) {
10589 + if (!notificationQueued) {
10590 + notificationQueued = true;
10591 + queueCallback(notifyListeners);
10592 + }
10593 + }
10594 + return store.dispatch(action);
10595 + }
10596 + finally {
10597 + notifying = true;
10598 + }
10599 + }
10600 + });
10601 + }; };
10602 +};
10603 +// src/index.ts
10604 +(0,immer__WEBPACK_IMPORTED_MODULE_2__.enableES5)();
10605 +
10606 +//# sourceMappingURL=redux-toolkit.esm.js.map
10607 +
10608 +/***/ }),
10609 +
10610 +/***/ "../node_modules/immer/dist/immer.esm.mjs":
10611 +/*!************************************************!*\
10612 + !*** ../node_modules/immer/dist/immer.esm.mjs ***!
10613 + \************************************************/
10614 +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
10615 +
10616 +"use strict";
10617 +__webpack_require__.r(__webpack_exports__);
10618 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
10619 +/* harmony export */ Immer: () => (/* binding */ un),
10620 +/* harmony export */ applyPatches: () => (/* binding */ pn),
10621 +/* harmony export */ castDraft: () => (/* binding */ K),
10622 +/* harmony export */ castImmutable: () => (/* binding */ $),
10623 +/* harmony export */ createDraft: () => (/* binding */ ln),
10624 +/* harmony export */ current: () => (/* binding */ R),
10625 +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
10626 +/* harmony export */ enableAllPlugins: () => (/* binding */ J),
10627 +/* harmony export */ enableES5: () => (/* binding */ F),
10628 +/* harmony export */ enableMapSet: () => (/* binding */ C),
10629 +/* harmony export */ enablePatches: () => (/* binding */ T),
10630 +/* harmony export */ finishDraft: () => (/* binding */ dn),
10631 +/* harmony export */ freeze: () => (/* binding */ d),
10632 +/* harmony export */ immerable: () => (/* binding */ L),
10633 +/* harmony export */ isDraft: () => (/* binding */ r),
10634 +/* harmony export */ isDraftable: () => (/* binding */ t),
10635 +/* harmony export */ nothing: () => (/* binding */ H),
10636 +/* harmony export */ original: () => (/* binding */ e),
10637 +/* harmony export */ produce: () => (/* binding */ fn),
10638 +/* harmony export */ produceWithPatches: () => (/* binding */ cn),
10639 +/* harmony export */ setAutoFreeze: () => (/* binding */ sn),
10640 +/* harmony export */ setUseProxies: () => (/* binding */ vn)
10641 +/* harmony export */ });
10642 +function n(n){for(var r=arguments.length,t=Array(r>1?r-1:0),e=1;e<r;e++)t[e-1]=arguments[e];if(true){var i=Y[n],o=i?"function"==typeof i?i.apply(null,t):i:"unknown error nr: "+n;throw Error("[Immer] "+o)}// removed by dead control flow
10643 +{}}function r(n){return!!n&&!!n[Q]}function t(n){var r;return!!n&&(function(n){if(!n||"object"!=typeof n)return!1;var r=Object.getPrototypeOf(n);if(null===r)return!0;var t=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return t===Object||"function"==typeof t&&Function.toString.call(t)===Z}(n)||Array.isArray(n)||!!n[L]||!!(null===(r=n.constructor)||void 0===r?void 0:r[L])||s(n)||v(n))}function e(t){return r(t)||n(23,t),t[Q].t}function i(n,r,t){void 0===t&&(t=!1),0===o(n)?(t?Object.keys:nn)(n).forEach((function(e){t&&"symbol"==typeof e||r(e,n[e],n)})):n.forEach((function(t,e){return r(e,t,n)}))}function o(n){var r=n[Q];return r?r.i>3?r.i-4:r.i:Array.isArray(n)?1:s(n)?2:v(n)?3:0}function u(n,r){return 2===o(n)?n.has(r):Object.prototype.hasOwnProperty.call(n,r)}function a(n,r){return 2===o(n)?n.get(r):n[r]}function f(n,r,t){var e=o(n);2===e?n.set(r,t):3===e?n.add(t):n[r]=t}function c(n,r){return n===r?0!==n||1/n==1/r:n!=n&&r!=r}function s(n){return X&&n instanceof Map}function v(n){return q&&n instanceof Set}function p(n){return n.o||n.t}function l(n){if(Array.isArray(n))return Array.prototype.slice.call(n);var r=rn(n);delete r[Q];for(var t=nn(r),e=0;e<t.length;e++){var i=t[e],o=r[i];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(r[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:n[i]})}return Object.create(Object.getPrototypeOf(n),r)}function d(n,e){return void 0===e&&(e=!1),y(n)||r(n)||!t(n)||(o(n)>1&&(n.set=n.add=n.clear=n.delete=h),Object.freeze(n),e&&i(n,(function(n,r){return d(r,!0)}),!0)),n}function h(){n(2)}function y(n){return null==n||"object"!=typeof n||Object.isFrozen(n)}function b(r){var t=tn[r];return t||n(18,r),t}function m(n,r){tn[n]||(tn[n]=r)}function _(){return false||U||n(0),U}function j(n,r){r&&(b("Patches"),n.u=[],n.s=[],n.v=r)}function g(n){O(n),n.p.forEach(S),n.p=null}function O(n){n===U&&(U=n.l)}function w(n){return U={p:[],l:U,h:n,m:!0,_:0}}function S(n){var r=n[Q];0===r.i||1===r.i?r.j():r.g=!0}function P(r,e){e._=e.p.length;var i=e.p[0],o=void 0!==r&&r!==i;return e.h.O||b("ES5").S(e,r,o),o?(i[Q].P&&(g(e),n(4)),t(r)&&(r=M(e,r),e.l||x(e,r)),e.u&&b("Patches").M(i[Q].t,r,e.u,e.s)):r=M(e,i,[]),g(e),e.u&&e.v(e.u,e.s),r!==H?r:void 0}function M(n,r,t){if(y(r))return r;var e=r[Q];if(!e)return i(r,(function(i,o){return A(n,e,r,i,o,t)}),!0),r;if(e.A!==n)return r;if(!e.P)return x(n,e.t,!0),e.t;if(!e.I){e.I=!0,e.A._--;var o=4===e.i||5===e.i?e.o=l(e.k):e.o,u=o,a=!1;3===e.i&&(u=new Set(o),o.clear(),a=!0),i(u,(function(r,i){return A(n,e,o,r,i,t,a)})),x(n,o,!1),t&&n.u&&b("Patches").N(e,t,n.u,n.s)}return e.o}function A(e,i,o,a,c,s,v){if( true&&c===o&&n(5),r(c)){var p=M(e,c,s&&i&&3!==i.i&&!u(i.R,a)?s.concat(a):void 0);if(f(o,a,p),!r(p))return;e.m=!1}else v&&o.add(c);if(t(c)&&!y(c)){if(!e.h.D&&e._<1)return;M(e,c),i&&i.A.l||x(e,c)}}function x(n,r,t){void 0===t&&(t=!1),!n.l&&n.h.D&&n.m&&d(r,t)}function z(n,r){var t=n[Q];return(t?p(t):n)[r]}function I(n,r){if(r in n)for(var t=Object.getPrototypeOf(n);t;){var e=Object.getOwnPropertyDescriptor(t,r);if(e)return e;t=Object.getPrototypeOf(t)}}function k(n){n.P||(n.P=!0,n.l&&k(n.l))}function E(n){n.o||(n.o=l(n.t))}function N(n,r,t){var e=s(r)?b("MapSet").F(r,t):v(r)?b("MapSet").T(r,t):n.O?function(n,r){var t=Array.isArray(n),e={i:t?1:0,A:r?r.A:_(),P:!1,I:!1,R:{},l:r,t:n,k:null,o:null,j:null,C:!1},i=e,o=en;t&&(i=[e],o=on);var u=Proxy.revocable(i,o),a=u.revoke,f=u.proxy;return e.k=f,e.j=a,f}(r,t):b("ES5").J(r,t);return(t?t.A:_()).p.push(e),e}function R(e){return r(e)||n(22,e),function n(r){if(!t(r))return r;var e,u=r[Q],c=o(r);if(u){if(!u.P&&(u.i<4||!b("ES5").K(u)))return u.t;u.I=!0,e=D(r,c),u.I=!1}else e=D(r,c);return i(e,(function(r,t){u&&a(u.t,r)===t||f(e,r,n(t))})),3===c?new Set(e):e}(e)}function D(n,r){switch(r){case 2:return new Map(n);case 3:return Array.from(n)}return l(n)}function F(){function t(n,r){var t=s[n];return t?t.enumerable=r:s[n]=t={configurable:!0,enumerable:r,get:function(){var r=this[Q];return true&&f(r),en.get(r,n)},set:function(r){var t=this[Q]; true&&f(t),en.set(t,n,r)}},t}function e(n){for(var r=n.length-1;r>=0;r--){var t=n[r][Q];if(!t.P)switch(t.i){case 5:a(t)&&k(t);break;case 4:o(t)&&k(t)}}}function o(n){for(var r=n.t,t=n.k,e=nn(t),i=e.length-1;i>=0;i--){var o=e[i];if(o!==Q){var a=r[o];if(void 0===a&&!u(r,o))return!0;var f=t[o],s=f&&f[Q];if(s?s.t!==a:!c(f,a))return!0}}var v=!!r[Q];return e.length!==nn(r).length+(v?0:1)}function a(n){var r=n.k;if(r.length!==n.t.length)return!0;var t=Object.getOwnPropertyDescriptor(r,r.length-1);if(t&&!t.get)return!0;for(var e=0;e<r.length;e++)if(!r.hasOwnProperty(e))return!0;return!1}function f(r){r.g&&n(3,JSON.stringify(p(r)))}var s={};m("ES5",{J:function(n,r){var e=Array.isArray(n),i=function(n,r){if(n){for(var e=Array(r.length),i=0;i<r.length;i++)Object.defineProperty(e,""+i,t(i,!0));return e}var o=rn(r);delete o[Q];for(var u=nn(o),a=0;a<u.length;a++){var f=u[a];o[f]=t(f,n||!!o[f].enumerable)}return Object.create(Object.getPrototypeOf(r),o)}(e,n),o={i:e?5:4,A:r?r.A:_(),P:!1,I:!1,R:{},l:r,t:n,k:i,o:null,g:!1,C:!1};return Object.defineProperty(i,Q,{value:o,writable:!0}),i},S:function(n,t,o){o?r(t)&&t[Q].A===n&&e(n.p):(n.u&&function n(r){if(r&&"object"==typeof r){var t=r[Q];if(t){var e=t.t,o=t.k,f=t.R,c=t.i;if(4===c)i(o,(function(r){r!==Q&&(void 0!==e[r]||u(e,r)?f[r]||n(o[r]):(f[r]=!0,k(t)))})),i(e,(function(n){void 0!==o[n]||u(o,n)||(f[n]=!1,k(t))}));else if(5===c){if(a(t)&&(k(t),f.length=!0),o.length<e.length)for(var s=o.length;s<e.length;s++)f[s]=!1;else for(var v=e.length;v<o.length;v++)f[v]=!0;for(var p=Math.min(o.length,e.length),l=0;l<p;l++)o.hasOwnProperty(l)||(f[l]=!0),void 0===f[l]&&n(o[l])}}}}(n.p[0]),e(n.p))},K:function(n){return 4===n.i?o(n):a(n)}})}function T(){function e(n){if(!t(n))return n;if(Array.isArray(n))return n.map(e);if(s(n))return new Map(Array.from(n.entries()).map((function(n){return[n[0],e(n[1])]})));if(v(n))return new Set(Array.from(n).map(e));var r=Object.create(Object.getPrototypeOf(n));for(var i in n)r[i]=e(n[i]);return u(n,L)&&(r[L]=n[L]),r}function f(n){return r(n)?e(n):n}var c="add";m("Patches",{$:function(r,t){return t.forEach((function(t){for(var i=t.path,u=t.op,f=r,s=0;s<i.length-1;s++){var v=o(f),p=i[s];"string"!=typeof p&&"number"!=typeof p&&(p=""+p),0!==v&&1!==v||"__proto__"!==p&&"constructor"!==p||n(24),"function"==typeof f&&"prototype"===p&&n(24),"object"!=typeof(f=a(f,p))&&n(15,i.join("/"))}var l=o(f),d=e(t.value),h=i[i.length-1];switch(u){case"replace":switch(l){case 2:return f.set(h,d);case 3:n(16);default:return f[h]=d}case c:switch(l){case 1:return"-"===h?f.push(d):f.splice(h,0,d);case 2:return f.set(h,d);case 3:return f.add(d);default:return f[h]=d}case"remove":switch(l){case 1:return f.splice(h,1);case 2:return f.delete(h);case 3:return f.delete(t.value);default:return delete f[h]}default:n(17,u)}})),r},N:function(n,r,t,e){switch(n.i){case 0:case 4:case 2:return function(n,r,t,e){var o=n.t,s=n.o;i(n.R,(function(n,i){var v=a(o,n),p=a(s,n),l=i?u(o,n)?"replace":c:"remove";if(v!==p||"replace"!==l){var d=r.concat(n);t.push("remove"===l?{op:l,path:d}:{op:l,path:d,value:p}),e.push(l===c?{op:"remove",path:d}:"remove"===l?{op:c,path:d,value:f(v)}:{op:"replace",path:d,value:f(v)})}}))}(n,r,t,e);case 5:case 1:return function(n,r,t,e){var i=n.t,o=n.R,u=n.o;if(u.length<i.length){var a=[u,i];i=a[0],u=a[1];var s=[e,t];t=s[0],e=s[1]}for(var v=0;v<i.length;v++)if(o[v]&&u[v]!==i[v]){var p=r.concat([v]);t.push({op:"replace",path:p,value:f(u[v])}),e.push({op:"replace",path:p,value:f(i[v])})}for(var l=i.length;l<u.length;l++){var d=r.concat([l]);t.push({op:c,path:d,value:f(u[l])})}i.length<u.length&&e.push({op:"replace",path:r.concat(["length"]),value:i.length})}(n,r,t,e);case 3:return function(n,r,t,e){var i=n.t,o=n.o,u=0;i.forEach((function(n){if(!o.has(n)){var i=r.concat([u]);t.push({op:"remove",path:i,value:n}),e.unshift({op:c,path:i,value:n})}u++})),u=0,o.forEach((function(n){if(!i.has(n)){var o=r.concat([u]);t.push({op:c,path:o,value:n}),e.unshift({op:"remove",path:o,value:n})}u++}))}(n,r,t,e)}},M:function(n,r,t,e){t.push({op:"replace",path:[],value:r===H?void 0:r}),e.push({op:"replace",path:[],value:n})}})}function C(){function r(n,r){function t(){this.constructor=n}a(n,r),n.prototype=(t.prototype=r.prototype,new t)}function e(n){n.o||(n.R=new Map,n.o=new Map(n.t))}function o(n){n.o||(n.o=new Set,n.t.forEach((function(r){if(t(r)){var e=N(n.A.h,r,n);n.p.set(r,e),n.o.add(e)}else n.o.add(r)})))}function u(r){r.g&&n(3,JSON.stringify(p(r)))}var a=function(n,r){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var t in r)r.hasOwnProperty(t)&&(n[t]=r[t])})(n,r)},f=function(){function n(n,r){return this[Q]={i:2,l:r,A:r?r.A:_(),P:!1,I:!1,o:void 0,R:void 0,t:n,k:this,C:!1,g:!1},this}r(n,Map);var o=n.prototype;return Object.defineProperty(o,"size",{get:function(){return p(this[Q]).size}}),o.has=function(n){return p(this[Q]).has(n)},o.set=function(n,r){var t=this[Q];return u(t),p(t).has(n)&&p(t).get(n)===r||(e(t),k(t),t.R.set(n,!0),t.o.set(n,r),t.R.set(n,!0)),this},o.delete=function(n){if(!this.has(n))return!1;var r=this[Q];return u(r),e(r),k(r),r.t.has(n)?r.R.set(n,!1):r.R.delete(n),r.o.delete(n),!0},o.clear=function(){var n=this[Q];u(n),p(n).size&&(e(n),k(n),n.R=new Map,i(n.t,(function(r){n.R.set(r,!1)})),n.o.clear())},o.forEach=function(n,r){var t=this;p(this[Q]).forEach((function(e,i){n.call(r,t.get(i),i,t)}))},o.get=function(n){var r=this[Q];u(r);var i=p(r).get(n);if(r.I||!t(i))return i;if(i!==r.t.get(n))return i;var o=N(r.A.h,i,r);return e(r),r.o.set(n,o),o},o.keys=function(){return p(this[Q]).keys()},o.values=function(){var n,r=this,t=this.keys();return(n={})[V]=function(){return r.values()},n.next=function(){var n=t.next();return n.done?n:{done:!1,value:r.get(n.value)}},n},o.entries=function(){var n,r=this,t=this.keys();return(n={})[V]=function(){return r.entries()},n.next=function(){var n=t.next();if(n.done)return n;var e=r.get(n.value);return{done:!1,value:[n.value,e]}},n},o[V]=function(){return this.entries()},n}(),c=function(){function n(n,r){return this[Q]={i:3,l:r,A:r?r.A:_(),P:!1,I:!1,o:void 0,t:n,k:this,p:new Map,g:!1,C:!1},this}r(n,Set);var t=n.prototype;return Object.defineProperty(t,"size",{get:function(){return p(this[Q]).size}}),t.has=function(n){var r=this[Q];return u(r),r.o?!!r.o.has(n)||!(!r.p.has(n)||!r.o.has(r.p.get(n))):r.t.has(n)},t.add=function(n){var r=this[Q];return u(r),this.has(n)||(o(r),k(r),r.o.add(n)),this},t.delete=function(n){if(!this.has(n))return!1;var r=this[Q];return u(r),o(r),k(r),r.o.delete(n)||!!r.p.has(n)&&r.o.delete(r.p.get(n))},t.clear=function(){var n=this[Q];u(n),p(n).size&&(o(n),k(n),n.o.clear())},t.values=function(){var n=this[Q];return u(n),o(n),n.o.values()},t.entries=function(){var n=this[Q];return u(n),o(n),n.o.entries()},t.keys=function(){return this.values()},t[V]=function(){return this.values()},t.forEach=function(n,r){for(var t=this.values(),e=t.next();!e.done;)n.call(r,e.value,e.value,this),e=t.next()},n}();m("MapSet",{F:function(n,r){return new f(n,r)},T:function(n,r){return new c(n,r)}})}function J(){F(),C(),T()}function K(n){return n}function $(n){return n}var G,U,W="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),X="undefined"!=typeof Map,q="undefined"!=typeof Set,B="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,H=W?Symbol.for("immer-nothing"):((G={})["immer-nothing"]=!0,G),L=W?Symbol.for("immer-draftable"):"__$immer_draftable",Q=W?Symbol.for("immer-state"):"__$immer_state",V="undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator",Y={0:"Illegal state",1:"Immer drafts cannot have computed properties",2:"This object has been frozen and should not be mutated",3:function(n){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+n},4:"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",5:"Immer forbids circular references",6:"The first or second argument to `produce` must be a function",7:"The third argument to `produce` must be a function or undefined",8:"First argument to `createDraft` must be a plain object, an array, or an immerable object",9:"First argument to `finishDraft` must be a draft returned by `createDraft`",10:"The given draft is already finalized",11:"Object.defineProperty() cannot be used on an Immer draft",12:"Object.setPrototypeOf() cannot be used on an Immer draft",13:"Immer only supports deleting array indices",14:"Immer only supports setting array indices and the 'length' property",15:function(n){return"Cannot apply patch, path doesn't resolve: "+n},16:'Sets cannot have "replace" patches.',17:function(n){return"Unsupported patch operation: "+n},18:function(n){return"The plugin for '"+n+"' has not been loaded into Immer. To enable the plugin, import and call `enable"+n+"()` when initializing your application."},20:"Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available",21:function(n){return"produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '"+n+"'"},22:function(n){return"'current' expects a draft, got: "+n},23:function(n){return"'original' expects a draft, got: "+n},24:"Patching reserved attributes like __proto__, prototype and constructor is not allowed"},Z=""+Object.prototype.constructor,nn="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:Object.getOwnPropertyNames,rn=Object.getOwnPropertyDescriptors||function(n){var r={};return nn(n).forEach((function(t){r[t]=Object.getOwnPropertyDescriptor(n,t)})),r},tn={},en={get:function(n,r){if(r===Q)return n;var e=p(n);if(!u(e,r))return function(n,r,t){var e,i=I(r,t);return i?"value"in i?i.value:null===(e=i.get)||void 0===e?void 0:e.call(n.k):void 0}(n,e,r);var i=e[r];return n.I||!t(i)?i:i===z(n.t,r)?(E(n),n.o[r]=N(n.A.h,i,n)):i},has:function(n,r){return r in p(n)},ownKeys:function(n){return Reflect.ownKeys(p(n))},set:function(n,r,t){var e=I(p(n),r);if(null==e?void 0:e.set)return e.set.call(n.k,t),!0;if(!n.P){var i=z(p(n),r),o=null==i?void 0:i[Q];if(o&&o.t===t)return n.o[r]=t,n.R[r]=!1,!0;if(c(t,i)&&(void 0!==t||u(n.t,r)))return!0;E(n),k(n)}return n.o[r]===t&&(void 0!==t||r in n.o)||Number.isNaN(t)&&Number.isNaN(n.o[r])||(n.o[r]=t,n.R[r]=!0),!0},deleteProperty:function(n,r){return void 0!==z(n.t,r)||r in n.t?(n.R[r]=!1,E(n),k(n)):delete n.R[r],n.o&&delete n.o[r],!0},getOwnPropertyDescriptor:function(n,r){var t=p(n),e=Reflect.getOwnPropertyDescriptor(t,r);return e?{writable:!0,configurable:1!==n.i||"length"!==r,enumerable:e.enumerable,value:t[r]}:e},defineProperty:function(){n(11)},getPrototypeOf:function(n){return Object.getPrototypeOf(n.t)},setPrototypeOf:function(){n(12)}},on={};i(en,(function(n,r){on[n]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)}})),on.deleteProperty=function(r,t){return true&&isNaN(parseInt(t))&&n(13),on.set.call(this,r,t,void 0)},on.set=function(r,t,e){return true&&"length"!==t&&isNaN(parseInt(t))&&n(14),en.set.call(this,r[0],t,e,r[0])};var un=function(){function e(r){var e=this;this.O=B,this.D=!0,this.produce=function(r,i,o){if("function"==typeof r&&"function"!=typeof i){var u=i;i=r;var a=e;return function(n){var r=this;void 0===n&&(n=u);for(var t=arguments.length,e=Array(t>1?t-1:0),o=1;o<t;o++)e[o-1]=arguments[o];return a.produce(n,(function(n){var t;return(t=i).call.apply(t,[r,n].concat(e))}))}}var f;if("function"!=typeof i&&n(6),void 0!==o&&"function"!=typeof o&&n(7),t(r)){var c=w(e),s=N(e,r,void 0),v=!0;try{f=i(s),v=!1}finally{v?g(c):O(c)}return"undefined"!=typeof Promise&&f instanceof Promise?f.then((function(n){return j(c,o),P(n,c)}),(function(n){throw g(c),n})):(j(c,o),P(f,c))}if(!r||"object"!=typeof r){if(void 0===(f=i(r))&&(f=r),f===H&&(f=void 0),e.D&&d(f,!0),o){var p=[],l=[];b("Patches").M(r,f,p,l),o(p,l)}return f}n(21,r)},this.produceWithPatches=function(n,r){if("function"==typeof n)return function(r){for(var t=arguments.length,i=Array(t>1?t-1:0),o=1;o<t;o++)i[o-1]=arguments[o];return e.produceWithPatches(r,(function(r){return n.apply(void 0,[r].concat(i))}))};var t,i,o=e.produce(n,r,(function(n,r){t=n,i=r}));return"undefined"!=typeof Promise&&o instanceof Promise?o.then((function(n){return[n,t,i]})):[o,t,i]},"boolean"==typeof(null==r?void 0:r.useProxies)&&this.setUseProxies(r.useProxies),"boolean"==typeof(null==r?void 0:r.autoFreeze)&&this.setAutoFreeze(r.autoFreeze)}var i=e.prototype;return i.createDraft=function(e){t(e)||n(8),r(e)&&(e=R(e));var i=w(this),o=N(this,e,void 0);return o[Q].C=!0,O(i),o},i.finishDraft=function(r,t){var e=r&&r[Q]; true&&(e&&e.C||n(9),e.I&&n(10));var i=e.A;return j(i,t),P(void 0,i)},i.setAutoFreeze=function(n){this.D=n},i.setUseProxies=function(r){r&&!B&&n(20),this.O=r},i.applyPatches=function(n,t){var e;for(e=t.length-1;e>=0;e--){var i=t[e];if(0===i.path.length&&"replace"===i.op){n=i.value;break}}e>-1&&(t=t.slice(e+1));var o=b("Patches").$;return r(n)?o(n,t):this.produce(n,(function(n){return o(n,t)}))},e}(),an=new un,fn=an.produce,cn=an.produceWithPatches.bind(an),sn=an.setAutoFreeze.bind(an),vn=an.setUseProxies.bind(an),pn=an.applyPatches.bind(an),ln=an.createDraft.bind(an),dn=an.finishDraft.bind(an);/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (fn);
10644 +//# sourceMappingURL=immer.esm.js.map
10645 +
10646 +
10647 +/***/ }),
10648 +
10649 +/***/ "../node_modules/redux-thunk/es/index.js":
10650 +/*!***********************************************!*\
10651 + !*** ../node_modules/redux-thunk/es/index.js ***!
10652 + \***********************************************/
10653 +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
10654 +
10655 +"use strict";
10656 +__webpack_require__.r(__webpack_exports__);
10657 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
10658 +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
10659 +/* harmony export */ });
10660 +/** A function that accepts a potential "extra argument" value to be injected later,
10661 + * and returns an instance of the thunk middleware that uses that value
10662 + */
10663 +function createThunkMiddleware(extraArgument) {
10664 + // Standard Redux middleware definition pattern:
10665 + // See: https://redux.js.org/tutorials/fundamentals/part-4-store#writing-custom-middleware
10666 + var middleware = function middleware(_ref) {
10667 + var dispatch = _ref.dispatch,
10668 + getState = _ref.getState;
10669 + return function (next) {
10670 + return function (action) {
10671 + // The thunk middleware looks for any functions that were passed to `store.dispatch`.
10672 + // If this "action" is really a function, call it and return the result.
10673 + if (typeof action === 'function') {
10674 + // Inject the store's `dispatch` and `getState` methods, as well as any "extra arg"
10675 + return action(dispatch, getState, extraArgument);
10676 + } // Otherwise, pass the action down the middleware chain as usual
10677 +
10678 +
10679 + return next(action);
10680 + };
10681 + };
10682 + };
10683 +
10684 + return middleware;
10685 +}
10686 +
10687 +var thunk = createThunkMiddleware(); // Attach the factory function so users can create a customized version
10688 +// with whatever "extra arg" they want to inject into their thunks
10689 +
10690 +thunk.withExtraArgument = createThunkMiddleware;
10691 +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (thunk);
10692 +
10693 +/***/ }),
10694 +
10695 +/***/ "../node_modules/redux/es/redux.js":
10696 +/*!*****************************************!*\
10697 + !*** ../node_modules/redux/es/redux.js ***!
10698 + \*****************************************/
10699 +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
10700 +
10701 +"use strict";
10702 +__webpack_require__.r(__webpack_exports__);
10703 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
10704 +/* harmony export */ __DO_NOT_USE__ActionTypes: () => (/* binding */ ActionTypes),
10705 +/* harmony export */ applyMiddleware: () => (/* binding */ applyMiddleware),
10706 +/* harmony export */ bindActionCreators: () => (/* binding */ bindActionCreators),
10707 +/* harmony export */ combineReducers: () => (/* binding */ combineReducers),
10708 +/* harmony export */ compose: () => (/* binding */ compose),
10709 +/* harmony export */ createStore: () => (/* binding */ createStore),
10710 +/* harmony export */ legacy_createStore: () => (/* binding */ legacy_createStore)
10711 +/* harmony export */ });
10712 +/* harmony import */ var _babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread2 */ "../node_modules/@babel/runtime/helpers/esm/objectSpread2.js");
10713 +
10714 +
10715 +/**
10716 + * Adapted from React: https://github.com/facebook/react/blob/master/packages/shared/formatProdErrorMessage.js
10717 + *
10718 + * Do not require this module directly! Use normal throw error calls. These messages will be replaced with error codes
10719 + * during build.
10720 + * @param {number} code
10721 + */
10722 +function formatProdErrorMessage(code) {
10723 + return "Minified Redux error #" + code + "; visit https://redux.js.org/Errors?code=" + code + " for the full message or " + 'use the non-minified dev environment for full errors. ';
10724 +}
10725 +
10726 +// Inlined version of the `symbol-observable` polyfill
10727 +var $$observable = (function () {
10728 + return typeof Symbol === 'function' && Symbol.observable || '@@observable';
10729 +})();
10730 +
10731 +/**
10732 + * These are private action types reserved by Redux.
10733 + * For any unknown actions, you must return the current state.
10734 + * If the current state is undefined, you must return the initial state.
10735 + * Do not reference these action types directly in your code.
10736 + */
10737 +var randomString = function randomString() {
10738 + return Math.random().toString(36).substring(7).split('').join('.');
10739 +};
10740 +
10741 +var ActionTypes = {
10742 + INIT: "@@redux/INIT" + randomString(),
10743 + REPLACE: "@@redux/REPLACE" + randomString(),
10744 + PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() {
10745 + return "@@redux/PROBE_UNKNOWN_ACTION" + randomString();
10746 + }
10747 +};
10748 +
10749 +/**
10750 + * @param {any} obj The object to inspect.
10751 + * @returns {boolean} True if the argument appears to be a plain object.
10752 + */
10753 +function isPlainObject(obj) {
10754 + if (typeof obj !== 'object' || obj === null) return false;
10755 + var proto = obj;
10756 +
10757 + while (Object.getPrototypeOf(proto) !== null) {
10758 + proto = Object.getPrototypeOf(proto);
10759 + }
10760 +
10761 + return Object.getPrototypeOf(obj) === proto;
10762 +}
10763 +
10764 +// Inlined / shortened version of `kindOf` from https://github.com/jonschlinkert/kind-of
10765 +function miniKindOf(val) {
10766 + if (val === void 0) return 'undefined';
10767 + if (val === null) return 'null';
10768 + var type = typeof val;
10769 +
10770 + switch (type) {
10771 + case 'boolean':
10772 + case 'string':
10773 + case 'number':
10774 + case 'symbol':
10775 + case 'function':
10776 + {
10777 + return type;
10778 + }
10779 + }
10780 +
10781 + if (Array.isArray(val)) return 'array';
10782 + if (isDate(val)) return 'date';
10783 + if (isError(val)) return 'error';
10784 + var constructorName = ctorName(val);
10785 +
10786 + switch (constructorName) {
10787 + case 'Symbol':
10788 + case 'Promise':
10789 + case 'WeakMap':
10790 + case 'WeakSet':
10791 + case 'Map':
10792 + case 'Set':
10793 + return constructorName;
10794 + } // other
10795 +
10796 +
10797 + return type.slice(8, -1).toLowerCase().replace(/\s/g, '');
10798 +}
10799 +
10800 +function ctorName(val) {
10801 + return typeof val.constructor === 'function' ? val.constructor.name : null;
10802 +}
10803 +
10804 +function isError(val) {
10805 + return val instanceof Error || typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number';
10806 +}
10807 +
10808 +function isDate(val) {
10809 + if (val instanceof Date) return true;
10810 + return typeof val.toDateString === 'function' && typeof val.getDate === 'function' && typeof val.setDate === 'function';
10811 +}
10812 +
10813 +function kindOf(val) {
10814 + var typeOfVal = typeof val;
10815 +
10816 + if (true) {
10817 + typeOfVal = miniKindOf(val);
10818 + }
10819 +
10820 + return typeOfVal;
10821 +}
10822 +
10823 +/**
10824 + * @deprecated
10825 + *
10826 + * **We recommend using the `configureStore` method
10827 + * of the `@reduxjs/toolkit` package**, which replaces `createStore`.
10828 + *
10829 + * Redux Toolkit is our recommended approach for writing Redux logic today,
10830 + * including store setup, reducers, data fetching, and more.
10831 + *
10832 + * **For more details, please read this Redux docs page:**
10833 + * **https://redux.js.org/introduction/why-rtk-is-redux-today**
10834 + *
10835 + * `configureStore` from Redux Toolkit is an improved version of `createStore` that
10836 + * simplifies setup and helps avoid common bugs.
10837 + *
10838 + * You should not be using the `redux` core package by itself today, except for learning purposes.
10839 + * The `createStore` method from the core `redux` package will not be removed, but we encourage
10840 + * all users to migrate to using Redux Toolkit for all Redux code.
10841 + *
10842 + * If you want to use `createStore` without this visual deprecation warning, use
10843 + * the `legacy_createStore` import instead:
10844 + *
10845 + * `import { legacy_createStore as createStore} from 'redux'`
10846 + *
10847 + */
10848 +
10849 +function createStore(reducer, preloadedState, enhancer) {
10850 + var _ref2;
10851 +
10852 + if (typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments[3] === 'function') {
10853 + throw new Error( false ? 0 : 'It looks like you are passing several store enhancers to ' + 'createStore(). This is not supported. Instead, compose them ' + 'together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.');
10854 + }
10855 +
10856 + if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {
10857 + enhancer = preloadedState;
10858 + preloadedState = undefined;
10859 + }
10860 +
10861 + if (typeof enhancer !== 'undefined') {
10862 + if (typeof enhancer !== 'function') {
10863 + throw new Error( false ? 0 : "Expected the enhancer to be a function. Instead, received: '" + kindOf(enhancer) + "'");
10864 + }
10865 +
10866 + return enhancer(createStore)(reducer, preloadedState);
10867 + }
10868 +
10869 + if (typeof reducer !== 'function') {
10870 + throw new Error( false ? 0 : "Expected the root reducer to be a function. Instead, received: '" + kindOf(reducer) + "'");
10871 + }
10872 +
10873 + var currentReducer = reducer;
10874 + var currentState = preloadedState;
10875 + var currentListeners = [];
10876 + var nextListeners = currentListeners;
10877 + var isDispatching = false;
10878 + /**
10879 + * This makes a shallow copy of currentListeners so we can use
10880 + * nextListeners as a temporary list while dispatching.
10881 + *
10882 + * This prevents any bugs around consumers calling
10883 + * subscribe/unsubscribe in the middle of a dispatch.
10884 + */
10885 +
10886 + function ensureCanMutateNextListeners() {
10887 + if (nextListeners === currentListeners) {
10888 + nextListeners = currentListeners.slice();
10889 + }
10890 + }
10891 + /**
10892 + * Reads the state tree managed by the store.
10893 + *
10894 + * @returns {any} The current state tree of your application.
10895 + */
10896 +
10897 +
10898 + function getState() {
10899 + if (isDispatching) {
10900 + throw new Error( false ? 0 : 'You may not call store.getState() while the reducer is executing. ' + 'The reducer has already received the state as an argument. ' + 'Pass it down from the top reducer instead of reading it from the store.');
10901 + }
10902 +
10903 + return currentState;
10904 + }
10905 + /**
10906 + * Adds a change listener. It will be called any time an action is dispatched,
10907 + * and some part of the state tree may potentially have changed. You may then
10908 + * call `getState()` to read the current state tree inside the callback.
10909 + *
10910 + * You may call `dispatch()` from a change listener, with the following
10911 + * caveats:
10912 + *
10913 + * 1. The subscriptions are snapshotted just before every `dispatch()` call.
10914 + * If you subscribe or unsubscribe while the listeners are being invoked, this
10915 + * will not have any effect on the `dispatch()` that is currently in progress.
10916 + * However, the next `dispatch()` call, whether nested or not, will use a more
10917 + * recent snapshot of the subscription list.
10918 + *
10919 + * 2. The listener should not expect to see all state changes, as the state
10920 + * might have been updated multiple times during a nested `dispatch()` before
10921 + * the listener is called. It is, however, guaranteed that all subscribers
10922 + * registered before the `dispatch()` started will be called with the latest
10923 + * state by the time it exits.
10924 + *
10925 + * @param {Function} listener A callback to be invoked on every dispatch.
10926 + * @returns {Function} A function to remove this change listener.
10927 + */
10928 +
10929 +
10930 + function subscribe(listener) {
10931 + if (typeof listener !== 'function') {
10932 + throw new Error( false ? 0 : "Expected the listener to be a function. Instead, received: '" + kindOf(listener) + "'");
10933 + }
10934 +
10935 + if (isDispatching) {
10936 + throw new Error( false ? 0 : 'You may not call store.subscribe() while the reducer is executing. ' + 'If you would like to be notified after the store has been updated, subscribe from a ' + 'component and invoke store.getState() in the callback to access the latest state. ' + 'See https://redux.js.org/api/store#subscribelistener for more details.');
10937 + }
10938 +
10939 + var isSubscribed = true;
10940 + ensureCanMutateNextListeners();
10941 + nextListeners.push(listener);
10942 + return function unsubscribe() {
10943 + if (!isSubscribed) {
10944 + return;
10945 + }
10946 +
10947 + if (isDispatching) {
10948 + throw new Error( false ? 0 : 'You may not unsubscribe from a store listener while the reducer is executing. ' + 'See https://redux.js.org/api/store#subscribelistener for more details.');
10949 + }
10950 +
10951 + isSubscribed = false;
10952 + ensureCanMutateNextListeners();
10953 + var index = nextListeners.indexOf(listener);
10954 + nextListeners.splice(index, 1);
10955 + currentListeners = null;
10956 + };
10957 + }
10958 + /**
10959 + * Dispatches an action. It is the only way to trigger a state change.
10960 + *
10961 + * The `reducer` function, used to create the store, will be called with the
10962 + * current state tree and the given `action`. Its return value will
10963 + * be considered the **next** state of the tree, and the change listeners
10964 + * will be notified.
10965 + *
10966 + * The base implementation only supports plain object actions. If you want to
10967 + * dispatch a Promise, an Observable, a thunk, or something else, you need to
10968 + * wrap your store creating function into the corresponding middleware. For
10969 + * example, see the documentation for the `redux-thunk` package. Even the
10970 + * middleware will eventually dispatch plain object actions using this method.
10971 + *
10972 + * @param {Object} action A plain object representing “what changed”. It is
10973 + * a good idea to keep actions serializable so you can record and replay user
10974 + * sessions, or use the time travelling `redux-devtools`. An action must have
10975 + * a `type` property which may not be `undefined`. It is a good idea to use
10976 + * string constants for action types.
10977 + *
10978 + * @returns {Object} For convenience, the same action object you dispatched.
10979 + *
10980 + * Note that, if you use a custom middleware, it may wrap `dispatch()` to
10981 + * return something else (for example, a Promise you can await).
10982 + */
10983 +
10984 +
10985 + function dispatch(action) {
10986 + if (!isPlainObject(action)) {
10987 + throw new Error( false ? 0 : "Actions must be plain objects. Instead, the actual type was: '" + kindOf(action) + "'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");
10988 + }
10989 +
10990 + if (typeof action.type === 'undefined') {
10991 + throw new Error( false ? 0 : 'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');
10992 + }
10993 +
10994 + if (isDispatching) {
10995 + throw new Error( false ? 0 : 'Reducers may not dispatch actions.');
10996 + }
10997 +
10998 + try {
10999 + isDispatching = true;
11000 + currentState = currentReducer(currentState, action);
11001 + } finally {
11002 + isDispatching = false;
11003 + }
11004 +
11005 + var listeners = currentListeners = nextListeners;
11006 +
11007 + for (var i = 0; i < listeners.length; i++) {
11008 + var listener = listeners[i];
11009 + listener();
11010 + }
11011 +
11012 + return action;
11013 + }
11014 + /**
11015 + * Replaces the reducer currently used by the store to calculate the state.
11016 + *
11017 + * You might need this if your app implements code splitting and you want to
11018 + * load some of the reducers dynamically. You might also need this if you
11019 + * implement a hot reloading mechanism for Redux.
11020 + *
11021 + * @param {Function} nextReducer The reducer for the store to use instead.
11022 + * @returns {void}
11023 + */
11024 +
11025 +
11026 + function replaceReducer(nextReducer) {
11027 + if (typeof nextReducer !== 'function') {
11028 + throw new Error( false ? 0 : "Expected the nextReducer to be a function. Instead, received: '" + kindOf(nextReducer));
11029 + }
11030 +
11031 + currentReducer = nextReducer; // This action has a similiar effect to ActionTypes.INIT.
11032 + // Any reducers that existed in both the new and old rootReducer
11033 + // will receive the previous state. This effectively populates
11034 + // the new state tree with any relevant data from the old one.
11035 +
11036 + dispatch({
11037 + type: ActionTypes.REPLACE
11038 + });
11039 + }
11040 + /**
11041 + * Interoperability point for observable/reactive libraries.
11042 + * @returns {observable} A minimal observable of state changes.
11043 + * For more information, see the observable proposal:
11044 + * https://github.com/tc39/proposal-observable
11045 + */
11046 +
11047 +
11048 + function observable() {
11049 + var _ref;
11050 +
11051 + var outerSubscribe = subscribe;
11052 + return _ref = {
11053 + /**
11054 + * The minimal observable subscription method.
11055 + * @param {Object} observer Any object that can be used as an observer.
11056 + * The observer object should have a `next` method.
11057 + * @returns {subscription} An object with an `unsubscribe` method that can
11058 + * be used to unsubscribe the observable from the store, and prevent further
11059 + * emission of values from the observable.
11060 + */
11061 + subscribe: function subscribe(observer) {
11062 + if (typeof observer !== 'object' || observer === null) {
11063 + throw new Error( false ? 0 : "Expected the observer to be an object. Instead, received: '" + kindOf(observer) + "'");
11064 + }
11065 +
11066 + function observeState() {
11067 + if (observer.next) {
11068 + observer.next(getState());
11069 + }
11070 + }
11071 +
11072 + observeState();
11073 + var unsubscribe = outerSubscribe(observeState);
11074 + return {
11075 + unsubscribe: unsubscribe
11076 + };
11077 + }
11078 + }, _ref[$$observable] = function () {
11079 + return this;
11080 + }, _ref;
11081 + } // When a store is created, an "INIT" action is dispatched so that every
11082 + // reducer returns their initial state. This effectively populates
11083 + // the initial state tree.
11084 +
11085 +
11086 + dispatch({
11087 + type: ActionTypes.INIT
11088 + });
11089 + return _ref2 = {
11090 + dispatch: dispatch,
11091 + subscribe: subscribe,
11092 + getState: getState,
11093 + replaceReducer: replaceReducer
11094 + }, _ref2[$$observable] = observable, _ref2;
11095 +}
11096 +/**
11097 + * Creates a Redux store that holds the state tree.
11098 + *
11099 + * **We recommend using `configureStore` from the
11100 + * `@reduxjs/toolkit` package**, which replaces `createStore`:
11101 + * **https://redux.js.org/introduction/why-rtk-is-redux-today**
11102 + *
11103 + * The only way to change the data in the store is to call `dispatch()` on it.
11104 + *
11105 + * There should only be a single store in your app. To specify how different
11106 + * parts of the state tree respond to actions, you may combine several reducers
11107 + * into a single reducer function by using `combineReducers`.
11108 + *
11109 + * @param {Function} reducer A function that returns the next state tree, given
11110 + * the current state tree and the action to handle.
11111 + *
11112 + * @param {any} [preloadedState] The initial state. You may optionally specify it
11113 + * to hydrate the state from the server in universal apps, or to restore a
11114 + * previously serialized user session.
11115 + * If you use `combineReducers` to produce the root reducer function, this must be
11116 + * an object with the same shape as `combineReducers` keys.
11117 + *
11118 + * @param {Function} [enhancer] The store enhancer. You may optionally specify it
11119 + * to enhance the store with third-party capabilities such as middleware,
11120 + * time travel, persistence, etc. The only store enhancer that ships with Redux
11121 + * is `applyMiddleware()`.
11122 + *
11123 + * @returns {Store} A Redux store that lets you read the state, dispatch actions
11124 + * and subscribe to changes.
11125 + */
11126 +
11127 +var legacy_createStore = createStore;
11128 +
11129 +/**
11130 + * Prints a warning in the console if it exists.
11131 + *
11132 + * @param {String} message The warning message.
11133 + * @returns {void}
11134 + */
11135 +function warning(message) {
11136 + /* eslint-disable no-console */
11137 + if (typeof console !== 'undefined' && typeof console.error === 'function') {
11138 + console.error(message);
11139 + }
11140 + /* eslint-enable no-console */
11141 +
11142 +
11143 + try {
11144 + // This error was thrown as a convenience so that if you enable
11145 + // "break on all exceptions" in your console,
11146 + // it would pause the execution at this line.
11147 + throw new Error(message);
11148 + } catch (e) {} // eslint-disable-line no-empty
11149 +
11150 +}
11151 +
11152 +function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {
11153 + var reducerKeys = Object.keys(reducers);
11154 + var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';
11155 +
11156 + if (reducerKeys.length === 0) {
11157 + return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';
11158 + }
11159 +
11160 + if (!isPlainObject(inputState)) {
11161 + return "The " + argumentName + " has unexpected type of \"" + kindOf(inputState) + "\". Expected argument to be an object with the following " + ("keys: \"" + reducerKeys.join('", "') + "\"");
11162 + }
11163 +
11164 + var unexpectedKeys = Object.keys(inputState).filter(function (key) {
11165 + return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];
11166 + });
11167 + unexpectedKeys.forEach(function (key) {
11168 + unexpectedKeyCache[key] = true;
11169 + });
11170 + if (action && action.type === ActionTypes.REPLACE) return;
11171 +
11172 + if (unexpectedKeys.length > 0) {
11173 + return "Unexpected " + (unexpectedKeys.length > 1 ? 'keys' : 'key') + " " + ("\"" + unexpectedKeys.join('", "') + "\" found in " + argumentName + ". ") + "Expected to find one of the known reducer keys instead: " + ("\"" + reducerKeys.join('", "') + "\". Unexpected keys will be ignored.");
11174 + }
11175 +}
11176 +
11177 +function assertReducerShape(reducers) {
11178 + Object.keys(reducers).forEach(function (key) {
11179 + var reducer = reducers[key];
11180 + var initialState = reducer(undefined, {
11181 + type: ActionTypes.INIT
11182 + });
11183 +
11184 + if (typeof initialState === 'undefined') {
11185 + throw new Error( false ? 0 : "The slice reducer for key \"" + key + "\" returned undefined during initialization. " + "If the state passed to the reducer is undefined, you must " + "explicitly return the initial state. The initial state may " + "not be undefined. If you don't want to set a value for this reducer, " + "you can use null instead of undefined.");
11186 + }
11187 +
11188 + if (typeof reducer(undefined, {
11189 + type: ActionTypes.PROBE_UNKNOWN_ACTION()
11190 + }) === 'undefined') {
11191 + throw new Error( false ? 0 : "The slice reducer for key \"" + key + "\" returned undefined when probed with a random type. " + ("Don't try to handle '" + ActionTypes.INIT + "' or other actions in \"redux/*\" ") + "namespace. They are considered private. Instead, you must return the " + "current state for any unknown actions, unless it is undefined, " + "in which case you must return the initial state, regardless of the " + "action type. The initial state may not be undefined, but can be null.");
11192 + }
11193 + });
11194 +}
11195 +/**
11196 + * Turns an object whose values are different reducer functions, into a single
11197 + * reducer function. It will call every child reducer, and gather their results
11198 + * into a single state object, whose keys correspond to the keys of the passed
11199 + * reducer functions.
11200 + *
11201 + * @param {Object} reducers An object whose values correspond to different
11202 + * reducer functions that need to be combined into one. One handy way to obtain
11203 + * it is to use ES6 `import * as reducers` syntax. The reducers may never return
11204 + * undefined for any action. Instead, they should return their initial state
11205 + * if the state passed to them was undefined, and the current state for any
11206 + * unrecognized action.
11207 + *
11208 + * @returns {Function} A reducer function that invokes every reducer inside the
11209 + * passed object, and builds a state object with the same shape.
11210 + */
11211 +
11212 +
11213 +function combineReducers(reducers) {
11214 + var reducerKeys = Object.keys(reducers);
11215 + var finalReducers = {};
11216 +
11217 + for (var i = 0; i < reducerKeys.length; i++) {
11218 + var key = reducerKeys[i];
11219 +
11220 + if (true) {
11221 + if (typeof reducers[key] === 'undefined') {
11222 + warning("No reducer provided for key \"" + key + "\"");
11223 + }
11224 + }
11225 +
11226 + if (typeof reducers[key] === 'function') {
11227 + finalReducers[key] = reducers[key];
11228 + }
11229 + }
11230 +
11231 + var finalReducerKeys = Object.keys(finalReducers); // This is used to make sure we don't warn about the same
11232 + // keys multiple times.
11233 +
11234 + var unexpectedKeyCache;
11235 +
11236 + if (true) {
11237 + unexpectedKeyCache = {};
11238 + }
11239 +
11240 + var shapeAssertionError;
11241 +
11242 + try {
11243 + assertReducerShape(finalReducers);
11244 + } catch (e) {
11245 + shapeAssertionError = e;
11246 + }
11247 +
11248 + return function combination(state, action) {
11249 + if (state === void 0) {
11250 + state = {};
11251 + }
11252 +
11253 + if (shapeAssertionError) {
11254 + throw shapeAssertionError;
11255 + }
11256 +
11257 + if (true) {
11258 + var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);
11259 +
11260 + if (warningMessage) {
11261 + warning(warningMessage);
11262 + }
11263 + }
11264 +
11265 + var hasChanged = false;
11266 + var nextState = {};
11267 +
11268 + for (var _i = 0; _i < finalReducerKeys.length; _i++) {
11269 + var _key = finalReducerKeys[_i];
11270 + var reducer = finalReducers[_key];
11271 + var previousStateForKey = state[_key];
11272 + var nextStateForKey = reducer(previousStateForKey, action);
11273 +
11274 + if (typeof nextStateForKey === 'undefined') {
11275 + var actionType = action && action.type;
11276 + throw new Error( false ? 0 : "When called with an action of type " + (actionType ? "\"" + String(actionType) + "\"" : '(unknown type)') + ", the slice reducer for key \"" + _key + "\" returned undefined. " + "To ignore an action, you must explicitly return the previous state. " + "If you want this reducer to hold no value, you can return null instead of undefined.");
11277 + }
11278 +
11279 + nextState[_key] = nextStateForKey;
11280 + hasChanged = hasChanged || nextStateForKey !== previousStateForKey;
11281 + }
11282 +
11283 + hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length;
11284 + return hasChanged ? nextState : state;
11285 + };
11286 +}
11287 +
11288 +function bindActionCreator(actionCreator, dispatch) {
11289 + return function () {
11290 + return dispatch(actionCreator.apply(this, arguments));
11291 + };
11292 +}
11293 +/**
11294 + * Turns an object whose values are action creators, into an object with the
11295 + * same keys, but with every function wrapped into a `dispatch` call so they
11296 + * may be invoked directly. This is just a convenience method, as you can call
11297 + * `store.dispatch(MyActionCreators.doSomething())` yourself just fine.
11298 + *
11299 + * For convenience, you can also pass an action creator as the first argument,
11300 + * and get a dispatch wrapped function in return.
11301 + *
11302 + * @param {Function|Object} actionCreators An object whose values are action
11303 + * creator functions. One handy way to obtain it is to use ES6 `import * as`
11304 + * syntax. You may also pass a single function.
11305 + *
11306 + * @param {Function} dispatch The `dispatch` function available on your Redux
11307 + * store.
11308 + *
11309 + * @returns {Function|Object} The object mimicking the original object, but with
11310 + * every action creator wrapped into the `dispatch` call. If you passed a
11311 + * function as `actionCreators`, the return value will also be a single
11312 + * function.
11313 + */
11314 +
11315 +
11316 +function bindActionCreators(actionCreators, dispatch) {
11317 + if (typeof actionCreators === 'function') {
11318 + return bindActionCreator(actionCreators, dispatch);
11319 + }
11320 +
11321 + if (typeof actionCreators !== 'object' || actionCreators === null) {
11322 + throw new Error( false ? 0 : "bindActionCreators expected an object or a function, but instead received: '" + kindOf(actionCreators) + "'. " + "Did you write \"import ActionCreators from\" instead of \"import * as ActionCreators from\"?");
11323 + }
11324 +
11325 + var boundActionCreators = {};
11326 +
11327 + for (var key in actionCreators) {
11328 + var actionCreator = actionCreators[key];
11329 +
11330 + if (typeof actionCreator === 'function') {
11331 + boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);
11332 + }
11333 + }
11334 +
11335 + return boundActionCreators;
11336 +}
11337 +
11338 +/**
11339 + * Composes single-argument functions from right to left. The rightmost
11340 + * function can take multiple arguments as it provides the signature for
11341 + * the resulting composite function.
11342 + *
11343 + * @param {...Function} funcs The functions to compose.
11344 + * @returns {Function} A function obtained by composing the argument functions
11345 + * from right to left. For example, compose(f, g, h) is identical to doing
11346 + * (...args) => f(g(h(...args))).
11347 + */
11348 +function compose() {
11349 + for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {
11350 + funcs[_key] = arguments[_key];
11351 + }
11352 +
11353 + if (funcs.length === 0) {
11354 + return function (arg) {
11355 + return arg;
11356 + };
11357 + }
11358 +
11359 + if (funcs.length === 1) {
11360 + return funcs[0];
11361 + }
11362 +
11363 + return funcs.reduce(function (a, b) {
11364 + return function () {
11365 + return a(b.apply(void 0, arguments));
11366 + };
11367 + });
11368 +}
11369 +
11370 +/**
11371 + * Creates a store enhancer that applies middleware to the dispatch method
11372 + * of the Redux store. This is handy for a variety of tasks, such as expressing
11373 + * asynchronous actions in a concise manner, or logging every action payload.
11374 + *
11375 + * See `redux-thunk` package as an example of the Redux middleware.
11376 + *
11377 + * Because middleware is potentially asynchronous, this should be the first
11378 + * store enhancer in the composition chain.
11379 + *
11380 + * Note that each middleware will be given the `dispatch` and `getState` functions
11381 + * as named arguments.
11382 + *
11383 + * @param {...Function} middlewares The middleware chain to be applied.
11384 + * @returns {Function} A store enhancer applying the middleware.
11385 + */
11386 +
11387 +function applyMiddleware() {
11388 + for (var _len = arguments.length, middlewares = new Array(_len), _key = 0; _key < _len; _key++) {
11389 + middlewares[_key] = arguments[_key];
11390 + }
11391 +
11392 + return function (createStore) {
11393 + return function () {
11394 + var store = createStore.apply(void 0, arguments);
11395 +
11396 + var _dispatch = function dispatch() {
11397 + throw new Error( false ? 0 : 'Dispatching while constructing your middleware is not allowed. ' + 'Other middleware would not be applied to this dispatch.');
11398 + };
11399 +
11400 + var middlewareAPI = {
11401 + getState: store.getState,
11402 + dispatch: function dispatch() {
11403 + return _dispatch.apply(void 0, arguments);
11404 + }
11405 + };
11406 + var chain = middlewares.map(function (middleware) {
11407 + return middleware(middlewareAPI);
11408 + });
11409 + _dispatch = compose.apply(void 0, chain)(store.dispatch);
11410 + return (0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_0__["default"])((0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_0__["default"])({}, store), {}, {
11411 + dispatch: _dispatch
11412 + });
11413 + };
11414 + };
11415 +}
11416 +
11417 +
11418 +
11419 +
11420 +/***/ }),
11421 +
11422 +/***/ "../node_modules/reselect/es/defaultMemoize.js":
11423 +/*!*****************************************************!*\
11424 + !*** ../node_modules/reselect/es/defaultMemoize.js ***!
11425 + \*****************************************************/
11426 +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
11427 +
11428 +"use strict";
11429 +__webpack_require__.r(__webpack_exports__);
11430 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
11431 +/* harmony export */ createCacheKeyComparator: () => (/* binding */ createCacheKeyComparator),
11432 +/* harmony export */ defaultEqualityCheck: () => (/* binding */ defaultEqualityCheck),
11433 +/* harmony export */ defaultMemoize: () => (/* binding */ defaultMemoize)
11434 +/* harmony export */ });
11435 +// Cache implementation based on Erik Rasmussen's `lru-memoize`:
11436 +// https://github.com/erikras/lru-memoize
11437 +var NOT_FOUND = 'NOT_FOUND';
11438 +
11439 +function createSingletonCache(equals) {
11440 + var entry;
11441 + return {
11442 + get: function get(key) {
11443 + if (entry && equals(entry.key, key)) {
11444 + return entry.value;
11445 + }
11446 +
11447 + return NOT_FOUND;
11448 + },
11449 + put: function put(key, value) {
11450 + entry = {
11451 + key: key,
11452 + value: value
11453 + };
11454 + },
11455 + getEntries: function getEntries() {
11456 + return entry ? [entry] : [];
11457 + },
11458 + clear: function clear() {
11459 + entry = undefined;
11460 + }
11461 + };
11462 +}
11463 +
11464 +function createLruCache(maxSize, equals) {
11465 + var entries = [];
11466 +
11467 + function get(key) {
11468 + var cacheIndex = entries.findIndex(function (entry) {
11469 + return equals(key, entry.key);
11470 + }); // We found a cached entry
11471 +
11472 + if (cacheIndex > -1) {
11473 + var entry = entries[cacheIndex]; // Cached entry not at top of cache, move it to the top
11474 +
11475 + if (cacheIndex > 0) {
11476 + entries.splice(cacheIndex, 1);
11477 + entries.unshift(entry);
11478 + }
11479 +
11480 + return entry.value;
11481 + } // No entry found in cache, return sentinel
11482 +
11483 +
11484 + return NOT_FOUND;
11485 + }
11486 +
11487 + function put(key, value) {
11488 + if (get(key) === NOT_FOUND) {
11489 + // TODO Is unshift slow?
11490 + entries.unshift({
11491 + key: key,
11492 + value: value
11493 + });
11494 +
11495 + if (entries.length > maxSize) {
11496 + entries.pop();
11497 + }
11498 + }
11499 + }
11500 +
11501 + function getEntries() {
11502 + return entries;
11503 + }
11504 +
11505 + function clear() {
11506 + entries = [];
11507 + }
11508 +
11509 + return {
11510 + get: get,
11511 + put: put,
11512 + getEntries: getEntries,
11513 + clear: clear
11514 + };
11515 +}
11516 +
11517 +var defaultEqualityCheck = function defaultEqualityCheck(a, b) {
11518 + return a === b;
11519 +};
11520 +function createCacheKeyComparator(equalityCheck) {
11521 + return function areArgumentsShallowlyEqual(prev, next) {
11522 + if (prev === null || next === null || prev.length !== next.length) {
11523 + return false;
11524 + } // Do this in a for loop (and not a `forEach` or an `every`) so we can determine equality as fast as possible.
11525 +
11526 +
11527 + var length = prev.length;
11528 +
11529 + for (var i = 0; i < length; i++) {
11530 + if (!equalityCheck(prev[i], next[i])) {
11531 + return false;
11532 + }
11533 + }
11534 +
11535 + return true;
11536 + };
11537 +}
11538 +// defaultMemoize now supports a configurable cache size with LRU behavior,
11539 +// and optional comparison of the result value with existing values
11540 +function defaultMemoize(func, equalityCheckOrOptions) {
11541 + var providedOptions = typeof equalityCheckOrOptions === 'object' ? equalityCheckOrOptions : {
11542 + equalityCheck: equalityCheckOrOptions
11543 + };
11544 + var _providedOptions$equa = providedOptions.equalityCheck,
11545 + equalityCheck = _providedOptions$equa === void 0 ? defaultEqualityCheck : _providedOptions$equa,
11546 + _providedOptions$maxS = providedOptions.maxSize,
11547 + maxSize = _providedOptions$maxS === void 0 ? 1 : _providedOptions$maxS,
11548 + resultEqualityCheck = providedOptions.resultEqualityCheck;
11549 + var comparator = createCacheKeyComparator(equalityCheck);
11550 + var cache = maxSize === 1 ? createSingletonCache(comparator) : createLruCache(maxSize, comparator); // we reference arguments instead of spreading them for performance reasons
11551 +
11552 + function memoized() {
11553 + var value = cache.get(arguments);
11554 +
11555 + if (value === NOT_FOUND) {
11556 + // @ts-ignore
11557 + value = func.apply(null, arguments);
11558 +
11559 + if (resultEqualityCheck) {
11560 + var entries = cache.getEntries();
11561 + var matchingEntry = entries.find(function (entry) {
11562 + return resultEqualityCheck(entry.value, value);
11563 + });
11564 +
11565 + if (matchingEntry) {
11566 + value = matchingEntry.value;
11567 + }
11568 + }
11569 +
11570 + cache.put(arguments, value);
11571 + }
11572 +
11573 + return value;
11574 + }
11575 +
11576 + memoized.clearCache = function () {
11577 + return cache.clear();
11578 + };
11579 +
11580 + return memoized;
11581 +}
11582 +
11583 +/***/ }),
11584 +
11585 +/***/ "../node_modules/reselect/es/index.js":
11586 +/*!********************************************!*\
11587 + !*** ../node_modules/reselect/es/index.js ***!
11588 + \********************************************/
11589 +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
11590 +
11591 +"use strict";
11592 +__webpack_require__.r(__webpack_exports__);
11593 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
11594 +/* harmony export */ createSelector: () => (/* binding */ createSelector),
11595 +/* harmony export */ createSelectorCreator: () => (/* binding */ createSelectorCreator),
11596 +/* harmony export */ createStructuredSelector: () => (/* binding */ createStructuredSelector),
11597 +/* harmony export */ defaultEqualityCheck: () => (/* reexport safe */ _defaultMemoize__WEBPACK_IMPORTED_MODULE_0__.defaultEqualityCheck),
11598 +/* harmony export */ defaultMemoize: () => (/* reexport safe */ _defaultMemoize__WEBPACK_IMPORTED_MODULE_0__.defaultMemoize)
11599 +/* harmony export */ });
11600 +/* harmony import */ var _defaultMemoize__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defaultMemoize */ "../node_modules/reselect/es/defaultMemoize.js");
11601 +
11602 +
11603 +
11604 +function getDependencies(funcs) {
11605 + var dependencies = Array.isArray(funcs[0]) ? funcs[0] : funcs;
11606 +
11607 + if (!dependencies.every(function (dep) {
11608 + return typeof dep === 'function';
11609 + })) {
11610 + var dependencyTypes = dependencies.map(function (dep) {
11611 + return typeof dep === 'function' ? "function " + (dep.name || 'unnamed') + "()" : typeof dep;
11612 + }).join(', ');
11613 + throw new Error("createSelector expects all input-selectors to be functions, but received the following types: [" + dependencyTypes + "]");
11614 + }
11615 +
11616 + return dependencies;
11617 +}
11618 +
11619 +function createSelectorCreator(memoize) {
11620 + for (var _len = arguments.length, memoizeOptionsFromArgs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
11621 + memoizeOptionsFromArgs[_key - 1] = arguments[_key];
11622 + }
11623 +
11624 + var createSelector = function createSelector() {
11625 + for (var _len2 = arguments.length, funcs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
11626 + funcs[_key2] = arguments[_key2];
11627 + }
11628 +
11629 + var _recomputations = 0;
11630 +
11631 + var _lastResult; // Due to the intricacies of rest params, we can't do an optional arg after `...funcs`.
11632 + // So, start by declaring the default value here.
11633 + // (And yes, the words 'memoize' and 'options' appear too many times in this next sequence.)
11634 +
11635 +
11636 + var directlyPassedOptions = {
11637 + memoizeOptions: undefined
11638 + }; // Normally, the result func or "output selector" is the last arg
11639 +
11640 + var resultFunc = funcs.pop(); // If the result func is actually an _object_, assume it's our options object
11641 +
11642 + if (typeof resultFunc === 'object') {
11643 + directlyPassedOptions = resultFunc; // and pop the real result func off
11644 +
11645 + resultFunc = funcs.pop();
11646 + }
11647 +
11648 + if (typeof resultFunc !== 'function') {
11649 + throw new Error("createSelector expects an output function after the inputs, but received: [" + typeof resultFunc + "]");
11650 + } // Determine which set of options we're using. Prefer options passed directly,
11651 + // but fall back to options given to createSelectorCreator.
11652 +
11653 +
11654 + var _directlyPassedOption = directlyPassedOptions,
11655 + _directlyPassedOption2 = _directlyPassedOption.memoizeOptions,
11656 + memoizeOptions = _directlyPassedOption2 === void 0 ? memoizeOptionsFromArgs : _directlyPassedOption2; // Simplifying assumption: it's unlikely that the first options arg of the provided memoizer
11657 + // is an array. In most libs I've looked at, it's an equality function or options object.
11658 + // Based on that, if `memoizeOptions` _is_ an array, we assume it's a full
11659 + // user-provided array of options. Otherwise, it must be just the _first_ arg, and so
11660 + // we wrap it in an array so we can apply it.
11661 +
11662 + var finalMemoizeOptions = Array.isArray(memoizeOptions) ? memoizeOptions : [memoizeOptions];
11663 + var dependencies = getDependencies(funcs);
11664 + var memoizedResultFunc = memoize.apply(void 0, [function recomputationWrapper() {
11665 + _recomputations++; // apply arguments instead of spreading for performance.
11666 +
11667 + return resultFunc.apply(null, arguments);
11668 + }].concat(finalMemoizeOptions)); // If a selector is called with the exact same arguments we don't need to traverse our dependencies again.
11669 +
11670 + var selector = memoize(function dependenciesChecker() {
11671 + var params = [];
11672 + var length = dependencies.length;
11673 +
11674 + for (var i = 0; i < length; i++) {
11675 + // apply arguments instead of spreading and mutate a local list of params for performance.
11676 + // @ts-ignore
11677 + params.push(dependencies[i].apply(null, arguments));
11678 + } // apply arguments instead of spreading for performance.
11679 +
11680 +
11681 + _lastResult = memoizedResultFunc.apply(null, params);
11682 + return _lastResult;
11683 + });
11684 + Object.assign(selector, {
11685 + resultFunc: resultFunc,
11686 + memoizedResultFunc: memoizedResultFunc,
11687 + dependencies: dependencies,
11688 + lastResult: function lastResult() {
11689 + return _lastResult;
11690 + },
11691 + recomputations: function recomputations() {
11692 + return _recomputations;
11693 + },
11694 + resetRecomputations: function resetRecomputations() {
11695 + return _recomputations = 0;
11696 + }
11697 + });
11698 + return selector;
11699 + }; // @ts-ignore
11700 +
11701 +
11702 + return createSelector;
11703 +}
11704 +var createSelector = /* #__PURE__ */createSelectorCreator(_defaultMemoize__WEBPACK_IMPORTED_MODULE_0__.defaultMemoize);
11705 +// Manual definition of state and output arguments
11706 +var createStructuredSelector = function createStructuredSelector(selectors, selectorCreator) {
11707 + if (selectorCreator === void 0) {
11708 + selectorCreator = createSelector;
11709 + }
11710 +
11711 + if (typeof selectors !== 'object') {
11712 + throw new Error('createStructuredSelector expects first argument to be an object ' + ("where each property is a selector, instead received a " + typeof selectors));
11713 + }
11714 +
11715 + var objectKeys = Object.keys(selectors);
11716 + var resultSelector = selectorCreator( // @ts-ignore
11717 + objectKeys.map(function (key) {
11718 + return selectors[key];
11719 + }), function () {
11720 + for (var _len3 = arguments.length, values = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
11721 + values[_key3] = arguments[_key3];
11722 + }
11723 +
11724 + return values.reduce(function (composition, value, index) {
11725 + composition[objectKeys[index]] = value;
11726 + return composition;
11727 + }, {});
11728 + });
11729 + return resultSelector;
11730 +};
11731 +
11732 +/***/ })
11733 +
11734 +/******/ });
11735 +/************************************************************************/
11736 +/******/ // The module cache
11737 +/******/ var __webpack_module_cache__ = {};
11738 +/******/
11739 +/******/ // The require function
11740 +/******/ function __webpack_require__(moduleId) {
11741 +/******/ // Check if module is in cache
11742 +/******/ var cachedModule = __webpack_module_cache__[moduleId];
11743 +/******/ if (cachedModule !== undefined) {
11744 +/******/ return cachedModule.exports;
11745 +/******/ }
11746 +/******/ // Create a new module (and put it into the cache)
11747 +/******/ var module = __webpack_module_cache__[moduleId] = {
11748 +/******/ // no module.id needed
11749 +/******/ // no module.loaded needed
11750 +/******/ exports: {}
11751 +/******/ };
11752 +/******/
11753 +/******/ // Execute the module function
11754 +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
11755 +/******/
11756 +/******/ // Return the exports of the module
11757 +/******/ return module.exports;
11758 +/******/ }
11759 +/******/
11760 +/************************************************************************/
11761 +/******/ /* webpack/runtime/define property getters */
11762 +/******/ (() => {
11763 +/******/ // define getter functions for harmony exports
11764 +/******/ __webpack_require__.d = (exports, definition) => {
11765 +/******/ for(var key in definition) {
11766 +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
11767 +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
11768 +/******/ }
11769 +/******/ }
11770 +/******/ };
11771 +/******/ })();
11772 +/******/
11773 +/******/ /* webpack/runtime/global */
11774 +/******/ (() => {
11775 +/******/ __webpack_require__.g = (function() {
11776 +/******/ if (typeof globalThis === 'object') return globalThis;
11777 +/******/ try {
11778 +/******/ return this || new Function('return this')();
11779 +/******/ } catch (e) {
11780 +/******/ if (typeof window === 'object') return window;
11781 +/******/ }
11782 +/******/ })();
11783 +/******/ })();
11784 +/******/
11785 +/******/ /* webpack/runtime/hasOwnProperty shorthand */
11786 +/******/ (() => {
11787 +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
11788 +/******/ })();
11789 +/******/
11790 +/******/ /* webpack/runtime/make namespace object */
11791 +/******/ (() => {
11792 +/******/ // define __esModule on exports
11793 +/******/ __webpack_require__.r = (exports) => {
11794 +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
11795 +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
11796 +/******/ }
11797 +/******/ Object.defineProperty(exports, '__esModule', { value: true });
11798 +/******/ };
11799 +/******/ })();
11800 +/******/
11801 +/************************************************************************/
11802 +var __webpack_exports__ = {};
11803 +// This entry needs to be wrapped in an IIFE because it needs to be in strict mode.
11804 +(() => {
11805 +"use strict";
11806 +/*!*********************************************!*\
11807 + !*** ../modules/web-cli/assets/js/index.js ***!
11808 + \*********************************************/
11809 +
11810 +
11811 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
11812 +var _api = _interopRequireDefault(__webpack_require__(/*! ./api */ "../modules/web-cli/assets/js/api.js"));
11813 +window.$e = new _api.default();
11814 +})();
11815 +
11816 +/******/ })()
11817 +;
5912 11818 //# sourceMappingURL=web-cli.js.map