PluginProbe
Elementor Website Builder – more than just a page builder / 3.17.2
Elementor Website Builder – more than just a page builder v3.17.2
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 4.0.7 All 451 releases
elementor / assets / js / web-cli.js

web-cli.js in Elementor Website Builder – more than just a page builder 3.17.2, at assets/js/web-cli.js

11,931 lines 500.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /*! elementor - v3.17.0 - 01-11-2023 */
2 /******/ (() => { // webpackBootstrap
3 /******/ var __webpack_modules__ = ({
4
5 /***/ "../node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js":
6 /*!******************************************************************!*\
7 !*** ../node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js ***!
8 \******************************************************************/
9 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
10
11 "use strict";
12 __webpack_require__.r(__webpack_exports__);
13 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
14 /* harmony export */ EnhancerArray: () => (/* binding */ EnhancerArray),
15 /* harmony export */ MiddlewareArray: () => (/* binding */ MiddlewareArray),
16 /* harmony export */ SHOULD_AUTOBATCH: () => (/* binding */ SHOULD_AUTOBATCH),
17 /* harmony export */ TaskAbortError: () => (/* binding */ TaskAbortError),
18 /* harmony export */ __DO_NOT_USE__ActionTypes: () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_0__.__DO_NOT_USE__ActionTypes),
19 /* harmony export */ addListener: () => (/* binding */ addListener),
20 /* harmony export */ applyMiddleware: () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_0__.applyMiddleware),
21 /* harmony export */ autoBatchEnhancer: () => (/* binding */ autoBatchEnhancer),
22 /* harmony export */ bindActionCreators: () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_0__.bindActionCreators),
23 /* harmony export */ clearAllListeners: () => (/* binding */ clearAllListeners),
24 /* harmony export */ combineReducers: () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_0__.combineReducers),
25 /* harmony export */ compose: () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_0__.compose),
26 /* harmony export */ configureStore: () => (/* binding */ configureStore),
27 /* harmony export */ createAction: () => (/* binding */ createAction),
28 /* harmony export */ createAsyncThunk: () => (/* binding */ createAsyncThunk),
29 /* harmony export */ createDraftSafeSelector: () => (/* binding */ createDraftSafeSelector),
30 /* harmony export */ createEntityAdapter: () => (/* binding */ createEntityAdapter),
31 /* harmony export */ createImmutableStateInvariantMiddleware: () => (/* binding */ createImmutableStateInvariantMiddleware),
32 /* harmony export */ createListenerMiddleware: () => (/* binding */ createListenerMiddleware),
33 /* harmony export */ createNextState: () => (/* reexport safe */ immer__WEBPACK_IMPORTED_MODULE_2__["default"]),
34 /* harmony export */ createReducer: () => (/* binding */ createReducer),
35 /* harmony export */ createSelector: () => (/* reexport safe */ reselect__WEBPACK_IMPORTED_MODULE_1__.createSelector),
36 /* harmony export */ createSerializableStateInvariantMiddleware: () => (/* binding */ createSerializableStateInvariantMiddleware),
37 /* harmony export */ createSlice: () => (/* binding */ createSlice),
38 /* harmony export */ createStore: () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_0__.createStore),
39 /* harmony export */ current: () => (/* reexport safe */ immer__WEBPACK_IMPORTED_MODULE_2__.current),
40 /* harmony export */ findNonSerializableValue: () => (/* binding */ findNonSerializableValue),
41 /* harmony export */ freeze: () => (/* reexport safe */ immer__WEBPACK_IMPORTED_MODULE_2__.freeze),
42 /* harmony export */ getDefaultMiddleware: () => (/* binding */ getDefaultMiddleware),
43 /* harmony export */ getType: () => (/* binding */ getType),
44 /* harmony export */ isAction: () => (/* binding */ isAction),
45 /* harmony export */ isAllOf: () => (/* binding */ isAllOf),
46 /* harmony export */ isAnyOf: () => (/* binding */ isAnyOf),
47 /* harmony export */ isAsyncThunkAction: () => (/* binding */ isAsyncThunkAction),
48 /* harmony export */ isDraft: () => (/* reexport safe */ immer__WEBPACK_IMPORTED_MODULE_2__.isDraft),
49 /* harmony export */ isFluxStandardAction: () => (/* binding */ isFSA),
50 /* harmony export */ isFulfilled: () => (/* binding */ isFulfilled),
51 /* harmony export */ isImmutableDefault: () => (/* binding */ isImmutableDefault),
52 /* harmony export */ isPending: () => (/* binding */ isPending),
53 /* harmony export */ isPlain: () => (/* binding */ isPlain),
54 /* harmony export */ isPlainObject: () => (/* binding */ isPlainObject),
55 /* harmony export */ isRejected: () => (/* binding */ isRejected),
56 /* harmony export */ isRejectedWithValue: () => (/* binding */ isRejectedWithValue),
57 /* harmony export */ legacy_createStore: () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_0__.legacy_createStore),
58 /* harmony export */ miniSerializeError: () => (/* binding */ miniSerializeError),
59 /* harmony export */ nanoid: () => (/* binding */ nanoid),
60 /* harmony export */ original: () => (/* reexport safe */ immer__WEBPACK_IMPORTED_MODULE_2__.original),
61 /* harmony export */ prepareAutoBatched: () => (/* binding */ prepareAutoBatched),
62 /* harmony export */ removeListener: () => (/* binding */ removeListener),
63 /* harmony export */ unwrapResult: () => (/* binding */ unwrapResult)
64 /* harmony export */ });
65 /* harmony import */ var immer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! immer */ "../node_modules/@reduxjs/toolkit/node_modules/immer/dist/immer.esm.mjs");
66 /* harmony import */ var redux__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! redux */ "../node_modules/redux/es/redux.js");
67 /* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! reselect */ "../node_modules/reselect/es/index.js");
68 /* harmony import */ var redux_thunk__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! redux-thunk */ "../node_modules/redux-thunk/es/index.js");
69 var __extends = (undefined && undefined.__extends) || (function () {
70 var extendStatics = function (d, b) {
71 extendStatics = Object.setPrototypeOf ||
72 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
73 function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
74 return extendStatics(d, b);
75 };
76 return function (d, b) {
77 if (typeof b !== "function" && b !== null)
78 throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
79 extendStatics(d, b);
80 function __() { this.constructor = d; }
81 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
82 };
83 })();
84 var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
85 var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
86 return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
87 function verb(n) { return function (v) { return step([n, v]); }; }
88 function step(op) {
89 if (f) throw new TypeError("Generator is already executing.");
90 while (_) try {
91 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;
92 if (y = 0, t) op = [op[0] & 2, t.value];
93 switch (op[0]) {
94 case 0: case 1: t = op; break;
95 case 4: _.label++; return { value: op[1], done: false };
96 case 5: _.label++; y = op[1]; op = [0]; continue;
97 case 7: op = _.ops.pop(); _.trys.pop(); continue;
98 default:
99 if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
100 if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
101 if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
102 if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
103 if (t[2]) _.ops.pop();
104 _.trys.pop(); continue;
105 }
106 op = body.call(thisArg, _);
107 } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
108 if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
109 }
110 };
111 var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from) {
112 for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
113 to[j] = from[i];
114 return to;
115 };
116 var __defProp = Object.defineProperty;
117 var __defProps = Object.defineProperties;
118 var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
119 var __getOwnPropSymbols = Object.getOwnPropertySymbols;
120 var __hasOwnProp = Object.prototype.hasOwnProperty;
121 var __propIsEnum = Object.prototype.propertyIsEnumerable;
122 var __defNormalProp = function (obj, key, value) { return key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value: value }) : obj[key] = value; };
123 var __spreadValues = function (a, b) {
124 for (var prop in b || (b = {}))
125 if (__hasOwnProp.call(b, prop))
126 __defNormalProp(a, prop, b[prop]);
127 if (__getOwnPropSymbols)
128 for (var _i = 0, _c = __getOwnPropSymbols(b); _i < _c.length; _i++) {
129 var prop = _c[_i];
130 if (__propIsEnum.call(b, prop))
131 __defNormalProp(a, prop, b[prop]);
132 }
133 return a;
134 };
135 var __spreadProps = function (a, b) { return __defProps(a, __getOwnPropDescs(b)); };
136 var __async = function (__this, __arguments, generator) {
137 return new Promise(function (resolve, reject) {
138 var fulfilled = function (value) {
139 try {
140 step(generator.next(value));
141 }
142 catch (e) {
143 reject(e);
144 }
145 };
146 var rejected = function (value) {
147 try {
148 step(generator.throw(value));
149 }
150 catch (e) {
151 reject(e);
152 }
153 };
154 var step = function (x) { return x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); };
155 step((generator = generator.apply(__this, __arguments)).next());
156 });
157 };
158 // src/index.ts
159
160
161
162
163 // src/createDraftSafeSelector.ts
164
165
166 var createDraftSafeSelector = function () {
167 var args = [];
168 for (var _i = 0; _i < arguments.length; _i++) {
169 args[_i] = arguments[_i];
170 }
171 var selector = reselect__WEBPACK_IMPORTED_MODULE_1__.createSelector.apply(void 0, args);
172 var wrappedSelector = function (value) {
173 var rest = [];
174 for (var _i = 1; _i < arguments.length; _i++) {
175 rest[_i - 1] = arguments[_i];
176 }
177 return selector.apply(void 0, __spreadArray([(0,immer__WEBPACK_IMPORTED_MODULE_2__.isDraft)(value) ? (0,immer__WEBPACK_IMPORTED_MODULE_2__.current)(value) : value], rest));
178 };
179 return wrappedSelector;
180 };
181 // src/configureStore.ts
182
183 // src/devtoolsExtension.ts
184
185 var composeWithDevTools = typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ : function () {
186 if (arguments.length === 0)
187 return void 0;
188 if (typeof arguments[0] === "object")
189 return redux__WEBPACK_IMPORTED_MODULE_0__.compose;
190 return redux__WEBPACK_IMPORTED_MODULE_0__.compose.apply(null, arguments);
191 };
192 var devToolsEnhancer = typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__ : function () {
193 return function (noop2) {
194 return noop2;
195 };
196 };
197 // src/isPlainObject.ts
198 function isPlainObject(value) {
199 if (typeof value !== "object" || value === null)
200 return false;
201 var proto = Object.getPrototypeOf(value);
202 if (proto === null)
203 return true;
204 var baseProto = proto;
205 while (Object.getPrototypeOf(baseProto) !== null) {
206 baseProto = Object.getPrototypeOf(baseProto);
207 }
208 return proto === baseProto;
209 }
210 // src/getDefaultMiddleware.ts
211
212 // src/utils.ts
213
214 function getTimeMeasureUtils(maxDelay, fnName) {
215 var elapsed = 0;
216 return {
217 measureTime: function (fn) {
218 var started = Date.now();
219 try {
220 return fn();
221 }
222 finally {
223 var finished = Date.now();
224 elapsed += finished - started;
225 }
226 },
227 warnIfExceeded: function () {
228 if (elapsed > maxDelay) {
229 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.");
230 }
231 }
232 };
233 }
234 var MiddlewareArray = /** @class */ (function (_super) {
235 __extends(MiddlewareArray, _super);
236 function MiddlewareArray() {
237 var args = [];
238 for (var _i = 0; _i < arguments.length; _i++) {
239 args[_i] = arguments[_i];
240 }
241 var _this = _super.apply(this, args) || this;
242 Object.setPrototypeOf(_this, MiddlewareArray.prototype);
243 return _this;
244 }
245 Object.defineProperty(MiddlewareArray, Symbol.species, {
246 get: function () {
247 return MiddlewareArray;
248 },
249 enumerable: false,
250 configurable: true
251 });
252 MiddlewareArray.prototype.concat = function () {
253 var arr = [];
254 for (var _i = 0; _i < arguments.length; _i++) {
255 arr[_i] = arguments[_i];
256 }
257 return _super.prototype.concat.apply(this, arr);
258 };
259 MiddlewareArray.prototype.prepend = function () {
260 var arr = [];
261 for (var _i = 0; _i < arguments.length; _i++) {
262 arr[_i] = arguments[_i];
263 }
264 if (arr.length === 1 && Array.isArray(arr[0])) {
265 return new (MiddlewareArray.bind.apply(MiddlewareArray, __spreadArray([void 0], arr[0].concat(this))))();
266 }
267 return new (MiddlewareArray.bind.apply(MiddlewareArray, __spreadArray([void 0], arr.concat(this))))();
268 };
269 return MiddlewareArray;
270 }(Array));
271 var EnhancerArray = /** @class */ (function (_super) {
272 __extends(EnhancerArray, _super);
273 function EnhancerArray() {
274 var args = [];
275 for (var _i = 0; _i < arguments.length; _i++) {
276 args[_i] = arguments[_i];
277 }
278 var _this = _super.apply(this, args) || this;
279 Object.setPrototypeOf(_this, EnhancerArray.prototype);
280 return _this;
281 }
282 Object.defineProperty(EnhancerArray, Symbol.species, {
283 get: function () {
284 return EnhancerArray;
285 },
286 enumerable: false,
287 configurable: true
288 });
289 EnhancerArray.prototype.concat = function () {
290 var arr = [];
291 for (var _i = 0; _i < arguments.length; _i++) {
292 arr[_i] = arguments[_i];
293 }
294 return _super.prototype.concat.apply(this, arr);
295 };
296 EnhancerArray.prototype.prepend = function () {
297 var arr = [];
298 for (var _i = 0; _i < arguments.length; _i++) {
299 arr[_i] = arguments[_i];
300 }
301 if (arr.length === 1 && Array.isArray(arr[0])) {
302 return new (EnhancerArray.bind.apply(EnhancerArray, __spreadArray([void 0], arr[0].concat(this))))();
303 }
304 return new (EnhancerArray.bind.apply(EnhancerArray, __spreadArray([void 0], arr.concat(this))))();
305 };
306 return EnhancerArray;
307 }(Array));
308 function freezeDraftable(val) {
309 return (0,immer__WEBPACK_IMPORTED_MODULE_2__.isDraftable)(val) ? (0,immer__WEBPACK_IMPORTED_MODULE_2__["default"])(val, function () {
310 }) : val;
311 }
312 // src/immutableStateInvariantMiddleware.ts
313 var isProduction = "development" === "production";
314 var prefix = "Invariant failed";
315 function invariant(condition, message) {
316 if (condition) {
317 return;
318 }
319 if (isProduction) {
320 throw new Error(prefix);
321 }
322 throw new Error(prefix + ": " + (message || ""));
323 }
324 function stringify(obj, serializer, indent, decycler) {
325 return JSON.stringify(obj, getSerialize(serializer, decycler), indent);
326 }
327 function getSerialize(serializer, decycler) {
328 var stack = [], keys = [];
329 if (!decycler)
330 decycler = function (_, value) {
331 if (stack[0] === value)
332 return "[Circular ~]";
333 return "[Circular ~." + keys.slice(0, stack.indexOf(value)).join(".") + "]";
334 };
335 return function (key, value) {
336 if (stack.length > 0) {
337 var thisPos = stack.indexOf(this);
338 ~thisPos ? stack.splice(thisPos + 1) : stack.push(this);
339 ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key);
340 if (~stack.indexOf(value))
341 value = decycler.call(this, key, value);
342 }
343 else
344 stack.push(value);
345 return serializer == null ? value : serializer.call(this, key, value);
346 };
347 }
348 function isImmutableDefault(value) {
349 return typeof value !== "object" || value == null || Object.isFrozen(value);
350 }
351 function trackForMutations(isImmutable, ignorePaths, obj) {
352 var trackedProperties = trackProperties(isImmutable, ignorePaths, obj);
353 return {
354 detectMutations: function () {
355 return detectMutations(isImmutable, ignorePaths, trackedProperties, obj);
356 }
357 };
358 }
359 function trackProperties(isImmutable, ignorePaths, obj, path) {
360 if (ignorePaths === void 0) { ignorePaths = []; }
361 if (path === void 0) { path = ""; }
362 var tracked = { value: obj };
363 if (!isImmutable(obj)) {
364 tracked.children = {};
365 for (var key in obj) {
366 var childPath = path ? path + "." + key : key;
367 if (ignorePaths.length && ignorePaths.indexOf(childPath) !== -1) {
368 continue;
369 }
370 tracked.children[key] = trackProperties(isImmutable, ignorePaths, obj[key], childPath);
371 }
372 }
373 return tracked;
374 }
375 function detectMutations(isImmutable, ignoredPaths, trackedProperty, obj, sameParentRef, path) {
376 if (ignoredPaths === void 0) { ignoredPaths = []; }
377 if (sameParentRef === void 0) { sameParentRef = false; }
378 if (path === void 0) { path = ""; }
379 var prevObj = trackedProperty ? trackedProperty.value : void 0;
380 var sameRef = prevObj === obj;
381 if (sameParentRef && !sameRef && !Number.isNaN(obj)) {
382 return { wasMutated: true, path: path };
383 }
384 if (isImmutable(prevObj) || isImmutable(obj)) {
385 return { wasMutated: false };
386 }
387 var keysToDetect = {};
388 for (var key in trackedProperty.children) {
389 keysToDetect[key] = true;
390 }
391 for (var key in obj) {
392 keysToDetect[key] = true;
393 }
394 var hasIgnoredPaths = ignoredPaths.length > 0;
395 var _loop_1 = function (key) {
396 var nestedPath = path ? path + "." + key : key;
397 if (hasIgnoredPaths) {
398 var hasMatches = ignoredPaths.some(function (ignored) {
399 if (ignored instanceof RegExp) {
400 return ignored.test(nestedPath);
401 }
402 return nestedPath === ignored;
403 });
404 if (hasMatches) {
405 return "continue";
406 }
407 }
408 var result = detectMutations(isImmutable, ignoredPaths, trackedProperty.children[key], obj[key], sameRef, nestedPath);
409 if (result.wasMutated) {
410 return { value: result };
411 }
412 };
413 for (var key in keysToDetect) {
414 var state_1 = _loop_1(key);
415 if (typeof state_1 === "object")
416 return state_1.value;
417 }
418 return { wasMutated: false };
419 }
420 function createImmutableStateInvariantMiddleware(options) {
421 if (options === void 0) { options = {}; }
422 if (false) {}
423 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;
424 ignoredPaths = ignoredPaths || ignore;
425 var track = trackForMutations.bind(null, isImmutable, ignoredPaths);
426 return function (_c) {
427 var getState = _c.getState;
428 var state = getState();
429 var tracker = track(state);
430 var result;
431 return function (next) { return function (action) {
432 var measureUtils = getTimeMeasureUtils(warnAfter, "ImmutableStateInvariantMiddleware");
433 measureUtils.measureTime(function () {
434 state = getState();
435 result = tracker.detectMutations();
436 tracker = track(state);
437 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)");
438 });
439 var dispatchedAction = next(action);
440 measureUtils.measureTime(function () {
441 state = getState();
442 result = tracker.detectMutations();
443 tracker = track(state);
444 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)");
445 });
446 measureUtils.warnIfExceeded();
447 return dispatchedAction;
448 }; };
449 };
450 }
451 // src/serializableStateInvariantMiddleware.ts
452 function isPlain(val) {
453 var type = typeof val;
454 return val == null || type === "string" || type === "boolean" || type === "number" || Array.isArray(val) || isPlainObject(val);
455 }
456 function findNonSerializableValue(value, path, isSerializable, getEntries, ignoredPaths, cache) {
457 if (path === void 0) { path = ""; }
458 if (isSerializable === void 0) { isSerializable = isPlain; }
459 if (ignoredPaths === void 0) { ignoredPaths = []; }
460 var foundNestedSerializable;
461 if (!isSerializable(value)) {
462 return {
463 keyPath: path || "<root>",
464 value: value
465 };
466 }
467 if (typeof value !== "object" || value === null) {
468 return false;
469 }
470 if (cache == null ? void 0 : cache.has(value))
471 return false;
472 var entries = getEntries != null ? getEntries(value) : Object.entries(value);
473 var hasIgnoredPaths = ignoredPaths.length > 0;
474 var _loop_2 = function (key, nestedValue) {
475 var nestedPath = path ? path + "." + key : key;
476 if (hasIgnoredPaths) {
477 var hasMatches = ignoredPaths.some(function (ignored) {
478 if (ignored instanceof RegExp) {
479 return ignored.test(nestedPath);
480 }
481 return nestedPath === ignored;
482 });
483 if (hasMatches) {
484 return "continue";
485 }
486 }
487 if (!isSerializable(nestedValue)) {
488 return { value: {
489 keyPath: nestedPath,
490 value: nestedValue
491 } };
492 }
493 if (typeof nestedValue === "object") {
494 foundNestedSerializable = findNonSerializableValue(nestedValue, nestedPath, isSerializable, getEntries, ignoredPaths, cache);
495 if (foundNestedSerializable) {
496 return { value: foundNestedSerializable };
497 }
498 }
499 };
500 for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {
501 var _c = entries_1[_i], key = _c[0], nestedValue = _c[1];
502 var state_2 = _loop_2(key, nestedValue);
503 if (typeof state_2 === "object")
504 return state_2.value;
505 }
506 if (cache && isNestedFrozen(value))
507 cache.add(value);
508 return false;
509 }
510 function isNestedFrozen(value) {
511 if (!Object.isFrozen(value))
512 return false;
513 for (var _i = 0, _c = Object.values(value); _i < _c.length; _i++) {
514 var nestedValue = _c[_i];
515 if (typeof nestedValue !== "object" || nestedValue === null)
516 continue;
517 if (!isNestedFrozen(nestedValue))
518 return false;
519 }
520 return true;
521 }
522 function createSerializableStateInvariantMiddleware(options) {
523 if (options === void 0) { options = {}; }
524 if (false) {}
525 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;
526 var cache = !disableCache && WeakSet ? new WeakSet() : void 0;
527 return function (storeAPI) { return function (next) { return function (action) {
528 var result = next(action);
529 var measureUtils = getTimeMeasureUtils(warnAfter, "SerializableStateInvariantMiddleware");
530 if (!ignoreActions && !(ignoredActions.length && ignoredActions.indexOf(action.type) !== -1)) {
531 measureUtils.measureTime(function () {
532 var foundActionNonSerializableValue = findNonSerializableValue(action, "", isSerializable, getEntries, ignoredActionPaths, cache);
533 if (foundActionNonSerializableValue) {
534 var keyPath = foundActionNonSerializableValue.keyPath, value = foundActionNonSerializableValue.value;
535 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)");
536 }
537 });
538 }
539 if (!ignoreState) {
540 measureUtils.measureTime(function () {
541 var state = storeAPI.getState();
542 var foundStateNonSerializableValue = findNonSerializableValue(state, "", isSerializable, getEntries, ignoredPaths, cache);
543 if (foundStateNonSerializableValue) {
544 var keyPath = foundStateNonSerializableValue.keyPath, value = foundStateNonSerializableValue.value;
545 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)");
546 }
547 });
548 measureUtils.warnIfExceeded();
549 }
550 return result;
551 }; }; };
552 }
553 // src/getDefaultMiddleware.ts
554 function isBoolean(x) {
555 return typeof x === "boolean";
556 }
557 function curryGetDefaultMiddleware() {
558 return function curriedGetDefaultMiddleware(options) {
559 return getDefaultMiddleware(options);
560 };
561 }
562 function getDefaultMiddleware(options) {
563 if (options === void 0) { options = {}; }
564 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;
565 var middlewareArray = new MiddlewareArray();
566 if (thunk) {
567 if (isBoolean(thunk)) {
568 middlewareArray.push(redux_thunk__WEBPACK_IMPORTED_MODULE_3__["default"]);
569 }
570 else {
571 middlewareArray.push(redux_thunk__WEBPACK_IMPORTED_MODULE_3__["default"].withExtraArgument(thunk.extraArgument));
572 }
573 }
574 if (true) {
575 if (immutableCheck) {
576 var immutableOptions = {};
577 if (!isBoolean(immutableCheck)) {
578 immutableOptions = immutableCheck;
579 }
580 middlewareArray.unshift(createImmutableStateInvariantMiddleware(immutableOptions));
581 }
582 if (serializableCheck) {
583 var serializableOptions = {};
584 if (!isBoolean(serializableCheck)) {
585 serializableOptions = serializableCheck;
586 }
587 middlewareArray.push(createSerializableStateInvariantMiddleware(serializableOptions));
588 }
589 }
590 return middlewareArray;
591 }
592 // src/configureStore.ts
593 var IS_PRODUCTION = "development" === "production";
594 function configureStore(options) {
595 var curriedGetDefaultMiddleware = curryGetDefaultMiddleware();
596 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;
597 var rootReducer;
598 if (typeof reducer === "function") {
599 rootReducer = reducer;
600 }
601 else if (isPlainObject(reducer)) {
602 rootReducer = (0,redux__WEBPACK_IMPORTED_MODULE_0__.combineReducers)(reducer);
603 }
604 else {
605 throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');
606 }
607 var finalMiddleware = middleware;
608 if (typeof finalMiddleware === "function") {
609 finalMiddleware = finalMiddleware(curriedGetDefaultMiddleware);
610 if (!IS_PRODUCTION && !Array.isArray(finalMiddleware)) {
611 throw new Error("when using a middleware builder function, an array of middleware must be returned");
612 }
613 }
614 if (!IS_PRODUCTION && finalMiddleware.some(function (item) { return typeof item !== "function"; })) {
615 throw new Error("each middleware provided to configureStore must be a function");
616 }
617 var middlewareEnhancer = redux__WEBPACK_IMPORTED_MODULE_0__.applyMiddleware.apply(void 0, finalMiddleware);
618 var finalCompose = redux__WEBPACK_IMPORTED_MODULE_0__.compose;
619 if (devTools) {
620 finalCompose = composeWithDevTools(__spreadValues({
621 trace: !IS_PRODUCTION
622 }, typeof devTools === "object" && devTools));
623 }
624 var defaultEnhancers = new EnhancerArray(middlewareEnhancer);
625 var storeEnhancers = defaultEnhancers;
626 if (Array.isArray(enhancers)) {
627 storeEnhancers = __spreadArray([middlewareEnhancer], enhancers);
628 }
629 else if (typeof enhancers === "function") {
630 storeEnhancers = enhancers(defaultEnhancers);
631 }
632 var composedEnhancer = finalCompose.apply(void 0, storeEnhancers);
633 return (0,redux__WEBPACK_IMPORTED_MODULE_0__.createStore)(rootReducer, preloadedState, composedEnhancer);
634 }
635 // src/createAction.ts
636 function createAction(type, prepareAction) {
637 function actionCreator() {
638 var args = [];
639 for (var _i = 0; _i < arguments.length; _i++) {
640 args[_i] = arguments[_i];
641 }
642 if (prepareAction) {
643 var prepared = prepareAction.apply(void 0, args);
644 if (!prepared) {
645 throw new Error("prepareAction did not return an object");
646 }
647 return __spreadValues(__spreadValues({
648 type: type,
649 payload: prepared.payload
650 }, "meta" in prepared && { meta: prepared.meta }), "error" in prepared && { error: prepared.error });
651 }
652 return { type: type, payload: args[0] };
653 }
654 actionCreator.toString = function () { return "" + type; };
655 actionCreator.type = type;
656 actionCreator.match = function (action) { return action.type === type; };
657 return actionCreator;
658 }
659 function isAction(action) {
660 return isPlainObject(action) && "type" in action;
661 }
662 function isFSA(action) {
663 return isAction(action) && typeof action.type === "string" && Object.keys(action).every(isValidKey);
664 }
665 function isValidKey(key) {
666 return ["type", "payload", "error", "meta"].indexOf(key) > -1;
667 }
668 function getType(actionCreator) {
669 return "" + actionCreator;
670 }
671 // src/createReducer.ts
672
673 // src/mapBuilders.ts
674 function executeReducerBuilderCallback(builderCallback) {
675 var actionsMap = {};
676 var actionMatchers = [];
677 var defaultCaseReducer;
678 var builder = {
679 addCase: function (typeOrActionCreator, reducer) {
680 if (true) {
681 if (actionMatchers.length > 0) {
682 throw new Error("`builder.addCase` should only be called before calling `builder.addMatcher`");
683 }
684 if (defaultCaseReducer) {
685 throw new Error("`builder.addCase` should only be called before calling `builder.addDefaultCase`");
686 }
687 }
688 var type = typeof typeOrActionCreator === "string" ? typeOrActionCreator : typeOrActionCreator.type;
689 if (type in actionsMap) {
690 throw new Error("addCase cannot be called with two reducers for the same action type");
691 }
692 actionsMap[type] = reducer;
693 return builder;
694 },
695 addMatcher: function (matcher, reducer) {
696 if (true) {
697 if (defaultCaseReducer) {
698 throw new Error("`builder.addMatcher` should only be called before calling `builder.addDefaultCase`");
699 }
700 }
701 actionMatchers.push({ matcher: matcher, reducer: reducer });
702 return builder;
703 },
704 addDefaultCase: function (reducer) {
705 if (true) {
706 if (defaultCaseReducer) {
707 throw new Error("`builder.addDefaultCase` can only be called once");
708 }
709 }
710 defaultCaseReducer = reducer;
711 return builder;
712 }
713 };
714 builderCallback(builder);
715 return [actionsMap, actionMatchers, defaultCaseReducer];
716 }
717 // src/createReducer.ts
718 function isStateFunction(x) {
719 return typeof x === "function";
720 }
721 var hasWarnedAboutObjectNotation = false;
722 function createReducer(initialState, mapOrBuilderCallback, actionMatchers, defaultCaseReducer) {
723 if (actionMatchers === void 0) { actionMatchers = []; }
724 if (true) {
725 if (typeof mapOrBuilderCallback === "object") {
726 if (!hasWarnedAboutObjectNotation) {
727 hasWarnedAboutObjectNotation = true;
728 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");
729 }
730 }
731 }
732 var _c = typeof mapOrBuilderCallback === "function" ? executeReducerBuilderCallback(mapOrBuilderCallback) : [mapOrBuilderCallback, actionMatchers, defaultCaseReducer], actionsMap = _c[0], finalActionMatchers = _c[1], finalDefaultCaseReducer = _c[2];
733 var getInitialState;
734 if (isStateFunction(initialState)) {
735 getInitialState = function () { return freezeDraftable(initialState()); };
736 }
737 else {
738 var frozenInitialState_1 = freezeDraftable(initialState);
739 getInitialState = function () { return frozenInitialState_1; };
740 }
741 function reducer(state, action) {
742 if (state === void 0) { state = getInitialState(); }
743 var caseReducers = __spreadArray([
744 actionsMap[action.type]
745 ], finalActionMatchers.filter(function (_c) {
746 var matcher = _c.matcher;
747 return matcher(action);
748 }).map(function (_c) {
749 var reducer2 = _c.reducer;
750 return reducer2;
751 }));
752 if (caseReducers.filter(function (cr) { return !!cr; }).length === 0) {
753 caseReducers = [finalDefaultCaseReducer];
754 }
755 return caseReducers.reduce(function (previousState, caseReducer) {
756 if (caseReducer) {
757 if ((0,immer__WEBPACK_IMPORTED_MODULE_2__.isDraft)(previousState)) {
758 var draft = previousState;
759 var result = caseReducer(draft, action);
760 if (result === void 0) {
761 return previousState;
762 }
763 return result;
764 }
765 else if (!(0,immer__WEBPACK_IMPORTED_MODULE_2__.isDraftable)(previousState)) {
766 var result = caseReducer(previousState, action);
767 if (result === void 0) {
768 if (previousState === null) {
769 return previousState;
770 }
771 throw Error("A case reducer on a non-draftable value must not return undefined");
772 }
773 return result;
774 }
775 else {
776 return (0,immer__WEBPACK_IMPORTED_MODULE_2__["default"])(previousState, function (draft) {
777 return caseReducer(draft, action);
778 });
779 }
780 }
781 return previousState;
782 }, state);
783 }
784 reducer.getInitialState = getInitialState;
785 return reducer;
786 }
787 // src/createSlice.ts
788 var hasWarnedAboutObjectNotation2 = false;
789 function getType2(slice, actionKey) {
790 return slice + "/" + actionKey;
791 }
792 function createSlice(options) {
793 var name = options.name;
794 if (!name) {
795 throw new Error("`name` is a required option for createSlice");
796 }
797 if (typeof process !== "undefined" && "development" === "development") {
798 if (options.initialState === void 0) {
799 console.error("You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`");
800 }
801 }
802 var initialState = typeof options.initialState == "function" ? options.initialState : freezeDraftable(options.initialState);
803 var reducers = options.reducers || {};
804 var reducerNames = Object.keys(reducers);
805 var sliceCaseReducersByName = {};
806 var sliceCaseReducersByType = {};
807 var actionCreators = {};
808 reducerNames.forEach(function (reducerName) {
809 var maybeReducerWithPrepare = reducers[reducerName];
810 var type = getType2(name, reducerName);
811 var caseReducer;
812 var prepareCallback;
813 if ("reducer" in maybeReducerWithPrepare) {
814 caseReducer = maybeReducerWithPrepare.reducer;
815 prepareCallback = maybeReducerWithPrepare.prepare;
816 }
817 else {
818 caseReducer = maybeReducerWithPrepare;
819 }
820 sliceCaseReducersByName[reducerName] = caseReducer;
821 sliceCaseReducersByType[type] = caseReducer;
822 actionCreators[reducerName] = prepareCallback ? createAction(type, prepareCallback) : createAction(type);
823 });
824 function buildReducer() {
825 if (true) {
826 if (typeof options.extraReducers === "object") {
827 if (!hasWarnedAboutObjectNotation2) {
828 hasWarnedAboutObjectNotation2 = true;
829 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");
830 }
831 }
832 }
833 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;
834 var finalCaseReducers = __spreadValues(__spreadValues({}, extraReducers), sliceCaseReducersByType);
835 return createReducer(initialState, function (builder) {
836 for (var key in finalCaseReducers) {
837 builder.addCase(key, finalCaseReducers[key]);
838 }
839 for (var _i = 0, actionMatchers_1 = actionMatchers; _i < actionMatchers_1.length; _i++) {
840 var m = actionMatchers_1[_i];
841 builder.addMatcher(m.matcher, m.reducer);
842 }
843 if (defaultCaseReducer) {
844 builder.addDefaultCase(defaultCaseReducer);
845 }
846 });
847 }
848 var _reducer;
849 return {
850 name: name,
851 reducer: function (state, action) {
852 if (!_reducer)
853 _reducer = buildReducer();
854 return _reducer(state, action);
855 },
856 actions: actionCreators,
857 caseReducers: sliceCaseReducersByName,
858 getInitialState: function () {
859 if (!_reducer)
860 _reducer = buildReducer();
861 return _reducer.getInitialState();
862 }
863 };
864 }
865 // src/entities/entity_state.ts
866 function getInitialEntityState() {
867 return {
868 ids: [],
869 entities: {}
870 };
871 }
872 function createInitialStateFactory() {
873 function getInitialState(additionalState) {
874 if (additionalState === void 0) { additionalState = {}; }
875 return Object.assign(getInitialEntityState(), additionalState);
876 }
877 return { getInitialState: getInitialState };
878 }
879 // src/entities/state_selectors.ts
880 function createSelectorsFactory() {
881 function getSelectors(selectState) {
882 var selectIds = function (state) { return state.ids; };
883 var selectEntities = function (state) { return state.entities; };
884 var selectAll = createDraftSafeSelector(selectIds, selectEntities, function (ids, entities) { return ids.map(function (id) { return entities[id]; }); });
885 var selectId = function (_, id) { return id; };
886 var selectById = function (entities, id) { return entities[id]; };
887 var selectTotal = createDraftSafeSelector(selectIds, function (ids) { return ids.length; });
888 if (!selectState) {
889 return {
890 selectIds: selectIds,
891 selectEntities: selectEntities,
892 selectAll: selectAll,
893 selectTotal: selectTotal,
894 selectById: createDraftSafeSelector(selectEntities, selectId, selectById)
895 };
896 }
897 var selectGlobalizedEntities = createDraftSafeSelector(selectState, selectEntities);
898 return {
899 selectIds: createDraftSafeSelector(selectState, selectIds),
900 selectEntities: selectGlobalizedEntities,
901 selectAll: createDraftSafeSelector(selectState, selectAll),
902 selectTotal: createDraftSafeSelector(selectState, selectTotal),
903 selectById: createDraftSafeSelector(selectGlobalizedEntities, selectId, selectById)
904 };
905 }
906 return { getSelectors: getSelectors };
907 }
908 // src/entities/state_adapter.ts
909
910 function createSingleArgumentStateOperator(mutator) {
911 var operator = createStateOperator(function (_, state) { return mutator(state); });
912 return function operation(state) {
913 return operator(state, void 0);
914 };
915 }
916 function createStateOperator(mutator) {
917 return function operation(state, arg) {
918 function isPayloadActionArgument(arg2) {
919 return isFSA(arg2);
920 }
921 var runMutator = function (draft) {
922 if (isPayloadActionArgument(arg)) {
923 mutator(arg.payload, draft);
924 }
925 else {
926 mutator(arg, draft);
927 }
928 };
929 if ((0,immer__WEBPACK_IMPORTED_MODULE_2__.isDraft)(state)) {
930 runMutator(state);
931 return state;
932 }
933 else {
934 return (0,immer__WEBPACK_IMPORTED_MODULE_2__["default"])(state, runMutator);
935 }
936 };
937 }
938 // src/entities/utils.ts
939 function selectIdValue(entity, selectId) {
940 var key = selectId(entity);
941 if ( true && key === void 0) {
942 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());
943 }
944 return key;
945 }
946 function ensureEntitiesArray(entities) {
947 if (!Array.isArray(entities)) {
948 entities = Object.values(entities);
949 }
950 return entities;
951 }
952 function splitAddedUpdatedEntities(newEntities, selectId, state) {
953 newEntities = ensureEntitiesArray(newEntities);
954 var added = [];
955 var updated = [];
956 for (var _i = 0, newEntities_1 = newEntities; _i < newEntities_1.length; _i++) {
957 var entity = newEntities_1[_i];
958 var id = selectIdValue(entity, selectId);
959 if (id in state.entities) {
960 updated.push({ id: id, changes: entity });
961 }
962 else {
963 added.push(entity);
964 }
965 }
966 return [added, updated];
967 }
968 // src/entities/unsorted_state_adapter.ts
969 function createUnsortedStateAdapter(selectId) {
970 function addOneMutably(entity, state) {
971 var key = selectIdValue(entity, selectId);
972 if (key in state.entities) {
973 return;
974 }
975 state.ids.push(key);
976 state.entities[key] = entity;
977 }
978 function addManyMutably(newEntities, state) {
979 newEntities = ensureEntitiesArray(newEntities);
980 for (var _i = 0, newEntities_2 = newEntities; _i < newEntities_2.length; _i++) {
981 var entity = newEntities_2[_i];
982 addOneMutably(entity, state);
983 }
984 }
985 function setOneMutably(entity, state) {
986 var key = selectIdValue(entity, selectId);
987 if (!(key in state.entities)) {
988 state.ids.push(key);
989 }
990 state.entities[key] = entity;
991 }
992 function setManyMutably(newEntities, state) {
993 newEntities = ensureEntitiesArray(newEntities);
994 for (var _i = 0, newEntities_3 = newEntities; _i < newEntities_3.length; _i++) {
995 var entity = newEntities_3[_i];
996 setOneMutably(entity, state);
997 }
998 }
999 function setAllMutably(newEntities, state) {
1000 newEntities = ensureEntitiesArray(newEntities);
1001 state.ids = [];
1002 state.entities = {};
1003 addManyMutably(newEntities, state);
1004 }
1005 function removeOneMutably(key, state) {
1006 return removeManyMutably([key], state);
1007 }
1008 function removeManyMutably(keys, state) {
1009 var didMutate = false;
1010 keys.forEach(function (key) {
1011 if (key in state.entities) {
1012 delete state.entities[key];
1013 didMutate = true;
1014 }
1015 });
1016 if (didMutate) {
1017 state.ids = state.ids.filter(function (id) { return id in state.entities; });
1018 }
1019 }
1020 function removeAllMutably(state) {
1021 Object.assign(state, {
1022 ids: [],
1023 entities: {}
1024 });
1025 }
1026 function takeNewKey(keys, update, state) {
1027 var original2 = state.entities[update.id];
1028 var updated = Object.assign({}, original2, update.changes);
1029 var newKey = selectIdValue(updated, selectId);
1030 var hasNewKey = newKey !== update.id;
1031 if (hasNewKey) {
1032 keys[update.id] = newKey;
1033 delete state.entities[update.id];
1034 }
1035 state.entities[newKey] = updated;
1036 return hasNewKey;
1037 }
1038 function updateOneMutably(update, state) {
1039 return updateManyMutably([update], state);
1040 }
1041 function updateManyMutably(updates, state) {
1042 var newKeys = {};
1043 var updatesPerEntity = {};
1044 updates.forEach(function (update) {
1045 if (update.id in state.entities) {
1046 updatesPerEntity[update.id] = {
1047 id: update.id,
1048 changes: __spreadValues(__spreadValues({}, updatesPerEntity[update.id] ? updatesPerEntity[update.id].changes : null), update.changes)
1049 };
1050 }
1051 });
1052 updates = Object.values(updatesPerEntity);
1053 var didMutateEntities = updates.length > 0;
1054 if (didMutateEntities) {
1055 var didMutateIds = updates.filter(function (update) { return takeNewKey(newKeys, update, state); }).length > 0;
1056 if (didMutateIds) {
1057 state.ids = Object.keys(state.entities);
1058 }
1059 }
1060 }
1061 function upsertOneMutably(entity, state) {
1062 return upsertManyMutably([entity], state);
1063 }
1064 function upsertManyMutably(newEntities, state) {
1065 var _c = splitAddedUpdatedEntities(newEntities, selectId, state), added = _c[0], updated = _c[1];
1066 updateManyMutably(updated, state);
1067 addManyMutably(added, state);
1068 }
1069 return {
1070 removeAll: createSingleArgumentStateOperator(removeAllMutably),
1071 addOne: createStateOperator(addOneMutably),
1072 addMany: createStateOperator(addManyMutably),
1073 setOne: createStateOperator(setOneMutably),
1074 setMany: createStateOperator(setManyMutably),
1075 setAll: createStateOperator(setAllMutably),
1076 updateOne: createStateOperator(updateOneMutably),
1077 updateMany: createStateOperator(updateManyMutably),
1078 upsertOne: createStateOperator(upsertOneMutably),
1079 upsertMany: createStateOperator(upsertManyMutably),
1080 removeOne: createStateOperator(removeOneMutably),
1081 removeMany: createStateOperator(removeManyMutably)
1082 };
1083 }
1084 // src/entities/sorted_state_adapter.ts
1085 function createSortedStateAdapter(selectId, sort) {
1086 var _c = createUnsortedStateAdapter(selectId), removeOne = _c.removeOne, removeMany = _c.removeMany, removeAll = _c.removeAll;
1087 function addOneMutably(entity, state) {
1088 return addManyMutably([entity], state);
1089 }
1090 function addManyMutably(newEntities, state) {
1091 newEntities = ensureEntitiesArray(newEntities);
1092 var models = newEntities.filter(function (model) { return !(selectIdValue(model, selectId) in state.entities); });
1093 if (models.length !== 0) {
1094 merge(models, state);
1095 }
1096 }
1097 function setOneMutably(entity, state) {
1098 return setManyMutably([entity], state);
1099 }
1100 function setManyMutably(newEntities, state) {
1101 newEntities = ensureEntitiesArray(newEntities);
1102 if (newEntities.length !== 0) {
1103 merge(newEntities, state);
1104 }
1105 }
1106 function setAllMutably(newEntities, state) {
1107 newEntities = ensureEntitiesArray(newEntities);
1108 state.entities = {};
1109 state.ids = [];
1110 addManyMutably(newEntities, state);
1111 }
1112 function updateOneMutably(update, state) {
1113 return updateManyMutably([update], state);
1114 }
1115 function updateManyMutably(updates, state) {
1116 var appliedUpdates = false;
1117 for (var _i = 0, updates_1 = updates; _i < updates_1.length; _i++) {
1118 var update = updates_1[_i];
1119 var entity = state.entities[update.id];
1120 if (!entity) {
1121 continue;
1122 }
1123 appliedUpdates = true;
1124 Object.assign(entity, update.changes);
1125 var newId = selectId(entity);
1126 if (update.id !== newId) {
1127 delete state.entities[update.id];
1128 state.entities[newId] = entity;
1129 }
1130 }
1131 if (appliedUpdates) {
1132 resortEntities(state);
1133 }
1134 }
1135 function upsertOneMutably(entity, state) {
1136 return upsertManyMutably([entity], state);
1137 }
1138 function upsertManyMutably(newEntities, state) {
1139 var _c = splitAddedUpdatedEntities(newEntities, selectId, state), added = _c[0], updated = _c[1];
1140 updateManyMutably(updated, state);
1141 addManyMutably(added, state);
1142 }
1143 function areArraysEqual(a, b) {
1144 if (a.length !== b.length) {
1145 return false;
1146 }
1147 for (var i = 0; i < a.length && i < b.length; i++) {
1148 if (a[i] === b[i]) {
1149 continue;
1150 }
1151 return false;
1152 }
1153 return true;
1154 }
1155 function merge(models, state) {
1156 models.forEach(function (model) {
1157 state.entities[selectId(model)] = model;
1158 });
1159 resortEntities(state);
1160 }
1161 function resortEntities(state) {
1162 var allEntities = Object.values(state.entities);
1163 allEntities.sort(sort);
1164 var newSortedIds = allEntities.map(selectId);
1165 var ids = state.ids;
1166 if (!areArraysEqual(ids, newSortedIds)) {
1167 state.ids = newSortedIds;
1168 }
1169 }
1170 return {
1171 removeOne: removeOne,
1172 removeMany: removeMany,
1173 removeAll: removeAll,
1174 addOne: createStateOperator(addOneMutably),
1175 updateOne: createStateOperator(updateOneMutably),
1176 upsertOne: createStateOperator(upsertOneMutably),
1177 setOne: createStateOperator(setOneMutably),
1178 setMany: createStateOperator(setManyMutably),
1179 setAll: createStateOperator(setAllMutably),
1180 addMany: createStateOperator(addManyMutably),
1181 updateMany: createStateOperator(updateManyMutably),
1182 upsertMany: createStateOperator(upsertManyMutably)
1183 };
1184 }
1185 // src/entities/create_adapter.ts
1186 function createEntityAdapter(options) {
1187 if (options === void 0) { options = {}; }
1188 var _c = __spreadValues({
1189 sortComparer: false,
1190 selectId: function (instance) { return instance.id; }
1191 }, options), selectId = _c.selectId, sortComparer = _c.sortComparer;
1192 var stateFactory = createInitialStateFactory();
1193 var selectorsFactory = createSelectorsFactory();
1194 var stateAdapter = sortComparer ? createSortedStateAdapter(selectId, sortComparer) : createUnsortedStateAdapter(selectId);
1195 return __spreadValues(__spreadValues(__spreadValues({
1196 selectId: selectId,
1197 sortComparer: sortComparer
1198 }, stateFactory), selectorsFactory), stateAdapter);
1199 }
1200 // src/nanoid.ts
1201 var urlAlphabet = "ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW";
1202 var nanoid = function (size) {
1203 if (size === void 0) { size = 21; }
1204 var id = "";
1205 var i = size;
1206 while (i--) {
1207 id += urlAlphabet[Math.random() * 64 | 0];
1208 }
1209 return id;
1210 };
1211 // src/createAsyncThunk.ts
1212 var commonProperties = [
1213 "name",
1214 "message",
1215 "stack",
1216 "code"
1217 ];
1218 var RejectWithValue = /** @class */ (function () {
1219 function RejectWithValue(payload, meta) {
1220 this.payload = payload;
1221 this.meta = meta;
1222 }
1223 return RejectWithValue;
1224 }());
1225 var FulfillWithMeta = /** @class */ (function () {
1226 function FulfillWithMeta(payload, meta) {
1227 this.payload = payload;
1228 this.meta = meta;
1229 }
1230 return FulfillWithMeta;
1231 }());
1232 var miniSerializeError = function (value) {
1233 if (typeof value === "object" && value !== null) {
1234 var simpleError = {};
1235 for (var _i = 0, commonProperties_1 = commonProperties; _i < commonProperties_1.length; _i++) {
1236 var property = commonProperties_1[_i];
1237 if (typeof value[property] === "string") {
1238 simpleError[property] = value[property];
1239 }
1240 }
1241 return simpleError;
1242 }
1243 return { message: String(value) };
1244 };
1245 var createAsyncThunk = (function () {
1246 function createAsyncThunk2(typePrefix, payloadCreator, options) {
1247 var fulfilled = createAction(typePrefix + "/fulfilled", function (payload, requestId, arg, meta) { return ({
1248 payload: payload,
1249 meta: __spreadProps(__spreadValues({}, meta || {}), {
1250 arg: arg,
1251 requestId: requestId,
1252 requestStatus: "fulfilled"
1253 })
1254 }); });
1255 var pending = createAction(typePrefix + "/pending", function (requestId, arg, meta) { return ({
1256 payload: void 0,
1257 meta: __spreadProps(__spreadValues({}, meta || {}), {
1258 arg: arg,
1259 requestId: requestId,
1260 requestStatus: "pending"
1261 })
1262 }); });
1263 var rejected = createAction(typePrefix + "/rejected", function (error, requestId, arg, payload, meta) { return ({
1264 payload: payload,
1265 error: (options && options.serializeError || miniSerializeError)(error || "Rejected"),
1266 meta: __spreadProps(__spreadValues({}, meta || {}), {
1267 arg: arg,
1268 requestId: requestId,
1269 rejectedWithValue: !!payload,
1270 requestStatus: "rejected",
1271 aborted: (error == null ? void 0 : error.name) === "AbortError",
1272 condition: (error == null ? void 0 : error.name) === "ConditionError"
1273 })
1274 }); });
1275 var displayedWarning = false;
1276 var AC = typeof AbortController !== "undefined" ? AbortController : /** @class */ (function () {
1277 function class_1() {
1278 this.signal = {
1279 aborted: false,
1280 addEventListener: function () {
1281 },
1282 dispatchEvent: function () {
1283 return false;
1284 },
1285 onabort: function () {
1286 },
1287 removeEventListener: function () {
1288 },
1289 reason: void 0,
1290 throwIfAborted: function () {
1291 }
1292 };
1293 }
1294 class_1.prototype.abort = function () {
1295 if (true) {
1296 if (!displayedWarning) {
1297 displayedWarning = true;
1298 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'.");
1299 }
1300 }
1301 };
1302 return class_1;
1303 }());
1304 function actionCreator(arg) {
1305 return function (dispatch, getState, extra) {
1306 var requestId = (options == null ? void 0 : options.idGenerator) ? options.idGenerator(arg) : nanoid();
1307 var abortController = new AC();
1308 var abortReason;
1309 var started = false;
1310 function abort(reason) {
1311 abortReason = reason;
1312 abortController.abort();
1313 }
1314 var promise2 = function () {
1315 return __async(this, null, function () {
1316 var _a, _b, finalAction, conditionResult, abortedPromise, err_1, skipDispatch;
1317 return __generator(this, function (_c) {
1318 switch (_c.label) {
1319 case 0:
1320 _c.trys.push([0, 4, , 5]);
1321 conditionResult = (_a = options == null ? void 0 : options.condition) == null ? void 0 : _a.call(options, arg, { getState: getState, extra: extra });
1322 if (!isThenable(conditionResult)) return [3 /*break*/, 2];
1323 return [4 /*yield*/, conditionResult];
1324 case 1:
1325 conditionResult = _c.sent();
1326 _c.label = 2;
1327 case 2:
1328 if (conditionResult === false || abortController.signal.aborted) {
1329 throw {
1330 name: "ConditionError",
1331 message: "Aborted due to condition callback returning false."
1332 };
1333 }
1334 started = true;
1335 abortedPromise = new Promise(function (_, reject) { return abortController.signal.addEventListener("abort", function () { return reject({
1336 name: "AbortError",
1337 message: abortReason || "Aborted"
1338 }); }); });
1339 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 })));
1340 return [4 /*yield*/, Promise.race([
1341 abortedPromise,
1342 Promise.resolve(payloadCreator(arg, {
1343 dispatch: dispatch,
1344 getState: getState,
1345 extra: extra,
1346 requestId: requestId,
1347 signal: abortController.signal,
1348 abort: abort,
1349 rejectWithValue: function (value, meta) {
1350 return new RejectWithValue(value, meta);
1351 },
1352 fulfillWithValue: function (value, meta) {
1353 return new FulfillWithMeta(value, meta);
1354 }
1355 })).then(function (result) {
1356 if (result instanceof RejectWithValue) {
1357 throw result;
1358 }
1359 if (result instanceof FulfillWithMeta) {
1360 return fulfilled(result.payload, requestId, arg, result.meta);
1361 }
1362 return fulfilled(result, requestId, arg);
1363 })
1364 ])];
1365 case 3:
1366 finalAction = _c.sent();
1367 return [3 /*break*/, 5];
1368 case 4:
1369 err_1 = _c.sent();
1370 finalAction = err_1 instanceof RejectWithValue ? rejected(null, requestId, arg, err_1.payload, err_1.meta) : rejected(err_1, requestId, arg);
1371 return [3 /*break*/, 5];
1372 case 5:
1373 skipDispatch = options && !options.dispatchConditionRejection && rejected.match(finalAction) && finalAction.meta.condition;
1374 if (!skipDispatch) {
1375 dispatch(finalAction);
1376 }
1377 return [2 /*return*/, finalAction];
1378 }
1379 });
1380 });
1381 }();
1382 return Object.assign(promise2, {
1383 abort: abort,
1384 requestId: requestId,
1385 arg: arg,
1386 unwrap: function () {
1387 return promise2.then(unwrapResult);
1388 }
1389 });
1390 };
1391 }
1392 return Object.assign(actionCreator, {
1393 pending: pending,
1394 rejected: rejected,
1395 fulfilled: fulfilled,
1396 typePrefix: typePrefix
1397 });
1398 }
1399 createAsyncThunk2.withTypes = function () { return createAsyncThunk2; };
1400 return createAsyncThunk2;
1401 })();
1402 function unwrapResult(action) {
1403 if (action.meta && action.meta.rejectedWithValue) {
1404 throw action.payload;
1405 }
1406 if (action.error) {
1407 throw action.error;
1408 }
1409 return action.payload;
1410 }
1411 function isThenable(value) {
1412 return value !== null && typeof value === "object" && typeof value.then === "function";
1413 }
1414 // src/tsHelpers.ts
1415 var hasMatchFunction = function (v) {
1416 return v && typeof v.match === "function";
1417 };
1418 // src/matchers.ts
1419 var matches = function (matcher, action) {
1420 if (hasMatchFunction(matcher)) {
1421 return matcher.match(action);
1422 }
1423 else {
1424 return matcher(action);
1425 }
1426 };
1427 function isAnyOf() {
1428 var matchers = [];
1429 for (var _i = 0; _i < arguments.length; _i++) {
1430 matchers[_i] = arguments[_i];
1431 }
1432 return function (action) {
1433 return matchers.some(function (matcher) { return matches(matcher, action); });
1434 };
1435 }
1436 function isAllOf() {
1437 var matchers = [];
1438 for (var _i = 0; _i < arguments.length; _i++) {
1439 matchers[_i] = arguments[_i];
1440 }
1441 return function (action) {
1442 return matchers.every(function (matcher) { return matches(matcher, action); });
1443 };
1444 }
1445 function hasExpectedRequestMetadata(action, validStatus) {
1446 if (!action || !action.meta)
1447 return false;
1448 var hasValidRequestId = typeof action.meta.requestId === "string";
1449 var hasValidRequestStatus = validStatus.indexOf(action.meta.requestStatus) > -1;
1450 return hasValidRequestId && hasValidRequestStatus;
1451 }
1452 function isAsyncThunkArray(a) {
1453 return typeof a[0] === "function" && "pending" in a[0] && "fulfilled" in a[0] && "rejected" in a[0];
1454 }
1455 function isPending() {
1456 var asyncThunks = [];
1457 for (var _i = 0; _i < arguments.length; _i++) {
1458 asyncThunks[_i] = arguments[_i];
1459 }
1460 if (asyncThunks.length === 0) {
1461 return function (action) { return hasExpectedRequestMetadata(action, ["pending"]); };
1462 }
1463 if (!isAsyncThunkArray(asyncThunks)) {
1464 return isPending()(asyncThunks[0]);
1465 }
1466 return function (action) {
1467 var matchers = asyncThunks.map(function (asyncThunk) { return asyncThunk.pending; });
1468 var combinedMatcher = isAnyOf.apply(void 0, matchers);
1469 return combinedMatcher(action);
1470 };
1471 }
1472 function isRejected() {
1473 var asyncThunks = [];
1474 for (var _i = 0; _i < arguments.length; _i++) {
1475 asyncThunks[_i] = arguments[_i];
1476 }
1477 if (asyncThunks.length === 0) {
1478 return function (action) { return hasExpectedRequestMetadata(action, ["rejected"]); };
1479 }
1480 if (!isAsyncThunkArray(asyncThunks)) {
1481 return isRejected()(asyncThunks[0]);
1482 }
1483 return function (action) {
1484 var matchers = asyncThunks.map(function (asyncThunk) { return asyncThunk.rejected; });
1485 var combinedMatcher = isAnyOf.apply(void 0, matchers);
1486 return combinedMatcher(action);
1487 };
1488 }
1489 function isRejectedWithValue() {
1490 var asyncThunks = [];
1491 for (var _i = 0; _i < arguments.length; _i++) {
1492 asyncThunks[_i] = arguments[_i];
1493 }
1494 var hasFlag = function (action) {
1495 return action && action.meta && action.meta.rejectedWithValue;
1496 };
1497 if (asyncThunks.length === 0) {
1498 return function (action) {
1499 var combinedMatcher = isAllOf(isRejected.apply(void 0, asyncThunks), hasFlag);
1500 return combinedMatcher(action);
1501 };
1502 }
1503 if (!isAsyncThunkArray(asyncThunks)) {
1504 return isRejectedWithValue()(asyncThunks[0]);
1505 }
1506 return function (action) {
1507 var combinedMatcher = isAllOf(isRejected.apply(void 0, asyncThunks), hasFlag);
1508 return combinedMatcher(action);
1509 };
1510 }
1511 function isFulfilled() {
1512 var asyncThunks = [];
1513 for (var _i = 0; _i < arguments.length; _i++) {
1514 asyncThunks[_i] = arguments[_i];
1515 }
1516 if (asyncThunks.length === 0) {
1517 return function (action) { return hasExpectedRequestMetadata(action, ["fulfilled"]); };
1518 }
1519 if (!isAsyncThunkArray(asyncThunks)) {
1520 return isFulfilled()(asyncThunks[0]);
1521 }
1522 return function (action) {
1523 var matchers = asyncThunks.map(function (asyncThunk) { return asyncThunk.fulfilled; });
1524 var combinedMatcher = isAnyOf.apply(void 0, matchers);
1525 return combinedMatcher(action);
1526 };
1527 }
1528 function isAsyncThunkAction() {
1529 var asyncThunks = [];
1530 for (var _i = 0; _i < arguments.length; _i++) {
1531 asyncThunks[_i] = arguments[_i];
1532 }
1533 if (asyncThunks.length === 0) {
1534 return function (action) { return hasExpectedRequestMetadata(action, ["pending", "fulfilled", "rejected"]); };
1535 }
1536 if (!isAsyncThunkArray(asyncThunks)) {
1537 return isAsyncThunkAction()(asyncThunks[0]);
1538 }
1539 return function (action) {
1540 var matchers = [];
1541 for (var _i = 0, asyncThunks_1 = asyncThunks; _i < asyncThunks_1.length; _i++) {
1542 var asyncThunk = asyncThunks_1[_i];
1543 matchers.push(asyncThunk.pending, asyncThunk.rejected, asyncThunk.fulfilled);
1544 }
1545 var combinedMatcher = isAnyOf.apply(void 0, matchers);
1546 return combinedMatcher(action);
1547 };
1548 }
1549 // src/listenerMiddleware/utils.ts
1550 var assertFunction = function (func, expected) {
1551 if (typeof func !== "function") {
1552 throw new TypeError(expected + " is not a function");
1553 }
1554 };
1555 var noop = function () {
1556 };
1557 var catchRejection = function (promise2, onError) {
1558 if (onError === void 0) { onError = noop; }
1559 promise2.catch(onError);
1560 return promise2;
1561 };
1562 var addAbortSignalListener = function (abortSignal, callback) {
1563 abortSignal.addEventListener("abort", callback, { once: true });
1564 return function () { return abortSignal.removeEventListener("abort", callback); };
1565 };
1566 var abortControllerWithReason = function (abortController, reason) {
1567 var signal = abortController.signal;
1568 if (signal.aborted) {
1569 return;
1570 }
1571 if (!("reason" in signal)) {
1572 Object.defineProperty(signal, "reason", {
1573 enumerable: true,
1574 value: reason,
1575 configurable: true,
1576 writable: true
1577 });
1578 }
1579 ;
1580 abortController.abort(reason);
1581 };
1582 // src/listenerMiddleware/exceptions.ts
1583 var task = "task";
1584 var listener = "listener";
1585 var completed = "completed";
1586 var cancelled = "cancelled";
1587 var taskCancelled = "task-" + cancelled;
1588 var taskCompleted = "task-" + completed;
1589 var listenerCancelled = listener + "-" + cancelled;
1590 var listenerCompleted = listener + "-" + completed;
1591 var TaskAbortError = /** @class */ (function () {
1592 function TaskAbortError(code) {
1593 this.code = code;
1594 this.name = "TaskAbortError";
1595 this.message = task + " " + cancelled + " (reason: " + code + ")";
1596 }
1597 return TaskAbortError;
1598 }());
1599 // src/listenerMiddleware/task.ts
1600 var validateActive = function (signal) {
1601 if (signal.aborted) {
1602 throw new TaskAbortError(signal.reason);
1603 }
1604 };
1605 function raceWithSignal(signal, promise2) {
1606 var cleanup = noop;
1607 return new Promise(function (resolve, reject) {
1608 var notifyRejection = function () { return reject(new TaskAbortError(signal.reason)); };
1609 if (signal.aborted) {
1610 notifyRejection();
1611 return;
1612 }
1613 cleanup = addAbortSignalListener(signal, notifyRejection);
1614 promise2.finally(function () { return cleanup(); }).then(resolve, reject);
1615 }).finally(function () {
1616 cleanup = noop;
1617 });
1618 }
1619 var runTask = function (task2, cleanUp) { return __async(void 0, null, function () {
1620 var value, error_1;
1621 return __generator(this, function (_c) {
1622 switch (_c.label) {
1623 case 0:
1624 _c.trys.push([0, 3, 4, 5]);
1625 return [4 /*yield*/, Promise.resolve()];
1626 case 1:
1627 _c.sent();
1628 return [4 /*yield*/, task2()];
1629 case 2:
1630 value = _c.sent();
1631 return [2 /*return*/, {
1632 status: "ok",
1633 value: value
1634 }];
1635 case 3:
1636 error_1 = _c.sent();
1637 return [2 /*return*/, {
1638 status: error_1 instanceof TaskAbortError ? "cancelled" : "rejected",
1639 error: error_1
1640 }];
1641 case 4:
1642 cleanUp == null ? void 0 : cleanUp();
1643 return [7 /*endfinally*/];
1644 case 5: return [2 /*return*/];
1645 }
1646 });
1647 }); };
1648 var createPause = function (signal) {
1649 return function (promise2) {
1650 return catchRejection(raceWithSignal(signal, promise2).then(function (output) {
1651 validateActive(signal);
1652 return output;
1653 }));
1654 };
1655 };
1656 var createDelay = function (signal) {
1657 var pause = createPause(signal);
1658 return function (timeoutMs) {
1659 return pause(new Promise(function (resolve) { return setTimeout(resolve, timeoutMs); }));
1660 };
1661 };
1662 // src/listenerMiddleware/index.ts
1663 var assign = Object.assign;
1664 var INTERNAL_NIL_TOKEN = {};
1665 var alm = "listenerMiddleware";
1666 var createFork = function (parentAbortSignal) {
1667 var linkControllers = function (controller) { return addAbortSignalListener(parentAbortSignal, function () { return abortControllerWithReason(controller, parentAbortSignal.reason); }); };
1668 return function (taskExecutor) {
1669 assertFunction(taskExecutor, "taskExecutor");
1670 var childAbortController = new AbortController();
1671 linkControllers(childAbortController);
1672 var result = runTask(function () { return __async(void 0, null, function () {
1673 var result2;
1674 return __generator(this, function (_c) {
1675 switch (_c.label) {
1676 case 0:
1677 validateActive(parentAbortSignal);
1678 validateActive(childAbortController.signal);
1679 return [4 /*yield*/, taskExecutor({
1680 pause: createPause(childAbortController.signal),
1681 delay: createDelay(childAbortController.signal),
1682 signal: childAbortController.signal
1683 })];
1684 case 1:
1685 result2 = _c.sent();
1686 validateActive(childAbortController.signal);
1687 return [2 /*return*/, result2];
1688 }
1689 });
1690 }); }, function () { return abortControllerWithReason(childAbortController, taskCompleted); });
1691 return {
1692 result: createPause(parentAbortSignal)(result),
1693 cancel: function () {
1694 abortControllerWithReason(childAbortController, taskCancelled);
1695 }
1696 };
1697 };
1698 };
1699 var createTakePattern = function (startListening, signal) {
1700 var take = function (predicate, timeout) { return __async(void 0, null, function () {
1701 var unsubscribe, tuplePromise, promises, output;
1702 return __generator(this, function (_c) {
1703 switch (_c.label) {
1704 case 0:
1705 validateActive(signal);
1706 unsubscribe = function () {
1707 };
1708 tuplePromise = new Promise(function (resolve, reject) {
1709 var stopListening = startListening({
1710 predicate: predicate,
1711 effect: function (action, listenerApi) {
1712 listenerApi.unsubscribe();
1713 resolve([
1714 action,
1715 listenerApi.getState(),
1716 listenerApi.getOriginalState()
1717 ]);
1718 }
1719 });
1720 unsubscribe = function () {
1721 stopListening();
1722 reject();
1723 };
1724 });
1725 promises = [
1726 tuplePromise
1727 ];
1728 if (timeout != null) {
1729 promises.push(new Promise(function (resolve) { return setTimeout(resolve, timeout, null); }));
1730 }
1731 _c.label = 1;
1732 case 1:
1733 _c.trys.push([1, , 3, 4]);
1734 return [4 /*yield*/, raceWithSignal(signal, Promise.race(promises))];
1735 case 2:
1736 output = _c.sent();
1737 validateActive(signal);
1738 return [2 /*return*/, output];
1739 case 3:
1740 unsubscribe();
1741 return [7 /*endfinally*/];
1742 case 4: return [2 /*return*/];
1743 }
1744 });
1745 }); };
1746 return function (predicate, timeout) { return catchRejection(take(predicate, timeout)); };
1747 };
1748 var getListenerEntryPropsFrom = function (options) {
1749 var type = options.type, actionCreator = options.actionCreator, matcher = options.matcher, predicate = options.predicate, effect = options.effect;
1750 if (type) {
1751 predicate = createAction(type).match;
1752 }
1753 else if (actionCreator) {
1754 type = actionCreator.type;
1755 predicate = actionCreator.match;
1756 }
1757 else if (matcher) {
1758 predicate = matcher;
1759 }
1760 else if (predicate) {
1761 }
1762 else {
1763 throw new Error("Creating or removing a listener requires one of the known fields for matching an action");
1764 }
1765 assertFunction(effect, "options.listener");
1766 return { predicate: predicate, type: type, effect: effect };
1767 };
1768 var createListenerEntry = function (options) {
1769 var _c = getListenerEntryPropsFrom(options), type = _c.type, predicate = _c.predicate, effect = _c.effect;
1770 var id = nanoid();
1771 var entry = {
1772 id: id,
1773 effect: effect,
1774 type: type,
1775 predicate: predicate,
1776 pending: new Set(),
1777 unsubscribe: function () {
1778 throw new Error("Unsubscribe not initialized");
1779 }
1780 };
1781 return entry;
1782 };
1783 var cancelActiveListeners = function (entry) {
1784 entry.pending.forEach(function (controller) {
1785 abortControllerWithReason(controller, listenerCancelled);
1786 });
1787 };
1788 var createClearListenerMiddleware = function (listenerMap) {
1789 return function () {
1790 listenerMap.forEach(cancelActiveListeners);
1791 listenerMap.clear();
1792 };
1793 };
1794 var safelyNotifyError = function (errorHandler, errorToNotify, errorInfo) {
1795 try {
1796 errorHandler(errorToNotify, errorInfo);
1797 }
1798 catch (errorHandlerError) {
1799 setTimeout(function () {
1800 throw errorHandlerError;
1801 }, 0);
1802 }
1803 };
1804 var addListener = createAction(alm + "/add");
1805 var clearAllListeners = createAction(alm + "/removeAll");
1806 var removeListener = createAction(alm + "/remove");
1807 var defaultErrorHandler = function () {
1808 var args = [];
1809 for (var _i = 0; _i < arguments.length; _i++) {
1810 args[_i] = arguments[_i];
1811 }
1812 console.error.apply(console, __spreadArray([alm + "/error"], args));
1813 };
1814 function createListenerMiddleware(middlewareOptions) {
1815 var _this = this;
1816 if (middlewareOptions === void 0) { middlewareOptions = {}; }
1817 var listenerMap = new Map();
1818 var extra = middlewareOptions.extra, _c = middlewareOptions.onError, onError = _c === void 0 ? defaultErrorHandler : _c;
1819 assertFunction(onError, "onError");
1820 var insertEntry = function (entry) {
1821 entry.unsubscribe = function () { return listenerMap.delete(entry.id); };
1822 listenerMap.set(entry.id, entry);
1823 return function (cancelOptions) {
1824 entry.unsubscribe();
1825 if (cancelOptions == null ? void 0 : cancelOptions.cancelActive) {
1826 cancelActiveListeners(entry);
1827 }
1828 };
1829 };
1830 var findListenerEntry = function (comparator) {
1831 for (var _i = 0, _c = Array.from(listenerMap.values()); _i < _c.length; _i++) {
1832 var entry = _c[_i];
1833 if (comparator(entry)) {
1834 return entry;
1835 }
1836 }
1837 return void 0;
1838 };
1839 var startListening = function (options) {
1840 var entry = findListenerEntry(function (existingEntry) { return existingEntry.effect === options.effect; });
1841 if (!entry) {
1842 entry = createListenerEntry(options);
1843 }
1844 return insertEntry(entry);
1845 };
1846 var stopListening = function (options) {
1847 var _c = getListenerEntryPropsFrom(options), type = _c.type, effect = _c.effect, predicate = _c.predicate;
1848 var entry = findListenerEntry(function (entry2) {
1849 var matchPredicateOrType = typeof type === "string" ? entry2.type === type : entry2.predicate === predicate;
1850 return matchPredicateOrType && entry2.effect === effect;
1851 });
1852 if (entry) {
1853 entry.unsubscribe();
1854 if (options.cancelActive) {
1855 cancelActiveListeners(entry);
1856 }
1857 }
1858 return !!entry;
1859 };
1860 var notifyListener = function (entry, action, api, getOriginalState) { return __async(_this, null, function () {
1861 var internalTaskController, take, listenerError_1;
1862 return __generator(this, function (_c) {
1863 switch (_c.label) {
1864 case 0:
1865 internalTaskController = new AbortController();
1866 take = createTakePattern(startListening, internalTaskController.signal);
1867 _c.label = 1;
1868 case 1:
1869 _c.trys.push([1, 3, 4, 5]);
1870 entry.pending.add(internalTaskController);
1871 return [4 /*yield*/, Promise.resolve(entry.effect(action, assign({}, api, {
1872 getOriginalState: getOriginalState,
1873 condition: function (predicate, timeout) { return take(predicate, timeout).then(Boolean); },
1874 take: take,
1875 delay: createDelay(internalTaskController.signal),
1876 pause: createPause(internalTaskController.signal),
1877 extra: extra,
1878 signal: internalTaskController.signal,
1879 fork: createFork(internalTaskController.signal),
1880 unsubscribe: entry.unsubscribe,
1881 subscribe: function () {
1882 listenerMap.set(entry.id, entry);
1883 },
1884 cancelActiveListeners: function () {
1885 entry.pending.forEach(function (controller, _, set) {
1886 if (controller !== internalTaskController) {
1887 abortControllerWithReason(controller, listenerCancelled);
1888 set.delete(controller);
1889 }
1890 });
1891 }
1892 })))];
1893 case 2:
1894 _c.sent();
1895 return [3 /*break*/, 5];
1896 case 3:
1897 listenerError_1 = _c.sent();
1898 if (!(listenerError_1 instanceof TaskAbortError)) {
1899 safelyNotifyError(onError, listenerError_1, {
1900 raisedBy: "effect"
1901 });
1902 }
1903 return [3 /*break*/, 5];
1904 case 4:
1905 abortControllerWithReason(internalTaskController, listenerCompleted);
1906 entry.pending.delete(internalTaskController);
1907 return [7 /*endfinally*/];
1908 case 5: return [2 /*return*/];
1909 }
1910 });
1911 }); };
1912 var clearListenerMiddleware = createClearListenerMiddleware(listenerMap);
1913 var middleware = function (api) { return function (next) { return function (action) {
1914 if (!isAction(action)) {
1915 return next(action);
1916 }
1917 if (addListener.match(action)) {
1918 return startListening(action.payload);
1919 }
1920 if (clearAllListeners.match(action)) {
1921 clearListenerMiddleware();
1922 return;
1923 }
1924 if (removeListener.match(action)) {
1925 return stopListening(action.payload);
1926 }
1927 var originalState = api.getState();
1928 var getOriginalState = function () {
1929 if (originalState === INTERNAL_NIL_TOKEN) {
1930 throw new Error(alm + ": getOriginalState can only be called synchronously");
1931 }
1932 return originalState;
1933 };
1934 var result;
1935 try {
1936 result = next(action);
1937 if (listenerMap.size > 0) {
1938 var currentState = api.getState();
1939 var listenerEntries = Array.from(listenerMap.values());
1940 for (var _i = 0, listenerEntries_1 = listenerEntries; _i < listenerEntries_1.length; _i++) {
1941 var entry = listenerEntries_1[_i];
1942 var runListener = false;
1943 try {
1944 runListener = entry.predicate(action, currentState, originalState);
1945 }
1946 catch (predicateError) {
1947 runListener = false;
1948 safelyNotifyError(onError, predicateError, {
1949 raisedBy: "predicate"
1950 });
1951 }
1952 if (!runListener) {
1953 continue;
1954 }
1955 notifyListener(entry, action, api, getOriginalState);
1956 }
1957 }
1958 }
1959 finally {
1960 originalState = INTERNAL_NIL_TOKEN;
1961 }
1962 return result;
1963 }; }; };
1964 return {
1965 middleware: middleware,
1966 startListening: startListening,
1967 stopListening: stopListening,
1968 clearListeners: clearListenerMiddleware
1969 };
1970 }
1971 // src/autoBatchEnhancer.ts
1972 var SHOULD_AUTOBATCH = "RTK_autoBatch";
1973 var prepareAutoBatched = function () { return function (payload) {
1974 var _c;
1975 return ({
1976 payload: payload,
1977 meta: (_c = {}, _c[SHOULD_AUTOBATCH] = true, _c)
1978 });
1979 }; };
1980 var promise;
1981 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 () {
1982 throw err;
1983 }, 0); }); };
1984 var createQueueWithTimer = function (timeout) {
1985 return function (notify) {
1986 setTimeout(notify, timeout);
1987 };
1988 };
1989 var rAF = typeof window !== "undefined" && window.requestAnimationFrame ? window.requestAnimationFrame : createQueueWithTimer(10);
1990 var autoBatchEnhancer = function (options) {
1991 if (options === void 0) { options = { type: "raf" }; }
1992 return function (next) { return function () {
1993 var args = [];
1994 for (var _i = 0; _i < arguments.length; _i++) {
1995 args[_i] = arguments[_i];
1996 }
1997 var store = next.apply(void 0, args);
1998 var notifying = true;
1999 var shouldNotifyAtEndOfTick = false;
2000 var notificationQueued = false;
2001 var listeners = new Set();
2002 var queueCallback = options.type === "tick" ? queueMicrotaskShim : options.type === "raf" ? rAF : options.type === "callback" ? options.queueNotification : createQueueWithTimer(options.timeout);
2003 var notifyListeners = function () {
2004 notificationQueued = false;
2005 if (shouldNotifyAtEndOfTick) {
2006 shouldNotifyAtEndOfTick = false;
2007 listeners.forEach(function (l) { return l(); });
2008 }
2009 };
2010 return Object.assign({}, store, {
2011 subscribe: function (listener2) {
2012 var wrappedListener = function () { return notifying && listener2(); };
2013 var unsubscribe = store.subscribe(wrappedListener);
2014 listeners.add(listener2);
2015 return function () {
2016 unsubscribe();
2017 listeners.delete(listener2);
2018 };
2019 },
2020 dispatch: function (action) {
2021 var _a;
2022 try {
2023 notifying = !((_a = action == null ? void 0 : action.meta) == null ? void 0 : _a[SHOULD_AUTOBATCH]);
2024 shouldNotifyAtEndOfTick = !notifying;
2025 if (shouldNotifyAtEndOfTick) {
2026 if (!notificationQueued) {
2027 notificationQueued = true;
2028 queueCallback(notifyListeners);
2029 }
2030 }
2031 return store.dispatch(action);
2032 }
2033 finally {
2034 notifying = true;
2035 }
2036 }
2037 });
2038 }; };
2039 };
2040 // src/index.ts
2041 (0,immer__WEBPACK_IMPORTED_MODULE_2__.enableES5)();
2042
2043 //# sourceMappingURL=redux-toolkit.esm.js.map
2044
2045 /***/ }),
2046
2047 /***/ "../assets/dev/js/editor/utils/is-instanceof.js":
2048 /*!******************************************************!*\
2049 !*** ../assets/dev/js/editor/utils/is-instanceof.js ***!
2050 \******************************************************/
2051 /***/ ((__unused_webpack_module, exports) => {
2052
2053 "use strict";
2054
2055
2056 Object.defineProperty(exports, "__esModule", ({
2057 value: true
2058 }));
2059 exports["default"] = void 0;
2060 function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
2061 function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
2062 function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
2063 /**
2064 * Some FileAPI objects such as FileList, DataTransferItem and DataTransferItemList has inconsistency with the retrieved
2065 * object (from events, etc.) and the actual JavaScript object so a regular instanceof doesn't work. This function can
2066 * check whether it's instanceof by using the objects constructor and prototype names.
2067 *
2068 * @param object
2069 * @param constructors
2070 * @return {boolean}
2071 */
2072 var _default = function _default(object, constructors) {
2073 constructors = Array.isArray(constructors) ? constructors : [constructors];
2074 var _iterator = _createForOfIteratorHelper(constructors),
2075 _step;
2076 try {
2077 for (_iterator.s(); !(_step = _iterator.n()).done;) {
2078 var _constructor = _step.value;
2079 if (object.constructor.name === _constructor.prototype[Symbol.toStringTag]) {
2080 return true;
2081 }
2082 }
2083 } catch (err) {
2084 _iterator.e(err);
2085 } finally {
2086 _iterator.f();
2087 }
2088 return false;
2089 };
2090 exports["default"] = _default;
2091
2092 /***/ }),
2093
2094 /***/ "../assets/dev/js/modules/imports/args-object.js":
2095 /*!*******************************************************!*\
2096 !*** ../assets/dev/js/modules/imports/args-object.js ***!
2097 \*******************************************************/
2098 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2099
2100 "use strict";
2101
2102
2103 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2104 Object.defineProperty(exports, "__esModule", ({
2105 value: true
2106 }));
2107 exports["default"] = void 0;
2108 var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"));
2109 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
2110 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
2111 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
2112 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
2113 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
2114 var _instanceType = _interopRequireDefault(__webpack_require__(/*! ./instance-type */ "../assets/dev/js/modules/imports/instance-type.js"));
2115 var _isInstanceof = _interopRequireDefault(__webpack_require__(/*! ../../editor/utils/is-instanceof */ "../assets/dev/js/editor/utils/is-instanceof.js"));
2116 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
2117 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
2118 var ArgsObject = /*#__PURE__*/function (_InstanceType) {
2119 (0, _inherits2.default)(ArgsObject, _InstanceType);
2120 var _super = _createSuper(ArgsObject);
2121 /**
2122 * Function constructor().
2123 *
2124 * Create ArgsObject.
2125 *
2126 * @param {{}} args
2127 */
2128 function ArgsObject(args) {
2129 var _this;
2130 (0, _classCallCheck2.default)(this, ArgsObject);
2131 _this = _super.call(this);
2132 _this.args = args;
2133 return _this;
2134 }
2135
2136 /**
2137 * Function requireArgument().
2138 *
2139 * Validate property in args.
2140 *
2141 * @param {string} property
2142 * @param {{}} args
2143 *
2144 * @throws {Error}
2145 *
2146 */
2147 (0, _createClass2.default)(ArgsObject, [{
2148 key: "requireArgument",
2149 value: function requireArgument(property) {
2150 var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.args;
2151 if (!Object.prototype.hasOwnProperty.call(args, property)) {
2152 throw Error("".concat(property, " is required."));
2153 }
2154 }
2155
2156 /**
2157 * Function requireArgumentType().
2158 *
2159 * Validate property in args using `type === typeof(args.whatever)`.
2160 *
2161 * @param {string} property
2162 * @param {string} type
2163 * @param {{}} args
2164 *
2165 * @throws {Error}
2166 *
2167 */
2168 }, {
2169 key: "requireArgumentType",
2170 value: function requireArgumentType(property, type) {
2171 var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.args;
2172 this.requireArgument(property, args);
2173 if ((0, _typeof2.default)(args[property]) !== type) {
2174 throw Error("".concat(property, " invalid type: ").concat(type, "."));
2175 }
2176 }
2177
2178 /**
2179 * Function requireArgumentInstance().
2180 *
2181 * Validate property in args using `args.whatever instanceof instance`.
2182 *
2183 * @param {string} property
2184 * @param {*} instance
2185 * @param {{}} args
2186 *
2187 * @throws {Error}
2188 *
2189 */
2190 }, {
2191 key: "requireArgumentInstance",
2192 value: function requireArgumentInstance(property, instance) {
2193 var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.args;
2194 this.requireArgument(property, args);
2195 if (!(args[property] instanceof instance) && !(0, _isInstanceof.default)(args[property], instance)) {
2196 throw Error("".concat(property, " invalid instance."));
2197 }
2198 }
2199
2200 /**
2201 * Function requireArgumentConstructor().
2202 *
2203 * Validate property in args using `type === args.whatever.constructor`.
2204 *
2205 * @param {string} property
2206 * @param {*} type
2207 * @param {{}} args
2208 *
2209 * @throws {Error}
2210 *
2211 */
2212 }, {
2213 key: "requireArgumentConstructor",
2214 value: function requireArgumentConstructor(property, type) {
2215 var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.args;
2216 this.requireArgument(property, args);
2217
2218 // Note: Converting the constructor to string in order to avoid equation issues
2219 // due to different memory addresses between iframes (window.Object !== window.top.Object).
2220 if (args[property].constructor.toString() !== type.prototype.constructor.toString()) {
2221 throw Error("".concat(property, " invalid constructor type."));
2222 }
2223 }
2224 }], [{
2225 key: "getInstanceType",
2226 value: function getInstanceType() {
2227 return 'ArgsObject';
2228 }
2229 }]);
2230 return ArgsObject;
2231 }(_instanceType.default);
2232 exports["default"] = ArgsObject;
2233
2234 /***/ }),
2235
2236 /***/ "../assets/dev/js/modules/imports/instance-type.js":
2237 /*!*********************************************************!*\
2238 !*** ../assets/dev/js/modules/imports/instance-type.js ***!
2239 \*********************************************************/
2240 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2241
2242 "use strict";
2243
2244
2245 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2246 Object.defineProperty(exports, "__esModule", ({
2247 value: true
2248 }));
2249 exports["default"] = void 0;
2250 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
2251 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
2252 var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js"));
2253 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
2254 var InstanceType = /*#__PURE__*/function (_Symbol$hasInstance) {
2255 function InstanceType() {
2256 var _this = this;
2257 (0, _classCallCheck2.default)(this, InstanceType);
2258 // Since anonymous classes sometimes do not get validated by babel, do it manually.
2259 var target = this instanceof InstanceType ? this.constructor : void 0;
2260 var prototypes = [];
2261 while (target.__proto__ && target.__proto__.name) {
2262 prototypes.push(target.__proto__);
2263 target = target.__proto__;
2264 }
2265 prototypes.reverse().forEach(function (proto) {
2266 return _this instanceof proto;
2267 });
2268 }
2269 (0, _createClass2.default)(InstanceType, null, [{
2270 key: _Symbol$hasInstance,
2271 value: function value(target) {
2272 /**
2273 * This is function extending being called each time JS uses instanceOf, since babel use it each time it create new class
2274 * its give's opportunity to mange capabilities of instanceOf operator.
2275 * saving current class each time will give option later to handle instanceOf manually.
2276 */
2277 var result = (0, _get2.default)((0, _getPrototypeOf2.default)(InstanceType), Symbol.hasInstance, this).call(this, target);
2278
2279 // Act normal when validate a class, which does not have instance type.
2280 if (target && !target.constructor.getInstanceType) {
2281 return result;
2282 }
2283 if (target) {
2284 if (!target.instanceTypes) {
2285 target.instanceTypes = [];
2286 }
2287 if (!result) {
2288 if (this.getInstanceType() === target.constructor.getInstanceType()) {
2289 result = true;
2290 }
2291 }
2292 if (result) {
2293 var name = this.getInstanceType === InstanceType.getInstanceType ? 'BaseInstanceType' : this.getInstanceType();
2294 if (-1 === target.instanceTypes.indexOf(name)) {
2295 target.instanceTypes.push(name);
2296 }
2297 }
2298 }
2299 if (!result && target) {
2300 // Check if the given 'target', is instance of known types.
2301 result = target.instanceTypes && Array.isArray(target.instanceTypes) && -1 !== target.instanceTypes.indexOf(this.getInstanceType());
2302 }
2303 return result;
2304 }
2305 }, {
2306 key: "getInstanceType",
2307 value: function getInstanceType() {
2308 elementorModules.ForceMethodImplementation();
2309 }
2310 }]);
2311 return InstanceType;
2312 }(Symbol.hasInstance);
2313 exports["default"] = InstanceType;
2314
2315 /***/ }),
2316
2317 /***/ "../assets/dev/js/modules/imports/module.js":
2318 /*!**************************************************!*\
2319 !*** ../assets/dev/js/modules/imports/module.js ***!
2320 \**************************************************/
2321 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2322
2323 "use strict";
2324
2325
2326 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2327 var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"));
2328 var Module = function Module() {
2329 var $ = jQuery,
2330 instanceParams = arguments,
2331 self = this,
2332 events = {};
2333 var settings;
2334 var ensureClosureMethods = function ensureClosureMethods() {
2335 $.each(self, function (methodName) {
2336 var oldMethod = self[methodName];
2337 if ('function' !== typeof oldMethod) {
2338 return;
2339 }
2340 self[methodName] = function () {
2341 return oldMethod.apply(self, arguments);
2342 };
2343 });
2344 };
2345 var initSettings = function initSettings() {
2346 settings = self.getDefaultSettings();
2347 var instanceSettings = instanceParams[0];
2348 if (instanceSettings) {
2349 $.extend(true, settings, instanceSettings);
2350 }
2351 };
2352 var init = function init() {
2353 self.__construct.apply(self, instanceParams);
2354 ensureClosureMethods();
2355 initSettings();
2356 self.trigger('init');
2357 };
2358 this.getItems = function (items, itemKey) {
2359 if (itemKey) {
2360 var keyStack = itemKey.split('.'),
2361 currentKey = keyStack.splice(0, 1);
2362 if (!keyStack.length) {
2363 return items[currentKey];
2364 }
2365 if (!items[currentKey]) {
2366 return;
2367 }
2368 return this.getItems(items[currentKey], keyStack.join('.'));
2369 }
2370 return items;
2371 };
2372 this.getSettings = function (setting) {
2373 return this.getItems(settings, setting);
2374 };
2375 this.setSettings = function (settingKey, value, settingsContainer) {
2376 if (!settingsContainer) {
2377 settingsContainer = settings;
2378 }
2379 if ('object' === (0, _typeof2.default)(settingKey)) {
2380 $.extend(settingsContainer, settingKey);
2381 return self;
2382 }
2383 var keyStack = settingKey.split('.'),
2384 currentKey = keyStack.splice(0, 1);
2385 if (!keyStack.length) {
2386 settingsContainer[currentKey] = value;
2387 return self;
2388 }
2389 if (!settingsContainer[currentKey]) {
2390 settingsContainer[currentKey] = {};
2391 }
2392 return self.setSettings(keyStack.join('.'), value, settingsContainer[currentKey]);
2393 };
2394 this.getErrorMessage = function (type, functionName) {
2395 var message;
2396 switch (type) {
2397 case 'forceMethodImplementation':
2398 message = "The method '".concat(functionName, "' must to be implemented in the inheritor child.");
2399 break;
2400 default:
2401 message = 'An error occurs';
2402 }
2403 return message;
2404 };
2405
2406 // TODO: This function should be deleted ?.
2407 this.forceMethodImplementation = function (functionName) {
2408 throw new Error(this.getErrorMessage('forceMethodImplementation', functionName));
2409 };
2410 this.on = function (eventName, callback) {
2411 if ('object' === (0, _typeof2.default)(eventName)) {
2412 $.each(eventName, function (singleEventName) {
2413 self.on(singleEventName, this);
2414 });
2415 return self;
2416 }
2417 var eventNames = eventName.split(' ');
2418 eventNames.forEach(function (singleEventName) {
2419 if (!events[singleEventName]) {
2420 events[singleEventName] = [];
2421 }
2422 events[singleEventName].push(callback);
2423 });
2424 return self;
2425 };
2426 this.off = function (eventName, callback) {
2427 if (!events[eventName]) {
2428 return self;
2429 }
2430 if (!callback) {
2431 delete events[eventName];
2432 return self;
2433 }
2434 var callbackIndex = events[eventName].indexOf(callback);
2435 if (-1 !== callbackIndex) {
2436 delete events[eventName][callbackIndex];
2437
2438 // Reset array index (for next off on same event).
2439 events[eventName] = events[eventName].filter(function (val) {
2440 return val;
2441 });
2442 }
2443 return self;
2444 };
2445 this.trigger = function (eventName) {
2446 var methodName = 'on' + eventName[0].toUpperCase() + eventName.slice(1),
2447 params = Array.prototype.slice.call(arguments, 1);
2448 if (self[methodName]) {
2449 self[methodName].apply(self, params);
2450 }
2451 var callbacks = events[eventName];
2452 if (!callbacks) {
2453 return self;
2454 }
2455 $.each(callbacks, function (index, callback) {
2456 callback.apply(self, params);
2457 });
2458 return self;
2459 };
2460 init();
2461 };
2462 Module.prototype.__construct = function () {};
2463 Module.prototype.getDefaultSettings = function () {
2464 return {};
2465 };
2466 Module.prototype.getConstructorID = function () {
2467 return this.constructor.name;
2468 };
2469 Module.extend = function (properties) {
2470 var $ = jQuery,
2471 parent = this;
2472 var child = function child() {
2473 return parent.apply(this, arguments);
2474 };
2475 $.extend(child, parent);
2476 child.prototype = Object.create($.extend({}, parent.prototype, properties));
2477 child.prototype.constructor = child;
2478 child.__super__ = parent.prototype;
2479 return child;
2480 };
2481 module.exports = Module;
2482
2483 /***/ }),
2484
2485 /***/ "../modules/web-cli/assets/js/api.js":
2486 /*!*******************************************!*\
2487 !*** ../modules/web-cli/assets/js/api.js ***!
2488 \*******************************************/
2489 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2490
2491 "use strict";
2492
2493
2494 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2495 var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js");
2496 Object.defineProperty(exports, "__esModule", ({
2497 value: true
2498 }));
2499 exports["default"] = void 0;
2500 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
2501 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
2502 var _backwardsCompatibility = _interopRequireDefault(__webpack_require__(/*! ./core/backwards-compatibility */ "../modules/web-cli/assets/js/core/backwards-compatibility.js"));
2503 var _commandBase = _interopRequireDefault(__webpack_require__(/*! ./modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js"));
2504 var _commandInternalBase = _interopRequireDefault(__webpack_require__(/*! ./modules/command-internal-base */ "../modules/web-cli/assets/js/modules/command-internal-base.js"));
2505 var _commandData = _interopRequireDefault(__webpack_require__(/*! ./modules/command-data */ "../modules/web-cli/assets/js/modules/command-data.js"));
2506 var _commands = _interopRequireDefault(__webpack_require__(/*! ./core/commands */ "../modules/web-cli/assets/js/core/commands.js"));
2507 var _commandsInternal = _interopRequireDefault(__webpack_require__(/*! ./core/commands-internal */ "../modules/web-cli/assets/js/core/commands-internal.js"));
2508 var _componentBase = _interopRequireDefault(__webpack_require__(/*! ./modules/component-base */ "../modules/web-cli/assets/js/modules/component-base.js"));
2509 var _componentModalBase = _interopRequireDefault(__webpack_require__(/*! ./modules/component-modal-base */ "../modules/web-cli/assets/js/modules/component-modal-base.js"));
2510 var _components = _interopRequireDefault(__webpack_require__(/*! ./core/components */ "../modules/web-cli/assets/js/core/components.js"));
2511 var _data = _interopRequireDefault(__webpack_require__(/*! ./core/data.js */ "../modules/web-cli/assets/js/core/data.js"));
2512 var _hashCommands = _interopRequireDefault(__webpack_require__(/*! ./extras/hash-commands */ "../modules/web-cli/assets/js/extras/hash-commands.js"));
2513 var _hookBreak = _interopRequireDefault(__webpack_require__(/*! ./modules/hook-break */ "../modules/web-cli/assets/js/modules/hook-break.js"));
2514 var _hooks = _interopRequireDefault(__webpack_require__(/*! ./core/hooks */ "../modules/web-cli/assets/js/core/hooks.js"));
2515 var _routes = _interopRequireDefault(__webpack_require__(/*! ./core/routes */ "../modules/web-cli/assets/js/core/routes.js"));
2516 var _shortcuts = _interopRequireDefault(__webpack_require__(/*! ./core/shortcuts */ "../modules/web-cli/assets/js/core/shortcuts.js"));
2517 var _store = _interopRequireDefault(__webpack_require__(/*! ./core/store */ "../modules/web-cli/assets/js/core/store.js"));
2518 var _uiStates = _interopRequireDefault(__webpack_require__(/*! ./core/ui-states */ "../modules/web-cli/assets/js/core/ui-states.js"));
2519 var hookData = _interopRequireWildcard(__webpack_require__(/*! ./modules/hooks/data/ */ "../modules/web-cli/assets/js/modules/hooks/data/index.js"));
2520 var hookUI = _interopRequireWildcard(__webpack_require__(/*! ./modules/hooks/ui */ "../modules/web-cli/assets/js/modules/hooks/ui/index.js"));
2521 function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
2522 function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
2523 /* Alphabetical order */
2524 var API = /*#__PURE__*/function () {
2525 /**
2526 * Function constructor().
2527 *
2528 * Create's 'elementor' api.
2529 */
2530 function API() {
2531 (0, _classCallCheck2.default)(this, API);
2532 this.components = new _components.default();
2533 this.commands = new _commands.default();
2534 this.commandsInternal = new _commandsInternal.default();
2535 this.hooks = new _hooks.default();
2536 this.routes = new _routes.default();
2537 this.shortcuts = new _shortcuts.default(jQuery(window));
2538 this.data = new _data.default();
2539 this.store = new _store.default();
2540 this.uiStates = new _uiStates.default();
2541 this.modules = {
2542 CommandBase: _commandBase.default,
2543 CommandInternalBase: _commandInternalBase.default,
2544 CommandData: _commandData.default,
2545 ComponentBase: _componentBase.default,
2546 ComponentModalBase: _componentModalBase.default,
2547 HookBreak: _hookBreak.default,
2548 hookData: hookData,
2549 hookUI: hookUI
2550 };
2551 this.extras = {
2552 hashCommands: new _hashCommands.default()
2553 };
2554
2555 // Backwards compatibility should be last, in order to handle others.
2556 this.bc = new _backwardsCompatibility.default();
2557 }
2558
2559 /**
2560 * Function run().
2561 *
2562 * Alias of `$e.commands.run()`.
2563 *
2564 * @param {string} command
2565 * @param {*} [args={}]
2566 *
2567 * @return {*} result
2568 */
2569 (0, _createClass2.default)(API, [{
2570 key: "run",
2571 value: function run(command) {
2572 var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2573 return $e.commands.run(command, args);
2574 }
2575
2576 /**
2577 * Function internal().
2578 *
2579 * Alias of `$e.commandsInternal.run()`.
2580 *
2581 * @param {string} command
2582 * @param {*} [args={}]
2583 *
2584 * @return {boolean} result
2585 */
2586 }, {
2587 key: "internal",
2588 value: function internal(command) {
2589 var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2590 return $e.commandsInternal.run(command, args);
2591 }
2592
2593 /**
2594 * Function route().
2595 *
2596 * Alias of `$e.routes.to()`.
2597 *
2598 * @param {string} route
2599 * @param {*} [args={}]
2600 * @param {Object} [options]
2601 */
2602 }, {
2603 key: "route",
2604 value: function route(_route) {
2605 var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2606 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
2607 history: true
2608 };
2609 return $e.routes.to(_route, args, options);
2610 }
2611
2612 // TODO: shortcut();
2613 }]);
2614 return API;
2615 }();
2616 exports["default"] = API;
2617
2618 /***/ }),
2619
2620 /***/ "../modules/web-cli/assets/js/core/backwards-compatibility.js":
2621 /*!********************************************************************!*\
2622 !*** ../modules/web-cli/assets/js/core/backwards-compatibility.js ***!
2623 \********************************************************************/
2624 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2625
2626 "use strict";
2627
2628
2629 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2630 Object.defineProperty(exports, "__esModule", ({
2631 value: true
2632 }));
2633 exports["default"] = void 0;
2634 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
2635 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
2636 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
2637 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
2638 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
2639 var _componentBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/component-base */ "../modules/web-cli/assets/js/modules/component-base.js"));
2640 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
2641 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
2642 var BackwardsCompatibility = /*#__PURE__*/function () {
2643 function BackwardsCompatibility() {
2644 (0, _classCallCheck2.default)(this, BackwardsCompatibility);
2645 }
2646 (0, _createClass2.default)(BackwardsCompatibility, [{
2647 key: "ensureTab",
2648 value: function ensureTab(namespace, tabSlug) {
2649 var page = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
2650 var component = $e.components.get(namespace);
2651 if (!component) {
2652 var Component = /*#__PURE__*/function (_ComponentBase) {
2653 (0, _inherits2.default)(Component, _ComponentBase);
2654 var _super = _createSuper(Component);
2655 function Component() {
2656 (0, _classCallCheck2.default)(this, Component);
2657 return _super.apply(this, arguments);
2658 }
2659 (0, _createClass2.default)(Component, [{
2660 key: "getNamespace",
2661 value: function getNamespace() {
2662 return namespace;
2663 }
2664 }, {
2665 key: "renderTab",
2666 value: function renderTab(tab) {
2667 elementor.getPanelView().setPage(page).activateTab(tab);
2668 }
2669 }]);
2670 return Component;
2671 }(_componentBase.default);
2672 component = $e.components.register(new Component());
2673 }
2674 if (!component.hasTab(tabSlug) && elementor.config.tabs[tabSlug]) {
2675 component.addTab(tabSlug, {
2676 title: elementor.config.tabs[tabSlug]
2677 });
2678 }
2679 }
2680 }]);
2681 return BackwardsCompatibility;
2682 }();
2683 exports["default"] = BackwardsCompatibility;
2684
2685 /***/ }),
2686
2687 /***/ "../modules/web-cli/assets/js/core/backwards-compatibility/commands.js":
2688 /*!*****************************************************************************!*\
2689 !*** ../modules/web-cli/assets/js/core/backwards-compatibility/commands.js ***!
2690 \*****************************************************************************/
2691 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2692
2693 "use strict";
2694
2695
2696 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2697 Object.defineProperty(exports, "__esModule", ({
2698 value: true
2699 }));
2700 exports["default"] = void 0;
2701 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
2702 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
2703 var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js"));
2704 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
2705 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
2706 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
2707 var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
2708 var _module = _interopRequireDefault(__webpack_require__(/*! elementor-assets-js/modules/imports/module.js */ "../assets/dev/js/modules/imports/module.js"));
2709 var _deprecation = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/deprecation */ "../modules/web-cli/assets/js/utils/deprecation.js"));
2710 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
2711 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
2712 var CommandsBackwardsCompatibility = /*#__PURE__*/function (_Module) {
2713 (0, _inherits2.default)(CommandsBackwardsCompatibility, _Module);
2714 var _super = _createSuper(CommandsBackwardsCompatibility);
2715 function CommandsBackwardsCompatibility() {
2716 var _this;
2717 (0, _classCallCheck2.default)(this, CommandsBackwardsCompatibility);
2718 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2719 args[_key] = arguments[_key];
2720 }
2721 _this = _super.call.apply(_super, [this].concat(args));
2722 (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "on", function (eventName, callback) {
2723 if ('run' === eventName) {
2724 var componentName = _this.getConstructorID();
2725
2726 // Regex takes the first letter and convert it to lower case.
2727 componentName = componentName.replace(/^./, function (val) {
2728 return val.toLowerCase();
2729 });
2730 _deprecation.default.deprecated("$e.".concat(componentName, ".on( 'run', ... )"), '3.0.0', "$e.".concat(componentName, ".on( 'run:before', ... )"));
2731 _this.onOrig('run:before', callback);
2732 return;
2733 }
2734 _this.onOrig(eventName, callback);
2735 });
2736 return _this;
2737 }
2738 (0, _createClass2.default)(CommandsBackwardsCompatibility, [{
2739 key: "__construct",
2740 value: function __construct() {
2741 this.onOrig = this.on;
2742 }
2743 }]);
2744 return CommandsBackwardsCompatibility;
2745 }(_module.default);
2746 exports["default"] = CommandsBackwardsCompatibility;
2747
2748 /***/ }),
2749
2750 /***/ "../modules/web-cli/assets/js/core/commands-internal.js":
2751 /*!**************************************************************!*\
2752 !*** ../modules/web-cli/assets/js/core/commands-internal.js ***!
2753 \**************************************************************/
2754 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2755
2756 "use strict";
2757
2758
2759 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2760 Object.defineProperty(exports, "__esModule", ({
2761 value: true
2762 }));
2763 exports["default"] = void 0;
2764 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
2765 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
2766 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
2767 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
2768 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
2769 var _commands = _interopRequireDefault(__webpack_require__(/*! ./commands.js */ "../modules/web-cli/assets/js/core/commands.js"));
2770 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
2771 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
2772 var CommandsInternal = /*#__PURE__*/function (_Commands) {
2773 (0, _inherits2.default)(CommandsInternal, _Commands);
2774 var _super = _createSuper(CommandsInternal);
2775 function CommandsInternal() {
2776 (0, _classCallCheck2.default)(this, CommandsInternal);
2777 return _super.apply(this, arguments);
2778 }
2779 (0, _createClass2.default)(CommandsInternal, [{
2780 key: "error",
2781 value: function error(message) {
2782 throw Error('Commands internal: ' + message);
2783 }
2784 }]);
2785 return CommandsInternal;
2786 }(_commands.default);
2787 exports["default"] = CommandsInternal;
2788
2789 /***/ }),
2790
2791 /***/ "../modules/web-cli/assets/js/core/commands.js":
2792 /*!*****************************************************!*\
2793 !*** ../modules/web-cli/assets/js/core/commands.js ***!
2794 \*****************************************************/
2795 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2796
2797 "use strict";
2798
2799
2800 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2801 Object.defineProperty(exports, "__esModule", ({
2802 value: true
2803 }));
2804 exports["default"] = void 0;
2805 var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js"));
2806 var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js"));
2807 var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"));
2808 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
2809 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
2810 var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js"));
2811 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
2812 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
2813 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
2814 var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
2815 var _commands = _interopRequireDefault(__webpack_require__(/*! ./backwards-compatibility/commands */ "../modules/web-cli/assets/js/core/backwards-compatibility/commands.js"));
2816 var _commandBase = _interopRequireDefault(__webpack_require__(/*! ../modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js"));
2817 var _console = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/console */ "../modules/web-cli/assets/js/utils/console.js"));
2818 var _deprecation = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/deprecation */ "../modules/web-cli/assets/js/utils/deprecation.js"));
2819 function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2820 function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
2821 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
2822 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
2823 /**
2824 * @typedef {import('../modules/component-base')} ComponentBase
2825 */
2826 /**
2827 * @typedef {import('../modules/command-base')} CommandBase
2828 */
2829 /**
2830 * @typedef {{}} Component
2831 */
2832 var Commands = /*#__PURE__*/function (_CommandsBackwardsCom) {
2833 (0, _inherits2.default)(Commands, _CommandsBackwardsCom);
2834 var _super = _createSuper(Commands);
2835 /**
2836 * Function constructor().
2837 *
2838 * Create `$e.commands` API.
2839 *
2840 * @param {{}} args
2841 */
2842 function Commands() {
2843 var _this;
2844 (0, _classCallCheck2.default)(this, Commands);
2845 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2846 args[_key] = arguments[_key];
2847 }
2848 _this = _super.call.apply(_super, [this].concat(args));
2849 _this.current = {};
2850 _this.currentArgs = {};
2851 _this.currentTrace = [];
2852 _this.commands = {};
2853 _this.components = {};
2854 Object.defineProperty((0, _assertThisInitialized2.default)(_this), 'classes', {
2855 get: function get() {
2856 _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,');
2857 return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, $e.commands.commands), $e.commandsInternal.commands), $e.data.commands), $e.routes.commands);
2858 }
2859 });
2860 return _this;
2861 }
2862
2863 /**
2864 * @param {string} id
2865 * @return {CommandBase} command class
2866 */
2867 (0, _createClass2.default)(Commands, [{
2868 key: "getCommandClass",
2869 value: function getCommandClass(id) {
2870 return this.commands[id];
2871 }
2872
2873 /**
2874 * Function getAll().
2875 *
2876 * Receive all loaded commands.
2877 *
2878 * @return {string[]} commands
2879 */
2880 }, {
2881 key: "getAll",
2882 value: function getAll() {
2883 return Object.keys(this.commands).sort();
2884 }
2885
2886 /**
2887 * Function register().
2888 *
2889 * Register new command.
2890 *
2891 * @param {ComponentBase|string} component
2892 * @param {string} command
2893 * @param {Function} callback
2894 *
2895 * @return {Commands} commands
2896 */
2897 }, {
2898 key: "register",
2899 value: function register(component, command, callback) {
2900 var _this2 = this;
2901 var namespace;
2902 if ('string' === typeof component) {
2903 namespace = component;
2904 component = $e.components.get(namespace);
2905 if (!component) {
2906 this.error("'".concat(namespace, "' component is not exist."));
2907 }
2908 } else {
2909 namespace = component.getNamespace();
2910 }
2911 var fullCommand = namespace + (command ? '/' + command : '');
2912 if (this.commands[fullCommand]) {
2913 this.error("`".concat(fullCommand, "` is already registered."));
2914 }
2915 this.commands[fullCommand] = callback;
2916 this.components[fullCommand] = namespace;
2917 var shortcuts = component.getShortcuts(),
2918 shortcut = shortcuts[command];
2919 if (shortcut) {
2920 shortcut.command = fullCommand;
2921 shortcut.callback = function (event) {
2922 return _this2.runShortcut(fullCommand, event);
2923 };
2924 $e.shortcuts.register(shortcut.keys, shortcut);
2925 }
2926 return this;
2927 }
2928 }, {
2929 key: "unregister",
2930 value: function unregister(component, command) {
2931 var namespace;
2932 if ('string' === typeof component) {
2933 namespace = component;
2934 component = $e.components.get(namespace);
2935 if (!component) {
2936 this.error("'".concat(namespace, "' component is not exist."));
2937 }
2938 } else {
2939 namespace = component.getNamespace();
2940 }
2941 var fullCommand = namespace + (command ? '/' + command : '');
2942 if (!this.commands[fullCommand]) {
2943 this.error("`".concat(fullCommand, "` not exist."));
2944 }
2945 delete this.commands[fullCommand];
2946 delete this.components[fullCommand];
2947 var shortcuts = component.getShortcuts(),
2948 shortcut = shortcuts[command];
2949 if (shortcut) {
2950 $e.shortcuts.unregister(shortcut.keys, shortcut);
2951 }
2952 return this;
2953 }
2954
2955 /**
2956 * Function getComponent().
2957 *
2958 * Receive Component of the command.
2959 *
2960 * @param {string} command
2961 *
2962 * @return {Component} component
2963 */
2964 }, {
2965 key: "getComponent",
2966 value: function getComponent(command) {
2967 var namespace = this.components[command];
2968 return $e.components.get(namespace);
2969 }
2970
2971 /**
2972 * Function is().
2973 *
2974 * Checks if current running command is the same parameter command.
2975 *
2976 * @param {string} command
2977 *
2978 * @return {boolean} is this command the same as the one passed in the arguments
2979 */
2980 }, {
2981 key: "is",
2982 value: function is(command) {
2983 var component = this.getComponent(command);
2984 if (!component) {
2985 return false;
2986 }
2987 return command === this.current[component.getServiceName()];
2988 }
2989
2990 /**
2991 * Function isCurrentFirstTrace().
2992 *
2993 * Checks if parameter command is the first command in trace that currently running.
2994 *
2995 * @param {string} command
2996 *
2997 * @return {boolean} is parameter command the first command in trace that currently running
2998 */
2999 }, {
3000 key: "isCurrentFirstTrace",
3001 value: function isCurrentFirstTrace(command) {
3002 return command === this.getCurrentFirstTrace();
3003 }
3004
3005 /**
3006 * Function getCurrent().
3007 *
3008 * Receive currently running components and its commands.
3009 *
3010 * @param {string} container
3011 *
3012 * @return {{}|boolean|*} currently running components
3013 */
3014 }, {
3015 key: "getCurrent",
3016 value: function getCurrent() {
3017 var container = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
3018 if (container) {
3019 if (!this.current[container]) {
3020 return false;
3021 }
3022 return this.current[container];
3023 }
3024 return this.current;
3025 }
3026
3027 /**
3028 * Function getCurrentArgs().
3029 *
3030 * Receive currently running command args.
3031 *
3032 * @param {string} container
3033 *
3034 * @return {{}|boolean|*} current arguments
3035 */
3036 }, {
3037 key: "getCurrentArgs",
3038 value: function getCurrentArgs() {
3039 var container = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
3040 if (container) {
3041 if (!this.currentArgs[container]) {
3042 return false;
3043 }
3044 return this.currentArgs[container];
3045 }
3046 return this.currentArgs;
3047 }
3048
3049 /**
3050 * Function getCurrentFirst().
3051 *
3052 * Receive first command that currently running.
3053 *
3054 * @return {string} first running command
3055 */
3056 }, {
3057 key: "getCurrentFirst",
3058 value: function getCurrentFirst() {
3059 return Object.values(this.current)[0];
3060 }
3061
3062 /**
3063 * Function getCurrentLast().
3064 *
3065 * Receive last command that currently running.
3066 *
3067 * @return {string} last running command
3068 */
3069 }, {
3070 key: "getCurrentLast",
3071 value: function getCurrentLast() {
3072 var current = Object.values(this.current);
3073 return current[current.length - 1];
3074 }
3075
3076 /**
3077 * Function getCurrentFirstTrace().
3078 *
3079 * Receive first command in trace that currently running
3080 *
3081 * @return {string} first command in trace
3082 */
3083 }, {
3084 key: "getCurrentFirstTrace",
3085 value: function getCurrentFirstTrace() {
3086 return this.currentTrace[0];
3087 }
3088
3089 /**
3090 * Function beforeRun().
3091 *
3092 * Responsible to add current command to trace and trigger 'run:before' event.
3093 * Run before command.
3094 *
3095 * @param {string} command
3096 * @param {{}} args
3097 * @param {boolean} [addTrace=true]
3098 */
3099 }, {
3100 key: "beforeRun",
3101 value: function beforeRun(command) {
3102 var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
3103 var addTrace = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
3104 var component = this.getComponent(command),
3105 container = component.getServiceName();
3106 if (addTrace) {
3107 this.addCurrentTrace(container, command, args);
3108 }
3109 if (args.onBefore) {
3110 args.onBefore.apply(component, [args]);
3111 }
3112 this.trigger('run:before', component, command, args);
3113 window.dispatchEvent(new CustomEvent('elementor/commands/run/before', {
3114 detail: {
3115 command: command,
3116 args: args
3117 }
3118 }));
3119 }
3120
3121 /**
3122 * Function validateRun().
3123 *
3124 * Responsible to validate if the run is even possible.
3125 * Runs immediately after entering `run()`.
3126 *
3127 * @param {string} command
3128 * @param {*} args
3129 *
3130 * @return {boolean} dependency result
3131 */
3132 }, {
3133 key: "validateRun",
3134 value: function validateRun(command) {
3135 var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
3136 if (!this.commands[command]) {
3137 this.error("`".concat(command, "` not found."));
3138 }
3139 return this.getComponent(command).dependency(command, args);
3140 }
3141
3142 /**
3143 * Function run().
3144 *
3145 * Runs a command.
3146 *
3147 * @param {string} command
3148 * @param {{}} args
3149 *
3150 * @return {boolean|*} results
3151 */
3152 }, {
3153 key: "run",
3154 value: function run(command) {
3155 var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
3156 if (!this.validateRun(command, args)) {
3157 return false;
3158 }
3159 this.beforeRun(command, args);
3160
3161 // Get command class or callback.
3162 var context = this.commands[command];
3163
3164 // Is it command-base based class?
3165 if (context.getInstanceType) {
3166 context = new context(args);
3167 }
3168 var currentComponent = this.getComponent(command);
3169
3170 // Is simple callback? (e.g. a route)
3171 if (!(context instanceof _commandBase.default)) {
3172 var results = context.apply(currentComponent, [args]);
3173 this.afterRun(command, args, results);
3174 return results;
3175 }
3176 if (!this.validateInstanceScope(context, currentComponent, command)) {
3177 return this.removeCurrentTrace(currentComponent);
3178 }
3179 return this.runInstance(context);
3180 }
3181
3182 /**
3183 * Function runInstance().
3184 *
3185 * @param {CommandBase} instance
3186 *
3187 * @return {boolean|Promise<*>}
3188 */
3189 }, {
3190 key: "runInstance",
3191 value: function runInstance(instance) {
3192 var results = null;
3193
3194 // For UI Hooks.
3195 instance.onBeforeRun(instance.args);
3196 try {
3197 // For data hooks.
3198 instance.onBeforeApply(instance.args);
3199 results = instance.run();
3200 } catch (e) {
3201 this.catchApply(e, instance);
3202 if (e instanceof $e.modules.HookBreak) {
3203 this.removeCurrentTrace(instance.component);
3204 return false;
3205 }
3206 }
3207 return this.applyRunAfter(instance, results);
3208 }
3209
3210 /**
3211 * Function applyRunAfter().
3212 *
3213 * Responsible for applying everything that need to be run after each command runs.
3214 * Called on run() after runInstance(), to manipulate results & apply 'after' hooks.
3215 *
3216 * @param {CommandBase} instance
3217 * @param {*} result
3218 *
3219 * @return {Promise<*>|*}
3220 */
3221 }, {
3222 key: "applyRunAfter",
3223 value: function applyRunAfter(instance, result) {
3224 var _this3 = this;
3225 // TODO: Temp code determine if it's a jQuery deferred object.
3226 if (result && 'object' === (0, _typeof2.default)(result) && result.promise && result.then && result.fail) {
3227 var handleJQueryDeferred = function handleJQueryDeferred(_result) {
3228 _result.fail(function (e) {
3229 _this3.catchApply(e, instance);
3230 _this3.afterRun(instance.command, instance.args, e);
3231 });
3232 _result.done(function (__result) {
3233 _this3.applyRunAfterSync(instance, __result);
3234 });
3235 return _result;
3236 };
3237 return handleJQueryDeferred(result);
3238 } else if (result instanceof Promise) {
3239 return this.applyRunAfterAsync(instance, result);
3240 }
3241 this.applyRunAfterSync(instance, result);
3242 return result;
3243 }
3244
3245 /**
3246 * Function applyRunAfterSync().
3247 *
3248 * Responsible to handle simple(synchronous) 'run after' behavior.
3249 * Called on applyRunAfterSync() after runInstance(), to handle results.
3250 *
3251 * @param {CommandBase} instance
3252 * @param {*} result
3253 */
3254 }, {
3255 key: "applyRunAfterSync",
3256 value: function applyRunAfterSync(instance, result) {
3257 // Run Data hooks.
3258 instance.onAfterApply(instance.args, result);
3259
3260 // For UI hooks.
3261 instance.onAfterRun(instance.args, result);
3262 this.afterRun(instance.command, instance.args, result);
3263 }
3264
3265 /**
3266 * Function applyRunAfterAsync().
3267 *
3268 * Await for promise result.
3269 * Called on applyRunAfter() after runInstance().
3270 *
3271 * @param {CommandBase} instance
3272 * @param {*} result
3273 */
3274 }, {
3275 key: "applyRunAfterAsync",
3276 value: function applyRunAfterAsync(instance, result) {
3277 var _this4 = this;
3278 // Override initial result ( promise ) to await onAfter promises, first!.
3279 return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
3280 return _regenerator.default.wrap(function _callee$(_context) {
3281 while (1) switch (_context.prev = _context.next) {
3282 case 0:
3283 _context.next = 2;
3284 return result.catch(function (e) {
3285 _this4.catchApply(e, instance);
3286 _this4.afterRun(instance.command, instance.args, e);
3287 });
3288 case 2:
3289 _context.next = 4;
3290 return result.then(function (_result) {
3291 return _this4.applyRunAfterAsyncResult(instance, _result);
3292 });
3293 case 4:
3294 return _context.abrupt("return", result);
3295 case 5:
3296 case "end":
3297 return _context.stop();
3298 }
3299 }, _callee);
3300 }))();
3301 }
3302
3303 /**
3304 * Function applyRunAfterAsyncResult().
3305 *
3306 * Responsible to await all promises results.
3307 * Called on applyRunAfterAsync() after runInstance(), to handle async results.
3308 * Awaits all the promises, before releasing the command.
3309 *
3310 * @param {CommandBase} instance
3311 * @param {*} result
3312 */
3313 }, {
3314 key: "applyRunAfterAsyncResult",
3315 value: function () {
3316 var _applyRunAfterAsyncResult = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(instance, result) {
3317 var results, promises;
3318 return _regenerator.default.wrap(function _callee2$(_context2) {
3319 while (1) switch (_context2.prev = _context2.next) {
3320 case 0:
3321 // Run Data hooks.
3322 results = instance.onAfterApply(instance.args, result), promises = Array.isArray(results) ? results.flat().filter(function (filtered) {
3323 return filtered instanceof Promise;
3324 }) : [];
3325 if (!promises.length) {
3326 _context2.next = 4;
3327 break;
3328 }
3329 _context2.next = 4;
3330 return Promise.all(promises);
3331 case 4:
3332 // For UI hooks.
3333 instance.onAfterRun(instance.args, result);
3334 this.afterRun(instance.command, instance.args, result);
3335 case 6:
3336 case "end":
3337 return _context2.stop();
3338 }
3339 }, _callee2, this);
3340 }));
3341 function applyRunAfterAsyncResult(_x, _x2) {
3342 return _applyRunAfterAsyncResult.apply(this, arguments);
3343 }
3344 return applyRunAfterAsyncResult;
3345 }()
3346 /**
3347 * Function afterRun().
3348 *
3349 * Responsible to to clear command from trace, and run 'run:after' event.
3350 * Method fired after the command runs.
3351 *
3352 * @param {string} command
3353 * @param {{}} args
3354 * @param {*} results
3355 * @param {boolean} [removeTrace=true]
3356 */
3357 }, {
3358 key: "afterRun",
3359 value: function afterRun(command, args) {
3360 var results = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
3361 var removeTrace = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
3362 var component = this.getComponent(command);
3363 if (args.onAfter) {
3364 args.onAfter.apply(component, [args, results]);
3365 }
3366 this.trigger('run:after', component, command, args, results);
3367 window.dispatchEvent(new CustomEvent('elementor/commands/run/after', {
3368 detail: {
3369 command: command,
3370 args: args
3371 }
3372 }));
3373 if (removeTrace) {
3374 this.removeCurrentTrace(component);
3375 }
3376 }
3377
3378 /**
3379 * @param {Error} e
3380 * @param {CommandBase} instance
3381 */
3382 }, {
3383 key: "catchApply",
3384 value: function catchApply(e, instance) {
3385 instance.onCatchApply(e);
3386 _console.default.error(e);
3387 }
3388
3389 /**
3390 * Function runShortcut().
3391 *
3392 * Run shortcut.
3393 *
3394 * It's separated in order to allow override.
3395 *
3396 * @param {string} command
3397 * @param {*} event
3398 *
3399 * @return {boolean|*} result
3400 */
3401 }, {
3402 key: "runShortcut",
3403 value: function runShortcut(command, event) {
3404 return this.run(command, event);
3405 }
3406 }, {
3407 key: "validateInstanceScope",
3408 value: function validateInstanceScope(instance, currentComponent, command) {
3409 if (!(instance instanceof _commandBase.default)) {
3410 this.error("invalid instance, command: '".concat(command, "' "));
3411 }
3412
3413 // In case of different scope.
3414 if (currentComponent !== instance.component) {
3415 if ($e.devTools) {
3416 $e.devTools.log.warn("Command: '".concat(command, "' registerArgs.component: '").concat(instance.component.getNamespace(), "' while current component is: '").concat(currentComponent.getNamespace(), "'"));
3417 }
3418 return false;
3419 }
3420 return true;
3421 }
3422 }, {
3423 key: "addCurrentTrace",
3424 value: function addCurrentTrace(container, command, args) {
3425 this.currentTrace.push(command);
3426 Commands.trace.push(command);
3427 this.attachCurrent(container, command, args);
3428 }
3429 }, {
3430 key: "removeCurrentTrace",
3431 value: function removeCurrentTrace(currentComponent) {
3432 var container = currentComponent.getServiceName();
3433 this.currentTrace.pop();
3434 Commands.trace.pop();
3435 this.detachCurrent(container);
3436 }
3437 }, {
3438 key: "attachCurrent",
3439 value: function attachCurrent(container, command, args) {
3440 this.current[container] = command;
3441 this.currentArgs[container] = args;
3442 }
3443 }, {
3444 key: "detachCurrent",
3445 value: function detachCurrent(container) {
3446 delete this.current[container];
3447 delete this.currentArgs[container];
3448 }
3449
3450 /**
3451 * Function error().
3452 *
3453 * Throws error.
3454 *
3455 * @throws {Error}
3456 *
3457 * @param {string} message
3458 */
3459 }, {
3460 key: "error",
3461 value: function error(message) {
3462 throw Error("Commands: ".concat(message));
3463 }
3464 }]);
3465 return Commands;
3466 }(_commands.default);
3467 exports["default"] = Commands;
3468 (0, _defineProperty2.default)(Commands, "trace", []);
3469
3470 /***/ }),
3471
3472 /***/ "../modules/web-cli/assets/js/core/components.js":
3473 /*!*******************************************************!*\
3474 !*** ../modules/web-cli/assets/js/core/components.js ***!
3475 \*******************************************************/
3476 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
3477
3478 "use strict";
3479
3480
3481 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
3482 Object.defineProperty(exports, "__esModule", ({
3483 value: true
3484 }));
3485 exports["default"] = void 0;
3486 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
3487 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
3488 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
3489 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
3490 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
3491 var _module = _interopRequireDefault(__webpack_require__(/*! elementor-assets-js/modules/imports/module.js */ "../assets/dev/js/modules/imports/module.js"));
3492 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
3493 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
3494 /**
3495 * @typedef {{}} Component
3496 */
3497 var _default = /*#__PURE__*/function (_Module) {
3498 (0, _inherits2.default)(_default, _Module);
3499 var _super = _createSuper(_default);
3500 function _default() {
3501 var _this;
3502 (0, _classCallCheck2.default)(this, _default);
3503 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
3504 args[_key] = arguments[_key];
3505 }
3506 _this = _super.call.apply(_super, [this].concat(args));
3507 _this.components = {};
3508 _this.activeComponents = {};
3509 return _this;
3510 }
3511 (0, _createClass2.default)(_default, [{
3512 key: "getAll",
3513 value: function getAll() {
3514 return Object.keys(this.components).sort();
3515 }
3516 }, {
3517 key: "register",
3518 value: function register(component) {
3519 if (this.components[component.getNamespace()]) {
3520 return;
3521 }
3522 component.registerAPI();
3523 this.components[component.getNamespace()] = component;
3524 return component;
3525 }
3526
3527 /**
3528 * @param {string} id
3529 * @return {Component} component
3530 */
3531 }, {
3532 key: "get",
3533 value: function get(id) {
3534 return this.components[id];
3535 }
3536 }, {
3537 key: "getActive",
3538 value: function getActive() {
3539 return this.activeComponents;
3540 }
3541 }, {
3542 key: "activate",
3543 value: function activate(namespace) {
3544 // Add as last.
3545 this.inactivate(namespace);
3546 this.activeComponents[namespace] = true;
3547 }
3548 }, {
3549 key: "inactivate",
3550 value: function inactivate(namespace) {
3551 delete this.activeComponents[namespace];
3552 }
3553 }, {
3554 key: "isActive",
3555 value: function isActive(namespace) {
3556 return !!this.activeComponents[namespace];
3557 }
3558 }]);
3559 return _default;
3560 }(_module.default);
3561 exports["default"] = _default;
3562
3563 /***/ }),
3564
3565 /***/ "../modules/web-cli/assets/js/core/data.js":
3566 /*!*************************************************!*\
3567 !*** ../modules/web-cli/assets/js/core/data.js ***!
3568 \*************************************************/
3569 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
3570
3571 "use strict";
3572
3573
3574 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
3575 Object.defineProperty(exports, "__esModule", ({
3576 value: true
3577 }));
3578 exports["default"] = exports.READABLE = exports.EDITABLE = exports.DELETABLE = exports.CREATABLE = exports.ALLMETHODS = void 0;
3579 var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js"));
3580 var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js"));
3581 var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
3582 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
3583 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
3584 var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js"));
3585 var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js"));
3586 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
3587 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
3588 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
3589 var _argsObject = _interopRequireDefault(__webpack_require__(/*! elementor-assets-js/modules/imports/args-object */ "../assets/dev/js/modules/imports/args-object.js"));
3590 var _commands = _interopRequireDefault(__webpack_require__(/*! ./commands.js */ "../modules/web-cli/assets/js/core/commands.js"));
3591 var _cache = _interopRequireDefault(__webpack_require__(/*! ./data/cache */ "../modules/web-cli/assets/js/core/data/cache.js"));
3592 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
3593 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
3594 /**
3595 * @typedef {('create'|'delete'|'get'|'update'|'options')} DataTypes
3596 */
3597 /**
3598 * @typedef {import('../modules/component-base')} ComponentBase
3599 */
3600 /**
3601 * @typedef {{}} RequestInfo
3602 */
3603
3604 /**
3605 * @typedef {{}} RequestData
3606 * @property {ComponentBase} component component
3607 * @property {string} command command
3608 * @property {{}} args arguments
3609 * @property {DataTypes} type type
3610 * @property {number} timestamp timestamp
3611 * @property {string} endpoint endpoint
3612 *
3613 * @property {string} [baseEndpointURL] baseEndpointURL
3614 * @property {string} [namespace] namespace
3615 * @property {string} [version] version
3616 * @property {('hit'|'miss')} [cache] cache
3617 */
3618
3619 /**
3620 * @typedef {Object} ExtractedCommand
3621 * @property {string} command command
3622 * @property {Object} args arguments
3623 */
3624
3625 // TODO: Return it from the server. Original at WP_REST_Server.
3626 var READABLE = ['GET'],
3627 CREATABLE = ['POST'],
3628 EDITABLE = ['POST', 'PUT', 'PATCH'],
3629 DELETABLE = ['DELETE'],
3630 ALLMETHODS = ['GET', 'POST', 'PUT', 'PATCH', 'DELETE'];
3631 exports.ALLMETHODS = ALLMETHODS;
3632 exports.DELETABLE = DELETABLE;
3633 exports.EDITABLE = EDITABLE;
3634 exports.CREATABLE = CREATABLE;
3635 exports.READABLE = READABLE;
3636 var Data = /*#__PURE__*/function (_Commands) {
3637 (0, _inherits2.default)(Data, _Commands);
3638 var _super = _createSuper(Data);
3639 function Data() {
3640 var _this;
3641 var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3642 (0, _classCallCheck2.default)(this, Data);
3643 _this = _super.call(this, args);
3644 _this.args = Object.assign(args, {
3645 namespace: 'elementor',
3646 version: '1',
3647 baseEndpointURL: elementorWebCliConfig.urls.rest
3648 });
3649 _this.cache = new _cache.default((0, _assertThisInitialized2.default)(_this));
3650 _this.validatedRequests = {};
3651 _this.commandFormats = {};
3652 return _this;
3653 }
3654
3655 /**
3656 * Function getHTTPMethod().
3657 *
3658 * Returns HTTP Method by type.
3659 *
3660 * @param {DataTypes} type
3661 *
3662 * @return {string|boolean} HTTP Method
3663 */
3664 (0, _createClass2.default)(Data, [{
3665 key: "getHTTPMethod",
3666 value: function getHTTPMethod(type) {
3667 switch (type) {
3668 case 'create':
3669 return 'POST';
3670 case 'delete':
3671 return 'DELETE';
3672 case 'get':
3673 return 'GET';
3674 case 'update':
3675 return 'PUT';
3676 case 'options':
3677 return 'OPTIONS';
3678 }
3679 return false;
3680 }
3681
3682 /**
3683 * Function getAllowedMethods().
3684 *
3685 * Returns allowed HTTP methods by type.
3686 *
3687 * @param {DataTypes} type
3688 *
3689 * @return {[string]|boolean} allowed HTTP methods
3690 */
3691 }, {
3692 key: "getAllowedMethods",
3693 value: function getAllowedMethods(type) {
3694 switch (type) {
3695 case 'create':
3696 return CREATABLE;
3697 case 'delete':
3698 return DELETABLE;
3699 case 'get':
3700 return READABLE;
3701 case 'update':
3702 return EDITABLE;
3703 case 'options':
3704 return ['OPTIONS'];
3705 }
3706 return false;
3707 }
3708
3709 /**
3710 * Function getEndpointURL().
3711 *
3712 * Get remote endpoint address.
3713 *
3714 * @param {RequestData} requestData
3715 * @param {string} [endpoint=requestData.endpoint]
3716 *
3717 * @return {string} endpoint address
3718 */
3719 }, {
3720 key: "getEndpointURL",
3721 value: function getEndpointURL(requestData) {
3722 var endpoint = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : requestData.endpoint;
3723 // Allow to request data override default namespace and args.
3724 var _requestData$baseEndp = requestData.baseEndpointURL,
3725 baseEndpointURL = _requestData$baseEndp === void 0 ? this.args.baseEndpointURL : _requestData$baseEndp,
3726 _requestData$namespac = requestData.namespace,
3727 namespace = _requestData$namespac === void 0 ? this.args.namespace : _requestData$namespac,
3728 _requestData$version = requestData.version,
3729 version = _requestData$version === void 0 ? this.args.version : _requestData$version;
3730 return "".concat(baseEndpointURL).concat(namespace, "/v").concat(version, "/") + endpoint;
3731 }
3732
3733 /**
3734 * Function commandToEndpoint().
3735 *
3736 * Convert command to endpoint.
3737 *
3738 * For example `component/command/{arg}` => `controller/endpoint/8`.
3739 *
3740 * TODO: Find a better solution.
3741 *
3742 * @param {string} command
3743 * @param {{}} args
3744 * @param {string|null} [format]
3745 *
3746 * @return {string} endpoint
3747 */
3748 }, {
3749 key: "commandToEndpoint",
3750 value: function commandToEndpoint(command, args) {
3751 var format = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
3752 var endpoint = command;
3753 var argsQueryLength = args !== null && args !== void 0 && args.query ? Object.values(args.query).length : 0;
3754 if (argsQueryLength && format && format.includes('/{')) {
3755 // Means command includes magic query arguments ( controller/endpoint/{whatever} ).
3756 var magicParams = format.split('/').filter(function (str) {
3757 return '{' === str.charAt(0);
3758 });
3759 magicParams.forEach(function (param) {
3760 // Remove the '{', '}'.
3761 param = param.replace('{', '');
3762 param = param.replace('}', '');
3763 var formatted = Object.entries(args.query).find(function (_ref) {
3764 var _ref2 = (0, _slicedToArray2.default)(_ref, 1),
3765 key = _ref2[0];
3766 return key === param;
3767 });
3768 if (!formatted) {
3769 return;
3770 }
3771 var key = formatted[0],
3772 value = formatted[1].toString();
3773
3774 // Replace magic params with values.
3775 format = format.replace(new RegExp('{' + param + '}', 'g'), value);
3776 delete args.query[key];
3777 });
3778 }
3779 if (format) {
3780 endpoint = format;
3781 }
3782
3783 // If requested magic param does not exist in args, need to remove it to have fixed endpoint.
3784 // eg: 'documents/{documentId}/elements/{elementId}' and args { documentId: 4123 }.
3785 // result: 'documents/4123/elements'
3786 if (format && endpoint.includes('/{')) {
3787 endpoint = endpoint.substring(0, endpoint.indexOf('/{'));
3788 }
3789 if (args.query && Object.values(args.query).length) {
3790 // Sorting since the endpoint later will be used as key to store the cache.
3791 var queryEntries = Object.entries(args.query).sort(function (_ref3, _ref4) {
3792 var _ref5 = (0, _slicedToArray2.default)(_ref3, 1),
3793 aKey = _ref5[0];
3794 var _ref6 = (0, _slicedToArray2.default)(_ref4, 1),
3795 bKey = _ref6[0];
3796 return aKey - bKey;
3797 } // Sort by param name.
3798 );
3799
3800 // `args.query` will become a part of GET params.
3801 if (queryEntries.length) {
3802 endpoint += '?';
3803 queryEntries.forEach(function (_ref7) {
3804 var _ref8 = (0, _slicedToArray2.default)(_ref7, 2),
3805 name = _ref8[0],
3806 value = _ref8[1];
3807 // Replace the character '/' with the encoded version,
3808 // mostly because when saving this endpoint value to the cache it splits the url base on the '/' character.
3809 value = "".concat(value).replace(/\//g, '%2F');
3810 endpoint += name + '=' + value + '&';
3811 });
3812 }
3813
3814 // If last character is '&' remove it.
3815 endpoint = endpoint.replace(/&$/, '');
3816 }
3817 return endpoint;
3818 }
3819
3820 /**
3821 * Function commandExtractArgs().
3822 *
3823 * If the command have query convert it to args.
3824 *
3825 * @param {string} command
3826 * @param {Object} args
3827 *
3828 * @return {ExtractedCommand} command
3829 */
3830 }, {
3831 key: "commandExtractArgs",
3832 value: function commandExtractArgs(command) {
3833 var _command;
3834 var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
3835 if ((_command = command) !== null && _command !== void 0 && _command.includes('?')) {
3836 if (!args.query) {
3837 args.query = {};
3838 }
3839 var commandParts = command.split('?'),
3840 pureCommand = commandParts[0],
3841 queryString = commandParts[1],
3842 query = new URLSearchParams(queryString);
3843 Object.assign(args.query, Object.fromEntries(query));
3844 command = pureCommand;
3845 }
3846 return {
3847 command: command,
3848 args: args
3849 };
3850 }
3851
3852 /**
3853 * Function validateRequestData().
3854 *
3855 * Validate request data requirements.
3856 *
3857 * @param {RequestData} requestData
3858 * @param {boolean} [requireArgsData]
3859 */
3860 }, {
3861 key: "validateRequestData",
3862 value: function validateRequestData(requestData) {
3863 var requireArgsData = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
3864 // Do not validate if its already valid.
3865 if (requestData.timestamp && this.validatedRequests[requestData.timestamp]) {
3866 return;
3867 }
3868 var argsObject = new _argsObject.default(requestData);
3869 argsObject.requireArgument('component');
3870 argsObject.requireArgumentType('command', 'string');
3871 argsObject.requireArgumentType('endpoint', 'string');
3872 if (requireArgsData) {
3873 argsObject.requireArgumentType('data', 'object', requestData.args);
3874 }
3875
3876 // Ensure timestamp.
3877 if (!requestData.timestamp) {
3878 requestData.timestamp = new Date().getTime();
3879 }
3880 this.validatedRequests[requestData.timestamp] = true;
3881 }
3882
3883 /**
3884 * Function prepareHeaders().
3885 *
3886 * Prepare the headers for each request.
3887 *
3888 * @param {RequestData} requestData
3889 *
3890 * @return {{}} params
3891 */
3892 }, {
3893 key: "prepareHeaders",
3894 value: function prepareHeaders(requestData) {
3895 var _requestData$args, _requestData$args$opt;
3896 var type = requestData.type,
3897 nonce = elementorWebCliConfig.nonce,
3898 params = {
3899 signal: (_requestData$args = requestData.args) === null || _requestData$args === void 0 ? void 0 : (_requestData$args$opt = _requestData$args.options) === null || _requestData$args$opt === void 0 ? void 0 : _requestData$args$opt.signal,
3900 credentials: 'include' // Cookies is required for wp reset.
3901 },
3902 headers = {
3903 'X-WP-Nonce': nonce
3904 };
3905
3906 /**
3907 * Translate:
3908 * 'create, delete, get, update' to HTTP Methods:
3909 * 'GET, POST, PUT, PATCH, DELETE'
3910 */
3911 var allowedMethods = this.getAllowedMethods(type),
3912 method = this.getHTTPMethod(type);
3913 if ('GET' === method) {
3914 Object.assign(params, {
3915 headers: headers
3916 });
3917 } else if (allowedMethods) {
3918 var _requestData$args2, _requestData$args3;
3919 if (['POST', 'PUT'].includes(method) && !((_requestData$args2 = requestData.args) !== null && _requestData$args2 !== void 0 && _requestData$args2.data)) {
3920 throw Error('Invalid requestData.args.data');
3921 }
3922 Object.assign(headers, {
3923 'Content-Type': 'application/json'
3924 });
3925 if ((_requestData$args3 = requestData.args) !== null && _requestData$args3 !== void 0 && _requestData$args3.headers) {
3926 Object.assign(headers, requestData.args.headers);
3927 }
3928 Object.assign(params, {
3929 method: method,
3930 headers: headers,
3931 body: 'application/json' === headers['Content-Type'] ? JSON.stringify(requestData.args.data) : requestData.args.data
3932 });
3933 } else {
3934 throw Error("Invalid type: '".concat(type, "'"));
3935 }
3936 return params;
3937 }
3938
3939 /**
3940 * Function prepareEndpoint().
3941 *
3942 * This method response for building a final endpoint,
3943 * the main problem is with plain permalink mode + command with query params that creates a weird url,
3944 * the current method should fix it.
3945 *
3946 * @param {RequestData} requestData
3947 *
3948 * @return {string} Endpoint URL
3949 */
3950 }, {
3951 key: "prepareEndpoint",
3952 value: function prepareEndpoint(requestData) {
3953 var splitEndpoint = requestData.endpoint.split('?'),
3954 endpoint = splitEndpoint.shift();
3955 var endpointAddress = this.getEndpointURL(requestData, endpoint);
3956 if (splitEndpoint.length) {
3957 var separator = endpointAddress.includes('?') ? '&' : '?';
3958 endpointAddress += separator + splitEndpoint.pop();
3959 }
3960 return endpointAddress;
3961 }
3962
3963 /**
3964 * Function fetch().
3965 *
3966 * @param {RequestData} requestData
3967 * @param {function(RequestInfo,*) : Promise<Response> } [fetchAPI]
3968 *
3969 * @return {Promise<Response>} response
3970 */
3971 }, {
3972 key: "fetch",
3973 value: function fetch(requestData) {
3974 var _requestData$args$opt2,
3975 _this2 = this;
3976 var fetchAPI = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window.fetch;
3977 requestData.cache = 'miss';
3978 var refresh = (_requestData$args$opt2 = requestData.args.options) === null || _requestData$args$opt2 === void 0 ? void 0 : _requestData$args$opt2.refresh,
3979 getCache = 'get' === requestData.type && !refresh,
3980 saveCache = ['create', 'get'].includes(requestData.type) && !refresh;
3981 if (getCache) {
3982 var cachePromise = this.cache.getAsync(requestData);
3983 if (cachePromise) {
3984 return cachePromise;
3985 }
3986 }
3987 var params = this.prepareHeaders(requestData);
3988 // eslint-disable-next-line no-async-promise-executor
3989 return new Promise( /*#__PURE__*/function () {
3990 var _ref9 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(resolve, reject) {
3991 var endpoint, request, response;
3992 return _regenerator.default.wrap(function _callee2$(_context2) {
3993 while (1) switch (_context2.prev = _context2.next) {
3994 case 0:
3995 _context2.prev = 0;
3996 endpoint = _this2.prepareEndpoint(requestData);
3997 request = fetchAPI(endpoint, params);
3998 _context2.next = 5;
3999 return request.then( /*#__PURE__*/function () {
4000 var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_response) {
4001 return _regenerator.default.wrap(function _callee$(_context) {
4002 while (1) switch (_context.prev = _context.next) {
4003 case 0:
4004 if (_response.ok) {
4005 _context.next = 6;
4006 break;
4007 }
4008 if (!_response.headers.get('content-type').includes('application/json')) {
4009 _context.next = 5;
4010 break;
4011 }
4012 _context.next = 4;
4013 return _response.json();
4014 case 4:
4015 _response = _context.sent;
4016 case 5:
4017 throw _response;
4018 case 6:
4019 return _context.abrupt("return", _response.json());
4020 case 7:
4021 case "end":
4022 return _context.stop();
4023 }
4024 }, _callee);
4025 }));
4026 return function (_x3) {
4027 return _ref10.apply(this, arguments);
4028 };
4029 }());
4030 case 5:
4031 response = _context2.sent;
4032 // At this point, it got the resolved response from remote.
4033 // So load cache, and resolve it.
4034 if (saveCache) {
4035 _this2.cache.set(requestData, response);
4036 }
4037 resolve(response);
4038 _context2.next = 13;
4039 break;
4040 case 10:
4041 _context2.prev = 10;
4042 _context2.t0 = _context2["catch"](0);
4043 reject(_context2.t0);
4044 case 13:
4045 case "end":
4046 return _context2.stop();
4047 }
4048 }, _callee2, null, [[0, 10]]);
4049 }));
4050 return function (_x, _x2) {
4051 return _ref9.apply(this, arguments);
4052 };
4053 }());
4054 }
4055
4056 /**
4057 * Function getCache().
4058 *
4059 * @param {ComponentBase} component
4060 * @param {string} command
4061 * @param {{}} query
4062 *
4063 * @return {{}} cache object
4064 */
4065 }, {
4066 key: "getCache",
4067 value: function getCache(component, command) {
4068 var query = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
4069 var args = {
4070 query: query
4071 };
4072 return this.cache.get({
4073 endpoint: this.commandToEndpoint(command, args, this.commandFormats[command]),
4074 component: component,
4075 command: command,
4076 args: args
4077 });
4078 }
4079
4080 /**
4081 * Function setCache().
4082 *
4083 * @param {ComponentBase} component
4084 * @param {string} command
4085 * @param {{}} query
4086 * @param {*} data
4087 */
4088 }, {
4089 key: "setCache",
4090 value: function setCache(component, command, query, data) {
4091 var args = {
4092 query: query
4093 };
4094 this.cache.set({
4095 endpoint: this.commandToEndpoint(command, args, this.commandFormats[command]),
4096 component: component,
4097 command: command,
4098 args: args
4099 }, data);
4100 }
4101
4102 /**
4103 * Function updateCache().
4104 *
4105 * The difference between 'setCache' and 'updateCache' is update will only modify exist values.
4106 * and 'setCache' will create or update.
4107 *
4108 * @param {ComponentBase} component
4109 * @param {string} command
4110 * @param {{}} query
4111 * @param {*} data
4112 */
4113 }, {
4114 key: "updateCache",
4115 value: function updateCache(component, command, query, data) {
4116 var args = {
4117 query: query,
4118 data: data
4119 };
4120 this.cache.update({
4121 endpoint: this.commandToEndpoint(command, args, this.commandFormats[command]),
4122 component: component,
4123 command: command,
4124 args: args
4125 });
4126 }
4127
4128 /**
4129 * Function deleteCache().
4130 *
4131 * @param {ComponentBase} component
4132 * @param {string} command
4133 * @param {{}} query
4134 */
4135 }, {
4136 key: "deleteCache",
4137 value: function deleteCache(component, command) {
4138 var query = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
4139 var args = {
4140 query: query
4141 };
4142 this.cache.delete({
4143 endpoint: this.commandToEndpoint(command, args, this.commandFormats[command]),
4144 component: component,
4145 command: command,
4146 args: args
4147 });
4148 }
4149
4150 /**
4151 * Function registerFormat().
4152 *
4153 * Register's format for each command.
4154 *
4155 * @param {string} command
4156 * @param {string} format
4157 */
4158 }, {
4159 key: "registerFormat",
4160 value: function registerFormat(command, format) {
4161 this.commandFormats[command] = format;
4162 }
4163
4164 /**
4165 * Function create().
4166 *
4167 * Run a command, that will be translated as endpoint for creating new data.
4168 *
4169 * @param {string} command
4170 * @param {*} data
4171 * @param {{}} query
4172 * @param {{}} options
4173 *
4174 * @return {*} result
4175 */
4176 }, {
4177 key: "create",
4178 value: function create(command, data) {
4179 var query = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
4180 var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
4181 return this.run('create', command, {
4182 query: query,
4183 options: options,
4184 data: data
4185 });
4186 }
4187
4188 /**
4189 * Function delete().
4190 *
4191 * Run a command, that will be translated as endpoint for deleting data.
4192 *
4193 * @param {string} command
4194 * @param {{}} query
4195 * @param {{}} options
4196 *
4197 * @return {*} result
4198 */
4199 }, {
4200 key: "delete",
4201 value: function _delete(command) {
4202 var query = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
4203 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
4204 return this.run('delete', command, {
4205 query: query,
4206 options: options
4207 });
4208 }
4209
4210 /**
4211 * Function get().
4212 *
4213 * Run a command, that will be translated as endpoint for getting data.
4214 *
4215 * @param {string} command
4216 * @param {{}} query
4217 * @param {{}} options
4218 *
4219 * @return {*} result
4220 */
4221 }, {
4222 key: "get",
4223 value: function get(command) {
4224 var query = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
4225 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
4226 return this.run('get', command, {
4227 query: query,
4228 options: options
4229 });
4230 }
4231
4232 /**
4233 * Function update().
4234 *
4235 * Run a command, that will be translated as endpoint for updating data.
4236 *
4237 * @param {string} command
4238 * @param {*} data
4239 * @param {{}} query
4240 * @param {{}} options
4241 *
4242 * @return {*} result
4243 */
4244 }, {
4245 key: "update",
4246 value: function update(command, data) {
4247 var query = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
4248 var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
4249 return this.run('update', command, {
4250 query: query,
4251 options: options,
4252 data: data
4253 });
4254 }
4255
4256 /**
4257 * Function options().
4258 *
4259 * Run a command, that will be translated as endpoint for requesting options/information about specific endpoint.
4260 *
4261 * @param {string} command
4262 * @param {{}} query
4263 * @param {{}} options
4264 *
4265 * @return {*} result
4266 */
4267 }, {
4268 key: "options",
4269 value: function options(command, query) {
4270 var _options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
4271 return this.run('options', command, {
4272 query: query,
4273 options: _options
4274 });
4275 }
4276 }, {
4277 key: "register",
4278 value: function register(component, command, callback) {
4279 (0, _get2.default)((0, _getPrototypeOf2.default)(Data.prototype), "register", this).call(this, component, command, callback);
4280 var fullCommandName = component.getNamespace() + '/' + command,
4281 commandInstance = $e.data.getCommandClass(fullCommandName),
4282 format = commandInstance !== null && commandInstance !== void 0 && commandInstance.getEndpointFormat ? commandInstance.getEndpointFormat() : false;
4283 if (format) {
4284 $e.data.registerFormat(fullCommandName, format);
4285 }
4286 return this;
4287 }
4288
4289 /**
4290 * TODO: Add JSDOC typedef for args ( query and options ).
4291 *
4292 * @param {DataTypes} type
4293 * @param {string} command
4294 * @param {{}} args
4295 *
4296 * @override
4297 */
4298 }, {
4299 key: "run",
4300 value: function run(type, command, args) {
4301 args.options.type = type;
4302 var _this$commandExtractA = this.commandExtractArgs(command, args);
4303 command = _this$commandExtractA.command;
4304 args = _this$commandExtractA.args;
4305 return (0, _get2.default)((0, _getPrototypeOf2.default)(Data.prototype), "run", this).call(this, command, args);
4306 }
4307 }, {
4308 key: "error",
4309 value: function error(message) {
4310 throw Error('Data commands: ' + message);
4311 }
4312 }]);
4313 return Data;
4314 }(_commands.default);
4315 exports["default"] = Data;
4316
4317 /***/ }),
4318
4319 /***/ "../modules/web-cli/assets/js/core/data/cache.js":
4320 /*!*******************************************************!*\
4321 !*** ../modules/web-cli/assets/js/core/data/cache.js ***!
4322 \*******************************************************/
4323 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4324
4325 "use strict";
4326
4327
4328 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
4329 Object.defineProperty(exports, "__esModule", ({
4330 value: true
4331 }));
4332 exports["default"] = void 0;
4333 var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"));
4334 var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
4335 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
4336 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
4337 var _localStorage = _interopRequireDefault(__webpack_require__(/*! ./storages/local-storage */ "../modules/web-cli/assets/js/core/data/storages/local-storage.js"));
4338 /**
4339 * @typedef {{}} RequestData
4340 */
4341 /**
4342 * @typedef {import('../data')} Data
4343 */
4344 /**
4345 * TODO: Search common logic, create functions to reduce code size.
4346 */
4347 var Cache = /*#__PURE__*/function () {
4348 /**
4349 * Function constructor().
4350 *
4351 * Create cache.
4352 *
4353 * @param {Data} manager
4354 */
4355 function Cache(manager) {
4356 (0, _classCallCheck2.default)(this, Cache);
4357 this.manager = manager;
4358 this.storage = new _localStorage.default();
4359 }
4360
4361 /**
4362 * Function getAsync().
4363 *
4364 * Receive from cache. the difference between getAsync() and get() is that receive return it as promise...
4365 * to fake fetch mechanism.
4366 *
4367 * @param {RequestData} requestData
4368 *
4369 * @return {(Promise|boolean)} request data
4370 */
4371 (0, _createClass2.default)(Cache, [{
4372 key: "getAsync",
4373 value: function getAsync(requestData) {
4374 var data = this.get(requestData);
4375 if (null !== data) {
4376 // If data comes from cache, add 'cache = hit' to requestData.
4377 requestData.cache = 'hit';
4378 return new Promise(function (resolve) {
4379 resolve(data);
4380 });
4381 }
4382
4383 // TODO: Check if possible, always return promise and reject it.
4384 return false;
4385 }
4386
4387 /**
4388 * Function set().
4389 *
4390 * set data to cache.
4391 *
4392 * The difference between set() and update() is that set, will modify the data anyway...
4393 * when update() will only modify exist objects/values.
4394 *
4395 * @param {RequestData} requestData
4396 * @param {*} data
4397 */
4398 }, {
4399 key: "set",
4400 value: function set(requestData, data) {
4401 $e.data.validateRequestData(requestData);
4402 var componentName = requestData.component.getNamespace(),
4403 pureEndpoint = requestData.endpoint.replace(componentName + '/', ''),
4404 pureEndpointParts = pureEndpoint.split('/');
4405 var newData = {};
4406
4407 // Example of working with reaming endpoint part(s) can be found at 'cache.spec.js' test: 'load(): deep'.
4408 // Analyze reaming endpoint.
4409 if (pureEndpointParts.length && pureEndpoint !== componentName) {
4410 // Using reaming endpoint parts, to build new data object.
4411 var result = pureEndpointParts.reduce(function (accumulator, pureEndpointPart) {
4412 accumulator[pureEndpointPart] = {};
4413 return accumulator[pureEndpointPart];
4414 }, newData);
4415
4416 // 'result' is equal to 'newData' with a deeper pointer, build based on 'pureEndpointParts' ( will effect newData ).
4417 Object.assign(result, data);
4418 } else {
4419 newData = data;
4420 }
4421 var oldData = this.storage.getItem(componentName);
4422
4423 // When have old data, merge it recursively with newData using jQuery.extend().
4424 if (oldData !== null) {
4425 newData = jQuery.extend(true, oldData, newData);
4426 }
4427 this.storage.setItem(componentName, newData);
4428 }
4429
4430 /**
4431 * Function get().
4432 *
4433 * Get from exist storage.
4434 *
4435 * @param {RequestData} requestData
4436 *
4437 * @return {{}} data
4438 */
4439 }, {
4440 key: "get",
4441 value: function get(requestData) {
4442 $e.data.validateRequestData(requestData);
4443 var componentName = requestData.component.getNamespace(),
4444 componentData = this.storage.getItem(componentName);
4445 if (componentData !== null) {
4446 if (componentName === requestData.endpoint) {
4447 return componentData;
4448 }
4449
4450 // Example of working with reaming endpoint part(s) can be found at 'cache.spec.js' test: 'get(): complex'.
4451 // Analyze reaming endpoint (Using reduce over endpoint parts, build the right index).
4452 var pureEndpoint = requestData.endpoint.replace(requestData.component.getNamespace() + '/', ''),
4453 pureEndpointParts = pureEndpoint.split('/'),
4454 // eslint-disable-next-line array-callback-return
4455 result = pureEndpointParts.reduce(function (accumulator, endpointPart) {
4456 if (accumulator && accumulator[endpointPart]) {
4457 return accumulator[endpointPart];
4458 }
4459 }, componentData);
4460
4461 // Since $e.data.cache.receive will reject only if null is the result.
4462 return result || null;
4463 }
4464 return null;
4465 }
4466
4467 /**
4468 * Function update().
4469 *
4470 * Update only already exist storage, runs over all storage
4471 *
4472 * @param {RequestData} requestData
4473 *
4474 * @return {boolean} is updated
4475 */
4476 }, {
4477 key: "update",
4478 value: function update(requestData) {
4479 $e.data.validateRequestData(requestData, true);
4480 var endpoint = requestData.endpoint;
4481 var response = {};
4482
4483 // Simulate response from cache.
4484 Object.entries(this.storage.getAll()).forEach(function (_ref) {
4485 var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
4486 endpointKey = _ref2[0],
4487 /* String*/endpointValue = _ref2[1];
4488 if (endpointValue && endpoint.includes(endpointKey)) {
4489 // Assuming it is a specific endpoint.
4490 var oldData = endpointValue,
4491 pureEndpoint = requestData.endpoint.replace(requestData.component.getNamespace() + '/', ''),
4492 pureEndpointParts = pureEndpoint.split('/'),
4493 isComponentUpdate = 1 === pureEndpointParts.length && endpointKey === requestData.endpoint && endpointKey === requestData.component.getNamespace();
4494
4495 // Component update or specific update?
4496 if (isComponentUpdate) {
4497 response = jQuery.extend(true, oldData, requestData.args.data);
4498 } else {
4499 var oldSpecificData = pureEndpointParts.reduce(function (accumulator, pureEndpointPart) {
4500 return accumulator[pureEndpointPart];
4501 }, oldData);
4502 response = jQuery.extend(true, oldSpecificData, requestData.args.data);
4503 }
4504 }
4505 });
4506
4507 // If response not found.
4508 if (0 === Object.values(response).length) {
4509 return false;
4510 }
4511
4512 // Update cache.
4513 this.set(requestData, response);
4514 return true;
4515 }
4516
4517 /**
4518 * Function delete().
4519 *
4520 * Delete endpoint from storage.
4521 *
4522 * @param {RequestData} requestData
4523 *
4524 * @return {boolean} is deleted
4525 */
4526 }, {
4527 key: "delete",
4528 value: function _delete(requestData) {
4529 $e.data.validateRequestData(requestData);
4530 var result = false;
4531 var componentName = requestData.component.getNamespace();
4532 if (componentName !== requestData.endpoint) {
4533 var oldData = this.storage.getItem(componentName),
4534 newData = {};
4535 if (null === oldData) {
4536 return false;
4537 }
4538 var pureEndpoint = requestData.endpoint.replace(componentName + '/', ''),
4539 pureEndpointParts = pureEndpoint.split('/'),
4540 lastEndpointPart = pureEndpointParts[pureEndpointParts.length - 1];
4541 pureEndpointParts.reduce(function (accumulator, pureEndpointPart) {
4542 if (pureEndpointPart === lastEndpointPart) {
4543 // Null, means delete.
4544 accumulator[pureEndpointPart] = null;
4545 } else {
4546 accumulator[pureEndpointPart] = {};
4547 }
4548 return accumulator[pureEndpointPart];
4549 }, newData);
4550 if (Object.keys(oldData).length) {
4551 var deleteKeys = function deleteKeys(target, nullsObject) {
4552 if (nullsObject) {
4553 Object.keys(nullsObject).forEach(function (key) {
4554 if (nullsObject[key] && 'object' === (0, _typeof2.default)(nullsObject[key])) {
4555 deleteKeys(target[key], nullsObject[key]);
4556 } else if (null === nullsObject[key]) {
4557 delete target[key];
4558 result = true;
4559 }
4560 });
4561 } else {
4562 // Means need to clear all the object.
4563 Object.keys(target).forEach(function (key) {
4564 return delete target[key];
4565 });
4566 }
4567 return target;
4568 };
4569 this.storage.setItem(componentName, deleteKeys(oldData, newData));
4570 }
4571 } else {
4572 for (var key in this.storage.getAll()) {
4573 if (key === requestData.endpoint) {
4574 this.storage.removeItem(requestData.endpoint);
4575 result = true;
4576 break;
4577 }
4578 }
4579 }
4580 return result;
4581 }
4582 }]);
4583 return Cache;
4584 }();
4585 exports["default"] = Cache;
4586
4587 /***/ }),
4588
4589 /***/ "../modules/web-cli/assets/js/core/data/errors/base-error.js":
4590 /*!*******************************************************************!*\
4591 !*** ../modules/web-cli/assets/js/core/data/errors/base-error.js ***!
4592 \*******************************************************************/
4593 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4594
4595 "use strict";
4596
4597
4598 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
4599 Object.defineProperty(exports, "__esModule", ({
4600 value: true
4601 }));
4602 exports["default"] = void 0;
4603 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
4604 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
4605 var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js"));
4606 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
4607 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
4608 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
4609 var _wrapNativeSuper2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ "../node_modules/@babel/runtime/helpers/wrapNativeSuper.js"));
4610 var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
4611 var _console = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/console */ "../modules/web-cli/assets/js/utils/console.js"));
4612 var _forceMethodImplementation = _interopRequireDefault(__webpack_require__(/*! ../../../utils/force-method-implementation */ "../modules/web-cli/assets/js/utils/force-method-implementation.js"));
4613 function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
4614 function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4615 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
4616 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
4617 var BaseError = /*#__PURE__*/function (_Error) {
4618 (0, _inherits2.default)(BaseError, _Error);
4619 var _super = _createSuper(BaseError);
4620 /**
4621 * Error constructor.
4622 *
4623 * @param {string} message
4624 * @param {string} code
4625 * @param {*} data
4626 */
4627 function BaseError() {
4628 var _this;
4629 var message = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
4630 var code = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
4631 var data = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
4632 (0, _classCallCheck2.default)(this, BaseError);
4633 _this = _super.call(this, message);
4634 /**
4635 * The server error code.
4636 *
4637 * @type {string}
4638 */
4639 (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "code", '');
4640 /**
4641 * Additional data about the current error.
4642 *
4643 * @type {*[]}
4644 */
4645 (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "data", []);
4646 _this.code = code;
4647 _this.data = data;
4648 return _this;
4649 }
4650
4651 /**
4652 * Notify a message when the error occurs.
4653 */
4654 (0, _createClass2.default)(BaseError, [{
4655 key: "notify",
4656 value: function notify() {
4657 _console.default.error(_objectSpread({
4658 message: this.message
4659 }, this));
4660 }
4661 }], [{
4662 key: "create",
4663 value:
4664 /**
4665 * Static helper function to create the error.
4666 *
4667 * @param {string} message
4668 * @param {string} code
4669 * @param {*} data
4670 * @return {BaseError} error
4671 */
4672 function create(message) {
4673 var code = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
4674 var data = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
4675 return new this(message, code, data);
4676 }
4677
4678 /**
4679 * Returns the status code of the error.
4680 */
4681 }, {
4682 key: "getHTTPErrorCode",
4683 value: function getHTTPErrorCode() {
4684 (0, _forceMethodImplementation.default)();
4685 }
4686 }]);
4687 return BaseError;
4688 }( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
4689 exports["default"] = BaseError;
4690
4691 /***/ }),
4692
4693 /***/ "../modules/web-cli/assets/js/core/data/errors/default-error.js":
4694 /*!**********************************************************************!*\
4695 !*** ../modules/web-cli/assets/js/core/data/errors/default-error.js ***!
4696 \**********************************************************************/
4697 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4698
4699 "use strict";
4700
4701
4702 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
4703 Object.defineProperty(exports, "__esModule", ({
4704 value: true
4705 }));
4706 exports["default"] = exports.DefaultError = void 0;
4707 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
4708 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
4709 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
4710 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
4711 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
4712 var _baseError = _interopRequireDefault(__webpack_require__(/*! ./base-error */ "../modules/web-cli/assets/js/core/data/errors/base-error.js"));
4713 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
4714 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
4715 var DefaultError = /*#__PURE__*/function (_BaseError) {
4716 (0, _inherits2.default)(DefaultError, _BaseError);
4717 var _super = _createSuper(DefaultError);
4718 function DefaultError() {
4719 (0, _classCallCheck2.default)(this, DefaultError);
4720 return _super.apply(this, arguments);
4721 }
4722 (0, _createClass2.default)(DefaultError, null, [{
4723 key: "getHTTPErrorCode",
4724 value: function getHTTPErrorCode() {
4725 return 501;
4726 }
4727 }]);
4728 return DefaultError;
4729 }(_baseError.default);
4730 exports.DefaultError = DefaultError;
4731 var _default = DefaultError;
4732 exports["default"] = _default;
4733
4734 /***/ }),
4735
4736 /***/ "../modules/web-cli/assets/js/core/data/errors/error-404.js":
4737 /*!******************************************************************!*\
4738 !*** ../modules/web-cli/assets/js/core/data/errors/error-404.js ***!
4739 \******************************************************************/
4740 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4741
4742 "use strict";
4743
4744
4745 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
4746 Object.defineProperty(exports, "__esModule", ({
4747 value: true
4748 }));
4749 exports["default"] = exports.Error404 = void 0;
4750 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
4751 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
4752 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
4753 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
4754 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
4755 var _baseError = _interopRequireDefault(__webpack_require__(/*! ./base-error */ "../modules/web-cli/assets/js/core/data/errors/base-error.js"));
4756 var _console = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/console */ "../modules/web-cli/assets/js/utils/console.js"));
4757 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
4758 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
4759 var Error404 = /*#__PURE__*/function (_BaseError) {
4760 (0, _inherits2.default)(Error404, _BaseError);
4761 var _super = _createSuper(Error404);
4762 function Error404() {
4763 (0, _classCallCheck2.default)(this, Error404);
4764 return _super.apply(this, arguments);
4765 }
4766 (0, _createClass2.default)(Error404, [{
4767 key: "notify",
4768 value: function notify() {
4769 _console.default.warn(this.message);
4770 }
4771 }], [{
4772 key: "getHTTPErrorCode",
4773 value: function getHTTPErrorCode() {
4774 return 404;
4775 }
4776 }]);
4777 return Error404;
4778 }(_baseError.default);
4779 exports.Error404 = Error404;
4780 var _default = Error404;
4781 exports["default"] = _default;
4782
4783 /***/ }),
4784
4785 /***/ "../modules/web-cli/assets/js/core/data/errors/index.js":
4786 /*!**************************************************************!*\
4787 !*** ../modules/web-cli/assets/js/core/data/errors/index.js ***!
4788 \**************************************************************/
4789 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4790
4791 "use strict";
4792
4793
4794 Object.defineProperty(exports, "__esModule", ({
4795 value: true
4796 }));
4797 Object.defineProperty(exports, "DefaultError", ({
4798 enumerable: true,
4799 get: function get() {
4800 return _defaultError.DefaultError;
4801 }
4802 }));
4803 Object.defineProperty(exports, "Error404", ({
4804 enumerable: true,
4805 get: function get() {
4806 return _error.Error404;
4807 }
4808 }));
4809 var _defaultError = __webpack_require__(/*! ./default-error */ "../modules/web-cli/assets/js/core/data/errors/default-error.js");
4810 var _error = __webpack_require__(/*! ./error-404 */ "../modules/web-cli/assets/js/core/data/errors/error-404.js");
4811
4812 /***/ }),
4813
4814 /***/ "../modules/web-cli/assets/js/core/data/storages/base-prefix-storage.js":
4815 /*!******************************************************************************!*\
4816 !*** ../modules/web-cli/assets/js/core/data/storages/base-prefix-storage.js ***!
4817 \******************************************************************************/
4818 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4819
4820 "use strict";
4821
4822
4823 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
4824 Object.defineProperty(exports, "__esModule", ({
4825 value: true
4826 }));
4827 exports["default"] = void 0;
4828 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
4829 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
4830 var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js"));
4831 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
4832 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
4833 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
4834 var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
4835 var _baseStorage = _interopRequireDefault(__webpack_require__(/*! elementor-api/core/data/storages/base-storage */ "../modules/web-cli/assets/js/core/data/storages/base-storage.js"));
4836 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
4837 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
4838 var BasePrefixStorage = /*#__PURE__*/function (_BaseStorage) {
4839 (0, _inherits2.default)(BasePrefixStorage, _BaseStorage);
4840 var _super = _createSuper(BasePrefixStorage);
4841 function BasePrefixStorage() {
4842 (0, _classCallCheck2.default)(this, BasePrefixStorage);
4843 return _super.apply(this, arguments);
4844 }
4845 (0, _createClass2.default)(BasePrefixStorage, [{
4846 key: "clear",
4847 value: function clear() {
4848 var _this = this;
4849 Object.keys(this.getAll()).forEach(function (key) {
4850 return _this.removeItem(key);
4851 });
4852 }
4853 }, {
4854 key: "getItem",
4855 value: function getItem(key) {
4856 return (0, _get2.default)((0, _getPrototypeOf2.default)(BasePrefixStorage.prototype), "getItem", this).call(this, BasePrefixStorage.DEFAULT_KEY_PREFIX + key);
4857 }
4858 }, {
4859 key: "removeItem",
4860 value: function removeItem(key) {
4861 return (0, _get2.default)((0, _getPrototypeOf2.default)(BasePrefixStorage.prototype), "removeItem", this).call(this, BasePrefixStorage.DEFAULT_KEY_PREFIX + key);
4862 }
4863 }, {
4864 key: "setItem",
4865 value: function setItem(key, value) {
4866 return (0, _get2.default)((0, _getPrototypeOf2.default)(BasePrefixStorage.prototype), "setItem", this).call(this, BasePrefixStorage.DEFAULT_KEY_PREFIX + key, value);
4867 }
4868 }, {
4869 key: "getAll",
4870 value: function getAll() {
4871 var _this2 = this;
4872 var DEFAULT_KEY_PREFIX = BasePrefixStorage.DEFAULT_KEY_PREFIX,
4873 keys = Object.keys(this.provider),
4874 result = {};
4875 keys.forEach(function (key) {
4876 if (key.startsWith(DEFAULT_KEY_PREFIX)) {
4877 key = key.replace(DEFAULT_KEY_PREFIX, '');
4878 result[key] = _this2.getItem(key);
4879 }
4880 });
4881 return result;
4882 }
4883 }]);
4884 return BasePrefixStorage;
4885 }(_baseStorage.default);
4886 exports["default"] = BasePrefixStorage;
4887 (0, _defineProperty2.default)(BasePrefixStorage, "DEFAULT_KEY_PREFIX", 'e_');
4888
4889 /***/ }),
4890
4891 /***/ "../modules/web-cli/assets/js/core/data/storages/base-storage.js":
4892 /*!***********************************************************************!*\
4893 !*** ../modules/web-cli/assets/js/core/data/storages/base-storage.js ***!
4894 \***********************************************************************/
4895 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4896
4897 "use strict";
4898
4899
4900 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
4901 Object.defineProperty(exports, "__esModule", ({
4902 value: true
4903 }));
4904 exports["default"] = void 0;
4905 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
4906 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
4907 /**
4908 * TODO: Merge all storage's to one.
4909 * Using this technique give's the ability to use JSDOC from 'window.storage'.
4910 *
4911 * @implements {Storage}
4912 */
4913 var BaseStorage = /*#__PURE__*/function () {
4914 /**
4915 * Create storage wrapper.
4916 *
4917 * @param {Storage} provider
4918 */
4919 function BaseStorage(provider) {
4920 (0, _classCallCheck2.default)(this, BaseStorage);
4921 if (BaseStorage === (this instanceof BaseStorage ? this.constructor : void 0)) {
4922 throw new TypeError('Cannot construct BaseStorage instances directly');
4923 }
4924 this.provider = provider;
4925 }
4926 (0, _createClass2.default)(BaseStorage, [{
4927 key: "clear",
4928 value: function clear() {
4929 return this.provider.clear();
4930 }
4931 }, {
4932 key: "getItem",
4933 value: function getItem(key) {
4934 var result = this.provider.getItem(key);
4935 if (null !== result) {
4936 return JSON.parse(result);
4937 }
4938 return result;
4939 }
4940 }, {
4941 key: "key",
4942 value: function key(index) {
4943 return this.provider.key(index);
4944 }
4945 }, {
4946 key: "removeItem",
4947 value: function removeItem(key) {
4948 return this.provider.removeItem(key);
4949 }
4950 }, {
4951 key: "setItem",
4952 value: function setItem(key, value) {
4953 return this.provider.setItem(key, JSON.stringify(value));
4954 }
4955 }, {
4956 key: "getAll",
4957 value: function getAll() {
4958 var _this = this;
4959 var keys = Object.keys(this.provider),
4960 result = {};
4961 keys.forEach(function (key) {
4962 result[key] = _this.getItem(key);
4963 });
4964 return result;
4965 }
4966 }]);
4967 return BaseStorage;
4968 }();
4969 exports["default"] = BaseStorage;
4970
4971 /***/ }),
4972
4973 /***/ "../modules/web-cli/assets/js/core/data/storages/local-storage.js":
4974 /*!************************************************************************!*\
4975 !*** ../modules/web-cli/assets/js/core/data/storages/local-storage.js ***!
4976 \************************************************************************/
4977 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4978
4979 "use strict";
4980
4981
4982 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
4983 Object.defineProperty(exports, "__esModule", ({
4984 value: true
4985 }));
4986 exports["default"] = void 0;
4987 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
4988 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
4989 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
4990 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
4991 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
4992 var _basePrefixStorage = _interopRequireDefault(__webpack_require__(/*! ./base-prefix-storage */ "../modules/web-cli/assets/js/core/data/storages/base-prefix-storage.js"));
4993 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
4994 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
4995 var LocalStorage = /*#__PURE__*/function (_BasePrefixStorage) {
4996 (0, _inherits2.default)(LocalStorage, _BasePrefixStorage);
4997 var _super = _createSuper(LocalStorage);
4998 function LocalStorage() {
4999 (0, _classCallCheck2.default)(this, LocalStorage);
5000 return _super.call(this, localStorage);
5001 }
5002 (0, _createClass2.default)(LocalStorage, [{
5003 key: "debug",
5004 value: function debug() {
5005 var entries = this.getAll(),
5006 ordered = {};
5007 Object.keys(entries).sort().forEach(function (key) {
5008 var value = entries[key];
5009 ordered[key] = value;
5010 });
5011 return ordered;
5012 }
5013 }]);
5014 return LocalStorage;
5015 }(_basePrefixStorage.default);
5016 exports["default"] = LocalStorage;
5017
5018 /***/ }),
5019
5020 /***/ "../modules/web-cli/assets/js/core/hooks.js":
5021 /*!**************************************************!*\
5022 !*** ../modules/web-cli/assets/js/core/hooks.js ***!
5023 \**************************************************/
5024 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5025
5026 "use strict";
5027
5028
5029 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
5030 Object.defineProperty(exports, "__esModule", ({
5031 value: true
5032 }));
5033 exports["default"] = void 0;
5034 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
5035 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
5036 var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
5037 var _data = _interopRequireDefault(__webpack_require__(/*! ./hooks/data.js */ "../modules/web-cli/assets/js/core/hooks/data.js"));
5038 var _ui = _interopRequireDefault(__webpack_require__(/*! ./hooks/ui.js */ "../modules/web-cli/assets/js/core/hooks/ui.js"));
5039 /**
5040 * @typedef {import('../modules/hook-base')} HookBase
5041 */
5042 var Hooks = /*#__PURE__*/function () {
5043 function Hooks() {
5044 (0, _classCallCheck2.default)(this, Hooks);
5045 (0, _defineProperty2.default)(this, "data", new _data.default());
5046 (0, _defineProperty2.default)(this, "ui", new _ui.default());
5047 }
5048 (0, _createClass2.default)(Hooks, [{
5049 key: "activate",
5050 value:
5051 /**
5052 * Function activate().
5053 *
5054 * Activate all hooks.
5055 */
5056 function activate() {
5057 this.getTypes().forEach(function (hooksType) {
5058 hooksType.activate();
5059 });
5060 }
5061
5062 /**
5063 * Function deactivate().
5064 *
5065 * Deactivate all hooks.
5066 */
5067 }, {
5068 key: "deactivate",
5069 value: function deactivate() {
5070 this.getTypes().forEach(function (hooksType) {
5071 hooksType.deactivate();
5072 });
5073 }
5074 }, {
5075 key: "getAll",
5076 value: function getAll() {
5077 var flat = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
5078 var result = {};
5079 this.getTypes().forEach(function (hooksType) {
5080 result[hooksType.getType()] = hooksType.getAll(flat);
5081 });
5082 return result;
5083 }
5084 }, {
5085 key: "getTypes",
5086 value: function getTypes() {
5087 return [this.data, this.ui];
5088 }
5089 }, {
5090 key: "getType",
5091 value: function getType(type) {
5092 return this.getTypes().find(function (hooks) {
5093 return type === hooks.getType();
5094 });
5095 }
5096
5097 /**
5098 * Function register().
5099 *
5100 * Register hook.
5101 *
5102 * @param {string} type
5103 * @param {string} event
5104 * @param {HookBase} instance
5105 *
5106 * @return {{}} Created callback
5107 */
5108 }, {
5109 key: "register",
5110 value: function register(type, event, instance) {
5111 return this.getType(type).register(event, instance);
5112 }
5113
5114 /**
5115 * Function run().
5116 *
5117 * Run's a hook.
5118 *
5119 * @param {string} type
5120 * @param {string} event
5121 * @param {string} command
5122 * @param {{}} args
5123 * @param {*} result
5124 *
5125 * @return {boolean} result
5126 */
5127 }, {
5128 key: "run",
5129 value: function run(type, event, command, args) {
5130 var result = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : undefined;
5131 return this.getType(type).run(event, command, args, result);
5132 }
5133
5134 /**
5135 * Function registerDataAfter().
5136 *
5137 * Register data hook that's run after the command.
5138 *
5139 * @param {HookBase} instance
5140 *
5141 * @return {{}} callback
5142 */
5143 }, {
5144 key: "registerDataAfter",
5145 value: function registerDataAfter(instance) {
5146 return this.register('data', 'after', instance);
5147 }
5148
5149 /**
5150 * Function registerDataCatch().
5151 *
5152 * Register data hook that's run when the command fails.
5153 *
5154 * @param {HookBase} instance
5155 *
5156 * @return {{}} callback
5157 */
5158 }, {
5159 key: "registerDataCatch",
5160 value: function registerDataCatch(instance) {
5161 return this.register('data', 'catch', instance);
5162 }
5163
5164 /**
5165 * Function registerDataDependency().
5166 *
5167 * Register data hook that's run before the command as dependency.
5168 *
5169 * @param {HookBase} instance
5170 *
5171 * @return {{}} callback
5172 */
5173 }, {
5174 key: "registerDataDependency",
5175 value: function registerDataDependency(instance) {
5176 return this.register('data', 'dependency', instance);
5177 }
5178
5179 /**
5180 * Function registerUIAfter().
5181 *
5182 * Register UI hook that's run after the commands run.
5183 *
5184 * @param {HookBase} instance
5185 *
5186 * @return {{}} callback
5187 */
5188 }, {
5189 key: "registerUIAfter",
5190 value: function registerUIAfter(instance) {
5191 return this.register('ui', 'after', instance);
5192 }
5193
5194 /**
5195 * Function registerUICatch().
5196 *
5197 * Register UI hook that's run when the command fails.
5198 *
5199 * @param {HookBase} instance
5200 *
5201 * @return {{}} callback
5202 */
5203 }, {
5204 key: "registerUICatch",
5205 value: function registerUICatch(instance) {
5206 return this.register('ui', 'catch', instance);
5207 }
5208
5209 /**
5210 * Function registerUIBefore().
5211 *
5212 * Register UI hook that's run before the command.
5213 *
5214 * @param {HookBase} instance
5215 *
5216 * @return {{}} callback
5217 */
5218 }, {
5219 key: "registerUIBefore",
5220 value: function registerUIBefore(instance) {
5221 return this.register('ui', 'before', instance);
5222 }
5223
5224 /**
5225 * Function runDataAfter().
5226 *
5227 * Run data hook that's run after the command.
5228 *
5229 * @param {string} command
5230 * @param {{}} args
5231 * @param {*} result
5232 *
5233 * @return {boolean} result
5234 */
5235 }, {
5236 key: "runDataAfter",
5237 value: function runDataAfter(command, args, result) {
5238 return this.run('data', 'after', command, args, result);
5239 }
5240
5241 /**
5242 * Function runDataCatch().
5243 *
5244 * Run data hook that's run when the command fails.
5245 *
5246 * @param {string} command
5247 * @param {{}} args
5248 * @param {*} error
5249 *
5250 * @return {boolean} result
5251 */
5252 }, {
5253 key: "runDataCatch",
5254 value: function runDataCatch(command, args, error) {
5255 return this.run('data', 'catch', command, args, error);
5256 }
5257
5258 /**
5259 * Function runDataDependency().
5260 *
5261 * Run data hook that's run before the command as dependency.
5262 *
5263 * @param {string} command
5264 * @param {{}} args
5265 *
5266 * @return {boolean} result
5267 */
5268 }, {
5269 key: "runDataDependency",
5270 value: function runDataDependency(command, args) {
5271 return this.run('data', 'dependency', command, args);
5272 }
5273
5274 /**
5275 * Function runUIAfter().
5276 *
5277 * Run UI hook that's run after the commands run.
5278 *
5279 * @param {string} command
5280 * @param {{}} args
5281 * @param {*} result
5282 *
5283 * @return {boolean} result
5284 */
5285 }, {
5286 key: "runUIAfter",
5287 value: function runUIAfter(command, args, result) {
5288 return this.run('ui', 'after', command, args, result);
5289 }
5290
5291 /**
5292 * Function runUICatch().
5293 *
5294 * Run UI hook that's run when the command fails.
5295 *
5296 * @param {string} command
5297 * @param {{}} args
5298 * @param {*} e
5299 *
5300 * @return {boolean} result
5301 */
5302 }, {
5303 key: "runUICatch",
5304 value: function runUICatch(command, args, e) {
5305 return this.run('ui', 'catch', command, args, e);
5306 }
5307
5308 /**
5309 * Function runUIBefore().
5310 *
5311 * Run UI hook that's run before the command.
5312 *
5313 * @param {string} command
5314 * @param {{}} args
5315 *
5316 * @return {boolean} result
5317 */
5318 }, {
5319 key: "runUIBefore",
5320 value: function runUIBefore(command, args) {
5321 return this.run('ui', 'before', command, args);
5322 }
5323 }]);
5324 return Hooks;
5325 }();
5326 exports["default"] = Hooks;
5327
5328 /***/ }),
5329
5330 /***/ "../modules/web-cli/assets/js/core/hooks/base.js":
5331 /*!*******************************************************!*\
5332 !*** ../modules/web-cli/assets/js/core/hooks/base.js ***!
5333 \*******************************************************/
5334 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5335
5336 "use strict";
5337
5338
5339 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
5340 Object.defineProperty(exports, "__esModule", ({
5341 value: true
5342 }));
5343 exports["default"] = void 0;
5344 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
5345 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
5346 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
5347 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
5348 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
5349 var _console = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/console */ "../modules/web-cli/assets/js/utils/console.js"));
5350 var _module = _interopRequireDefault(__webpack_require__(/*! elementor-assets-js/modules/imports/module.js */ "../assets/dev/js/modules/imports/module.js"));
5351 var _forceMethodImplementation = _interopRequireDefault(__webpack_require__(/*! ../../utils/force-method-implementation */ "../modules/web-cli/assets/js/utils/force-method-implementation.js"));
5352 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
5353 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
5354 /**
5355 * @typedef {import('../../modules/hook-base')} HookBase
5356 */
5357 var HooksBase = /*#__PURE__*/function (_Module) {
5358 (0, _inherits2.default)(HooksBase, _Module);
5359 var _super = _createSuper(HooksBase);
5360 /**
5361 * Function constructor().
5362 *
5363 * Create hooks base.
5364 *
5365 * @param {{}} args
5366 */
5367 function HooksBase() {
5368 var _this;
5369 (0, _classCallCheck2.default)(this, HooksBase);
5370 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
5371 args[_key] = arguments[_key];
5372 }
5373 _this = _super.call.apply(_super, [this].concat(args));
5374
5375 /**
5376 * Current command.
5377 *
5378 * @type {string}
5379 */
5380 _this.current = '';
5381
5382 /**
5383 * Array of ids which in use.
5384 *
5385 * @type {Array}
5386 */
5387 _this.usedIds = [];
5388
5389 /**
5390 * Object of callbacks that was bound by container type.
5391 *
5392 * @type {{}}
5393 */
5394 _this.callbacks = {
5395 after: {},
5396 catch: {}
5397 };
5398
5399 /**
5400 * Object of depth.
5401 *
5402 * @type {{}}
5403 */
5404 _this.depth = {
5405 after: {},
5406 catch: {}
5407 };
5408 _this.callbacksFlatList = {};
5409 return _this;
5410 }
5411 (0, _createClass2.default)(HooksBase, [{
5412 key: "activate",
5413 value: function activate() {
5414 Object.values(this.getAll(true)).forEach(function (callback) {
5415 callback.activate();
5416 });
5417 }
5418 }, {
5419 key: "deactivate",
5420 value: function deactivate() {
5421 Object.values(this.getAll(true)).forEach(function (callback) {
5422 callback.deactivate();
5423 });
5424 }
5425
5426 // eslint-disable-next-line jsdoc/require-returns-check
5427 /**
5428 * Function getType().
5429 *
5430 * Returns type eg: ( event, hook, etc ... ).
5431 *
5432 * @return {string} type
5433 */
5434 }, {
5435 key: "getType",
5436 value: function getType() {
5437 (0, _forceMethodImplementation.default)();
5438 }
5439 }, {
5440 key: "get",
5441 value: function get(id) {
5442 return this.callbacksFlatList[id];
5443 }
5444
5445 /**
5446 * Function getAll().
5447 *
5448 * Return all possible callbacks.
5449 *
5450 * @param {boolean} flat
5451 *
5452 * @return {{}} all callbacks
5453 */
5454 }, {
5455 key: "getAll",
5456 value: function getAll() {
5457 var _this2 = this;
5458 var flat = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
5459 if (flat) {
5460 return this.callbacksFlatList;
5461 }
5462 var result = {};
5463 Object.keys(this.callbacks).forEach(function (event) {
5464 if (!result[event]) {
5465 result[event] = [];
5466 }
5467 Object.keys(_this2.callbacks[event]).forEach(function (command) {
5468 result[event].push({
5469 command: command,
5470 callbacks: _this2.callbacks[event][command]
5471 });
5472 });
5473 });
5474 return result;
5475 }
5476
5477 /**
5478 * Function getCurrent();
5479 *
5480 * Return current command.
5481 *
5482 * @return {string} current command
5483 */
5484 }, {
5485 key: "getCurrent",
5486 value: function getCurrent() {
5487 return this.current;
5488 }
5489
5490 /**
5491 * Function getUsedIds().
5492 *
5493 * Returns the current used ids.
5494 *
5495 * @return {Array} used IDs
5496 */
5497 }, {
5498 key: "getUsedIds",
5499 value: function getUsedIds() {
5500 return this.usedIds;
5501 }
5502
5503 /**
5504 * Function getCallbacks().
5505 *
5506 * Get available callbacks for specific event and command.
5507 *
5508 * @param {string} event
5509 * @param {string} command
5510 * @param {*} args
5511 * @return {(Array | boolean)} callbacks
5512 */
5513 }, {
5514 key: "getCallbacks",
5515 value: function getCallbacks(event, command, args) {
5516 var _args$containers = args.containers,
5517 containers = _args$containers === void 0 ? [args.container] : _args$containers,
5518 containerType = containers[0] ? containers[0].type : false;
5519 var callbacks = [];
5520 if (this.callbacks[event] && this.callbacks[event][command]) {
5521 if (containerType && this.callbacks[event][command][containerType]) {
5522 callbacks = callbacks.concat(this.callbacks[event][command][containerType]);
5523 }
5524 if (this.callbacks[event][command].all) {
5525 callbacks = callbacks.concat(this.callbacks[event][command].all);
5526 }
5527 }
5528 if (callbacks.length) {
5529 return callbacks;
5530 }
5531 return false;
5532 }
5533
5534 /**
5535 * Function checkEvent().
5536 *
5537 * Validate if the event is available.
5538 *
5539 * @param {string} event
5540 */
5541 }, {
5542 key: "checkEvent",
5543 value: function checkEvent(event) {
5544 if (-1 === Object.keys(this.callbacks).indexOf(event)) {
5545 throw Error("".concat(this.getType(), ": '").concat(event, "' is not available."));
5546 }
5547 }
5548
5549 /**
5550 * Function checkInstance().
5551 *
5552 * Validate given instance.
5553 *
5554 * @param {HookBase} instance
5555 */
5556 }, {
5557 key: "checkInstance",
5558 value: function checkInstance(instance) {
5559 if (instance.getType() !== this.getType()) {
5560 throw new Error("invalid instance, please use: 'elementor-api/modules/hook-base.js'. ");
5561 }
5562 }
5563
5564 /**
5565 * Function checkId().
5566 *
5567 * Validate if the id is not used before.
5568 *
5569 * @param {string} id
5570 */
5571 }, {
5572 key: "checkId",
5573 value: function checkId(id) {
5574 if (-1 !== this.usedIds.indexOf(id)) {
5575 throw Error("id: '".concat(id, "' is already in use."));
5576 }
5577 }
5578
5579 /**
5580 * Function shouldRun().
5581 *
5582 * Determine if the event should run.
5583 *
5584 * @param {Array} callbacks
5585 *
5586 * @return {boolean} true if there are callbacks, otherwise false
5587 *
5588 * @throws {Error}
5589 */
5590 }, {
5591 key: "shouldRun",
5592 value: function shouldRun(callbacks) {
5593 return !!callbacks && callbacks.length;
5594 }
5595
5596 /**
5597 * Function register().
5598 *
5599 * Register the callback instance.
5600 *
5601 * @param {string} event
5602 * @param {HookBase} instance
5603 *
5604 * @return {{}} Created callback
5605 */
5606 }, {
5607 key: "register",
5608 value: function register(event, instance) {
5609 var command = instance.getCommand(),
5610 id = instance.getId(),
5611 containerType = instance.getContainerType();
5612 this.checkEvent(event);
5613 this.checkInstance(instance);
5614 this.checkId(id);
5615 return this.registerCallback(id, event, command, instance, containerType);
5616 }
5617
5618 /**
5619 * Function registerCallback().
5620 *
5621 * Register callback.
5622 *
5623 * @param {string} id
5624 * @param {string} event
5625 * @param {string} command
5626 * @param {HookBase} instance
5627 * @param {string} containerType
5628 *
5629 * TODO: Consider replace with typedef.
5630 * @return {{callback: *, id: *, isActive: boolean}} callback
5631 */
5632 }, {
5633 key: "registerCallback",
5634 value: function registerCallback(id, event, command, instance, containerType) {
5635 if (!this.callbacks[event][command]) {
5636 this.callbacks[event][command] = [];
5637 }
5638
5639 // Save used id(s).
5640 this.usedIds.push(id);
5641 if (!this.callbacks[event][command]) {
5642 this.callbacks[event][command] = {};
5643 }
5644
5645 // TODO: Create HookCallback class/type.
5646 var callback = {
5647 id: id,
5648 callback: instance.run.bind(instance),
5649 isActive: true,
5650 activate: function activate() {
5651 this.isActive = true;
5652 },
5653 deactivate: function deactivate() {
5654 this.isActive = false;
5655 }
5656 };
5657 if (containerType) {
5658 if (!this.callbacks[event][command][containerType]) {
5659 this.callbacks[event][command][containerType] = [];
5660 }
5661 this.callbacks[event][command][containerType].push(callback);
5662 } else {
5663 if (!this.callbacks[event][command].all) {
5664 this.callbacks[event][command].all = [];
5665 }
5666 this.callbacks[event][command].all.push(callback);
5667 }
5668 this.callbacksFlatList[callback.id] = callback;
5669 return callback;
5670 }
5671
5672 /**
5673 * Function run().
5674 *
5675 * Run the callbacks.
5676 *
5677 * @param {string} event
5678 * @param {string} command
5679 * @param {{}} args
5680 * @param {*} result
5681 *
5682 * @return {*} results
5683 */
5684 }, {
5685 key: "run",
5686 value: function run(event, command, args) {
5687 var result = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined;
5688 var callbacks = this.getCallbacks(event, command, args);
5689 if (this.shouldRun(callbacks)) {
5690 this.current = command;
5691 this.onRun(command, args, event);
5692 return this.runCallbacks(event, command, callbacks, args, result);
5693 }
5694 return false;
5695 }
5696
5697 /**
5698 * Function runCallbacks().
5699 *
5700 * Run's the given callbacks.
5701 *
5702 * @param {string} event
5703 * @param {string} command
5704 * @param {Array} callbacks
5705 * @param {{}} args
5706 * @param {[]} result
5707 */
5708 }, {
5709 key: "runCallbacks",
5710 value: function runCallbacks(event, command, callbacks, args, result) {
5711 var callbacksResult = [];
5712 for (var i in callbacks) {
5713 var callback = callbacks[i];
5714 if (!callback.isActive) {
5715 continue;
5716 }
5717
5718 // If not exist, set zero.
5719 if (undefined === this.depth[event][callback.id]) {
5720 this.depth[event][callback.id] = 0;
5721 }
5722 this.depth[event][callback.id]++;
5723
5724 // Prevent recursive hooks.
5725 if (1 === this.depth[event][callback.id]) {
5726 this.onCallback(command, args, event, callback.id);
5727 try {
5728 var callbackResult = this.runCallback(event, callback, args, result);
5729 if (!callbackResult) {
5730 throw Error("Callback failed, event: '".concat(event, "'"));
5731 }
5732 callbacksResult.push(callbackResult);
5733 } catch (e) {
5734 // If its 'Hook-Break' then parent `try {}` will handle it.
5735 if (e instanceof $e.modules.HookBreak) {
5736 throw e;
5737 }
5738 _console.default.error(e);
5739 }
5740 }
5741 this.depth[event][callback.id]--;
5742 }
5743 return callbacksResult;
5744 }
5745
5746 // eslint-disable-next-line jsdoc/require-returns-check
5747 /**
5748 * Function runCallback().
5749 *
5750 * Run's the given callback.
5751 *
5752 * @param {string} event
5753 * @param {{}} callback
5754 * @param {{}} args
5755 * @param {*} result
5756 *
5757 * @return {*} results
5758 *
5759 * @throws {Error}
5760 */
5761 }, {
5762 key: "runCallback",
5763 value: function runCallback(event, callback, args, result) {
5764 // eslint-disable-line no-unused-vars
5765 (0, _forceMethodImplementation.default)();
5766 }
5767
5768 /**
5769 * Function onRun().
5770 *
5771 * Called before run a set of callbacks.
5772 *
5773 * @param {string} command
5774 * @param {{}} args
5775 * @param {string} event
5776 *
5777 * @throws {Error}
5778 */
5779 }, {
5780 key: "onRun",
5781 value: function onRun(command, args, event) {
5782 // eslint-disable-line no-unused-vars
5783 (0, _forceMethodImplementation.default)();
5784 }
5785
5786 /**
5787 * Function onCallback().
5788 *
5789 * Called before a single callback.
5790 *
5791 * @param {string} command
5792 * @param {{}} args
5793 * @param {string} event
5794 * @param {string} id
5795 *
5796 * @throws {Error}
5797 */
5798 }, {
5799 key: "onCallback",
5800 value: function onCallback(command, args, event, id) {
5801 // eslint-disable-line no-unused-vars
5802 (0, _forceMethodImplementation.default)();
5803 }
5804 }]);
5805 return HooksBase;
5806 }(_module.default);
5807 exports["default"] = HooksBase;
5808
5809 /***/ }),
5810
5811 /***/ "../modules/web-cli/assets/js/core/hooks/data.js":
5812 /*!*******************************************************!*\
5813 !*** ../modules/web-cli/assets/js/core/hooks/data.js ***!
5814 \*******************************************************/
5815 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5816
5817 "use strict";
5818
5819
5820 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
5821 Object.defineProperty(exports, "__esModule", ({
5822 value: true
5823 }));
5824 exports["default"] = void 0;
5825 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
5826 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
5827 var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js"));
5828 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
5829 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
5830 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
5831 var _base = _interopRequireDefault(__webpack_require__(/*! ./base.js */ "../modules/web-cli/assets/js/core/hooks/base.js"));
5832 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
5833 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
5834 var Data = /*#__PURE__*/function (_HooksBase) {
5835 (0, _inherits2.default)(Data, _HooksBase);
5836 var _super = _createSuper(Data);
5837 function Data() {
5838 var _this;
5839 (0, _classCallCheck2.default)(this, Data);
5840 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
5841 args[_key] = arguments[_key];
5842 }
5843 _this = _super.call.apply(_super, [this].concat(args));
5844 _this.callbacks.dependency = {};
5845 _this.depth.dependency = {};
5846 return _this;
5847 }
5848 (0, _createClass2.default)(Data, [{
5849 key: "getType",
5850 value: function getType() {
5851 return 'data';
5852 }
5853 }, {
5854 key: "runCallback",
5855 value: function runCallback(event, callback, args, result) {
5856 switch (event) {
5857 case 'dependency':
5858 {
5859 // If callback returns false and its dependency, then 'Hook-Break'.
5860 if (!callback.callback(args)) {
5861 this.depth[event][callback.id]--;
5862
5863 // Throw custom break to be catch by the base for 'Safe' exit.
5864 throw new $e.modules.HookBreak();
5865 }
5866 return true;
5867 }
5868 case 'catch':
5869 case 'after':
5870 {
5871 /**
5872 * When handling HOOK which is data after (not breakable),
5873 * even the result of the callback is negative, it is required to return positive,
5874 * since result of runCallback determine if the callback succeeded.
5875 */
5876 return callback.callback(args, result) || 'after' === event;
5877 }
5878 }
5879 return false;
5880 }
5881 }, {
5882 key: "shouldRun",
5883 value: function shouldRun(callbacks) {
5884 return (0, _get2.default)((0, _getPrototypeOf2.default)(Data.prototype), "shouldRun", this).call(this, callbacks) && elementor.documents.getCurrent().history.getActive();
5885 }
5886 }, {
5887 key: "onRun",
5888 value: function onRun(command, args, event) {
5889 if (!$e.devTools) {
5890 return;
5891 }
5892 $e.devTools.log.callbacks().run(this.getType(), command, args, event);
5893 }
5894 }, {
5895 key: "onCallback",
5896 value: function onCallback(command, args, event, id) {
5897 if (!$e.devTools) {
5898 return;
5899 }
5900 $e.devTools.log.callbacks().callback(this.getType(), command, args, event, id);
5901 }
5902 }]);
5903 return Data;
5904 }(_base.default);
5905 exports["default"] = Data;
5906
5907 /***/ }),
5908
5909 /***/ "../modules/web-cli/assets/js/core/hooks/ui.js":
5910 /*!*****************************************************!*\
5911 !*** ../modules/web-cli/assets/js/core/hooks/ui.js ***!
5912 \*****************************************************/
5913 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5914
5915 "use strict";
5916
5917
5918 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
5919 Object.defineProperty(exports, "__esModule", ({
5920 value: true
5921 }));
5922 exports["default"] = void 0;
5923 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
5924 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
5925 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
5926 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
5927 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
5928 var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/core/hooks/base.js"));
5929 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
5930 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
5931 var Ui = /*#__PURE__*/function (_HooksBase) {
5932 (0, _inherits2.default)(Ui, _HooksBase);
5933 var _super = _createSuper(Ui);
5934 function Ui() {
5935 var _this;
5936 (0, _classCallCheck2.default)(this, Ui);
5937 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
5938 args[_key] = arguments[_key];
5939 }
5940 _this = _super.call.apply(_super, [this].concat(args));
5941 _this.callbacks.before = {};
5942 _this.depth.before = {};
5943 return _this;
5944 }
5945 (0, _createClass2.default)(Ui, [{
5946 key: "getType",
5947 value: function getType() {
5948 return 'ui';
5949 }
5950 }, {
5951 key: "runCallback",
5952 value: function runCallback(event, callback, args, result) {
5953 switch (event) {
5954 case 'before':
5955 callback.callback(args);
5956 break;
5957 case 'catch':
5958 case 'after':
5959 callback.callback(args, result);
5960 break;
5961 default:
5962 return false;
5963 }
5964 return true;
5965 }
5966 }, {
5967 key: "onRun",
5968 value: function onRun(command, args, event) {
5969 if (!$e.devTools) {
5970 return;
5971 }
5972 $e.devTools.log.callbacks().run(this.getType(), command, args, event);
5973 }
5974 }, {
5975 key: "onCallback",
5976 value: function onCallback(command, args, event, id) {
5977 if (!$e.devTools) {
5978 return;
5979 }
5980 $e.devTools.log.callbacks().callback(this.getType(), command, args, event, id);
5981 }
5982 }]);
5983 return Ui;
5984 }(_base.default);
5985 exports["default"] = Ui;
5986
5987 /***/ }),
5988
5989 /***/ "../modules/web-cli/assets/js/core/routes.js":
5990 /*!***************************************************!*\
5991 !*** ../modules/web-cli/assets/js/core/routes.js ***!
5992 \***************************************************/
5993 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5994
5995 "use strict";
5996
5997
5998 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
5999 Object.defineProperty(exports, "__esModule", ({
6000 value: true
6001 }));
6002 exports["default"] = void 0;
6003 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
6004 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
6005 var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js"));
6006 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
6007 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
6008 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
6009 var _commands = _interopRequireDefault(__webpack_require__(/*! ./commands */ "../modules/web-cli/assets/js/core/commands.js"));
6010 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
6011 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
6012 var Routes = /*#__PURE__*/function (_Commands) {
6013 (0, _inherits2.default)(Routes, _Commands);
6014 var _super = _createSuper(Routes);
6015 function Routes() {
6016 var _this;
6017 (0, _classCallCheck2.default)(this, Routes);
6018 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
6019 args[_key] = arguments[_key];
6020 }
6021 _this = _super.call.apply(_super, [this].concat(args));
6022 _this.savedStates = {};
6023 _this.historyPerComponent = {};
6024 return _this;
6025 }
6026 (0, _createClass2.default)(Routes, [{
6027 key: "refreshContainer",
6028 value: function refreshContainer(container) {
6029 var currentRoute = this.getCurrent(container),
6030 currentArgs = this.getCurrentArgs(container);
6031 this.clearCurrent(container);
6032 this.to(currentRoute, currentArgs);
6033 }
6034 }, {
6035 key: "getHistory",
6036 value: function getHistory() {
6037 var namespaceRoot = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
6038 if (namespaceRoot) {
6039 return this.historyPerComponent[namespaceRoot] || [];
6040 }
6041 return this.historyPerComponent;
6042 }
6043 }, {
6044 key: "clearHistory",
6045 value: function clearHistory(namespaceRoot) {
6046 delete this.historyPerComponent[namespaceRoot];
6047 }
6048 }, {
6049 key: "clearCurrent",
6050 value: function clearCurrent(container) {
6051 var route = this.current[container];
6052 if (!route) {
6053 return;
6054 }
6055 this.detachCurrent(container);
6056 this.getComponent(route).onCloseRoute(route);
6057 this.dispatchOnClose(route);
6058 }
6059 }, {
6060 key: "clear",
6061 value: function clear() {
6062 var _this2 = this;
6063 Object.keys(this.current).forEach(function (container) {
6064 return _this2.clearCurrent(container);
6065 });
6066 }
6067 }, {
6068 key: "saveState",
6069 value: function saveState(container) {
6070 this.savedStates[container] = {
6071 route: this.current[container],
6072 args: this.currentArgs[container]
6073 };
6074 return this;
6075 }
6076 }, {
6077 key: "restoreState",
6078 value: function restoreState(container) {
6079 if (!this.savedStates[container]) {
6080 return false;
6081 }
6082 this.to(this.savedStates[container].route, this.savedStates[container].args);
6083 return true;
6084 }
6085 }, {
6086 key: "validateRun",
6087 value: function validateRun(route) {
6088 var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
6089 if (!(0, _get2.default)((0, _getPrototypeOf2.default)(Routes.prototype), "validateRun", this).call(this, route, args)) {
6090 return false;
6091 }
6092 if (this.is(route, args) && !args.refresh) {
6093 return false;
6094 }
6095 var component = this.getComponent(route);
6096 if (!component.isOpen || args.reOpen) {
6097 component.isOpen = component.open(args);
6098 }
6099 return component.isOpen;
6100 }
6101
6102 /**
6103 * @override
6104 */
6105 }, {
6106 key: "beforeRun",
6107 value: function beforeRun(route, args) {
6108 var component = this.getComponent(route),
6109 container = component.getServiceName(),
6110 oldRoute = this.current[container];
6111 if (oldRoute) {
6112 this.getComponent(oldRoute).onCloseRoute(oldRoute);
6113 }
6114 _commands.default.trace.push(route);
6115 (0, _get2.default)((0, _getPrototypeOf2.default)(Routes.prototype), "beforeRun", this).call(this, route, args, false);
6116 this.attachCurrent(container, route, args);
6117
6118 // In the previous condition, `$e.routes.is()` resolves the old route as active (because the actual route
6119 // switching happens inside `this.attachCurrent()`), so we can't use it there.
6120 if (oldRoute) {
6121 this.dispatchOnClose(oldRoute);
6122 }
6123 }
6124 }, {
6125 key: "to",
6126 value: function to(route, args) {
6127 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
6128 history: true
6129 };
6130 this.run(route, args);
6131 var namespaceRoot = this.getComponent(route).getServiceName();
6132 if (options.history) {
6133 if (!this.historyPerComponent[namespaceRoot]) {
6134 this.historyPerComponent[namespaceRoot] = [];
6135 }
6136 this.historyPerComponent[namespaceRoot].push({
6137 route: route,
6138 args: args
6139 });
6140 }
6141 }
6142 }, {
6143 key: "back",
6144 value: function back(namespaceRoot) {
6145 var history = this.getHistory(namespaceRoot);
6146
6147 // Remove current;
6148 history.pop();
6149 var last = history.pop();
6150 if (!last) {
6151 return;
6152 }
6153 this.to(last.route, last.args);
6154 }
6155
6156 // Don't use the event object.
6157 }, {
6158 key: "runShortcut",
6159 value: function runShortcut(command) {
6160 this.to(command);
6161 }
6162
6163 // Don't clear current route.
6164 }, {
6165 key: "afterRun",
6166 value: function afterRun(route, args) {
6167 var results = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
6168 var component = this.getComponent(route);
6169 component.onRoute(route, args);
6170 this.dispatchOnOpen(route);
6171 (0, _get2.default)((0, _getPrototypeOf2.default)(Routes.prototype), "afterRun", this).call(this, route, args, results, false);
6172 _commands.default.trace.pop();
6173 }
6174 }, {
6175 key: "is",
6176 value: function is(route) {
6177 var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
6178 if (!(0, _get2.default)((0, _getPrototypeOf2.default)(Routes.prototype), "is", this).call(this, route)) {
6179 return false;
6180 }
6181 var container = this.getComponent(route).getServiceName();
6182 return _.isEqual(args, this.currentArgs[container]);
6183 }
6184 }, {
6185 key: "isPartOf",
6186 value: function isPartOf(route) {
6187 /**
6188 * Check against current command hierarchically.
6189 * For example `is( 'panel' )` will be true for `panel/elements`
6190 * `is( 'panel/editor' )` will be true for `panel/editor/style`
6191 */
6192 var parts = route.split('/'),
6193 container = parts[0],
6194 toCheck = [],
6195 currentParts = this.current[container] ? this.current[container].split('/') : [];
6196 var match = false;
6197 currentParts.forEach(function (part) {
6198 toCheck.push(part);
6199 if (toCheck.join('/') === route) {
6200 match = true;
6201 }
6202 });
6203 return match;
6204 }
6205 }, {
6206 key: "error",
6207 value: function error(message) {
6208 throw Error('Routes: ' + message);
6209 }
6210 }, {
6211 key: "dispatchOnOpen",
6212 value: function dispatchOnOpen(route) {
6213 window.dispatchEvent(new CustomEvent('elementor/routes/open', {
6214 detail: {
6215 route: route
6216 }
6217 }));
6218 }
6219 }, {
6220 key: "dispatchOnClose",
6221 value: function dispatchOnClose(route) {
6222 window.dispatchEvent(new CustomEvent('elementor/routes/close', {
6223 detail: {
6224 route: route
6225 }
6226 }));
6227 }
6228 }]);
6229 return Routes;
6230 }(_commands.default);
6231 exports["default"] = Routes;
6232
6233 /***/ }),
6234
6235 /***/ "../modules/web-cli/assets/js/core/shortcuts.js":
6236 /*!******************************************************!*\
6237 !*** ../modules/web-cli/assets/js/core/shortcuts.js ***!
6238 \******************************************************/
6239 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6240
6241 "use strict";
6242
6243
6244 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
6245 Object.defineProperty(exports, "__esModule", ({
6246 value: true
6247 }));
6248 exports["default"] = void 0;
6249 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
6250 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
6251 var _environment = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/environment */ "../modules/web-cli/assets/js/utils/environment.js"));
6252 var _console = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/console */ "../modules/web-cli/assets/js/utils/console.js"));
6253 var Shortcuts = /*#__PURE__*/function () {
6254 function Shortcuts($window) {
6255 (0, _classCallCheck2.default)(this, Shortcuts);
6256 this.specialKeys = {
6257 13: 'enter',
6258 27: 'esc',
6259 38: 'up',
6260 40: 'down',
6261 46: 'del',
6262 191: '?'
6263 };
6264 this.component = '';
6265 this.handlers = {};
6266 this.bindListener($window);
6267 }
6268 (0, _createClass2.default)(Shortcuts, [{
6269 key: "bindListener",
6270 value: function bindListener($window) {
6271 var _this = this;
6272 $window.on('keydown', function (event) {
6273 return _this.handle(event);
6274 });
6275 }
6276 }, {
6277 key: "getAll",
6278 value: function getAll() {
6279 var shortcuts = {};
6280 jQuery.each(this.handlers, function (key, handler) {
6281 jQuery.each(handler, function (index, config) {
6282 shortcuts[config.command] = key;
6283 });
6284 });
6285 return shortcuts;
6286 }
6287
6288 /**
6289 * @param {string} shortcuts
6290 * @param {Object} args
6291 * @param {Function} args.callback Required
6292 * @param {string} args.component Optional
6293 * @param {Function} args.dependency Optional
6294 * @param {Array} args.exclude Optional
6295 * @param {boolean} args.allowAltKey Optional
6296 */
6297 }, {
6298 key: "register",
6299 value: function register(shortcuts, args) {
6300 var _this2 = this;
6301 shortcuts.replace(' ', '').split(',').forEach(function (shortcut) {
6302 if (!_this2.handlers[shortcut]) {
6303 _this2.handlers[shortcut] = [];
6304 }
6305 _this2.handlers[shortcut].push(args);
6306 });
6307 }
6308 }, {
6309 key: "unregister",
6310 value: function unregister(shortcuts, args) {
6311 var _this3 = this;
6312 shortcuts.replace(' ', '').split(',').forEach(function (shortcut) {
6313 _this3.handlers[shortcut].forEach(function (index, handler) {
6314 if (args === handler) {
6315 delete _this3.handlers[shortcut][index];
6316 }
6317 });
6318 });
6319 }
6320 }, {
6321 key: "handle",
6322 value: function handle(event) {
6323 var handlers = this.getHandlersByPriority(event);
6324 if (!handlers) {
6325 return;
6326 }
6327 var filteredHandlers = handlers.filter(function (handler) {
6328 if (handler.exclude && -1 !== handler.exclude.indexOf('input')) {
6329 var $target = jQuery(event.target);
6330 if ($target.is(':input, .elementor-input') || $target.closest('[contenteditable="true"]').length) {
6331 return false;
6332 }
6333 }
6334 if (handler.dependency && !handler.dependency(event)) {
6335 return false;
6336 }
6337
6338 // Fix for some keyboard sources that consider alt key as ctrl key
6339 if (!handler.allowAltKey && event.altKey) {
6340 return false;
6341 }
6342 return true;
6343 });
6344 if (!filteredHandlers.length) {
6345 return;
6346 }
6347 if (1 < filteredHandlers.length && elementorWebCliConfig.isDebug) {
6348 _console.default.warn('Multiple handlers for shortcut.', filteredHandlers, event);
6349 }
6350 event.preventDefault();
6351 filteredHandlers[0].callback(event);
6352 }
6353 }, {
6354 key: "isControlEvent",
6355 value: function isControlEvent(event) {
6356 return event[_environment.default.mac ? 'metaKey' : 'ctrlKey'];
6357 }
6358 }, {
6359 key: "getEventShortcut",
6360 value: function getEventShortcut(event) {
6361 var shortcut = [];
6362 if (event.altKey) {
6363 shortcut.push('alt');
6364 }
6365 if (this.isControlEvent(event)) {
6366 shortcut.push('ctrl');
6367 }
6368 if (event.shiftKey) {
6369 shortcut.push('shift');
6370 }
6371 if (this.specialKeys[event.which]) {
6372 shortcut.push(this.specialKeys[event.which]);
6373 } else {
6374 shortcut.push(String.fromCharCode(event.which).toLowerCase());
6375 }
6376 return shortcut.join('+');
6377 }
6378 }, {
6379 key: "isActiveScope",
6380 value: function isActiveScope(scopes) {
6381 var activeComponents = Object.keys($e.components.activeComponents),
6382 activeComponent = activeComponents[activeComponents.length - 1],
6383 component = $e.components.get(activeComponent);
6384 if (!component) {
6385 return false;
6386 }
6387 var namespace = component.getNamespace();
6388 var filteredByNamespace = scopes.some(function (scope) {
6389 return namespace === scope;
6390 });
6391 if (filteredByNamespace) {
6392 return true;
6393 }
6394
6395 // Else filter by namespaceRoot.
6396 var namespaceRoot = component.getServiceName();
6397 return scopes.some(function (scope) {
6398 return namespaceRoot === scope;
6399 });
6400 }
6401 }, {
6402 key: "getHandlersByPriority",
6403 value: function getHandlersByPriority(event) {
6404 var _this4 = this;
6405 var handlers = this.handlers[this.getEventShortcut(event)];
6406 if (!handlers) {
6407 return false;
6408 }
6409
6410 // TODO: Prioritize current scope before roo scope.
6411 var inCurrentScope = handlers.filter(function (handler) {
6412 return handler.scopes && _this4.isActiveScope(handler.scopes);
6413 });
6414 if (inCurrentScope.length) {
6415 return inCurrentScope;
6416 }
6417 var noScope = handlers.filter(function (handler) {
6418 return !handler.scopes;
6419 });
6420 if (noScope.length) {
6421 return noScope;
6422 }
6423 }
6424 }]);
6425 return Shortcuts;
6426 }();
6427 exports["default"] = Shortcuts;
6428
6429 /***/ }),
6430
6431 /***/ "../modules/web-cli/assets/js/core/store.js":
6432 /*!**************************************************!*\
6433 !*** ../modules/web-cli/assets/js/core/store.js ***!
6434 \**************************************************/
6435 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6436
6437 "use strict";
6438
6439
6440 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
6441 Object.defineProperty(exports, "__esModule", ({
6442 value: true
6443 }));
6444 exports["default"] = void 0;
6445 var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
6446 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
6447 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
6448 var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
6449 var _toolkit = __webpack_require__(/*! @reduxjs/toolkit */ "../node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js");
6450 function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
6451 function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
6452 /**
6453 * @typedef {import('@reduxjs/toolkit').Slice} Slice
6454 */
6455 /**
6456 * @typedef {import('@reduxjs/toolkit').EnhancedStore} EnhancedStore
6457 */
6458 /**
6459 * @typedef {import('@reduxjs/toolkit').AnyAction} AnyAction
6460 */
6461 /**
6462 * @typedef {import('@reduxjs/toolkit').ThunkMiddlewareFor} ThunkMiddlewareFor
6463 */
6464 var Store = /*#__PURE__*/function () {
6465 /**
6466 * Initialize the Store.
6467 *
6468 * @return {void}
6469 */
6470 function Store() {
6471 (0, _classCallCheck2.default)(this, Store);
6472 /**
6473 * @type {Object}
6474 */
6475 (0, _defineProperty2.default)(this, "slices", {});
6476 /**
6477 * @type {EnhancedStore<{}, AnyAction, [ThunkMiddlewareFor<{}>]>}
6478 */
6479 (0, _defineProperty2.default)(this, "reduxStore", void 0);
6480 this.slices = {};
6481 this.reduxStore = this.createStore();
6482 }
6483
6484 /**
6485 * Create a Redux Store object.
6486 *
6487 * @return {EnhancedStore<{}, AnyAction, [ThunkMiddlewareFor<{}>]>} store
6488 */
6489 (0, _createClass2.default)(Store, [{
6490 key: "createStore",
6491 value: function createStore() {
6492 return (0, _toolkit.configureStore)({
6493 // Use an empty function instead of empty object since an empty object
6494 // isn't a valid reducer value.
6495 reducer: function reducer() {}
6496 });
6497 }
6498
6499 /**
6500 * Inject a new reducer.
6501 *
6502 * See: https://redux.js.org/usage/code-splitting#defining-an-injectreducer-function
6503 *
6504 * @param {string} id - Reducer unique ID.
6505 * @param {Function} newReducer - New reducer to inject.
6506 *
6507 * @return {void}
6508 */
6509 }, {
6510 key: "injectReducer",
6511 value: function injectReducer(id, newReducer) {
6512 var prevReducers = this.getReducers();
6513 this.reduxStore.replaceReducer((0, _toolkit.combineReducers)(_objectSpread(_objectSpread({}, prevReducers), {}, (0, _defineProperty2.default)({}, id, newReducer))));
6514 }
6515
6516 /**
6517 * Register a Redux Store slice.
6518 *
6519 * @param {string} sliceId - Slice unique ID.
6520 * @param {Slice} instance - Slice object to add.
6521 *
6522 * @return {void}
6523 */
6524 }, {
6525 key: "register",
6526 value: function register(sliceId, instance) {
6527 if (this.slices[sliceId]) {
6528 throw "Slice with ID '".concat(sliceId, "' already exists.");
6529 }
6530 this.slices[sliceId] = instance;
6531 this.injectReducer(sliceId, instance.reducer);
6532 }
6533
6534 /**
6535 * Get a specific slice.
6536 *
6537 * @param {string|null} sliceId - Slice ID to get.
6538 *
6539 * @return {Slice} slice
6540 */
6541 }, {
6542 key: "get",
6543 value: function get(sliceId) {
6544 return this.slices[sliceId];
6545 }
6546
6547 /**
6548 * Get all slices.
6549 *
6550 * @return {Object} slices
6551 */
6552 }, {
6553 key: "getAllSlices",
6554 value: function getAllSlices() {
6555 return this.slices;
6556 }
6557
6558 /**
6559 * Get All slices.
6560 *
6561 * @return {Object} slices
6562 */
6563 }, {
6564 key: "getAll",
6565 value: function getAll() {
6566 return Object.keys(this.slices).sort();
6567 }
6568
6569 /**
6570 * Return the current reducers.
6571 *
6572 * @return {Object} reducers
6573 */
6574 }, {
6575 key: "getReducers",
6576 value: function getReducers() {
6577 return Object.entries(this.slices).reduce(function (reducers, _ref) {
6578 var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
6579 key = _ref2[0],
6580 slice = _ref2[1];
6581 return _objectSpread(_objectSpread({}, reducers), {}, (0, _defineProperty2.default)({}, key, slice.reducer));
6582 }, {});
6583 }
6584
6585 /**
6586 * Get the actual Redux store object.
6587 *
6588 * @return {Object} redux store object
6589 */
6590 }, {
6591 key: "getReduxStore",
6592 value: function getReduxStore() {
6593 return this.reduxStore;
6594 }
6595
6596 /**
6597 * Proxy to Redux's `dispatch()` function.
6598 *
6599 * @return {*} the dispatched action
6600 */
6601 }, {
6602 key: "dispatch",
6603 value: function dispatch() {
6604 var _this$reduxStore;
6605 return (_this$reduxStore = this.reduxStore).dispatch.apply(_this$reduxStore, arguments);
6606 }
6607
6608 /**
6609 * Proxy to Redux's `getState()` function, with the ability to get a specific slice.
6610 *
6611 * @param {string|null} sliceId
6612 *
6613 * @return {*} The current state tree of the application
6614 */
6615 }, {
6616 key: "getState",
6617 value: function getState() {
6618 var sliceId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
6619 var state = this.reduxStore.getState();
6620 return sliceId ? state[sliceId] : state;
6621 }
6622
6623 /**
6624 * Proxy to Redux's `replaceReducer()` function.
6625 * TODO: Do we want that?
6626 *
6627 * @return {*} undefined
6628 */
6629 }, {
6630 key: "replaceReducer",
6631 value: function replaceReducer() {
6632 var _this$reduxStore2;
6633 return (_this$reduxStore2 = this.reduxStore).replaceReducer.apply(_this$reduxStore2, arguments);
6634 }
6635
6636 /**
6637 * Proxy to Redux's `subscribe()` function.
6638 *
6639 * @return {*} A function that unsubscribes the change listener
6640 */
6641 }, {
6642 key: "subscribe",
6643 value: function subscribe() {
6644 var _this$reduxStore3;
6645 return (_this$reduxStore3 = this.reduxStore).subscribe.apply(_this$reduxStore3, arguments);
6646 }
6647 }]);
6648 return Store;
6649 }();
6650 exports["default"] = Store;
6651
6652 /***/ }),
6653
6654 /***/ "../modules/web-cli/assets/js/core/ui-states.js":
6655 /*!******************************************************!*\
6656 !*** ../modules/web-cli/assets/js/core/ui-states.js ***!
6657 \******************************************************/
6658 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6659
6660 "use strict";
6661
6662
6663 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
6664 Object.defineProperty(exports, "__esModule", ({
6665 value: true
6666 }));
6667 exports["default"] = void 0;
6668 var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
6669 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
6670 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
6671 /**
6672 * @typedef {import('./states/ui-state-base')} UiStateBase
6673 */
6674 var UiStates = /*#__PURE__*/function () {
6675 /**
6676 * Initialize the State Manager.
6677 *
6678 * @return {void}
6679 */
6680 function UiStates() {
6681 (0, _classCallCheck2.default)(this, UiStates);
6682 this.states = {};
6683 }
6684
6685 /**
6686 * Register a new state.
6687 *
6688 * @param {UiStateBase} instance - State instance.
6689 */
6690 (0, _createClass2.default)(UiStates, [{
6691 key: "register",
6692 value: function register(instance) {
6693 var stateId = instance.getPrefixedId();
6694 if (this.states[stateId]) {
6695 throw "State '".concat(stateId, "' already exists.");
6696 }
6697 this.states[stateId] = instance;
6698 }
6699
6700 /**
6701 * Get all existing states with their options:
6702 *
6703 * {
6704 * 'state-id': [
6705 * 'option-1',
6706 * 'option-2',
6707 * 'option-3',
6708 * ],
6709 * }
6710 *
6711 * @return {Object} all existing states
6712 */
6713 }, {
6714 key: "getAll",
6715 value: function getAll() {
6716 var states = {};
6717 Object.entries(this.states).forEach(function (_ref) {
6718 var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
6719 id = _ref2[0],
6720 instance = _ref2[1];
6721 var options = instance.getOptions();
6722 states[id] = Object.keys(options);
6723 });
6724 return states;
6725 }
6726
6727 /**
6728 * Get the state value, or return all of them if no `state` is set.
6729 *
6730 * @param {string} state - State ID.
6731 *
6732 * @return {UiStateBase} state value
6733 */
6734 }, {
6735 key: "get",
6736 value: function get(state) {
6737 if (state) {
6738 return this.states[state];
6739 }
6740 return this.states;
6741 }
6742
6743 /**
6744 * Set the current state value and trigger its callbacks & events.
6745 * This function triggers a `e-ui-state:${ stateID }` event to the scope, with `oldValue` & `newValue`
6746 * under `e.detail`.
6747 * Additionally, it adds a `e-ui-state--${ stateID }__${ value }` class to the scope element.
6748 *
6749 * @param {string} state - State ID.
6750 * @param {string} value - New state value.
6751 *
6752 * @return {void}
6753 */
6754 }, {
6755 key: "set",
6756 value: function set(state, value) {
6757 // Invalid state or option.
6758 if (!this.get(state)) {
6759 throw "State '".concat(state, "' doesn't exist.");
6760 }
6761 var oldValue = this.getCurrent(state),
6762 classPrefix = "e-ui-state--".concat(state.replaceAll('/', '-')),
6763 oldStateClass = "".concat(classPrefix, "__").concat(oldValue),
6764 newStateClass = "".concat(classPrefix, "__").concat(value),
6765 scopes = this.get(state).getScopes();
6766
6767 // Set the current state to the new value.
6768 this.get(state).set(value);
6769 scopes.forEach(function (scope) {
6770 scope.classList.remove(oldStateClass);
6771
6772 // Set the new class only if there is a value (i.e. it's not a state removal action).
6773 if (value) {
6774 scope.classList.add(newStateClass);
6775 }
6776
6777 // Dispatch a custom state-change event to the scope.
6778 var event = new CustomEvent("e-ui-state:".concat(state), {
6779 detail: {
6780 oldValue: oldValue,
6781 newValue: value
6782 }
6783 });
6784 scope.dispatchEvent(event);
6785 });
6786 }
6787
6788 /**
6789 * Remove a state.
6790 *
6791 * @param {string} state - State ID.
6792 *
6793 * @return {void}
6794 */
6795 }, {
6796 key: "remove",
6797 value: function remove(state) {
6798 this.set(state, '');
6799 }
6800
6801 /**
6802 * Get the current state value.
6803 *
6804 * @param {string} state - State ID.
6805 *
6806 * @return {string} current state value
6807 */
6808 }, {
6809 key: "getCurrent",
6810 value: function getCurrent(state) {
6811 var _this$get;
6812 return (_this$get = this.get(state)) === null || _this$get === void 0 ? void 0 : _this$get.getCurrent();
6813 }
6814 }]);
6815 return UiStates;
6816 }();
6817 exports["default"] = UiStates;
6818
6819 /***/ }),
6820
6821 /***/ "../modules/web-cli/assets/js/extras/hash-commands.js":
6822 /*!************************************************************!*\
6823 !*** ../modules/web-cli/assets/js/extras/hash-commands.js ***!
6824 \************************************************************/
6825 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6826
6827 "use strict";
6828
6829
6830 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
6831 Object.defineProperty(exports, "__esModule", ({
6832 value: true
6833 }));
6834 exports["default"] = void 0;
6835 var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js"));
6836 var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js"));
6837 var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
6838 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
6839 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
6840 var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
6841 var _console = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/console */ "../modules/web-cli/assets/js/utils/console.js"));
6842 function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
6843 function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
6844 function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
6845 var HashCommands = /*#__PURE__*/function () {
6846 function HashCommands() {
6847 (0, _classCallCheck2.default)(this, HashCommands);
6848 /**
6849 * Cannot be static since it uses callback(s) that are available only after '$e' is initialized.
6850 */
6851 (0, _defineProperty2.default)(this, "dispatchersList", {
6852 'e:run': {
6853 runner: function runner() {
6854 return $e.run;
6855 },
6856 isSafe: function isSafe(command) {
6857 var _$e$commands$getComma;
6858 return (_$e$commands$getComma = $e.commands.getCommandClass(command)) === null || _$e$commands$getComma === void 0 ? void 0 : _$e$commands$getComma.getInfo().isSafe;
6859 },
6860 isSafeWithArgs: function isSafeWithArgs(command) {
6861 var _$e$commands$getComma2;
6862 return (_$e$commands$getComma2 = $e.commands.getCommandClass(command)) === null || _$e$commands$getComma2 === void 0 ? void 0 : _$e$commands$getComma2.getInfo().isSafeWithArgs;
6863 }
6864 },
6865 'e:route': {
6866 runner: function runner() {
6867 return $e.route;
6868 },
6869 isSafe: function isSafe() {
6870 return true;
6871 },
6872 isSafeWithArgs: function isSafeWithArgs() {
6873 return false;
6874 }
6875 }
6876 });
6877 /**
6878 * @typedef HashCommand
6879 * @property {string} method method
6880 * @property {string} command command
6881 * @property {Object} args arguments
6882 */
6883 /**
6884 * List of current loaded hash commands.
6885 *
6886 * @type {Array.<HashCommand>}
6887 */
6888 (0, _defineProperty2.default)(this, "commands", []);
6889 this.commands = this.get();
6890 }
6891
6892 /**
6893 * Function get().
6894 *
6895 * Get API requests that comes from hash ( eg #e:run ).
6896 *
6897 * @param {string} hash
6898 *
6899 * @return {Array.<HashCommand>} API requests
6900 */
6901 (0, _createClass2.default)(HashCommands, [{
6902 key: "get",
6903 value: function get() {
6904 var _this = this;
6905 var hash = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : location.hash;
6906 var result = [];
6907 if (hash) {
6908 // Remove first '#' and split each '&'.
6909 var hashList = hash.substr(1).split('&');
6910 hashList.forEach(function (hashItem) {
6911 // eslint-disable-next-line @wordpress/no-unused-vars-before-return
6912 var _hashItem$split = hashItem.split('?'),
6913 _hashItem$split2 = (0, _slicedToArray2.default)(_hashItem$split, 2),
6914 rawCommand = _hashItem$split2[0],
6915 rawArgs = _hashItem$split2[1];
6916 var hashParts = rawCommand.split(':');
6917 if (3 !== hashParts.length) {
6918 return;
6919 }
6920 var method = hashParts[0] + ':' + hashParts[1],
6921 dispatcher = _this.dispatchersList[method];
6922 if (dispatcher) {
6923 var command = hashParts[2],
6924 args = _this.parseCommandArgs(rawArgs);
6925 result.push({
6926 method: method,
6927 command: command,
6928 args: args
6929 });
6930 }
6931 });
6932 }
6933 return result;
6934 }
6935
6936 /**
6937 * Function run().
6938 *
6939 * Run API requests that comes from hash ( eg #e:run ).
6940 *
6941 * @param {Array.<HashCommand>} [commands=this.commands]
6942 */
6943 }, {
6944 key: "run",
6945 value: function () {
6946 var _run = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
6947 var commands,
6948 _iterator,
6949 _step,
6950 hashCommand,
6951 dispatcher,
6952 _iterator2,
6953 _step2,
6954 _hashCommand,
6955 _dispatcher,
6956 _args = arguments;
6957 return _regenerator.default.wrap(function _callee$(_context) {
6958 while (1) switch (_context.prev = _context.next) {
6959 case 0:
6960 commands = _args.length > 0 && _args[0] !== undefined ? _args[0] : this.commands;
6961 // To allow validate the run first.
6962 _iterator = _createForOfIteratorHelper(commands);
6963 _context.prev = 2;
6964 _iterator.s();
6965 case 4:
6966 if ((_step = _iterator.n()).done) {
6967 _context.next = 13;
6968 break;
6969 }
6970 hashCommand = _step.value;
6971 dispatcher = this.dispatchersList[hashCommand.method];
6972 if (dispatcher) {
6973 _context.next = 9;
6974 break;
6975 }
6976 return _context.abrupt("return", Promise.reject(new Error("No dispatcher found for the command: `".concat(hashCommand.command, "`."))));
6977 case 9:
6978 if (dispatcher.isSafe(hashCommand.command)) {
6979 _context.next = 11;
6980 break;
6981 }
6982 return _context.abrupt("return", Promise.reject(new Error("Attempting to run unsafe or non exist command: `".concat(hashCommand.command, "`."))));
6983 case 11:
6984 _context.next = 4;
6985 break;
6986 case 13:
6987 _context.next = 18;
6988 break;
6989 case 15:
6990 _context.prev = 15;
6991 _context.t0 = _context["catch"](2);
6992 _iterator.e(_context.t0);
6993 case 18:
6994 _context.prev = 18;
6995 _iterator.f();
6996 return _context.finish(18);
6997 case 21:
6998 // This logic will run the promises by sequence (will wait for dispatcher to finish, before run again).
6999 _iterator2 = _createForOfIteratorHelper(commands);
7000 _context.prev = 22;
7001 _iterator2.s();
7002 case 24:
7003 if ((_step2 = _iterator2.n()).done) {
7004 _context.next = 31;
7005 break;
7006 }
7007 _hashCommand = _step2.value;
7008 _dispatcher = this.dispatchersList[_hashCommand.method];
7009 _context.next = 29;
7010 return _dispatcher.runner()(_hashCommand.command, _dispatcher.isSafeWithArgs(_hashCommand.command) ? _hashCommand.args : undefined);
7011 case 29:
7012 _context.next = 24;
7013 break;
7014 case 31:
7015 _context.next = 36;
7016 break;
7017 case 33:
7018 _context.prev = 33;
7019 _context.t1 = _context["catch"](22);
7020 _iterator2.e(_context.t1);
7021 case 36:
7022 _context.prev = 36;
7023 _iterator2.f();
7024 return _context.finish(36);
7025 case 39:
7026 case "end":
7027 return _context.stop();
7028 }
7029 }, _callee, this, [[2, 15, 18, 21], [22, 33, 36, 39]]);
7030 }));
7031 function run() {
7032 return _run.apply(this, arguments);
7033 }
7034 return run;
7035 }()
7036 /**
7037 * Function runOnce().
7038 *
7039 * Do same as `run` but clear `this.commands` before leaving.
7040 */
7041 }, {
7042 key: "runOnce",
7043 value: function runOnce() {
7044 var _this2 = this;
7045 this.run(this.commands).then(function () {
7046 _this2.commands = [];
7047 });
7048 }
7049
7050 /**
7051 * Takes a args in form of JSON and parse it.
7052 *
7053 * @param {string} rawArgs
7054 * @return {Object} args in as an object
7055 */
7056 }, {
7057 key: "parseCommandArgs",
7058 value: function parseCommandArgs(rawArgs) {
7059 try {
7060 return JSON.parse(decodeURI(rawArgs || '{}'));
7061 } catch (e) {
7062 _console.default.warn('Hash commands JSON args cannot be parsed. \n\n', e);
7063 return {};
7064 }
7065 }
7066 }]);
7067 return HashCommands;
7068 }();
7069 exports["default"] = HashCommands;
7070
7071 /***/ }),
7072
7073 /***/ "../modules/web-cli/assets/js/modules/command-base.js":
7074 /*!************************************************************!*\
7075 !*** ../modules/web-cli/assets/js/modules/command-base.js ***!
7076 \************************************************************/
7077 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7078
7079 "use strict";
7080
7081
7082 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
7083 Object.defineProperty(exports, "__esModule", ({
7084 value: true
7085 }));
7086 exports["default"] = void 0;
7087 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
7088 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
7089 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
7090 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
7091 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
7092 var _commandInfra = _interopRequireDefault(__webpack_require__(/*! ./command-infra */ "../modules/web-cli/assets/js/modules/command-infra.js"));
7093 var _deprecation = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/deprecation */ "../modules/web-cli/assets/js/utils/deprecation.js"));
7094 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
7095 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
7096 /**
7097 * @name $e.modules.CommandBase
7098 */
7099 var CommandBase = /*#__PURE__*/function (_CommandInfra) {
7100 (0, _inherits2.default)(CommandBase, _CommandInfra);
7101 var _super = _createSuper(CommandBase);
7102 function CommandBase() {
7103 (0, _classCallCheck2.default)(this, CommandBase);
7104 return _super.apply(this, arguments);
7105 }
7106 (0, _createClass2.default)(CommandBase, [{
7107 key: "onBeforeRun",
7108 value: function onBeforeRun() {
7109 var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7110 $e.hooks.runUIBefore(this.command, args);
7111 }
7112 }, {
7113 key: "onAfterRun",
7114 value: function onAfterRun() {
7115 var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7116 var result = arguments.length > 1 ? arguments[1] : undefined;
7117 $e.hooks.runUIAfter(this.command, args, result);
7118 }
7119 }, {
7120 key: "onBeforeApply",
7121 value: function onBeforeApply() {
7122 var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7123 $e.hooks.runDataDependency(this.command, args);
7124 }
7125 }, {
7126 key: "onAfterApply",
7127 value: function onAfterApply() {
7128 var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7129 var result = arguments.length > 1 ? arguments[1] : undefined;
7130 $e.hooks.runDataAfter(this.command, args, result);
7131 }
7132 }, {
7133 key: "onCatchApply",
7134 value: function onCatchApply(e) {
7135 this.runCatchHooks(e);
7136 }
7137
7138 /**
7139 * Run all the catch hooks.
7140 *
7141 * @param {Error} e
7142 */
7143 }, {
7144 key: "runCatchHooks",
7145 value: function runCatchHooks(e) {
7146 $e.hooks.runDataCatch(this.command, this.args, e);
7147 $e.hooks.runUICatch(this.command, this.args, e);
7148 }
7149
7150 /**
7151 * TODO - Remove - Backwards compatibility.
7152 *
7153 * Function requireContainer().
7154 *
7155 * Validate `arg.container` & `arg.containers`.
7156 *
7157 * @param {{}} args
7158 * @deprecated since 3.7.0, extend `$e.modules.editor.CommandContainerBase` or `$e.modules.editor.CommandContainerInternalBase` instead.
7159 *
7160 * @throws {Error}
7161 */
7162 }, {
7163 key: "requireContainer",
7164 value: function requireContainer() {
7165 var _this = this;
7166 var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.args;
7167 _deprecation.default.deprecated('requireContainer()', '3.7.0', 'Extend `$e.modules.editor.CommandContainerBase` or `$e.modules.editor.CommandContainerInternalBase`');
7168 if (!args.container && !args.containers) {
7169 throw Error('container or containers are required.');
7170 }
7171 if (args.container && args.containers) {
7172 throw Error('container and containers cannot go together please select one of them.');
7173 }
7174 var containers = args.containers || [args.container];
7175 containers.forEach(function (container) {
7176 _this.requireArgumentInstance('container', elementorModules.editor.Container, {
7177 container: container
7178 });
7179 });
7180 }
7181 }], [{
7182 key: "getInstanceType",
7183 value: function getInstanceType() {
7184 return 'CommandBase';
7185 }
7186 }]);
7187 return CommandBase;
7188 }(_commandInfra.default);
7189 exports["default"] = CommandBase;
7190
7191 /***/ }),
7192
7193 /***/ "../modules/web-cli/assets/js/modules/command-callback-base.js":
7194 /*!*********************************************************************!*\
7195 !*** ../modules/web-cli/assets/js/modules/command-callback-base.js ***!
7196 \*********************************************************************/
7197 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7198
7199 "use strict";
7200
7201
7202 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
7203 Object.defineProperty(exports, "__esModule", ({
7204 value: true
7205 }));
7206 exports["default"] = void 0;
7207 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
7208 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
7209 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
7210 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
7211 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
7212 var _commandBase = _interopRequireDefault(__webpack_require__(/*! ./command-base */ "../modules/web-cli/assets/js/modules/command-base.js"));
7213 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
7214 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
7215 /**
7216 * To support pure callbacks in the API(commands.js), to ensure they have registered with the proper context.
7217 */
7218 var CommandCallbackBase = /*#__PURE__*/function (_CommandBase) {
7219 (0, _inherits2.default)(CommandCallbackBase, _CommandBase);
7220 var _super = _createSuper(CommandCallbackBase);
7221 function CommandCallbackBase() {
7222 (0, _classCallCheck2.default)(this, CommandCallbackBase);
7223 return _super.apply(this, arguments);
7224 }
7225 (0, _createClass2.default)(CommandCallbackBase, [{
7226 key: "apply",
7227 value: function apply() {
7228 var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7229 return this.constructor.getCallback()(args);
7230 }
7231 }], [{
7232 key: "getInstanceType",
7233 value: function getInstanceType() {
7234 return 'CommandCallbackBase';
7235 }
7236
7237 /**
7238 * Get original callback of the command.
7239 *
7240 * Support pure callbacks ( Non command-base ).
7241 *
7242 * @return {()=>{}} Command Results.
7243 */
7244 }, {
7245 key: "getCallback",
7246 value: function getCallback() {
7247 return this.registerConfig.callback;
7248 }
7249 }]);
7250 return CommandCallbackBase;
7251 }(_commandBase.default);
7252 exports["default"] = CommandCallbackBase;
7253
7254 /***/ }),
7255
7256 /***/ "../modules/web-cli/assets/js/modules/command-data.js":
7257 /*!************************************************************!*\
7258 !*** ../modules/web-cli/assets/js/modules/command-data.js ***!
7259 \************************************************************/
7260 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7261
7262 "use strict";
7263
7264
7265 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
7266 var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js");
7267 Object.defineProperty(exports, "__esModule", ({
7268 value: true
7269 }));
7270 exports["default"] = void 0;
7271 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
7272 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
7273 var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js"));
7274 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
7275 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
7276 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
7277 var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
7278 var _commandBase = _interopRequireDefault(__webpack_require__(/*! ./command-base */ "../modules/web-cli/assets/js/modules/command-base.js"));
7279 var errors = _interopRequireWildcard(__webpack_require__(/*! ../core/data/errors/ */ "../modules/web-cli/assets/js/core/data/errors/index.js"));
7280 function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
7281 function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
7282 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
7283 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
7284 /**
7285 * @name $e.modules.CommandData
7286 */
7287 /**
7288 * @typedef {('create'|'delete'|'get'|'update'|'options')} DataTypes
7289 */
7290 /**
7291 * @typedef {{}} RequestData
7292 */
7293 /**
7294 * @typedef {import('../core/data/errors/base-error')} BaseError
7295 */
7296 var CommandData = /*#__PURE__*/function (_CommandBase) {
7297 (0, _inherits2.default)(CommandData, _CommandBase);
7298 var _super = _createSuper(CommandData);
7299 function CommandData(args) {
7300 var _this$args$options;
7301 var _this;
7302 var commandsAPI = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : $e.data;
7303 (0, _classCallCheck2.default)(this, CommandData);
7304 _this = _super.call(this, args, commandsAPI);
7305 /**
7306 * Data returned from remote.
7307 *
7308 * @type {*}
7309 */
7310 (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "data", void 0);
7311 /**
7312 * Fetch type.
7313 *
7314 * @type {DataTypes}
7315 */
7316 (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "type", void 0);
7317 if ((_this$args$options = _this.args.options) !== null && _this$args$options !== void 0 && _this$args$options.type) {
7318 _this.type = _this.args.options.type;
7319 }
7320 return _this;
7321 }
7322
7323 /**
7324 * Function getEndpointFormat().
7325 *
7326 * @return {null|string} endpoint format
7327 */
7328 (0, _createClass2.default)(CommandData, [{
7329 key: "getApplyMethods",
7330 value:
7331 /**
7332 * @param {DataTypes} type
7333 *
7334 * @return {boolean|{before: (function(*=): {}), after: (function({}, *=): {})}} apply methods
7335 */
7336 function getApplyMethods() {
7337 var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.type;
7338 var before, after;
7339 switch (type) {
7340 case 'create':
7341 before = this.applyBeforeCreate;
7342 after = this.applyAfterCreate;
7343 break;
7344 case 'delete':
7345 before = this.applyBeforeDelete;
7346 after = this.applyAfterDelete;
7347 break;
7348 case 'get':
7349 before = this.applyBeforeGet;
7350 after = this.applyAfterGet;
7351 break;
7352 case 'update':
7353 before = this.applyBeforeUpdate;
7354 after = this.applyAfterUpdate;
7355 break;
7356 case 'options':
7357 before = this.applyBeforeOptions;
7358 after = this.applyAfterOptions;
7359 break;
7360 default:
7361 return false;
7362 }
7363 return {
7364 before: before.bind(this),
7365 after: after.bind(this)
7366 };
7367 }
7368
7369 /**
7370 * Function getRequestData().
7371 *
7372 * @return {RequestData} request data
7373 */
7374 }, {
7375 key: "getRequestData",
7376 value: function getRequestData() {
7377 return {
7378 type: this.type,
7379 args: this.args,
7380 timestamp: new Date().getTime(),
7381 component: this.component,
7382 command: this.command,
7383 endpoint: $e.data.commandToEndpoint(this.command, JSON.parse(JSON.stringify(this.args)), this.constructor.getEndpointFormat())
7384 };
7385 }
7386 }, {
7387 key: "apply",
7388 value: function apply() {
7389 var _this2 = this;
7390 var applyMethods = this.getApplyMethods();
7391
7392 // Run 'before' method.
7393 this.args = applyMethods.before(this.args);
7394 var requestData = this.getRequestData();
7395 return $e.data.fetch(requestData).then(function (data) {
7396 _this2.data = data;
7397
7398 // Run 'after' method.
7399 _this2.data = applyMethods.after(data, _this2.args);
7400 _this2.data = {
7401 data: _this2.data
7402 };
7403
7404 // Append requestData.
7405 _this2.data = Object.assign({
7406 __requestData__: requestData
7407 }, _this2.data);
7408 return _this2.data;
7409 });
7410 }
7411
7412 /**
7413 * @param {*} [args={}]
7414 * @return {{}} filtered args
7415 */
7416 }, {
7417 key: "applyBeforeCreate",
7418 value: function applyBeforeCreate() {
7419 var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7420 return args;
7421 }
7422
7423 /**
7424 * @param {{}} data
7425 * @param {*} [args={}]
7426 * @return {{}} filtered result
7427 */
7428 }, {
7429 key: "applyAfterCreate",
7430 value: function applyAfterCreate(data) {
7431 var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7432 // eslint-disable-line no-unused-vars
7433 return data;
7434 }
7435
7436 /**
7437 * @param {*} [args={}]
7438 * @return {{}} filtered args
7439 */
7440 }, {
7441 key: "applyBeforeDelete",
7442 value: function applyBeforeDelete() {
7443 var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7444 return args;
7445 }
7446
7447 /**
7448 * @param {{}} data
7449 * @param {*} [args={}]
7450 * @return {{}} filtered result
7451 */
7452 }, {
7453 key: "applyAfterDelete",
7454 value: function applyAfterDelete(data) {
7455 var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7456 // eslint-disable-line no-unused-vars
7457 return data;
7458 }
7459
7460 /**
7461 * @param {*} [args={}]
7462 * @return {{}} filtered args
7463 */
7464 }, {
7465 key: "applyBeforeGet",
7466 value: function applyBeforeGet() {
7467 var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7468 return args;
7469 }
7470
7471 /**
7472 * @param {{}} data
7473 * @param {*} [args={}]
7474 * @return {{}} filtered result
7475 */
7476 }, {
7477 key: "applyAfterGet",
7478 value: function applyAfterGet(data) {
7479 var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7480 // eslint-disable-line no-unused-vars
7481 return data;
7482 }
7483
7484 /**
7485 * @param {*} [args={}]
7486 * @return {{}} filtered args
7487 */
7488 }, {
7489 key: "applyBeforeUpdate",
7490 value: function applyBeforeUpdate() {
7491 var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7492 return args;
7493 }
7494
7495 /**
7496 * @param {{}} data
7497 * @param {*} [args={}]
7498 * @return {{}} filtered result
7499 */
7500 }, {
7501 key: "applyAfterUpdate",
7502 value: function applyAfterUpdate(data) {
7503 var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7504 // eslint-disable-line no-unused-vars
7505 return data;
7506 }
7507
7508 /**
7509 * @param {*} [args={}]
7510 * @return {{}} filtered args
7511 */
7512 }, {
7513 key: "applyBeforeOptions",
7514 value: function applyBeforeOptions() {
7515 var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7516 return args;
7517 }
7518
7519 /**
7520 * @param {{}} data
7521 * @param {*} [args={}]
7522 * @return {{}} filtered result
7523 */
7524 }, {
7525 key: "applyAfterOptions",
7526 value: function applyAfterOptions(data) {
7527 var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7528 // eslint-disable-line no-unused-vars
7529 return data;
7530 }
7531
7532 /**
7533 * @param {BaseError} e
7534 */
7535 }, {
7536 key: "applyAfterCatch",
7537 value: function applyAfterCatch(e) {
7538 e.notify();
7539 }
7540 }, {
7541 key: "onCatchApply",
7542 value: function onCatchApply(e) {
7543 var _e, _e$data;
7544 // TODO: If the errors that returns from the server is consistent remove the '?' from 'e'
7545 var httpErrorCode = ((_e = e) === null || _e === void 0 ? void 0 : (_e$data = _e.data) === null || _e$data === void 0 ? void 0 : _e$data.status) || 501;
7546 var dataError = Object.values(errors).find(function (error) {
7547 return error.getHTTPErrorCode() === httpErrorCode;
7548 });
7549 if (!dataError) {
7550 dataError = errors.DefaultError;
7551 }
7552 e = dataError.create(e.message, e.code, e.data || []);
7553 this.runCatchHooks(e);
7554 this.applyAfterCatch(e);
7555 }
7556 }], [{
7557 key: "getInstanceType",
7558 value: function getInstanceType() {
7559 return 'CommandData';
7560 }
7561 }, {
7562 key: "getEndpointFormat",
7563 value: function getEndpointFormat() {
7564 return null;
7565 }
7566 }]);
7567 return CommandData;
7568 }(_commandBase.default);
7569 exports["default"] = CommandData;
7570
7571 /***/ }),
7572
7573 /***/ "../modules/web-cli/assets/js/modules/command-infra.js":
7574 /*!*************************************************************!*\
7575 !*** ../modules/web-cli/assets/js/modules/command-infra.js ***!
7576 \*************************************************************/
7577 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7578
7579 "use strict";
7580
7581
7582 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
7583 Object.defineProperty(exports, "__esModule", ({
7584 value: true
7585 }));
7586 exports["default"] = void 0;
7587 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
7588 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
7589 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
7590 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
7591 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
7592 var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
7593 var _argsObject = _interopRequireDefault(__webpack_require__(/*! elementor-assets-js/modules/imports/args-object */ "../assets/dev/js/modules/imports/args-object.js"));
7594 var _deprecation = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/deprecation */ "../modules/web-cli/assets/js/utils/deprecation.js"));
7595 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
7596 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
7597 /**
7598 * @typedef {import('../modules/component-base')} ComponentBase
7599 */
7600 var CommandInfra = /*#__PURE__*/function (_ArgsObject) {
7601 (0, _inherits2.default)(CommandInfra, _ArgsObject);
7602 var _super = _createSuper(CommandInfra);
7603 /**
7604 * Function constructor().
7605 *
7606 * Create Commands Base.
7607 *
7608 * @param {{}} args
7609 */
7610 function CommandInfra() {
7611 var _this;
7612 var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7613 (0, _classCallCheck2.default)(this, CommandInfra);
7614 _this = _super.call(this, args);
7615 if (!_this.constructor.registerConfig) {
7616 throw RangeError('Doing it wrong: Each command type should have `registerConfig`.');
7617 }
7618
7619 // Acknowledge self about which command it run.
7620 _this.command = _this.constructor.getCommand();
7621
7622 // Assign instance of current component.
7623 _this.component = _this.constructor.getComponent();
7624
7625 // Who ever need do something before without `super` the constructor can use `initialize` method.
7626 _this.initialize(args);
7627
7628 // Refresh args, maybe the changed via `initialize`.
7629 args = _this.args;
7630
7631 // Validate args before run.
7632 _this.validateArgs(args);
7633 return _this;
7634 }
7635
7636 /**
7637 * Function initialize().
7638 *
7639 * Initialize command, called after construction.
7640 *
7641 * @param {{}} args
7642 */
7643 (0, _createClass2.default)(CommandInfra, [{
7644 key: "currentCommand",
7645 get:
7646 /**
7647 * @deprecated since 3.7.0, use `this.command` instead.
7648 */
7649 function get() {
7650 _deprecation.default.deprecated('this.currentCommand', '3.7.0', 'this.command');
7651 return this.command;
7652 }
7653 }, {
7654 key: "initialize",
7655 value: function initialize() {
7656 var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7657 } // eslint-disable-line no-unused-vars
7658
7659 /**
7660 * Function validateArgs().
7661 *
7662 * Validate command arguments.
7663 *
7664 * @param {{}} args
7665 */
7666 }, {
7667 key: "validateArgs",
7668 value: function validateArgs() {
7669 var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7670 } // eslint-disable-line no-unused-vars
7671
7672 // eslint-disable-next-line jsdoc/require-returns-check
7673 /**
7674 * Function apply().
7675 *
7676 * Do the actual command.
7677 *
7678 * @param {{}} args
7679 *
7680 * @return {*} Command results.
7681 */
7682 }, {
7683 key: "apply",
7684 value: function apply() {
7685 var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7686 // eslint-disable-line no-unused-vars
7687 elementorModules.ForceMethodImplementation();
7688 }
7689
7690 /**
7691 * Function run().
7692 *
7693 * Run command with history & hooks.
7694 *
7695 * @return {*} Command results.
7696 */
7697 }, {
7698 key: "run",
7699 value: function run() {
7700 return this.apply(this.args);
7701 }
7702
7703 /**
7704 * Function onBeforeRun.
7705 *
7706 * Called before run().
7707 *
7708 * @param {{}} args
7709 */
7710 }, {
7711 key: "onBeforeRun",
7712 value: function onBeforeRun() {
7713 var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7714 } // eslint-disable-line no-unused-vars
7715
7716 /**
7717 * Function onAfterRun.
7718 *
7719 * Called after run().
7720 *
7721 * @param {{}} args
7722 * @param {*} result
7723 */
7724 }, {
7725 key: "onAfterRun",
7726 value: function onAfterRun() {
7727 var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7728 var result = arguments.length > 1 ? arguments[1] : undefined;
7729 } // eslint-disable-line no-unused-vars
7730
7731 /**
7732 * Function onBeforeApply.
7733 *
7734 * Called before apply().
7735 *
7736 * @param {{}} args
7737 */
7738 }, {
7739 key: "onBeforeApply",
7740 value: function onBeforeApply() {
7741 var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7742 } // eslint-disable-line no-unused-vars
7743
7744 /**
7745 * Function onAfterApply.
7746 *
7747 * Called after apply().
7748 *
7749 * @param {{}} args
7750 * @param {*} result
7751 */
7752 }, {
7753 key: "onAfterApply",
7754 value: function onAfterApply() {
7755 var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7756 var result = arguments.length > 1 ? arguments[1] : undefined;
7757 } // eslint-disable-line no-unused-vars
7758
7759 /**
7760 * Function onCatchApply.
7761 *
7762 * Called after apply() failed.
7763 *
7764 * @param {Error} e
7765 */
7766 }, {
7767 key: "onCatchApply",
7768 value: function onCatchApply(e) {} // eslint-disable-line no-unused-vars
7769 }], [{
7770 key: "getInstanceType",
7771 value: function getInstanceType() {
7772 return 'CommandInfra';
7773 }
7774
7775 /**
7776 * Get info of command.
7777 *
7778 * @return {Object} Extra information about the command.
7779 */
7780 }, {
7781 key: "getInfo",
7782 value: function getInfo() {
7783 return {};
7784 }
7785
7786 /**
7787 * @return {string} Self command name.
7788 */
7789 }, {
7790 key: "getCommand",
7791 value: function getCommand() {
7792 return this.registerConfig.command;
7793 }
7794
7795 /**
7796 * @return {ComponentBase} Self component
7797 */
7798 }, {
7799 key: "getComponent",
7800 value: function getComponent() {
7801 return this.registerConfig.component;
7802 }
7803 }, {
7804 key: "setRegisterConfig",
7805 value: function setRegisterConfig(config) {
7806 this.registerConfig = Object.freeze(config);
7807 }
7808 }]);
7809 return CommandInfra;
7810 }(_argsObject.default);
7811 exports["default"] = CommandInfra;
7812 /**
7813 * @type {Object}
7814 */
7815 (0, _defineProperty2.default)(CommandInfra, "registerConfig", null);
7816
7817 /***/ }),
7818
7819 /***/ "../modules/web-cli/assets/js/modules/command-internal-base.js":
7820 /*!*********************************************************************!*\
7821 !*** ../modules/web-cli/assets/js/modules/command-internal-base.js ***!
7822 \*********************************************************************/
7823 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7824
7825 "use strict";
7826
7827
7828 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
7829 Object.defineProperty(exports, "__esModule", ({
7830 value: true
7831 }));
7832 exports["default"] = void 0;
7833 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
7834 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
7835 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
7836 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
7837 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
7838 var _commandBase = _interopRequireDefault(__webpack_require__(/*! ./command-base */ "../modules/web-cli/assets/js/modules/command-base.js"));
7839 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
7840 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
7841 /**
7842 * @name $e.modules.CommandInternalBase
7843 */
7844 var CommandInternalBase = /*#__PURE__*/function (_CommandBase) {
7845 (0, _inherits2.default)(CommandInternalBase, _CommandBase);
7846 var _super = _createSuper(CommandInternalBase);
7847 function CommandInternalBase(args) {
7848 var commandsAPI = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : $e.commandsInternal;
7849 (0, _classCallCheck2.default)(this, CommandInternalBase);
7850 return _super.call(this, args, commandsAPI);
7851 }
7852 (0, _createClass2.default)(CommandInternalBase, null, [{
7853 key: "getInstanceType",
7854 value: function getInstanceType() {
7855 return 'CommandInternalBase';
7856 }
7857 }]);
7858 return CommandInternalBase;
7859 }(_commandBase.default);
7860 exports["default"] = CommandInternalBase;
7861
7862 /***/ }),
7863
7864 /***/ "../modules/web-cli/assets/js/modules/commands/close.js":
7865 /*!**************************************************************!*\
7866 !*** ../modules/web-cli/assets/js/modules/commands/close.js ***!
7867 \**************************************************************/
7868 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7869
7870 "use strict";
7871
7872
7873 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
7874 Object.defineProperty(exports, "__esModule", ({
7875 value: true
7876 }));
7877 exports["default"] = exports.Close = void 0;
7878 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
7879 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
7880 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
7881 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
7882 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
7883 var _commandBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js"));
7884 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
7885 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
7886 var Close = /*#__PURE__*/function (_CommandBase) {
7887 (0, _inherits2.default)(Close, _CommandBase);
7888 var _super = _createSuper(Close);
7889 function Close() {
7890 (0, _classCallCheck2.default)(this, Close);
7891 return _super.apply(this, arguments);
7892 }
7893 (0, _createClass2.default)(Close, [{
7894 key: "apply",
7895 value: function apply() {
7896 this.component.close();
7897 }
7898 }]);
7899 return Close;
7900 }(_commandBase.default);
7901 exports.Close = Close;
7902 var _default = Close;
7903 exports["default"] = _default;
7904
7905 /***/ }),
7906
7907 /***/ "../modules/web-cli/assets/js/modules/commands/index.js":
7908 /*!**************************************************************!*\
7909 !*** ../modules/web-cli/assets/js/modules/commands/index.js ***!
7910 \**************************************************************/
7911 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7912
7913 "use strict";
7914
7915
7916 Object.defineProperty(exports, "__esModule", ({
7917 value: true
7918 }));
7919 Object.defineProperty(exports, "Close", ({
7920 enumerable: true,
7921 get: function get() {
7922 return _close.Close;
7923 }
7924 }));
7925 Object.defineProperty(exports, "Open", ({
7926 enumerable: true,
7927 get: function get() {
7928 return _open.Open;
7929 }
7930 }));
7931 Object.defineProperty(exports, "Toggle", ({
7932 enumerable: true,
7933 get: function get() {
7934 return _toggle.Toggle;
7935 }
7936 }));
7937 var _close = __webpack_require__(/*! ./close */ "../modules/web-cli/assets/js/modules/commands/close.js");
7938 var _open = __webpack_require__(/*! ./open */ "../modules/web-cli/assets/js/modules/commands/open.js");
7939 var _toggle = __webpack_require__(/*! ./toggle */ "../modules/web-cli/assets/js/modules/commands/toggle.js");
7940
7941 /***/ }),
7942
7943 /***/ "../modules/web-cli/assets/js/modules/commands/open.js":
7944 /*!*************************************************************!*\
7945 !*** ../modules/web-cli/assets/js/modules/commands/open.js ***!
7946 \*************************************************************/
7947 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7948
7949 "use strict";
7950
7951
7952 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
7953 Object.defineProperty(exports, "__esModule", ({
7954 value: true
7955 }));
7956 exports["default"] = exports.Open = void 0;
7957 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
7958 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
7959 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
7960 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
7961 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
7962 var _commandBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js"));
7963 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
7964 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
7965 var Open = /*#__PURE__*/function (_CommandBase) {
7966 (0, _inherits2.default)(Open, _CommandBase);
7967 var _super = _createSuper(Open);
7968 function Open() {
7969 (0, _classCallCheck2.default)(this, Open);
7970 return _super.apply(this, arguments);
7971 }
7972 (0, _createClass2.default)(Open, [{
7973 key: "apply",
7974 value: function apply() {
7975 $e.route(this.component.getNamespace());
7976 }
7977 }]);
7978 return Open;
7979 }(_commandBase.default);
7980 exports.Open = Open;
7981 var _default = Open;
7982 exports["default"] = _default;
7983
7984 /***/ }),
7985
7986 /***/ "../modules/web-cli/assets/js/modules/commands/toggle.js":
7987 /*!***************************************************************!*\
7988 !*** ../modules/web-cli/assets/js/modules/commands/toggle.js ***!
7989 \***************************************************************/
7990 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7991
7992 "use strict";
7993
7994
7995 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
7996 Object.defineProperty(exports, "__esModule", ({
7997 value: true
7998 }));
7999 exports["default"] = exports.Toggle = void 0;
8000 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
8001 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
8002 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
8003 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
8004 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
8005 var _commandBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js"));
8006 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
8007 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
8008 var Toggle = /*#__PURE__*/function (_CommandBase) {
8009 (0, _inherits2.default)(Toggle, _CommandBase);
8010 var _super = _createSuper(Toggle);
8011 function Toggle() {
8012 (0, _classCallCheck2.default)(this, Toggle);
8013 return _super.apply(this, arguments);
8014 }
8015 (0, _createClass2.default)(Toggle, [{
8016 key: "apply",
8017 value: function apply() {
8018 if (this.component.isOpen) {
8019 this.component.close();
8020 } else {
8021 $e.route(this.component.getNamespace());
8022 }
8023 }
8024 }]);
8025 return Toggle;
8026 }(_commandBase.default);
8027 exports.Toggle = Toggle;
8028 var _default = Toggle;
8029 exports["default"] = _default;
8030
8031 /***/ }),
8032
8033 /***/ "../modules/web-cli/assets/js/modules/component-base.js":
8034 /*!**************************************************************!*\
8035 !*** ../modules/web-cli/assets/js/modules/component-base.js ***!
8036 \**************************************************************/
8037 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8038
8039 "use strict";
8040
8041
8042 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
8043 Object.defineProperty(exports, "__esModule", ({
8044 value: true
8045 }));
8046 exports["default"] = void 0;
8047 var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
8048 var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
8049 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
8050 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
8051 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
8052 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
8053 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
8054 var _commandCallbackBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-callback-base */ "../modules/web-cli/assets/js/modules/command-callback-base.js"));
8055 var _toolkit = __webpack_require__(/*! @reduxjs/toolkit */ "../node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js");
8056 var _module = _interopRequireDefault(__webpack_require__(/*! elementor/assets/dev/js/modules/imports/module.js */ "../assets/dev/js/modules/imports/module.js"));
8057 var _forceMethodImplementation = _interopRequireDefault(__webpack_require__(/*! ../utils/force-method-implementation */ "../modules/web-cli/assets/js/utils/force-method-implementation.js"));
8058 var _deprecation = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/deprecation */ "../modules/web-cli/assets/js/utils/deprecation.js"));
8059 function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
8060 function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
8061 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
8062 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
8063 /**
8064 * @typedef {import('./command-infra')} CommandInfra
8065 * @typedef {import('./hook-base')} HookBase
8066 * @typedef {import('../core/states/ui-state-base')} UiStateBase
8067 */
8068 var ComponentBase = /*#__PURE__*/function (_Module) {
8069 (0, _inherits2.default)(ComponentBase, _Module);
8070 var _super = _createSuper(ComponentBase);
8071 function ComponentBase() {
8072 (0, _classCallCheck2.default)(this, ComponentBase);
8073 return _super.apply(this, arguments);
8074 }
8075 (0, _createClass2.default)(ComponentBase, [{
8076 key: "__construct",
8077 value: function __construct() {
8078 var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
8079 if (args.manager) {
8080 this.manager = args.manager;
8081 }
8082 this.commands = this.defaultCommands();
8083 this.commandsInternal = this.defaultCommandsInternal();
8084 this.hooks = this.defaultHooks();
8085 this.routes = this.defaultRoutes();
8086 this.tabs = this.defaultTabs();
8087 this.shortcuts = this.defaultShortcuts();
8088 this.utils = this.defaultUtils();
8089 this.data = this.defaultData();
8090 this.uiStates = this.defaultUiStates();
8091 this.states = this.defaultStates();
8092 this.defaultRoute = '';
8093 this.currentTab = '';
8094 }
8095 }, {
8096 key: "registerAPI",
8097 value: function registerAPI() {
8098 var _this = this;
8099 Object.entries(this.getTabs()).forEach(function (tab) {
8100 return _this.registerTabRoute(tab[0]);
8101 });
8102 Object.entries(this.getRoutes()).forEach(function (_ref) {
8103 var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
8104 route = _ref2[0],
8105 callback = _ref2[1];
8106 return _this.registerRoute(route, callback);
8107 });
8108 Object.entries(this.getCommands()).forEach(function (_ref3) {
8109 var _ref4 = (0, _slicedToArray2.default)(_ref3, 2),
8110 command = _ref4[0],
8111 callback = _ref4[1];
8112 return _this.registerCommand(command, callback);
8113 });
8114 Object.entries(this.getCommandsInternal()).forEach(function (_ref5) {
8115 var _ref6 = (0, _slicedToArray2.default)(_ref5, 2),
8116 command = _ref6[0],
8117 callback = _ref6[1];
8118 return _this.registerCommandInternal(command, callback);
8119 });
8120 Object.values(this.getHooks()).forEach(function (instance) {
8121 return _this.registerHook(instance);
8122 });
8123 Object.entries(this.getData()).forEach(function (_ref7) {
8124 var _ref8 = (0, _slicedToArray2.default)(_ref7, 2),
8125 command = _ref8[0],
8126 callback = _ref8[1];
8127 return _this.registerData(command, callback);
8128 });
8129 Object.values(this.getUiStates()).forEach(function (instance) {
8130 return _this.registerUiState(instance);
8131 });
8132 Object.entries(this.getStates()).forEach(function (_ref9) {
8133 var _ref10 = (0, _slicedToArray2.default)(_ref9, 2),
8134 id = _ref10[0],
8135 state = _ref10[1];
8136 return _this.registerState(id, state);
8137 });
8138 }
8139
8140 // eslint-disable-next-line jsdoc/require-returns-check
8141 /**
8142 * @return {string} namespace
8143 */
8144 }, {
8145 key: "getNamespace",
8146 value: function getNamespace() {
8147 (0, _forceMethodImplementation.default)();
8148 }
8149
8150 /**
8151 * @deprecated since 3.7.0, use `getServiceName()` instead.
8152 */
8153 }, {
8154 key: "getRootContainer",
8155 value: function getRootContainer() {
8156 _deprecation.default.deprecated('getRootContainer()', '3.7.0', 'getServiceName()');
8157 return this.getServiceName();
8158 }
8159 }, {
8160 key: "getServiceName",
8161 value: function getServiceName() {
8162 return this.getNamespace().split('/')[0];
8163 }
8164 }, {
8165 key: "store",
8166 get: function get() {
8167 return $e.store.get(this.getNamespace());
8168 }
8169 }, {
8170 key: "defaultTabs",
8171 value: function defaultTabs() {
8172 return {};
8173 }
8174 }, {
8175 key: "defaultRoutes",
8176 value: function defaultRoutes() {
8177 return {};
8178 }
8179 }, {
8180 key: "defaultCommands",
8181 value: function defaultCommands() {
8182 return {};
8183 }
8184 }, {
8185 key: "defaultCommandsInternal",
8186 value: function defaultCommandsInternal() {
8187 return {};
8188 }
8189 }, {
8190 key: "defaultHooks",
8191 value: function defaultHooks() {
8192 return {};
8193 }
8194
8195 /**
8196 * Get the component's default UI states.
8197 *
8198 * @return {Object} default UI states
8199 */
8200 }, {
8201 key: "defaultUiStates",
8202 value: function defaultUiStates() {
8203 return {};
8204 }
8205
8206 /**
8207 * Get the component's Redux slice settings.
8208 *
8209 * @return {Object} Redux slice settings
8210 */
8211 }, {
8212 key: "defaultStates",
8213 value: function defaultStates() {
8214 return {};
8215 }
8216 }, {
8217 key: "defaultShortcuts",
8218 value: function defaultShortcuts() {
8219 return {};
8220 }
8221 }, {
8222 key: "defaultUtils",
8223 value: function defaultUtils() {
8224 return {};
8225 }
8226 }, {
8227 key: "defaultData",
8228 value: function defaultData() {
8229 return {};
8230 }
8231 }, {
8232 key: "getCommands",
8233 value: function getCommands() {
8234 return this.commands;
8235 }
8236 }, {
8237 key: "getCommandsInternal",
8238 value: function getCommandsInternal() {
8239 return this.commandsInternal;
8240 }
8241 }, {
8242 key: "getHooks",
8243 value: function getHooks() {
8244 return this.hooks;
8245 }
8246
8247 /**
8248 * Retrieve the component's UI states.
8249 *
8250 * @return {Object} UI states
8251 */
8252 }, {
8253 key: "getUiStates",
8254 value: function getUiStates() {
8255 return this.uiStates;
8256 }
8257
8258 /**
8259 * Retrieve the component's Redux Slice.
8260 *
8261 * @return {Object} Redux Slice
8262 */
8263 }, {
8264 key: "getStates",
8265 value: function getStates() {
8266 return this.states;
8267 }
8268 }, {
8269 key: "getRoutes",
8270 value: function getRoutes() {
8271 return this.routes;
8272 }
8273 }, {
8274 key: "getTabs",
8275 value: function getTabs() {
8276 return this.tabs;
8277 }
8278 }, {
8279 key: "getShortcuts",
8280 value: function getShortcuts() {
8281 return this.shortcuts;
8282 }
8283 }, {
8284 key: "getData",
8285 value: function getData() {
8286 return this.data;
8287 }
8288
8289 /**
8290 * @param {string} command
8291 * @param {(()=>{}|CommandInfra)} context
8292 * @param {'default'|'internal'|'data'} commandsType
8293 */
8294 }, {
8295 key: "registerCommand",
8296 value: function registerCommand(command, context) {
8297 var commandsType = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'default';
8298 var commandsManager;
8299 switch (commandsType) {
8300 case 'default':
8301 commandsManager = $e.commands;
8302 break;
8303 case 'internal':
8304 commandsManager = $e.commandsInternal;
8305 break;
8306 case 'data':
8307 commandsManager = $e.data;
8308 break;
8309 default:
8310 throw new Error("Invalid commands type: '".concat(command, "'"));
8311 }
8312 var fullCommand = this.getNamespace() + '/' + command,
8313 instanceType = context.getInstanceType ? context.getInstanceType() : false,
8314 registerConfig = {
8315 command: fullCommand,
8316 component: this
8317 };
8318
8319 // Support pure callback.
8320 if (!instanceType) {
8321 if ($e.devTools) {
8322 $e.devTools.log.warn("Attach command-callback-base, on command: '".concat(fullCommand, "', context is unknown type."));
8323 }
8324 registerConfig.callback = context;
8325
8326 // Unique class.
8327 context = /*#__PURE__*/function (_CommandCallbackBase) {
8328 (0, _inherits2.default)(context, _CommandCallbackBase);
8329 var _super2 = _createSuper(context);
8330 function context() {
8331 (0, _classCallCheck2.default)(this, context);
8332 return _super2.apply(this, arguments);
8333 }
8334 return (0, _createClass2.default)(context);
8335 }(_commandCallbackBase.default);
8336 }
8337 context.setRegisterConfig(registerConfig);
8338 commandsManager.register(this, command, context);
8339 }
8340
8341 /**
8342 * @param {HookBase} instance
8343 */
8344 }, {
8345 key: "registerHook",
8346 value: function registerHook(instance) {
8347 return instance.register();
8348 }
8349 }, {
8350 key: "registerCommandInternal",
8351 value: function registerCommandInternal(command, context) {
8352 this.registerCommand(command, context, 'internal');
8353 }
8354
8355 /**
8356 * Register a UI state.
8357 *
8358 * @param {UiStateBase} instance - UI state instance.
8359 *
8360 * @return {void}
8361 */
8362 }, {
8363 key: "registerUiState",
8364 value: function registerUiState(instance) {
8365 $e.uiStates.register(instance);
8366 }
8367
8368 /**
8369 * Register a Redux Slice.
8370 *
8371 * @param {string} id - State id.
8372 * @param {Object} stateConfig - The state config.
8373 *
8374 * @return {void}
8375 */
8376 }, {
8377 key: "registerState",
8378 value: function registerState(id, stateConfig) {
8379 id = this.getNamespace() + (id ? "/".concat(id) : '');
8380 var slice = (0, _toolkit.createSlice)(_objectSpread(_objectSpread({}, stateConfig), {}, {
8381 name: id
8382 }));
8383 $e.store.register(id, slice);
8384 }
8385 }, {
8386 key: "registerRoute",
8387 value: function registerRoute(route, callback) {
8388 $e.routes.register(this, route, callback);
8389 }
8390 }, {
8391 key: "registerData",
8392 value: function registerData(command, context) {
8393 this.registerCommand(command, context, 'data');
8394 }
8395 }, {
8396 key: "unregisterRoute",
8397 value: function unregisterRoute(route) {
8398 $e.routes.unregister(this, route);
8399 }
8400 }, {
8401 key: "registerTabRoute",
8402 value: function registerTabRoute(tab) {
8403 var _this2 = this;
8404 this.registerRoute(tab, function (args) {
8405 return _this2.activateTab(tab, args);
8406 });
8407 }
8408 }, {
8409 key: "dependency",
8410 value: function dependency() {
8411 return true;
8412 }
8413 }, {
8414 key: "open",
8415 value: function open() {
8416 return true;
8417 }
8418 }, {
8419 key: "close",
8420 value: function close() {
8421 if (!this.isOpen) {
8422 return false;
8423 }
8424 this.isOpen = false;
8425 this.inactivate();
8426 $e.routes.clearCurrent(this.getNamespace());
8427 $e.routes.clearHistory(this.getServiceName());
8428 return true;
8429 }
8430 }, {
8431 key: "activate",
8432 value: function activate() {
8433 $e.components.activate(this.getNamespace());
8434 }
8435 }, {
8436 key: "inactivate",
8437 value: function inactivate() {
8438 $e.components.inactivate(this.getNamespace());
8439 }
8440 }, {
8441 key: "isActive",
8442 value: function isActive() {
8443 return $e.components.isActive(this.getNamespace());
8444 }
8445 }, {
8446 key: "onRoute",
8447 value: function onRoute(route) {
8448 this.toggleRouteClass(route, true);
8449 this.toggleHistoryClass();
8450 this.activate();
8451 this.trigger('route/open', route);
8452 }
8453 }, {
8454 key: "onCloseRoute",
8455 value: function onCloseRoute(route) {
8456 this.toggleRouteClass(route, false);
8457 this.inactivate();
8458 this.trigger('route/close', route);
8459 }
8460 }, {
8461 key: "setDefaultRoute",
8462 value: function setDefaultRoute(route) {
8463 this.defaultRoute = this.getNamespace() + '/' + route;
8464 }
8465 }, {
8466 key: "getDefaultRoute",
8467 value: function getDefaultRoute() {
8468 return this.defaultRoute;
8469 }
8470 }, {
8471 key: "removeTab",
8472 value: function removeTab(tab) {
8473 delete this.tabs[tab];
8474 this.unregisterRoute(tab);
8475 }
8476 }, {
8477 key: "hasTab",
8478 value: function hasTab(tab) {
8479 return !!this.tabs[tab];
8480 }
8481 }, {
8482 key: "addTab",
8483 value: function addTab(tab, args, position) {
8484 var _this3 = this;
8485 this.tabs[tab] = args;
8486 // It can be 0.
8487 if ('undefined' !== typeof position) {
8488 var newTabs = {};
8489 var ids = Object.keys(this.tabs);
8490 // Remove new tab
8491 ids.pop();
8492
8493 // Add it to position.
8494 ids.splice(position, 0, tab);
8495 ids.forEach(function (id) {
8496 newTabs[id] = _this3.tabs[id];
8497 });
8498 this.tabs = newTabs;
8499 }
8500 this.registerTabRoute(tab);
8501 }
8502 }, {
8503 key: "getTabsWrapperSelector",
8504 value: function getTabsWrapperSelector() {
8505 return '';
8506 }
8507 }, {
8508 key: "getTabRoute",
8509 value: function getTabRoute(tab) {
8510 return this.getNamespace() + '/' + tab;
8511 }
8512 }, {
8513 key: "renderTab",
8514 value: function renderTab(tab) {} // eslint-disable-line
8515 }, {
8516 key: "activateTab",
8517 value: function activateTab(tab, args) {
8518 var _this4 = this;
8519 this.renderTab(tab, args);
8520 jQuery(this.getTabsWrapperSelector() + ' .elementor-component-tab').off('click').on('click', function (event) {
8521 $e.route(_this4.getTabRoute(event.currentTarget.dataset.tab), args);
8522 }).removeClass('elementor-active').filter('[data-tab="' + tab + '"]').addClass('elementor-active');
8523 }
8524 }, {
8525 key: "getActiveTabConfig",
8526 value: function getActiveTabConfig() {
8527 return this.tabs[this.currentTab] || {};
8528 }
8529 }, {
8530 key: "getBodyClass",
8531 value: function getBodyClass(route) {
8532 return 'e-route-' + route.replace(/\//g, '-');
8533 }
8534
8535 /**
8536 * If command includes uppercase character convert it to lowercase and add `-`.
8537 * e.g: `CopyAll` is converted to `copy-all`.
8538 *
8539 * @param {string} commandName
8540 */
8541 }, {
8542 key: "normalizeCommandName",
8543 value: function normalizeCommandName(commandName) {
8544 return commandName.replace(/[A-Z]/g, function (match, offset) {
8545 return (offset > 0 ? '-' : '') + match.toLowerCase();
8546 });
8547 }
8548
8549 /**
8550 * @param {{}} commandsFromImport
8551 * @return {{}} imported commands
8552 */
8553 }, {
8554 key: "importCommands",
8555 value: function importCommands(commandsFromImport) {
8556 var _this5 = this;
8557 var commands = {};
8558
8559 // Convert `Commands` to `ComponentBase` workable format.
8560 Object.entries(commandsFromImport).forEach(function (_ref11) {
8561 var _ref12 = (0, _slicedToArray2.default)(_ref11, 2),
8562 className = _ref12[0],
8563 Class = _ref12[1];
8564 var command = _this5.normalizeCommandName(className);
8565 commands[command] = Class;
8566 });
8567 return commands;
8568 }
8569 }, {
8570 key: "importHooks",
8571 value: function importHooks(hooksFromImport) {
8572 var hooks = {};
8573 for (var key in hooksFromImport) {
8574 var hook = new hooksFromImport[key]();
8575 hooks[hook.getId()] = hook;
8576 }
8577 return hooks;
8578 }
8579
8580 /**
8581 * Import & initialize the component's UI states.
8582 * Should be used inside `defaultUiState()`.
8583 *
8584 * @param {Object} statesFromImport - UI states from import.
8585 *
8586 * @return {Object} UI States
8587 */
8588 }, {
8589 key: "importUiStates",
8590 value: function importUiStates(statesFromImport) {
8591 var _this6 = this;
8592 var uiStates = {};
8593 Object.values(statesFromImport).forEach(function (className) {
8594 var uiState = new className(_this6);
8595 uiStates[uiState.getId()] = uiState;
8596 });
8597 return uiStates;
8598 }
8599
8600 /**
8601 * Set a UI state value.
8602 * TODO: Should we provide such function? Maybe the developer should implicitly pass the full state ID?
8603 *
8604 * @param {string} state - Non-prefixed state ID.
8605 * @param {*} value - New state value.
8606 *
8607 * @return {void}
8608 */
8609 }, {
8610 key: "setUiState",
8611 value: function setUiState(state, value) {
8612 $e.uiStates.set("".concat(this.getNamespace(), "/").concat(state), value);
8613 }
8614 }, {
8615 key: "toggleRouteClass",
8616 value: function toggleRouteClass(route, state) {
8617 document.body.classList.toggle(this.getBodyClass(route), state);
8618 }
8619 }, {
8620 key: "toggleHistoryClass",
8621 value: function toggleHistoryClass() {
8622 document.body.classList.toggle('e-routes-has-history', !!$e.routes.getHistory(this.getServiceName()).length);
8623 }
8624 }]);
8625 return ComponentBase;
8626 }(_module.default);
8627 exports["default"] = ComponentBase;
8628
8629 /***/ }),
8630
8631 /***/ "../modules/web-cli/assets/js/modules/component-modal-base.js":
8632 /*!********************************************************************!*\
8633 !*** ../modules/web-cli/assets/js/modules/component-modal-base.js ***!
8634 \********************************************************************/
8635 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8636
8637 "use strict";
8638
8639
8640 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
8641 var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js");
8642 Object.defineProperty(exports, "__esModule", ({
8643 value: true
8644 }));
8645 exports["default"] = void 0;
8646 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
8647 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
8648 var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js"));
8649 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
8650 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
8651 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
8652 var _componentBase = _interopRequireDefault(__webpack_require__(/*! ./component-base */ "../modules/web-cli/assets/js/modules/component-base.js"));
8653 var commands = _interopRequireWildcard(__webpack_require__(/*! ./commands/ */ "../modules/web-cli/assets/js/modules/commands/index.js"));
8654 var _forceMethodImplementation = _interopRequireDefault(__webpack_require__(/*! ../utils/force-method-implementation */ "../modules/web-cli/assets/js/utils/force-method-implementation.js"));
8655 function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
8656 function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
8657 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
8658 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
8659 var ComponentModalBase = /*#__PURE__*/function (_ComponentBase) {
8660 (0, _inherits2.default)(ComponentModalBase, _ComponentBase);
8661 var _super = _createSuper(ComponentModalBase);
8662 function ComponentModalBase() {
8663 (0, _classCallCheck2.default)(this, ComponentModalBase);
8664 return _super.apply(this, arguments);
8665 }
8666 (0, _createClass2.default)(ComponentModalBase, [{
8667 key: "registerAPI",
8668 value: function registerAPI() {
8669 var _this = this;
8670 (0, _get2.default)((0, _getPrototypeOf2.default)(ComponentModalBase.prototype), "registerAPI", this).call(this);
8671 $e.shortcuts.register('esc', {
8672 scopes: [this.getNamespace()],
8673 callback: function callback() {
8674 return _this.close();
8675 }
8676 });
8677 }
8678 }, {
8679 key: "defaultCommands",
8680 value: function defaultCommands() {
8681 return this.importCommands(commands);
8682 }
8683 }, {
8684 key: "defaultRoutes",
8685 value: function defaultRoutes() {
8686 return {
8687 '': function _() {/* Nothing to do, it's already rendered. */}
8688 };
8689 }
8690 }, {
8691 key: "open",
8692 value: function open() {
8693 var _this2 = this;
8694 if (!this.layout) {
8695 var layout = this.getModalLayout();
8696 this.layout = new layout({
8697 component: this
8698 });
8699 this.layout.getModal().on('hide', function () {
8700 return _this2.close();
8701 });
8702 }
8703 this.layout.showModal();
8704 return true;
8705 }
8706 }, {
8707 key: "close",
8708 value: function close() {
8709 if (!(0, _get2.default)((0, _getPrototypeOf2.default)(ComponentModalBase.prototype), "close", this).call(this)) {
8710 return false;
8711 }
8712 this.layout.getModal().hide();
8713 return true;
8714 }
8715 }, {
8716 key: "getModalLayout",
8717 value: function getModalLayout() {
8718 (0, _forceMethodImplementation.default)();
8719 }
8720 }]);
8721 return ComponentModalBase;
8722 }(_componentBase.default);
8723 exports["default"] = ComponentModalBase;
8724
8725 /***/ }),
8726
8727 /***/ "../modules/web-cli/assets/js/modules/hook-base.js":
8728 /*!*********************************************************!*\
8729 !*** ../modules/web-cli/assets/js/modules/hook-base.js ***!
8730 \*********************************************************/
8731 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8732
8733 "use strict";
8734
8735
8736 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
8737 Object.defineProperty(exports, "__esModule", ({
8738 value: true
8739 }));
8740 exports["default"] = void 0;
8741 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
8742 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
8743 var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
8744 var _forceMethodImplementation = _interopRequireDefault(__webpack_require__(/*! ../utils/force-method-implementation */ "../modules/web-cli/assets/js/utils/force-method-implementation.js"));
8745 var HookBase = /*#__PURE__*/function () {
8746 /**
8747 * Function constructor().
8748 *
8749 * Create callback base.
8750 */
8751 function HookBase() {
8752 (0, _classCallCheck2.default)(this, HookBase);
8753 /**
8754 * Callback type, eg ( hook, event ).
8755 *
8756 * @type {string}
8757 */
8758 (0, _defineProperty2.default)(this, "type", void 0);
8759 /**
8760 * Full command address, that will hook the callback.
8761 *
8762 * @type {string}
8763 */
8764 (0, _defineProperty2.default)(this, "command", void 0);
8765 /**
8766 * Unique id of the callback.
8767 *
8768 * @type {string}
8769 */
8770 (0, _defineProperty2.default)(this, "id", void 0);
8771 this.initialize();
8772 this.type = this.getType();
8773 this.command = this.getCommand();
8774 this.id = this.getId();
8775 }
8776
8777 /**
8778 * Function initialize().
8779 *
8780 * Called after creation of the base, used for initialize extras.
8781 * Without expending constructor.
8782 */
8783 (0, _createClass2.default)(HookBase, [{
8784 key: "initialize",
8785 value: function initialize() {}
8786
8787 /**
8788 * Function register().
8789 *
8790 * Used to register the callback.
8791 *
8792 * @throws {Error}
8793 */
8794 }, {
8795 key: "register",
8796 value: function register() {
8797 (0, _forceMethodImplementation.default)();
8798 }
8799
8800 // eslint-disable-next-line jsdoc/require-returns-check
8801 /**
8802 * Function getType().
8803 *
8804 * Get type eg: ( hook, event, etc ... ).
8805 *
8806 * @return {string} type
8807 *
8808 * @throws {Error}
8809 */
8810 }, {
8811 key: "getType",
8812 value: function getType() {
8813 (0, _forceMethodImplementation.default)();
8814 }
8815
8816 // eslint-disable-next-line jsdoc/require-returns-check
8817 /**
8818 * Function getCommand().
8819 *
8820 * Returns the full command path for callback binding.
8821 *
8822 * Supports array of strings ( commands ).
8823 *
8824 * @return {string} command
8825 *
8826 * @throws {Error}
8827 */
8828 }, {
8829 key: "getCommand",
8830 value: function getCommand() {
8831 (0, _forceMethodImplementation.default)();
8832 }
8833
8834 // eslint-disable-next-line jsdoc/require-returns-check
8835 /**
8836 * Function getId().
8837 *
8838 * Returns command id for the hook (should be unique).
8839 *
8840 * @return {string} id
8841 *
8842 * @throws {Error}
8843 */
8844 }, {
8845 key: "getId",
8846 value: function getId() {
8847 (0, _forceMethodImplementation.default)();
8848 }
8849
8850 // eslint-disable-next-line jsdoc/require-returns-check
8851 /**
8852 * Function getContainerType().
8853 *
8854 * Bind eContainer type to callback.
8855 *
8856 * Used to gain performance.
8857 *
8858 * @return {string} type
8859 */
8860 }, {
8861 key: "getContainerType",
8862 value: function getContainerType() {}
8863
8864 /**
8865 * Function getConditions().
8866 *
8867 * Condition for running the callback, if true, call to apply().
8868 *
8869 * @param {*} [args={}]
8870 * @param {*} [result=*]
8871 *
8872 * @return {boolean} conditions
8873 */
8874 }, {
8875 key: "getConditions",
8876 value: function getConditions() {
8877 var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
8878 var result = arguments.length > 1 ? arguments[1] : undefined;
8879 // eslint-disable-line no-unused-vars
8880 return true;
8881 }
8882
8883 // eslint-disable-next-line jsdoc/require-returns-check
8884 /**
8885 * Function apply().
8886 *
8887 * Apply the callback, ( The actual affect of the callback ).
8888 *
8889 * @param {*} [args={}]
8890 *
8891 * @return {*} results
8892 */
8893 }, {
8894 key: "apply",
8895 value: function apply(args) {
8896 // eslint-disable-line no-unused-vars
8897 (0, _forceMethodImplementation.default)();
8898 }
8899
8900 /**
8901 * Function run().
8902 *
8903 * Run the callback.
8904 *
8905 * @param {*} args
8906 *
8907 * @return {*} results
8908 */
8909 }, {
8910 key: "run",
8911 value: function run() {
8912 var _ref = arguments.length <= 0 ? undefined : arguments[0],
8913 _ref$options = _ref.options,
8914 options = _ref$options === void 0 ? {} : _ref$options;
8915
8916 // Disable callback if requested by args.options.
8917 if (options.callbacks && false === options.callbacks[this.id]) {
8918 return true;
8919 }
8920 if (this.getConditions.apply(this, arguments)) {
8921 if ($e.devTools) {
8922 $e.devTools.log.callbacks().active(this.type, this.command, this.id);
8923 }
8924 return this.apply.apply(this, arguments);
8925 }
8926 return true;
8927 }
8928 }]);
8929 return HookBase;
8930 }();
8931 exports["default"] = HookBase;
8932
8933 /***/ }),
8934
8935 /***/ "../modules/web-cli/assets/js/modules/hook-break.js":
8936 /*!**********************************************************!*\
8937 !*** ../modules/web-cli/assets/js/modules/hook-break.js ***!
8938 \**********************************************************/
8939 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8940
8941 "use strict";
8942
8943
8944 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
8945 Object.defineProperty(exports, "__esModule", ({
8946 value: true
8947 }));
8948 exports["default"] = void 0;
8949 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
8950 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
8951 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
8952 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
8953 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
8954 var _wrapNativeSuper2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ "../node_modules/@babel/runtime/helpers/wrapNativeSuper.js"));
8955 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
8956 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
8957 var HookBreak = /*#__PURE__*/function (_Error) {
8958 (0, _inherits2.default)(HookBreak, _Error);
8959 var _super = _createSuper(HookBreak);
8960 function HookBreak() {
8961 (0, _classCallCheck2.default)(this, HookBreak);
8962 return _super.call(this, 'HookBreak');
8963 }
8964 return (0, _createClass2.default)(HookBreak);
8965 }( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
8966 exports["default"] = HookBreak;
8967
8968 /***/ }),
8969
8970 /***/ "../modules/web-cli/assets/js/modules/hooks/data/after.js":
8971 /*!****************************************************************!*\
8972 !*** ../modules/web-cli/assets/js/modules/hooks/data/after.js ***!
8973 \****************************************************************/
8974 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8975
8976 "use strict";
8977
8978
8979 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
8980 Object.defineProperty(exports, "__esModule", ({
8981 value: true
8982 }));
8983 exports["default"] = exports.After = void 0;
8984 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
8985 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
8986 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
8987 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
8988 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
8989 var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/data/base.js"));
8990 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
8991 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
8992 var After = /*#__PURE__*/function (_Base) {
8993 (0, _inherits2.default)(After, _Base);
8994 var _super = _createSuper(After);
8995 function After() {
8996 (0, _classCallCheck2.default)(this, After);
8997 return _super.apply(this, arguments);
8998 }
8999 (0, _createClass2.default)(After, [{
9000 key: "register",
9001 value: function register() {
9002 $e.hooks.registerDataAfter(this);
9003 }
9004 }]);
9005 return After;
9006 }(_base.default);
9007 exports.After = After;
9008 var _default = After;
9009 exports["default"] = _default;
9010
9011 /***/ }),
9012
9013 /***/ "../modules/web-cli/assets/js/modules/hooks/data/base.js":
9014 /*!***************************************************************!*\
9015 !*** ../modules/web-cli/assets/js/modules/hooks/data/base.js ***!
9016 \***************************************************************/
9017 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9018
9019 "use strict";
9020
9021
9022 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
9023 Object.defineProperty(exports, "__esModule", ({
9024 value: true
9025 }));
9026 exports["default"] = exports.Base = void 0;
9027 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
9028 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
9029 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
9030 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
9031 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
9032 var _hookBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/hook-base */ "../modules/web-cli/assets/js/modules/hook-base.js"));
9033 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
9034 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
9035 var Base = /*#__PURE__*/function (_HookBase) {
9036 (0, _inherits2.default)(Base, _HookBase);
9037 var _super = _createSuper(Base);
9038 function Base() {
9039 (0, _classCallCheck2.default)(this, Base);
9040 return _super.apply(this, arguments);
9041 }
9042 (0, _createClass2.default)(Base, [{
9043 key: "getType",
9044 value: function getType() {
9045 return 'data';
9046 }
9047 }]);
9048 return Base;
9049 }(_hookBase.default);
9050 exports.Base = Base;
9051 var _default = Base;
9052 exports["default"] = _default;
9053
9054 /***/ }),
9055
9056 /***/ "../modules/web-cli/assets/js/modules/hooks/data/catch.js":
9057 /*!****************************************************************!*\
9058 !*** ../modules/web-cli/assets/js/modules/hooks/data/catch.js ***!
9059 \****************************************************************/
9060 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9061
9062 "use strict";
9063
9064
9065 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
9066 Object.defineProperty(exports, "__esModule", ({
9067 value: true
9068 }));
9069 exports["default"] = exports.Catch = void 0;
9070 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
9071 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
9072 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
9073 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
9074 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
9075 var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/data/base.js"));
9076 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
9077 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
9078 var Catch = /*#__PURE__*/function (_Base) {
9079 (0, _inherits2.default)(Catch, _Base);
9080 var _super = _createSuper(Catch);
9081 function Catch() {
9082 (0, _classCallCheck2.default)(this, Catch);
9083 return _super.apply(this, arguments);
9084 }
9085 (0, _createClass2.default)(Catch, [{
9086 key: "register",
9087 value: function register() {
9088 $e.hooks.registerDataCatch(this);
9089 }
9090 }]);
9091 return Catch;
9092 }(_base.default);
9093 exports.Catch = Catch;
9094 var _default = Catch;
9095 exports["default"] = _default;
9096
9097 /***/ }),
9098
9099 /***/ "../modules/web-cli/assets/js/modules/hooks/data/dependency.js":
9100 /*!*********************************************************************!*\
9101 !*** ../modules/web-cli/assets/js/modules/hooks/data/dependency.js ***!
9102 \*********************************************************************/
9103 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9104
9105 "use strict";
9106
9107
9108 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
9109 Object.defineProperty(exports, "__esModule", ({
9110 value: true
9111 }));
9112 exports["default"] = exports.Dependency = void 0;
9113 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
9114 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
9115 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
9116 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
9117 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
9118 var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/data/base.js"));
9119 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
9120 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
9121 var Dependency = /*#__PURE__*/function (_Base) {
9122 (0, _inherits2.default)(Dependency, _Base);
9123 var _super = _createSuper(Dependency);
9124 function Dependency() {
9125 (0, _classCallCheck2.default)(this, Dependency);
9126 return _super.apply(this, arguments);
9127 }
9128 (0, _createClass2.default)(Dependency, [{
9129 key: "register",
9130 value: function register() {
9131 $e.hooks.registerDataDependency(this);
9132 }
9133 }]);
9134 return Dependency;
9135 }(_base.default);
9136 exports.Dependency = Dependency;
9137 var _default = Dependency;
9138 exports["default"] = _default;
9139
9140 /***/ }),
9141
9142 /***/ "../modules/web-cli/assets/js/modules/hooks/data/index.js":
9143 /*!****************************************************************!*\
9144 !*** ../modules/web-cli/assets/js/modules/hooks/data/index.js ***!
9145 \****************************************************************/
9146 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9147
9148 "use strict";
9149
9150
9151 Object.defineProperty(exports, "__esModule", ({
9152 value: true
9153 }));
9154 Object.defineProperty(exports, "After", ({
9155 enumerable: true,
9156 get: function get() {
9157 return _after.After;
9158 }
9159 }));
9160 Object.defineProperty(exports, "Base", ({
9161 enumerable: true,
9162 get: function get() {
9163 return _base.Base;
9164 }
9165 }));
9166 Object.defineProperty(exports, "Catch", ({
9167 enumerable: true,
9168 get: function get() {
9169 return _catch.Catch;
9170 }
9171 }));
9172 Object.defineProperty(exports, "Dependency", ({
9173 enumerable: true,
9174 get: function get() {
9175 return _dependency.Dependency;
9176 }
9177 }));
9178 var _after = __webpack_require__(/*! ./after */ "../modules/web-cli/assets/js/modules/hooks/data/after.js");
9179 var _base = __webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/data/base.js");
9180 var _catch = __webpack_require__(/*! ./catch */ "../modules/web-cli/assets/js/modules/hooks/data/catch.js");
9181 var _dependency = __webpack_require__(/*! ./dependency */ "../modules/web-cli/assets/js/modules/hooks/data/dependency.js");
9182
9183 /***/ }),
9184
9185 /***/ "../modules/web-cli/assets/js/modules/hooks/ui/after.js":
9186 /*!**************************************************************!*\
9187 !*** ../modules/web-cli/assets/js/modules/hooks/ui/after.js ***!
9188 \**************************************************************/
9189 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9190
9191 "use strict";
9192
9193
9194 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
9195 Object.defineProperty(exports, "__esModule", ({
9196 value: true
9197 }));
9198 exports["default"] = exports.After = void 0;
9199 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
9200 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
9201 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
9202 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
9203 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
9204 var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/ui/base.js"));
9205 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
9206 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
9207 var After = /*#__PURE__*/function (_Base) {
9208 (0, _inherits2.default)(After, _Base);
9209 var _super = _createSuper(After);
9210 function After() {
9211 (0, _classCallCheck2.default)(this, After);
9212 return _super.apply(this, arguments);
9213 }
9214 (0, _createClass2.default)(After, [{
9215 key: "register",
9216 value: function register() {
9217 $e.hooks.registerUIAfter(this);
9218 }
9219 }]);
9220 return After;
9221 }(_base.default);
9222 exports.After = After;
9223 var _default = After;
9224 exports["default"] = _default;
9225
9226 /***/ }),
9227
9228 /***/ "../modules/web-cli/assets/js/modules/hooks/ui/base.js":
9229 /*!*************************************************************!*\
9230 !*** ../modules/web-cli/assets/js/modules/hooks/ui/base.js ***!
9231 \*************************************************************/
9232 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9233
9234 "use strict";
9235
9236
9237 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
9238 Object.defineProperty(exports, "__esModule", ({
9239 value: true
9240 }));
9241 exports["default"] = exports.Base = void 0;
9242 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
9243 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
9244 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
9245 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
9246 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
9247 var _hookBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/hook-base */ "../modules/web-cli/assets/js/modules/hook-base.js"));
9248 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
9249 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
9250 var Base = /*#__PURE__*/function (_HookBase) {
9251 (0, _inherits2.default)(Base, _HookBase);
9252 var _super = _createSuper(Base);
9253 function Base() {
9254 (0, _classCallCheck2.default)(this, Base);
9255 return _super.apply(this, arguments);
9256 }
9257 (0, _createClass2.default)(Base, [{
9258 key: "getType",
9259 value: function getType() {
9260 return 'ui';
9261 }
9262 }]);
9263 return Base;
9264 }(_hookBase.default);
9265 exports.Base = Base;
9266 var _default = Base;
9267 exports["default"] = _default;
9268
9269 /***/ }),
9270
9271 /***/ "../modules/web-cli/assets/js/modules/hooks/ui/before.js":
9272 /*!***************************************************************!*\
9273 !*** ../modules/web-cli/assets/js/modules/hooks/ui/before.js ***!
9274 \***************************************************************/
9275 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9276
9277 "use strict";
9278
9279
9280 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
9281 Object.defineProperty(exports, "__esModule", ({
9282 value: true
9283 }));
9284 exports["default"] = exports.Before = void 0;
9285 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
9286 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
9287 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
9288 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
9289 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
9290 var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/ui/base.js"));
9291 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
9292 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
9293 var Before = /*#__PURE__*/function (_Base) {
9294 (0, _inherits2.default)(Before, _Base);
9295 var _super = _createSuper(Before);
9296 function Before() {
9297 (0, _classCallCheck2.default)(this, Before);
9298 return _super.apply(this, arguments);
9299 }
9300 (0, _createClass2.default)(Before, [{
9301 key: "register",
9302 value: function register() {
9303 $e.hooks.registerUIBefore(this);
9304 }
9305 }]);
9306 return Before;
9307 }(_base.default);
9308 exports.Before = Before;
9309 var _default = Before;
9310 exports["default"] = _default;
9311
9312 /***/ }),
9313
9314 /***/ "../modules/web-cli/assets/js/modules/hooks/ui/catch.js":
9315 /*!**************************************************************!*\
9316 !*** ../modules/web-cli/assets/js/modules/hooks/ui/catch.js ***!
9317 \**************************************************************/
9318 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9319
9320 "use strict";
9321
9322
9323 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
9324 Object.defineProperty(exports, "__esModule", ({
9325 value: true
9326 }));
9327 exports["default"] = exports.Catch = void 0;
9328 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
9329 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
9330 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
9331 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
9332 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
9333 var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/ui/base.js"));
9334 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
9335 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
9336 var Catch = /*#__PURE__*/function (_Base) {
9337 (0, _inherits2.default)(Catch, _Base);
9338 var _super = _createSuper(Catch);
9339 function Catch() {
9340 (0, _classCallCheck2.default)(this, Catch);
9341 return _super.apply(this, arguments);
9342 }
9343 (0, _createClass2.default)(Catch, [{
9344 key: "register",
9345 value: function register() {
9346 $e.hooks.registerUICatch(this);
9347 }
9348 }]);
9349 return Catch;
9350 }(_base.default);
9351 exports.Catch = Catch;
9352 var _default = Catch;
9353 exports["default"] = _default;
9354
9355 /***/ }),
9356
9357 /***/ "../modules/web-cli/assets/js/modules/hooks/ui/index.js":
9358 /*!**************************************************************!*\
9359 !*** ../modules/web-cli/assets/js/modules/hooks/ui/index.js ***!
9360 \**************************************************************/
9361 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9362
9363 "use strict";
9364
9365
9366 Object.defineProperty(exports, "__esModule", ({
9367 value: true
9368 }));
9369 Object.defineProperty(exports, "After", ({
9370 enumerable: true,
9371 get: function get() {
9372 return _after.After;
9373 }
9374 }));
9375 Object.defineProperty(exports, "Base", ({
9376 enumerable: true,
9377 get: function get() {
9378 return _base.Base;
9379 }
9380 }));
9381 Object.defineProperty(exports, "Before", ({
9382 enumerable: true,
9383 get: function get() {
9384 return _before.Before;
9385 }
9386 }));
9387 Object.defineProperty(exports, "Catch", ({
9388 enumerable: true,
9389 get: function get() {
9390 return _catch.Catch;
9391 }
9392 }));
9393 var _after = __webpack_require__(/*! ./after */ "../modules/web-cli/assets/js/modules/hooks/ui/after.js");
9394 var _base = __webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/ui/base.js");
9395 var _before = __webpack_require__(/*! ./before */ "../modules/web-cli/assets/js/modules/hooks/ui/before.js");
9396 var _catch = __webpack_require__(/*! ./catch */ "../modules/web-cli/assets/js/modules/hooks/ui/catch.js");
9397
9398 /***/ }),
9399
9400 /***/ "../modules/web-cli/assets/js/utils/console.js":
9401 /*!*****************************************************!*\
9402 !*** ../modules/web-cli/assets/js/utils/console.js ***!
9403 \*****************************************************/
9404 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9405
9406 "use strict";
9407
9408
9409 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
9410 Object.defineProperty(exports, "__esModule", ({
9411 value: true
9412 }));
9413 exports["default"] = void 0;
9414 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
9415 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
9416 var Console = /*#__PURE__*/function () {
9417 function Console() {
9418 (0, _classCallCheck2.default)(this, Console);
9419 }
9420 (0, _createClass2.default)(Console, null, [{
9421 key: "error",
9422 value: function error(message) {
9423 // Show an error if devTools is available.
9424 if ($e.devTools) {
9425 $e.devTools.log.error(message);
9426 }
9427
9428 // If not a 'Hook-Break' then show error.
9429 if (!(message instanceof $e.modules.HookBreak)) {
9430 // eslint-disable-next-line no-console
9431 console.error(message);
9432 }
9433 }
9434 }, {
9435 key: "warn",
9436 value: function warn() {
9437 var _console;
9438 var style = "font-size: 12px; background-image: url(\"".concat(elementorWebCliConfig.urls.assets, "images/logo-icon.png\"); background-repeat: no-repeat; background-size: contain;");
9439 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
9440 args[_key] = arguments[_key];
9441 }
9442 args.unshift('%c %c', style, '');
9443 (_console = console).warn.apply(_console, args); // eslint-disable-line no-console
9444 }
9445 }]);
9446 return Console;
9447 }();
9448 exports["default"] = Console;
9449
9450 /***/ }),
9451
9452 /***/ "../modules/web-cli/assets/js/utils/deprecation.js":
9453 /*!*********************************************************!*\
9454 !*** ../modules/web-cli/assets/js/utils/deprecation.js ***!
9455 \*********************************************************/
9456 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9457
9458 "use strict";
9459
9460
9461 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
9462 Object.defineProperty(exports, "__esModule", ({
9463 value: true
9464 }));
9465 exports["default"] = void 0;
9466 var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
9467 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
9468 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
9469 var _console = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/console */ "../modules/web-cli/assets/js/utils/console.js"));
9470 // Copied from `modules/dev-tools/assets/js/deprecation.js`
9471 /**
9472 * @typedef {Object} Version
9473 * @property {number} major1 The first number
9474 * @property {number} major2 The second number
9475 * @property {number} minor The third number
9476 * @property {string} build The fourth number
9477 */
9478 var softDeprecated = function softDeprecated(name, version, replacement) {
9479 if (elementorWebCliConfig.isDebug) {
9480 deprecatedMessage('soft', name, version, replacement);
9481 }
9482 };
9483 var hardDeprecated = function hardDeprecated(name, version, replacement) {
9484 deprecatedMessage('hard', name, version, replacement);
9485 };
9486 var deprecatedMessage = function deprecatedMessage(type, name, version, replacement) {
9487 var message = "`".concat(name, "` is ").concat(type, " deprecated since ").concat(version);
9488 if (replacement) {
9489 message += " - Use `".concat(replacement, "` instead");
9490 }
9491 _console.default.warn(message);
9492 };
9493 var Deprecation = /*#__PURE__*/function () {
9494 function Deprecation() {
9495 (0, _classCallCheck2.default)(this, Deprecation);
9496 }
9497 (0, _createClass2.default)(Deprecation, null, [{
9498 key: "deprecated",
9499 value: function deprecated(name, version, replacement) {
9500 if (this.isHardDeprecated(version)) {
9501 hardDeprecated(name, version, replacement);
9502 } else {
9503 softDeprecated(name, version, replacement);
9504 }
9505 }
9506
9507 /**
9508 * @param {string} version
9509 *
9510 * @return {Version}
9511 */
9512 }, {
9513 key: "parseVersion",
9514 value: function parseVersion(version) {
9515 var versionParts = version.split('.');
9516 if (versionParts.length < 3 || versionParts.length > 4) {
9517 throw new RangeError('Invalid Semantic Version string provided');
9518 }
9519 var _versionParts = (0, _slicedToArray2.default)(versionParts, 4),
9520 major1 = _versionParts[0],
9521 major2 = _versionParts[1],
9522 minor = _versionParts[2],
9523 _versionParts$ = _versionParts[3],
9524 build = _versionParts$ === void 0 ? '' : _versionParts$;
9525 return {
9526 major1: parseInt(major1),
9527 major2: parseInt(major2),
9528 minor: parseInt(minor),
9529 build: build
9530 };
9531 }
9532
9533 /**
9534 * Get total of major.
9535 *
9536 * 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,
9537 * versions with major2 more then 9 will be added to total.
9538 *
9539 * @param {Version} versionObj
9540 *
9541 * @return {number}
9542 */
9543 }, {
9544 key: "getTotalMajor",
9545 value: function getTotalMajor(versionObj) {
9546 var total = parseInt("".concat(versionObj.major1).concat(versionObj.major2, "0"));
9547 total = Number((total / 10).toFixed(0));
9548 if (versionObj.major2 > 9) {
9549 total = versionObj.major2 - 9;
9550 }
9551 return total;
9552 }
9553
9554 /**
9555 * @param {string} version1
9556 * @param {string} version2
9557 *
9558 * @return {number}
9559 */
9560 }, {
9561 key: "compareVersion",
9562 value: function compareVersion(version1, version2) {
9563 var _this = this;
9564 return [this.parseVersion(version1), this.parseVersion(version2)].map(function (versionObj) {
9565 return _this.getTotalMajor(versionObj);
9566 }).reduce(function (acc, major) {
9567 return acc - major;
9568 });
9569 }
9570
9571 /**
9572 * @param {string} version
9573 *
9574 * @return {boolean}
9575 */
9576 }, {
9577 key: "isSoftDeprecated",
9578 value: function isSoftDeprecated(version) {
9579 var total = this.compareVersion(version, elementorWebCliConfig.version);
9580 return total <= 4;
9581 }
9582
9583 /**
9584 * @param {string} version
9585 * @return {boolean}
9586 */
9587 }, {
9588 key: "isHardDeprecated",
9589 value: function isHardDeprecated(version) {
9590 var total = this.compareVersion(version, elementorWebCliConfig.version);
9591 return total < 0 || total >= 8;
9592 }
9593 }]);
9594 return Deprecation;
9595 }();
9596 exports["default"] = Deprecation;
9597
9598 /***/ }),
9599
9600 /***/ "../modules/web-cli/assets/js/utils/environment.js":
9601 /*!*********************************************************!*\
9602 !*** ../modules/web-cli/assets/js/utils/environment.js ***!
9603 \*********************************************************/
9604 /***/ ((__unused_webpack_module, exports) => {
9605
9606 "use strict";
9607
9608
9609 Object.defineProperty(exports, "__esModule", ({
9610 value: true
9611 }));
9612 exports["default"] = void 0;
9613 // TODO: Copied from `core/common/assets/js/utils/environment.js`.
9614 var matchUserAgent = function matchUserAgent(UserAgentStr) {
9615 return userAgent.indexOf(UserAgentStr) >= 0;
9616 },
9617 userAgent = navigator.userAgent,
9618 // Solution influenced by https://stackoverflow.com/questions/9847580/how-to-detect-safari-chrome-ie-firefox-and-opera-browser
9619
9620 // Opera 8.0+
9621 isOpera = !!window.opr && !!opr.addons || !!window.opera || matchUserAgent(' OPR/'),
9622 // Firefox 1.0+
9623 isFirefox = matchUserAgent('Firefox'),
9624 // Safari 3.0+ "[object HTMLElementConstructor]"
9625 isSafari = /^((?!chrome|android).)*safari/i.test(userAgent) || /constructor/i.test(window.HTMLElement) || function (p) {
9626 return '[object SafariRemoteNotification]' === p.toString();
9627 }(!window.safari || typeof safari !== 'undefined' && safari.pushNotification),
9628 // Internet Explorer 6-11
9629 isIE = /Trident|MSIE/.test(userAgent) && ( /* @cc_on!@*/ false || !!document.documentMode),
9630 // Edge 20+
9631 isEdge = !isIE && !!window.StyleMedia || matchUserAgent('Edg'),
9632 // Google Chrome (Not accurate)
9633 isChrome = !!window.chrome && matchUserAgent('Chrome') && !(isEdge || isOpera),
9634 // Blink engine
9635 isBlink = matchUserAgent('Chrome') && !!window.CSS,
9636 // Apple Webkit engine
9637 isAppleWebkit = matchUserAgent('AppleWebKit') && !isBlink,
9638 environment = {
9639 appleWebkit: isAppleWebkit,
9640 blink: isBlink,
9641 chrome: isChrome,
9642 edge: isEdge,
9643 firefox: isFirefox,
9644 ie: isIE,
9645 mac: matchUserAgent('Macintosh'),
9646 opera: isOpera,
9647 safari: isSafari,
9648 webkit: matchUserAgent('AppleWebKit')
9649 };
9650 var _default = environment;
9651 exports["default"] = _default;
9652
9653 /***/ }),
9654
9655 /***/ "../modules/web-cli/assets/js/utils/force-method-implementation.js":
9656 /*!*************************************************************************!*\
9657 !*** ../modules/web-cli/assets/js/utils/force-method-implementation.js ***!
9658 \*************************************************************************/
9659 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9660
9661 "use strict";
9662
9663
9664 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
9665 Object.defineProperty(exports, "__esModule", ({
9666 value: true
9667 }));
9668 exports["default"] = exports.ForceMethodImplementation = void 0;
9669 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
9670 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
9671 var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js"));
9672 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
9673 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
9674 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
9675 var _wrapNativeSuper2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ "../node_modules/@babel/runtime/helpers/wrapNativeSuper.js"));
9676 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
9677 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
9678 // TODO: Copied from `assets/dev/js/modules/imports/force-method-implementation.js`;
9679 var ForceMethodImplementation = /*#__PURE__*/function (_Error) {
9680 (0, _inherits2.default)(ForceMethodImplementation, _Error);
9681 var _super = _createSuper(ForceMethodImplementation);
9682 function ForceMethodImplementation() {
9683 var _this;
9684 var info = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
9685 (0, _classCallCheck2.default)(this, ForceMethodImplementation);
9686 _this = _super.call(this, "".concat(info.isStatic ? 'static ' : '').concat(info.fullName, "() should be implemented, please provide '").concat(info.functionName || info.fullName, "' functionality."));
9687 Error.captureStackTrace((0, _assertThisInitialized2.default)(_this), ForceMethodImplementation);
9688 return _this;
9689 }
9690 return (0, _createClass2.default)(ForceMethodImplementation);
9691 }( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
9692 exports.ForceMethodImplementation = ForceMethodImplementation;
9693 var _default = function _default() {
9694 var stack = Error().stack,
9695 caller = stack.split('\n')[2].trim(),
9696 callerName = caller.startsWith('at new') ? 'constructor' : caller.split(' ')[1],
9697 info = {};
9698 info.functionName = callerName;
9699 info.fullName = callerName;
9700 if (info.functionName.includes('.')) {
9701 var parts = info.functionName.split('.');
9702 info.className = parts[0];
9703 info.functionName = parts[1];
9704 } else {
9705 info.isStatic = true;
9706 }
9707 throw new ForceMethodImplementation(info);
9708 };
9709 exports["default"] = _default;
9710
9711 /***/ }),
9712
9713 /***/ "../node_modules/redux-thunk/es/index.js":
9714 /*!***********************************************!*\
9715 !*** ../node_modules/redux-thunk/es/index.js ***!
9716 \***********************************************/
9717 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
9718
9719 "use strict";
9720 __webpack_require__.r(__webpack_exports__);
9721 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
9722 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
9723 /* harmony export */ });
9724 /** A function that accepts a potential "extra argument" value to be injected later,
9725 * and returns an instance of the thunk middleware that uses that value
9726 */
9727 function createThunkMiddleware(extraArgument) {
9728 // Standard Redux middleware definition pattern:
9729 // See: https://redux.js.org/tutorials/fundamentals/part-4-store#writing-custom-middleware
9730 var middleware = function middleware(_ref) {
9731 var dispatch = _ref.dispatch,
9732 getState = _ref.getState;
9733 return function (next) {
9734 return function (action) {
9735 // The thunk middleware looks for any functions that were passed to `store.dispatch`.
9736 // If this "action" is really a function, call it and return the result.
9737 if (typeof action === 'function') {
9738 // Inject the store's `dispatch` and `getState` methods, as well as any "extra arg"
9739 return action(dispatch, getState, extraArgument);
9740 } // Otherwise, pass the action down the middleware chain as usual
9741
9742
9743 return next(action);
9744 };
9745 };
9746 };
9747
9748 return middleware;
9749 }
9750
9751 var thunk = createThunkMiddleware(); // Attach the factory function so users can create a customized version
9752 // with whatever "extra arg" they want to inject into their thunks
9753
9754 thunk.withExtraArgument = createThunkMiddleware;
9755 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (thunk);
9756
9757 /***/ }),
9758
9759 /***/ "../node_modules/redux/es/redux.js":
9760 /*!*****************************************!*\
9761 !*** ../node_modules/redux/es/redux.js ***!
9762 \*****************************************/
9763 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
9764
9765 "use strict";
9766 __webpack_require__.r(__webpack_exports__);
9767 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
9768 /* harmony export */ __DO_NOT_USE__ActionTypes: () => (/* binding */ ActionTypes),
9769 /* harmony export */ applyMiddleware: () => (/* binding */ applyMiddleware),
9770 /* harmony export */ bindActionCreators: () => (/* binding */ bindActionCreators),
9771 /* harmony export */ combineReducers: () => (/* binding */ combineReducers),
9772 /* harmony export */ compose: () => (/* binding */ compose),
9773 /* harmony export */ createStore: () => (/* binding */ createStore),
9774 /* harmony export */ legacy_createStore: () => (/* binding */ legacy_createStore)
9775 /* harmony export */ });
9776 /* 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");
9777
9778
9779 /**
9780 * Adapted from React: https://github.com/facebook/react/blob/master/packages/shared/formatProdErrorMessage.js
9781 *
9782 * Do not require this module directly! Use normal throw error calls. These messages will be replaced with error codes
9783 * during build.
9784 * @param {number} code
9785 */
9786 function formatProdErrorMessage(code) {
9787 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. ';
9788 }
9789
9790 // Inlined version of the `symbol-observable` polyfill
9791 var $$observable = (function () {
9792 return typeof Symbol === 'function' && Symbol.observable || '@@observable';
9793 })();
9794
9795 /**
9796 * These are private action types reserved by Redux.
9797 * For any unknown actions, you must return the current state.
9798 * If the current state is undefined, you must return the initial state.
9799 * Do not reference these action types directly in your code.
9800 */
9801 var randomString = function randomString() {
9802 return Math.random().toString(36).substring(7).split('').join('.');
9803 };
9804
9805 var ActionTypes = {
9806 INIT: "@@redux/INIT" + randomString(),
9807 REPLACE: "@@redux/REPLACE" + randomString(),
9808 PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() {
9809 return "@@redux/PROBE_UNKNOWN_ACTION" + randomString();
9810 }
9811 };
9812
9813 /**
9814 * @param {any} obj The object to inspect.
9815 * @returns {boolean} True if the argument appears to be a plain object.
9816 */
9817 function isPlainObject(obj) {
9818 if (typeof obj !== 'object' || obj === null) return false;
9819 var proto = obj;
9820
9821 while (Object.getPrototypeOf(proto) !== null) {
9822 proto = Object.getPrototypeOf(proto);
9823 }
9824
9825 return Object.getPrototypeOf(obj) === proto;
9826 }
9827
9828 // Inlined / shortened version of `kindOf` from https://github.com/jonschlinkert/kind-of
9829 function miniKindOf(val) {
9830 if (val === void 0) return 'undefined';
9831 if (val === null) return 'null';
9832 var type = typeof val;
9833
9834 switch (type) {
9835 case 'boolean':
9836 case 'string':
9837 case 'number':
9838 case 'symbol':
9839 case 'function':
9840 {
9841 return type;
9842 }
9843 }
9844
9845 if (Array.isArray(val)) return 'array';
9846 if (isDate(val)) return 'date';
9847 if (isError(val)) return 'error';
9848 var constructorName = ctorName(val);
9849
9850 switch (constructorName) {
9851 case 'Symbol':
9852 case 'Promise':
9853 case 'WeakMap':
9854 case 'WeakSet':
9855 case 'Map':
9856 case 'Set':
9857 return constructorName;
9858 } // other
9859
9860
9861 return type.slice(8, -1).toLowerCase().replace(/\s/g, '');
9862 }
9863
9864 function ctorName(val) {
9865 return typeof val.constructor === 'function' ? val.constructor.name : null;
9866 }
9867
9868 function isError(val) {
9869 return val instanceof Error || typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number';
9870 }
9871
9872 function isDate(val) {
9873 if (val instanceof Date) return true;
9874 return typeof val.toDateString === 'function' && typeof val.getDate === 'function' && typeof val.setDate === 'function';
9875 }
9876
9877 function kindOf(val) {
9878 var typeOfVal = typeof val;
9879
9880 if (true) {
9881 typeOfVal = miniKindOf(val);
9882 }
9883
9884 return typeOfVal;
9885 }
9886
9887 /**
9888 * @deprecated
9889 *
9890 * **We recommend using the `configureStore` method
9891 * of the `@reduxjs/toolkit` package**, which replaces `createStore`.
9892 *
9893 * Redux Toolkit is our recommended approach for writing Redux logic today,
9894 * including store setup, reducers, data fetching, and more.
9895 *
9896 * **For more details, please read this Redux docs page:**
9897 * **https://redux.js.org/introduction/why-rtk-is-redux-today**
9898 *
9899 * `configureStore` from Redux Toolkit is an improved version of `createStore` that
9900 * simplifies setup and helps avoid common bugs.
9901 *
9902 * You should not be using the `redux` core package by itself today, except for learning purposes.
9903 * The `createStore` method from the core `redux` package will not be removed, but we encourage
9904 * all users to migrate to using Redux Toolkit for all Redux code.
9905 *
9906 * If you want to use `createStore` without this visual deprecation warning, use
9907 * the `legacy_createStore` import instead:
9908 *
9909 * `import { legacy_createStore as createStore} from 'redux'`
9910 *
9911 */
9912
9913 function createStore(reducer, preloadedState, enhancer) {
9914 var _ref2;
9915
9916 if (typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments[3] === 'function') {
9917 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.');
9918 }
9919
9920 if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {
9921 enhancer = preloadedState;
9922 preloadedState = undefined;
9923 }
9924
9925 if (typeof enhancer !== 'undefined') {
9926 if (typeof enhancer !== 'function') {
9927 throw new Error( false ? 0 : "Expected the enhancer to be a function. Instead, received: '" + kindOf(enhancer) + "'");
9928 }
9929
9930 return enhancer(createStore)(reducer, preloadedState);
9931 }
9932
9933 if (typeof reducer !== 'function') {
9934 throw new Error( false ? 0 : "Expected the root reducer to be a function. Instead, received: '" + kindOf(reducer) + "'");
9935 }
9936
9937 var currentReducer = reducer;
9938 var currentState = preloadedState;
9939 var currentListeners = [];
9940 var nextListeners = currentListeners;
9941 var isDispatching = false;
9942 /**
9943 * This makes a shallow copy of currentListeners so we can use
9944 * nextListeners as a temporary list while dispatching.
9945 *
9946 * This prevents any bugs around consumers calling
9947 * subscribe/unsubscribe in the middle of a dispatch.
9948 */
9949
9950 function ensureCanMutateNextListeners() {
9951 if (nextListeners === currentListeners) {
9952 nextListeners = currentListeners.slice();
9953 }
9954 }
9955 /**
9956 * Reads the state tree managed by the store.
9957 *
9958 * @returns {any} The current state tree of your application.
9959 */
9960
9961
9962 function getState() {
9963 if (isDispatching) {
9964 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.');
9965 }
9966
9967 return currentState;
9968 }
9969 /**
9970 * Adds a change listener. It will be called any time an action is dispatched,
9971 * and some part of the state tree may potentially have changed. You may then
9972 * call `getState()` to read the current state tree inside the callback.
9973 *
9974 * You may call `dispatch()` from a change listener, with the following
9975 * caveats:
9976 *
9977 * 1. The subscriptions are snapshotted just before every `dispatch()` call.
9978 * If you subscribe or unsubscribe while the listeners are being invoked, this
9979 * will not have any effect on the `dispatch()` that is currently in progress.
9980 * However, the next `dispatch()` call, whether nested or not, will use a more
9981 * recent snapshot of the subscription list.
9982 *
9983 * 2. The listener should not expect to see all state changes, as the state
9984 * might have been updated multiple times during a nested `dispatch()` before
9985 * the listener is called. It is, however, guaranteed that all subscribers
9986 * registered before the `dispatch()` started will be called with the latest
9987 * state by the time it exits.
9988 *
9989 * @param {Function} listener A callback to be invoked on every dispatch.
9990 * @returns {Function} A function to remove this change listener.
9991 */
9992
9993
9994 function subscribe(listener) {
9995 if (typeof listener !== 'function') {
9996 throw new Error( false ? 0 : "Expected the listener to be a function. Instead, received: '" + kindOf(listener) + "'");
9997 }
9998
9999 if (isDispatching) {
10000 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.');
10001 }
10002
10003 var isSubscribed = true;
10004 ensureCanMutateNextListeners();
10005 nextListeners.push(listener);
10006 return function unsubscribe() {
10007 if (!isSubscribed) {
10008 return;
10009 }
10010
10011 if (isDispatching) {
10012 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.');
10013 }
10014
10015 isSubscribed = false;
10016 ensureCanMutateNextListeners();
10017 var index = nextListeners.indexOf(listener);
10018 nextListeners.splice(index, 1);
10019 currentListeners = null;
10020 };
10021 }
10022 /**
10023 * Dispatches an action. It is the only way to trigger a state change.
10024 *
10025 * The `reducer` function, used to create the store, will be called with the
10026 * current state tree and the given `action`. Its return value will
10027 * be considered the **next** state of the tree, and the change listeners
10028 * will be notified.
10029 *
10030 * The base implementation only supports plain object actions. If you want to
10031 * dispatch a Promise, an Observable, a thunk, or something else, you need to
10032 * wrap your store creating function into the corresponding middleware. For
10033 * example, see the documentation for the `redux-thunk` package. Even the
10034 * middleware will eventually dispatch plain object actions using this method.
10035 *
10036 * @param {Object} action A plain object representing “what changed”. It is
10037 * a good idea to keep actions serializable so you can record and replay user
10038 * sessions, or use the time travelling `redux-devtools`. An action must have
10039 * a `type` property which may not be `undefined`. It is a good idea to use
10040 * string constants for action types.
10041 *
10042 * @returns {Object} For convenience, the same action object you dispatched.
10043 *
10044 * Note that, if you use a custom middleware, it may wrap `dispatch()` to
10045 * return something else (for example, a Promise you can await).
10046 */
10047
10048
10049 function dispatch(action) {
10050 if (!isPlainObject(action)) {
10051 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.");
10052 }
10053
10054 if (typeof action.type === 'undefined') {
10055 throw new Error( false ? 0 : 'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');
10056 }
10057
10058 if (isDispatching) {
10059 throw new Error( false ? 0 : 'Reducers may not dispatch actions.');
10060 }
10061
10062 try {
10063 isDispatching = true;
10064 currentState = currentReducer(currentState, action);
10065 } finally {
10066 isDispatching = false;
10067 }
10068
10069 var listeners = currentListeners = nextListeners;
10070
10071 for (var i = 0; i < listeners.length; i++) {
10072 var listener = listeners[i];
10073 listener();
10074 }
10075
10076 return action;
10077 }
10078 /**
10079 * Replaces the reducer currently used by the store to calculate the state.
10080 *
10081 * You might need this if your app implements code splitting and you want to
10082 * load some of the reducers dynamically. You might also need this if you
10083 * implement a hot reloading mechanism for Redux.
10084 *
10085 * @param {Function} nextReducer The reducer for the store to use instead.
10086 * @returns {void}
10087 */
10088
10089
10090 function replaceReducer(nextReducer) {
10091 if (typeof nextReducer !== 'function') {
10092 throw new Error( false ? 0 : "Expected the nextReducer to be a function. Instead, received: '" + kindOf(nextReducer));
10093 }
10094
10095 currentReducer = nextReducer; // This action has a similiar effect to ActionTypes.INIT.
10096 // Any reducers that existed in both the new and old rootReducer
10097 // will receive the previous state. This effectively populates
10098 // the new state tree with any relevant data from the old one.
10099
10100 dispatch({
10101 type: ActionTypes.REPLACE
10102 });
10103 }
10104 /**
10105 * Interoperability point for observable/reactive libraries.
10106 * @returns {observable} A minimal observable of state changes.
10107 * For more information, see the observable proposal:
10108 * https://github.com/tc39/proposal-observable
10109 */
10110
10111
10112 function observable() {
10113 var _ref;
10114
10115 var outerSubscribe = subscribe;
10116 return _ref = {
10117 /**
10118 * The minimal observable subscription method.
10119 * @param {Object} observer Any object that can be used as an observer.
10120 * The observer object should have a `next` method.
10121 * @returns {subscription} An object with an `unsubscribe` method that can
10122 * be used to unsubscribe the observable from the store, and prevent further
10123 * emission of values from the observable.
10124 */
10125 subscribe: function subscribe(observer) {
10126 if (typeof observer !== 'object' || observer === null) {
10127 throw new Error( false ? 0 : "Expected the observer to be an object. Instead, received: '" + kindOf(observer) + "'");
10128 }
10129
10130 function observeState() {
10131 if (observer.next) {
10132 observer.next(getState());
10133 }
10134 }
10135
10136 observeState();
10137 var unsubscribe = outerSubscribe(observeState);
10138 return {
10139 unsubscribe: unsubscribe
10140 };
10141 }
10142 }, _ref[$$observable] = function () {
10143 return this;
10144 }, _ref;
10145 } // When a store is created, an "INIT" action is dispatched so that every
10146 // reducer returns their initial state. This effectively populates
10147 // the initial state tree.
10148
10149
10150 dispatch({
10151 type: ActionTypes.INIT
10152 });
10153 return _ref2 = {
10154 dispatch: dispatch,
10155 subscribe: subscribe,
10156 getState: getState,
10157 replaceReducer: replaceReducer
10158 }, _ref2[$$observable] = observable, _ref2;
10159 }
10160 /**
10161 * Creates a Redux store that holds the state tree.
10162 *
10163 * **We recommend using `configureStore` from the
10164 * `@reduxjs/toolkit` package**, which replaces `createStore`:
10165 * **https://redux.js.org/introduction/why-rtk-is-redux-today**
10166 *
10167 * The only way to change the data in the store is to call `dispatch()` on it.
10168 *
10169 * There should only be a single store in your app. To specify how different
10170 * parts of the state tree respond to actions, you may combine several reducers
10171 * into a single reducer function by using `combineReducers`.
10172 *
10173 * @param {Function} reducer A function that returns the next state tree, given
10174 * the current state tree and the action to handle.
10175 *
10176 * @param {any} [preloadedState] The initial state. You may optionally specify it
10177 * to hydrate the state from the server in universal apps, or to restore a
10178 * previously serialized user session.
10179 * If you use `combineReducers` to produce the root reducer function, this must be
10180 * an object with the same shape as `combineReducers` keys.
10181 *
10182 * @param {Function} [enhancer] The store enhancer. You may optionally specify it
10183 * to enhance the store with third-party capabilities such as middleware,
10184 * time travel, persistence, etc. The only store enhancer that ships with Redux
10185 * is `applyMiddleware()`.
10186 *
10187 * @returns {Store} A Redux store that lets you read the state, dispatch actions
10188 * and subscribe to changes.
10189 */
10190
10191 var legacy_createStore = createStore;
10192
10193 /**
10194 * Prints a warning in the console if it exists.
10195 *
10196 * @param {String} message The warning message.
10197 * @returns {void}
10198 */
10199 function warning(message) {
10200 /* eslint-disable no-console */
10201 if (typeof console !== 'undefined' && typeof console.error === 'function') {
10202 console.error(message);
10203 }
10204 /* eslint-enable no-console */
10205
10206
10207 try {
10208 // This error was thrown as a convenience so that if you enable
10209 // "break on all exceptions" in your console,
10210 // it would pause the execution at this line.
10211 throw new Error(message);
10212 } catch (e) {} // eslint-disable-line no-empty
10213
10214 }
10215
10216 function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {
10217 var reducerKeys = Object.keys(reducers);
10218 var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';
10219
10220 if (reducerKeys.length === 0) {
10221 return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';
10222 }
10223
10224 if (!isPlainObject(inputState)) {
10225 return "The " + argumentName + " has unexpected type of \"" + kindOf(inputState) + "\". Expected argument to be an object with the following " + ("keys: \"" + reducerKeys.join('", "') + "\"");
10226 }
10227
10228 var unexpectedKeys = Object.keys(inputState).filter(function (key) {
10229 return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];
10230 });
10231 unexpectedKeys.forEach(function (key) {
10232 unexpectedKeyCache[key] = true;
10233 });
10234 if (action && action.type === ActionTypes.REPLACE) return;
10235
10236 if (unexpectedKeys.length > 0) {
10237 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.");
10238 }
10239 }
10240
10241 function assertReducerShape(reducers) {
10242 Object.keys(reducers).forEach(function (key) {
10243 var reducer = reducers[key];
10244 var initialState = reducer(undefined, {
10245 type: ActionTypes.INIT
10246 });
10247
10248 if (typeof initialState === 'undefined') {
10249 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.");
10250 }
10251
10252 if (typeof reducer(undefined, {
10253 type: ActionTypes.PROBE_UNKNOWN_ACTION()
10254 }) === 'undefined') {
10255 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.");
10256 }
10257 });
10258 }
10259 /**
10260 * Turns an object whose values are different reducer functions, into a single
10261 * reducer function. It will call every child reducer, and gather their results
10262 * into a single state object, whose keys correspond to the keys of the passed
10263 * reducer functions.
10264 *
10265 * @param {Object} reducers An object whose values correspond to different
10266 * reducer functions that need to be combined into one. One handy way to obtain
10267 * it is to use ES6 `import * as reducers` syntax. The reducers may never return
10268 * undefined for any action. Instead, they should return their initial state
10269 * if the state passed to them was undefined, and the current state for any
10270 * unrecognized action.
10271 *
10272 * @returns {Function} A reducer function that invokes every reducer inside the
10273 * passed object, and builds a state object with the same shape.
10274 */
10275
10276
10277 function combineReducers(reducers) {
10278 var reducerKeys = Object.keys(reducers);
10279 var finalReducers = {};
10280
10281 for (var i = 0; i < reducerKeys.length; i++) {
10282 var key = reducerKeys[i];
10283
10284 if (true) {
10285 if (typeof reducers[key] === 'undefined') {
10286 warning("No reducer provided for key \"" + key + "\"");
10287 }
10288 }
10289
10290 if (typeof reducers[key] === 'function') {
10291 finalReducers[key] = reducers[key];
10292 }
10293 }
10294
10295 var finalReducerKeys = Object.keys(finalReducers); // This is used to make sure we don't warn about the same
10296 // keys multiple times.
10297
10298 var unexpectedKeyCache;
10299
10300 if (true) {
10301 unexpectedKeyCache = {};
10302 }
10303
10304 var shapeAssertionError;
10305
10306 try {
10307 assertReducerShape(finalReducers);
10308 } catch (e) {
10309 shapeAssertionError = e;
10310 }
10311
10312 return function combination(state, action) {
10313 if (state === void 0) {
10314 state = {};
10315 }
10316
10317 if (shapeAssertionError) {
10318 throw shapeAssertionError;
10319 }
10320
10321 if (true) {
10322 var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);
10323
10324 if (warningMessage) {
10325 warning(warningMessage);
10326 }
10327 }
10328
10329 var hasChanged = false;
10330 var nextState = {};
10331
10332 for (var _i = 0; _i < finalReducerKeys.length; _i++) {
10333 var _key = finalReducerKeys[_i];
10334 var reducer = finalReducers[_key];
10335 var previousStateForKey = state[_key];
10336 var nextStateForKey = reducer(previousStateForKey, action);
10337
10338 if (typeof nextStateForKey === 'undefined') {
10339 var actionType = action && action.type;
10340 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.");
10341 }
10342
10343 nextState[_key] = nextStateForKey;
10344 hasChanged = hasChanged || nextStateForKey !== previousStateForKey;
10345 }
10346
10347 hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length;
10348 return hasChanged ? nextState : state;
10349 };
10350 }
10351
10352 function bindActionCreator(actionCreator, dispatch) {
10353 return function () {
10354 return dispatch(actionCreator.apply(this, arguments));
10355 };
10356 }
10357 /**
10358 * Turns an object whose values are action creators, into an object with the
10359 * same keys, but with every function wrapped into a `dispatch` call so they
10360 * may be invoked directly. This is just a convenience method, as you can call
10361 * `store.dispatch(MyActionCreators.doSomething())` yourself just fine.
10362 *
10363 * For convenience, you can also pass an action creator as the first argument,
10364 * and get a dispatch wrapped function in return.
10365 *
10366 * @param {Function|Object} actionCreators An object whose values are action
10367 * creator functions. One handy way to obtain it is to use ES6 `import * as`
10368 * syntax. You may also pass a single function.
10369 *
10370 * @param {Function} dispatch The `dispatch` function available on your Redux
10371 * store.
10372 *
10373 * @returns {Function|Object} The object mimicking the original object, but with
10374 * every action creator wrapped into the `dispatch` call. If you passed a
10375 * function as `actionCreators`, the return value will also be a single
10376 * function.
10377 */
10378
10379
10380 function bindActionCreators(actionCreators, dispatch) {
10381 if (typeof actionCreators === 'function') {
10382 return bindActionCreator(actionCreators, dispatch);
10383 }
10384
10385 if (typeof actionCreators !== 'object' || actionCreators === null) {
10386 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\"?");
10387 }
10388
10389 var boundActionCreators = {};
10390
10391 for (var key in actionCreators) {
10392 var actionCreator = actionCreators[key];
10393
10394 if (typeof actionCreator === 'function') {
10395 boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);
10396 }
10397 }
10398
10399 return boundActionCreators;
10400 }
10401
10402 /**
10403 * Composes single-argument functions from right to left. The rightmost
10404 * function can take multiple arguments as it provides the signature for
10405 * the resulting composite function.
10406 *
10407 * @param {...Function} funcs The functions to compose.
10408 * @returns {Function} A function obtained by composing the argument functions
10409 * from right to left. For example, compose(f, g, h) is identical to doing
10410 * (...args) => f(g(h(...args))).
10411 */
10412 function compose() {
10413 for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {
10414 funcs[_key] = arguments[_key];
10415 }
10416
10417 if (funcs.length === 0) {
10418 return function (arg) {
10419 return arg;
10420 };
10421 }
10422
10423 if (funcs.length === 1) {
10424 return funcs[0];
10425 }
10426
10427 return funcs.reduce(function (a, b) {
10428 return function () {
10429 return a(b.apply(void 0, arguments));
10430 };
10431 });
10432 }
10433
10434 /**
10435 * Creates a store enhancer that applies middleware to the dispatch method
10436 * of the Redux store. This is handy for a variety of tasks, such as expressing
10437 * asynchronous actions in a concise manner, or logging every action payload.
10438 *
10439 * See `redux-thunk` package as an example of the Redux middleware.
10440 *
10441 * Because middleware is potentially asynchronous, this should be the first
10442 * store enhancer in the composition chain.
10443 *
10444 * Note that each middleware will be given the `dispatch` and `getState` functions
10445 * as named arguments.
10446 *
10447 * @param {...Function} middlewares The middleware chain to be applied.
10448 * @returns {Function} A store enhancer applying the middleware.
10449 */
10450
10451 function applyMiddleware() {
10452 for (var _len = arguments.length, middlewares = new Array(_len), _key = 0; _key < _len; _key++) {
10453 middlewares[_key] = arguments[_key];
10454 }
10455
10456 return function (createStore) {
10457 return function () {
10458 var store = createStore.apply(void 0, arguments);
10459
10460 var _dispatch = function dispatch() {
10461 throw new Error( false ? 0 : 'Dispatching while constructing your middleware is not allowed. ' + 'Other middleware would not be applied to this dispatch.');
10462 };
10463
10464 var middlewareAPI = {
10465 getState: store.getState,
10466 dispatch: function dispatch() {
10467 return _dispatch.apply(void 0, arguments);
10468 }
10469 };
10470 var chain = middlewares.map(function (middleware) {
10471 return middleware(middlewareAPI);
10472 });
10473 _dispatch = compose.apply(void 0, chain)(store.dispatch);
10474 return (0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_0__["default"])((0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_0__["default"])({}, store), {}, {
10475 dispatch: _dispatch
10476 });
10477 };
10478 };
10479 }
10480
10481
10482
10483
10484 /***/ }),
10485
10486 /***/ "../node_modules/reselect/es/defaultMemoize.js":
10487 /*!*****************************************************!*\
10488 !*** ../node_modules/reselect/es/defaultMemoize.js ***!
10489 \*****************************************************/
10490 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
10491
10492 "use strict";
10493 __webpack_require__.r(__webpack_exports__);
10494 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
10495 /* harmony export */ createCacheKeyComparator: () => (/* binding */ createCacheKeyComparator),
10496 /* harmony export */ defaultEqualityCheck: () => (/* binding */ defaultEqualityCheck),
10497 /* harmony export */ defaultMemoize: () => (/* binding */ defaultMemoize)
10498 /* harmony export */ });
10499 // Cache implementation based on Erik Rasmussen's `lru-memoize`:
10500 // https://github.com/erikras/lru-memoize
10501 var NOT_FOUND = 'NOT_FOUND';
10502
10503 function createSingletonCache(equals) {
10504 var entry;
10505 return {
10506 get: function get(key) {
10507 if (entry && equals(entry.key, key)) {
10508 return entry.value;
10509 }
10510
10511 return NOT_FOUND;
10512 },
10513 put: function put(key, value) {
10514 entry = {
10515 key: key,
10516 value: value
10517 };
10518 },
10519 getEntries: function getEntries() {
10520 return entry ? [entry] : [];
10521 },
10522 clear: function clear() {
10523 entry = undefined;
10524 }
10525 };
10526 }
10527
10528 function createLruCache(maxSize, equals) {
10529 var entries = [];
10530
10531 function get(key) {
10532 var cacheIndex = entries.findIndex(function (entry) {
10533 return equals(key, entry.key);
10534 }); // We found a cached entry
10535
10536 if (cacheIndex > -1) {
10537 var entry = entries[cacheIndex]; // Cached entry not at top of cache, move it to the top
10538
10539 if (cacheIndex > 0) {
10540 entries.splice(cacheIndex, 1);
10541 entries.unshift(entry);
10542 }
10543
10544 return entry.value;
10545 } // No entry found in cache, return sentinel
10546
10547
10548 return NOT_FOUND;
10549 }
10550
10551 function put(key, value) {
10552 if (get(key) === NOT_FOUND) {
10553 // TODO Is unshift slow?
10554 entries.unshift({
10555 key: key,
10556 value: value
10557 });
10558
10559 if (entries.length > maxSize) {
10560 entries.pop();
10561 }
10562 }
10563 }
10564
10565 function getEntries() {
10566 return entries;
10567 }
10568
10569 function clear() {
10570 entries = [];
10571 }
10572
10573 return {
10574 get: get,
10575 put: put,
10576 getEntries: getEntries,
10577 clear: clear
10578 };
10579 }
10580
10581 var defaultEqualityCheck = function defaultEqualityCheck(a, b) {
10582 return a === b;
10583 };
10584 function createCacheKeyComparator(equalityCheck) {
10585 return function areArgumentsShallowlyEqual(prev, next) {
10586 if (prev === null || next === null || prev.length !== next.length) {
10587 return false;
10588 } // Do this in a for loop (and not a `forEach` or an `every`) so we can determine equality as fast as possible.
10589
10590
10591 var length = prev.length;
10592
10593 for (var i = 0; i < length; i++) {
10594 if (!equalityCheck(prev[i], next[i])) {
10595 return false;
10596 }
10597 }
10598
10599 return true;
10600 };
10601 }
10602 // defaultMemoize now supports a configurable cache size with LRU behavior,
10603 // and optional comparison of the result value with existing values
10604 function defaultMemoize(func, equalityCheckOrOptions) {
10605 var providedOptions = typeof equalityCheckOrOptions === 'object' ? equalityCheckOrOptions : {
10606 equalityCheck: equalityCheckOrOptions
10607 };
10608 var _providedOptions$equa = providedOptions.equalityCheck,
10609 equalityCheck = _providedOptions$equa === void 0 ? defaultEqualityCheck : _providedOptions$equa,
10610 _providedOptions$maxS = providedOptions.maxSize,
10611 maxSize = _providedOptions$maxS === void 0 ? 1 : _providedOptions$maxS,
10612 resultEqualityCheck = providedOptions.resultEqualityCheck;
10613 var comparator = createCacheKeyComparator(equalityCheck);
10614 var cache = maxSize === 1 ? createSingletonCache(comparator) : createLruCache(maxSize, comparator); // we reference arguments instead of spreading them for performance reasons
10615
10616 function memoized() {
10617 var value = cache.get(arguments);
10618
10619 if (value === NOT_FOUND) {
10620 // @ts-ignore
10621 value = func.apply(null, arguments);
10622
10623 if (resultEqualityCheck) {
10624 var entries = cache.getEntries();
10625 var matchingEntry = entries.find(function (entry) {
10626 return resultEqualityCheck(entry.value, value);
10627 });
10628
10629 if (matchingEntry) {
10630 value = matchingEntry.value;
10631 }
10632 }
10633
10634 cache.put(arguments, value);
10635 }
10636
10637 return value;
10638 }
10639
10640 memoized.clearCache = function () {
10641 return cache.clear();
10642 };
10643
10644 return memoized;
10645 }
10646
10647 /***/ }),
10648
10649 /***/ "../node_modules/reselect/es/index.js":
10650 /*!********************************************!*\
10651 !*** ../node_modules/reselect/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 */ createSelector: () => (/* binding */ createSelector),
10659 /* harmony export */ createSelectorCreator: () => (/* binding */ createSelectorCreator),
10660 /* harmony export */ createStructuredSelector: () => (/* binding */ createStructuredSelector),
10661 /* harmony export */ defaultEqualityCheck: () => (/* reexport safe */ _defaultMemoize__WEBPACK_IMPORTED_MODULE_0__.defaultEqualityCheck),
10662 /* harmony export */ defaultMemoize: () => (/* reexport safe */ _defaultMemoize__WEBPACK_IMPORTED_MODULE_0__.defaultMemoize)
10663 /* harmony export */ });
10664 /* harmony import */ var _defaultMemoize__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defaultMemoize */ "../node_modules/reselect/es/defaultMemoize.js");
10665
10666
10667
10668 function getDependencies(funcs) {
10669 var dependencies = Array.isArray(funcs[0]) ? funcs[0] : funcs;
10670
10671 if (!dependencies.every(function (dep) {
10672 return typeof dep === 'function';
10673 })) {
10674 var dependencyTypes = dependencies.map(function (dep) {
10675 return typeof dep === 'function' ? "function " + (dep.name || 'unnamed') + "()" : typeof dep;
10676 }).join(', ');
10677 throw new Error("createSelector expects all input-selectors to be functions, but received the following types: [" + dependencyTypes + "]");
10678 }
10679
10680 return dependencies;
10681 }
10682
10683 function createSelectorCreator(memoize) {
10684 for (var _len = arguments.length, memoizeOptionsFromArgs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
10685 memoizeOptionsFromArgs[_key - 1] = arguments[_key];
10686 }
10687
10688 var createSelector = function createSelector() {
10689 for (var _len2 = arguments.length, funcs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
10690 funcs[_key2] = arguments[_key2];
10691 }
10692
10693 var _recomputations = 0;
10694
10695 var _lastResult; // Due to the intricacies of rest params, we can't do an optional arg after `...funcs`.
10696 // So, start by declaring the default value here.
10697 // (And yes, the words 'memoize' and 'options' appear too many times in this next sequence.)
10698
10699
10700 var directlyPassedOptions = {
10701 memoizeOptions: undefined
10702 }; // Normally, the result func or "output selector" is the last arg
10703
10704 var resultFunc = funcs.pop(); // If the result func is actually an _object_, assume it's our options object
10705
10706 if (typeof resultFunc === 'object') {
10707 directlyPassedOptions = resultFunc; // and pop the real result func off
10708
10709 resultFunc = funcs.pop();
10710 }
10711
10712 if (typeof resultFunc !== 'function') {
10713 throw new Error("createSelector expects an output function after the inputs, but received: [" + typeof resultFunc + "]");
10714 } // Determine which set of options we're using. Prefer options passed directly,
10715 // but fall back to options given to createSelectorCreator.
10716
10717
10718 var _directlyPassedOption = directlyPassedOptions,
10719 _directlyPassedOption2 = _directlyPassedOption.memoizeOptions,
10720 memoizeOptions = _directlyPassedOption2 === void 0 ? memoizeOptionsFromArgs : _directlyPassedOption2; // Simplifying assumption: it's unlikely that the first options arg of the provided memoizer
10721 // is an array. In most libs I've looked at, it's an equality function or options object.
10722 // Based on that, if `memoizeOptions` _is_ an array, we assume it's a full
10723 // user-provided array of options. Otherwise, it must be just the _first_ arg, and so
10724 // we wrap it in an array so we can apply it.
10725
10726 var finalMemoizeOptions = Array.isArray(memoizeOptions) ? memoizeOptions : [memoizeOptions];
10727 var dependencies = getDependencies(funcs);
10728 var memoizedResultFunc = memoize.apply(void 0, [function recomputationWrapper() {
10729 _recomputations++; // apply arguments instead of spreading for performance.
10730
10731 return resultFunc.apply(null, arguments);
10732 }].concat(finalMemoizeOptions)); // If a selector is called with the exact same arguments we don't need to traverse our dependencies again.
10733
10734 var selector = memoize(function dependenciesChecker() {
10735 var params = [];
10736 var length = dependencies.length;
10737
10738 for (var i = 0; i < length; i++) {
10739 // apply arguments instead of spreading and mutate a local list of params for performance.
10740 // @ts-ignore
10741 params.push(dependencies[i].apply(null, arguments));
10742 } // apply arguments instead of spreading for performance.
10743
10744
10745 _lastResult = memoizedResultFunc.apply(null, params);
10746 return _lastResult;
10747 });
10748 Object.assign(selector, {
10749 resultFunc: resultFunc,
10750 memoizedResultFunc: memoizedResultFunc,
10751 dependencies: dependencies,
10752 lastResult: function lastResult() {
10753 return _lastResult;
10754 },
10755 recomputations: function recomputations() {
10756 return _recomputations;
10757 },
10758 resetRecomputations: function resetRecomputations() {
10759 return _recomputations = 0;
10760 }
10761 });
10762 return selector;
10763 }; // @ts-ignore
10764
10765
10766 return createSelector;
10767 }
10768 var createSelector = /* #__PURE__ */createSelectorCreator(_defaultMemoize__WEBPACK_IMPORTED_MODULE_0__.defaultMemoize);
10769 // Manual definition of state and output arguments
10770 var createStructuredSelector = function createStructuredSelector(selectors, selectorCreator) {
10771 if (selectorCreator === void 0) {
10772 selectorCreator = createSelector;
10773 }
10774
10775 if (typeof selectors !== 'object') {
10776 throw new Error('createStructuredSelector expects first argument to be an object ' + ("where each property is a selector, instead received a " + typeof selectors));
10777 }
10778
10779 var objectKeys = Object.keys(selectors);
10780 var resultSelector = selectorCreator( // @ts-ignore
10781 objectKeys.map(function (key) {
10782 return selectors[key];
10783 }), function () {
10784 for (var _len3 = arguments.length, values = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
10785 values[_key3] = arguments[_key3];
10786 }
10787
10788 return values.reduce(function (composition, value, index) {
10789 composition[objectKeys[index]] = value;
10790 return composition;
10791 }, {});
10792 });
10793 return resultSelector;
10794 };
10795
10796 /***/ }),
10797
10798 /***/ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js":
10799 /*!******************************************************************!*\
10800 !*** ../node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***!
10801 \******************************************************************/
10802 /***/ ((module) => {
10803
10804 function _arrayLikeToArray(arr, len) {
10805 if (len == null || len > arr.length) len = arr.length;
10806 for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
10807 return arr2;
10808 }
10809 module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
10810
10811 /***/ }),
10812
10813 /***/ "../node_modules/@babel/runtime/helpers/arrayWithHoles.js":
10814 /*!****************************************************************!*\
10815 !*** ../node_modules/@babel/runtime/helpers/arrayWithHoles.js ***!
10816 \****************************************************************/
10817 /***/ ((module) => {
10818
10819 function _arrayWithHoles(arr) {
10820 if (Array.isArray(arr)) return arr;
10821 }
10822 module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
10823
10824 /***/ }),
10825
10826 /***/ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js":
10827 /*!***********************************************************************!*\
10828 !*** ../node_modules/@babel/runtime/helpers/assertThisInitialized.js ***!
10829 \***********************************************************************/
10830 /***/ ((module) => {
10831
10832 function _assertThisInitialized(self) {
10833 if (self === void 0) {
10834 throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
10835 }
10836 return self;
10837 }
10838 module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports;
10839
10840 /***/ }),
10841
10842 /***/ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js":
10843 /*!******************************************************************!*\
10844 !*** ../node_modules/@babel/runtime/helpers/asyncToGenerator.js ***!
10845 \******************************************************************/
10846 /***/ ((module) => {
10847
10848 function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
10849 try {
10850 var info = gen[key](arg);
10851 var value = info.value;
10852 } catch (error) {
10853 reject(error);
10854 return;
10855 }
10856 if (info.done) {
10857 resolve(value);
10858 } else {
10859 Promise.resolve(value).then(_next, _throw);
10860 }
10861 }
10862 function _asyncToGenerator(fn) {
10863 return function () {
10864 var self = this,
10865 args = arguments;
10866 return new Promise(function (resolve, reject) {
10867 var gen = fn.apply(self, args);
10868 function _next(value) {
10869 asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
10870 }
10871 function _throw(err) {
10872 asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
10873 }
10874 _next(undefined);
10875 });
10876 };
10877 }
10878 module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
10879
10880 /***/ }),
10881
10882 /***/ "../node_modules/@babel/runtime/helpers/classCallCheck.js":
10883 /*!****************************************************************!*\
10884 !*** ../node_modules/@babel/runtime/helpers/classCallCheck.js ***!
10885 \****************************************************************/
10886 /***/ ((module) => {
10887
10888 function _classCallCheck(instance, Constructor) {
10889 if (!(instance instanceof Constructor)) {
10890 throw new TypeError("Cannot call a class as a function");
10891 }
10892 }
10893 module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
10894
10895 /***/ }),
10896
10897 /***/ "../node_modules/@babel/runtime/helpers/construct.js":
10898 /*!***********************************************************!*\
10899 !*** ../node_modules/@babel/runtime/helpers/construct.js ***!
10900 \***********************************************************/
10901 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
10902
10903 var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js");
10904 var isNativeReflectConstruct = __webpack_require__(/*! ./isNativeReflectConstruct.js */ "../node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js");
10905 function _construct(Parent, args, Class) {
10906 if (isNativeReflectConstruct()) {
10907 module.exports = _construct = Reflect.construct.bind(), module.exports.__esModule = true, module.exports["default"] = module.exports;
10908 } else {
10909 module.exports = _construct = function _construct(Parent, args, Class) {
10910 var a = [null];
10911 a.push.apply(a, args);
10912 var Constructor = Function.bind.apply(Parent, a);
10913 var instance = new Constructor();
10914 if (Class) setPrototypeOf(instance, Class.prototype);
10915 return instance;
10916 }, module.exports.__esModule = true, module.exports["default"] = module.exports;
10917 }
10918 return _construct.apply(null, arguments);
10919 }
10920 module.exports = _construct, module.exports.__esModule = true, module.exports["default"] = module.exports;
10921
10922 /***/ }),
10923
10924 /***/ "../node_modules/@babel/runtime/helpers/createClass.js":
10925 /*!*************************************************************!*\
10926 !*** ../node_modules/@babel/runtime/helpers/createClass.js ***!
10927 \*************************************************************/
10928 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
10929
10930 var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/toPropertyKey.js");
10931 function _defineProperties(target, props) {
10932 for (var i = 0; i < props.length; i++) {
10933 var descriptor = props[i];
10934 descriptor.enumerable = descriptor.enumerable || false;
10935 descriptor.configurable = true;
10936 if ("value" in descriptor) descriptor.writable = true;
10937 Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
10938 }
10939 }
10940 function _createClass(Constructor, protoProps, staticProps) {
10941 if (protoProps) _defineProperties(Constructor.prototype, protoProps);
10942 if (staticProps) _defineProperties(Constructor, staticProps);
10943 Object.defineProperty(Constructor, "prototype", {
10944 writable: false
10945 });
10946 return Constructor;
10947 }
10948 module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
10949
10950 /***/ }),
10951
10952 /***/ "../node_modules/@babel/runtime/helpers/defineProperty.js":
10953 /*!****************************************************************!*\
10954 !*** ../node_modules/@babel/runtime/helpers/defineProperty.js ***!
10955 \****************************************************************/
10956 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
10957
10958 var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/toPropertyKey.js");
10959 function _defineProperty(obj, key, value) {
10960 key = toPropertyKey(key);
10961 if (key in obj) {
10962 Object.defineProperty(obj, key, {
10963 value: value,
10964 enumerable: true,
10965 configurable: true,
10966 writable: true
10967 });
10968 } else {
10969 obj[key] = value;
10970 }
10971 return obj;
10972 }
10973 module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
10974
10975 /***/ }),
10976
10977 /***/ "../node_modules/@babel/runtime/helpers/get.js":
10978 /*!*****************************************************!*\
10979 !*** ../node_modules/@babel/runtime/helpers/get.js ***!
10980 \*****************************************************/
10981 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
10982
10983 var superPropBase = __webpack_require__(/*! ./superPropBase.js */ "../node_modules/@babel/runtime/helpers/superPropBase.js");
10984 function _get() {
10985 if (typeof Reflect !== "undefined" && Reflect.get) {
10986 module.exports = _get = Reflect.get.bind(), module.exports.__esModule = true, module.exports["default"] = module.exports;
10987 } else {
10988 module.exports = _get = function _get(target, property, receiver) {
10989 var base = superPropBase(target, property);
10990 if (!base) return;
10991 var desc = Object.getOwnPropertyDescriptor(base, property);
10992 if (desc.get) {
10993 return desc.get.call(arguments.length < 3 ? target : receiver);
10994 }
10995 return desc.value;
10996 }, module.exports.__esModule = true, module.exports["default"] = module.exports;
10997 }
10998 return _get.apply(this, arguments);
10999 }
11000 module.exports = _get, module.exports.__esModule = true, module.exports["default"] = module.exports;
11001
11002 /***/ }),
11003
11004 /***/ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js":
11005 /*!****************************************************************!*\
11006 !*** ../node_modules/@babel/runtime/helpers/getPrototypeOf.js ***!
11007 \****************************************************************/
11008 /***/ ((module) => {
11009
11010 function _getPrototypeOf(o) {
11011 module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
11012 return o.__proto__ || Object.getPrototypeOf(o);
11013 }, module.exports.__esModule = true, module.exports["default"] = module.exports;
11014 return _getPrototypeOf(o);
11015 }
11016 module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
11017
11018 /***/ }),
11019
11020 /***/ "../node_modules/@babel/runtime/helpers/inherits.js":
11021 /*!**********************************************************!*\
11022 !*** ../node_modules/@babel/runtime/helpers/inherits.js ***!
11023 \**********************************************************/
11024 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
11025
11026 var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js");
11027 function _inherits(subClass, superClass) {
11028 if (typeof superClass !== "function" && superClass !== null) {
11029 throw new TypeError("Super expression must either be null or a function");
11030 }
11031 subClass.prototype = Object.create(superClass && superClass.prototype, {
11032 constructor: {
11033 value: subClass,
11034 writable: true,
11035 configurable: true
11036 }
11037 });
11038 Object.defineProperty(subClass, "prototype", {
11039 writable: false
11040 });
11041 if (superClass) setPrototypeOf(subClass, superClass);
11042 }
11043 module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports;
11044
11045 /***/ }),
11046
11047 /***/ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js":
11048 /*!***********************************************************************!*\
11049 !*** ../node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
11050 \***********************************************************************/
11051 /***/ ((module) => {
11052
11053 function _interopRequireDefault(obj) {
11054 return obj && obj.__esModule ? obj : {
11055 "default": obj
11056 };
11057 }
11058 module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
11059
11060 /***/ }),
11061
11062 /***/ "../node_modules/@babel/runtime/helpers/isNativeFunction.js":
11063 /*!******************************************************************!*\
11064 !*** ../node_modules/@babel/runtime/helpers/isNativeFunction.js ***!
11065 \******************************************************************/
11066 /***/ ((module) => {
11067
11068 function _isNativeFunction(fn) {
11069 return Function.toString.call(fn).indexOf("[native code]") !== -1;
11070 }
11071 module.exports = _isNativeFunction, module.exports.__esModule = true, module.exports["default"] = module.exports;
11072
11073 /***/ }),
11074
11075 /***/ "../node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js":
11076 /*!**************************************************************************!*\
11077 !*** ../node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js ***!
11078 \**************************************************************************/
11079 /***/ ((module) => {
11080
11081 function _isNativeReflectConstruct() {
11082 if (typeof Reflect === "undefined" || !Reflect.construct) return false;
11083 if (Reflect.construct.sham) return false;
11084 if (typeof Proxy === "function") return true;
11085 try {
11086 Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
11087 return true;
11088 } catch (e) {
11089 return false;
11090 }
11091 }
11092 module.exports = _isNativeReflectConstruct, module.exports.__esModule = true, module.exports["default"] = module.exports;
11093
11094 /***/ }),
11095
11096 /***/ "../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js":
11097 /*!**********************************************************************!*\
11098 !*** ../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***!
11099 \**********************************************************************/
11100 /***/ ((module) => {
11101
11102 function _iterableToArrayLimit(arr, i) {
11103 var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
11104 if (null != _i) {
11105 var _s,
11106 _e,
11107 _x,
11108 _r,
11109 _arr = [],
11110 _n = !0,
11111 _d = !1;
11112 try {
11113 if (_x = (_i = _i.call(arr)).next, 0 === i) {
11114 if (Object(_i) !== _i) return;
11115 _n = !1;
11116 } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
11117 } catch (err) {
11118 _d = !0, _e = err;
11119 } finally {
11120 try {
11121 if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
11122 } finally {
11123 if (_d) throw _e;
11124 }
11125 }
11126 return _arr;
11127 }
11128 }
11129 module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports;
11130
11131 /***/ }),
11132
11133 /***/ "../node_modules/@babel/runtime/helpers/nonIterableRest.js":
11134 /*!*****************************************************************!*\
11135 !*** ../node_modules/@babel/runtime/helpers/nonIterableRest.js ***!
11136 \*****************************************************************/
11137 /***/ ((module) => {
11138
11139 function _nonIterableRest() {
11140 throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
11141 }
11142 module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports;
11143
11144 /***/ }),
11145
11146 /***/ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js":
11147 /*!***************************************************************************!*\
11148 !*** ../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js ***!
11149 \***************************************************************************/
11150 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
11151
11152 var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
11153 var assertThisInitialized = __webpack_require__(/*! ./assertThisInitialized.js */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js");
11154 function _possibleConstructorReturn(self, call) {
11155 if (call && (_typeof(call) === "object" || typeof call === "function")) {
11156 return call;
11157 } else if (call !== void 0) {
11158 throw new TypeError("Derived constructors may only return object or undefined");
11159 }
11160 return assertThisInitialized(self);
11161 }
11162 module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports;
11163
11164 /***/ }),
11165
11166 /***/ "../node_modules/@babel/runtime/helpers/regeneratorRuntime.js":
11167 /*!********************************************************************!*\
11168 !*** ../node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***!
11169 \********************************************************************/
11170 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
11171
11172 var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
11173 function _regeneratorRuntime() {
11174 "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
11175 module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
11176 return exports;
11177 }, module.exports.__esModule = true, module.exports["default"] = module.exports;
11178 var exports = {},
11179 Op = Object.prototype,
11180 hasOwn = Op.hasOwnProperty,
11181 defineProperty = Object.defineProperty || function (obj, key, desc) {
11182 obj[key] = desc.value;
11183 },
11184 $Symbol = "function" == typeof Symbol ? Symbol : {},
11185 iteratorSymbol = $Symbol.iterator || "@@iterator",
11186 asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
11187 toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
11188 function define(obj, key, value) {
11189 return Object.defineProperty(obj, key, {
11190 value: value,
11191 enumerable: !0,
11192 configurable: !0,
11193 writable: !0
11194 }), obj[key];
11195 }
11196 try {
11197 define({}, "");
11198 } catch (err) {
11199 define = function define(obj, key, value) {
11200 return obj[key] = value;
11201 };
11202 }
11203 function wrap(innerFn, outerFn, self, tryLocsList) {
11204 var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
11205 generator = Object.create(protoGenerator.prototype),
11206 context = new Context(tryLocsList || []);
11207 return defineProperty(generator, "_invoke", {
11208 value: makeInvokeMethod(innerFn, self, context)
11209 }), generator;
11210 }
11211 function tryCatch(fn, obj, arg) {
11212 try {
11213 return {
11214 type: "normal",
11215 arg: fn.call(obj, arg)
11216 };
11217 } catch (err) {
11218 return {
11219 type: "throw",
11220 arg: err
11221 };
11222 }
11223 }
11224 exports.wrap = wrap;
11225 var ContinueSentinel = {};
11226 function Generator() {}
11227 function GeneratorFunction() {}
11228 function GeneratorFunctionPrototype() {}
11229 var IteratorPrototype = {};
11230 define(IteratorPrototype, iteratorSymbol, function () {
11231 return this;
11232 });
11233 var getProto = Object.getPrototypeOf,
11234 NativeIteratorPrototype = getProto && getProto(getProto(values([])));
11235 NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
11236 var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
11237 function defineIteratorMethods(prototype) {
11238 ["next", "throw", "return"].forEach(function (method) {
11239 define(prototype, method, function (arg) {
11240 return this._invoke(method, arg);
11241 });
11242 });
11243 }
11244 function AsyncIterator(generator, PromiseImpl) {
11245 function invoke(method, arg, resolve, reject) {
11246 var record = tryCatch(generator[method], generator, arg);
11247 if ("throw" !== record.type) {
11248 var result = record.arg,
11249 value = result.value;
11250 return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
11251 invoke("next", value, resolve, reject);
11252 }, function (err) {
11253 invoke("throw", err, resolve, reject);
11254 }) : PromiseImpl.resolve(value).then(function (unwrapped) {
11255 result.value = unwrapped, resolve(result);
11256 }, function (error) {
11257 return invoke("throw", error, resolve, reject);
11258 });
11259 }
11260 reject(record.arg);
11261 }
11262 var previousPromise;
11263 defineProperty(this, "_invoke", {
11264 value: function value(method, arg) {
11265 function callInvokeWithMethodAndArg() {
11266 return new PromiseImpl(function (resolve, reject) {
11267 invoke(method, arg, resolve, reject);
11268 });
11269 }
11270 return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
11271 }
11272 });
11273 }
11274 function makeInvokeMethod(innerFn, self, context) {
11275 var state = "suspendedStart";
11276 return function (method, arg) {
11277 if ("executing" === state) throw new Error("Generator is already running");
11278 if ("completed" === state) {
11279 if ("throw" === method) throw arg;
11280 return doneResult();
11281 }
11282 for (context.method = method, context.arg = arg;;) {
11283 var delegate = context.delegate;
11284 if (delegate) {
11285 var delegateResult = maybeInvokeDelegate(delegate, context);
11286 if (delegateResult) {
11287 if (delegateResult === ContinueSentinel) continue;
11288 return delegateResult;
11289 }
11290 }
11291 if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
11292 if ("suspendedStart" === state) throw state = "completed", context.arg;
11293 context.dispatchException(context.arg);
11294 } else "return" === context.method && context.abrupt("return", context.arg);
11295 state = "executing";
11296 var record = tryCatch(innerFn, self, context);
11297 if ("normal" === record.type) {
11298 if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
11299 return {
11300 value: record.arg,
11301 done: context.done
11302 };
11303 }
11304 "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
11305 }
11306 };
11307 }
11308 function maybeInvokeDelegate(delegate, context) {
11309 var methodName = context.method,
11310 method = delegate.iterator[methodName];
11311 if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
11312 var record = tryCatch(method, delegate.iterator, context.arg);
11313 if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
11314 var info = record.arg;
11315 return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
11316 }
11317 function pushTryEntry(locs) {
11318 var entry = {
11319 tryLoc: locs[0]
11320 };
11321 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
11322 }
11323 function resetTryEntry(entry) {
11324 var record = entry.completion || {};
11325 record.type = "normal", delete record.arg, entry.completion = record;
11326 }
11327 function Context(tryLocsList) {
11328 this.tryEntries = [{
11329 tryLoc: "root"
11330 }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
11331 }
11332 function values(iterable) {
11333 if (iterable) {
11334 var iteratorMethod = iterable[iteratorSymbol];
11335 if (iteratorMethod) return iteratorMethod.call(iterable);
11336 if ("function" == typeof iterable.next) return iterable;
11337 if (!isNaN(iterable.length)) {
11338 var i = -1,
11339 next = function next() {
11340 for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
11341 return next.value = undefined, next.done = !0, next;
11342 };
11343 return next.next = next;
11344 }
11345 }
11346 return {
11347 next: doneResult
11348 };
11349 }
11350 function doneResult() {
11351 return {
11352 value: undefined,
11353 done: !0
11354 };
11355 }
11356 return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
11357 value: GeneratorFunctionPrototype,
11358 configurable: !0
11359 }), defineProperty(GeneratorFunctionPrototype, "constructor", {
11360 value: GeneratorFunction,
11361 configurable: !0
11362 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
11363 var ctor = "function" == typeof genFun && genFun.constructor;
11364 return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
11365 }, exports.mark = function (genFun) {
11366 return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
11367 }, exports.awrap = function (arg) {
11368 return {
11369 __await: arg
11370 };
11371 }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
11372 return this;
11373 }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
11374 void 0 === PromiseImpl && (PromiseImpl = Promise);
11375 var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
11376 return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
11377 return result.done ? result.value : iter.next();
11378 });
11379 }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
11380 return this;
11381 }), define(Gp, "toString", function () {
11382 return "[object Generator]";
11383 }), exports.keys = function (val) {
11384 var object = Object(val),
11385 keys = [];
11386 for (var key in object) keys.push(key);
11387 return keys.reverse(), function next() {
11388 for (; keys.length;) {
11389 var key = keys.pop();
11390 if (key in object) return next.value = key, next.done = !1, next;
11391 }
11392 return next.done = !0, next;
11393 };
11394 }, exports.values = values, Context.prototype = {
11395 constructor: Context,
11396 reset: function reset(skipTempReset) {
11397 if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
11398 },
11399 stop: function stop() {
11400 this.done = !0;
11401 var rootRecord = this.tryEntries[0].completion;
11402 if ("throw" === rootRecord.type) throw rootRecord.arg;
11403 return this.rval;
11404 },
11405 dispatchException: function dispatchException(exception) {
11406 if (this.done) throw exception;
11407 var context = this;
11408 function handle(loc, caught) {
11409 return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
11410 }
11411 for (var i = this.tryEntries.length - 1; i >= 0; --i) {
11412 var entry = this.tryEntries[i],
11413 record = entry.completion;
11414 if ("root" === entry.tryLoc) return handle("end");
11415 if (entry.tryLoc <= this.prev) {
11416 var hasCatch = hasOwn.call(entry, "catchLoc"),
11417 hasFinally = hasOwn.call(entry, "finallyLoc");
11418 if (hasCatch && hasFinally) {
11419 if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
11420 if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
11421 } else if (hasCatch) {
11422 if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
11423 } else {
11424 if (!hasFinally) throw new Error("try statement without catch or finally");
11425 if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
11426 }
11427 }
11428 }
11429 },
11430 abrupt: function abrupt(type, arg) {
11431 for (var i = this.tryEntries.length - 1; i >= 0; --i) {
11432 var entry = this.tryEntries[i];
11433 if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
11434 var finallyEntry = entry;
11435 break;
11436 }
11437 }
11438 finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
11439 var record = finallyEntry ? finallyEntry.completion : {};
11440 return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
11441 },
11442 complete: function complete(record, afterLoc) {
11443 if ("throw" === record.type) throw record.arg;
11444 return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
11445 },
11446 finish: function finish(finallyLoc) {
11447 for (var i = this.tryEntries.length - 1; i >= 0; --i) {
11448 var entry = this.tryEntries[i];
11449 if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
11450 }
11451 },
11452 "catch": function _catch(tryLoc) {
11453 for (var i = this.tryEntries.length - 1; i >= 0; --i) {
11454 var entry = this.tryEntries[i];
11455 if (entry.tryLoc === tryLoc) {
11456 var record = entry.completion;
11457 if ("throw" === record.type) {
11458 var thrown = record.arg;
11459 resetTryEntry(entry);
11460 }
11461 return thrown;
11462 }
11463 }
11464 throw new Error("illegal catch attempt");
11465 },
11466 delegateYield: function delegateYield(iterable, resultName, nextLoc) {
11467 return this.delegate = {
11468 iterator: values(iterable),
11469 resultName: resultName,
11470 nextLoc: nextLoc
11471 }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
11472 }
11473 }, exports;
11474 }
11475 module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
11476
11477 /***/ }),
11478
11479 /***/ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js":
11480 /*!****************************************************************!*\
11481 !*** ../node_modules/@babel/runtime/helpers/setPrototypeOf.js ***!
11482 \****************************************************************/
11483 /***/ ((module) => {
11484
11485 function _setPrototypeOf(o, p) {
11486 module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
11487 o.__proto__ = p;
11488 return o;
11489 }, module.exports.__esModule = true, module.exports["default"] = module.exports;
11490 return _setPrototypeOf(o, p);
11491 }
11492 module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
11493
11494 /***/ }),
11495
11496 /***/ "../node_modules/@babel/runtime/helpers/slicedToArray.js":
11497 /*!***************************************************************!*\
11498 !*** ../node_modules/@babel/runtime/helpers/slicedToArray.js ***!
11499 \***************************************************************/
11500 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
11501
11502 var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles.js */ "../node_modules/@babel/runtime/helpers/arrayWithHoles.js");
11503 var iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit.js */ "../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js");
11504 var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ "../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js");
11505 var nonIterableRest = __webpack_require__(/*! ./nonIterableRest.js */ "../node_modules/@babel/runtime/helpers/nonIterableRest.js");
11506 function _slicedToArray(arr, i) {
11507 return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
11508 }
11509 module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
11510
11511 /***/ }),
11512
11513 /***/ "../node_modules/@babel/runtime/helpers/superPropBase.js":
11514 /*!***************************************************************!*\
11515 !*** ../node_modules/@babel/runtime/helpers/superPropBase.js ***!
11516 \***************************************************************/
11517 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
11518
11519 var getPrototypeOf = __webpack_require__(/*! ./getPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js");
11520 function _superPropBase(object, property) {
11521 while (!Object.prototype.hasOwnProperty.call(object, property)) {
11522 object = getPrototypeOf(object);
11523 if (object === null) break;
11524 }
11525 return object;
11526 }
11527 module.exports = _superPropBase, module.exports.__esModule = true, module.exports["default"] = module.exports;
11528
11529 /***/ }),
11530
11531 /***/ "../node_modules/@babel/runtime/helpers/toPrimitive.js":
11532 /*!*************************************************************!*\
11533 !*** ../node_modules/@babel/runtime/helpers/toPrimitive.js ***!
11534 \*************************************************************/
11535 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
11536
11537 var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
11538 function _toPrimitive(input, hint) {
11539 if (_typeof(input) !== "object" || input === null) return input;
11540 var prim = input[Symbol.toPrimitive];
11541 if (prim !== undefined) {
11542 var res = prim.call(input, hint || "default");
11543 if (_typeof(res) !== "object") return res;
11544 throw new TypeError("@@toPrimitive must return a primitive value.");
11545 }
11546 return (hint === "string" ? String : Number)(input);
11547 }
11548 module.exports = _toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
11549
11550 /***/ }),
11551
11552 /***/ "../node_modules/@babel/runtime/helpers/toPropertyKey.js":
11553 /*!***************************************************************!*\
11554 !*** ../node_modules/@babel/runtime/helpers/toPropertyKey.js ***!
11555 \***************************************************************/
11556 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
11557
11558 var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
11559 var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ "../node_modules/@babel/runtime/helpers/toPrimitive.js");
11560 function _toPropertyKey(arg) {
11561 var key = toPrimitive(arg, "string");
11562 return _typeof(key) === "symbol" ? key : String(key);
11563 }
11564 module.exports = _toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
11565
11566 /***/ }),
11567
11568 /***/ "../node_modules/@babel/runtime/helpers/typeof.js":
11569 /*!********************************************************!*\
11570 !*** ../node_modules/@babel/runtime/helpers/typeof.js ***!
11571 \********************************************************/
11572 /***/ ((module) => {
11573
11574 function _typeof(obj) {
11575 "@babel/helpers - typeof";
11576
11577 return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
11578 return typeof obj;
11579 } : function (obj) {
11580 return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
11581 }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
11582 }
11583 module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
11584
11585 /***/ }),
11586
11587 /***/ "../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js":
11588 /*!****************************************************************************!*\
11589 !*** ../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***!
11590 \****************************************************************************/
11591 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
11592
11593 var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js");
11594 function _unsupportedIterableToArray(o, minLen) {
11595 if (!o) return;
11596 if (typeof o === "string") return arrayLikeToArray(o, minLen);
11597 var n = Object.prototype.toString.call(o).slice(8, -1);
11598 if (n === "Object" && o.constructor) n = o.constructor.name;
11599 if (n === "Map" || n === "Set") return Array.from(o);
11600 if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
11601 }
11602 module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
11603
11604 /***/ }),
11605
11606 /***/ "../node_modules/@babel/runtime/helpers/wrapNativeSuper.js":
11607 /*!*****************************************************************!*\
11608 !*** ../node_modules/@babel/runtime/helpers/wrapNativeSuper.js ***!
11609 \*****************************************************************/
11610 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
11611
11612 var getPrototypeOf = __webpack_require__(/*! ./getPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js");
11613 var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js");
11614 var isNativeFunction = __webpack_require__(/*! ./isNativeFunction.js */ "../node_modules/@babel/runtime/helpers/isNativeFunction.js");
11615 var construct = __webpack_require__(/*! ./construct.js */ "../node_modules/@babel/runtime/helpers/construct.js");
11616 function _wrapNativeSuper(Class) {
11617 var _cache = typeof Map === "function" ? new Map() : undefined;
11618 module.exports = _wrapNativeSuper = function _wrapNativeSuper(Class) {
11619 if (Class === null || !isNativeFunction(Class)) return Class;
11620 if (typeof Class !== "function") {
11621 throw new TypeError("Super expression must either be null or a function");
11622 }
11623 if (typeof _cache !== "undefined") {
11624 if (_cache.has(Class)) return _cache.get(Class);
11625 _cache.set(Class, Wrapper);
11626 }
11627 function Wrapper() {
11628 return construct(Class, arguments, getPrototypeOf(this).constructor);
11629 }
11630 Wrapper.prototype = Object.create(Class.prototype, {
11631 constructor: {
11632 value: Wrapper,
11633 enumerable: false,
11634 writable: true,
11635 configurable: true
11636 }
11637 });
11638 return setPrototypeOf(Wrapper, Class);
11639 }, module.exports.__esModule = true, module.exports["default"] = module.exports;
11640 return _wrapNativeSuper(Class);
11641 }
11642 module.exports = _wrapNativeSuper, module.exports.__esModule = true, module.exports["default"] = module.exports;
11643
11644 /***/ }),
11645
11646 /***/ "../node_modules/@babel/runtime/regenerator/index.js":
11647 /*!***********************************************************!*\
11648 !*** ../node_modules/@babel/runtime/regenerator/index.js ***!
11649 \***********************************************************/
11650 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
11651
11652 // TODO(Babel 8): Remove this file.
11653
11654 var runtime = __webpack_require__(/*! ../helpers/regeneratorRuntime */ "../node_modules/@babel/runtime/helpers/regeneratorRuntime.js")();
11655 module.exports = runtime;
11656
11657 // Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
11658 try {
11659 regeneratorRuntime = runtime;
11660 } catch (accidentalStrictMode) {
11661 if (typeof globalThis === "object") {
11662 globalThis.regeneratorRuntime = runtime;
11663 } else {
11664 Function("r", "regeneratorRuntime = r")(runtime);
11665 }
11666 }
11667
11668
11669 /***/ }),
11670
11671 /***/ "../node_modules/@babel/runtime/helpers/esm/defineProperty.js":
11672 /*!********************************************************************!*\
11673 !*** ../node_modules/@babel/runtime/helpers/esm/defineProperty.js ***!
11674 \********************************************************************/
11675 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
11676
11677 "use strict";
11678 __webpack_require__.r(__webpack_exports__);
11679 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
11680 /* harmony export */ "default": () => (/* binding */ _defineProperty)
11681 /* harmony export */ });
11682 /* harmony import */ var _toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js");
11683
11684 function _defineProperty(obj, key, value) {
11685 key = (0,_toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__["default"])(key);
11686 if (key in obj) {
11687 Object.defineProperty(obj, key, {
11688 value: value,
11689 enumerable: true,
11690 configurable: true,
11691 writable: true
11692 });
11693 } else {
11694 obj[key] = value;
11695 }
11696 return obj;
11697 }
11698
11699 /***/ }),
11700
11701 /***/ "../node_modules/@babel/runtime/helpers/esm/objectSpread2.js":
11702 /*!*******************************************************************!*\
11703 !*** ../node_modules/@babel/runtime/helpers/esm/objectSpread2.js ***!
11704 \*******************************************************************/
11705 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
11706
11707 "use strict";
11708 __webpack_require__.r(__webpack_exports__);
11709 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
11710 /* harmony export */ "default": () => (/* binding */ _objectSpread2)
11711 /* harmony export */ });
11712 /* harmony import */ var _defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defineProperty.js */ "../node_modules/@babel/runtime/helpers/esm/defineProperty.js");
11713
11714 function ownKeys(object, enumerableOnly) {
11715 var keys = Object.keys(object);
11716 if (Object.getOwnPropertySymbols) {
11717 var symbols = Object.getOwnPropertySymbols(object);
11718 enumerableOnly && (symbols = symbols.filter(function (sym) {
11719 return Object.getOwnPropertyDescriptor(object, sym).enumerable;
11720 })), keys.push.apply(keys, symbols);
11721 }
11722 return keys;
11723 }
11724 function _objectSpread2(target) {
11725 for (var i = 1; i < arguments.length; i++) {
11726 var source = null != arguments[i] ? arguments[i] : {};
11727 i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
11728 (0,_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(target, key, source[key]);
11729 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
11730 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
11731 });
11732 }
11733 return target;
11734 }
11735
11736 /***/ }),
11737
11738 /***/ "../node_modules/@babel/runtime/helpers/esm/toPrimitive.js":
11739 /*!*****************************************************************!*\
11740 !*** ../node_modules/@babel/runtime/helpers/esm/toPrimitive.js ***!
11741 \*****************************************************************/
11742 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
11743
11744 "use strict";
11745 __webpack_require__.r(__webpack_exports__);
11746 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
11747 /* harmony export */ "default": () => (/* binding */ _toPrimitive)
11748 /* harmony export */ });
11749 /* harmony import */ var _typeof_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/esm/typeof.js");
11750
11751 function _toPrimitive(input, hint) {
11752 if ((0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__["default"])(input) !== "object" || input === null) return input;
11753 var prim = input[Symbol.toPrimitive];
11754 if (prim !== undefined) {
11755 var res = prim.call(input, hint || "default");
11756 if ((0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__["default"])(res) !== "object") return res;
11757 throw new TypeError("@@toPrimitive must return a primitive value.");
11758 }
11759 return (hint === "string" ? String : Number)(input);
11760 }
11761
11762 /***/ }),
11763
11764 /***/ "../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js":
11765 /*!*******************************************************************!*\
11766 !*** ../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js ***!
11767 \*******************************************************************/
11768 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
11769
11770 "use strict";
11771 __webpack_require__.r(__webpack_exports__);
11772 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
11773 /* harmony export */ "default": () => (/* binding */ _toPropertyKey)
11774 /* harmony export */ });
11775 /* harmony import */ var _typeof_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/esm/typeof.js");
11776 /* harmony import */ var _toPrimitive_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toPrimitive.js */ "../node_modules/@babel/runtime/helpers/esm/toPrimitive.js");
11777
11778
11779 function _toPropertyKey(arg) {
11780 var key = (0,_toPrimitive_js__WEBPACK_IMPORTED_MODULE_1__["default"])(arg, "string");
11781 return (0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__["default"])(key) === "symbol" ? key : String(key);
11782 }
11783
11784 /***/ }),
11785
11786 /***/ "../node_modules/@babel/runtime/helpers/esm/typeof.js":
11787 /*!************************************************************!*\
11788 !*** ../node_modules/@babel/runtime/helpers/esm/typeof.js ***!
11789 \************************************************************/
11790 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
11791
11792 "use strict";
11793 __webpack_require__.r(__webpack_exports__);
11794 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
11795 /* harmony export */ "default": () => (/* binding */ _typeof)
11796 /* harmony export */ });
11797 function _typeof(obj) {
11798 "@babel/helpers - typeof";
11799
11800 return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
11801 return typeof obj;
11802 } : function (obj) {
11803 return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
11804 }, _typeof(obj);
11805 }
11806
11807 /***/ }),
11808
11809 /***/ "../node_modules/@reduxjs/toolkit/node_modules/immer/dist/immer.esm.mjs":
11810 /*!******************************************************************************!*\
11811 !*** ../node_modules/@reduxjs/toolkit/node_modules/immer/dist/immer.esm.mjs ***!
11812 \******************************************************************************/
11813 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
11814
11815 "use strict";
11816 __webpack_require__.r(__webpack_exports__);
11817 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
11818 /* harmony export */ Immer: () => (/* binding */ un),
11819 /* harmony export */ applyPatches: () => (/* binding */ pn),
11820 /* harmony export */ castDraft: () => (/* binding */ K),
11821 /* harmony export */ castImmutable: () => (/* binding */ $),
11822 /* harmony export */ createDraft: () => (/* binding */ ln),
11823 /* harmony export */ current: () => (/* binding */ R),
11824 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
11825 /* harmony export */ enableAllPlugins: () => (/* binding */ J),
11826 /* harmony export */ enableES5: () => (/* binding */ F),
11827 /* harmony export */ enableMapSet: () => (/* binding */ C),
11828 /* harmony export */ enablePatches: () => (/* binding */ T),
11829 /* harmony export */ finishDraft: () => (/* binding */ dn),
11830 /* harmony export */ freeze: () => (/* binding */ d),
11831 /* harmony export */ immerable: () => (/* binding */ L),
11832 /* harmony export */ isDraft: () => (/* binding */ r),
11833 /* harmony export */ isDraftable: () => (/* binding */ t),
11834 /* harmony export */ nothing: () => (/* binding */ H),
11835 /* harmony export */ original: () => (/* binding */ e),
11836 /* harmony export */ produce: () => (/* binding */ fn),
11837 /* harmony export */ produceWithPatches: () => (/* binding */ cn),
11838 /* harmony export */ setAutoFreeze: () => (/* binding */ sn),
11839 /* harmony export */ setUseProxies: () => (/* binding */ vn)
11840 /* harmony export */ });
11841 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)}throw Error("[Immer] minified error nr: "+n+(t.length?" "+t.map((function(n){return"'"+n+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}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);
11842 //# sourceMappingURL=immer.esm.js.map
11843
11844
11845 /***/ })
11846
11847 /******/ });
11848 /************************************************************************/
11849 /******/ // The module cache
11850 /******/ var __webpack_module_cache__ = {};
11851 /******/
11852 /******/ // The require function
11853 /******/ function __webpack_require__(moduleId) {
11854 /******/ // Check if module is in cache
11855 /******/ var cachedModule = __webpack_module_cache__[moduleId];
11856 /******/ if (cachedModule !== undefined) {
11857 /******/ return cachedModule.exports;
11858 /******/ }
11859 /******/ // Create a new module (and put it into the cache)
11860 /******/ var module = __webpack_module_cache__[moduleId] = {
11861 /******/ // no module.id needed
11862 /******/ // no module.loaded needed
11863 /******/ exports: {}
11864 /******/ };
11865 /******/
11866 /******/ // Execute the module function
11867 /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
11868 /******/
11869 /******/ // Return the exports of the module
11870 /******/ return module.exports;
11871 /******/ }
11872 /******/
11873 /************************************************************************/
11874 /******/ /* webpack/runtime/define property getters */
11875 /******/ (() => {
11876 /******/ // define getter functions for harmony exports
11877 /******/ __webpack_require__.d = (exports, definition) => {
11878 /******/ for(var key in definition) {
11879 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
11880 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
11881 /******/ }
11882 /******/ }
11883 /******/ };
11884 /******/ })();
11885 /******/
11886 /******/ /* webpack/runtime/global */
11887 /******/ (() => {
11888 /******/ __webpack_require__.g = (function() {
11889 /******/ if (typeof globalThis === 'object') return globalThis;
11890 /******/ try {
11891 /******/ return this || new Function('return this')();
11892 /******/ } catch (e) {
11893 /******/ if (typeof window === 'object') return window;
11894 /******/ }
11895 /******/ })();
11896 /******/ })();
11897 /******/
11898 /******/ /* webpack/runtime/hasOwnProperty shorthand */
11899 /******/ (() => {
11900 /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
11901 /******/ })();
11902 /******/
11903 /******/ /* webpack/runtime/make namespace object */
11904 /******/ (() => {
11905 /******/ // define __esModule on exports
11906 /******/ __webpack_require__.r = (exports) => {
11907 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
11908 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
11909 /******/ }
11910 /******/ Object.defineProperty(exports, '__esModule', { value: true });
11911 /******/ };
11912 /******/ })();
11913 /******/
11914 /************************************************************************/
11915 var __webpack_exports__ = {};
11916 // This entry need to be wrapped in an IIFE because it need to be in strict mode.
11917 (() => {
11918 "use strict";
11919 /*!*********************************************!*\
11920 !*** ../modules/web-cli/assets/js/index.js ***!
11921 \*********************************************/
11922
11923
11924 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
11925 var _api = _interopRequireDefault(__webpack_require__(/*! ./api */ "../modules/web-cli/assets/js/api.js"));
11926 window.$e = new _api.default();
11927 })();
11928
11929 /******/ })()
11930 ;
11931 //# sourceMappingURL=web-cli.js.map