| @@ -1,7 +1,2071 @@ | ||
| 1 | 1 | /******/ (() => { // webpackBootstrap |
| 2 | 2 | /******/ var __webpack_modules__ = ({ |
| 3 | 3 | |
| 4 | +/***/ "../app/assets/js/event-track/apps-event-tracking.js": | |
| 5 | +/*!***********************************************************!*\ | |
| 6 | + !*** ../app/assets/js/event-track/apps-event-tracking.js ***! | |
| 7 | + \***********************************************************/ | |
| 8 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 9 | + | |
| 10 | +"use strict"; | |
| 11 | + | |
| 12 | + | |
| 13 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 14 | +Object.defineProperty(exports, "__esModule", ({ | |
| 15 | + value: true | |
| 16 | +})); | |
| 17 | +exports.appsEventTrackingDispatch = exports.AppsEventTracking = void 0; | |
| 18 | +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 19 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 20 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 21 | +var _eventsConfig = _interopRequireDefault(__webpack_require__(/*! ../../../../core/common/modules/events-manager/assets/js/events-config */ "../core/common/modules/events-manager/assets/js/events-config.js")); | |
| 22 | +function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } | |
| 23 | +function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } | |
| 24 | +function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; } | |
| 25 | +function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } | |
| 26 | +function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } | |
| 27 | +var EVENTS_MAP = { | |
| 28 | + PAGE_VIEWS_WEBSITE_TEMPLATES: 'page_views_website_templates', | |
| 29 | + KITS_CLOUD_UPGRADE_CLICKED: 'kits_cloud_upgrade_clicked', | |
| 30 | + EXPORT_KIT_CUSTOMIZATION: 'export_kit_customization', | |
| 31 | + IMPORT_KIT_CUSTOMIZATION: 'import_kit_customization', | |
| 32 | + KIT_IMPORT_STATUS: 'kit_import_status', | |
| 33 | + KIT_CLOUD_LIBRARY_APPLY: 'kit_cloud_library_apply', | |
| 34 | + KIT_CLOUD_LIBRARY_DELETE: 'kit_cloud_library_delete', | |
| 35 | + IMPORT_EXPORT_ADMIN_ACTION: 'ie_admin_action', | |
| 36 | + KIT_IMPORT_UPLOAD_FILE: 'kit_import_upload_file' | |
| 37 | +}; | |
| 38 | +var appsEventTrackingDispatch = exports.appsEventTrackingDispatch = function appsEventTrackingDispatch(command, eventParams) { | |
| 39 | + // Add existing eventParams key value pair to the data/details object. | |
| 40 | + var objectCreator = function objectCreator(array, obj) { | |
| 41 | + var _iterator = _createForOfIteratorHelper(array), | |
| 42 | + _step; | |
| 43 | + try { | |
| 44 | + for (_iterator.s(); !(_step = _iterator.n()).done;) { | |
| 45 | + var key = _step.value; | |
| 46 | + if (eventParams.hasOwnProperty(key) && eventParams[key] !== null) { | |
| 47 | + obj[key] = eventParams[key]; | |
| 48 | + } | |
| 49 | + } | |
| 50 | + } catch (err) { | |
| 51 | + _iterator.e(err); | |
| 52 | + } finally { | |
| 53 | + _iterator.f(); | |
| 54 | + } | |
| 55 | + return obj; | |
| 56 | + }; | |
| 57 | + var dataKeys = []; | |
| 58 | + var detailsKeys = ['layout', 'site_part', 'error', 'document_name', 'document_type', 'view_type_clicked', 'tag', 'sort_direction', 'sort_type', 'action', 'grid_location', 'kit_name', 'page_source', 'element_position', 'element', 'event_type', 'modal_type', 'method', 'status', 'step', 'item', 'category', 'element_location', 'search_term', 'section', 'site_area']; | |
| 59 | + var data = {}; | |
| 60 | + var details = {}; | |
| 61 | + var init = function init() { | |
| 62 | + objectCreator(detailsKeys, details); | |
| 63 | + objectCreator(dataKeys, data); | |
| 64 | + var commandSplit = command.split('/'); | |
| 65 | + data.placement = commandSplit[0]; | |
| 66 | + data.event = commandSplit[1]; | |
| 67 | + | |
| 68 | + // If 'details' is not empty, add the details object to the data object. | |
| 69 | + if (Object.keys(details).length) { | |
| 70 | + data.details = details; | |
| 71 | + } | |
| 72 | + }; | |
| 73 | + init(); | |
| 74 | + $e.run(command, data); | |
| 75 | +}; | |
| 76 | +var AppsEventTracking = exports.AppsEventTracking = /*#__PURE__*/function () { | |
| 77 | + function AppsEventTracking() { | |
| 78 | + (0, _classCallCheck2.default)(this, AppsEventTracking); | |
| 79 | + } | |
| 80 | + return (0, _createClass2.default)(AppsEventTracking, null, [{ | |
| 81 | + key: "dispatchEvent", | |
| 82 | + value: function dispatchEvent(eventName, payload) { | |
| 83 | + return elementorCommon.eventsManager.dispatchEvent(eventName, payload); | |
| 84 | + } | |
| 85 | + }, { | |
| 86 | + key: "sendPageViewsWebsiteTemplates", | |
| 87 | + value: function sendPageViewsWebsiteTemplates(page) { | |
| 88 | + return this.dispatchEvent(EVENTS_MAP.PAGE_VIEWS_WEBSITE_TEMPLATES, { | |
| 89 | + trigger: _eventsConfig.default.triggers.pageLoaded, | |
| 90 | + page_loaded: page, | |
| 91 | + secondary_location: page | |
| 92 | + }); | |
| 93 | + } | |
| 94 | + }, { | |
| 95 | + key: "sendKitsCloudUpgradeClicked", | |
| 96 | + value: function sendKitsCloudUpgradeClicked(upgradeLocation) { | |
| 97 | + return this.dispatchEvent(EVENTS_MAP.KITS_CLOUD_UPGRADE_CLICKED, { | |
| 98 | + trigger: _eventsConfig.default.triggers.click, | |
| 99 | + secondary_location: upgradeLocation, | |
| 100 | + upgrade_location: upgradeLocation | |
| 101 | + }); | |
| 102 | + } | |
| 103 | + }, { | |
| 104 | + key: "sendExportKitCustomization", | |
| 105 | + value: function sendExportKitCustomization(payload) { | |
| 106 | + return this.dispatchEvent(EVENTS_MAP.EXPORT_KIT_CUSTOMIZATION, _objectSpread({ | |
| 107 | + trigger: _eventsConfig.default.triggers.click | |
| 108 | + }, payload)); | |
| 109 | + } | |
| 110 | + }, { | |
| 111 | + key: "sendImportKitCustomization", | |
| 112 | + value: function sendImportKitCustomization(payload) { | |
| 113 | + return this.dispatchEvent(EVENTS_MAP.IMPORT_KIT_CUSTOMIZATION, _objectSpread({ | |
| 114 | + trigger: _eventsConfig.default.triggers.click | |
| 115 | + }, payload)); | |
| 116 | + } | |
| 117 | + }, { | |
| 118 | + key: "sendKitImportStatus", | |
| 119 | + value: function sendKitImportStatus() { | |
| 120 | + var error = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; | |
| 121 | + var isError = !!error; | |
| 122 | + return this.dispatchEvent(EVENTS_MAP.KIT_IMPORT_STATUS, _objectSpread({ | |
| 123 | + kit_import_status: !isError | |
| 124 | + }, isError && { | |
| 125 | + kit_import_error: error.message | |
| 126 | + })); | |
| 127 | + } | |
| 128 | + }, { | |
| 129 | + key: "sendKitCloudLibraryApply", | |
| 130 | + value: function sendKitCloudLibraryApply(kitId, kitApplyUrl) { | |
| 131 | + return this.dispatchEvent(EVENTS_MAP.KIT_CLOUD_LIBRARY_APPLY, _objectSpread({ | |
| 132 | + trigger: _eventsConfig.default.triggers.click, | |
| 133 | + kit_cloud_id: kitId | |
| 134 | + }, kitApplyUrl && { | |
| 135 | + kit_apply_url: kitApplyUrl | |
| 136 | + })); | |
| 137 | + } | |
| 138 | + }, { | |
| 139 | + key: "sendKitCloudLibraryDelete", | |
| 140 | + value: function sendKitCloudLibraryDelete() { | |
| 141 | + return this.dispatchEvent(EVENTS_MAP.KIT_CLOUD_LIBRARY_DELETE, { | |
| 142 | + trigger: _eventsConfig.default.triggers.click | |
| 143 | + }); | |
| 144 | + } | |
| 145 | + }, { | |
| 146 | + key: "sendImportExportAdminAction", | |
| 147 | + value: function sendImportExportAdminAction(actionType) { | |
| 148 | + return this.dispatchEvent(EVENTS_MAP.IMPORT_EXPORT_ADMIN_ACTION, { | |
| 149 | + trigger: _eventsConfig.default.triggers.click, | |
| 150 | + action_type: actionType | |
| 151 | + }); | |
| 152 | + } | |
| 153 | + }, { | |
| 154 | + key: "sendKitImportUploadFile", | |
| 155 | + value: function sendKitImportUploadFile(status) { | |
| 156 | + return this.dispatchEvent(EVENTS_MAP.KIT_IMPORT_UPLOAD_FILE, { | |
| 157 | + kit_import_upload_file_status: status | |
| 158 | + }); | |
| 159 | + } | |
| 160 | + }]); | |
| 161 | +}(); | |
| 162 | + | |
| 163 | +/***/ }), | |
| 164 | + | |
| 165 | +/***/ "../app/assets/js/event-track/dashboard/action-controls.js": | |
| 166 | +/*!*****************************************************************!*\ | |
| 167 | + !*** ../app/assets/js/event-track/dashboard/action-controls.js ***! | |
| 168 | + \*****************************************************************/ | |
| 169 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 170 | + | |
| 171 | +"use strict"; | |
| 172 | + | |
| 173 | + | |
| 174 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 175 | +var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); | |
| 176 | +Object.defineProperty(exports, "__esModule", ({ | |
| 177 | + value: true | |
| 178 | +})); | |
| 179 | +exports["default"] = void 0; | |
| 180 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 181 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 182 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 183 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 184 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 185 | +var _wpDashboardTracking = _interopRequireWildcard(__webpack_require__(/*! ../wp-dashboard-tracking */ "../app/assets/js/event-track/wp-dashboard-tracking.js")); | |
| 186 | +var _utils = __webpack_require__(/*! ./utils */ "../app/assets/js/event-track/dashboard/utils.js"); | |
| 187 | +var _baseTracking = _interopRequireDefault(__webpack_require__(/*! ./base-tracking */ "../app/assets/js/event-track/dashboard/base-tracking.js")); | |
| 188 | +function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); } | |
| 189 | +function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; } | |
| 190 | +function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } | |
| 191 | +function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } | |
| 192 | +function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } | |
| 193 | +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 194 | +var EXCLUDED_SELECTORS = { | |
| 195 | + ADMIN_MENU: '#adminmenu', | |
| 196 | + TOP_BAR: '.e-admin-top-bar', | |
| 197 | + TOP_BAR_EDITOR_ONE: '#editor-one-top-bar', | |
| 198 | + WP_ADMIN_BAR: '#wpadminbar', | |
| 199 | + SUBMENU: '.wp-submenu', | |
| 200 | + PROMO_PAGE: '.e-feature-promotion', | |
| 201 | + PROMO_BLANK_STATE: '.elementor-blank_state', | |
| 202 | + APP: '.e-app', | |
| 203 | + SIDEBAR_NAVIGATION: '#editor-one-sidebar-navigation', | |
| 204 | + FLYOUT_MENU: '.elementor-submenu-flyout' | |
| 205 | +}; | |
| 206 | +var ActionControlTracking = /*#__PURE__*/function (_BaseTracking) { | |
| 207 | + function ActionControlTracking() { | |
| 208 | + (0, _classCallCheck2.default)(this, ActionControlTracking); | |
| 209 | + return _callSuper(this, ActionControlTracking, arguments); | |
| 210 | + } | |
| 211 | + (0, _inherits2.default)(ActionControlTracking, _BaseTracking); | |
| 212 | + return (0, _createClass2.default)(ActionControlTracking, null, [{ | |
| 213 | + key: "init", | |
| 214 | + value: function init() { | |
| 215 | + if (!_utils.DashboardUtils.isElementorPage()) { | |
| 216 | + return; | |
| 217 | + } | |
| 218 | + this.attachDelegatedHandlers(); | |
| 219 | + this.addTrackingAttributesToFilterButtons(); | |
| 220 | + this.initializeLinkDataIds(); | |
| 221 | + } | |
| 222 | + }, { | |
| 223 | + key: "initializeLinkDataIds", | |
| 224 | + value: function initializeLinkDataIds() { | |
| 225 | + var _this = this; | |
| 226 | + var initializeLinks = function initializeLinks() { | |
| 227 | + var links = document.querySelectorAll('a[href]'); | |
| 228 | + links.forEach(function (link) { | |
| 229 | + if (_this.isExcludedElement(link) || _this.isNavigationLink(link) || link.hasAttribute('data-id')) { | |
| 230 | + return; | |
| 231 | + } | |
| 232 | + var href = link.getAttribute('href'); | |
| 233 | + if (!href) { | |
| 234 | + return; | |
| 235 | + } | |
| 236 | + var cleanedHref = _this.removeNonceFromUrl(href); | |
| 237 | + if (cleanedHref) { | |
| 238 | + link.setAttribute('data-id', cleanedHref); | |
| 239 | + } | |
| 240 | + }); | |
| 241 | + }; | |
| 242 | + if ('loading' === document.readyState) { | |
| 243 | + document.addEventListener('DOMContentLoaded', initializeLinks); | |
| 244 | + } else { | |
| 245 | + initializeLinks(); | |
| 246 | + } | |
| 247 | + } | |
| 248 | + }, { | |
| 249 | + key: "addTrackingAttributesToFilterButtons", | |
| 250 | + value: function addTrackingAttributesToFilterButtons() { | |
| 251 | + var body = document.body; | |
| 252 | + if (!body) { | |
| 253 | + return; | |
| 254 | + } | |
| 255 | + var screenPrefix = ''; | |
| 256 | + switch (true) { | |
| 257 | + case body.classList.contains('post-type-elementor_library'): | |
| 258 | + screenPrefix = 'elementor_library-library'; | |
| 259 | + break; | |
| 260 | + case body.classList.contains('post-type-e-floating-buttons'): | |
| 261 | + screenPrefix = 'e-floating-buttons'; | |
| 262 | + break; | |
| 263 | + default: | |
| 264 | + return; | |
| 265 | + } | |
| 266 | + var addDataIdToListTableButtons = function addDataIdToListTableButtons() { | |
| 267 | + var buttonConfigs = [{ | |
| 268 | + id: 'post-query-submit', | |
| 269 | + suffix: 'filter' | |
| 270 | + }, { | |
| 271 | + id: 'search-submit', | |
| 272 | + suffix: 'search' | |
| 273 | + }, { | |
| 274 | + id: 'doaction', | |
| 275 | + suffix: 'apply' | |
| 276 | + }, { | |
| 277 | + id: 'doaction2', | |
| 278 | + suffix: 'apply-bottom' | |
| 279 | + }]; | |
| 280 | + buttonConfigs.forEach(function (config) { | |
| 281 | + var button = document.getElementById(config.id); | |
| 282 | + if (!button || button.hasAttribute('data-id')) { | |
| 283 | + return; | |
| 284 | + } | |
| 285 | + button.setAttribute('data-id', "".concat(screenPrefix, "-button-").concat(config.suffix)); | |
| 286 | + }); | |
| 287 | + }; | |
| 288 | + if ('loading' === document.readyState) { | |
| 289 | + document.addEventListener('DOMContentLoaded', addDataIdToListTableButtons); | |
| 290 | + } else { | |
| 291 | + addDataIdToListTableButtons(); | |
| 292 | + } | |
| 293 | + } | |
| 294 | + }, { | |
| 295 | + key: "isExcludedElement", | |
| 296 | + value: function isExcludedElement(element) { | |
| 297 | + for (var _i = 0, _Object$values = Object.values(EXCLUDED_SELECTORS); _i < _Object$values.length; _i++) { | |
| 298 | + var selector = _Object$values[_i]; | |
| 299 | + if (element.closest(selector)) { | |
| 300 | + return true; | |
| 301 | + } | |
| 302 | + } | |
| 303 | + if (element.classList.contains('go-pro')) { | |
| 304 | + return true; | |
| 305 | + } | |
| 306 | + return false; | |
| 307 | + } | |
| 308 | + }, { | |
| 309 | + key: "attachDelegatedHandlers", | |
| 310 | + value: function attachDelegatedHandlers() { | |
| 311 | + var _this2 = this; | |
| 312 | + var FILTER_BUTTON_IDS = ['search-submit', 'post-query-submit']; | |
| 313 | + this.addEventListenerTracked(document, 'click', function (event) { | |
| 314 | + var _event$target; | |
| 315 | + var base = event.target && 1 === event.target.nodeType ? event.target : (_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.parentElement; | |
| 316 | + if (!base) { | |
| 317 | + return; | |
| 318 | + } | |
| 319 | + var toggle = base.closest('.elementor-role-toggle'); | |
| 320 | + if (toggle && !_this2.isExcludedElement(toggle)) { | |
| 321 | + _this2.trackControl(toggle, _wpDashboardTracking.CONTROL_TYPES.TOGGLE); | |
| 322 | + return; | |
| 323 | + } | |
| 324 | + var button = base.closest('button, input[type="submit"], input[type="button"], .button, .e-btn'); | |
| 325 | + if (button && !_this2.isExcludedElement(button)) { | |
| 326 | + if (FILTER_BUTTON_IDS.includes(button.id)) { | |
| 327 | + _this2.trackControl(button, _wpDashboardTracking.CONTROL_TYPES.FILTER); | |
| 328 | + return; | |
| 329 | + } | |
| 330 | + _this2.trackControl(button, _wpDashboardTracking.CONTROL_TYPES.BUTTON); | |
| 331 | + return; | |
| 332 | + } | |
| 333 | + var link = base.closest('a'); | |
| 334 | + if (link && !_this2.isExcludedElement(link) && !_this2.isNavigationLink(link)) { | |
| 335 | + _this2.trackControl(link, _wpDashboardTracking.CONTROL_TYPES.LINK); | |
| 336 | + } | |
| 337 | + }, { | |
| 338 | + capture: false | |
| 339 | + }); | |
| 340 | + this.addEventListenerTracked(document, 'change', function (event) { | |
| 341 | + var _event$target2; | |
| 342 | + var base = event.target && 1 === event.target.nodeType ? event.target : (_event$target2 = event.target) === null || _event$target2 === void 0 ? void 0 : _event$target2.parentElement; | |
| 343 | + if (!base) { | |
| 344 | + return; | |
| 345 | + } | |
| 346 | + var toggle = null; | |
| 347 | + if (_wpDashboardTracking.default.isEditorOneActive()) { | |
| 348 | + toggle = base.closest('.MuiSwitch-switchBase'); | |
| 349 | + } else { | |
| 350 | + toggle = base.closest('.components-toggle-control'); | |
| 351 | + } | |
| 352 | + if (toggle && !_this2.isExcludedElement(toggle)) { | |
| 353 | + _this2.trackControl(toggle, _wpDashboardTracking.CONTROL_TYPES.TOGGLE); | |
| 354 | + return; | |
| 355 | + } | |
| 356 | + var checkbox = base.closest('input[type="checkbox"]'); | |
| 357 | + if (checkbox && !_this2.isExcludedElement(checkbox)) { | |
| 358 | + _this2.trackControl(checkbox, _wpDashboardTracking.CONTROL_TYPES.CHECKBOX); | |
| 359 | + return; | |
| 360 | + } | |
| 361 | + var radio = base.closest('input[type="radio"]'); | |
| 362 | + if (radio && !_this2.isExcludedElement(radio)) { | |
| 363 | + _this2.trackControl(radio, _wpDashboardTracking.CONTROL_TYPES.RADIO); | |
| 364 | + return; | |
| 365 | + } | |
| 366 | + var select = base.closest('select'); | |
| 367 | + if (select && !_this2.isExcludedElement(select)) { | |
| 368 | + _this2.trackControl(select, _wpDashboardTracking.CONTROL_TYPES.SELECT); | |
| 369 | + } | |
| 370 | + }); | |
| 371 | + } | |
| 372 | + }, { | |
| 373 | + key: "isNavigationLink", | |
| 374 | + value: function isNavigationLink(link) { | |
| 375 | + var href = link.getAttribute('href'); | |
| 376 | + if (!href) { | |
| 377 | + return false; | |
| 378 | + } | |
| 379 | + if (href.startsWith('#') && href.includes('tab')) { | |
| 380 | + return true; | |
| 381 | + } | |
| 382 | + if (link.classList.contains('nav-tab')) { | |
| 383 | + return true; | |
| 384 | + } | |
| 385 | + var isInNavigation = link.closest('.wp-submenu, #adminmenu, .e-admin-top-bar, #wpadminbar'); | |
| 386 | + return !!isInNavigation; | |
| 387 | + } | |
| 388 | + }, { | |
| 389 | + key: "trackControl", | |
| 390 | + value: function trackControl(element, controlType) { | |
| 391 | + var controlIdentifier = this.extractControlIdentifier(element, controlType); | |
| 392 | + if (!controlIdentifier) { | |
| 393 | + return; | |
| 394 | + } | |
| 395 | + _wpDashboardTracking.default.trackActionControl(controlIdentifier, controlType); | |
| 396 | + } | |
| 397 | + }, { | |
| 398 | + key: "extractControlIdentifier", | |
| 399 | + value: function extractControlIdentifier(element, controlType) { | |
| 400 | + if (_wpDashboardTracking.CONTROL_TYPES.RADIO === controlType) { | |
| 401 | + var name = element.getAttribute('name'); | |
| 402 | + var value = element.value || element.getAttribute('value'); | |
| 403 | + if (name && value) { | |
| 404 | + return "".concat(name, "-").concat(value); | |
| 405 | + } | |
| 406 | + if (name) { | |
| 407 | + return name; | |
| 408 | + } | |
| 409 | + } | |
| 410 | + if (_wpDashboardTracking.CONTROL_TYPES.SELECT === controlType) { | |
| 411 | + var _name = element.getAttribute('name'); | |
| 412 | + if (_name) { | |
| 413 | + return _name; | |
| 414 | + } | |
| 415 | + } | |
| 416 | + if (_wpDashboardTracking.CONTROL_TYPES.CHECKBOX === controlType) { | |
| 417 | + var _name2 = element.getAttribute('name'); | |
| 418 | + if (_name2) { | |
| 419 | + var checkboxesWithSameName = document.querySelectorAll("input[type=\"checkbox\"][name=\"".concat(CSS.escape(_name2), "\"]")); | |
| 420 | + if (checkboxesWithSameName.length > 1) { | |
| 421 | + var _value = element.value || element.getAttribute('value'); | |
| 422 | + if (_value) { | |
| 423 | + return "".concat(_name2, "-").concat(_value); | |
| 424 | + } | |
| 425 | + } | |
| 426 | + return _name2; | |
| 427 | + } | |
| 428 | + } | |
| 429 | + if (_wpDashboardTracking.CONTROL_TYPES.LINK === controlType) { | |
| 430 | + var dataId = element.getAttribute('data-id'); | |
| 431 | + if (dataId) { | |
| 432 | + return dataId; | |
| 433 | + } | |
| 434 | + var href = element.getAttribute('href'); | |
| 435 | + if (href) { | |
| 436 | + return this.removeNonceFromUrl(href); | |
| 437 | + } | |
| 438 | + } | |
| 439 | + if (_wpDashboardTracking.CONTROL_TYPES.BUTTON === controlType || _wpDashboardTracking.CONTROL_TYPES.TOGGLE === controlType || _wpDashboardTracking.CONTROL_TYPES.FILTER === controlType) { | |
| 440 | + var _dataId = element.getAttribute('data-id'); | |
| 441 | + if (_dataId) { | |
| 442 | + return _dataId; | |
| 443 | + } | |
| 444 | + var classIdMatch = this.extractClassId(element); | |
| 445 | + if (classIdMatch) { | |
| 446 | + return classIdMatch; | |
| 447 | + } | |
| 448 | + } | |
| 449 | + return ''; | |
| 450 | + } | |
| 451 | + }, { | |
| 452 | + key: "extractClassId", | |
| 453 | + value: function extractClassId(element) { | |
| 454 | + var classes = element.className; | |
| 455 | + if (!classes || 'string' !== typeof classes) { | |
| 456 | + return ''; | |
| 457 | + } | |
| 458 | + var classList = classes.split(' '); | |
| 459 | + var _iterator = _createForOfIteratorHelper(classList), | |
| 460 | + _step; | |
| 461 | + try { | |
| 462 | + for (_iterator.s(); !(_step = _iterator.n()).done;) { | |
| 463 | + var cls = _step.value; | |
| 464 | + if (cls.startsWith('e-id-')) { | |
| 465 | + return cls.substring(5); | |
| 466 | + } | |
| 467 | + } | |
| 468 | + } catch (err) { | |
| 469 | + _iterator.e(err); | |
| 470 | + } finally { | |
| 471 | + _iterator.f(); | |
| 472 | + } | |
| 473 | + return ''; | |
| 474 | + } | |
| 475 | + }, { | |
| 476 | + key: "removeNonceFromUrl", | |
| 477 | + value: function removeNonceFromUrl(url) { | |
| 478 | + try { | |
| 479 | + var urlObj = new URL(url, window.location.origin); | |
| 480 | + urlObj.searchParams.delete('_wpnonce'); | |
| 481 | + var postParam = urlObj.searchParams.get('post'); | |
| 482 | + if (postParam !== null && /^[0-9]+$/.test(postParam)) { | |
| 483 | + urlObj.searchParams.delete('post'); | |
| 484 | + } | |
| 485 | + return urlObj.pathname + urlObj.search + urlObj.hash; | |
| 486 | + } catch (e) { | |
| 487 | + return url; | |
| 488 | + } | |
| 489 | + } | |
| 490 | + }]); | |
| 491 | +}(_baseTracking.default); | |
| 492 | +var _default = exports["default"] = ActionControlTracking; | |
| 493 | + | |
| 494 | +/***/ }), | |
| 495 | + | |
| 496 | +/***/ "../app/assets/js/event-track/dashboard/base-tracking.js": | |
| 497 | +/*!***************************************************************!*\ | |
| 498 | + !*** ../app/assets/js/event-track/dashboard/base-tracking.js ***! | |
| 499 | + \***************************************************************/ | |
| 500 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 501 | + | |
| 502 | +"use strict"; | |
| 503 | + | |
| 504 | + | |
| 505 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 506 | +Object.defineProperty(exports, "__esModule", ({ | |
| 507 | + value: true | |
| 508 | +})); | |
| 509 | +exports["default"] = void 0; | |
| 510 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 511 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 512 | +var BaseTracking = /*#__PURE__*/function () { | |
| 513 | + function BaseTracking() { | |
| 514 | + (0, _classCallCheck2.default)(this, BaseTracking); | |
| 515 | + } | |
| 516 | + return (0, _createClass2.default)(BaseTracking, null, [{ | |
| 517 | + key: "ensureOwnArrays", | |
| 518 | + value: function ensureOwnArrays() { | |
| 519 | + if (!Object.prototype.hasOwnProperty.call(this, 'observers')) { | |
| 520 | + this.observers = []; | |
| 521 | + } | |
| 522 | + if (!Object.prototype.hasOwnProperty.call(this, 'eventListeners')) { | |
| 523 | + this.eventListeners = []; | |
| 524 | + } | |
| 525 | + } | |
| 526 | + }, { | |
| 527 | + key: "destroy", | |
| 528 | + value: function destroy() { | |
| 529 | + this.ensureOwnArrays(); | |
| 530 | + this.observers.forEach(function (observer) { | |
| 531 | + return observer.disconnect(); | |
| 532 | + }); | |
| 533 | + this.observers = []; | |
| 534 | + this.eventListeners.forEach(function (_ref) { | |
| 535 | + var target = _ref.target, | |
| 536 | + type = _ref.type, | |
| 537 | + handler = _ref.handler, | |
| 538 | + options = _ref.options; | |
| 539 | + target.removeEventListener(type, handler, options); | |
| 540 | + }); | |
| 541 | + this.eventListeners = []; | |
| 542 | + } | |
| 543 | + }, { | |
| 544 | + key: "addObserver", | |
| 545 | + value: function addObserver(target, options, callback) { | |
| 546 | + this.ensureOwnArrays(); | |
| 547 | + var observer = new MutationObserver(callback); | |
| 548 | + observer.observe(target, options); | |
| 549 | + this.observers.push(observer); | |
| 550 | + return observer; | |
| 551 | + } | |
| 552 | + }, { | |
| 553 | + key: "addEventListenerTracked", | |
| 554 | + value: function addEventListenerTracked(target, type, handler) { | |
| 555 | + var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; | |
| 556 | + this.ensureOwnArrays(); | |
| 557 | + target.addEventListener(type, handler, options); | |
| 558 | + this.eventListeners.push({ | |
| 559 | + target: target, | |
| 560 | + type: type, | |
| 561 | + handler: handler, | |
| 562 | + options: options | |
| 563 | + }); | |
| 564 | + } | |
| 565 | + }]); | |
| 566 | +}(); | |
| 567 | +var _default = exports["default"] = BaseTracking; | |
| 568 | + | |
| 569 | +/***/ }), | |
| 570 | + | |
| 571 | +/***/ "../app/assets/js/event-track/dashboard/menu-promotion.js": | |
| 572 | +/*!****************************************************************!*\ | |
| 573 | + !*** ../app/assets/js/event-track/dashboard/menu-promotion.js ***! | |
| 574 | + \****************************************************************/ | |
| 575 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 576 | + | |
| 577 | +"use strict"; | |
| 578 | + | |
| 579 | + | |
| 580 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 581 | +Object.defineProperty(exports, "__esModule", ({ | |
| 582 | + value: true | |
| 583 | +})); | |
| 584 | +exports["default"] = void 0; | |
| 585 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 586 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 587 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 588 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 589 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 590 | +var _wpDashboardTracking = _interopRequireDefault(__webpack_require__(/*! ../wp-dashboard-tracking */ "../app/assets/js/event-track/wp-dashboard-tracking.js")); | |
| 591 | +var _baseTracking = _interopRequireDefault(__webpack_require__(/*! ./base-tracking */ "../app/assets/js/event-track/dashboard/base-tracking.js")); | |
| 592 | +function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } | |
| 593 | +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 594 | +var PROMO_MENU_ITEMS = { | |
| 595 | + go_elementor_pro: 'Upgrade' | |
| 596 | +}; | |
| 597 | +var MenuPromotionTracking = /*#__PURE__*/function (_BaseTracking) { | |
| 598 | + function MenuPromotionTracking() { | |
| 599 | + (0, _classCallCheck2.default)(this, MenuPromotionTracking); | |
| 600 | + return _callSuper(this, MenuPromotionTracking, arguments); | |
| 601 | + } | |
| 602 | + (0, _inherits2.default)(MenuPromotionTracking, _BaseTracking); | |
| 603 | + return (0, _createClass2.default)(MenuPromotionTracking, null, [{ | |
| 604 | + key: "init", | |
| 605 | + value: function init() { | |
| 606 | + this.attachDelegatedTracking(); | |
| 607 | + } | |
| 608 | + }, { | |
| 609 | + key: "attachDelegatedTracking", | |
| 610 | + value: function attachDelegatedTracking() { | |
| 611 | + var _this = this; | |
| 612 | + this.addEventListenerTracked(document, 'click', function (event) { | |
| 613 | + var target = event.target; | |
| 614 | + if (!target) { | |
| 615 | + return; | |
| 616 | + } | |
| 617 | + var link = target.closest('a'); | |
| 618 | + if (!link) { | |
| 619 | + return; | |
| 620 | + } | |
| 621 | + var href = link.getAttribute('href'); | |
| 622 | + if (!href) { | |
| 623 | + return; | |
| 624 | + } | |
| 625 | + var menuItemKey = _this.extractPromoMenuKey(href); | |
| 626 | + if (!menuItemKey) { | |
| 627 | + return; | |
| 628 | + } | |
| 629 | + _this.handleMenuPromoClick(link, menuItemKey); | |
| 630 | + }, { | |
| 631 | + capture: true | |
| 632 | + }); | |
| 633 | + } | |
| 634 | + }, { | |
| 635 | + key: "extractPromoMenuKey", | |
| 636 | + value: function extractPromoMenuKey(href) { | |
| 637 | + for (var _i = 0, _Object$keys = Object.keys(PROMO_MENU_ITEMS); _i < _Object$keys.length; _i++) { | |
| 638 | + var menuItemKey = _Object$keys[_i]; | |
| 639 | + if (href.includes("page=".concat(menuItemKey))) { | |
| 640 | + return menuItemKey; | |
| 641 | + } | |
| 642 | + } | |
| 643 | + return null; | |
| 644 | + } | |
| 645 | + }, { | |
| 646 | + key: "handleMenuPromoClick", | |
| 647 | + value: function handleMenuPromoClick(menuItem, menuItemKey) { | |
| 648 | + var destination = menuItem.getAttribute('href'); | |
| 649 | + var promoName = PROMO_MENU_ITEMS[menuItemKey]; | |
| 650 | + var path = menuItemKey.replace('elementor_', '').replace(/_/g, '/'); | |
| 651 | + _wpDashboardTracking.default.trackPromoClicked(promoName, destination, path); | |
| 652 | + } | |
| 653 | + }]); | |
| 654 | +}(_baseTracking.default); | |
| 655 | +var _default = exports["default"] = MenuPromotionTracking; | |
| 656 | + | |
| 657 | +/***/ }), | |
| 658 | + | |
| 659 | +/***/ "../app/assets/js/event-track/dashboard/navigation.js": | |
| 660 | +/*!************************************************************!*\ | |
| 661 | + !*** ../app/assets/js/event-track/dashboard/navigation.js ***! | |
| 662 | + \************************************************************/ | |
| 663 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 664 | + | |
| 665 | +"use strict"; | |
| 666 | + | |
| 667 | + | |
| 668 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 669 | +var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); | |
| 670 | +Object.defineProperty(exports, "__esModule", ({ | |
| 671 | + value: true | |
| 672 | +})); | |
| 673 | +exports["default"] = void 0; | |
| 674 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 675 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 676 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 677 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 678 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 679 | +var _wpDashboardTracking = _interopRequireWildcard(__webpack_require__(/*! ../wp-dashboard-tracking */ "../app/assets/js/event-track/wp-dashboard-tracking.js")); | |
| 680 | +var _baseTracking = _interopRequireDefault(__webpack_require__(/*! ./base-tracking */ "../app/assets/js/event-track/dashboard/base-tracking.js")); | |
| 681 | +function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); } | |
| 682 | +function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } | |
| 683 | +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 684 | +var ELEMENTOR_MENU_SELECTORS = { | |
| 685 | + ELEMENTOR_TOP_LEVEL: 'li#toplevel_page_elementor', | |
| 686 | + TEMPLATES_TOP_LEVEL: 'li#menu-posts-elementor_library', | |
| 687 | + ELEMENTOR_HOME_TOP_LEVEL: 'li#toplevel_page_elementor-home', | |
| 688 | + ADMIN_MENU: '#adminmenu', | |
| 689 | + TOP_LEVEL_LINK: '.wp-menu-name', | |
| 690 | + SUBMENU_CONTAINER: '.wp-submenu', | |
| 691 | + SUBMENU_ITEM: '.wp-submenu li a', | |
| 692 | + SUBMENU_ITEM_TOP_LEVEL: '.wp-has-submenu', | |
| 693 | + SIDEBAR_NAVIGATION: '#editor-one-sidebar-navigation' | |
| 694 | +}; | |
| 695 | +var NavigationTracking = /*#__PURE__*/function (_BaseTracking) { | |
| 696 | + function NavigationTracking() { | |
| 697 | + (0, _classCallCheck2.default)(this, NavigationTracking); | |
| 698 | + return _callSuper(this, NavigationTracking, arguments); | |
| 699 | + } | |
| 700 | + (0, _inherits2.default)(NavigationTracking, _BaseTracking); | |
| 701 | + return (0, _createClass2.default)(NavigationTracking, null, [{ | |
| 702 | + key: "init", | |
| 703 | + value: function init() { | |
| 704 | + if (_wpDashboardTracking.default.isEditorOneActive()) { | |
| 705 | + this.attachSidebarNavigationTracking(); | |
| 706 | + this.attachElementorHomeMenuTracking(); | |
| 707 | + } else { | |
| 708 | + this.attachElementorMenuTracking(); | |
| 709 | + this.attachTemplatesMenuTracking(); | |
| 710 | + } | |
| 711 | + } | |
| 712 | + }, { | |
| 713 | + key: "attachTemplatesMenuTracking", | |
| 714 | + value: function attachTemplatesMenuTracking() { | |
| 715 | + var templatesMenu = document.querySelector(ELEMENTOR_MENU_SELECTORS.TEMPLATES_TOP_LEVEL); | |
| 716 | + if (!templatesMenu) { | |
| 717 | + return; | |
| 718 | + } | |
| 719 | + this.attachMenuTracking(templatesMenu, 'Templates'); | |
| 720 | + } | |
| 721 | + }, { | |
| 722 | + key: "attachElementorHomeMenuTracking", | |
| 723 | + value: function attachElementorHomeMenuTracking() { | |
| 724 | + var elementorHomeMenu = document.querySelector(ELEMENTOR_MENU_SELECTORS.ELEMENTOR_HOME_TOP_LEVEL); | |
| 725 | + if (!elementorHomeMenu) { | |
| 726 | + return; | |
| 727 | + } | |
| 728 | + this.attachMenuTracking(elementorHomeMenu, 'Elementor'); | |
| 729 | + } | |
| 730 | + }, { | |
| 731 | + key: "attachElementorMenuTracking", | |
| 732 | + value: function attachElementorMenuTracking() { | |
| 733 | + var elementorMenu = document.querySelector(ELEMENTOR_MENU_SELECTORS.ELEMENTOR_TOP_LEVEL); | |
| 734 | + if (!elementorMenu) { | |
| 735 | + return; | |
| 736 | + } | |
| 737 | + this.attachMenuTracking(elementorMenu, 'Elementor'); | |
| 738 | + } | |
| 739 | + }, { | |
| 740 | + key: "attachSidebarNavigationTracking", | |
| 741 | + value: function attachSidebarNavigationTracking() { | |
| 742 | + var sidebar = document.querySelector(ELEMENTOR_MENU_SELECTORS.SIDEBAR_NAVIGATION); | |
| 743 | + if (sidebar) { | |
| 744 | + this.attachSidebarClickListener(sidebar); | |
| 745 | + } | |
| 746 | + } | |
| 747 | + }, { | |
| 748 | + key: "attachSidebarClickListener", | |
| 749 | + value: function attachSidebarClickListener(sidebar) { | |
| 750 | + var _this = this; | |
| 751 | + this.addEventListenerTracked(sidebar, 'click', function (event) { | |
| 752 | + _this.handleSidebarClick(event); | |
| 753 | + }, { | |
| 754 | + capture: true | |
| 755 | + }); | |
| 756 | + } | |
| 757 | + }, { | |
| 758 | + key: "attachMenuTracking", | |
| 759 | + value: function attachMenuTracking(menuElement, menuName) { | |
| 760 | + var _this2 = this; | |
| 761 | + this.addEventListenerTracked(menuElement, 'click', function (event) { | |
| 762 | + _this2.handleMenuClick(event, menuName); | |
| 763 | + }); | |
| 764 | + } | |
| 765 | + }, { | |
| 766 | + key: "handleMenuClick", | |
| 767 | + value: function handleMenuClick(event, menuName) { | |
| 768 | + var link = event.target.closest('a'); | |
| 769 | + if (!link) { | |
| 770 | + return; | |
| 771 | + } | |
| 772 | + var isTopLevel = link.classList.contains('menu-top'); | |
| 773 | + var itemId = this.extractItemId(link); | |
| 774 | + var area = this.determineNavArea(link); | |
| 775 | + _wpDashboardTracking.default.trackNavClicked(itemId, isTopLevel ? null : menuName, area); | |
| 776 | + } | |
| 777 | + }, { | |
| 778 | + key: "handleSidebarClick", | |
| 779 | + value: function handleSidebarClick(event) { | |
| 780 | + var clickedElement = event.target.closest('a, button, [role="button"]'); | |
| 781 | + if (!clickedElement) { | |
| 782 | + return; | |
| 783 | + } | |
| 784 | + var itemId = this.extractSidebarItemId(clickedElement); | |
| 785 | + _wpDashboardTracking.default.trackNavClicked(itemId, null, _wpDashboardTracking.NAV_AREAS.SIDEBAR_MENU); | |
| 786 | + } | |
| 787 | + }, { | |
| 788 | + key: "extractSidebarItemId", | |
| 789 | + value: function extractSidebarItemId(element) { | |
| 790 | + var paragraph = element.querySelector('p'); | |
| 791 | + if (paragraph) { | |
| 792 | + return paragraph.textContent.trim(); | |
| 793 | + } | |
| 794 | + var textContent = element.textContent.trim(); | |
| 795 | + if (textContent) { | |
| 796 | + return textContent; | |
| 797 | + } | |
| 798 | + return 'unknown'; | |
| 799 | + } | |
| 800 | + }, { | |
| 801 | + key: "extractPageFromUrl", | |
| 802 | + value: function extractPageFromUrl(href) { | |
| 803 | + var urlParams = new URLSearchParams(href.split('?')[1] || ''); | |
| 804 | + var page = urlParams.get('page'); | |
| 805 | + if (page) { | |
| 806 | + return page; | |
| 807 | + } | |
| 808 | + var postType = urlParams.get('post_type'); | |
| 809 | + if (postType) { | |
| 810 | + return postType; | |
| 811 | + } | |
| 812 | + return 'unknown'; | |
| 813 | + } | |
| 814 | + }, { | |
| 815 | + key: "extractItemId", | |
| 816 | + value: function extractItemId(link) { | |
| 817 | + var textContent = link.textContent.trim(); | |
| 818 | + if (textContent) { | |
| 819 | + return textContent; | |
| 820 | + } | |
| 821 | + var href = link.getAttribute('href'); | |
| 822 | + if (href) { | |
| 823 | + return this.extractPageFromUrl(href); | |
| 824 | + } | |
| 825 | + var linkId = link.getAttribute('id'); | |
| 826 | + if (linkId) { | |
| 827 | + return linkId; | |
| 828 | + } | |
| 829 | + return 'unknown'; | |
| 830 | + } | |
| 831 | + }, { | |
| 832 | + key: "determineNavArea", | |
| 833 | + value: function determineNavArea(link) { | |
| 834 | + var parentMenu = link.closest('li.menu-top'); | |
| 835 | + if (parentMenu) { | |
| 836 | + var isSubmenuItem = link.closest(ELEMENTOR_MENU_SELECTORS.SUBMENU_CONTAINER); | |
| 837 | + if (isSubmenuItem) { | |
| 838 | + var submenuElement = link.closest(ELEMENTOR_MENU_SELECTORS.SUBMENU_ITEM_TOP_LEVEL); | |
| 839 | + if (submenuElement.classList.contains('wp-not-current-submenu')) { | |
| 840 | + return _wpDashboardTracking.NAV_AREAS.HOVER_MENU; | |
| 841 | + } | |
| 842 | + return _wpDashboardTracking.NAV_AREAS.SUBMENU; | |
| 843 | + } | |
| 844 | + return _wpDashboardTracking.NAV_AREAS.LEFT_MENU; | |
| 845 | + } | |
| 846 | + return _wpDashboardTracking.NAV_AREAS.LEFT_MENU; | |
| 847 | + } | |
| 848 | + }]); | |
| 849 | +}(_baseTracking.default); | |
| 850 | +var _default = exports["default"] = NavigationTracking; | |
| 851 | + | |
| 852 | +/***/ }), | |
| 853 | + | |
| 854 | +/***/ "../app/assets/js/event-track/dashboard/plugin-actions.js": | |
| 855 | +/*!****************************************************************!*\ | |
| 856 | + !*** ../app/assets/js/event-track/dashboard/plugin-actions.js ***! | |
| 857 | + \****************************************************************/ | |
| 858 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 859 | + | |
| 860 | +"use strict"; | |
| 861 | + | |
| 862 | + | |
| 863 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 864 | +Object.defineProperty(exports, "__esModule", ({ | |
| 865 | + value: true | |
| 866 | +})); | |
| 867 | +exports["default"] = void 0; | |
| 868 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 869 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 870 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 871 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 872 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 873 | +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 874 | +var _wpDashboardTracking = _interopRequireDefault(__webpack_require__(/*! ../wp-dashboard-tracking */ "../app/assets/js/event-track/wp-dashboard-tracking.js")); | |
| 875 | +var _baseTracking = _interopRequireDefault(__webpack_require__(/*! ./base-tracking */ "../app/assets/js/event-track/dashboard/base-tracking.js")); | |
| 876 | +function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } | |
| 877 | +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 878 | +var PLUGIN_TYPE = { | |
| 879 | + ELEMENTOR: 'core', | |
| 880 | + ELEMENTOR_PRO: 'pro' | |
| 881 | +}; | |
| 882 | +var PluginActions = /*#__PURE__*/function (_BaseTracking) { | |
| 883 | + function PluginActions() { | |
| 884 | + (0, _classCallCheck2.default)(this, PluginActions); | |
| 885 | + return _callSuper(this, PluginActions, arguments); | |
| 886 | + } | |
| 887 | + (0, _inherits2.default)(PluginActions, _BaseTracking); | |
| 888 | + return (0, _createClass2.default)(PluginActions, null, [{ | |
| 889 | + key: "init", | |
| 890 | + value: function init() { | |
| 891 | + this.attachCoreDeactivationTracking(); | |
| 892 | + this.attachProDeactivationTracking(); | |
| 893 | + this.attachProDeletionTracking(); | |
| 894 | + } | |
| 895 | + }, { | |
| 896 | + key: "attachCoreDeactivationTracking", | |
| 897 | + value: function attachCoreDeactivationTracking() { | |
| 898 | + var _this = this; | |
| 899 | + var dialogForm = document.querySelector('#elementor-deactivate-feedback-dialog-form'); | |
| 900 | + if (!dialogForm) { | |
| 901 | + return; | |
| 902 | + } | |
| 903 | + this.addEventListenerTracked(dialogForm, 'change', function (event) { | |
| 904 | + var target = event.target; | |
| 905 | + if (target.classList.contains('elementor-deactivate-feedback-dialog-input')) { | |
| 906 | + _this.selectedReason = target.value; | |
| 907 | + } | |
| 908 | + }); | |
| 909 | + this.observeModalButtons(); | |
| 910 | + } | |
| 911 | + }, { | |
| 912 | + key: "attachProDeactivationTracking", | |
| 913 | + value: function attachProDeactivationTracking() { | |
| 914 | + var _this2 = this; | |
| 915 | + var pluginsTable = document.querySelector('.plugins'); | |
| 916 | + if (!pluginsTable) { | |
| 917 | + return; | |
| 918 | + } | |
| 919 | + this.addEventListenerTracked(pluginsTable, 'click', function (event) { | |
| 920 | + var link = event.target.closest('a'); | |
| 921 | + if (link && 'deactivate-elementor-pro' === link.id) { | |
| 922 | + _this2.trackProDeactivation(); | |
| 923 | + } | |
| 924 | + }, { | |
| 925 | + capture: true | |
| 926 | + }); | |
| 927 | + } | |
| 928 | + }, { | |
| 929 | + key: "observeModalButtons", | |
| 930 | + value: function observeModalButtons() { | |
| 931 | + var _this3 = this; | |
| 932 | + var checkAndAttachDelegation = function checkAndAttachDelegation() { | |
| 933 | + var modal = document.querySelector('#elementor-deactivate-feedback-modal'); | |
| 934 | + if (!modal) { | |
| 935 | + return false; | |
| 936 | + } | |
| 937 | + _this3.addEventListenerTracked(modal, 'click', function (event) { | |
| 938 | + var submitButton = event.target.closest('.dialog-submit'); | |
| 939 | + var skipButton = event.target.closest('.dialog-skip'); | |
| 940 | + if (submitButton) { | |
| 941 | + _this3.trackCoreDeactivation('submit&deactivate'); | |
| 942 | + } else if (skipButton) { | |
| 943 | + _this3.trackCoreDeactivation('skip&deactivate'); | |
| 944 | + } | |
| 945 | + }, { | |
| 946 | + capture: true | |
| 947 | + }); | |
| 948 | + return true; | |
| 949 | + }; | |
| 950 | + if (checkAndAttachDelegation()) { | |
| 951 | + return; | |
| 952 | + } | |
| 953 | + this.addObserver(document.body, { | |
| 954 | + childList: true, | |
| 955 | + subtree: true | |
| 956 | + }, function (mutations, observer) { | |
| 957 | + if (checkAndAttachDelegation()) { | |
| 958 | + observer.disconnect(); | |
| 959 | + } | |
| 960 | + }); | |
| 961 | + } | |
| 962 | + }, { | |
| 963 | + key: "getUserInput", | |
| 964 | + value: function getUserInput() { | |
| 965 | + var reasonsWithInput = ['found_a_better_plugin', 'other']; | |
| 966 | + if (!this.selectedReason || !reasonsWithInput.includes(this.selectedReason)) { | |
| 967 | + return null; | |
| 968 | + } | |
| 969 | + var inputField = document.querySelector("input[name=\"reason_".concat(this.selectedReason, "\"]")); | |
| 970 | + if (inputField && inputField.value) { | |
| 971 | + return inputField.value; | |
| 972 | + } | |
| 973 | + return null; | |
| 974 | + } | |
| 975 | + }, { | |
| 976 | + key: "trackCoreDeactivation", | |
| 977 | + value: function trackCoreDeactivation(action) { | |
| 978 | + var properties = { | |
| 979 | + deactivate_form_submit: action, | |
| 980 | + deactivate_plugin_type: PLUGIN_TYPE.ELEMENTOR | |
| 981 | + }; | |
| 982 | + if (this.selectedReason) { | |
| 983 | + properties.deactivate_feedback_reason = this.selectedReason; | |
| 984 | + } | |
| 985 | + var userInput = this.getUserInput(); | |
| 986 | + if (userInput) { | |
| 987 | + properties.deactivate_feedback_reason += "/".concat(userInput); | |
| 988 | + } | |
| 989 | + _wpDashboardTracking.default.dispatchEvent('wpdash_deactivate_plugin', properties, { | |
| 990 | + send_immediately: true | |
| 991 | + }); | |
| 992 | + } | |
| 993 | + }, { | |
| 994 | + key: "trackProDeactivation", | |
| 995 | + value: function trackProDeactivation() { | |
| 996 | + this.trackProAction('deactivate'); | |
| 997 | + } | |
| 998 | + }, { | |
| 999 | + key: "attachProDeletionTracking", | |
| 1000 | + value: function attachProDeletionTracking() { | |
| 1001 | + var _this4 = this; | |
| 1002 | + if ('undefined' === typeof jQuery) { | |
| 1003 | + return; | |
| 1004 | + } | |
| 1005 | + jQuery(document).on('wp-plugin-deleting', function (event, args) { | |
| 1006 | + if ('elementor-pro' === (args === null || args === void 0 ? void 0 : args.slug)) { | |
| 1007 | + _this4.trackProAction('delete'); | |
| 1008 | + } | |
| 1009 | + }); | |
| 1010 | + } | |
| 1011 | + }, { | |
| 1012 | + key: "destroy", | |
| 1013 | + value: function destroy() { | |
| 1014 | + if ('undefined' !== typeof jQuery) { | |
| 1015 | + jQuery(document).off('wp-plugin-deleting'); | |
| 1016 | + } | |
| 1017 | + _baseTracking.default.destroy.call(this); | |
| 1018 | + } | |
| 1019 | + }, { | |
| 1020 | + key: "trackProAction", | |
| 1021 | + value: function trackProAction(action) { | |
| 1022 | + var eventMap = { | |
| 1023 | + deactivate: { | |
| 1024 | + eventName: 'wpdash_deactivate_plugin', | |
| 1025 | + propertyKey: 'deactivate_plugin_type' | |
| 1026 | + }, | |
| 1027 | + delete: { | |
| 1028 | + eventName: 'wpdash_delete_plugin', | |
| 1029 | + propertyKey: 'plugin_delete' | |
| 1030 | + } | |
| 1031 | + }; | |
| 1032 | + var config = eventMap[action]; | |
| 1033 | + if (!config) { | |
| 1034 | + return; | |
| 1035 | + } | |
| 1036 | + var properties = (0, _defineProperty2.default)({}, config.propertyKey, PLUGIN_TYPE.ELEMENTOR_PRO); | |
| 1037 | + _wpDashboardTracking.default.dispatchEvent(config.eventName, properties, { | |
| 1038 | + send_immediately: true | |
| 1039 | + }); | |
| 1040 | + } | |
| 1041 | + }]); | |
| 1042 | +}(_baseTracking.default); | |
| 1043 | +(0, _defineProperty2.default)(PluginActions, "selectedReason", null); | |
| 1044 | +var _default = exports["default"] = PluginActions; | |
| 1045 | + | |
| 1046 | +/***/ }), | |
| 1047 | + | |
| 1048 | +/***/ "../app/assets/js/event-track/dashboard/promotion.js": | |
| 1049 | +/*!***********************************************************!*\ | |
| 1050 | + !*** ../app/assets/js/event-track/dashboard/promotion.js ***! | |
| 1051 | + \***********************************************************/ | |
| 1052 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 1053 | + | |
| 1054 | +"use strict"; | |
| 1055 | + | |
| 1056 | + | |
| 1057 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 1058 | +Object.defineProperty(exports, "__esModule", ({ | |
| 1059 | + value: true | |
| 1060 | +})); | |
| 1061 | +exports["default"] = void 0; | |
| 1062 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 1063 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 1064 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 1065 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 1066 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 1067 | +var _wpDashboardTracking = _interopRequireDefault(__webpack_require__(/*! ../wp-dashboard-tracking */ "../app/assets/js/event-track/wp-dashboard-tracking.js")); | |
| 1068 | +var _baseTracking = _interopRequireDefault(__webpack_require__(/*! ./base-tracking */ "../app/assets/js/event-track/dashboard/base-tracking.js")); | |
| 1069 | +function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } | |
| 1070 | +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 1071 | +var PROMO_SELECTORS = { | |
| 1072 | + PROMO_PAGE: '.e-feature-promotion, .elementor-settings-form-page, #elementor-element-manager-wrap', | |
| 1073 | + PROMO_BLANK_STATE: '.elementor-blank_state', | |
| 1074 | + CTA_BUTTON: '.go-pro', | |
| 1075 | + TITLE: 'h3' | |
| 1076 | +}; | |
| 1077 | +var PromotionTracking = /*#__PURE__*/function (_BaseTracking) { | |
| 1078 | + function PromotionTracking() { | |
| 1079 | + (0, _classCallCheck2.default)(this, PromotionTracking); | |
| 1080 | + return _callSuper(this, PromotionTracking, arguments); | |
| 1081 | + } | |
| 1082 | + (0, _inherits2.default)(PromotionTracking, _BaseTracking); | |
| 1083 | + return (0, _createClass2.default)(PromotionTracking, null, [{ | |
| 1084 | + key: "init", | |
| 1085 | + value: function init() { | |
| 1086 | + this.attachDelegatedTracking(); | |
| 1087 | + } | |
| 1088 | + }, { | |
| 1089 | + key: "attachDelegatedTracking", | |
| 1090 | + value: function attachDelegatedTracking() { | |
| 1091 | + var _this = this; | |
| 1092 | + this.addEventListenerTracked(document, 'click', function (event) { | |
| 1093 | + var target = event.target; | |
| 1094 | + if (!target) { | |
| 1095 | + return; | |
| 1096 | + } | |
| 1097 | + var button = target.closest("a".concat(PROMO_SELECTORS.CTA_BUTTON)); | |
| 1098 | + if (!button) { | |
| 1099 | + return; | |
| 1100 | + } | |
| 1101 | + var promoPage = button.closest("".concat(PROMO_SELECTORS.PROMO_PAGE, ", ").concat(PROMO_SELECTORS.PROMO_BLANK_STATE)); | |
| 1102 | + if (!promoPage) { | |
| 1103 | + return; | |
| 1104 | + } | |
| 1105 | + _this.handlePromoClick(button, promoPage); | |
| 1106 | + }, { | |
| 1107 | + capture: true | |
| 1108 | + }); | |
| 1109 | + } | |
| 1110 | + }, { | |
| 1111 | + key: "handlePromoClick", | |
| 1112 | + value: function handlePromoClick(button, promoPage) { | |
| 1113 | + var promoTitle = this.extractPromoTitle(promoPage, button); | |
| 1114 | + var destination = button.getAttribute('href'); | |
| 1115 | + var path = this.extractPromoPath(); | |
| 1116 | + _wpDashboardTracking.default.trackPromoClicked(promoTitle, destination, path); | |
| 1117 | + } | |
| 1118 | + }, { | |
| 1119 | + key: "extractPromoTitle", | |
| 1120 | + value: function extractPromoTitle(promoPage, button) { | |
| 1121 | + var titleElement = promoPage.querySelector(PROMO_SELECTORS.TITLE); | |
| 1122 | + return titleElement ? titleElement.textContent.trim() : button.textContent.trim(); | |
| 1123 | + } | |
| 1124 | + }, { | |
| 1125 | + key: "extractPromoPath", | |
| 1126 | + value: function extractPromoPath() { | |
| 1127 | + var urlParams = new URLSearchParams(window.location.search); | |
| 1128 | + var page = urlParams.get('page'); | |
| 1129 | + if (!page) { | |
| 1130 | + return 'elementor'; | |
| 1131 | + } | |
| 1132 | + return page.replace('elementor_', '').replace(/_/g, '/'); | |
| 1133 | + } | |
| 1134 | + }]); | |
| 1135 | +}(_baseTracking.default); | |
| 1136 | +var _default = exports["default"] = PromotionTracking; | |
| 1137 | + | |
| 1138 | +/***/ }), | |
| 1139 | + | |
| 1140 | +/***/ "../app/assets/js/event-track/dashboard/screen-view.js": | |
| 1141 | +/*!*************************************************************!*\ | |
| 1142 | + !*** ../app/assets/js/event-track/dashboard/screen-view.js ***! | |
| 1143 | + \*************************************************************/ | |
| 1144 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 1145 | + | |
| 1146 | +"use strict"; | |
| 1147 | + | |
| 1148 | + | |
| 1149 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 1150 | +var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); | |
| 1151 | +Object.defineProperty(exports, "__esModule", ({ | |
| 1152 | + value: true | |
| 1153 | +})); | |
| 1154 | +exports["default"] = void 0; | |
| 1155 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 1156 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 1157 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 1158 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 1159 | +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js")); | |
| 1160 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 1161 | +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 1162 | +var _wpDashboardTracking = _interopRequireWildcard(__webpack_require__(/*! ../wp-dashboard-tracking */ "../app/assets/js/event-track/wp-dashboard-tracking.js")); | |
| 1163 | +var _utils = __webpack_require__(/*! ./utils */ "../app/assets/js/event-track/dashboard/utils.js"); | |
| 1164 | +var _baseTracking = _interopRequireDefault(__webpack_require__(/*! ./base-tracking */ "../app/assets/js/event-track/dashboard/base-tracking.js")); | |
| 1165 | +function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); } | |
| 1166 | +function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; } | |
| 1167 | +function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } | |
| 1168 | +function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } | |
| 1169 | +function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } | |
| 1170 | +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 1171 | +function _superPropGet(t, o, e, r) { var p = (0, _get2.default)((0, _getPrototypeOf2.default)(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; } | |
| 1172 | +var SCREEN_SELECTORS = { | |
| 1173 | + NAV_TAB_WRAPPER: '.nav-tab-wrapper', | |
| 1174 | + NAV_TAB: '.nav-tab', | |
| 1175 | + NAV_TAB_ACTIVE: '.nav-tab-active', | |
| 1176 | + SETTINGS_FORM_PAGE: '.elementor-settings-form-page', | |
| 1177 | + SETTINGS_FORM_PAGE_ACTIVE: '.elementor-settings-form-page.elementor-active', | |
| 1178 | + FLOATING_ELEMENTS_MODAL: '#elementor-new-floating-elements-modal', | |
| 1179 | + TEMPLATE_DIALOG_MODAL: '#elementor-new-template-dialog-content' | |
| 1180 | +}; | |
| 1181 | +var TRACKED_MODALS = [SCREEN_SELECTORS.FLOATING_ELEMENTS_MODAL, SCREEN_SELECTORS.TEMPLATE_DIALOG_MODAL]; | |
| 1182 | +var ScreenViewTracking = /*#__PURE__*/function (_BaseTracking) { | |
| 1183 | + function ScreenViewTracking() { | |
| 1184 | + (0, _classCallCheck2.default)(this, ScreenViewTracking); | |
| 1185 | + return _callSuper(this, ScreenViewTracking, arguments); | |
| 1186 | + } | |
| 1187 | + (0, _inherits2.default)(ScreenViewTracking, _BaseTracking); | |
| 1188 | + return (0, _createClass2.default)(ScreenViewTracking, null, [{ | |
| 1189 | + key: "init", | |
| 1190 | + value: function init() { | |
| 1191 | + if (!_utils.DashboardUtils.isElementorPage()) { | |
| 1192 | + return; | |
| 1193 | + } | |
| 1194 | + this.attachTabChangeTracking(); | |
| 1195 | + } | |
| 1196 | + }, { | |
| 1197 | + key: "destroy", | |
| 1198 | + value: function destroy() { | |
| 1199 | + _superPropGet(ScreenViewTracking, "destroy", this, 2)([]); | |
| 1200 | + this.trackedScreens.clear(); | |
| 1201 | + } | |
| 1202 | + }, { | |
| 1203 | + key: "getScreenData", | |
| 1204 | + value: function getScreenData() { | |
| 1205 | + var urlParams = new URLSearchParams(window.location.search); | |
| 1206 | + var page = urlParams.get('page'); | |
| 1207 | + var postType = urlParams.get('post_type'); | |
| 1208 | + var hash = window.location.hash; | |
| 1209 | + var screenId = ''; | |
| 1210 | + var screenType = ''; | |
| 1211 | + if (page) { | |
| 1212 | + screenId = page; | |
| 1213 | + } else if (postType) { | |
| 1214 | + screenId = postType; | |
| 1215 | + } else { | |
| 1216 | + screenId = this.getScreenIdFromBody(); | |
| 1217 | + } | |
| 1218 | + if (this.isElementorAppPage()) { | |
| 1219 | + var appScreenData = this.getAppScreenData(hash); | |
| 1220 | + if (appScreenData) { | |
| 1221 | + return appScreenData; | |
| 1222 | + } | |
| 1223 | + } | |
| 1224 | + var hasNavTabs = document.querySelector(SCREEN_SELECTORS.NAV_TAB_WRAPPER); | |
| 1225 | + var hasSettingsTabs = document.querySelectorAll(SCREEN_SELECTORS.SETTINGS_FORM_PAGE).length > 1; | |
| 1226 | + if (hasNavTabs || hasSettingsTabs || hash && !this.isElementorAppPage()) { | |
| 1227 | + screenType = _wpDashboardTracking.SCREEN_TYPES.TAB; | |
| 1228 | + if (hash) { | |
| 1229 | + var tabId = hash.replace(/^#(tab-)?/, ''); | |
| 1230 | + screenId = "".concat(screenId, "-").concat(tabId); | |
| 1231 | + } else if (hasNavTabs) { | |
| 1232 | + var activeTab = document.querySelector(SCREEN_SELECTORS.NAV_TAB_ACTIVE); | |
| 1233 | + if (activeTab) { | |
| 1234 | + var tabText = activeTab.textContent.trim(); | |
| 1235 | + var tabHref = activeTab.getAttribute('href'); | |
| 1236 | + if (tabText) { | |
| 1237 | + screenId = "".concat(screenId, "-").concat(this.sanitizeScreenId(tabText)); | |
| 1238 | + } else if (tabHref && tabHref.includes('#')) { | |
| 1239 | + var _tabId = tabHref.split('#')[1]; | |
| 1240 | + screenId = "".concat(screenId, "-").concat(_tabId); | |
| 1241 | + } | |
| 1242 | + } | |
| 1243 | + } else if (hasSettingsTabs) { | |
| 1244 | + var activeSettingsTab = document.querySelector(SCREEN_SELECTORS.SETTINGS_FORM_PAGE_ACTIVE); | |
| 1245 | + if (activeSettingsTab) { | |
| 1246 | + var _tabId2 = activeSettingsTab.id; | |
| 1247 | + if (_tabId2) { | |
| 1248 | + screenId = "".concat(screenId, "-").concat(_tabId2); | |
| 1249 | + } | |
| 1250 | + } | |
| 1251 | + } | |
| 1252 | + } | |
| 1253 | + return { | |
| 1254 | + screenId: screenId, | |
| 1255 | + screenType: screenType | |
| 1256 | + }; | |
| 1257 | + } | |
| 1258 | + }, { | |
| 1259 | + key: "isElementorAppPage", | |
| 1260 | + value: function isElementorAppPage() { | |
| 1261 | + var urlParams = new URLSearchParams(window.location.search); | |
| 1262 | + return 'elementor-app' === urlParams.get('page'); | |
| 1263 | + } | |
| 1264 | + }, { | |
| 1265 | + key: "getAppScreenData", | |
| 1266 | + value: function getAppScreenData(hash) { | |
| 1267 | + if (!hash) { | |
| 1268 | + return null; | |
| 1269 | + } | |
| 1270 | + var cleanHash = hash.replace(/^#/, ''); | |
| 1271 | + if (!cleanHash.startsWith('/')) { | |
| 1272 | + return null; | |
| 1273 | + } | |
| 1274 | + var pathParts = cleanHash.split('/').filter(Boolean); | |
| 1275 | + if (0 === pathParts.length) { | |
| 1276 | + return null; | |
| 1277 | + } | |
| 1278 | + var screenId = pathParts.join('/'); | |
| 1279 | + var screenType = _wpDashboardTracking.SCREEN_TYPES.APP_SCREEN; | |
| 1280 | + return { | |
| 1281 | + screenId: screenId, | |
| 1282 | + screenType: screenType | |
| 1283 | + }; | |
| 1284 | + } | |
| 1285 | + }, { | |
| 1286 | + key: "getScreenIdFromBody", | |
| 1287 | + value: function getScreenIdFromBody() { | |
| 1288 | + var body = document.body; | |
| 1289 | + var bodyClasses = body.className.split(' '); | |
| 1290 | + var _iterator = _createForOfIteratorHelper(bodyClasses), | |
| 1291 | + _step; | |
| 1292 | + try { | |
| 1293 | + for (_iterator.s(); !(_step = _iterator.n()).done;) { | |
| 1294 | + var cls = _step.value; | |
| 1295 | + if (cls.startsWith('elementor') && (cls.includes('page') || cls.includes('post-type'))) { | |
| 1296 | + return cls; | |
| 1297 | + } | |
| 1298 | + } | |
| 1299 | + } catch (err) { | |
| 1300 | + _iterator.e(err); | |
| 1301 | + } finally { | |
| 1302 | + _iterator.f(); | |
| 1303 | + } | |
| 1304 | + return 'elementor-unknown'; | |
| 1305 | + } | |
| 1306 | + }, { | |
| 1307 | + key: "sanitizeScreenId", | |
| 1308 | + value: function sanitizeScreenId(text) { | |
| 1309 | + return text.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, ''); | |
| 1310 | + } | |
| 1311 | + }, { | |
| 1312 | + key: "attachTabChangeTracking", | |
| 1313 | + value: function attachTabChangeTracking() { | |
| 1314 | + this.attachNavTabTracking(); | |
| 1315 | + this.attachHashChangeTracking(); | |
| 1316 | + this.attachSettingsTabTracking(); | |
| 1317 | + this.attachModalTracking(); | |
| 1318 | + } | |
| 1319 | + }, { | |
| 1320 | + key: "attachNavTabTracking", | |
| 1321 | + value: function attachNavTabTracking() { | |
| 1322 | + var _this = this; | |
| 1323 | + var wrapper = document.querySelector(SCREEN_SELECTORS.NAV_TAB_WRAPPER); | |
| 1324 | + if (!wrapper) { | |
| 1325 | + return; | |
| 1326 | + } | |
| 1327 | + this.addEventListenerTracked(wrapper, 'click', function (event) { | |
| 1328 | + var navTab = event.target.closest(SCREEN_SELECTORS.NAV_TAB); | |
| 1329 | + if (navTab && !navTab.classList.contains('nav-tab-active')) { | |
| 1330 | + var screenData = _this.getScreenData(); | |
| 1331 | + if (screenData) { | |
| 1332 | + _this.trackScreen(screenData.screenId, screenData.screenType); | |
| 1333 | + } | |
| 1334 | + } | |
| 1335 | + }); | |
| 1336 | + } | |
| 1337 | + }, { | |
| 1338 | + key: "attachHashChangeTracking", | |
| 1339 | + value: function attachHashChangeTracking() { | |
| 1340 | + var _this2 = this; | |
| 1341 | + this.addEventListenerTracked(window, 'hashchange', function () { | |
| 1342 | + var screenData = _this2.getScreenData(); | |
| 1343 | + if (screenData) { | |
| 1344 | + _this2.trackScreen(screenData.screenId, screenData.screenType); | |
| 1345 | + } | |
| 1346 | + }); | |
| 1347 | + } | |
| 1348 | + }, { | |
| 1349 | + key: "attachSettingsTabTracking", | |
| 1350 | + value: function attachSettingsTabTracking() { | |
| 1351 | + var _this3 = this; | |
| 1352 | + var settingsPages = document.querySelectorAll(SCREEN_SELECTORS.SETTINGS_FORM_PAGE); | |
| 1353 | + if (0 === settingsPages.length) { | |
| 1354 | + return; | |
| 1355 | + } | |
| 1356 | + settingsPages.forEach(function (page) { | |
| 1357 | + _this3.addObserver(page, { | |
| 1358 | + attributes: true, | |
| 1359 | + attributeFilter: ['class'] | |
| 1360 | + }, function () { | |
| 1361 | + var screenData = _this3.getScreenData(); | |
| 1362 | + if (screenData) { | |
| 1363 | + _this3.trackScreen(screenData.screenId, screenData.screenType); | |
| 1364 | + } | |
| 1365 | + }); | |
| 1366 | + }); | |
| 1367 | + } | |
| 1368 | + }, { | |
| 1369 | + key: "attachModalTracking", | |
| 1370 | + value: function attachModalTracking() { | |
| 1371 | + var _this4 = this; | |
| 1372 | + this.addObserver(document.body, { | |
| 1373 | + childList: true, | |
| 1374 | + subtree: true | |
| 1375 | + }, function (mutations) { | |
| 1376 | + var _iterator2 = _createForOfIteratorHelper(mutations), | |
| 1377 | + _step2; | |
| 1378 | + try { | |
| 1379 | + for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { | |
| 1380 | + var mutation = _step2.value; | |
| 1381 | + if ('childList' === mutation.type) { | |
| 1382 | + TRACKED_MODALS.forEach(function (modalSelector) { | |
| 1383 | + var modal = document.querySelector(modalSelector); | |
| 1384 | + if (modal && _this4.isModalVisible(modal)) { | |
| 1385 | + var modalId = modalSelector.replace('#', ''); | |
| 1386 | + _this4.trackScreen(modalId, _wpDashboardTracking.SCREEN_TYPES.POPUP); | |
| 1387 | + } | |
| 1388 | + }); | |
| 1389 | + } | |
| 1390 | + } | |
| 1391 | + } catch (err) { | |
| 1392 | + _iterator2.e(err); | |
| 1393 | + } finally { | |
| 1394 | + _iterator2.f(); | |
| 1395 | + } | |
| 1396 | + }); | |
| 1397 | + } | |
| 1398 | + }, { | |
| 1399 | + key: "isModalVisible", | |
| 1400 | + value: function isModalVisible(element) { | |
| 1401 | + if (!element) { | |
| 1402 | + return false; | |
| 1403 | + } | |
| 1404 | + var style = window.getComputedStyle(element); | |
| 1405 | + return 'none' !== style.display && 0 !== parseFloat(style.opacity); | |
| 1406 | + } | |
| 1407 | + }, { | |
| 1408 | + key: "trackScreen", | |
| 1409 | + value: function trackScreen(screenId) { | |
| 1410 | + var screenType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _wpDashboardTracking.SCREEN_TYPES.TOP_LEVEL_PAGE; | |
| 1411 | + var trackingKey = "".concat(screenId, "-").concat(screenType); | |
| 1412 | + if (this.trackedScreens.has(trackingKey)) { | |
| 1413 | + return; | |
| 1414 | + } | |
| 1415 | + this.trackedScreens.add(trackingKey); | |
| 1416 | + _wpDashboardTracking.default.trackScreenViewed(screenId, screenType); | |
| 1417 | + } | |
| 1418 | + }]); | |
| 1419 | +}(_baseTracking.default); | |
| 1420 | +(0, _defineProperty2.default)(ScreenViewTracking, "trackedScreens", new Set()); | |
| 1421 | +var _default = exports["default"] = ScreenViewTracking; | |
| 1422 | + | |
| 1423 | +/***/ }), | |
| 1424 | + | |
| 1425 | +/***/ "../app/assets/js/event-track/dashboard/top-bar.js": | |
| 1426 | +/*!*********************************************************!*\ | |
| 1427 | + !*** ../app/assets/js/event-track/dashboard/top-bar.js ***! | |
| 1428 | + \*********************************************************/ | |
| 1429 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 1430 | + | |
| 1431 | +"use strict"; | |
| 1432 | + | |
| 1433 | + | |
| 1434 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 1435 | +var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); | |
| 1436 | +Object.defineProperty(exports, "__esModule", ({ | |
| 1437 | + value: true | |
| 1438 | +})); | |
| 1439 | +exports["default"] = void 0; | |
| 1440 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 1441 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 1442 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 1443 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 1444 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 1445 | +var _wpDashboardTracking = _interopRequireWildcard(__webpack_require__(/*! ../wp-dashboard-tracking */ "../app/assets/js/event-track/wp-dashboard-tracking.js")); | |
| 1446 | +var _baseTracking = _interopRequireDefault(__webpack_require__(/*! ./base-tracking */ "../app/assets/js/event-track/dashboard/base-tracking.js")); | |
| 1447 | +function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); } | |
| 1448 | +function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } | |
| 1449 | +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 1450 | +var TOP_BAR_SELECTORS = { | |
| 1451 | + TOP_BAR_ROOT: '.e-admin-top-bar', | |
| 1452 | + BAR_BUTTON: '.e-admin-top-bar__bar-button', | |
| 1453 | + BUTTON_TITLE: '.e-admin-top-bar__bar-button-title', | |
| 1454 | + MAIN_AREA: '.e-admin-top-bar__main-area', | |
| 1455 | + SECONDARY_AREA: '.e-admin-top-bar__secondary-area' | |
| 1456 | +}; | |
| 1457 | +var TopBarTracking = /*#__PURE__*/function (_BaseTracking) { | |
| 1458 | + function TopBarTracking() { | |
| 1459 | + (0, _classCallCheck2.default)(this, TopBarTracking); | |
| 1460 | + return _callSuper(this, TopBarTracking, arguments); | |
| 1461 | + } | |
| 1462 | + (0, _inherits2.default)(TopBarTracking, _BaseTracking); | |
| 1463 | + return (0, _createClass2.default)(TopBarTracking, null, [{ | |
| 1464 | + key: "init", | |
| 1465 | + value: function init() { | |
| 1466 | + this.waitForTopBar(); | |
| 1467 | + } | |
| 1468 | + }, { | |
| 1469 | + key: "waitForTopBar", | |
| 1470 | + value: function waitForTopBar() { | |
| 1471 | + var _this = this; | |
| 1472 | + var topBar = document.querySelector(TOP_BAR_SELECTORS.TOP_BAR_ROOT); | |
| 1473 | + if (topBar) { | |
| 1474 | + this.attachTopBarTracking(topBar); | |
| 1475 | + return; | |
| 1476 | + } | |
| 1477 | + var observer = this.addObserver(document.body, { | |
| 1478 | + childList: true, | |
| 1479 | + subtree: true | |
| 1480 | + }, function () { | |
| 1481 | + var foundTopBar = document.querySelector(TOP_BAR_SELECTORS.TOP_BAR_ROOT); | |
| 1482 | + if (foundTopBar) { | |
| 1483 | + _this.attachTopBarTracking(foundTopBar); | |
| 1484 | + observer.disconnect(); | |
| 1485 | + clearTimeout(timeoutId); | |
| 1486 | + } | |
| 1487 | + }); | |
| 1488 | + var timeoutId = setTimeout(function () { | |
| 1489 | + observer.disconnect(); | |
| 1490 | + }, 10000); | |
| 1491 | + } | |
| 1492 | + }, { | |
| 1493 | + key: "attachTopBarTracking", | |
| 1494 | + value: function attachTopBarTracking(topBar) { | |
| 1495 | + var _this2 = this; | |
| 1496 | + var buttons = topBar.querySelectorAll(TOP_BAR_SELECTORS.BAR_BUTTON); | |
| 1497 | + buttons.forEach(function (button) { | |
| 1498 | + _this2.addEventListenerTracked(button, 'click', function (event) { | |
| 1499 | + _this2.handleTopBarClick(event); | |
| 1500 | + }); | |
| 1501 | + }); | |
| 1502 | + this.observeTopBarChanges(topBar); | |
| 1503 | + } | |
| 1504 | + }, { | |
| 1505 | + key: "observeTopBarChanges", | |
| 1506 | + value: function observeTopBarChanges(topBar) { | |
| 1507 | + var _this3 = this; | |
| 1508 | + this.addObserver(topBar, { | |
| 1509 | + childList: true, | |
| 1510 | + subtree: true | |
| 1511 | + }, function (mutations) { | |
| 1512 | + mutations.forEach(function (mutation) { | |
| 1513 | + if ('childList' === mutation.type) { | |
| 1514 | + mutation.addedNodes.forEach(function (node) { | |
| 1515 | + if (1 === node.nodeType) { | |
| 1516 | + if (node.matches && node.matches(TOP_BAR_SELECTORS.BAR_BUTTON)) { | |
| 1517 | + _this3.addEventListenerTracked(node, 'click', function (event) { | |
| 1518 | + _this3.handleTopBarClick(event); | |
| 1519 | + }); | |
| 1520 | + } else { | |
| 1521 | + var buttons = node.querySelectorAll ? node.querySelectorAll(TOP_BAR_SELECTORS.BAR_BUTTON) : []; | |
| 1522 | + buttons.forEach(function (button) { | |
| 1523 | + _this3.addEventListenerTracked(button, 'click', function (event) { | |
| 1524 | + _this3.handleTopBarClick(event); | |
| 1525 | + }); | |
| 1526 | + }); | |
| 1527 | + } | |
| 1528 | + } | |
| 1529 | + }); | |
| 1530 | + } | |
| 1531 | + }); | |
| 1532 | + }); | |
| 1533 | + } | |
| 1534 | + }, { | |
| 1535 | + key: "handleTopBarClick", | |
| 1536 | + value: function handleTopBarClick(event) { | |
| 1537 | + var button = event.currentTarget; | |
| 1538 | + var itemId = this.extractItemId(button); | |
| 1539 | + _wpDashboardTracking.default.trackNavClicked(itemId, null, _wpDashboardTracking.NAV_AREAS.TOP_BAR); | |
| 1540 | + } | |
| 1541 | + }, { | |
| 1542 | + key: "extractItemId", | |
| 1543 | + value: function extractItemId(button) { | |
| 1544 | + var titleElement = button.querySelector(TOP_BAR_SELECTORS.BUTTON_TITLE); | |
| 1545 | + if (titleElement && titleElement.textContent.trim()) { | |
| 1546 | + return titleElement.textContent.trim(); | |
| 1547 | + } | |
| 1548 | + var textContent = button.textContent.trim(); | |
| 1549 | + if (textContent) { | |
| 1550 | + return textContent; | |
| 1551 | + } | |
| 1552 | + var href = button.getAttribute('href'); | |
| 1553 | + if (href) { | |
| 1554 | + var urlParams = new URLSearchParams(href.split('?')[1] || ''); | |
| 1555 | + var page = urlParams.get('page'); | |
| 1556 | + if (page) { | |
| 1557 | + return page; | |
| 1558 | + } | |
| 1559 | + if (href.includes('/wp-admin/')) { | |
| 1560 | + var pathParts = href.split('/wp-admin/')[1]; | |
| 1561 | + if (pathParts) { | |
| 1562 | + return pathParts.split('?')[0]; | |
| 1563 | + } | |
| 1564 | + } | |
| 1565 | + try { | |
| 1566 | + var url = new URL(href, window.location.origin); | |
| 1567 | + return url.pathname.split('/').filter(Boolean).pop() || url.hostname; | |
| 1568 | + } catch (error) { | |
| 1569 | + return href; | |
| 1570 | + } | |
| 1571 | + } | |
| 1572 | + var dataInfo = button.getAttribute('data-info'); | |
| 1573 | + if (dataInfo) { | |
| 1574 | + return dataInfo; | |
| 1575 | + } | |
| 1576 | + var classes = button.className.split(' ').filter(function (cls) { | |
| 1577 | + return cls && 'e-admin-top-bar__bar-button' !== cls; | |
| 1578 | + }); | |
| 1579 | + if (classes.length > 0) { | |
| 1580 | + return classes.join('-'); | |
| 1581 | + } | |
| 1582 | + return 'unknown-top-bar-button'; | |
| 1583 | + } | |
| 1584 | + }]); | |
| 1585 | +}(_baseTracking.default); | |
| 1586 | +var _default = exports["default"] = TopBarTracking; | |
| 1587 | + | |
| 1588 | +/***/ }), | |
| 1589 | + | |
| 1590 | +/***/ "../app/assets/js/event-track/dashboard/utils.js": | |
| 1591 | +/*!*******************************************************!*\ | |
| 1592 | + !*** ../app/assets/js/event-track/dashboard/utils.js ***! | |
| 1593 | + \*******************************************************/ | |
| 1594 | +/***/ ((__unused_webpack_module, exports) => { | |
| 1595 | + | |
| 1596 | +"use strict"; | |
| 1597 | + | |
| 1598 | + | |
| 1599 | +Object.defineProperty(exports, "__esModule", ({ | |
| 1600 | + value: true | |
| 1601 | +})); | |
| 1602 | +exports.DashboardUtils = void 0; | |
| 1603 | +var DashboardUtils = exports.DashboardUtils = { | |
| 1604 | + isElementorPage: function isElementorPage() { | |
| 1605 | + var urlParams = new URLSearchParams(window.location.search); | |
| 1606 | + var page = urlParams.get('page'); | |
| 1607 | + if (page && (page.startsWith('elementor') || page.includes('elementor'))) { | |
| 1608 | + return true; | |
| 1609 | + } | |
| 1610 | + var postType = urlParams.get('post_type'); | |
| 1611 | + if ('elementor_library' === postType || 'e-floating-buttons' === postType) { | |
| 1612 | + return true; | |
| 1613 | + } | |
| 1614 | + var body = document.body; | |
| 1615 | + var bodyClasses = body.className.split(' '); | |
| 1616 | + return bodyClasses.some(function (cls) { | |
| 1617 | + return cls.includes('elementor') && (cls.includes('page') || cls.includes('post-type')); | |
| 1618 | + }); | |
| 1619 | + } | |
| 1620 | +}; | |
| 1621 | + | |
| 1622 | +/***/ }), | |
| 1623 | + | |
| 1624 | +/***/ "../app/assets/js/event-track/wp-dashboard-tracking.js": | |
| 1625 | +/*!*************************************************************!*\ | |
| 1626 | + !*** ../app/assets/js/event-track/wp-dashboard-tracking.js ***! | |
| 1627 | + \*************************************************************/ | |
| 1628 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 1629 | + | |
| 1630 | +"use strict"; | |
| 1631 | + | |
| 1632 | + | |
| 1633 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 1634 | +Object.defineProperty(exports, "__esModule", ({ | |
| 1635 | + value: true | |
| 1636 | +})); | |
| 1637 | +exports["default"] = exports.SCREEN_TYPES = exports.NAV_AREAS = exports.CONTROL_TYPES = void 0; | |
| 1638 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 1639 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 1640 | +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 1641 | +var _navigation = _interopRequireDefault(__webpack_require__(/*! ./dashboard/navigation */ "../app/assets/js/event-track/dashboard/navigation.js")); | |
| 1642 | +var _pluginActions = _interopRequireDefault(__webpack_require__(/*! ./dashboard/plugin-actions */ "../app/assets/js/event-track/dashboard/plugin-actions.js")); | |
| 1643 | +var _promotion = _interopRequireDefault(__webpack_require__(/*! ./dashboard/promotion */ "../app/assets/js/event-track/dashboard/promotion.js")); | |
| 1644 | +var _screenView = _interopRequireDefault(__webpack_require__(/*! ./dashboard/screen-view */ "../app/assets/js/event-track/dashboard/screen-view.js")); | |
| 1645 | +var _menuPromotion = _interopRequireDefault(__webpack_require__(/*! ./dashboard/menu-promotion */ "../app/assets/js/event-track/dashboard/menu-promotion.js")); | |
| 1646 | +var _actionControls = _interopRequireDefault(__webpack_require__(/*! ./dashboard/action-controls */ "../app/assets/js/event-track/dashboard/action-controls.js")); | |
| 1647 | +var _topBar = _interopRequireDefault(__webpack_require__(/*! ./dashboard/top-bar */ "../app/assets/js/event-track/dashboard/top-bar.js")); | |
| 1648 | +var SESSION_TIMEOUT_MINUTES = 30; | |
| 1649 | +var MINUTE_MS = 60 * 1000; | |
| 1650 | +var SESSION_TIMEOUT = SESSION_TIMEOUT_MINUTES * MINUTE_MS; | |
| 1651 | +var ACTIVITY_CHECK_INTERVAL = 1 * MINUTE_MS; | |
| 1652 | +var SESSION_STORAGE_KEY = 'elementor_wpdash_session'; | |
| 1653 | +var PENDING_NAV_CLICK_KEY = 'elementor_wpdash_pending_nav'; | |
| 1654 | +var CONTROL_TYPES = exports.CONTROL_TYPES = { | |
| 1655 | + BUTTON: 'button', | |
| 1656 | + CHECKBOX: 'checkbox', | |
| 1657 | + RADIO: 'radio', | |
| 1658 | + LINK: 'link', | |
| 1659 | + SELECT: 'select', | |
| 1660 | + TOGGLE: 'toggle', | |
| 1661 | + FILTER: 'filter' | |
| 1662 | +}; | |
| 1663 | +var NAV_AREAS = exports.NAV_AREAS = { | |
| 1664 | + LEFT_MENU: 'left_menu', | |
| 1665 | + SUBMENU: 'submenu', | |
| 1666 | + HOVER_MENU: 'hover_menu', | |
| 1667 | + TOP_BAR: 'top_bar', | |
| 1668 | + SIDEBAR_MENU: 'sidebar' | |
| 1669 | +}; | |
| 1670 | +var SCREEN_TYPES = exports.SCREEN_TYPES = { | |
| 1671 | + TAB: 'tab', | |
| 1672 | + POPUP: 'popup', | |
| 1673 | + APP_SCREEN: 'app_screen' | |
| 1674 | +}; | |
| 1675 | +var WpDashboardTracking = exports["default"] = /*#__PURE__*/function () { | |
| 1676 | + function WpDashboardTracking() { | |
| 1677 | + (0, _classCallCheck2.default)(this, WpDashboardTracking); | |
| 1678 | + } | |
| 1679 | + return (0, _createClass2.default)(WpDashboardTracking, null, [{ | |
| 1680 | + key: "init", | |
| 1681 | + value: function init() { | |
| 1682 | + if (this.initialized) { | |
| 1683 | + return; | |
| 1684 | + } | |
| 1685 | + this.restoreOrCreateSession(); | |
| 1686 | + if (this.isEventsManagerAvailable()) { | |
| 1687 | + this.startSessionMonitoring(); | |
| 1688 | + this.attachActivityListeners(); | |
| 1689 | + this.attachNavigationListener(); | |
| 1690 | + this.initialized = true; | |
| 1691 | + } | |
| 1692 | + } | |
| 1693 | + }, { | |
| 1694 | + key: "restoreOrCreateSession", | |
| 1695 | + value: function restoreOrCreateSession() { | |
| 1696 | + var storedSession = this.getStoredSession(); | |
| 1697 | + if (storedSession) { | |
| 1698 | + this.sessionStartTime = storedSession.sessionStartTime; | |
| 1699 | + this.navItemsVisited = new Set(storedSession.navItemsVisited); | |
| 1700 | + this.lastActivityTime = Date.now(); | |
| 1701 | + this.sessionEnded = false; | |
| 1702 | + } else { | |
| 1703 | + this.sessionStartTime = Date.now(); | |
| 1704 | + this.lastActivityTime = Date.now(); | |
| 1705 | + this.sessionEnded = false; | |
| 1706 | + this.navItemsVisited = new Set(); | |
| 1707 | + } | |
| 1708 | + this.processPendingNavClick(); | |
| 1709 | + this.saveSessionToStorage(); | |
| 1710 | + } | |
| 1711 | + }, { | |
| 1712 | + key: "isEditorOneActive", | |
| 1713 | + value: function isEditorOneActive() { | |
| 1714 | + var _elementorCommon$conf, _elementorCommon; | |
| 1715 | + return (_elementorCommon$conf = (_elementorCommon = elementorCommon) === null || _elementorCommon === void 0 || (_elementorCommon = _elementorCommon.config) === null || _elementorCommon === void 0 || (_elementorCommon = _elementorCommon.editor_events) === null || _elementorCommon === void 0 ? void 0 : _elementorCommon.isEditorOneActive) !== null && _elementorCommon$conf !== void 0 ? _elementorCommon$conf : false; | |
| 1716 | + } | |
| 1717 | + }, { | |
| 1718 | + key: "processPendingNavClick", | |
| 1719 | + value: function processPendingNavClick() { | |
| 1720 | + try { | |
| 1721 | + var pendingNav = sessionStorage.getItem(PENDING_NAV_CLICK_KEY); | |
| 1722 | + if (pendingNav) { | |
| 1723 | + var _JSON$parse = JSON.parse(pendingNav), | |
| 1724 | + itemId = _JSON$parse.itemId, | |
| 1725 | + rootItem = _JSON$parse.rootItem, | |
| 1726 | + area = _JSON$parse.area; | |
| 1727 | + this.navItemsVisited.add(itemId); | |
| 1728 | + var properties = { | |
| 1729 | + wpdash_nav_item_id: itemId, | |
| 1730 | + wpdash_nav_area: area | |
| 1731 | + }; | |
| 1732 | + if (rootItem) { | |
| 1733 | + properties.wpdash_nav_item_root = rootItem; | |
| 1734 | + } | |
| 1735 | + this.dispatchEvent('wpdash_nav_clicked', properties, { | |
| 1736 | + send_immediately: true | |
| 1737 | + }); | |
| 1738 | + sessionStorage.removeItem(PENDING_NAV_CLICK_KEY); | |
| 1739 | + } | |
| 1740 | + } catch (error) { | |
| 1741 | + sessionStorage.removeItem(PENDING_NAV_CLICK_KEY); | |
| 1742 | + } | |
| 1743 | + } | |
| 1744 | + }, { | |
| 1745 | + key: "getStoredSession", | |
| 1746 | + value: function getStoredSession() { | |
| 1747 | + try { | |
| 1748 | + var stored = sessionStorage.getItem(SESSION_STORAGE_KEY); | |
| 1749 | + return stored ? JSON.parse(stored) : null; | |
| 1750 | + } catch (error) { | |
| 1751 | + return null; | |
| 1752 | + } | |
| 1753 | + } | |
| 1754 | + }, { | |
| 1755 | + key: "saveSessionToStorage", | |
| 1756 | + value: function saveSessionToStorage() { | |
| 1757 | + var sessionData = { | |
| 1758 | + sessionStartTime: this.sessionStartTime, | |
| 1759 | + navItemsVisited: Array.from(this.navItemsVisited) | |
| 1760 | + }; | |
| 1761 | + sessionStorage.setItem(SESSION_STORAGE_KEY, JSON.stringify(sessionData)); | |
| 1762 | + } | |
| 1763 | + }, { | |
| 1764 | + key: "clearStoredSession", | |
| 1765 | + value: function clearStoredSession() { | |
| 1766 | + sessionStorage.removeItem(SESSION_STORAGE_KEY); | |
| 1767 | + } | |
| 1768 | + }, { | |
| 1769 | + key: "isEventsManagerAvailable", | |
| 1770 | + value: function isEventsManagerAvailable() { | |
| 1771 | + var _elementorCommon2; | |
| 1772 | + return ((_elementorCommon2 = elementorCommon) === null || _elementorCommon2 === void 0 ? void 0 : _elementorCommon2.eventsManager) && 'function' === typeof elementorCommon.eventsManager.dispatchEvent; | |
| 1773 | + } | |
| 1774 | + }, { | |
| 1775 | + key: "canSendEvents", | |
| 1776 | + value: function canSendEvents() { | |
| 1777 | + var _elementorCommon3; | |
| 1778 | + return ((_elementorCommon3 = elementorCommon) === null || _elementorCommon3 === void 0 || (_elementorCommon3 = _elementorCommon3.config) === null || _elementorCommon3 === void 0 || (_elementorCommon3 = _elementorCommon3.editor_events) === null || _elementorCommon3 === void 0 ? void 0 : _elementorCommon3.can_send_events) || false; | |
| 1779 | + } | |
| 1780 | + }, { | |
| 1781 | + key: "dispatchEvent", | |
| 1782 | + value: function dispatchEvent(eventName) { | |
| 1783 | + var properties = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | |
| 1784 | + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; | |
| 1785 | + if (!this.isEventsManagerAvailable() || !this.canSendEvents()) { | |
| 1786 | + return; | |
| 1787 | + } | |
| 1788 | + elementorCommon.eventsManager.dispatchEvent(eventName, properties, options); | |
| 1789 | + } | |
| 1790 | + }, { | |
| 1791 | + key: "updateActivity", | |
| 1792 | + value: function updateActivity() { | |
| 1793 | + this.lastActivityTime = Date.now(); | |
| 1794 | + } | |
| 1795 | + }, { | |
| 1796 | + key: "startSessionMonitoring", | |
| 1797 | + value: function startSessionMonitoring() { | |
| 1798 | + var _this = this; | |
| 1799 | + this.activityCheckInterval = setInterval(function () { | |
| 1800 | + _this.checkSessionTimeout(); | |
| 1801 | + }, ACTIVITY_CHECK_INTERVAL); | |
| 1802 | + window.addEventListener('beforeunload', function () { | |
| 1803 | + if (!_this.sessionEnded && !_this.isNavigatingToElementor) { | |
| 1804 | + _this.trackSessionEnd('tab_closed'); | |
| 1805 | + } | |
| 1806 | + }); | |
| 1807 | + document.addEventListener('visibilitychange', function () { | |
| 1808 | + if (!_this.sessionEnded && document.hidden) { | |
| 1809 | + var timeSinceLastActivity = Date.now() - _this.lastActivityTime; | |
| 1810 | + if (timeSinceLastActivity > SESSION_TIMEOUT) { | |
| 1811 | + _this.trackSessionEnd('tab_inactive'); | |
| 1812 | + } | |
| 1813 | + } | |
| 1814 | + }); | |
| 1815 | + } | |
| 1816 | + }, { | |
| 1817 | + key: "isElementorPage", | |
| 1818 | + value: function isElementorPage(url) { | |
| 1819 | + try { | |
| 1820 | + var urlObj = new URL(url, window.location.origin); | |
| 1821 | + var params = urlObj.searchParams; | |
| 1822 | + var page = params.get('page'); | |
| 1823 | + var postType = params.get('post_type'); | |
| 1824 | + var action = params.get('action'); | |
| 1825 | + var elementorPages = ['elementor', 'go_knowledge_base_site', 'e-form-submissions']; | |
| 1826 | + var elementorPostTypes = ['elementor_library', 'e-floating-buttons']; | |
| 1827 | + return page && elementorPages.some(function (p) { | |
| 1828 | + return page.includes(p); | |
| 1829 | + }) || postType && elementorPostTypes.includes(postType) || action && action.includes('elementor'); | |
| 1830 | + } catch (error) { | |
| 1831 | + return false; | |
| 1832 | + } | |
| 1833 | + } | |
| 1834 | + }, { | |
| 1835 | + key: "isPluginsPage", | |
| 1836 | + value: function isPluginsPage(url) { | |
| 1837 | + try { | |
| 1838 | + var urlObj = new URL(url, window.location.origin); | |
| 1839 | + return urlObj.pathname.includes('plugins.php'); | |
| 1840 | + } catch (error) { | |
| 1841 | + return false; | |
| 1842 | + } | |
| 1843 | + } | |
| 1844 | + }, { | |
| 1845 | + key: "isNavigatingAwayFromElementor", | |
| 1846 | + value: function isNavigatingAwayFromElementor(targetUrl) { | |
| 1847 | + if (!targetUrl) { | |
| 1848 | + return false; | |
| 1849 | + } | |
| 1850 | + if (targetUrl.startsWith('#')) { | |
| 1851 | + return false; | |
| 1852 | + } | |
| 1853 | + return !this.isElementorPage(targetUrl); | |
| 1854 | + } | |
| 1855 | + }, { | |
| 1856 | + key: "isLinkOpeningInNewTab", | |
| 1857 | + value: function isLinkOpeningInNewTab(link) { | |
| 1858 | + var target = link.getAttribute('target'); | |
| 1859 | + return '_blank' === target || '_new' === target; | |
| 1860 | + } | |
| 1861 | + }, { | |
| 1862 | + key: "attachNavigationListener", | |
| 1863 | + value: function attachNavigationListener() { | |
| 1864 | + var _this2 = this; | |
| 1865 | + var handleLinkClick = function handleLinkClick(event) { | |
| 1866 | + var link = event.target.closest('a'); | |
| 1867 | + if (link && link.href) { | |
| 1868 | + if (_this2.isLinkOpeningInNewTab(link)) { | |
| 1869 | + return; | |
| 1870 | + } | |
| 1871 | + if (!_this2.sessionEnded && _this2.isNavigatingAwayFromElementor(link.href)) { | |
| 1872 | + _this2.trackSessionEnd('navigate_away'); | |
| 1873 | + } else if (_this2.isElementorPage(link.href)) { | |
| 1874 | + _this2.isNavigatingToElementor = true; | |
| 1875 | + } | |
| 1876 | + } | |
| 1877 | + var isSidebar = event.target.closest('#editor-one-sidebar-navigation'); | |
| 1878 | + if (isSidebar) { | |
| 1879 | + _this2.isNavigatingToElementor = true; | |
| 1880 | + } | |
| 1881 | + }; | |
| 1882 | + var handleFormSubmit = function handleFormSubmit(event) { | |
| 1883 | + var form = event.target; | |
| 1884 | + if (form.action) { | |
| 1885 | + if (!_this2.sessionEnded && _this2.isNavigatingAwayFromElementor(form.action)) { | |
| 1886 | + _this2.trackSessionEnd('navigate_away'); | |
| 1887 | + } else if (_this2.isElementorPage(form.action)) { | |
| 1888 | + _this2.isNavigatingToElementor = true; | |
| 1889 | + } | |
| 1890 | + } | |
| 1891 | + }; | |
| 1892 | + document.addEventListener('click', handleLinkClick, true); | |
| 1893 | + document.addEventListener('submit', handleFormSubmit, true); | |
| 1894 | + this.navigationListeners.push({ | |
| 1895 | + type: 'click', | |
| 1896 | + handler: handleLinkClick | |
| 1897 | + }, { | |
| 1898 | + type: 'submit', | |
| 1899 | + handler: handleFormSubmit | |
| 1900 | + }); | |
| 1901 | + } | |
| 1902 | + }, { | |
| 1903 | + key: "checkSessionTimeout", | |
| 1904 | + value: function checkSessionTimeout() { | |
| 1905 | + var timeSinceLastActivity = Date.now() - this.lastActivityTime; | |
| 1906 | + if (timeSinceLastActivity > SESSION_TIMEOUT && !this.sessionEnded) { | |
| 1907 | + this.trackSessionEnd('timeout'); | |
| 1908 | + } | |
| 1909 | + } | |
| 1910 | + }, { | |
| 1911 | + key: "attachActivityListeners", | |
| 1912 | + value: function attachActivityListeners() { | |
| 1913 | + var _this3 = this; | |
| 1914 | + var events = ['mousedown', 'keydown', 'scroll', 'touchstart', 'click']; | |
| 1915 | + events.forEach(function (event) { | |
| 1916 | + document.addEventListener(event, function () { | |
| 1917 | + _this3.updateActivity(); | |
| 1918 | + }, { | |
| 1919 | + capture: true, | |
| 1920 | + passive: true | |
| 1921 | + }); | |
| 1922 | + }); | |
| 1923 | + } | |
| 1924 | + }, { | |
| 1925 | + key: "formatDuration", | |
| 1926 | + value: function formatDuration(milliseconds) { | |
| 1927 | + var totalSeconds = Math.floor(milliseconds / 1000); | |
| 1928 | + return Number(totalSeconds.toFixed(2)); | |
| 1929 | + } | |
| 1930 | + }, { | |
| 1931 | + key: "trackNavClicked", | |
| 1932 | + value: function trackNavClicked(itemId) { | |
| 1933 | + var rootItem = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; | |
| 1934 | + var area = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : NAV_AREAS.LEFT_MENU; | |
| 1935 | + if (!this.initialized) { | |
| 1936 | + var pendingNav = { | |
| 1937 | + itemId: itemId, | |
| 1938 | + rootItem: rootItem, | |
| 1939 | + area: area | |
| 1940 | + }; | |
| 1941 | + sessionStorage.setItem(PENDING_NAV_CLICK_KEY, JSON.stringify(pendingNav)); | |
| 1942 | + return; | |
| 1943 | + } | |
| 1944 | + this.updateActivity(); | |
| 1945 | + this.navItemsVisited.add(itemId); | |
| 1946 | + this.saveSessionToStorage(); | |
| 1947 | + var properties = { | |
| 1948 | + wpdash_nav_item_id: itemId, | |
| 1949 | + wpdash_nav_area: area | |
| 1950 | + }; | |
| 1951 | + if (rootItem) { | |
| 1952 | + properties.wpdash_nav_item_root = rootItem; | |
| 1953 | + } | |
| 1954 | + this.dispatchEvent('wpdash_nav_clicked', properties); | |
| 1955 | + } | |
| 1956 | + }, { | |
| 1957 | + key: "trackScreenViewed", | |
| 1958 | + value: function trackScreenViewed(screenId) { | |
| 1959 | + var screenType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : SCREEN_TYPES.TAB; | |
| 1960 | + this.updateActivity(); | |
| 1961 | + var properties = { | |
| 1962 | + wpdash_screen_id: screenId, | |
| 1963 | + wpdash_screen_type: screenType | |
| 1964 | + }; | |
| 1965 | + this.dispatchEvent('wpdash_screen_viewed', properties); | |
| 1966 | + } | |
| 1967 | + }, { | |
| 1968 | + key: "trackActionControl", | |
| 1969 | + value: function trackActionControl(controlIdentifier, controlType) { | |
| 1970 | + this.updateActivity(); | |
| 1971 | + var properties = { | |
| 1972 | + wpdash_action_control_interacted: controlIdentifier, | |
| 1973 | + wpdash_control_type: controlType | |
| 1974 | + }; | |
| 1975 | + this.dispatchEvent('wpdash_action_control', properties); | |
| 1976 | + } | |
| 1977 | + }, { | |
| 1978 | + key: "trackPromoClicked", | |
| 1979 | + value: function trackPromoClicked(promoName, destination, clickPath) { | |
| 1980 | + this.updateActivity(); | |
| 1981 | + var properties = { | |
| 1982 | + wpdash_promo_name: promoName, | |
| 1983 | + wpdash_promo_destination: destination, | |
| 1984 | + wpdash_promo_clicked_path: clickPath | |
| 1985 | + }; | |
| 1986 | + this.dispatchEvent('wpdash_promo_clicked', properties); | |
| 1987 | + } | |
| 1988 | + }, { | |
| 1989 | + key: "trackSessionEnd", | |
| 1990 | + value: function trackSessionEnd() { | |
| 1991 | + var reason = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'timeout'; | |
| 1992 | + if (this.sessionEnded) { | |
| 1993 | + return; | |
| 1994 | + } | |
| 1995 | + this.sessionEnded = true; | |
| 1996 | + if (this.activityCheckInterval) { | |
| 1997 | + clearInterval(this.activityCheckInterval); | |
| 1998 | + this.activityCheckInterval = null; | |
| 1999 | + } | |
| 2000 | + var duration = Date.now() - this.sessionStartTime; | |
| 2001 | + var properties = { | |
| 2002 | + wpdash_endstate_nav_summary: Array.from(this.navItemsVisited), | |
| 2003 | + wpdash_endstate_nav_count: this.navItemsVisited.size, | |
| 2004 | + wpdash_endstate_duration: this.formatDuration(duration), | |
| 2005 | + reason: reason | |
| 2006 | + }; | |
| 2007 | + this.dispatchEvent('wpdash_session_end_state', properties); | |
| 2008 | + this.clearStoredSession(); | |
| 2009 | + } | |
| 2010 | + }, { | |
| 2011 | + key: "destroy", | |
| 2012 | + value: function destroy() { | |
| 2013 | + if (this.activityCheckInterval) { | |
| 2014 | + clearInterval(this.activityCheckInterval); | |
| 2015 | + } | |
| 2016 | + this.navigationListeners.forEach(function (_ref) { | |
| 2017 | + var type = _ref.type, | |
| 2018 | + handler = _ref.handler; | |
| 2019 | + document.removeEventListener(type, handler, true); | |
| 2020 | + }); | |
| 2021 | + this.navigationListeners = []; | |
| 2022 | + _screenView.default.destroy(); | |
| 2023 | + _promotion.default.destroy(); | |
| 2024 | + _menuPromotion.default.destroy(); | |
| 2025 | + _actionControls.default.destroy(); | |
| 2026 | + if (!WpDashboardTracking.isEditorOneActive()) { | |
| 2027 | + _topBar.default.destroy(); | |
| 2028 | + } | |
| 2029 | + this.initialized = false; | |
| 2030 | + } | |
| 2031 | + }]); | |
| 2032 | +}(); | |
| 2033 | +(0, _defineProperty2.default)(WpDashboardTracking, "sessionStartTime", Date.now()); | |
| 2034 | +(0, _defineProperty2.default)(WpDashboardTracking, "lastActivityTime", Date.now()); | |
| 2035 | +(0, _defineProperty2.default)(WpDashboardTracking, "sessionEnded", false); | |
| 2036 | +(0, _defineProperty2.default)(WpDashboardTracking, "navItemsVisited", new Set()); | |
| 2037 | +(0, _defineProperty2.default)(WpDashboardTracking, "activityCheckInterval", null); | |
| 2038 | +(0, _defineProperty2.default)(WpDashboardTracking, "initialized", false); | |
| 2039 | +(0, _defineProperty2.default)(WpDashboardTracking, "navigationListeners", []); | |
| 2040 | +(0, _defineProperty2.default)(WpDashboardTracking, "isNavigatingToElementor", false); | |
| 2041 | +window.addEventListener('elementor/admin/init', function () { | |
| 2042 | + var currentUrl = window.location.href; | |
| 2043 | + var isPluginsPage = WpDashboardTracking.isPluginsPage(currentUrl); | |
| 2044 | + var isElementorPage = WpDashboardTracking.isElementorPage(currentUrl); | |
| 2045 | + if (isPluginsPage) { | |
| 2046 | + _pluginActions.default.init(); | |
| 2047 | + } | |
| 2048 | + _navigation.default.init(); | |
| 2049 | + if (isElementorPage) { | |
| 2050 | + WpDashboardTracking.init(); | |
| 2051 | + _screenView.default.init(); | |
| 2052 | + _promotion.default.init(); | |
| 2053 | + _menuPromotion.default.init(); | |
| 2054 | + _actionControls.default.init(); | |
| 2055 | + if (!WpDashboardTracking.isEditorOneActive()) { | |
| 2056 | + _topBar.default.init(); | |
| 2057 | + } | |
| 2058 | + } | |
| 2059 | +}); | |
| 2060 | +window.addEventListener('beforeunload', function () { | |
| 2061 | + _navigation.default.destroy(); | |
| 2062 | + _pluginActions.default.destroy(); | |
| 2063 | + WpDashboardTracking.destroy(); | |
| 2064 | +}); | |
| 2065 | + | |
| 2066 | +/***/ }), | |
| 2067 | + | |
| 4 | 2068 | /***/ "../app/modules/import-export-customization/assets/js/shared/registry/base.js": |
| 5 | 2069 | /*!************************************************************************************!*\ |
| 6 | 2070 | !*** ../app/modules/import-export-customization/assets/js/shared/registry/base.js ***! |
| 7 | 2071 | \************************************************************************************/ |
| @@ -883,9 +2947,11 @@ | ||
| 883 | 2947 | var _scroll = _interopRequireDefault(__webpack_require__(/*! ./imports/utils/scroll */ "../assets/dev/js/modules/imports/utils/scroll.js")); |
| 884 | 2948 | var _forceMethodImplementation = _interopRequireDefault(__webpack_require__(/*! ./imports/force-method-implementation */ "../assets/dev/js/modules/imports/force-method-implementation.js")); |
| 885 | 2949 | var _templateRegistryHelpers = __webpack_require__(/*! ../../../../app/modules/import-export-customization/assets/js/shared/utils/template-registry-helpers */ "../app/modules/import-export-customization/assets/js/shared/utils/template-registry-helpers.js"); |
| 886 | 2950 | var _customizationDialogs = __webpack_require__(/*! ../../../../app/modules/import-export-customization/assets/js/shared/registry/customization-dialogs */ "../app/modules/import-export-customization/assets/js/shared/registry/customization-dialogs.js"); |
| 887 | -var baseModules = { | |
| 2951 | +var _appsEventTracking = __webpack_require__(/*! elementor-app/event-track/apps-event-tracking */ "../app/assets/js/event-track/apps-event-tracking.js"); | |
| 2952 | +var _wpDashboardTracking = _interopRequireDefault(__webpack_require__(/*! elementor-app/event-track/wp-dashboard-tracking */ "../app/assets/js/event-track/wp-dashboard-tracking.js")); | |
| 2953 | +var _default = exports["default"] = window.elementorModules = { | |
| 888 | 2954 | Module: _module.default, |
| 889 | 2955 | ViewModule: _viewModule.default, |
| 890 | 2956 | ArgsObject: _argsObject.default, |
| 891 | 2957 | ForceMethodImplementation: _forceMethodImplementation.default, |
| @@ -895,16 +2961,16 @@ | ||
| 895 | 2961 | }, |
| 896 | 2962 | importExport: { |
| 897 | 2963 | createGetInitialState: _templateRegistryHelpers.createGetInitialState, |
| 898 | 2964 | customizationDialogsRegistry: _customizationDialogs.customizationDialogsRegistry |
| 2965 | + }, | |
| 2966 | + appsEventTracking: { | |
| 2967 | + AppsEventTracking: _appsEventTracking.AppsEventTracking | |
| 2968 | + }, | |
| 2969 | + wpDashboardTracking: { | |
| 2970 | + WpDashboardTracking: _wpDashboardTracking.default | |
| 899 | 2971 | } |
| 900 | 2972 | }; |
| 901 | -if (!window.elementorModules) { | |
| 902 | - window.elementorModules = baseModules; | |
| 903 | -} else { | |
| 904 | - Object.assign(window.elementorModules, baseModules); | |
| 905 | -} | |
| 906 | -var _default = exports["default"] = window.elementorModules; | |
| 907 | 2973 | |
| 908 | 2974 | /***/ }), |
| 909 | 2975 | |
| 910 | 2976 | /***/ "../core/common/assets/js/views/modal/header.js": |
| @@ -934,13 +3000,8 @@ | ||
| 934 | 3000 | return _callSuper(this, _default, arguments); |
| 935 | 3001 | } |
| 936 | 3002 | (0, _inherits2.default)(_default, _Marionette$LayoutVie); |
| 937 | 3003 | return (0, _createClass2.default)(_default, [{ |
| 938 | - key: "tagName", | |
| 939 | - value: function tagName() { | |
| 940 | - return 'header'; | |
| 941 | - } | |
| 942 | - }, { | |
| 943 | 3004 | key: "className", |
| 944 | 3005 | value: function className() { |
| 945 | 3006 | return 'elementor-templates-modal__header'; |
| 946 | 3007 | } |
| @@ -1285,8 +3346,231 @@ | ||
| 1285 | 3346 | }(Marionette.ItemView); |
| 1286 | 3347 | |
| 1287 | 3348 | /***/ }), |
| 1288 | 3349 | |
| 3350 | +/***/ "../core/common/modules/events-manager/assets/js/events-config.js": | |
| 3351 | +/*!************************************************************************!*\ | |
| 3352 | + !*** ../core/common/modules/events-manager/assets/js/events-config.js ***! | |
| 3353 | + \************************************************************************/ | |
| 3354 | +/***/ ((__unused_webpack_module, exports) => { | |
| 3355 | + | |
| 3356 | +"use strict"; | |
| 3357 | + | |
| 3358 | + | |
| 3359 | +Object.defineProperty(exports, "__esModule", ({ | |
| 3360 | + value: true | |
| 3361 | +})); | |
| 3362 | +exports["default"] = void 0; | |
| 3363 | +var eventsConfig = { | |
| 3364 | + triggers: { | |
| 3365 | + click: 'Click', | |
| 3366 | + rightClick: 'Right Click', | |
| 3367 | + doubleClick: 'Double Click', | |
| 3368 | + accordionClick: 'Accordion Click', | |
| 3369 | + toggleClick: 'Toggle Click', | |
| 3370 | + dropdownClick: 'Click Dropdown', | |
| 3371 | + editorLoaded: 'Editor Loaded', | |
| 3372 | + visible: 'Visible', | |
| 3373 | + pageLoaded: 'Page Loaded' | |
| 3374 | + }, | |
| 3375 | + locations: { | |
| 3376 | + widgetPanel: 'Widget Panel', | |
| 3377 | + topBar: 'Top Bar', | |
| 3378 | + elementorEditor: 'Elementor Editor', | |
| 3379 | + templatesLibrary: { | |
| 3380 | + library: 'Templates Library' | |
| 3381 | + }, | |
| 3382 | + app: { | |
| 3383 | + import: 'Import Kit', | |
| 3384 | + export: 'Export Kit', | |
| 3385 | + kitLibrary: 'Kit Library', | |
| 3386 | + cloudKitLibrary: 'Cloud Kit Library' | |
| 3387 | + }, | |
| 3388 | + variables: 'Variables Panel', | |
| 3389 | + variablesManager: 'Variables Manager', | |
| 3390 | + admin: 'WP admin', | |
| 3391 | + structurePanel: 'Structure Panel', | |
| 3392 | + canvas: 'Canvas' | |
| 3393 | + }, | |
| 3394 | + secondaryLocations: { | |
| 3395 | + layout: 'Layout Section', | |
| 3396 | + basic: 'Basic Section', | |
| 3397 | + 'pro-elements': 'Pro Section', | |
| 3398 | + general: 'General Section', | |
| 3399 | + 'theme-elements': 'Site Section', | |
| 3400 | + 'theme-elements-single': 'Single Section', | |
| 3401 | + 'woocommerce-elements': 'WooCommerce Section', | |
| 3402 | + wordpress: 'WordPress Section', | |
| 3403 | + categories: 'Widgets Tab', | |
| 3404 | + global: 'Globals Tab', | |
| 3405 | + 'whats-new': 'What\'s New', | |
| 3406 | + 'document-settings': 'Document Settings icon', | |
| 3407 | + 'preview-page': 'Preview Page', | |
| 3408 | + 'publish-button': 'Publish Button', | |
| 3409 | + 'widget-panel': 'Widget Panel Icon', | |
| 3410 | + finder: 'Finder', | |
| 3411 | + help: 'Help', | |
| 3412 | + elementorLogoDropdown: 'top_bar_elementor_logo_dropdown', | |
| 3413 | + elementorLogo: 'Elementor Logo', | |
| 3414 | + eLogoMenu: 'E-logo Menu', | |
| 3415 | + notes: 'Notes', | |
| 3416 | + siteSettings: 'Site Settings', | |
| 3417 | + structure: 'Structure', | |
| 3418 | + documentNameDropdown: 'Document Name dropdown', | |
| 3419 | + responsiveControls: 'Responsive controls', | |
| 3420 | + launchpad: 'launchpad', | |
| 3421 | + checklistHeader: 'Checklist Header', | |
| 3422 | + checklistSteps: 'Checklist Steps', | |
| 3423 | + userPreferences: 'User Preferences', | |
| 3424 | + contextMenu: 'Context Menu', | |
| 3425 | + templateLibrary: { | |
| 3426 | + saveModal: 'Save to Modal', | |
| 3427 | + moveModal: 'Move to Modal', | |
| 3428 | + bulkMoveModal: 'Bulk Move to Modal', | |
| 3429 | + copyModal: 'Copy to Modal', | |
| 3430 | + bulkCopyModal: 'Bulk Copy to Modal', | |
| 3431 | + saveModalSelectFolder: 'Save to Modal - select folder', | |
| 3432 | + saveModalSelectConnect: 'Save to Modal - connect', | |
| 3433 | + saveModalSelectUpgrade: 'Save to Modal - upgrade', | |
| 3434 | + importModal: 'Import Modal', | |
| 3435 | + newFolderModal: 'New Folder Modal', | |
| 3436 | + deleteDialog: 'Delete Dialog', | |
| 3437 | + deleteFolderDialog: 'Delete Folder Dialog', | |
| 3438 | + renameDialog: 'Rename Dialog', | |
| 3439 | + createFolderDialog: 'Create Folder Dialog', | |
| 3440 | + applySettingsDialog: 'Apply Settings Dialog', | |
| 3441 | + cloudTab: 'Cloud Tab', | |
| 3442 | + siteTab: 'Site Tab', | |
| 3443 | + cloudTabFolder: 'Cloud Tab - Folder', | |
| 3444 | + cloudTabConnect: 'Cloud Tab - Connect', | |
| 3445 | + cloudTabUpgrade: 'Cloud Tab - Upgrade', | |
| 3446 | + morePopup: 'Context Menu', | |
| 3447 | + quotaBar: 'Quota Bar' | |
| 3448 | + }, | |
| 3449 | + kitLibrary: { | |
| 3450 | + cloudKitLibrary: 'kits_cloud_library', | |
| 3451 | + cloudKitLibraryConnect: 'kits_cloud_library_connect', | |
| 3452 | + cloudKitLibraryUpgrade: 'kits_cloud_library_upgrade', | |
| 3453 | + kitExportCustomization: 'kit_export_customization', | |
| 3454 | + kitExport: 'kit_export', | |
| 3455 | + kitExportCustomizationEdit: 'kit_export_customization_edit', | |
| 3456 | + kitExportSummary: 'kit_export_summary', | |
| 3457 | + kitImportUploadBox: 'kit_import_upload_box', | |
| 3458 | + kitImportCustomization: 'kit_import_customization', | |
| 3459 | + kitImportSummary: 'kit_import_summary' | |
| 3460 | + }, | |
| 3461 | + variablesPopover: 'Variables Popover', | |
| 3462 | + admin: { | |
| 3463 | + pluginToolsTab: 'plugin_tools_tab', | |
| 3464 | + pluginWebsiteTemplatesTab: 'plugin_website_templates_tab' | |
| 3465 | + }, | |
| 3466 | + componentsTab: 'Components Tab', | |
| 3467 | + canvasElement: 'Canvas Element' | |
| 3468 | + }, | |
| 3469 | + elements: { | |
| 3470 | + accordionSection: 'Accordion section', | |
| 3471 | + buttonIcon: 'Button Icon', | |
| 3472 | + mainCta: 'Main CTA', | |
| 3473 | + button: 'Button', | |
| 3474 | + link: 'Link', | |
| 3475 | + dropdown: 'Dropdown', | |
| 3476 | + toggle: 'Toggle', | |
| 3477 | + launchpadChecklist: 'Checklist popup' | |
| 3478 | + }, | |
| 3479 | + names: { | |
| 3480 | + v1: { | |
| 3481 | + layout: 'v1_widgets_tab_layout_section', | |
| 3482 | + basic: 'v1_widgets_tab_basic_section', | |
| 3483 | + 'pro-elements': 'v1_widgets_tab_pro_section', | |
| 3484 | + general: 'v1_widgets_tab_general_section', | |
| 3485 | + 'theme-elements': 'v1_widgets_tab_site_section', | |
| 3486 | + 'theme-elements-single': 'v1_widgets_tab_single_section', | |
| 3487 | + 'woocommerce-elements': 'v1_widgets_tab_woocommerce_section', | |
| 3488 | + wordpress: 'v1_widgets_tab_wordpress_section', | |
| 3489 | + categories: 'v1_widgets_tab', | |
| 3490 | + global: 'v1_globals_tab' | |
| 3491 | + }, | |
| 3492 | + topBar: { | |
| 3493 | + whatsNew: 'top_bar_whats_new', | |
| 3494 | + documentSettings: 'top_bar_document_settings_icon', | |
| 3495 | + previewPage: 'top_bar_preview_page', | |
| 3496 | + publishButton: 'top_bar_publish_button', | |
| 3497 | + widgetPanel: 'top_bar_widget_panel_icon', | |
| 3498 | + finder: 'top_bar_finder', | |
| 3499 | + help: 'top_bar_help', | |
| 3500 | + history: 'top_bar_elementor_logo_dropdown_history', | |
| 3501 | + userPreferences: 'top_bar_elementor_logo_dropdown_user_preferences', | |
| 3502 | + keyboardShortcuts: 'top_bar_elementor_logo_dropdown_keyboard_shortcuts', | |
| 3503 | + exitToWordpress: 'top_bar_elementor_logo_dropdown_exit_to_wordpress', | |
| 3504 | + themeBuilder: 'top_bar_elementor_logo_dropdown_theme_builder', | |
| 3505 | + notes: 'top_bar_notes', | |
| 3506 | + siteSettings: 'top_bar_site_setting', | |
| 3507 | + structure: 'top_bar_structure', | |
| 3508 | + documentNameDropdown: 'top_bar_document_name_dropdown', | |
| 3509 | + responsiveControls: 'top_bar_responsive_controls', | |
| 3510 | + launchpadOn: 'top_bar_checklist_icon_show', | |
| 3511 | + launchpadOff: 'top_bar_checklist_icon_hide', | |
| 3512 | + elementorLogoDropdown: 'open_e_menu', | |
| 3513 | + connectAccount: 'connect_account', | |
| 3514 | + accountConnected: 'account_connected' | |
| 3515 | + }, | |
| 3516 | + // ChecklistSteps event names are generated dynamically, based on stepId and action type taken: title, action, done, undone, upgrade | |
| 3517 | + elementorEditor: { | |
| 3518 | + checklist: { | |
| 3519 | + checklistHeaderClose: 'checklist_header_close_icon', | |
| 3520 | + checklistFirstPopup: 'checklist popup triggered' | |
| 3521 | + }, | |
| 3522 | + userPreferences: { | |
| 3523 | + checklistShow: 'checklist_userpreferences_toggle_show', | |
| 3524 | + checklistHide: 'checklist_userpreferences_toggle_hide' | |
| 3525 | + } | |
| 3526 | + }, | |
| 3527 | + variables: { | |
| 3528 | + open: 'open_variables_popover', | |
| 3529 | + add: 'add_new_variable', | |
| 3530 | + connect: 'connect_variable', | |
| 3531 | + save: 'save_new_variable', | |
| 3532 | + openManager: 'open_variables_manager', | |
| 3533 | + saveChanges: 'save_variables_changes', | |
| 3534 | + delete: 'delete_variable' | |
| 3535 | + }, | |
| 3536 | + components: { | |
| 3537 | + createClicked: 'component_create_clicked', | |
| 3538 | + createCancelled: 'component_creation_cancelled', | |
| 3539 | + created: 'component_created', | |
| 3540 | + instanceAdded: 'component_instance_added', | |
| 3541 | + edited: 'component_edited', | |
| 3542 | + propertiesPanelOpened: 'component_properties_panel_opened', | |
| 3543 | + propertiesGroupCreated: 'component_properties_group_created', | |
| 3544 | + propertyExposed: 'component_property_exposed', | |
| 3545 | + propertyRemoved: 'component_property_removed' | |
| 3546 | + }, | |
| 3547 | + global_classes: { | |
| 3548 | + classApplied: 'class_applied', | |
| 3549 | + classRemoved: 'class_removed', | |
| 3550 | + classManagerFilterCleared: 'class_manager_filter_cleared', | |
| 3551 | + classDeleted: 'class_deleted', | |
| 3552 | + classPublishConflict: 'class_publish_conflict', | |
| 3553 | + classRenamed: 'class_renamed', | |
| 3554 | + classCreated: 'class_created', | |
| 3555 | + classManagerSearched: 'class_manager_searched', | |
| 3556 | + classManagerFiltersOpened: 'class_manager_filters_opened', | |
| 3557 | + classManagerOpened: 'class_manager_opened', | |
| 3558 | + classManagerReorder: 'class_manager_reorder', | |
| 3559 | + classManagerFilterUsed: 'class_manager_filter_used', | |
| 3560 | + classUsageLocate: 'class_usage_locate', | |
| 3561 | + classUsageHovered: 'class_usage_hovered', | |
| 3562 | + classStyled: 'class_styled', | |
| 3563 | + classStateClicked: 'class_state_clicked', | |
| 3564 | + classUsageClicked: 'class_usage_clicked', | |
| 3565 | + classDuplicate: 'class_duplicate' | |
| 3566 | + } | |
| 3567 | + } | |
| 3568 | +}; | |
| 3569 | +var _default = exports["default"] = eventsConfig; | |
| 3570 | + | |
| 3571 | +/***/ }), | |
| 3572 | + | |
| 1289 | 3573 | /***/ "../modules/web-cli/assets/js/modules/command-base.js": |
| 1290 | 3574 | /*!************************************************************!*\ |
| 1291 | 3575 | !*** ../modules/web-cli/assets/js/modules/command-base.js ***! |
| 1292 | 3576 | \************************************************************/ |
| @@ -1884,9 +4168,9 @@ | ||
| 1884 | 4168 | var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); |
| 1885 | 4169 | var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); |
| 1886 | 4170 | var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); |
| 1887 | 4171 | var _commandCallbackBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-callback-base */ "../modules/web-cli/assets/js/modules/command-callback-base.js")); |
| 1888 | -var _toolkit = __webpack_require__(/*! @reduxjs/toolkit */ "@reduxjs/toolkit"); | |
| 4172 | +var _toolkit = __webpack_require__(/*! @reduxjs/toolkit */ "../node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js"); | |
| 1889 | 4173 | var _module = _interopRequireDefault(__webpack_require__(/*! elementor/assets/dev/js/modules/imports/module.js */ "../assets/dev/js/modules/imports/module.js")); |
| 1890 | 4174 | var _forceMethodImplementation = _interopRequireDefault(__webpack_require__(/*! ../utils/force-method-implementation */ "../modules/web-cli/assets/js/utils/force-method-implementation.js")); |
| 1891 | 4175 | var _deprecation = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/deprecation */ "../modules/web-cli/assets/js/utils/deprecation.js")); |
| 1892 | 4176 | function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } |
| @@ -2964,8 +5248,145 @@ | ||
| 2964 | 5248 | module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 2965 | 5249 | |
| 2966 | 5250 | /***/ }), |
| 2967 | 5251 | |
| 5252 | +/***/ "../node_modules/@babel/runtime/helpers/esm/defineProperty.js": | |
| 5253 | +/*!********************************************************************!*\ | |
| 5254 | + !*** ../node_modules/@babel/runtime/helpers/esm/defineProperty.js ***! | |
| 5255 | + \********************************************************************/ | |
| 5256 | +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { | |
| 5257 | + | |
| 5258 | +"use strict"; | |
| 5259 | +__webpack_require__.r(__webpack_exports__); | |
| 5260 | +/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 5261 | +/* harmony export */ "default": () => (/* binding */ _defineProperty) | |
| 5262 | +/* harmony export */ }); | |
| 5263 | +/* harmony import */ var _toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js"); | |
| 5264 | + | |
| 5265 | +function _defineProperty(e, r, t) { | |
| 5266 | + return (r = (0,_toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__["default"])(r)) in e ? Object.defineProperty(e, r, { | |
| 5267 | + value: t, | |
| 5268 | + enumerable: !0, | |
| 5269 | + configurable: !0, | |
| 5270 | + writable: !0 | |
| 5271 | + }) : e[r] = t, e; | |
| 5272 | +} | |
| 5273 | + | |
| 5274 | + | |
| 5275 | +/***/ }), | |
| 5276 | + | |
| 5277 | +/***/ "../node_modules/@babel/runtime/helpers/esm/objectSpread2.js": | |
| 5278 | +/*!*******************************************************************!*\ | |
| 5279 | + !*** ../node_modules/@babel/runtime/helpers/esm/objectSpread2.js ***! | |
| 5280 | + \*******************************************************************/ | |
| 5281 | +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { | |
| 5282 | + | |
| 5283 | +"use strict"; | |
| 5284 | +__webpack_require__.r(__webpack_exports__); | |
| 5285 | +/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 5286 | +/* harmony export */ "default": () => (/* binding */ _objectSpread2) | |
| 5287 | +/* harmony export */ }); | |
| 5288 | +/* harmony import */ var _defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defineProperty.js */ "../node_modules/@babel/runtime/helpers/esm/defineProperty.js"); | |
| 5289 | + | |
| 5290 | +function ownKeys(e, r) { | |
| 5291 | + var t = Object.keys(e); | |
| 5292 | + if (Object.getOwnPropertySymbols) { | |
| 5293 | + var o = Object.getOwnPropertySymbols(e); | |
| 5294 | + r && (o = o.filter(function (r) { | |
| 5295 | + return Object.getOwnPropertyDescriptor(e, r).enumerable; | |
| 5296 | + })), t.push.apply(t, o); | |
| 5297 | + } | |
| 5298 | + return t; | |
| 5299 | +} | |
| 5300 | +function _objectSpread2(e) { | |
| 5301 | + for (var r = 1; r < arguments.length; r++) { | |
| 5302 | + var t = null != arguments[r] ? arguments[r] : {}; | |
| 5303 | + r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { | |
| 5304 | + (0,_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(e, r, t[r]); | |
| 5305 | + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { | |
| 5306 | + Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); | |
| 5307 | + }); | |
| 5308 | + } | |
| 5309 | + return e; | |
| 5310 | +} | |
| 5311 | + | |
| 5312 | + | |
| 5313 | +/***/ }), | |
| 5314 | + | |
| 5315 | +/***/ "../node_modules/@babel/runtime/helpers/esm/toPrimitive.js": | |
| 5316 | +/*!*****************************************************************!*\ | |
| 5317 | + !*** ../node_modules/@babel/runtime/helpers/esm/toPrimitive.js ***! | |
| 5318 | + \*****************************************************************/ | |
| 5319 | +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { | |
| 5320 | + | |
| 5321 | +"use strict"; | |
| 5322 | +__webpack_require__.r(__webpack_exports__); | |
| 5323 | +/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 5324 | +/* harmony export */ "default": () => (/* binding */ toPrimitive) | |
| 5325 | +/* harmony export */ }); | |
| 5326 | +/* harmony import */ var _typeof_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/esm/typeof.js"); | |
| 5327 | + | |
| 5328 | +function toPrimitive(t, r) { | |
| 5329 | + if ("object" != (0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__["default"])(t) || !t) return t; | |
| 5330 | + var e = t[Symbol.toPrimitive]; | |
| 5331 | + if (void 0 !== e) { | |
| 5332 | + var i = e.call(t, r || "default"); | |
| 5333 | + if ("object" != (0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__["default"])(i)) return i; | |
| 5334 | + throw new TypeError("@@toPrimitive must return a primitive value."); | |
| 5335 | + } | |
| 5336 | + return ("string" === r ? String : Number)(t); | |
| 5337 | +} | |
| 5338 | + | |
| 5339 | + | |
| 5340 | +/***/ }), | |
| 5341 | + | |
| 5342 | +/***/ "../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js": | |
| 5343 | +/*!*******************************************************************!*\ | |
| 5344 | + !*** ../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js ***! | |
| 5345 | + \*******************************************************************/ | |
| 5346 | +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { | |
| 5347 | + | |
| 5348 | +"use strict"; | |
| 5349 | +__webpack_require__.r(__webpack_exports__); | |
| 5350 | +/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 5351 | +/* harmony export */ "default": () => (/* binding */ toPropertyKey) | |
| 5352 | +/* harmony export */ }); | |
| 5353 | +/* harmony import */ var _typeof_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/esm/typeof.js"); | |
| 5354 | +/* harmony import */ var _toPrimitive_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toPrimitive.js */ "../node_modules/@babel/runtime/helpers/esm/toPrimitive.js"); | |
| 5355 | + | |
| 5356 | + | |
| 5357 | +function toPropertyKey(t) { | |
| 5358 | + var i = (0,_toPrimitive_js__WEBPACK_IMPORTED_MODULE_1__["default"])(t, "string"); | |
| 5359 | + return "symbol" == (0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__["default"])(i) ? i : i + ""; | |
| 5360 | +} | |
| 5361 | + | |
| 5362 | + | |
| 5363 | +/***/ }), | |
| 5364 | + | |
| 5365 | +/***/ "../node_modules/@babel/runtime/helpers/esm/typeof.js": | |
| 5366 | +/*!************************************************************!*\ | |
| 5367 | + !*** ../node_modules/@babel/runtime/helpers/esm/typeof.js ***! | |
| 5368 | + \************************************************************/ | |
| 5369 | +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { | |
| 5370 | + | |
| 5371 | +"use strict"; | |
| 5372 | +__webpack_require__.r(__webpack_exports__); | |
| 5373 | +/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 5374 | +/* harmony export */ "default": () => (/* binding */ _typeof) | |
| 5375 | +/* harmony export */ }); | |
| 5376 | +function _typeof(o) { | |
| 5377 | + "@babel/helpers - typeof"; | |
| 5378 | + | |
| 5379 | + return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { | |
| 5380 | + return typeof o; | |
| 5381 | + } : function (o) { | |
| 5382 | + return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; | |
| 5383 | + }, _typeof(o); | |
| 5384 | +} | |
| 5385 | + | |
| 5386 | + | |
| 5387 | +/***/ }), | |
| 5388 | + | |
| 2968 | 5389 | /***/ "../node_modules/@babel/runtime/helpers/get.js": |
| 2969 | 5390 | /*!*****************************************************!*\ |
| 2970 | 5391 | !*** ../node_modules/@babel/runtime/helpers/get.js ***! |
| 2971 | 5392 | \*****************************************************/ |
| @@ -3393,17 +5814,3215 @@ | ||
| 3393 | 5814 | module.exports = _wrapNativeSuper, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 3394 | 5815 | |
| 3395 | 5816 | /***/ }), |
| 3396 | 5817 | |
| 3397 | -/***/ "@reduxjs/toolkit": | |
| 5818 | +/***/ "../node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js": | |
| 5819 | +/*!******************************************************************!*\ | |
| 5820 | + !*** ../node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js ***! | |
| 5821 | + \******************************************************************/ | |
| 5822 | +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { | |
| 5823 | + | |
| 5824 | +"use strict"; | |
| 5825 | +__webpack_require__.r(__webpack_exports__); | |
| 5826 | +/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 5827 | +/* harmony export */ EnhancerArray: () => (/* binding */ EnhancerArray), | |
| 5828 | +/* harmony export */ MiddlewareArray: () => (/* binding */ MiddlewareArray), | |
| 5829 | +/* harmony export */ SHOULD_AUTOBATCH: () => (/* binding */ SHOULD_AUTOBATCH), | |
| 5830 | +/* harmony export */ TaskAbortError: () => (/* binding */ TaskAbortError), | |
| 5831 | +/* harmony export */ __DO_NOT_USE__ActionTypes: () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_1__.__DO_NOT_USE__ActionTypes), | |
| 5832 | +/* harmony export */ addListener: () => (/* binding */ addListener), | |
| 5833 | +/* harmony export */ applyMiddleware: () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_1__.applyMiddleware), | |
| 5834 | +/* harmony export */ autoBatchEnhancer: () => (/* binding */ autoBatchEnhancer), | |
| 5835 | +/* harmony export */ bindActionCreators: () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_1__.bindActionCreators), | |
| 5836 | +/* harmony export */ clearAllListeners: () => (/* binding */ clearAllListeners), | |
| 5837 | +/* harmony export */ combineReducers: () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_1__.combineReducers), | |
| 5838 | +/* harmony export */ compose: () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_1__.compose), | |
| 5839 | +/* harmony export */ configureStore: () => (/* binding */ configureStore), | |
| 5840 | +/* harmony export */ createAction: () => (/* binding */ createAction), | |
| 5841 | +/* harmony export */ createActionCreatorInvariantMiddleware: () => (/* binding */ createActionCreatorInvariantMiddleware), | |
| 5842 | +/* harmony export */ createAsyncThunk: () => (/* binding */ createAsyncThunk), | |
| 5843 | +/* harmony export */ createDraftSafeSelector: () => (/* binding */ createDraftSafeSelector), | |
| 5844 | +/* harmony export */ createEntityAdapter: () => (/* binding */ createEntityAdapter), | |
| 5845 | +/* harmony export */ createImmutableStateInvariantMiddleware: () => (/* binding */ createImmutableStateInvariantMiddleware), | |
| 5846 | +/* harmony export */ createListenerMiddleware: () => (/* binding */ createListenerMiddleware), | |
| 5847 | +/* harmony export */ createNextState: () => (/* reexport safe */ immer__WEBPACK_IMPORTED_MODULE_0__["default"]), | |
| 5848 | +/* harmony export */ createReducer: () => (/* binding */ createReducer), | |
| 5849 | +/* harmony export */ createSelector: () => (/* reexport safe */ reselect__WEBPACK_IMPORTED_MODULE_2__.createSelector), | |
| 5850 | +/* harmony export */ createSerializableStateInvariantMiddleware: () => (/* binding */ createSerializableStateInvariantMiddleware), | |
| 5851 | +/* harmony export */ createSlice: () => (/* binding */ createSlice), | |
| 5852 | +/* harmony export */ createStore: () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_1__.createStore), | |
| 5853 | +/* harmony export */ current: () => (/* reexport safe */ immer__WEBPACK_IMPORTED_MODULE_0__.current), | |
| 5854 | +/* harmony export */ findNonSerializableValue: () => (/* binding */ findNonSerializableValue), | |
| 5855 | +/* harmony export */ freeze: () => (/* reexport safe */ immer__WEBPACK_IMPORTED_MODULE_0__.freeze), | |
| 5856 | +/* harmony export */ getDefaultMiddleware: () => (/* binding */ getDefaultMiddleware), | |
| 5857 | +/* harmony export */ getType: () => (/* binding */ getType), | |
| 5858 | +/* harmony export */ isAction: () => (/* binding */ isAction), | |
| 5859 | +/* harmony export */ isActionCreator: () => (/* binding */ isActionCreator), | |
| 5860 | +/* harmony export */ isAllOf: () => (/* binding */ isAllOf), | |
| 5861 | +/* harmony export */ isAnyOf: () => (/* binding */ isAnyOf), | |
| 5862 | +/* harmony export */ isAsyncThunkAction: () => (/* binding */ isAsyncThunkAction), | |
| 5863 | +/* harmony export */ isDraft: () => (/* reexport safe */ immer__WEBPACK_IMPORTED_MODULE_0__.isDraft), | |
| 5864 | +/* harmony export */ isFluxStandardAction: () => (/* binding */ isFSA), | |
| 5865 | +/* harmony export */ isFulfilled: () => (/* binding */ isFulfilled), | |
| 5866 | +/* harmony export */ isImmutableDefault: () => (/* binding */ isImmutableDefault), | |
| 5867 | +/* harmony export */ isPending: () => (/* binding */ isPending), | |
| 5868 | +/* harmony export */ isPlain: () => (/* binding */ isPlain), | |
| 5869 | +/* harmony export */ isPlainObject: () => (/* binding */ isPlainObject), | |
| 5870 | +/* harmony export */ isRejected: () => (/* binding */ isRejected), | |
| 5871 | +/* harmony export */ isRejectedWithValue: () => (/* binding */ isRejectedWithValue), | |
| 5872 | +/* harmony export */ legacy_createStore: () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_1__.legacy_createStore), | |
| 5873 | +/* harmony export */ miniSerializeError: () => (/* binding */ miniSerializeError), | |
| 5874 | +/* harmony export */ nanoid: () => (/* binding */ nanoid), | |
| 5875 | +/* harmony export */ original: () => (/* reexport safe */ immer__WEBPACK_IMPORTED_MODULE_0__.original), | |
| 5876 | +/* harmony export */ prepareAutoBatched: () => (/* binding */ prepareAutoBatched), | |
| 5877 | +/* harmony export */ removeListener: () => (/* binding */ removeListener), | |
| 5878 | +/* harmony export */ unwrapResult: () => (/* binding */ unwrapResult) | |
| 5879 | +/* harmony export */ }); | |
| 5880 | +/* harmony import */ var immer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! immer */ "../node_modules/immer/dist/immer.esm.mjs"); | |
| 5881 | +/* harmony import */ var redux__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! redux */ "../node_modules/redux/es/redux.js"); | |
| 5882 | +/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! reselect */ "../node_modules/reselect/es/index.js"); | |
| 5883 | +/* harmony import */ var redux_thunk__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! redux-thunk */ "../node_modules/redux-thunk/es/index.js"); | |
| 5884 | +var __extends = (undefined && undefined.__extends) || (function () { | |
| 5885 | + var extendStatics = function (d, b) { | |
| 5886 | + extendStatics = Object.setPrototypeOf || | |
| 5887 | + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | |
| 5888 | + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; | |
| 5889 | + return extendStatics(d, b); | |
| 5890 | + }; | |
| 5891 | + return function (d, b) { | |
| 5892 | + if (typeof b !== "function" && b !== null) | |
| 5893 | + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); | |
| 5894 | + extendStatics(d, b); | |
| 5895 | + function __() { this.constructor = d; } | |
| 5896 | + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | |
| 5897 | + }; | |
| 5898 | +})(); | |
| 5899 | +var __generator = (undefined && undefined.__generator) || function (thisArg, body) { | |
| 5900 | + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; | |
| 5901 | + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; | |
| 5902 | + function verb(n) { return function (v) { return step([n, v]); }; } | |
| 5903 | + function step(op) { | |
| 5904 | + if (f) throw new TypeError("Generator is already executing."); | |
| 5905 | + while (_) try { | |
| 5906 | + 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; | |
| 5907 | + if (y = 0, t) op = [op[0] & 2, t.value]; | |
| 5908 | + switch (op[0]) { | |
| 5909 | + case 0: case 1: t = op; break; | |
| 5910 | + case 4: _.label++; return { value: op[1], done: false }; | |
| 5911 | + case 5: _.label++; y = op[1]; op = [0]; continue; | |
| 5912 | + case 7: op = _.ops.pop(); _.trys.pop(); continue; | |
| 5913 | + default: | |
| 5914 | + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } | |
| 5915 | + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } | |
| 5916 | + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } | |
| 5917 | + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } | |
| 5918 | + if (t[2]) _.ops.pop(); | |
| 5919 | + _.trys.pop(); continue; | |
| 5920 | + } | |
| 5921 | + op = body.call(thisArg, _); | |
| 5922 | + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } | |
| 5923 | + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; | |
| 5924 | + } | |
| 5925 | +}; | |
| 5926 | +var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from) { | |
| 5927 | + for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) | |
| 5928 | + to[j] = from[i]; | |
| 5929 | + return to; | |
| 5930 | +}; | |
| 5931 | +var __defProp = Object.defineProperty; | |
| 5932 | +var __defProps = Object.defineProperties; | |
| 5933 | +var __getOwnPropDescs = Object.getOwnPropertyDescriptors; | |
| 5934 | +var __getOwnPropSymbols = Object.getOwnPropertySymbols; | |
| 5935 | +var __hasOwnProp = Object.prototype.hasOwnProperty; | |
| 5936 | +var __propIsEnum = Object.prototype.propertyIsEnumerable; | |
| 5937 | +var __defNormalProp = function (obj, key, value) { return key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value: value }) : obj[key] = value; }; | |
| 5938 | +var __spreadValues = function (a, b) { | |
| 5939 | + for (var prop in b || (b = {})) | |
| 5940 | + if (__hasOwnProp.call(b, prop)) | |
| 5941 | + __defNormalProp(a, prop, b[prop]); | |
| 5942 | + if (__getOwnPropSymbols) | |
| 5943 | + for (var _i = 0, _c = __getOwnPropSymbols(b); _i < _c.length; _i++) { | |
| 5944 | + var prop = _c[_i]; | |
| 5945 | + if (__propIsEnum.call(b, prop)) | |
| 5946 | + __defNormalProp(a, prop, b[prop]); | |
| 5947 | + } | |
| 5948 | + return a; | |
| 5949 | +}; | |
| 5950 | +var __spreadProps = function (a, b) { return __defProps(a, __getOwnPropDescs(b)); }; | |
| 5951 | +var __async = function (__this, __arguments, generator) { | |
| 5952 | + return new Promise(function (resolve, reject) { | |
| 5953 | + var fulfilled = function (value) { | |
| 5954 | + try { | |
| 5955 | + step(generator.next(value)); | |
| 5956 | + } | |
| 5957 | + catch (e) { | |
| 5958 | + reject(e); | |
| 5959 | + } | |
| 5960 | + }; | |
| 5961 | + var rejected = function (value) { | |
| 5962 | + try { | |
| 5963 | + step(generator.throw(value)); | |
| 5964 | + } | |
| 5965 | + catch (e) { | |
| 5966 | + reject(e); | |
| 5967 | + } | |
| 5968 | + }; | |
| 5969 | + var step = function (x) { return x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); }; | |
| 5970 | + step((generator = generator.apply(__this, __arguments)).next()); | |
| 5971 | + }); | |
| 5972 | +}; | |
| 5973 | +// src/index.ts | |
| 5974 | + | |
| 5975 | + | |
| 5976 | + | |
| 5977 | + | |
| 5978 | +// src/createDraftSafeSelector.ts | |
| 5979 | + | |
| 5980 | + | |
| 5981 | +var createDraftSafeSelector = function () { | |
| 5982 | + var args = []; | |
| 5983 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 5984 | + args[_i] = arguments[_i]; | |
| 5985 | + } | |
| 5986 | + var selector = reselect__WEBPACK_IMPORTED_MODULE_2__.createSelector.apply(void 0, args); | |
| 5987 | + var wrappedSelector = function (value) { | |
| 5988 | + var rest = []; | |
| 5989 | + for (var _i = 1; _i < arguments.length; _i++) { | |
| 5990 | + rest[_i - 1] = arguments[_i]; | |
| 5991 | + } | |
| 5992 | + return selector.apply(void 0, __spreadArray([(0,immer__WEBPACK_IMPORTED_MODULE_0__.isDraft)(value) ? (0,immer__WEBPACK_IMPORTED_MODULE_0__.current)(value) : value], rest)); | |
| 5993 | + }; | |
| 5994 | + return wrappedSelector; | |
| 5995 | +}; | |
| 5996 | +// src/configureStore.ts | |
| 5997 | + | |
| 5998 | +// src/devtoolsExtension.ts | |
| 5999 | + | |
| 6000 | +var composeWithDevTools = typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ : function () { | |
| 6001 | + if (arguments.length === 0) | |
| 6002 | + return void 0; | |
| 6003 | + if (typeof arguments[0] === "object") | |
| 6004 | + return redux__WEBPACK_IMPORTED_MODULE_1__.compose; | |
| 6005 | + return redux__WEBPACK_IMPORTED_MODULE_1__.compose.apply(null, arguments); | |
| 6006 | +}; | |
| 6007 | +var devToolsEnhancer = typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__ : function () { | |
| 6008 | + return function (noop2) { | |
| 6009 | + return noop2; | |
| 6010 | + }; | |
| 6011 | +}; | |
| 6012 | +// src/isPlainObject.ts | |
| 6013 | +function isPlainObject(value) { | |
| 6014 | + if (typeof value !== "object" || value === null) | |
| 6015 | + return false; | |
| 6016 | + var proto = Object.getPrototypeOf(value); | |
| 6017 | + if (proto === null) | |
| 6018 | + return true; | |
| 6019 | + var baseProto = proto; | |
| 6020 | + while (Object.getPrototypeOf(baseProto) !== null) { | |
| 6021 | + baseProto = Object.getPrototypeOf(baseProto); | |
| 6022 | + } | |
| 6023 | + return proto === baseProto; | |
| 6024 | +} | |
| 6025 | +// src/getDefaultMiddleware.ts | |
| 6026 | + | |
| 6027 | +// src/tsHelpers.ts | |
| 6028 | +var hasMatchFunction = function (v) { | |
| 6029 | + return v && typeof v.match === "function"; | |
| 6030 | +}; | |
| 6031 | +// src/createAction.ts | |
| 6032 | +function createAction(type, prepareAction) { | |
| 6033 | + function actionCreator() { | |
| 6034 | + var args = []; | |
| 6035 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 6036 | + args[_i] = arguments[_i]; | |
| 6037 | + } | |
| 6038 | + if (prepareAction) { | |
| 6039 | + var prepared = prepareAction.apply(void 0, args); | |
| 6040 | + if (!prepared) { | |
| 6041 | + throw new Error("prepareAction did not return an object"); | |
| 6042 | + } | |
| 6043 | + return __spreadValues(__spreadValues({ | |
| 6044 | + type: type, | |
| 6045 | + payload: prepared.payload | |
| 6046 | + }, "meta" in prepared && { meta: prepared.meta }), "error" in prepared && { error: prepared.error }); | |
| 6047 | + } | |
| 6048 | + return { type: type, payload: args[0] }; | |
| 6049 | + } | |
| 6050 | + actionCreator.toString = function () { return "" + type; }; | |
| 6051 | + actionCreator.type = type; | |
| 6052 | + actionCreator.match = function (action) { return action.type === type; }; | |
| 6053 | + return actionCreator; | |
| 6054 | +} | |
| 6055 | +function isAction(action) { | |
| 6056 | + return isPlainObject(action) && "type" in action; | |
| 6057 | +} | |
| 6058 | +function isActionCreator(action) { | |
| 6059 | + return typeof action === "function" && "type" in action && hasMatchFunction(action); | |
| 6060 | +} | |
| 6061 | +function isFSA(action) { | |
| 6062 | + return isAction(action) && typeof action.type === "string" && Object.keys(action).every(isValidKey); | |
| 6063 | +} | |
| 6064 | +function isValidKey(key) { | |
| 6065 | + return ["type", "payload", "error", "meta"].indexOf(key) > -1; | |
| 6066 | +} | |
| 6067 | +function getType(actionCreator) { | |
| 6068 | + return "" + actionCreator; | |
| 6069 | +} | |
| 6070 | +// src/actionCreatorInvariantMiddleware.ts | |
| 6071 | +function getMessage(type) { | |
| 6072 | + var splitType = type ? ("" + type).split("/") : []; | |
| 6073 | + var actionName = splitType[splitType.length - 1] || "actionCreator"; | |
| 6074 | + return "Detected an action creator with type \"" + (type || "unknown") + "\" being dispatched. \nMake sure you're calling the action creator before dispatching, i.e. `dispatch(" + actionName + "())` instead of `dispatch(" + actionName + ")`. This is necessary even if the action has no payload."; | |
| 6075 | +} | |
| 6076 | +function createActionCreatorInvariantMiddleware(options) { | |
| 6077 | + if (options === void 0) { options = {}; } | |
| 6078 | + if (false) // removed by dead control flow | |
| 6079 | +{} | |
| 6080 | + var _c = options.isActionCreator, isActionCreator2 = _c === void 0 ? isActionCreator : _c; | |
| 6081 | + return function () { return function (next) { return function (action) { | |
| 6082 | + if (isActionCreator2(action)) { | |
| 6083 | + console.warn(getMessage(action.type)); | |
| 6084 | + } | |
| 6085 | + return next(action); | |
| 6086 | + }; }; }; | |
| 6087 | +} | |
| 6088 | +// src/utils.ts | |
| 6089 | + | |
| 6090 | +function getTimeMeasureUtils(maxDelay, fnName) { | |
| 6091 | + var elapsed = 0; | |
| 6092 | + return { | |
| 6093 | + measureTime: function (fn) { | |
| 6094 | + var started = Date.now(); | |
| 6095 | + try { | |
| 6096 | + return fn(); | |
| 6097 | + } | |
| 6098 | + finally { | |
| 6099 | + var finished = Date.now(); | |
| 6100 | + elapsed += finished - started; | |
| 6101 | + } | |
| 6102 | + }, | |
| 6103 | + warnIfExceeded: function () { | |
| 6104 | + if (elapsed > maxDelay) { | |
| 6105 | + 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."); | |
| 6106 | + } | |
| 6107 | + } | |
| 6108 | + }; | |
| 6109 | +} | |
| 6110 | +var MiddlewareArray = /** @class */ (function (_super) { | |
| 6111 | + __extends(MiddlewareArray, _super); | |
| 6112 | + function MiddlewareArray() { | |
| 6113 | + var args = []; | |
| 6114 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 6115 | + args[_i] = arguments[_i]; | |
| 6116 | + } | |
| 6117 | + var _this = _super.apply(this, args) || this; | |
| 6118 | + Object.setPrototypeOf(_this, MiddlewareArray.prototype); | |
| 6119 | + return _this; | |
| 6120 | + } | |
| 6121 | + Object.defineProperty(MiddlewareArray, Symbol.species, { | |
| 6122 | + get: function () { | |
| 6123 | + return MiddlewareArray; | |
| 6124 | + }, | |
| 6125 | + enumerable: false, | |
| 6126 | + configurable: true | |
| 6127 | + }); | |
| 6128 | + MiddlewareArray.prototype.concat = function () { | |
| 6129 | + var arr = []; | |
| 6130 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 6131 | + arr[_i] = arguments[_i]; | |
| 6132 | + } | |
| 6133 | + return _super.prototype.concat.apply(this, arr); | |
| 6134 | + }; | |
| 6135 | + MiddlewareArray.prototype.prepend = function () { | |
| 6136 | + var arr = []; | |
| 6137 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 6138 | + arr[_i] = arguments[_i]; | |
| 6139 | + } | |
| 6140 | + if (arr.length === 1 && Array.isArray(arr[0])) { | |
| 6141 | + return new (MiddlewareArray.bind.apply(MiddlewareArray, __spreadArray([void 0], arr[0].concat(this))))(); | |
| 6142 | + } | |
| 6143 | + return new (MiddlewareArray.bind.apply(MiddlewareArray, __spreadArray([void 0], arr.concat(this))))(); | |
| 6144 | + }; | |
| 6145 | + return MiddlewareArray; | |
| 6146 | +}(Array)); | |
| 6147 | +var EnhancerArray = /** @class */ (function (_super) { | |
| 6148 | + __extends(EnhancerArray, _super); | |
| 6149 | + function EnhancerArray() { | |
| 6150 | + var args = []; | |
| 6151 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 6152 | + args[_i] = arguments[_i]; | |
| 6153 | + } | |
| 6154 | + var _this = _super.apply(this, args) || this; | |
| 6155 | + Object.setPrototypeOf(_this, EnhancerArray.prototype); | |
| 6156 | + return _this; | |
| 6157 | + } | |
| 6158 | + Object.defineProperty(EnhancerArray, Symbol.species, { | |
| 6159 | + get: function () { | |
| 6160 | + return EnhancerArray; | |
| 6161 | + }, | |
| 6162 | + enumerable: false, | |
| 6163 | + configurable: true | |
| 6164 | + }); | |
| 6165 | + EnhancerArray.prototype.concat = function () { | |
| 6166 | + var arr = []; | |
| 6167 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 6168 | + arr[_i] = arguments[_i]; | |
| 6169 | + } | |
| 6170 | + return _super.prototype.concat.apply(this, arr); | |
| 6171 | + }; | |
| 6172 | + EnhancerArray.prototype.prepend = function () { | |
| 6173 | + var arr = []; | |
| 6174 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 6175 | + arr[_i] = arguments[_i]; | |
| 6176 | + } | |
| 6177 | + if (arr.length === 1 && Array.isArray(arr[0])) { | |
| 6178 | + return new (EnhancerArray.bind.apply(EnhancerArray, __spreadArray([void 0], arr[0].concat(this))))(); | |
| 6179 | + } | |
| 6180 | + return new (EnhancerArray.bind.apply(EnhancerArray, __spreadArray([void 0], arr.concat(this))))(); | |
| 6181 | + }; | |
| 6182 | + return EnhancerArray; | |
| 6183 | +}(Array)); | |
| 6184 | +function freezeDraftable(val) { | |
| 6185 | + return (0,immer__WEBPACK_IMPORTED_MODULE_0__.isDraftable)(val) ? (0,immer__WEBPACK_IMPORTED_MODULE_0__["default"])(val, function () { | |
| 6186 | + }) : val; | |
| 6187 | +} | |
| 6188 | +// src/immutableStateInvariantMiddleware.ts | |
| 6189 | +var isProduction = "development" === "production"; | |
| 6190 | +var prefix = "Invariant failed"; | |
| 6191 | +function invariant(condition, message) { | |
| 6192 | + if (condition) { | |
| 6193 | + return; | |
| 6194 | + } | |
| 6195 | + if (isProduction) { | |
| 6196 | + throw new Error(prefix); | |
| 6197 | + } | |
| 6198 | + throw new Error(prefix + ": " + (message || "")); | |
| 6199 | +} | |
| 6200 | +function stringify(obj, serializer, indent, decycler) { | |
| 6201 | + return JSON.stringify(obj, getSerialize(serializer, decycler), indent); | |
| 6202 | +} | |
| 6203 | +function getSerialize(serializer, decycler) { | |
| 6204 | + var stack = [], keys = []; | |
| 6205 | + if (!decycler) | |
| 6206 | + decycler = function (_, value) { | |
| 6207 | + if (stack[0] === value) | |
| 6208 | + return "[Circular ~]"; | |
| 6209 | + return "[Circular ~." + keys.slice(0, stack.indexOf(value)).join(".") + "]"; | |
| 6210 | + }; | |
| 6211 | + return function (key, value) { | |
| 6212 | + if (stack.length > 0) { | |
| 6213 | + var thisPos = stack.indexOf(this); | |
| 6214 | + ~thisPos ? stack.splice(thisPos + 1) : stack.push(this); | |
| 6215 | + ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key); | |
| 6216 | + if (~stack.indexOf(value)) | |
| 6217 | + value = decycler.call(this, key, value); | |
| 6218 | + } | |
| 6219 | + else | |
| 6220 | + stack.push(value); | |
| 6221 | + return serializer == null ? value : serializer.call(this, key, value); | |
| 6222 | + }; | |
| 6223 | +} | |
| 6224 | +function isImmutableDefault(value) { | |
| 6225 | + return typeof value !== "object" || value == null || Object.isFrozen(value); | |
| 6226 | +} | |
| 6227 | +function trackForMutations(isImmutable, ignorePaths, obj) { | |
| 6228 | + var trackedProperties = trackProperties(isImmutable, ignorePaths, obj); | |
| 6229 | + return { | |
| 6230 | + detectMutations: function () { | |
| 6231 | + return detectMutations(isImmutable, ignorePaths, trackedProperties, obj); | |
| 6232 | + } | |
| 6233 | + }; | |
| 6234 | +} | |
| 6235 | +function trackProperties(isImmutable, ignorePaths, obj, path, checkedObjects) { | |
| 6236 | + if (ignorePaths === void 0) { ignorePaths = []; } | |
| 6237 | + if (path === void 0) { path = ""; } | |
| 6238 | + if (checkedObjects === void 0) { checkedObjects = new Set(); } | |
| 6239 | + var tracked = { value: obj }; | |
| 6240 | + if (!isImmutable(obj) && !checkedObjects.has(obj)) { | |
| 6241 | + checkedObjects.add(obj); | |
| 6242 | + tracked.children = {}; | |
| 6243 | + for (var key in obj) { | |
| 6244 | + var childPath = path ? path + "." + key : key; | |
| 6245 | + if (ignorePaths.length && ignorePaths.indexOf(childPath) !== -1) { | |
| 6246 | + continue; | |
| 6247 | + } | |
| 6248 | + tracked.children[key] = trackProperties(isImmutable, ignorePaths, obj[key], childPath); | |
| 6249 | + } | |
| 6250 | + } | |
| 6251 | + return tracked; | |
| 6252 | +} | |
| 6253 | +function detectMutations(isImmutable, ignoredPaths, trackedProperty, obj, sameParentRef, path) { | |
| 6254 | + if (ignoredPaths === void 0) { ignoredPaths = []; } | |
| 6255 | + if (sameParentRef === void 0) { sameParentRef = false; } | |
| 6256 | + if (path === void 0) { path = ""; } | |
| 6257 | + var prevObj = trackedProperty ? trackedProperty.value : void 0; | |
| 6258 | + var sameRef = prevObj === obj; | |
| 6259 | + if (sameParentRef && !sameRef && !Number.isNaN(obj)) { | |
| 6260 | + return { wasMutated: true, path: path }; | |
| 6261 | + } | |
| 6262 | + if (isImmutable(prevObj) || isImmutable(obj)) { | |
| 6263 | + return { wasMutated: false }; | |
| 6264 | + } | |
| 6265 | + var keysToDetect = {}; | |
| 6266 | + for (var key in trackedProperty.children) { | |
| 6267 | + keysToDetect[key] = true; | |
| 6268 | + } | |
| 6269 | + for (var key in obj) { | |
| 6270 | + keysToDetect[key] = true; | |
| 6271 | + } | |
| 6272 | + var hasIgnoredPaths = ignoredPaths.length > 0; | |
| 6273 | + var _loop_1 = function (key) { | |
| 6274 | + var nestedPath = path ? path + "." + key : key; | |
| 6275 | + if (hasIgnoredPaths) { | |
| 6276 | + var hasMatches = ignoredPaths.some(function (ignored) { | |
| 6277 | + if (ignored instanceof RegExp) { | |
| 6278 | + return ignored.test(nestedPath); | |
| 6279 | + } | |
| 6280 | + return nestedPath === ignored; | |
| 6281 | + }); | |
| 6282 | + if (hasMatches) { | |
| 6283 | + return "continue"; | |
| 6284 | + } | |
| 6285 | + } | |
| 6286 | + var result = detectMutations(isImmutable, ignoredPaths, trackedProperty.children[key], obj[key], sameRef, nestedPath); | |
| 6287 | + if (result.wasMutated) { | |
| 6288 | + return { value: result }; | |
| 6289 | + } | |
| 6290 | + }; | |
| 6291 | + for (var key in keysToDetect) { | |
| 6292 | + var state_1 = _loop_1(key); | |
| 6293 | + if (typeof state_1 === "object") | |
| 6294 | + return state_1.value; | |
| 6295 | + } | |
| 6296 | + return { wasMutated: false }; | |
| 6297 | +} | |
| 6298 | +function createImmutableStateInvariantMiddleware(options) { | |
| 6299 | + if (options === void 0) { options = {}; } | |
| 6300 | + if (false) // removed by dead control flow | |
| 6301 | +{} | |
| 6302 | + 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; | |
| 6303 | + ignoredPaths = ignoredPaths || ignore; | |
| 6304 | + var track = trackForMutations.bind(null, isImmutable, ignoredPaths); | |
| 6305 | + return function (_c) { | |
| 6306 | + var getState = _c.getState; | |
| 6307 | + var state = getState(); | |
| 6308 | + var tracker = track(state); | |
| 6309 | + var result; | |
| 6310 | + return function (next) { return function (action) { | |
| 6311 | + var measureUtils = getTimeMeasureUtils(warnAfter, "ImmutableStateInvariantMiddleware"); | |
| 6312 | + measureUtils.measureTime(function () { | |
| 6313 | + state = getState(); | |
| 6314 | + result = tracker.detectMutations(); | |
| 6315 | + tracker = track(state); | |
| 6316 | + 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)"); | |
| 6317 | + }); | |
| 6318 | + var dispatchedAction = next(action); | |
| 6319 | + measureUtils.measureTime(function () { | |
| 6320 | + state = getState(); | |
| 6321 | + result = tracker.detectMutations(); | |
| 6322 | + tracker = track(state); | |
| 6323 | + 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)"); | |
| 6324 | + }); | |
| 6325 | + measureUtils.warnIfExceeded(); | |
| 6326 | + return dispatchedAction; | |
| 6327 | + }; }; | |
| 6328 | + }; | |
| 6329 | +} | |
| 6330 | +// src/serializableStateInvariantMiddleware.ts | |
| 6331 | +function isPlain(val) { | |
| 6332 | + var type = typeof val; | |
| 6333 | + return val == null || type === "string" || type === "boolean" || type === "number" || Array.isArray(val) || isPlainObject(val); | |
| 6334 | +} | |
| 6335 | +function findNonSerializableValue(value, path, isSerializable, getEntries, ignoredPaths, cache) { | |
| 6336 | + if (path === void 0) { path = ""; } | |
| 6337 | + if (isSerializable === void 0) { isSerializable = isPlain; } | |
| 6338 | + if (ignoredPaths === void 0) { ignoredPaths = []; } | |
| 6339 | + var foundNestedSerializable; | |
| 6340 | + if (!isSerializable(value)) { | |
| 6341 | + return { | |
| 6342 | + keyPath: path || "<root>", | |
| 6343 | + value: value | |
| 6344 | + }; | |
| 6345 | + } | |
| 6346 | + if (typeof value !== "object" || value === null) { | |
| 6347 | + return false; | |
| 6348 | + } | |
| 6349 | + if (cache == null ? void 0 : cache.has(value)) | |
| 6350 | + return false; | |
| 6351 | + var entries = getEntries != null ? getEntries(value) : Object.entries(value); | |
| 6352 | + var hasIgnoredPaths = ignoredPaths.length > 0; | |
| 6353 | + var _loop_2 = function (key, nestedValue) { | |
| 6354 | + var nestedPath = path ? path + "." + key : key; | |
| 6355 | + if (hasIgnoredPaths) { | |
| 6356 | + var hasMatches = ignoredPaths.some(function (ignored) { | |
| 6357 | + if (ignored instanceof RegExp) { | |
| 6358 | + return ignored.test(nestedPath); | |
| 6359 | + } | |
| 6360 | + return nestedPath === ignored; | |
| 6361 | + }); | |
| 6362 | + if (hasMatches) { | |
| 6363 | + return "continue"; | |
| 6364 | + } | |
| 6365 | + } | |
| 6366 | + if (!isSerializable(nestedValue)) { | |
| 6367 | + return { value: { | |
| 6368 | + keyPath: nestedPath, | |
| 6369 | + value: nestedValue | |
| 6370 | + } }; | |
| 6371 | + } | |
| 6372 | + if (typeof nestedValue === "object") { | |
| 6373 | + foundNestedSerializable = findNonSerializableValue(nestedValue, nestedPath, isSerializable, getEntries, ignoredPaths, cache); | |
| 6374 | + if (foundNestedSerializable) { | |
| 6375 | + return { value: foundNestedSerializable }; | |
| 6376 | + } | |
| 6377 | + } | |
| 6378 | + }; | |
| 6379 | + for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) { | |
| 6380 | + var _c = entries_1[_i], key = _c[0], nestedValue = _c[1]; | |
| 6381 | + var state_2 = _loop_2(key, nestedValue); | |
| 6382 | + if (typeof state_2 === "object") | |
| 6383 | + return state_2.value; | |
| 6384 | + } | |
| 6385 | + if (cache && isNestedFrozen(value)) | |
| 6386 | + cache.add(value); | |
| 6387 | + return false; | |
| 6388 | +} | |
| 6389 | +function isNestedFrozen(value) { | |
| 6390 | + if (!Object.isFrozen(value)) | |
| 6391 | + return false; | |
| 6392 | + for (var _i = 0, _c = Object.values(value); _i < _c.length; _i++) { | |
| 6393 | + var nestedValue = _c[_i]; | |
| 6394 | + if (typeof nestedValue !== "object" || nestedValue === null) | |
| 6395 | + continue; | |
| 6396 | + if (!isNestedFrozen(nestedValue)) | |
| 6397 | + return false; | |
| 6398 | + } | |
| 6399 | + return true; | |
| 6400 | +} | |
| 6401 | +function createSerializableStateInvariantMiddleware(options) { | |
| 6402 | + if (options === void 0) { options = {}; } | |
| 6403 | + if (false) // removed by dead control flow | |
| 6404 | +{} | |
| 6405 | + 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; | |
| 6406 | + var cache = !disableCache && WeakSet ? new WeakSet() : void 0; | |
| 6407 | + return function (storeAPI) { return function (next) { return function (action) { | |
| 6408 | + var result = next(action); | |
| 6409 | + var measureUtils = getTimeMeasureUtils(warnAfter, "SerializableStateInvariantMiddleware"); | |
| 6410 | + if (!ignoreActions && !(ignoredActions.length && ignoredActions.indexOf(action.type) !== -1)) { | |
| 6411 | + measureUtils.measureTime(function () { | |
| 6412 | + var foundActionNonSerializableValue = findNonSerializableValue(action, "", isSerializable, getEntries, ignoredActionPaths, cache); | |
| 6413 | + if (foundActionNonSerializableValue) { | |
| 6414 | + var keyPath = foundActionNonSerializableValue.keyPath, value = foundActionNonSerializableValue.value; | |
| 6415 | + 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)"); | |
| 6416 | + } | |
| 6417 | + }); | |
| 6418 | + } | |
| 6419 | + if (!ignoreState) { | |
| 6420 | + measureUtils.measureTime(function () { | |
| 6421 | + var state = storeAPI.getState(); | |
| 6422 | + var foundStateNonSerializableValue = findNonSerializableValue(state, "", isSerializable, getEntries, ignoredPaths, cache); | |
| 6423 | + if (foundStateNonSerializableValue) { | |
| 6424 | + var keyPath = foundStateNonSerializableValue.keyPath, value = foundStateNonSerializableValue.value; | |
| 6425 | + 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)"); | |
| 6426 | + } | |
| 6427 | + }); | |
| 6428 | + measureUtils.warnIfExceeded(); | |
| 6429 | + } | |
| 6430 | + return result; | |
| 6431 | + }; }; }; | |
| 6432 | +} | |
| 6433 | +// src/getDefaultMiddleware.ts | |
| 6434 | +function isBoolean(x) { | |
| 6435 | + return typeof x === "boolean"; | |
| 6436 | +} | |
| 6437 | +function curryGetDefaultMiddleware() { | |
| 6438 | + return function curriedGetDefaultMiddleware(options) { | |
| 6439 | + return getDefaultMiddleware(options); | |
| 6440 | + }; | |
| 6441 | +} | |
| 6442 | +function getDefaultMiddleware(options) { | |
| 6443 | + if (options === void 0) { options = {}; } | |
| 6444 | + var _c = options.thunk, thunk = _c === void 0 ? true : _c, _d = options.immutableCheck, immutableCheck = _d === void 0 ? true : _d, _e = options.serializableCheck, serializableCheck = _e === void 0 ? true : _e, _f = options.actionCreatorCheck, actionCreatorCheck = _f === void 0 ? true : _f; | |
| 6445 | + var middlewareArray = new MiddlewareArray(); | |
| 6446 | + if (thunk) { | |
| 6447 | + if (isBoolean(thunk)) { | |
| 6448 | + middlewareArray.push(redux_thunk__WEBPACK_IMPORTED_MODULE_3__["default"]); | |
| 6449 | + } | |
| 6450 | + else { | |
| 6451 | + middlewareArray.push(redux_thunk__WEBPACK_IMPORTED_MODULE_3__["default"].withExtraArgument(thunk.extraArgument)); | |
| 6452 | + } | |
| 6453 | + } | |
| 6454 | + if (true) { | |
| 6455 | + if (immutableCheck) { | |
| 6456 | + var immutableOptions = {}; | |
| 6457 | + if (!isBoolean(immutableCheck)) { | |
| 6458 | + immutableOptions = immutableCheck; | |
| 6459 | + } | |
| 6460 | + middlewareArray.unshift(createImmutableStateInvariantMiddleware(immutableOptions)); | |
| 6461 | + } | |
| 6462 | + if (serializableCheck) { | |
| 6463 | + var serializableOptions = {}; | |
| 6464 | + if (!isBoolean(serializableCheck)) { | |
| 6465 | + serializableOptions = serializableCheck; | |
| 6466 | + } | |
| 6467 | + middlewareArray.push(createSerializableStateInvariantMiddleware(serializableOptions)); | |
| 6468 | + } | |
| 6469 | + if (actionCreatorCheck) { | |
| 6470 | + var actionCreatorOptions = {}; | |
| 6471 | + if (!isBoolean(actionCreatorCheck)) { | |
| 6472 | + actionCreatorOptions = actionCreatorCheck; | |
| 6473 | + } | |
| 6474 | + middlewareArray.unshift(createActionCreatorInvariantMiddleware(actionCreatorOptions)); | |
| 6475 | + } | |
| 6476 | + } | |
| 6477 | + return middlewareArray; | |
| 6478 | +} | |
| 6479 | +// src/configureStore.ts | |
| 6480 | +var IS_PRODUCTION = "development" === "production"; | |
| 6481 | +function configureStore(options) { | |
| 6482 | + var curriedGetDefaultMiddleware = curryGetDefaultMiddleware(); | |
| 6483 | + 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; | |
| 6484 | + var rootReducer; | |
| 6485 | + if (typeof reducer === "function") { | |
| 6486 | + rootReducer = reducer; | |
| 6487 | + } | |
| 6488 | + else if (isPlainObject(reducer)) { | |
| 6489 | + rootReducer = (0,redux__WEBPACK_IMPORTED_MODULE_1__.combineReducers)(reducer); | |
| 6490 | + } | |
| 6491 | + else { | |
| 6492 | + throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers'); | |
| 6493 | + } | |
| 6494 | + var finalMiddleware = middleware; | |
| 6495 | + if (typeof finalMiddleware === "function") { | |
| 6496 | + finalMiddleware = finalMiddleware(curriedGetDefaultMiddleware); | |
| 6497 | + if (!IS_PRODUCTION && !Array.isArray(finalMiddleware)) { | |
| 6498 | + throw new Error("when using a middleware builder function, an array of middleware must be returned"); | |
| 6499 | + } | |
| 6500 | + } | |
| 6501 | + if (!IS_PRODUCTION && finalMiddleware.some(function (item) { return typeof item !== "function"; })) { | |
| 6502 | + throw new Error("each middleware provided to configureStore must be a function"); | |
| 6503 | + } | |
| 6504 | + var middlewareEnhancer = redux__WEBPACK_IMPORTED_MODULE_1__.applyMiddleware.apply(void 0, finalMiddleware); | |
| 6505 | + var finalCompose = redux__WEBPACK_IMPORTED_MODULE_1__.compose; | |
| 6506 | + if (devTools) { | |
| 6507 | + finalCompose = composeWithDevTools(__spreadValues({ | |
| 6508 | + trace: !IS_PRODUCTION | |
| 6509 | + }, typeof devTools === "object" && devTools)); | |
| 6510 | + } | |
| 6511 | + var defaultEnhancers = new EnhancerArray(middlewareEnhancer); | |
| 6512 | + var storeEnhancers = defaultEnhancers; | |
| 6513 | + if (Array.isArray(enhancers)) { | |
| 6514 | + storeEnhancers = __spreadArray([middlewareEnhancer], enhancers); | |
| 6515 | + } | |
| 6516 | + else if (typeof enhancers === "function") { | |
| 6517 | + storeEnhancers = enhancers(defaultEnhancers); | |
| 6518 | + } | |
| 6519 | + var composedEnhancer = finalCompose.apply(void 0, storeEnhancers); | |
| 6520 | + return (0,redux__WEBPACK_IMPORTED_MODULE_1__.createStore)(rootReducer, preloadedState, composedEnhancer); | |
| 6521 | +} | |
| 6522 | +// src/createReducer.ts | |
| 6523 | + | |
| 6524 | +// src/mapBuilders.ts | |
| 6525 | +function executeReducerBuilderCallback(builderCallback) { | |
| 6526 | + var actionsMap = {}; | |
| 6527 | + var actionMatchers = []; | |
| 6528 | + var defaultCaseReducer; | |
| 6529 | + var builder = { | |
| 6530 | + addCase: function (typeOrActionCreator, reducer) { | |
| 6531 | + if (true) { | |
| 6532 | + if (actionMatchers.length > 0) { | |
| 6533 | + throw new Error("`builder.addCase` should only be called before calling `builder.addMatcher`"); | |
| 6534 | + } | |
| 6535 | + if (defaultCaseReducer) { | |
| 6536 | + throw new Error("`builder.addCase` should only be called before calling `builder.addDefaultCase`"); | |
| 6537 | + } | |
| 6538 | + } | |
| 6539 | + var type = typeof typeOrActionCreator === "string" ? typeOrActionCreator : typeOrActionCreator.type; | |
| 6540 | + if (!type) { | |
| 6541 | + throw new Error("`builder.addCase` cannot be called with an empty action type"); | |
| 6542 | + } | |
| 6543 | + if (type in actionsMap) { | |
| 6544 | + throw new Error("`builder.addCase` cannot be called with two reducers for the same action type"); | |
| 6545 | + } | |
| 6546 | + actionsMap[type] = reducer; | |
| 6547 | + return builder; | |
| 6548 | + }, | |
| 6549 | + addMatcher: function (matcher, reducer) { | |
| 6550 | + if (true) { | |
| 6551 | + if (defaultCaseReducer) { | |
| 6552 | + throw new Error("`builder.addMatcher` should only be called before calling `builder.addDefaultCase`"); | |
| 6553 | + } | |
| 6554 | + } | |
| 6555 | + actionMatchers.push({ matcher: matcher, reducer: reducer }); | |
| 6556 | + return builder; | |
| 6557 | + }, | |
| 6558 | + addDefaultCase: function (reducer) { | |
| 6559 | + if (true) { | |
| 6560 | + if (defaultCaseReducer) { | |
| 6561 | + throw new Error("`builder.addDefaultCase` can only be called once"); | |
| 6562 | + } | |
| 6563 | + } | |
| 6564 | + defaultCaseReducer = reducer; | |
| 6565 | + return builder; | |
| 6566 | + } | |
| 6567 | + }; | |
| 6568 | + builderCallback(builder); | |
| 6569 | + return [actionsMap, actionMatchers, defaultCaseReducer]; | |
| 6570 | +} | |
| 6571 | +// src/createReducer.ts | |
| 6572 | +function isStateFunction(x) { | |
| 6573 | + return typeof x === "function"; | |
| 6574 | +} | |
| 6575 | +var hasWarnedAboutObjectNotation = false; | |
| 6576 | +function createReducer(initialState, mapOrBuilderCallback, actionMatchers, defaultCaseReducer) { | |
| 6577 | + if (actionMatchers === void 0) { actionMatchers = []; } | |
| 6578 | + if (true) { | |
| 6579 | + if (typeof mapOrBuilderCallback === "object") { | |
| 6580 | + if (!hasWarnedAboutObjectNotation) { | |
| 6581 | + hasWarnedAboutObjectNotation = true; | |
| 6582 | + 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"); | |
| 6583 | + } | |
| 6584 | + } | |
| 6585 | + } | |
| 6586 | + var _c = typeof mapOrBuilderCallback === "function" ? executeReducerBuilderCallback(mapOrBuilderCallback) : [mapOrBuilderCallback, actionMatchers, defaultCaseReducer], actionsMap = _c[0], finalActionMatchers = _c[1], finalDefaultCaseReducer = _c[2]; | |
| 6587 | + var getInitialState; | |
| 6588 | + if (isStateFunction(initialState)) { | |
| 6589 | + getInitialState = function () { return freezeDraftable(initialState()); }; | |
| 6590 | + } | |
| 6591 | + else { | |
| 6592 | + var frozenInitialState_1 = freezeDraftable(initialState); | |
| 6593 | + getInitialState = function () { return frozenInitialState_1; }; | |
| 6594 | + } | |
| 6595 | + function reducer(state, action) { | |
| 6596 | + if (state === void 0) { state = getInitialState(); } | |
| 6597 | + var caseReducers = __spreadArray([ | |
| 6598 | + actionsMap[action.type] | |
| 6599 | + ], finalActionMatchers.filter(function (_c) { | |
| 6600 | + var matcher = _c.matcher; | |
| 6601 | + return matcher(action); | |
| 6602 | + }).map(function (_c) { | |
| 6603 | + var reducer2 = _c.reducer; | |
| 6604 | + return reducer2; | |
| 6605 | + })); | |
| 6606 | + if (caseReducers.filter(function (cr) { return !!cr; }).length === 0) { | |
| 6607 | + caseReducers = [finalDefaultCaseReducer]; | |
| 6608 | + } | |
| 6609 | + return caseReducers.reduce(function (previousState, caseReducer) { | |
| 6610 | + if (caseReducer) { | |
| 6611 | + if ((0,immer__WEBPACK_IMPORTED_MODULE_0__.isDraft)(previousState)) { | |
| 6612 | + var draft = previousState; | |
| 6613 | + var result = caseReducer(draft, action); | |
| 6614 | + if (result === void 0) { | |
| 6615 | + return previousState; | |
| 6616 | + } | |
| 6617 | + return result; | |
| 6618 | + } | |
| 6619 | + else if (!(0,immer__WEBPACK_IMPORTED_MODULE_0__.isDraftable)(previousState)) { | |
| 6620 | + var result = caseReducer(previousState, action); | |
| 6621 | + if (result === void 0) { | |
| 6622 | + if (previousState === null) { | |
| 6623 | + return previousState; | |
| 6624 | + } | |
| 6625 | + throw Error("A case reducer on a non-draftable value must not return undefined"); | |
| 6626 | + } | |
| 6627 | + return result; | |
| 6628 | + } | |
| 6629 | + else { | |
| 6630 | + return (0,immer__WEBPACK_IMPORTED_MODULE_0__["default"])(previousState, function (draft) { | |
| 6631 | + return caseReducer(draft, action); | |
| 6632 | + }); | |
| 6633 | + } | |
| 6634 | + } | |
| 6635 | + return previousState; | |
| 6636 | + }, state); | |
| 6637 | + } | |
| 6638 | + reducer.getInitialState = getInitialState; | |
| 6639 | + return reducer; | |
| 6640 | +} | |
| 6641 | +// src/createSlice.ts | |
| 6642 | +var hasWarnedAboutObjectNotation2 = false; | |
| 6643 | +function getType2(slice, actionKey) { | |
| 6644 | + return slice + "/" + actionKey; | |
| 6645 | +} | |
| 6646 | +function createSlice(options) { | |
| 6647 | + var name = options.name; | |
| 6648 | + if (!name) { | |
| 6649 | + throw new Error("`name` is a required option for createSlice"); | |
| 6650 | + } | |
| 6651 | + if (typeof process !== "undefined" && "development" === "development") { | |
| 6652 | + if (options.initialState === void 0) { | |
| 6653 | + console.error("You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`"); | |
| 6654 | + } | |
| 6655 | + } | |
| 6656 | + var initialState = typeof options.initialState == "function" ? options.initialState : freezeDraftable(options.initialState); | |
| 6657 | + var reducers = options.reducers || {}; | |
| 6658 | + var reducerNames = Object.keys(reducers); | |
| 6659 | + var sliceCaseReducersByName = {}; | |
| 6660 | + var sliceCaseReducersByType = {}; | |
| 6661 | + var actionCreators = {}; | |
| 6662 | + reducerNames.forEach(function (reducerName) { | |
| 6663 | + var maybeReducerWithPrepare = reducers[reducerName]; | |
| 6664 | + var type = getType2(name, reducerName); | |
| 6665 | + var caseReducer; | |
| 6666 | + var prepareCallback; | |
| 6667 | + if ("reducer" in maybeReducerWithPrepare) { | |
| 6668 | + caseReducer = maybeReducerWithPrepare.reducer; | |
| 6669 | + prepareCallback = maybeReducerWithPrepare.prepare; | |
| 6670 | + } | |
| 6671 | + else { | |
| 6672 | + caseReducer = maybeReducerWithPrepare; | |
| 6673 | + } | |
| 6674 | + sliceCaseReducersByName[reducerName] = caseReducer; | |
| 6675 | + sliceCaseReducersByType[type] = caseReducer; | |
| 6676 | + actionCreators[reducerName] = prepareCallback ? createAction(type, prepareCallback) : createAction(type); | |
| 6677 | + }); | |
| 6678 | + function buildReducer() { | |
| 6679 | + if (true) { | |
| 6680 | + if (typeof options.extraReducers === "object") { | |
| 6681 | + if (!hasWarnedAboutObjectNotation2) { | |
| 6682 | + hasWarnedAboutObjectNotation2 = true; | |
| 6683 | + 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"); | |
| 6684 | + } | |
| 6685 | + } | |
| 6686 | + } | |
| 6687 | + 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; | |
| 6688 | + var finalCaseReducers = __spreadValues(__spreadValues({}, extraReducers), sliceCaseReducersByType); | |
| 6689 | + return createReducer(initialState, function (builder) { | |
| 6690 | + for (var key in finalCaseReducers) { | |
| 6691 | + builder.addCase(key, finalCaseReducers[key]); | |
| 6692 | + } | |
| 6693 | + for (var _i = 0, actionMatchers_1 = actionMatchers; _i < actionMatchers_1.length; _i++) { | |
| 6694 | + var m = actionMatchers_1[_i]; | |
| 6695 | + builder.addMatcher(m.matcher, m.reducer); | |
| 6696 | + } | |
| 6697 | + if (defaultCaseReducer) { | |
| 6698 | + builder.addDefaultCase(defaultCaseReducer); | |
| 6699 | + } | |
| 6700 | + }); | |
| 6701 | + } | |
| 6702 | + var _reducer; | |
| 6703 | + return { | |
| 6704 | + name: name, | |
| 6705 | + reducer: function (state, action) { | |
| 6706 | + if (!_reducer) | |
| 6707 | + _reducer = buildReducer(); | |
| 6708 | + return _reducer(state, action); | |
| 6709 | + }, | |
| 6710 | + actions: actionCreators, | |
| 6711 | + caseReducers: sliceCaseReducersByName, | |
| 6712 | + getInitialState: function () { | |
| 6713 | + if (!_reducer) | |
| 6714 | + _reducer = buildReducer(); | |
| 6715 | + return _reducer.getInitialState(); | |
| 6716 | + } | |
| 6717 | + }; | |
| 6718 | +} | |
| 6719 | +// src/entities/entity_state.ts | |
| 6720 | +function getInitialEntityState() { | |
| 6721 | + return { | |
| 6722 | + ids: [], | |
| 6723 | + entities: {} | |
| 6724 | + }; | |
| 6725 | +} | |
| 6726 | +function createInitialStateFactory() { | |
| 6727 | + function getInitialState(additionalState) { | |
| 6728 | + if (additionalState === void 0) { additionalState = {}; } | |
| 6729 | + return Object.assign(getInitialEntityState(), additionalState); | |
| 6730 | + } | |
| 6731 | + return { getInitialState: getInitialState }; | |
| 6732 | +} | |
| 6733 | +// src/entities/state_selectors.ts | |
| 6734 | +function createSelectorsFactory() { | |
| 6735 | + function getSelectors(selectState) { | |
| 6736 | + var selectIds = function (state) { return state.ids; }; | |
| 6737 | + var selectEntities = function (state) { return state.entities; }; | |
| 6738 | + var selectAll = createDraftSafeSelector(selectIds, selectEntities, function (ids, entities) { return ids.map(function (id) { return entities[id]; }); }); | |
| 6739 | + var selectId = function (_, id) { return id; }; | |
| 6740 | + var selectById = function (entities, id) { return entities[id]; }; | |
| 6741 | + var selectTotal = createDraftSafeSelector(selectIds, function (ids) { return ids.length; }); | |
| 6742 | + if (!selectState) { | |
| 6743 | + return { | |
| 6744 | + selectIds: selectIds, | |
| 6745 | + selectEntities: selectEntities, | |
| 6746 | + selectAll: selectAll, | |
| 6747 | + selectTotal: selectTotal, | |
| 6748 | + selectById: createDraftSafeSelector(selectEntities, selectId, selectById) | |
| 6749 | + }; | |
| 6750 | + } | |
| 6751 | + var selectGlobalizedEntities = createDraftSafeSelector(selectState, selectEntities); | |
| 6752 | + return { | |
| 6753 | + selectIds: createDraftSafeSelector(selectState, selectIds), | |
| 6754 | + selectEntities: selectGlobalizedEntities, | |
| 6755 | + selectAll: createDraftSafeSelector(selectState, selectAll), | |
| 6756 | + selectTotal: createDraftSafeSelector(selectState, selectTotal), | |
| 6757 | + selectById: createDraftSafeSelector(selectGlobalizedEntities, selectId, selectById) | |
| 6758 | + }; | |
| 6759 | + } | |
| 6760 | + return { getSelectors: getSelectors }; | |
| 6761 | +} | |
| 6762 | +// src/entities/state_adapter.ts | |
| 6763 | + | |
| 6764 | +function createSingleArgumentStateOperator(mutator) { | |
| 6765 | + var operator = createStateOperator(function (_, state) { return mutator(state); }); | |
| 6766 | + return function operation(state) { | |
| 6767 | + return operator(state, void 0); | |
| 6768 | + }; | |
| 6769 | +} | |
| 6770 | +function createStateOperator(mutator) { | |
| 6771 | + return function operation(state, arg) { | |
| 6772 | + function isPayloadActionArgument(arg2) { | |
| 6773 | + return isFSA(arg2); | |
| 6774 | + } | |
| 6775 | + var runMutator = function (draft) { | |
| 6776 | + if (isPayloadActionArgument(arg)) { | |
| 6777 | + mutator(arg.payload, draft); | |
| 6778 | + } | |
| 6779 | + else { | |
| 6780 | + mutator(arg, draft); | |
| 6781 | + } | |
| 6782 | + }; | |
| 6783 | + if ((0,immer__WEBPACK_IMPORTED_MODULE_0__.isDraft)(state)) { | |
| 6784 | + runMutator(state); | |
| 6785 | + return state; | |
| 6786 | + } | |
| 6787 | + else { | |
| 6788 | + return (0,immer__WEBPACK_IMPORTED_MODULE_0__["default"])(state, runMutator); | |
| 6789 | + } | |
| 6790 | + }; | |
| 6791 | +} | |
| 6792 | +// src/entities/utils.ts | |
| 6793 | +function selectIdValue(entity, selectId) { | |
| 6794 | + var key = selectId(entity); | |
| 6795 | + if ( true && key === void 0) { | |
| 6796 | + 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()); | |
| 6797 | + } | |
| 6798 | + return key; | |
| 6799 | +} | |
| 6800 | +function ensureEntitiesArray(entities) { | |
| 6801 | + if (!Array.isArray(entities)) { | |
| 6802 | + entities = Object.values(entities); | |
| 6803 | + } | |
| 6804 | + return entities; | |
| 6805 | +} | |
| 6806 | +function splitAddedUpdatedEntities(newEntities, selectId, state) { | |
| 6807 | + newEntities = ensureEntitiesArray(newEntities); | |
| 6808 | + var added = []; | |
| 6809 | + var updated = []; | |
| 6810 | + for (var _i = 0, newEntities_1 = newEntities; _i < newEntities_1.length; _i++) { | |
| 6811 | + var entity = newEntities_1[_i]; | |
| 6812 | + var id = selectIdValue(entity, selectId); | |
| 6813 | + if (id in state.entities) { | |
| 6814 | + updated.push({ id: id, changes: entity }); | |
| 6815 | + } | |
| 6816 | + else { | |
| 6817 | + added.push(entity); | |
| 6818 | + } | |
| 6819 | + } | |
| 6820 | + return [added, updated]; | |
| 6821 | +} | |
| 6822 | +// src/entities/unsorted_state_adapter.ts | |
| 6823 | +function createUnsortedStateAdapter(selectId) { | |
| 6824 | + function addOneMutably(entity, state) { | |
| 6825 | + var key = selectIdValue(entity, selectId); | |
| 6826 | + if (key in state.entities) { | |
| 6827 | + return; | |
| 6828 | + } | |
| 6829 | + state.ids.push(key); | |
| 6830 | + state.entities[key] = entity; | |
| 6831 | + } | |
| 6832 | + function addManyMutably(newEntities, state) { | |
| 6833 | + newEntities = ensureEntitiesArray(newEntities); | |
| 6834 | + for (var _i = 0, newEntities_2 = newEntities; _i < newEntities_2.length; _i++) { | |
| 6835 | + var entity = newEntities_2[_i]; | |
| 6836 | + addOneMutably(entity, state); | |
| 6837 | + } | |
| 6838 | + } | |
| 6839 | + function setOneMutably(entity, state) { | |
| 6840 | + var key = selectIdValue(entity, selectId); | |
| 6841 | + if (!(key in state.entities)) { | |
| 6842 | + state.ids.push(key); | |
| 6843 | + } | |
| 6844 | + state.entities[key] = entity; | |
| 6845 | + } | |
| 6846 | + function setManyMutably(newEntities, state) { | |
| 6847 | + newEntities = ensureEntitiesArray(newEntities); | |
| 6848 | + for (var _i = 0, newEntities_3 = newEntities; _i < newEntities_3.length; _i++) { | |
| 6849 | + var entity = newEntities_3[_i]; | |
| 6850 | + setOneMutably(entity, state); | |
| 6851 | + } | |
| 6852 | + } | |
| 6853 | + function setAllMutably(newEntities, state) { | |
| 6854 | + newEntities = ensureEntitiesArray(newEntities); | |
| 6855 | + state.ids = []; | |
| 6856 | + state.entities = {}; | |
| 6857 | + addManyMutably(newEntities, state); | |
| 6858 | + } | |
| 6859 | + function removeOneMutably(key, state) { | |
| 6860 | + return removeManyMutably([key], state); | |
| 6861 | + } | |
| 6862 | + function removeManyMutably(keys, state) { | |
| 6863 | + var didMutate = false; | |
| 6864 | + keys.forEach(function (key) { | |
| 6865 | + if (key in state.entities) { | |
| 6866 | + delete state.entities[key]; | |
| 6867 | + didMutate = true; | |
| 6868 | + } | |
| 6869 | + }); | |
| 6870 | + if (didMutate) { | |
| 6871 | + state.ids = state.ids.filter(function (id) { return id in state.entities; }); | |
| 6872 | + } | |
| 6873 | + } | |
| 6874 | + function removeAllMutably(state) { | |
| 6875 | + Object.assign(state, { | |
| 6876 | + ids: [], | |
| 6877 | + entities: {} | |
| 6878 | + }); | |
| 6879 | + } | |
| 6880 | + function takeNewKey(keys, update, state) { | |
| 6881 | + var original2 = state.entities[update.id]; | |
| 6882 | + var updated = Object.assign({}, original2, update.changes); | |
| 6883 | + var newKey = selectIdValue(updated, selectId); | |
| 6884 | + var hasNewKey = newKey !== update.id; | |
| 6885 | + if (hasNewKey) { | |
| 6886 | + keys[update.id] = newKey; | |
| 6887 | + delete state.entities[update.id]; | |
| 6888 | + } | |
| 6889 | + state.entities[newKey] = updated; | |
| 6890 | + return hasNewKey; | |
| 6891 | + } | |
| 6892 | + function updateOneMutably(update, state) { | |
| 6893 | + return updateManyMutably([update], state); | |
| 6894 | + } | |
| 6895 | + function updateManyMutably(updates, state) { | |
| 6896 | + var newKeys = {}; | |
| 6897 | + var updatesPerEntity = {}; | |
| 6898 | + updates.forEach(function (update) { | |
| 6899 | + if (update.id in state.entities) { | |
| 6900 | + updatesPerEntity[update.id] = { | |
| 6901 | + id: update.id, | |
| 6902 | + changes: __spreadValues(__spreadValues({}, updatesPerEntity[update.id] ? updatesPerEntity[update.id].changes : null), update.changes) | |
| 6903 | + }; | |
| 6904 | + } | |
| 6905 | + }); | |
| 6906 | + updates = Object.values(updatesPerEntity); | |
| 6907 | + var didMutateEntities = updates.length > 0; | |
| 6908 | + if (didMutateEntities) { | |
| 6909 | + var didMutateIds = updates.filter(function (update) { return takeNewKey(newKeys, update, state); }).length > 0; | |
| 6910 | + if (didMutateIds) { | |
| 6911 | + state.ids = Object.keys(state.entities); | |
| 6912 | + } | |
| 6913 | + } | |
| 6914 | + } | |
| 6915 | + function upsertOneMutably(entity, state) { | |
| 6916 | + return upsertManyMutably([entity], state); | |
| 6917 | + } | |
| 6918 | + function upsertManyMutably(newEntities, state) { | |
| 6919 | + var _c = splitAddedUpdatedEntities(newEntities, selectId, state), added = _c[0], updated = _c[1]; | |
| 6920 | + updateManyMutably(updated, state); | |
| 6921 | + addManyMutably(added, state); | |
| 6922 | + } | |
| 6923 | + return { | |
| 6924 | + removeAll: createSingleArgumentStateOperator(removeAllMutably), | |
| 6925 | + addOne: createStateOperator(addOneMutably), | |
| 6926 | + addMany: createStateOperator(addManyMutably), | |
| 6927 | + setOne: createStateOperator(setOneMutably), | |
| 6928 | + setMany: createStateOperator(setManyMutably), | |
| 6929 | + setAll: createStateOperator(setAllMutably), | |
| 6930 | + updateOne: createStateOperator(updateOneMutably), | |
| 6931 | + updateMany: createStateOperator(updateManyMutably), | |
| 6932 | + upsertOne: createStateOperator(upsertOneMutably), | |
| 6933 | + upsertMany: createStateOperator(upsertManyMutably), | |
| 6934 | + removeOne: createStateOperator(removeOneMutably), | |
| 6935 | + removeMany: createStateOperator(removeManyMutably) | |
| 6936 | + }; | |
| 6937 | +} | |
| 6938 | +// src/entities/sorted_state_adapter.ts | |
| 6939 | +function createSortedStateAdapter(selectId, sort) { | |
| 6940 | + var _c = createUnsortedStateAdapter(selectId), removeOne = _c.removeOne, removeMany = _c.removeMany, removeAll = _c.removeAll; | |
| 6941 | + function addOneMutably(entity, state) { | |
| 6942 | + return addManyMutably([entity], state); | |
| 6943 | + } | |
| 6944 | + function addManyMutably(newEntities, state) { | |
| 6945 | + newEntities = ensureEntitiesArray(newEntities); | |
| 6946 | + var models = newEntities.filter(function (model) { return !(selectIdValue(model, selectId) in state.entities); }); | |
| 6947 | + if (models.length !== 0) { | |
| 6948 | + merge(models, state); | |
| 6949 | + } | |
| 6950 | + } | |
| 6951 | + function setOneMutably(entity, state) { | |
| 6952 | + return setManyMutably([entity], state); | |
| 6953 | + } | |
| 6954 | + function setManyMutably(newEntities, state) { | |
| 6955 | + newEntities = ensureEntitiesArray(newEntities); | |
| 6956 | + if (newEntities.length !== 0) { | |
| 6957 | + merge(newEntities, state); | |
| 6958 | + } | |
| 6959 | + } | |
| 6960 | + function setAllMutably(newEntities, state) { | |
| 6961 | + newEntities = ensureEntitiesArray(newEntities); | |
| 6962 | + state.entities = {}; | |
| 6963 | + state.ids = []; | |
| 6964 | + addManyMutably(newEntities, state); | |
| 6965 | + } | |
| 6966 | + function updateOneMutably(update, state) { | |
| 6967 | + return updateManyMutably([update], state); | |
| 6968 | + } | |
| 6969 | + function updateManyMutably(updates, state) { | |
| 6970 | + var appliedUpdates = false; | |
| 6971 | + for (var _i = 0, updates_1 = updates; _i < updates_1.length; _i++) { | |
| 6972 | + var update = updates_1[_i]; | |
| 6973 | + var entity = state.entities[update.id]; | |
| 6974 | + if (!entity) { | |
| 6975 | + continue; | |
| 6976 | + } | |
| 6977 | + appliedUpdates = true; | |
| 6978 | + Object.assign(entity, update.changes); | |
| 6979 | + var newId = selectId(entity); | |
| 6980 | + if (update.id !== newId) { | |
| 6981 | + delete state.entities[update.id]; | |
| 6982 | + state.entities[newId] = entity; | |
| 6983 | + } | |
| 6984 | + } | |
| 6985 | + if (appliedUpdates) { | |
| 6986 | + resortEntities(state); | |
| 6987 | + } | |
| 6988 | + } | |
| 6989 | + function upsertOneMutably(entity, state) { | |
| 6990 | + return upsertManyMutably([entity], state); | |
| 6991 | + } | |
| 6992 | + function upsertManyMutably(newEntities, state) { | |
| 6993 | + var _c = splitAddedUpdatedEntities(newEntities, selectId, state), added = _c[0], updated = _c[1]; | |
| 6994 | + updateManyMutably(updated, state); | |
| 6995 | + addManyMutably(added, state); | |
| 6996 | + } | |
| 6997 | + function areArraysEqual(a, b) { | |
| 6998 | + if (a.length !== b.length) { | |
| 6999 | + return false; | |
| 7000 | + } | |
| 7001 | + for (var i = 0; i < a.length && i < b.length; i++) { | |
| 7002 | + if (a[i] === b[i]) { | |
| 7003 | + continue; | |
| 7004 | + } | |
| 7005 | + return false; | |
| 7006 | + } | |
| 7007 | + return true; | |
| 7008 | + } | |
| 7009 | + function merge(models, state) { | |
| 7010 | + models.forEach(function (model) { | |
| 7011 | + state.entities[selectId(model)] = model; | |
| 7012 | + }); | |
| 7013 | + resortEntities(state); | |
| 7014 | + } | |
| 7015 | + function resortEntities(state) { | |
| 7016 | + var allEntities = Object.values(state.entities); | |
| 7017 | + allEntities.sort(sort); | |
| 7018 | + var newSortedIds = allEntities.map(selectId); | |
| 7019 | + var ids = state.ids; | |
| 7020 | + if (!areArraysEqual(ids, newSortedIds)) { | |
| 7021 | + state.ids = newSortedIds; | |
| 7022 | + } | |
| 7023 | + } | |
| 7024 | + return { | |
| 7025 | + removeOne: removeOne, | |
| 7026 | + removeMany: removeMany, | |
| 7027 | + removeAll: removeAll, | |
| 7028 | + addOne: createStateOperator(addOneMutably), | |
| 7029 | + updateOne: createStateOperator(updateOneMutably), | |
| 7030 | + upsertOne: createStateOperator(upsertOneMutably), | |
| 7031 | + setOne: createStateOperator(setOneMutably), | |
| 7032 | + setMany: createStateOperator(setManyMutably), | |
| 7033 | + setAll: createStateOperator(setAllMutably), | |
| 7034 | + addMany: createStateOperator(addManyMutably), | |
| 7035 | + updateMany: createStateOperator(updateManyMutably), | |
| 7036 | + upsertMany: createStateOperator(upsertManyMutably) | |
| 7037 | + }; | |
| 7038 | +} | |
| 7039 | +// src/entities/create_adapter.ts | |
| 7040 | +function createEntityAdapter(options) { | |
| 7041 | + if (options === void 0) { options = {}; } | |
| 7042 | + var _c = __spreadValues({ | |
| 7043 | + sortComparer: false, | |
| 7044 | + selectId: function (instance) { return instance.id; } | |
| 7045 | + }, options), selectId = _c.selectId, sortComparer = _c.sortComparer; | |
| 7046 | + var stateFactory = createInitialStateFactory(); | |
| 7047 | + var selectorsFactory = createSelectorsFactory(); | |
| 7048 | + var stateAdapter = sortComparer ? createSortedStateAdapter(selectId, sortComparer) : createUnsortedStateAdapter(selectId); | |
| 7049 | + return __spreadValues(__spreadValues(__spreadValues({ | |
| 7050 | + selectId: selectId, | |
| 7051 | + sortComparer: sortComparer | |
| 7052 | + }, stateFactory), selectorsFactory), stateAdapter); | |
| 7053 | +} | |
| 7054 | +// src/nanoid.ts | |
| 7055 | +var urlAlphabet = "ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"; | |
| 7056 | +var nanoid = function (size) { | |
| 7057 | + if (size === void 0) { size = 21; } | |
| 7058 | + var id = ""; | |
| 7059 | + var i = size; | |
| 7060 | + while (i--) { | |
| 7061 | + id += urlAlphabet[Math.random() * 64 | 0]; | |
| 7062 | + } | |
| 7063 | + return id; | |
| 7064 | +}; | |
| 7065 | +// src/createAsyncThunk.ts | |
| 7066 | +var commonProperties = [ | |
| 7067 | + "name", | |
| 7068 | + "message", | |
| 7069 | + "stack", | |
| 7070 | + "code" | |
| 7071 | +]; | |
| 7072 | +var RejectWithValue = /** @class */ (function () { | |
| 7073 | + function RejectWithValue(payload, meta) { | |
| 7074 | + this.payload = payload; | |
| 7075 | + this.meta = meta; | |
| 7076 | + } | |
| 7077 | + return RejectWithValue; | |
| 7078 | +}()); | |
| 7079 | +var FulfillWithMeta = /** @class */ (function () { | |
| 7080 | + function FulfillWithMeta(payload, meta) { | |
| 7081 | + this.payload = payload; | |
| 7082 | + this.meta = meta; | |
| 7083 | + } | |
| 7084 | + return FulfillWithMeta; | |
| 7085 | +}()); | |
| 7086 | +var miniSerializeError = function (value) { | |
| 7087 | + if (typeof value === "object" && value !== null) { | |
| 7088 | + var simpleError = {}; | |
| 7089 | + for (var _i = 0, commonProperties_1 = commonProperties; _i < commonProperties_1.length; _i++) { | |
| 7090 | + var property = commonProperties_1[_i]; | |
| 7091 | + if (typeof value[property] === "string") { | |
| 7092 | + simpleError[property] = value[property]; | |
| 7093 | + } | |
| 7094 | + } | |
| 7095 | + return simpleError; | |
| 7096 | + } | |
| 7097 | + return { message: String(value) }; | |
| 7098 | +}; | |
| 7099 | +var createAsyncThunk = (function () { | |
| 7100 | + function createAsyncThunk2(typePrefix, payloadCreator, options) { | |
| 7101 | + var fulfilled = createAction(typePrefix + "/fulfilled", function (payload, requestId, arg, meta) { return ({ | |
| 7102 | + payload: payload, | |
| 7103 | + meta: __spreadProps(__spreadValues({}, meta || {}), { | |
| 7104 | + arg: arg, | |
| 7105 | + requestId: requestId, | |
| 7106 | + requestStatus: "fulfilled" | |
| 7107 | + }) | |
| 7108 | + }); }); | |
| 7109 | + var pending = createAction(typePrefix + "/pending", function (requestId, arg, meta) { return ({ | |
| 7110 | + payload: void 0, | |
| 7111 | + meta: __spreadProps(__spreadValues({}, meta || {}), { | |
| 7112 | + arg: arg, | |
| 7113 | + requestId: requestId, | |
| 7114 | + requestStatus: "pending" | |
| 7115 | + }) | |
| 7116 | + }); }); | |
| 7117 | + var rejected = createAction(typePrefix + "/rejected", function (error, requestId, arg, payload, meta) { return ({ | |
| 7118 | + payload: payload, | |
| 7119 | + error: (options && options.serializeError || miniSerializeError)(error || "Rejected"), | |
| 7120 | + meta: __spreadProps(__spreadValues({}, meta || {}), { | |
| 7121 | + arg: arg, | |
| 7122 | + requestId: requestId, | |
| 7123 | + rejectedWithValue: !!payload, | |
| 7124 | + requestStatus: "rejected", | |
| 7125 | + aborted: (error == null ? void 0 : error.name) === "AbortError", | |
| 7126 | + condition: (error == null ? void 0 : error.name) === "ConditionError" | |
| 7127 | + }) | |
| 7128 | + }); }); | |
| 7129 | + var displayedWarning = false; | |
| 7130 | + var AC = typeof AbortController !== "undefined" ? AbortController : /** @class */ (function () { | |
| 7131 | + function class_1() { | |
| 7132 | + this.signal = { | |
| 7133 | + aborted: false, | |
| 7134 | + addEventListener: function () { | |
| 7135 | + }, | |
| 7136 | + dispatchEvent: function () { | |
| 7137 | + return false; | |
| 7138 | + }, | |
| 7139 | + onabort: function () { | |
| 7140 | + }, | |
| 7141 | + removeEventListener: function () { | |
| 7142 | + }, | |
| 7143 | + reason: void 0, | |
| 7144 | + throwIfAborted: function () { | |
| 7145 | + } | |
| 7146 | + }; | |
| 7147 | + } | |
| 7148 | + class_1.prototype.abort = function () { | |
| 7149 | + if (true) { | |
| 7150 | + if (!displayedWarning) { | |
| 7151 | + displayedWarning = true; | |
| 7152 | + 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'."); | |
| 7153 | + } | |
| 7154 | + } | |
| 7155 | + }; | |
| 7156 | + return class_1; | |
| 7157 | + }()); | |
| 7158 | + function actionCreator(arg) { | |
| 7159 | + return function (dispatch, getState, extra) { | |
| 7160 | + var requestId = (options == null ? void 0 : options.idGenerator) ? options.idGenerator(arg) : nanoid(); | |
| 7161 | + var abortController = new AC(); | |
| 7162 | + var abortReason; | |
| 7163 | + var started = false; | |
| 7164 | + function abort(reason) { | |
| 7165 | + abortReason = reason; | |
| 7166 | + abortController.abort(); | |
| 7167 | + } | |
| 7168 | + var promise2 = function () { | |
| 7169 | + return __async(this, null, function () { | |
| 7170 | + var _a, _b, finalAction, conditionResult, abortedPromise, err_1, skipDispatch; | |
| 7171 | + return __generator(this, function (_c) { | |
| 7172 | + switch (_c.label) { | |
| 7173 | + case 0: | |
| 7174 | + _c.trys.push([0, 4, , 5]); | |
| 7175 | + conditionResult = (_a = options == null ? void 0 : options.condition) == null ? void 0 : _a.call(options, arg, { getState: getState, extra: extra }); | |
| 7176 | + if (!isThenable(conditionResult)) return [3 /*break*/, 2]; | |
| 7177 | + return [4 /*yield*/, conditionResult]; | |
| 7178 | + case 1: | |
| 7179 | + conditionResult = _c.sent(); | |
| 7180 | + _c.label = 2; | |
| 7181 | + case 2: | |
| 7182 | + if (conditionResult === false || abortController.signal.aborted) { | |
| 7183 | + throw { | |
| 7184 | + name: "ConditionError", | |
| 7185 | + message: "Aborted due to condition callback returning false." | |
| 7186 | + }; | |
| 7187 | + } | |
| 7188 | + started = true; | |
| 7189 | + abortedPromise = new Promise(function (_, reject) { return abortController.signal.addEventListener("abort", function () { return reject({ | |
| 7190 | + name: "AbortError", | |
| 7191 | + message: abortReason || "Aborted" | |
| 7192 | + }); }); }); | |
| 7193 | + 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 }))); | |
| 7194 | + return [4 /*yield*/, Promise.race([ | |
| 7195 | + abortedPromise, | |
| 7196 | + Promise.resolve(payloadCreator(arg, { | |
| 7197 | + dispatch: dispatch, | |
| 7198 | + getState: getState, | |
| 7199 | + extra: extra, | |
| 7200 | + requestId: requestId, | |
| 7201 | + signal: abortController.signal, | |
| 7202 | + abort: abort, | |
| 7203 | + rejectWithValue: function (value, meta) { | |
| 7204 | + return new RejectWithValue(value, meta); | |
| 7205 | + }, | |
| 7206 | + fulfillWithValue: function (value, meta) { | |
| 7207 | + return new FulfillWithMeta(value, meta); | |
| 7208 | + } | |
| 7209 | + })).then(function (result) { | |
| 7210 | + if (result instanceof RejectWithValue) { | |
| 7211 | + throw result; | |
| 7212 | + } | |
| 7213 | + if (result instanceof FulfillWithMeta) { | |
| 7214 | + return fulfilled(result.payload, requestId, arg, result.meta); | |
| 7215 | + } | |
| 7216 | + return fulfilled(result, requestId, arg); | |
| 7217 | + }) | |
| 7218 | + ])]; | |
| 7219 | + case 3: | |
| 7220 | + finalAction = _c.sent(); | |
| 7221 | + return [3 /*break*/, 5]; | |
| 7222 | + case 4: | |
| 7223 | + err_1 = _c.sent(); | |
| 7224 | + finalAction = err_1 instanceof RejectWithValue ? rejected(null, requestId, arg, err_1.payload, err_1.meta) : rejected(err_1, requestId, arg); | |
| 7225 | + return [3 /*break*/, 5]; | |
| 7226 | + case 5: | |
| 7227 | + skipDispatch = options && !options.dispatchConditionRejection && rejected.match(finalAction) && finalAction.meta.condition; | |
| 7228 | + if (!skipDispatch) { | |
| 7229 | + dispatch(finalAction); | |
| 7230 | + } | |
| 7231 | + return [2 /*return*/, finalAction]; | |
| 7232 | + } | |
| 7233 | + }); | |
| 7234 | + }); | |
| 7235 | + }(); | |
| 7236 | + return Object.assign(promise2, { | |
| 7237 | + abort: abort, | |
| 7238 | + requestId: requestId, | |
| 7239 | + arg: arg, | |
| 7240 | + unwrap: function () { | |
| 7241 | + return promise2.then(unwrapResult); | |
| 7242 | + } | |
| 7243 | + }); | |
| 7244 | + }; | |
| 7245 | + } | |
| 7246 | + return Object.assign(actionCreator, { | |
| 7247 | + pending: pending, | |
| 7248 | + rejected: rejected, | |
| 7249 | + fulfilled: fulfilled, | |
| 7250 | + typePrefix: typePrefix | |
| 7251 | + }); | |
| 7252 | + } | |
| 7253 | + createAsyncThunk2.withTypes = function () { return createAsyncThunk2; }; | |
| 7254 | + return createAsyncThunk2; | |
| 7255 | +})(); | |
| 7256 | +function unwrapResult(action) { | |
| 7257 | + if (action.meta && action.meta.rejectedWithValue) { | |
| 7258 | + throw action.payload; | |
| 7259 | + } | |
| 7260 | + if (action.error) { | |
| 7261 | + throw action.error; | |
| 7262 | + } | |
| 7263 | + return action.payload; | |
| 7264 | +} | |
| 7265 | +function isThenable(value) { | |
| 7266 | + return value !== null && typeof value === "object" && typeof value.then === "function"; | |
| 7267 | +} | |
| 7268 | +// src/matchers.ts | |
| 7269 | +var matches = function (matcher, action) { | |
| 7270 | + if (hasMatchFunction(matcher)) { | |
| 7271 | + return matcher.match(action); | |
| 7272 | + } | |
| 7273 | + else { | |
| 7274 | + return matcher(action); | |
| 7275 | + } | |
| 7276 | +}; | |
| 7277 | +function isAnyOf() { | |
| 7278 | + var matchers = []; | |
| 7279 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 7280 | + matchers[_i] = arguments[_i]; | |
| 7281 | + } | |
| 7282 | + return function (action) { | |
| 7283 | + return matchers.some(function (matcher) { return matches(matcher, action); }); | |
| 7284 | + }; | |
| 7285 | +} | |
| 7286 | +function isAllOf() { | |
| 7287 | + var matchers = []; | |
| 7288 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 7289 | + matchers[_i] = arguments[_i]; | |
| 7290 | + } | |
| 7291 | + return function (action) { | |
| 7292 | + return matchers.every(function (matcher) { return matches(matcher, action); }); | |
| 7293 | + }; | |
| 7294 | +} | |
| 7295 | +function hasExpectedRequestMetadata(action, validStatus) { | |
| 7296 | + if (!action || !action.meta) | |
| 7297 | + return false; | |
| 7298 | + var hasValidRequestId = typeof action.meta.requestId === "string"; | |
| 7299 | + var hasValidRequestStatus = validStatus.indexOf(action.meta.requestStatus) > -1; | |
| 7300 | + return hasValidRequestId && hasValidRequestStatus; | |
| 7301 | +} | |
| 7302 | +function isAsyncThunkArray(a) { | |
| 7303 | + return typeof a[0] === "function" && "pending" in a[0] && "fulfilled" in a[0] && "rejected" in a[0]; | |
| 7304 | +} | |
| 7305 | +function isPending() { | |
| 7306 | + var asyncThunks = []; | |
| 7307 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 7308 | + asyncThunks[_i] = arguments[_i]; | |
| 7309 | + } | |
| 7310 | + if (asyncThunks.length === 0) { | |
| 7311 | + return function (action) { return hasExpectedRequestMetadata(action, ["pending"]); }; | |
| 7312 | + } | |
| 7313 | + if (!isAsyncThunkArray(asyncThunks)) { | |
| 7314 | + return isPending()(asyncThunks[0]); | |
| 7315 | + } | |
| 7316 | + return function (action) { | |
| 7317 | + var matchers = asyncThunks.map(function (asyncThunk) { return asyncThunk.pending; }); | |
| 7318 | + var combinedMatcher = isAnyOf.apply(void 0, matchers); | |
| 7319 | + return combinedMatcher(action); | |
| 7320 | + }; | |
| 7321 | +} | |
| 7322 | +function isRejected() { | |
| 7323 | + var asyncThunks = []; | |
| 7324 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 7325 | + asyncThunks[_i] = arguments[_i]; | |
| 7326 | + } | |
| 7327 | + if (asyncThunks.length === 0) { | |
| 7328 | + return function (action) { return hasExpectedRequestMetadata(action, ["rejected"]); }; | |
| 7329 | + } | |
| 7330 | + if (!isAsyncThunkArray(asyncThunks)) { | |
| 7331 | + return isRejected()(asyncThunks[0]); | |
| 7332 | + } | |
| 7333 | + return function (action) { | |
| 7334 | + var matchers = asyncThunks.map(function (asyncThunk) { return asyncThunk.rejected; }); | |
| 7335 | + var combinedMatcher = isAnyOf.apply(void 0, matchers); | |
| 7336 | + return combinedMatcher(action); | |
| 7337 | + }; | |
| 7338 | +} | |
| 7339 | +function isRejectedWithValue() { | |
| 7340 | + var asyncThunks = []; | |
| 7341 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 7342 | + asyncThunks[_i] = arguments[_i]; | |
| 7343 | + } | |
| 7344 | + var hasFlag = function (action) { | |
| 7345 | + return action && action.meta && action.meta.rejectedWithValue; | |
| 7346 | + }; | |
| 7347 | + if (asyncThunks.length === 0) { | |
| 7348 | + return function (action) { | |
| 7349 | + var combinedMatcher = isAllOf(isRejected.apply(void 0, asyncThunks), hasFlag); | |
| 7350 | + return combinedMatcher(action); | |
| 7351 | + }; | |
| 7352 | + } | |
| 7353 | + if (!isAsyncThunkArray(asyncThunks)) { | |
| 7354 | + return isRejectedWithValue()(asyncThunks[0]); | |
| 7355 | + } | |
| 7356 | + return function (action) { | |
| 7357 | + var combinedMatcher = isAllOf(isRejected.apply(void 0, asyncThunks), hasFlag); | |
| 7358 | + return combinedMatcher(action); | |
| 7359 | + }; | |
| 7360 | +} | |
| 7361 | +function isFulfilled() { | |
| 7362 | + var asyncThunks = []; | |
| 7363 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 7364 | + asyncThunks[_i] = arguments[_i]; | |
| 7365 | + } | |
| 7366 | + if (asyncThunks.length === 0) { | |
| 7367 | + return function (action) { return hasExpectedRequestMetadata(action, ["fulfilled"]); }; | |
| 7368 | + } | |
| 7369 | + if (!isAsyncThunkArray(asyncThunks)) { | |
| 7370 | + return isFulfilled()(asyncThunks[0]); | |
| 7371 | + } | |
| 7372 | + return function (action) { | |
| 7373 | + var matchers = asyncThunks.map(function (asyncThunk) { return asyncThunk.fulfilled; }); | |
| 7374 | + var combinedMatcher = isAnyOf.apply(void 0, matchers); | |
| 7375 | + return combinedMatcher(action); | |
| 7376 | + }; | |
| 7377 | +} | |
| 7378 | +function isAsyncThunkAction() { | |
| 7379 | + var asyncThunks = []; | |
| 7380 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 7381 | + asyncThunks[_i] = arguments[_i]; | |
| 7382 | + } | |
| 7383 | + if (asyncThunks.length === 0) { | |
| 7384 | + return function (action) { return hasExpectedRequestMetadata(action, ["pending", "fulfilled", "rejected"]); }; | |
| 7385 | + } | |
| 7386 | + if (!isAsyncThunkArray(asyncThunks)) { | |
| 7387 | + return isAsyncThunkAction()(asyncThunks[0]); | |
| 7388 | + } | |
| 7389 | + return function (action) { | |
| 7390 | + var matchers = []; | |
| 7391 | + for (var _i = 0, asyncThunks_1 = asyncThunks; _i < asyncThunks_1.length; _i++) { | |
| 7392 | + var asyncThunk = asyncThunks_1[_i]; | |
| 7393 | + matchers.push(asyncThunk.pending, asyncThunk.rejected, asyncThunk.fulfilled); | |
| 7394 | + } | |
| 7395 | + var combinedMatcher = isAnyOf.apply(void 0, matchers); | |
| 7396 | + return combinedMatcher(action); | |
| 7397 | + }; | |
| 7398 | +} | |
| 7399 | +// src/listenerMiddleware/utils.ts | |
| 7400 | +var assertFunction = function (func, expected) { | |
| 7401 | + if (typeof func !== "function") { | |
| 7402 | + throw new TypeError(expected + " is not a function"); | |
| 7403 | + } | |
| 7404 | +}; | |
| 7405 | +var noop = function () { | |
| 7406 | +}; | |
| 7407 | +var catchRejection = function (promise2, onError) { | |
| 7408 | + if (onError === void 0) { onError = noop; } | |
| 7409 | + promise2.catch(onError); | |
| 7410 | + return promise2; | |
| 7411 | +}; | |
| 7412 | +var addAbortSignalListener = function (abortSignal, callback) { | |
| 7413 | + abortSignal.addEventListener("abort", callback, { once: true }); | |
| 7414 | + return function () { return abortSignal.removeEventListener("abort", callback); }; | |
| 7415 | +}; | |
| 7416 | +var abortControllerWithReason = function (abortController, reason) { | |
| 7417 | + var signal = abortController.signal; | |
| 7418 | + if (signal.aborted) { | |
| 7419 | + return; | |
| 7420 | + } | |
| 7421 | + if (!("reason" in signal)) { | |
| 7422 | + Object.defineProperty(signal, "reason", { | |
| 7423 | + enumerable: true, | |
| 7424 | + value: reason, | |
| 7425 | + configurable: true, | |
| 7426 | + writable: true | |
| 7427 | + }); | |
| 7428 | + } | |
| 7429 | + ; | |
| 7430 | + abortController.abort(reason); | |
| 7431 | +}; | |
| 7432 | +// src/listenerMiddleware/exceptions.ts | |
| 7433 | +var task = "task"; | |
| 7434 | +var listener = "listener"; | |
| 7435 | +var completed = "completed"; | |
| 7436 | +var cancelled = "cancelled"; | |
| 7437 | +var taskCancelled = "task-" + cancelled; | |
| 7438 | +var taskCompleted = "task-" + completed; | |
| 7439 | +var listenerCancelled = listener + "-" + cancelled; | |
| 7440 | +var listenerCompleted = listener + "-" + completed; | |
| 7441 | +var TaskAbortError = /** @class */ (function () { | |
| 7442 | + function TaskAbortError(code) { | |
| 7443 | + this.code = code; | |
| 7444 | + this.name = "TaskAbortError"; | |
| 7445 | + this.message = task + " " + cancelled + " (reason: " + code + ")"; | |
| 7446 | + } | |
| 7447 | + return TaskAbortError; | |
| 7448 | +}()); | |
| 7449 | +// src/listenerMiddleware/task.ts | |
| 7450 | +var validateActive = function (signal) { | |
| 7451 | + if (signal.aborted) { | |
| 7452 | + throw new TaskAbortError(signal.reason); | |
| 7453 | + } | |
| 7454 | +}; | |
| 7455 | +function raceWithSignal(signal, promise2) { | |
| 7456 | + var cleanup = noop; | |
| 7457 | + return new Promise(function (resolve, reject) { | |
| 7458 | + var notifyRejection = function () { return reject(new TaskAbortError(signal.reason)); }; | |
| 7459 | + if (signal.aborted) { | |
| 7460 | + notifyRejection(); | |
| 7461 | + return; | |
| 7462 | + } | |
| 7463 | + cleanup = addAbortSignalListener(signal, notifyRejection); | |
| 7464 | + promise2.finally(function () { return cleanup(); }).then(resolve, reject); | |
| 7465 | + }).finally(function () { | |
| 7466 | + cleanup = noop; | |
| 7467 | + }); | |
| 7468 | +} | |
| 7469 | +var runTask = function (task2, cleanUp) { return __async(void 0, null, function () { | |
| 7470 | + var value, error_1; | |
| 7471 | + return __generator(this, function (_c) { | |
| 7472 | + switch (_c.label) { | |
| 7473 | + case 0: | |
| 7474 | + _c.trys.push([0, 3, 4, 5]); | |
| 7475 | + return [4 /*yield*/, Promise.resolve()]; | |
| 7476 | + case 1: | |
| 7477 | + _c.sent(); | |
| 7478 | + return [4 /*yield*/, task2()]; | |
| 7479 | + case 2: | |
| 7480 | + value = _c.sent(); | |
| 7481 | + return [2 /*return*/, { | |
| 7482 | + status: "ok", | |
| 7483 | + value: value | |
| 7484 | + }]; | |
| 7485 | + case 3: | |
| 7486 | + error_1 = _c.sent(); | |
| 7487 | + return [2 /*return*/, { | |
| 7488 | + status: error_1 instanceof TaskAbortError ? "cancelled" : "rejected", | |
| 7489 | + error: error_1 | |
| 7490 | + }]; | |
| 7491 | + case 4: | |
| 7492 | + cleanUp == null ? void 0 : cleanUp(); | |
| 7493 | + return [7 /*endfinally*/]; | |
| 7494 | + case 5: return [2 /*return*/]; | |
| 7495 | + } | |
| 7496 | + }); | |
| 7497 | +}); }; | |
| 7498 | +var createPause = function (signal) { | |
| 7499 | + return function (promise2) { | |
| 7500 | + return catchRejection(raceWithSignal(signal, promise2).then(function (output) { | |
| 7501 | + validateActive(signal); | |
| 7502 | + return output; | |
| 7503 | + })); | |
| 7504 | + }; | |
| 7505 | +}; | |
| 7506 | +var createDelay = function (signal) { | |
| 7507 | + var pause = createPause(signal); | |
| 7508 | + return function (timeoutMs) { | |
| 7509 | + return pause(new Promise(function (resolve) { return setTimeout(resolve, timeoutMs); })); | |
| 7510 | + }; | |
| 7511 | +}; | |
| 7512 | +// src/listenerMiddleware/index.ts | |
| 7513 | +var assign = Object.assign; | |
| 7514 | +var INTERNAL_NIL_TOKEN = {}; | |
| 7515 | +var alm = "listenerMiddleware"; | |
| 7516 | +var createFork = function (parentAbortSignal, parentBlockingPromises) { | |
| 7517 | + var linkControllers = function (controller) { return addAbortSignalListener(parentAbortSignal, function () { return abortControllerWithReason(controller, parentAbortSignal.reason); }); }; | |
| 7518 | + return function (taskExecutor, opts) { | |
| 7519 | + assertFunction(taskExecutor, "taskExecutor"); | |
| 7520 | + var childAbortController = new AbortController(); | |
| 7521 | + linkControllers(childAbortController); | |
| 7522 | + var result = runTask(function () { return __async(void 0, null, function () { | |
| 7523 | + var result2; | |
| 7524 | + return __generator(this, function (_c) { | |
| 7525 | + switch (_c.label) { | |
| 7526 | + case 0: | |
| 7527 | + validateActive(parentAbortSignal); | |
| 7528 | + validateActive(childAbortController.signal); | |
| 7529 | + return [4 /*yield*/, taskExecutor({ | |
| 7530 | + pause: createPause(childAbortController.signal), | |
| 7531 | + delay: createDelay(childAbortController.signal), | |
| 7532 | + signal: childAbortController.signal | |
| 7533 | + })]; | |
| 7534 | + case 1: | |
| 7535 | + result2 = _c.sent(); | |
| 7536 | + validateActive(childAbortController.signal); | |
| 7537 | + return [2 /*return*/, result2]; | |
| 7538 | + } | |
| 7539 | + }); | |
| 7540 | + }); }, function () { return abortControllerWithReason(childAbortController, taskCompleted); }); | |
| 7541 | + if (opts == null ? void 0 : opts.autoJoin) { | |
| 7542 | + parentBlockingPromises.push(result); | |
| 7543 | + } | |
| 7544 | + return { | |
| 7545 | + result: createPause(parentAbortSignal)(result), | |
| 7546 | + cancel: function () { | |
| 7547 | + abortControllerWithReason(childAbortController, taskCancelled); | |
| 7548 | + } | |
| 7549 | + }; | |
| 7550 | + }; | |
| 7551 | +}; | |
| 7552 | +var createTakePattern = function (startListening, signal) { | |
| 7553 | + var take = function (predicate, timeout) { return __async(void 0, null, function () { | |
| 7554 | + var unsubscribe, tuplePromise, promises, output; | |
| 7555 | + return __generator(this, function (_c) { | |
| 7556 | + switch (_c.label) { | |
| 7557 | + case 0: | |
| 7558 | + validateActive(signal); | |
| 7559 | + unsubscribe = function () { | |
| 7560 | + }; | |
| 7561 | + tuplePromise = new Promise(function (resolve, reject) { | |
| 7562 | + var stopListening = startListening({ | |
| 7563 | + predicate: predicate, | |
| 7564 | + effect: function (action, listenerApi) { | |
| 7565 | + listenerApi.unsubscribe(); | |
| 7566 | + resolve([ | |
| 7567 | + action, | |
| 7568 | + listenerApi.getState(), | |
| 7569 | + listenerApi.getOriginalState() | |
| 7570 | + ]); | |
| 7571 | + } | |
| 7572 | + }); | |
| 7573 | + unsubscribe = function () { | |
| 7574 | + stopListening(); | |
| 7575 | + reject(); | |
| 7576 | + }; | |
| 7577 | + }); | |
| 7578 | + promises = [ | |
| 7579 | + tuplePromise | |
| 7580 | + ]; | |
| 7581 | + if (timeout != null) { | |
| 7582 | + promises.push(new Promise(function (resolve) { return setTimeout(resolve, timeout, null); })); | |
| 7583 | + } | |
| 7584 | + _c.label = 1; | |
| 7585 | + case 1: | |
| 7586 | + _c.trys.push([1, , 3, 4]); | |
| 7587 | + return [4 /*yield*/, raceWithSignal(signal, Promise.race(promises))]; | |
| 7588 | + case 2: | |
| 7589 | + output = _c.sent(); | |
| 7590 | + validateActive(signal); | |
| 7591 | + return [2 /*return*/, output]; | |
| 7592 | + case 3: | |
| 7593 | + unsubscribe(); | |
| 7594 | + return [7 /*endfinally*/]; | |
| 7595 | + case 4: return [2 /*return*/]; | |
| 7596 | + } | |
| 7597 | + }); | |
| 7598 | + }); }; | |
| 7599 | + return function (predicate, timeout) { return catchRejection(take(predicate, timeout)); }; | |
| 7600 | +}; | |
| 7601 | +var getListenerEntryPropsFrom = function (options) { | |
| 7602 | + var type = options.type, actionCreator = options.actionCreator, matcher = options.matcher, predicate = options.predicate, effect = options.effect; | |
| 7603 | + if (type) { | |
| 7604 | + predicate = createAction(type).match; | |
| 7605 | + } | |
| 7606 | + else if (actionCreator) { | |
| 7607 | + type = actionCreator.type; | |
| 7608 | + predicate = actionCreator.match; | |
| 7609 | + } | |
| 7610 | + else if (matcher) { | |
| 7611 | + predicate = matcher; | |
| 7612 | + } | |
| 7613 | + else if (predicate) { | |
| 7614 | + } | |
| 7615 | + else { | |
| 7616 | + throw new Error("Creating or removing a listener requires one of the known fields for matching an action"); | |
| 7617 | + } | |
| 7618 | + assertFunction(effect, "options.listener"); | |
| 7619 | + return { predicate: predicate, type: type, effect: effect }; | |
| 7620 | +}; | |
| 7621 | +var createListenerEntry = function (options) { | |
| 7622 | + var _c = getListenerEntryPropsFrom(options), type = _c.type, predicate = _c.predicate, effect = _c.effect; | |
| 7623 | + var id = nanoid(); | |
| 7624 | + var entry = { | |
| 7625 | + id: id, | |
| 7626 | + effect: effect, | |
| 7627 | + type: type, | |
| 7628 | + predicate: predicate, | |
| 7629 | + pending: new Set(), | |
| 7630 | + unsubscribe: function () { | |
| 7631 | + throw new Error("Unsubscribe not initialized"); | |
| 7632 | + } | |
| 7633 | + }; | |
| 7634 | + return entry; | |
| 7635 | +}; | |
| 7636 | +var cancelActiveListeners = function (entry) { | |
| 7637 | + entry.pending.forEach(function (controller) { | |
| 7638 | + abortControllerWithReason(controller, listenerCancelled); | |
| 7639 | + }); | |
| 7640 | +}; | |
| 7641 | +var createClearListenerMiddleware = function (listenerMap) { | |
| 7642 | + return function () { | |
| 7643 | + listenerMap.forEach(cancelActiveListeners); | |
| 7644 | + listenerMap.clear(); | |
| 7645 | + }; | |
| 7646 | +}; | |
| 7647 | +var safelyNotifyError = function (errorHandler, errorToNotify, errorInfo) { | |
| 7648 | + try { | |
| 7649 | + errorHandler(errorToNotify, errorInfo); | |
| 7650 | + } | |
| 7651 | + catch (errorHandlerError) { | |
| 7652 | + setTimeout(function () { | |
| 7653 | + throw errorHandlerError; | |
| 7654 | + }, 0); | |
| 7655 | + } | |
| 7656 | +}; | |
| 7657 | +var addListener = createAction(alm + "/add"); | |
| 7658 | +var clearAllListeners = createAction(alm + "/removeAll"); | |
| 7659 | +var removeListener = createAction(alm + "/remove"); | |
| 7660 | +var defaultErrorHandler = function () { | |
| 7661 | + var args = []; | |
| 7662 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 7663 | + args[_i] = arguments[_i]; | |
| 7664 | + } | |
| 7665 | + console.error.apply(console, __spreadArray([alm + "/error"], args)); | |
| 7666 | +}; | |
| 7667 | +function createListenerMiddleware(middlewareOptions) { | |
| 7668 | + var _this = this; | |
| 7669 | + if (middlewareOptions === void 0) { middlewareOptions = {}; } | |
| 7670 | + var listenerMap = new Map(); | |
| 7671 | + var extra = middlewareOptions.extra, _c = middlewareOptions.onError, onError = _c === void 0 ? defaultErrorHandler : _c; | |
| 7672 | + assertFunction(onError, "onError"); | |
| 7673 | + var insertEntry = function (entry) { | |
| 7674 | + entry.unsubscribe = function () { return listenerMap.delete(entry.id); }; | |
| 7675 | + listenerMap.set(entry.id, entry); | |
| 7676 | + return function (cancelOptions) { | |
| 7677 | + entry.unsubscribe(); | |
| 7678 | + if (cancelOptions == null ? void 0 : cancelOptions.cancelActive) { | |
| 7679 | + cancelActiveListeners(entry); | |
| 7680 | + } | |
| 7681 | + }; | |
| 7682 | + }; | |
| 7683 | + var findListenerEntry = function (comparator) { | |
| 7684 | + for (var _i = 0, _c = Array.from(listenerMap.values()); _i < _c.length; _i++) { | |
| 7685 | + var entry = _c[_i]; | |
| 7686 | + if (comparator(entry)) { | |
| 7687 | + return entry; | |
| 7688 | + } | |
| 7689 | + } | |
| 7690 | + return void 0; | |
| 7691 | + }; | |
| 7692 | + var startListening = function (options) { | |
| 7693 | + var entry = findListenerEntry(function (existingEntry) { return existingEntry.effect === options.effect; }); | |
| 7694 | + if (!entry) { | |
| 7695 | + entry = createListenerEntry(options); | |
| 7696 | + } | |
| 7697 | + return insertEntry(entry); | |
| 7698 | + }; | |
| 7699 | + var stopListening = function (options) { | |
| 7700 | + var _c = getListenerEntryPropsFrom(options), type = _c.type, effect = _c.effect, predicate = _c.predicate; | |
| 7701 | + var entry = findListenerEntry(function (entry2) { | |
| 7702 | + var matchPredicateOrType = typeof type === "string" ? entry2.type === type : entry2.predicate === predicate; | |
| 7703 | + return matchPredicateOrType && entry2.effect === effect; | |
| 7704 | + }); | |
| 7705 | + if (entry) { | |
| 7706 | + entry.unsubscribe(); | |
| 7707 | + if (options.cancelActive) { | |
| 7708 | + cancelActiveListeners(entry); | |
| 7709 | + } | |
| 7710 | + } | |
| 7711 | + return !!entry; | |
| 7712 | + }; | |
| 7713 | + var notifyListener = function (entry, action, api, getOriginalState) { return __async(_this, null, function () { | |
| 7714 | + var internalTaskController, take, autoJoinPromises, listenerError_1; | |
| 7715 | + return __generator(this, function (_c) { | |
| 7716 | + switch (_c.label) { | |
| 7717 | + case 0: | |
| 7718 | + internalTaskController = new AbortController(); | |
| 7719 | + take = createTakePattern(startListening, internalTaskController.signal); | |
| 7720 | + autoJoinPromises = []; | |
| 7721 | + _c.label = 1; | |
| 7722 | + case 1: | |
| 7723 | + _c.trys.push([1, 3, 4, 6]); | |
| 7724 | + entry.pending.add(internalTaskController); | |
| 7725 | + return [4 /*yield*/, Promise.resolve(entry.effect(action, assign({}, api, { | |
| 7726 | + getOriginalState: getOriginalState, | |
| 7727 | + condition: function (predicate, timeout) { return take(predicate, timeout).then(Boolean); }, | |
| 7728 | + take: take, | |
| 7729 | + delay: createDelay(internalTaskController.signal), | |
| 7730 | + pause: createPause(internalTaskController.signal), | |
| 7731 | + extra: extra, | |
| 7732 | + signal: internalTaskController.signal, | |
| 7733 | + fork: createFork(internalTaskController.signal, autoJoinPromises), | |
| 7734 | + unsubscribe: entry.unsubscribe, | |
| 7735 | + subscribe: function () { | |
| 7736 | + listenerMap.set(entry.id, entry); | |
| 7737 | + }, | |
| 7738 | + cancelActiveListeners: function () { | |
| 7739 | + entry.pending.forEach(function (controller, _, set) { | |
| 7740 | + if (controller !== internalTaskController) { | |
| 7741 | + abortControllerWithReason(controller, listenerCancelled); | |
| 7742 | + set.delete(controller); | |
| 7743 | + } | |
| 7744 | + }); | |
| 7745 | + } | |
| 7746 | + })))]; | |
| 7747 | + case 2: | |
| 7748 | + _c.sent(); | |
| 7749 | + return [3 /*break*/, 6]; | |
| 7750 | + case 3: | |
| 7751 | + listenerError_1 = _c.sent(); | |
| 7752 | + if (!(listenerError_1 instanceof TaskAbortError)) { | |
| 7753 | + safelyNotifyError(onError, listenerError_1, { | |
| 7754 | + raisedBy: "effect" | |
| 7755 | + }); | |
| 7756 | + } | |
| 7757 | + return [3 /*break*/, 6]; | |
| 7758 | + case 4: return [4 /*yield*/, Promise.allSettled(autoJoinPromises)]; | |
| 7759 | + case 5: | |
| 7760 | + _c.sent(); | |
| 7761 | + abortControllerWithReason(internalTaskController, listenerCompleted); | |
| 7762 | + entry.pending.delete(internalTaskController); | |
| 7763 | + return [7 /*endfinally*/]; | |
| 7764 | + case 6: return [2 /*return*/]; | |
| 7765 | + } | |
| 7766 | + }); | |
| 7767 | + }); }; | |
| 7768 | + var clearListenerMiddleware = createClearListenerMiddleware(listenerMap); | |
| 7769 | + var middleware = function (api) { return function (next) { return function (action) { | |
| 7770 | + if (!isAction(action)) { | |
| 7771 | + return next(action); | |
| 7772 | + } | |
| 7773 | + if (addListener.match(action)) { | |
| 7774 | + return startListening(action.payload); | |
| 7775 | + } | |
| 7776 | + if (clearAllListeners.match(action)) { | |
| 7777 | + clearListenerMiddleware(); | |
| 7778 | + return; | |
| 7779 | + } | |
| 7780 | + if (removeListener.match(action)) { | |
| 7781 | + return stopListening(action.payload); | |
| 7782 | + } | |
| 7783 | + var originalState = api.getState(); | |
| 7784 | + var getOriginalState = function () { | |
| 7785 | + if (originalState === INTERNAL_NIL_TOKEN) { | |
| 7786 | + throw new Error(alm + ": getOriginalState can only be called synchronously"); | |
| 7787 | + } | |
| 7788 | + return originalState; | |
| 7789 | + }; | |
| 7790 | + var result; | |
| 7791 | + try { | |
| 7792 | + result = next(action); | |
| 7793 | + if (listenerMap.size > 0) { | |
| 7794 | + var currentState = api.getState(); | |
| 7795 | + var listenerEntries = Array.from(listenerMap.values()); | |
| 7796 | + for (var _i = 0, listenerEntries_1 = listenerEntries; _i < listenerEntries_1.length; _i++) { | |
| 7797 | + var entry = listenerEntries_1[_i]; | |
| 7798 | + var runListener = false; | |
| 7799 | + try { | |
| 7800 | + runListener = entry.predicate(action, currentState, originalState); | |
| 7801 | + } | |
| 7802 | + catch (predicateError) { | |
| 7803 | + runListener = false; | |
| 7804 | + safelyNotifyError(onError, predicateError, { | |
| 7805 | + raisedBy: "predicate" | |
| 7806 | + }); | |
| 7807 | + } | |
| 7808 | + if (!runListener) { | |
| 7809 | + continue; | |
| 7810 | + } | |
| 7811 | + notifyListener(entry, action, api, getOriginalState); | |
| 7812 | + } | |
| 7813 | + } | |
| 7814 | + } | |
| 7815 | + finally { | |
| 7816 | + originalState = INTERNAL_NIL_TOKEN; | |
| 7817 | + } | |
| 7818 | + return result; | |
| 7819 | + }; }; }; | |
| 7820 | + return { | |
| 7821 | + middleware: middleware, | |
| 7822 | + startListening: startListening, | |
| 7823 | + stopListening: stopListening, | |
| 7824 | + clearListeners: clearListenerMiddleware | |
| 7825 | + }; | |
| 7826 | +} | |
| 7827 | +// src/autoBatchEnhancer.ts | |
| 7828 | +var SHOULD_AUTOBATCH = "RTK_autoBatch"; | |
| 7829 | +var prepareAutoBatched = function () { return function (payload) { | |
| 7830 | + var _c; | |
| 7831 | + return ({ | |
| 7832 | + payload: payload, | |
| 7833 | + meta: (_c = {}, _c[SHOULD_AUTOBATCH] = true, _c) | |
| 7834 | + }); | |
| 7835 | +}; }; | |
| 7836 | +var promise; | |
| 7837 | +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 () { | |
| 7838 | + throw err; | |
| 7839 | +}, 0); }); }; | |
| 7840 | +var createQueueWithTimer = function (timeout) { | |
| 7841 | + return function (notify) { | |
| 7842 | + setTimeout(notify, timeout); | |
| 7843 | + }; | |
| 7844 | +}; | |
| 7845 | +var rAF = typeof window !== "undefined" && window.requestAnimationFrame ? window.requestAnimationFrame : createQueueWithTimer(10); | |
| 7846 | +var autoBatchEnhancer = function (options) { | |
| 7847 | + if (options === void 0) { options = { type: "raf" }; } | |
| 7848 | + return function (next) { return function () { | |
| 7849 | + var args = []; | |
| 7850 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 7851 | + args[_i] = arguments[_i]; | |
| 7852 | + } | |
| 7853 | + var store = next.apply(void 0, args); | |
| 7854 | + var notifying = true; | |
| 7855 | + var shouldNotifyAtEndOfTick = false; | |
| 7856 | + var notificationQueued = false; | |
| 7857 | + var listeners = new Set(); | |
| 7858 | + var queueCallback = options.type === "tick" ? queueMicrotaskShim : options.type === "raf" ? rAF : options.type === "callback" ? options.queueNotification : createQueueWithTimer(options.timeout); | |
| 7859 | + var notifyListeners = function () { | |
| 7860 | + notificationQueued = false; | |
| 7861 | + if (shouldNotifyAtEndOfTick) { | |
| 7862 | + shouldNotifyAtEndOfTick = false; | |
| 7863 | + listeners.forEach(function (l) { return l(); }); | |
| 7864 | + } | |
| 7865 | + }; | |
| 7866 | + return Object.assign({}, store, { | |
| 7867 | + subscribe: function (listener2) { | |
| 7868 | + var wrappedListener = function () { return notifying && listener2(); }; | |
| 7869 | + var unsubscribe = store.subscribe(wrappedListener); | |
| 7870 | + listeners.add(listener2); | |
| 7871 | + return function () { | |
| 7872 | + unsubscribe(); | |
| 7873 | + listeners.delete(listener2); | |
| 7874 | + }; | |
| 7875 | + }, | |
| 7876 | + dispatch: function (action) { | |
| 7877 | + var _a; | |
| 7878 | + try { | |
| 7879 | + notifying = !((_a = action == null ? void 0 : action.meta) == null ? void 0 : _a[SHOULD_AUTOBATCH]); | |
| 7880 | + shouldNotifyAtEndOfTick = !notifying; | |
| 7881 | + if (shouldNotifyAtEndOfTick) { | |
| 7882 | + if (!notificationQueued) { | |
| 7883 | + notificationQueued = true; | |
| 7884 | + queueCallback(notifyListeners); | |
| 7885 | + } | |
| 7886 | + } | |
| 7887 | + return store.dispatch(action); | |
| 7888 | + } | |
| 7889 | + finally { | |
| 7890 | + notifying = true; | |
| 7891 | + } | |
| 7892 | + } | |
| 7893 | + }); | |
| 7894 | + }; }; | |
| 7895 | +}; | |
| 7896 | +// src/index.ts | |
| 7897 | +(0,immer__WEBPACK_IMPORTED_MODULE_0__.enableES5)(); | |
| 7898 | + | |
| 7899 | +//# sourceMappingURL=redux-toolkit.esm.js.map | |
| 7900 | + | |
| 7901 | +/***/ }), | |
| 7902 | + | |
| 7903 | +/***/ "../node_modules/immer/dist/immer.esm.mjs": | |
| 3398 | 7904 | /*!************************************************!*\ |
| 3399 | - !*** external "elementorVendors.reduxToolkit" ***! | |
| 7905 | + !*** ../node_modules/immer/dist/immer.esm.mjs ***! | |
| 3400 | 7906 | \************************************************/ |
| 3401 | -/***/ ((module) => { | |
| 7907 | +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { | |
| 3402 | 7908 | |
| 3403 | 7909 | "use strict"; |
| 3404 | -module.exports = elementorVendors.reduxToolkit; | |
| 7910 | +__webpack_require__.r(__webpack_exports__); | |
| 7911 | +/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 7912 | +/* harmony export */ Immer: () => (/* binding */ un), | |
| 7913 | +/* harmony export */ applyPatches: () => (/* binding */ pn), | |
| 7914 | +/* harmony export */ castDraft: () => (/* binding */ K), | |
| 7915 | +/* harmony export */ castImmutable: () => (/* binding */ $), | |
| 7916 | +/* harmony export */ createDraft: () => (/* binding */ ln), | |
| 7917 | +/* harmony export */ current: () => (/* binding */ R), | |
| 7918 | +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), | |
| 7919 | +/* harmony export */ enableAllPlugins: () => (/* binding */ J), | |
| 7920 | +/* harmony export */ enableES5: () => (/* binding */ F), | |
| 7921 | +/* harmony export */ enableMapSet: () => (/* binding */ C), | |
| 7922 | +/* harmony export */ enablePatches: () => (/* binding */ T), | |
| 7923 | +/* harmony export */ finishDraft: () => (/* binding */ dn), | |
| 7924 | +/* harmony export */ freeze: () => (/* binding */ d), | |
| 7925 | +/* harmony export */ immerable: () => (/* binding */ L), | |
| 7926 | +/* harmony export */ isDraft: () => (/* binding */ r), | |
| 7927 | +/* harmony export */ isDraftable: () => (/* binding */ t), | |
| 7928 | +/* harmony export */ nothing: () => (/* binding */ H), | |
| 7929 | +/* harmony export */ original: () => (/* binding */ e), | |
| 7930 | +/* harmony export */ produce: () => (/* binding */ fn), | |
| 7931 | +/* harmony export */ produceWithPatches: () => (/* binding */ cn), | |
| 7932 | +/* harmony export */ setAutoFreeze: () => (/* binding */ sn), | |
| 7933 | +/* harmony export */ setUseProxies: () => (/* binding */ vn) | |
| 7934 | +/* harmony export */ }); | |
| 7935 | +function n(n){for(var r=arguments.length,t=Array(r>1?r-1:0),e=1;e<r;e++)t[e-1]=arguments[e];if(true){var i=Y[n],o=i?"function"==typeof i?i.apply(null,t):i:"unknown error nr: "+n;throw Error("[Immer] "+o)}// removed by dead control flow | |
| 7936 | +}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); | |
| 7937 | +//# sourceMappingURL=immer.esm.js.map | |
| 3405 | 7938 | |
| 7939 | + | |
| 7940 | +/***/ }), | |
| 7941 | + | |
| 7942 | +/***/ "../node_modules/redux-thunk/es/index.js": | |
| 7943 | +/*!***********************************************!*\ | |
| 7944 | + !*** ../node_modules/redux-thunk/es/index.js ***! | |
| 7945 | + \***********************************************/ | |
| 7946 | +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { | |
| 7947 | + | |
| 7948 | +"use strict"; | |
| 7949 | +__webpack_require__.r(__webpack_exports__); | |
| 7950 | +/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 7951 | +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) | |
| 7952 | +/* harmony export */ }); | |
| 7953 | +/** A function that accepts a potential "extra argument" value to be injected later, | |
| 7954 | + * and returns an instance of the thunk middleware that uses that value | |
| 7955 | + */ | |
| 7956 | +function createThunkMiddleware(extraArgument) { | |
| 7957 | + // Standard Redux middleware definition pattern: | |
| 7958 | + // See: https://redux.js.org/tutorials/fundamentals/part-4-store#writing-custom-middleware | |
| 7959 | + var middleware = function middleware(_ref) { | |
| 7960 | + var dispatch = _ref.dispatch, | |
| 7961 | + getState = _ref.getState; | |
| 7962 | + return function (next) { | |
| 7963 | + return function (action) { | |
| 7964 | + // The thunk middleware looks for any functions that were passed to `store.dispatch`. | |
| 7965 | + // If this "action" is really a function, call it and return the result. | |
| 7966 | + if (typeof action === 'function') { | |
| 7967 | + // Inject the store's `dispatch` and `getState` methods, as well as any "extra arg" | |
| 7968 | + return action(dispatch, getState, extraArgument); | |
| 7969 | + } // Otherwise, pass the action down the middleware chain as usual | |
| 7970 | + | |
| 7971 | + | |
| 7972 | + return next(action); | |
| 7973 | + }; | |
| 7974 | + }; | |
| 7975 | + }; | |
| 7976 | + | |
| 7977 | + return middleware; | |
| 7978 | +} | |
| 7979 | + | |
| 7980 | +var thunk = createThunkMiddleware(); // Attach the factory function so users can create a customized version | |
| 7981 | +// with whatever "extra arg" they want to inject into their thunks | |
| 7982 | + | |
| 7983 | +thunk.withExtraArgument = createThunkMiddleware; | |
| 7984 | +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (thunk); | |
| 7985 | + | |
| 7986 | +/***/ }), | |
| 7987 | + | |
| 7988 | +/***/ "../node_modules/redux/es/redux.js": | |
| 7989 | +/*!*****************************************!*\ | |
| 7990 | + !*** ../node_modules/redux/es/redux.js ***! | |
| 7991 | + \*****************************************/ | |
| 7992 | +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { | |
| 7993 | + | |
| 7994 | +"use strict"; | |
| 7995 | +__webpack_require__.r(__webpack_exports__); | |
| 7996 | +/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 7997 | +/* harmony export */ __DO_NOT_USE__ActionTypes: () => (/* binding */ ActionTypes), | |
| 7998 | +/* harmony export */ applyMiddleware: () => (/* binding */ applyMiddleware), | |
| 7999 | +/* harmony export */ bindActionCreators: () => (/* binding */ bindActionCreators), | |
| 8000 | +/* harmony export */ combineReducers: () => (/* binding */ combineReducers), | |
| 8001 | +/* harmony export */ compose: () => (/* binding */ compose), | |
| 8002 | +/* harmony export */ createStore: () => (/* binding */ createStore), | |
| 8003 | +/* harmony export */ legacy_createStore: () => (/* binding */ legacy_createStore) | |
| 8004 | +/* harmony export */ }); | |
| 8005 | +/* 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"); | |
| 8006 | + | |
| 8007 | + | |
| 8008 | +/** | |
| 8009 | + * Adapted from React: https://github.com/facebook/react/blob/master/packages/shared/formatProdErrorMessage.js | |
| 8010 | + * | |
| 8011 | + * Do not require this module directly! Use normal throw error calls. These messages will be replaced with error codes | |
| 8012 | + * during build. | |
| 8013 | + * @param {number} code | |
| 8014 | + */ | |
| 8015 | +function formatProdErrorMessage(code) { | |
| 8016 | + 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. '; | |
| 8017 | +} | |
| 8018 | + | |
| 8019 | +// Inlined version of the `symbol-observable` polyfill | |
| 8020 | +var $$observable = (function () { | |
| 8021 | + return typeof Symbol === 'function' && Symbol.observable || '@@observable'; | |
| 8022 | +})(); | |
| 8023 | + | |
| 8024 | +/** | |
| 8025 | + * These are private action types reserved by Redux. | |
| 8026 | + * For any unknown actions, you must return the current state. | |
| 8027 | + * If the current state is undefined, you must return the initial state. | |
| 8028 | + * Do not reference these action types directly in your code. | |
| 8029 | + */ | |
| 8030 | +var randomString = function randomString() { | |
| 8031 | + return Math.random().toString(36).substring(7).split('').join('.'); | |
| 8032 | +}; | |
| 8033 | + | |
| 8034 | +var ActionTypes = { | |
| 8035 | + INIT: "@@redux/INIT" + randomString(), | |
| 8036 | + REPLACE: "@@redux/REPLACE" + randomString(), | |
| 8037 | + PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() { | |
| 8038 | + return "@@redux/PROBE_UNKNOWN_ACTION" + randomString(); | |
| 8039 | + } | |
| 8040 | +}; | |
| 8041 | + | |
| 8042 | +/** | |
| 8043 | + * @param {any} obj The object to inspect. | |
| 8044 | + * @returns {boolean} True if the argument appears to be a plain object. | |
| 8045 | + */ | |
| 8046 | +function isPlainObject(obj) { | |
| 8047 | + if (typeof obj !== 'object' || obj === null) return false; | |
| 8048 | + var proto = obj; | |
| 8049 | + | |
| 8050 | + while (Object.getPrototypeOf(proto) !== null) { | |
| 8051 | + proto = Object.getPrototypeOf(proto); | |
| 8052 | + } | |
| 8053 | + | |
| 8054 | + return Object.getPrototypeOf(obj) === proto; | |
| 8055 | +} | |
| 8056 | + | |
| 8057 | +// Inlined / shortened version of `kindOf` from https://github.com/jonschlinkert/kind-of | |
| 8058 | +function miniKindOf(val) { | |
| 8059 | + if (val === void 0) return 'undefined'; | |
| 8060 | + if (val === null) return 'null'; | |
| 8061 | + var type = typeof val; | |
| 8062 | + | |
| 8063 | + switch (type) { | |
| 8064 | + case 'boolean': | |
| 8065 | + case 'string': | |
| 8066 | + case 'number': | |
| 8067 | + case 'symbol': | |
| 8068 | + case 'function': | |
| 8069 | + { | |
| 8070 | + return type; | |
| 8071 | + } | |
| 8072 | + } | |
| 8073 | + | |
| 8074 | + if (Array.isArray(val)) return 'array'; | |
| 8075 | + if (isDate(val)) return 'date'; | |
| 8076 | + if (isError(val)) return 'error'; | |
| 8077 | + var constructorName = ctorName(val); | |
| 8078 | + | |
| 8079 | + switch (constructorName) { | |
| 8080 | + case 'Symbol': | |
| 8081 | + case 'Promise': | |
| 8082 | + case 'WeakMap': | |
| 8083 | + case 'WeakSet': | |
| 8084 | + case 'Map': | |
| 8085 | + case 'Set': | |
| 8086 | + return constructorName; | |
| 8087 | + } // other | |
| 8088 | + | |
| 8089 | + | |
| 8090 | + return type.slice(8, -1).toLowerCase().replace(/\s/g, ''); | |
| 8091 | +} | |
| 8092 | + | |
| 8093 | +function ctorName(val) { | |
| 8094 | + return typeof val.constructor === 'function' ? val.constructor.name : null; | |
| 8095 | +} | |
| 8096 | + | |
| 8097 | +function isError(val) { | |
| 8098 | + return val instanceof Error || typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number'; | |
| 8099 | +} | |
| 8100 | + | |
| 8101 | +function isDate(val) { | |
| 8102 | + if (val instanceof Date) return true; | |
| 8103 | + return typeof val.toDateString === 'function' && typeof val.getDate === 'function' && typeof val.setDate === 'function'; | |
| 8104 | +} | |
| 8105 | + | |
| 8106 | +function kindOf(val) { | |
| 8107 | + var typeOfVal = typeof val; | |
| 8108 | + | |
| 8109 | + if (true) { | |
| 8110 | + typeOfVal = miniKindOf(val); | |
| 8111 | + } | |
| 8112 | + | |
| 8113 | + return typeOfVal; | |
| 8114 | +} | |
| 8115 | + | |
| 8116 | +/** | |
| 8117 | + * @deprecated | |
| 8118 | + * | |
| 8119 | + * **We recommend using the `configureStore` method | |
| 8120 | + * of the `@reduxjs/toolkit` package**, which replaces `createStore`. | |
| 8121 | + * | |
| 8122 | + * Redux Toolkit is our recommended approach for writing Redux logic today, | |
| 8123 | + * including store setup, reducers, data fetching, and more. | |
| 8124 | + * | |
| 8125 | + * **For more details, please read this Redux docs page:** | |
| 8126 | + * **https://redux.js.org/introduction/why-rtk-is-redux-today** | |
| 8127 | + * | |
| 8128 | + * `configureStore` from Redux Toolkit is an improved version of `createStore` that | |
| 8129 | + * simplifies setup and helps avoid common bugs. | |
| 8130 | + * | |
| 8131 | + * You should not be using the `redux` core package by itself today, except for learning purposes. | |
| 8132 | + * The `createStore` method from the core `redux` package will not be removed, but we encourage | |
| 8133 | + * all users to migrate to using Redux Toolkit for all Redux code. | |
| 8134 | + * | |
| 8135 | + * If you want to use `createStore` without this visual deprecation warning, use | |
| 8136 | + * the `legacy_createStore` import instead: | |
| 8137 | + * | |
| 8138 | + * `import { legacy_createStore as createStore} from 'redux'` | |
| 8139 | + * | |
| 8140 | + */ | |
| 8141 | + | |
| 8142 | +function createStore(reducer, preloadedState, enhancer) { | |
| 8143 | + var _ref2; | |
| 8144 | + | |
| 8145 | + if (typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments[3] === 'function') { | |
| 8146 | + 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.'); | |
| 8147 | + } | |
| 8148 | + | |
| 8149 | + if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') { | |
| 8150 | + enhancer = preloadedState; | |
| 8151 | + preloadedState = undefined; | |
| 8152 | + } | |
| 8153 | + | |
| 8154 | + if (typeof enhancer !== 'undefined') { | |
| 8155 | + if (typeof enhancer !== 'function') { | |
| 8156 | + throw new Error( false ? 0 : "Expected the enhancer to be a function. Instead, received: '" + kindOf(enhancer) + "'"); | |
| 8157 | + } | |
| 8158 | + | |
| 8159 | + return enhancer(createStore)(reducer, preloadedState); | |
| 8160 | + } | |
| 8161 | + | |
| 8162 | + if (typeof reducer !== 'function') { | |
| 8163 | + throw new Error( false ? 0 : "Expected the root reducer to be a function. Instead, received: '" + kindOf(reducer) + "'"); | |
| 8164 | + } | |
| 8165 | + | |
| 8166 | + var currentReducer = reducer; | |
| 8167 | + var currentState = preloadedState; | |
| 8168 | + var currentListeners = []; | |
| 8169 | + var nextListeners = currentListeners; | |
| 8170 | + var isDispatching = false; | |
| 8171 | + /** | |
| 8172 | + * This makes a shallow copy of currentListeners so we can use | |
| 8173 | + * nextListeners as a temporary list while dispatching. | |
| 8174 | + * | |
| 8175 | + * This prevents any bugs around consumers calling | |
| 8176 | + * subscribe/unsubscribe in the middle of a dispatch. | |
| 8177 | + */ | |
| 8178 | + | |
| 8179 | + function ensureCanMutateNextListeners() { | |
| 8180 | + if (nextListeners === currentListeners) { | |
| 8181 | + nextListeners = currentListeners.slice(); | |
| 8182 | + } | |
| 8183 | + } | |
| 8184 | + /** | |
| 8185 | + * Reads the state tree managed by the store. | |
| 8186 | + * | |
| 8187 | + * @returns {any} The current state tree of your application. | |
| 8188 | + */ | |
| 8189 | + | |
| 8190 | + | |
| 8191 | + function getState() { | |
| 8192 | + if (isDispatching) { | |
| 8193 | + 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.'); | |
| 8194 | + } | |
| 8195 | + | |
| 8196 | + return currentState; | |
| 8197 | + } | |
| 8198 | + /** | |
| 8199 | + * Adds a change listener. It will be called any time an action is dispatched, | |
| 8200 | + * and some part of the state tree may potentially have changed. You may then | |
| 8201 | + * call `getState()` to read the current state tree inside the callback. | |
| 8202 | + * | |
| 8203 | + * You may call `dispatch()` from a change listener, with the following | |
| 8204 | + * caveats: | |
| 8205 | + * | |
| 8206 | + * 1. The subscriptions are snapshotted just before every `dispatch()` call. | |
| 8207 | + * If you subscribe or unsubscribe while the listeners are being invoked, this | |
| 8208 | + * will not have any effect on the `dispatch()` that is currently in progress. | |
| 8209 | + * However, the next `dispatch()` call, whether nested or not, will use a more | |
| 8210 | + * recent snapshot of the subscription list. | |
| 8211 | + * | |
| 8212 | + * 2. The listener should not expect to see all state changes, as the state | |
| 8213 | + * might have been updated multiple times during a nested `dispatch()` before | |
| 8214 | + * the listener is called. It is, however, guaranteed that all subscribers | |
| 8215 | + * registered before the `dispatch()` started will be called with the latest | |
| 8216 | + * state by the time it exits. | |
| 8217 | + * | |
| 8218 | + * @param {Function} listener A callback to be invoked on every dispatch. | |
| 8219 | + * @returns {Function} A function to remove this change listener. | |
| 8220 | + */ | |
| 8221 | + | |
| 8222 | + | |
| 8223 | + function subscribe(listener) { | |
| 8224 | + if (typeof listener !== 'function') { | |
| 8225 | + throw new Error( false ? 0 : "Expected the listener to be a function. Instead, received: '" + kindOf(listener) + "'"); | |
| 8226 | + } | |
| 8227 | + | |
| 8228 | + if (isDispatching) { | |
| 8229 | + 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.'); | |
| 8230 | + } | |
| 8231 | + | |
| 8232 | + var isSubscribed = true; | |
| 8233 | + ensureCanMutateNextListeners(); | |
| 8234 | + nextListeners.push(listener); | |
| 8235 | + return function unsubscribe() { | |
| 8236 | + if (!isSubscribed) { | |
| 8237 | + return; | |
| 8238 | + } | |
| 8239 | + | |
| 8240 | + if (isDispatching) { | |
| 8241 | + 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.'); | |
| 8242 | + } | |
| 8243 | + | |
| 8244 | + isSubscribed = false; | |
| 8245 | + ensureCanMutateNextListeners(); | |
| 8246 | + var index = nextListeners.indexOf(listener); | |
| 8247 | + nextListeners.splice(index, 1); | |
| 8248 | + currentListeners = null; | |
| 8249 | + }; | |
| 8250 | + } | |
| 8251 | + /** | |
| 8252 | + * Dispatches an action. It is the only way to trigger a state change. | |
| 8253 | + * | |
| 8254 | + * The `reducer` function, used to create the store, will be called with the | |
| 8255 | + * current state tree and the given `action`. Its return value will | |
| 8256 | + * be considered the **next** state of the tree, and the change listeners | |
| 8257 | + * will be notified. | |
| 8258 | + * | |
| 8259 | + * The base implementation only supports plain object actions. If you want to | |
| 8260 | + * dispatch a Promise, an Observable, a thunk, or something else, you need to | |
| 8261 | + * wrap your store creating function into the corresponding middleware. For | |
| 8262 | + * example, see the documentation for the `redux-thunk` package. Even the | |
| 8263 | + * middleware will eventually dispatch plain object actions using this method. | |
| 8264 | + * | |
| 8265 | + * @param {Object} action A plain object representing “what changed”. It is | |
| 8266 | + * a good idea to keep actions serializable so you can record and replay user | |
| 8267 | + * sessions, or use the time travelling `redux-devtools`. An action must have | |
| 8268 | + * a `type` property which may not be `undefined`. It is a good idea to use | |
| 8269 | + * string constants for action types. | |
| 8270 | + * | |
| 8271 | + * @returns {Object} For convenience, the same action object you dispatched. | |
| 8272 | + * | |
| 8273 | + * Note that, if you use a custom middleware, it may wrap `dispatch()` to | |
| 8274 | + * return something else (for example, a Promise you can await). | |
| 8275 | + */ | |
| 8276 | + | |
| 8277 | + | |
| 8278 | + function dispatch(action) { | |
| 8279 | + if (!isPlainObject(action)) { | |
| 8280 | + 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."); | |
| 8281 | + } | |
| 8282 | + | |
| 8283 | + if (typeof action.type === 'undefined') { | |
| 8284 | + throw new Error( false ? 0 : 'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.'); | |
| 8285 | + } | |
| 8286 | + | |
| 8287 | + if (isDispatching) { | |
| 8288 | + throw new Error( false ? 0 : 'Reducers may not dispatch actions.'); | |
| 8289 | + } | |
| 8290 | + | |
| 8291 | + try { | |
| 8292 | + isDispatching = true; | |
| 8293 | + currentState = currentReducer(currentState, action); | |
| 8294 | + } finally { | |
| 8295 | + isDispatching = false; | |
| 8296 | + } | |
| 8297 | + | |
| 8298 | + var listeners = currentListeners = nextListeners; | |
| 8299 | + | |
| 8300 | + for (var i = 0; i < listeners.length; i++) { | |
| 8301 | + var listener = listeners[i]; | |
| 8302 | + listener(); | |
| 8303 | + } | |
| 8304 | + | |
| 8305 | + return action; | |
| 8306 | + } | |
| 8307 | + /** | |
| 8308 | + * Replaces the reducer currently used by the store to calculate the state. | |
| 8309 | + * | |
| 8310 | + * You might need this if your app implements code splitting and you want to | |
| 8311 | + * load some of the reducers dynamically. You might also need this if you | |
| 8312 | + * implement a hot reloading mechanism for Redux. | |
| 8313 | + * | |
| 8314 | + * @param {Function} nextReducer The reducer for the store to use instead. | |
| 8315 | + * @returns {void} | |
| 8316 | + */ | |
| 8317 | + | |
| 8318 | + | |
| 8319 | + function replaceReducer(nextReducer) { | |
| 8320 | + if (typeof nextReducer !== 'function') { | |
| 8321 | + throw new Error( false ? 0 : "Expected the nextReducer to be a function. Instead, received: '" + kindOf(nextReducer)); | |
| 8322 | + } | |
| 8323 | + | |
| 8324 | + currentReducer = nextReducer; // This action has a similiar effect to ActionTypes.INIT. | |
| 8325 | + // Any reducers that existed in both the new and old rootReducer | |
| 8326 | + // will receive the previous state. This effectively populates | |
| 8327 | + // the new state tree with any relevant data from the old one. | |
| 8328 | + | |
| 8329 | + dispatch({ | |
| 8330 | + type: ActionTypes.REPLACE | |
| 8331 | + }); | |
| 8332 | + } | |
| 8333 | + /** | |
| 8334 | + * Interoperability point for observable/reactive libraries. | |
| 8335 | + * @returns {observable} A minimal observable of state changes. | |
| 8336 | + * For more information, see the observable proposal: | |
| 8337 | + * https://github.com/tc39/proposal-observable | |
| 8338 | + */ | |
| 8339 | + | |
| 8340 | + | |
| 8341 | + function observable() { | |
| 8342 | + var _ref; | |
| 8343 | + | |
| 8344 | + var outerSubscribe = subscribe; | |
| 8345 | + return _ref = { | |
| 8346 | + /** | |
| 8347 | + * The minimal observable subscription method. | |
| 8348 | + * @param {Object} observer Any object that can be used as an observer. | |
| 8349 | + * The observer object should have a `next` method. | |
| 8350 | + * @returns {subscription} An object with an `unsubscribe` method that can | |
| 8351 | + * be used to unsubscribe the observable from the store, and prevent further | |
| 8352 | + * emission of values from the observable. | |
| 8353 | + */ | |
| 8354 | + subscribe: function subscribe(observer) { | |
| 8355 | + if (typeof observer !== 'object' || observer === null) { | |
| 8356 | + throw new Error( false ? 0 : "Expected the observer to be an object. Instead, received: '" + kindOf(observer) + "'"); | |
| 8357 | + } | |
| 8358 | + | |
| 8359 | + function observeState() { | |
| 8360 | + if (observer.next) { | |
| 8361 | + observer.next(getState()); | |
| 8362 | + } | |
| 8363 | + } | |
| 8364 | + | |
| 8365 | + observeState(); | |
| 8366 | + var unsubscribe = outerSubscribe(observeState); | |
| 8367 | + return { | |
| 8368 | + unsubscribe: unsubscribe | |
| 8369 | + }; | |
| 8370 | + } | |
| 8371 | + }, _ref[$$observable] = function () { | |
| 8372 | + return this; | |
| 8373 | + }, _ref; | |
| 8374 | + } // When a store is created, an "INIT" action is dispatched so that every | |
| 8375 | + // reducer returns their initial state. This effectively populates | |
| 8376 | + // the initial state tree. | |
| 8377 | + | |
| 8378 | + | |
| 8379 | + dispatch({ | |
| 8380 | + type: ActionTypes.INIT | |
| 8381 | + }); | |
| 8382 | + return _ref2 = { | |
| 8383 | + dispatch: dispatch, | |
| 8384 | + subscribe: subscribe, | |
| 8385 | + getState: getState, | |
| 8386 | + replaceReducer: replaceReducer | |
| 8387 | + }, _ref2[$$observable] = observable, _ref2; | |
| 8388 | +} | |
| 8389 | +/** | |
| 8390 | + * Creates a Redux store that holds the state tree. | |
| 8391 | + * | |
| 8392 | + * **We recommend using `configureStore` from the | |
| 8393 | + * `@reduxjs/toolkit` package**, which replaces `createStore`: | |
| 8394 | + * **https://redux.js.org/introduction/why-rtk-is-redux-today** | |
| 8395 | + * | |
| 8396 | + * The only way to change the data in the store is to call `dispatch()` on it. | |
| 8397 | + * | |
| 8398 | + * There should only be a single store in your app. To specify how different | |
| 8399 | + * parts of the state tree respond to actions, you may combine several reducers | |
| 8400 | + * into a single reducer function by using `combineReducers`. | |
| 8401 | + * | |
| 8402 | + * @param {Function} reducer A function that returns the next state tree, given | |
| 8403 | + * the current state tree and the action to handle. | |
| 8404 | + * | |
| 8405 | + * @param {any} [preloadedState] The initial state. You may optionally specify it | |
| 8406 | + * to hydrate the state from the server in universal apps, or to restore a | |
| 8407 | + * previously serialized user session. | |
| 8408 | + * If you use `combineReducers` to produce the root reducer function, this must be | |
| 8409 | + * an object with the same shape as `combineReducers` keys. | |
| 8410 | + * | |
| 8411 | + * @param {Function} [enhancer] The store enhancer. You may optionally specify it | |
| 8412 | + * to enhance the store with third-party capabilities such as middleware, | |
| 8413 | + * time travel, persistence, etc. The only store enhancer that ships with Redux | |
| 8414 | + * is `applyMiddleware()`. | |
| 8415 | + * | |
| 8416 | + * @returns {Store} A Redux store that lets you read the state, dispatch actions | |
| 8417 | + * and subscribe to changes. | |
| 8418 | + */ | |
| 8419 | + | |
| 8420 | +var legacy_createStore = createStore; | |
| 8421 | + | |
| 8422 | +/** | |
| 8423 | + * Prints a warning in the console if it exists. | |
| 8424 | + * | |
| 8425 | + * @param {String} message The warning message. | |
| 8426 | + * @returns {void} | |
| 8427 | + */ | |
| 8428 | +function warning(message) { | |
| 8429 | + /* eslint-disable no-console */ | |
| 8430 | + if (typeof console !== 'undefined' && typeof console.error === 'function') { | |
| 8431 | + console.error(message); | |
| 8432 | + } | |
| 8433 | + /* eslint-enable no-console */ | |
| 8434 | + | |
| 8435 | + | |
| 8436 | + try { | |
| 8437 | + // This error was thrown as a convenience so that if you enable | |
| 8438 | + // "break on all exceptions" in your console, | |
| 8439 | + // it would pause the execution at this line. | |
| 8440 | + throw new Error(message); | |
| 8441 | + } catch (e) {} // eslint-disable-line no-empty | |
| 8442 | + | |
| 8443 | +} | |
| 8444 | + | |
| 8445 | +function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) { | |
| 8446 | + var reducerKeys = Object.keys(reducers); | |
| 8447 | + var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer'; | |
| 8448 | + | |
| 8449 | + if (reducerKeys.length === 0) { | |
| 8450 | + return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.'; | |
| 8451 | + } | |
| 8452 | + | |
| 8453 | + if (!isPlainObject(inputState)) { | |
| 8454 | + return "The " + argumentName + " has unexpected type of \"" + kindOf(inputState) + "\". Expected argument to be an object with the following " + ("keys: \"" + reducerKeys.join('", "') + "\""); | |
| 8455 | + } | |
| 8456 | + | |
| 8457 | + var unexpectedKeys = Object.keys(inputState).filter(function (key) { | |
| 8458 | + return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key]; | |
| 8459 | + }); | |
| 8460 | + unexpectedKeys.forEach(function (key) { | |
| 8461 | + unexpectedKeyCache[key] = true; | |
| 8462 | + }); | |
| 8463 | + if (action && action.type === ActionTypes.REPLACE) return; | |
| 8464 | + | |
| 8465 | + if (unexpectedKeys.length > 0) { | |
| 8466 | + 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."); | |
| 8467 | + } | |
| 8468 | +} | |
| 8469 | + | |
| 8470 | +function assertReducerShape(reducers) { | |
| 8471 | + Object.keys(reducers).forEach(function (key) { | |
| 8472 | + var reducer = reducers[key]; | |
| 8473 | + var initialState = reducer(undefined, { | |
| 8474 | + type: ActionTypes.INIT | |
| 8475 | + }); | |
| 8476 | + | |
| 8477 | + if (typeof initialState === 'undefined') { | |
| 8478 | + 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."); | |
| 8479 | + } | |
| 8480 | + | |
| 8481 | + if (typeof reducer(undefined, { | |
| 8482 | + type: ActionTypes.PROBE_UNKNOWN_ACTION() | |
| 8483 | + }) === 'undefined') { | |
| 8484 | + 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."); | |
| 8485 | + } | |
| 8486 | + }); | |
| 8487 | +} | |
| 8488 | +/** | |
| 8489 | + * Turns an object whose values are different reducer functions, into a single | |
| 8490 | + * reducer function. It will call every child reducer, and gather their results | |
| 8491 | + * into a single state object, whose keys correspond to the keys of the passed | |
| 8492 | + * reducer functions. | |
| 8493 | + * | |
| 8494 | + * @param {Object} reducers An object whose values correspond to different | |
| 8495 | + * reducer functions that need to be combined into one. One handy way to obtain | |
| 8496 | + * it is to use ES6 `import * as reducers` syntax. The reducers may never return | |
| 8497 | + * undefined for any action. Instead, they should return their initial state | |
| 8498 | + * if the state passed to them was undefined, and the current state for any | |
| 8499 | + * unrecognized action. | |
| 8500 | + * | |
| 8501 | + * @returns {Function} A reducer function that invokes every reducer inside the | |
| 8502 | + * passed object, and builds a state object with the same shape. | |
| 8503 | + */ | |
| 8504 | + | |
| 8505 | + | |
| 8506 | +function combineReducers(reducers) { | |
| 8507 | + var reducerKeys = Object.keys(reducers); | |
| 8508 | + var finalReducers = {}; | |
| 8509 | + | |
| 8510 | + for (var i = 0; i < reducerKeys.length; i++) { | |
| 8511 | + var key = reducerKeys[i]; | |
| 8512 | + | |
| 8513 | + if (true) { | |
| 8514 | + if (typeof reducers[key] === 'undefined') { | |
| 8515 | + warning("No reducer provided for key \"" + key + "\""); | |
| 8516 | + } | |
| 8517 | + } | |
| 8518 | + | |
| 8519 | + if (typeof reducers[key] === 'function') { | |
| 8520 | + finalReducers[key] = reducers[key]; | |
| 8521 | + } | |
| 8522 | + } | |
| 8523 | + | |
| 8524 | + var finalReducerKeys = Object.keys(finalReducers); // This is used to make sure we don't warn about the same | |
| 8525 | + // keys multiple times. | |
| 8526 | + | |
| 8527 | + var unexpectedKeyCache; | |
| 8528 | + | |
| 8529 | + if (true) { | |
| 8530 | + unexpectedKeyCache = {}; | |
| 8531 | + } | |
| 8532 | + | |
| 8533 | + var shapeAssertionError; | |
| 8534 | + | |
| 8535 | + try { | |
| 8536 | + assertReducerShape(finalReducers); | |
| 8537 | + } catch (e) { | |
| 8538 | + shapeAssertionError = e; | |
| 8539 | + } | |
| 8540 | + | |
| 8541 | + return function combination(state, action) { | |
| 8542 | + if (state === void 0) { | |
| 8543 | + state = {}; | |
| 8544 | + } | |
| 8545 | + | |
| 8546 | + if (shapeAssertionError) { | |
| 8547 | + throw shapeAssertionError; | |
| 8548 | + } | |
| 8549 | + | |
| 8550 | + if (true) { | |
| 8551 | + var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache); | |
| 8552 | + | |
| 8553 | + if (warningMessage) { | |
| 8554 | + warning(warningMessage); | |
| 8555 | + } | |
| 8556 | + } | |
| 8557 | + | |
| 8558 | + var hasChanged = false; | |
| 8559 | + var nextState = {}; | |
| 8560 | + | |
| 8561 | + for (var _i = 0; _i < finalReducerKeys.length; _i++) { | |
| 8562 | + var _key = finalReducerKeys[_i]; | |
| 8563 | + var reducer = finalReducers[_key]; | |
| 8564 | + var previousStateForKey = state[_key]; | |
| 8565 | + var nextStateForKey = reducer(previousStateForKey, action); | |
| 8566 | + | |
| 8567 | + if (typeof nextStateForKey === 'undefined') { | |
| 8568 | + var actionType = action && action.type; | |
| 8569 | + 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."); | |
| 8570 | + } | |
| 8571 | + | |
| 8572 | + nextState[_key] = nextStateForKey; | |
| 8573 | + hasChanged = hasChanged || nextStateForKey !== previousStateForKey; | |
| 8574 | + } | |
| 8575 | + | |
| 8576 | + hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length; | |
| 8577 | + return hasChanged ? nextState : state; | |
| 8578 | + }; | |
| 8579 | +} | |
| 8580 | + | |
| 8581 | +function bindActionCreator(actionCreator, dispatch) { | |
| 8582 | + return function () { | |
| 8583 | + return dispatch(actionCreator.apply(this, arguments)); | |
| 8584 | + }; | |
| 8585 | +} | |
| 8586 | +/** | |
| 8587 | + * Turns an object whose values are action creators, into an object with the | |
| 8588 | + * same keys, but with every function wrapped into a `dispatch` call so they | |
| 8589 | + * may be invoked directly. This is just a convenience method, as you can call | |
| 8590 | + * `store.dispatch(MyActionCreators.doSomething())` yourself just fine. | |
| 8591 | + * | |
| 8592 | + * For convenience, you can also pass an action creator as the first argument, | |
| 8593 | + * and get a dispatch wrapped function in return. | |
| 8594 | + * | |
| 8595 | + * @param {Function|Object} actionCreators An object whose values are action | |
| 8596 | + * creator functions. One handy way to obtain it is to use ES6 `import * as` | |
| 8597 | + * syntax. You may also pass a single function. | |
| 8598 | + * | |
| 8599 | + * @param {Function} dispatch The `dispatch` function available on your Redux | |
| 8600 | + * store. | |
| 8601 | + * | |
| 8602 | + * @returns {Function|Object} The object mimicking the original object, but with | |
| 8603 | + * every action creator wrapped into the `dispatch` call. If you passed a | |
| 8604 | + * function as `actionCreators`, the return value will also be a single | |
| 8605 | + * function. | |
| 8606 | + */ | |
| 8607 | + | |
| 8608 | + | |
| 8609 | +function bindActionCreators(actionCreators, dispatch) { | |
| 8610 | + if (typeof actionCreators === 'function') { | |
| 8611 | + return bindActionCreator(actionCreators, dispatch); | |
| 8612 | + } | |
| 8613 | + | |
| 8614 | + if (typeof actionCreators !== 'object' || actionCreators === null) { | |
| 8615 | + 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\"?"); | |
| 8616 | + } | |
| 8617 | + | |
| 8618 | + var boundActionCreators = {}; | |
| 8619 | + | |
| 8620 | + for (var key in actionCreators) { | |
| 8621 | + var actionCreator = actionCreators[key]; | |
| 8622 | + | |
| 8623 | + if (typeof actionCreator === 'function') { | |
| 8624 | + boundActionCreators[key] = bindActionCreator(actionCreator, dispatch); | |
| 8625 | + } | |
| 8626 | + } | |
| 8627 | + | |
| 8628 | + return boundActionCreators; | |
| 8629 | +} | |
| 8630 | + | |
| 8631 | +/** | |
| 8632 | + * Composes single-argument functions from right to left. The rightmost | |
| 8633 | + * function can take multiple arguments as it provides the signature for | |
| 8634 | + * the resulting composite function. | |
| 8635 | + * | |
| 8636 | + * @param {...Function} funcs The functions to compose. | |
| 8637 | + * @returns {Function} A function obtained by composing the argument functions | |
| 8638 | + * from right to left. For example, compose(f, g, h) is identical to doing | |
| 8639 | + * (...args) => f(g(h(...args))). | |
| 8640 | + */ | |
| 8641 | +function compose() { | |
| 8642 | + for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) { | |
| 8643 | + funcs[_key] = arguments[_key]; | |
| 8644 | + } | |
| 8645 | + | |
| 8646 | + if (funcs.length === 0) { | |
| 8647 | + return function (arg) { | |
| 8648 | + return arg; | |
| 8649 | + }; | |
| 8650 | + } | |
| 8651 | + | |
| 8652 | + if (funcs.length === 1) { | |
| 8653 | + return funcs[0]; | |
| 8654 | + } | |
| 8655 | + | |
| 8656 | + return funcs.reduce(function (a, b) { | |
| 8657 | + return function () { | |
| 8658 | + return a(b.apply(void 0, arguments)); | |
| 8659 | + }; | |
| 8660 | + }); | |
| 8661 | +} | |
| 8662 | + | |
| 8663 | +/** | |
| 8664 | + * Creates a store enhancer that applies middleware to the dispatch method | |
| 8665 | + * of the Redux store. This is handy for a variety of tasks, such as expressing | |
| 8666 | + * asynchronous actions in a concise manner, or logging every action payload. | |
| 8667 | + * | |
| 8668 | + * See `redux-thunk` package as an example of the Redux middleware. | |
| 8669 | + * | |
| 8670 | + * Because middleware is potentially asynchronous, this should be the first | |
| 8671 | + * store enhancer in the composition chain. | |
| 8672 | + * | |
| 8673 | + * Note that each middleware will be given the `dispatch` and `getState` functions | |
| 8674 | + * as named arguments. | |
| 8675 | + * | |
| 8676 | + * @param {...Function} middlewares The middleware chain to be applied. | |
| 8677 | + * @returns {Function} A store enhancer applying the middleware. | |
| 8678 | + */ | |
| 8679 | + | |
| 8680 | +function applyMiddleware() { | |
| 8681 | + for (var _len = arguments.length, middlewares = new Array(_len), _key = 0; _key < _len; _key++) { | |
| 8682 | + middlewares[_key] = arguments[_key]; | |
| 8683 | + } | |
| 8684 | + | |
| 8685 | + return function (createStore) { | |
| 8686 | + return function () { | |
| 8687 | + var store = createStore.apply(void 0, arguments); | |
| 8688 | + | |
| 8689 | + var _dispatch = function dispatch() { | |
| 8690 | + throw new Error( false ? 0 : 'Dispatching while constructing your middleware is not allowed. ' + 'Other middleware would not be applied to this dispatch.'); | |
| 8691 | + }; | |
| 8692 | + | |
| 8693 | + var middlewareAPI = { | |
| 8694 | + getState: store.getState, | |
| 8695 | + dispatch: function dispatch() { | |
| 8696 | + return _dispatch.apply(void 0, arguments); | |
| 8697 | + } | |
| 8698 | + }; | |
| 8699 | + var chain = middlewares.map(function (middleware) { | |
| 8700 | + return middleware(middlewareAPI); | |
| 8701 | + }); | |
| 8702 | + _dispatch = compose.apply(void 0, chain)(store.dispatch); | |
| 8703 | + return (0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_0__["default"])((0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_0__["default"])({}, store), {}, { | |
| 8704 | + dispatch: _dispatch | |
| 8705 | + }); | |
| 8706 | + }; | |
| 8707 | + }; | |
| 8708 | +} | |
| 8709 | + | |
| 8710 | + | |
| 8711 | + | |
| 8712 | + | |
| 8713 | +/***/ }), | |
| 8714 | + | |
| 8715 | +/***/ "../node_modules/reselect/es/defaultMemoize.js": | |
| 8716 | +/*!*****************************************************!*\ | |
| 8717 | + !*** ../node_modules/reselect/es/defaultMemoize.js ***! | |
| 8718 | + \*****************************************************/ | |
| 8719 | +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { | |
| 8720 | + | |
| 8721 | +"use strict"; | |
| 8722 | +__webpack_require__.r(__webpack_exports__); | |
| 8723 | +/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 8724 | +/* harmony export */ createCacheKeyComparator: () => (/* binding */ createCacheKeyComparator), | |
| 8725 | +/* harmony export */ defaultEqualityCheck: () => (/* binding */ defaultEqualityCheck), | |
| 8726 | +/* harmony export */ defaultMemoize: () => (/* binding */ defaultMemoize) | |
| 8727 | +/* harmony export */ }); | |
| 8728 | +// Cache implementation based on Erik Rasmussen's `lru-memoize`: | |
| 8729 | +// https://github.com/erikras/lru-memoize | |
| 8730 | +var NOT_FOUND = 'NOT_FOUND'; | |
| 8731 | + | |
| 8732 | +function createSingletonCache(equals) { | |
| 8733 | + var entry; | |
| 8734 | + return { | |
| 8735 | + get: function get(key) { | |
| 8736 | + if (entry && equals(entry.key, key)) { | |
| 8737 | + return entry.value; | |
| 8738 | + } | |
| 8739 | + | |
| 8740 | + return NOT_FOUND; | |
| 8741 | + }, | |
| 8742 | + put: function put(key, value) { | |
| 8743 | + entry = { | |
| 8744 | + key: key, | |
| 8745 | + value: value | |
| 8746 | + }; | |
| 8747 | + }, | |
| 8748 | + getEntries: function getEntries() { | |
| 8749 | + return entry ? [entry] : []; | |
| 8750 | + }, | |
| 8751 | + clear: function clear() { | |
| 8752 | + entry = undefined; | |
| 8753 | + } | |
| 8754 | + }; | |
| 8755 | +} | |
| 8756 | + | |
| 8757 | +function createLruCache(maxSize, equals) { | |
| 8758 | + var entries = []; | |
| 8759 | + | |
| 8760 | + function get(key) { | |
| 8761 | + var cacheIndex = entries.findIndex(function (entry) { | |
| 8762 | + return equals(key, entry.key); | |
| 8763 | + }); // We found a cached entry | |
| 8764 | + | |
| 8765 | + if (cacheIndex > -1) { | |
| 8766 | + var entry = entries[cacheIndex]; // Cached entry not at top of cache, move it to the top | |
| 8767 | + | |
| 8768 | + if (cacheIndex > 0) { | |
| 8769 | + entries.splice(cacheIndex, 1); | |
| 8770 | + entries.unshift(entry); | |
| 8771 | + } | |
| 8772 | + | |
| 8773 | + return entry.value; | |
| 8774 | + } // No entry found in cache, return sentinel | |
| 8775 | + | |
| 8776 | + | |
| 8777 | + return NOT_FOUND; | |
| 8778 | + } | |
| 8779 | + | |
| 8780 | + function put(key, value) { | |
| 8781 | + if (get(key) === NOT_FOUND) { | |
| 8782 | + // TODO Is unshift slow? | |
| 8783 | + entries.unshift({ | |
| 8784 | + key: key, | |
| 8785 | + value: value | |
| 8786 | + }); | |
| 8787 | + | |
| 8788 | + if (entries.length > maxSize) { | |
| 8789 | + entries.pop(); | |
| 8790 | + } | |
| 8791 | + } | |
| 8792 | + } | |
| 8793 | + | |
| 8794 | + function getEntries() { | |
| 8795 | + return entries; | |
| 8796 | + } | |
| 8797 | + | |
| 8798 | + function clear() { | |
| 8799 | + entries = []; | |
| 8800 | + } | |
| 8801 | + | |
| 8802 | + return { | |
| 8803 | + get: get, | |
| 8804 | + put: put, | |
| 8805 | + getEntries: getEntries, | |
| 8806 | + clear: clear | |
| 8807 | + }; | |
| 8808 | +} | |
| 8809 | + | |
| 8810 | +var defaultEqualityCheck = function defaultEqualityCheck(a, b) { | |
| 8811 | + return a === b; | |
| 8812 | +}; | |
| 8813 | +function createCacheKeyComparator(equalityCheck) { | |
| 8814 | + return function areArgumentsShallowlyEqual(prev, next) { | |
| 8815 | + if (prev === null || next === null || prev.length !== next.length) { | |
| 8816 | + return false; | |
| 8817 | + } // Do this in a for loop (and not a `forEach` or an `every`) so we can determine equality as fast as possible. | |
| 8818 | + | |
| 8819 | + | |
| 8820 | + var length = prev.length; | |
| 8821 | + | |
| 8822 | + for (var i = 0; i < length; i++) { | |
| 8823 | + if (!equalityCheck(prev[i], next[i])) { | |
| 8824 | + return false; | |
| 8825 | + } | |
| 8826 | + } | |
| 8827 | + | |
| 8828 | + return true; | |
| 8829 | + }; | |
| 8830 | +} | |
| 8831 | +// defaultMemoize now supports a configurable cache size with LRU behavior, | |
| 8832 | +// and optional comparison of the result value with existing values | |
| 8833 | +function defaultMemoize(func, equalityCheckOrOptions) { | |
| 8834 | + var providedOptions = typeof equalityCheckOrOptions === 'object' ? equalityCheckOrOptions : { | |
| 8835 | + equalityCheck: equalityCheckOrOptions | |
| 8836 | + }; | |
| 8837 | + var _providedOptions$equa = providedOptions.equalityCheck, | |
| 8838 | + equalityCheck = _providedOptions$equa === void 0 ? defaultEqualityCheck : _providedOptions$equa, | |
| 8839 | + _providedOptions$maxS = providedOptions.maxSize, | |
| 8840 | + maxSize = _providedOptions$maxS === void 0 ? 1 : _providedOptions$maxS, | |
| 8841 | + resultEqualityCheck = providedOptions.resultEqualityCheck; | |
| 8842 | + var comparator = createCacheKeyComparator(equalityCheck); | |
| 8843 | + var cache = maxSize === 1 ? createSingletonCache(comparator) : createLruCache(maxSize, comparator); // we reference arguments instead of spreading them for performance reasons | |
| 8844 | + | |
| 8845 | + function memoized() { | |
| 8846 | + var value = cache.get(arguments); | |
| 8847 | + | |
| 8848 | + if (value === NOT_FOUND) { | |
| 8849 | + // @ts-ignore | |
| 8850 | + value = func.apply(null, arguments); | |
| 8851 | + | |
| 8852 | + if (resultEqualityCheck) { | |
| 8853 | + var entries = cache.getEntries(); | |
| 8854 | + var matchingEntry = entries.find(function (entry) { | |
| 8855 | + return resultEqualityCheck(entry.value, value); | |
| 8856 | + }); | |
| 8857 | + | |
| 8858 | + if (matchingEntry) { | |
| 8859 | + value = matchingEntry.value; | |
| 8860 | + } | |
| 8861 | + } | |
| 8862 | + | |
| 8863 | + cache.put(arguments, value); | |
| 8864 | + } | |
| 8865 | + | |
| 8866 | + return value; | |
| 8867 | + } | |
| 8868 | + | |
| 8869 | + memoized.clearCache = function () { | |
| 8870 | + return cache.clear(); | |
| 8871 | + }; | |
| 8872 | + | |
| 8873 | + return memoized; | |
| 8874 | +} | |
| 8875 | + | |
| 8876 | +/***/ }), | |
| 8877 | + | |
| 8878 | +/***/ "../node_modules/reselect/es/index.js": | |
| 8879 | +/*!********************************************!*\ | |
| 8880 | + !*** ../node_modules/reselect/es/index.js ***! | |
| 8881 | + \********************************************/ | |
| 8882 | +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { | |
| 8883 | + | |
| 8884 | +"use strict"; | |
| 8885 | +__webpack_require__.r(__webpack_exports__); | |
| 8886 | +/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 8887 | +/* harmony export */ createSelector: () => (/* binding */ createSelector), | |
| 8888 | +/* harmony export */ createSelectorCreator: () => (/* binding */ createSelectorCreator), | |
| 8889 | +/* harmony export */ createStructuredSelector: () => (/* binding */ createStructuredSelector), | |
| 8890 | +/* harmony export */ defaultEqualityCheck: () => (/* reexport safe */ _defaultMemoize__WEBPACK_IMPORTED_MODULE_0__.defaultEqualityCheck), | |
| 8891 | +/* harmony export */ defaultMemoize: () => (/* reexport safe */ _defaultMemoize__WEBPACK_IMPORTED_MODULE_0__.defaultMemoize) | |
| 8892 | +/* harmony export */ }); | |
| 8893 | +/* harmony import */ var _defaultMemoize__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defaultMemoize */ "../node_modules/reselect/es/defaultMemoize.js"); | |
| 8894 | + | |
| 8895 | + | |
| 8896 | + | |
| 8897 | +function getDependencies(funcs) { | |
| 8898 | + var dependencies = Array.isArray(funcs[0]) ? funcs[0] : funcs; | |
| 8899 | + | |
| 8900 | + if (!dependencies.every(function (dep) { | |
| 8901 | + return typeof dep === 'function'; | |
| 8902 | + })) { | |
| 8903 | + var dependencyTypes = dependencies.map(function (dep) { | |
| 8904 | + return typeof dep === 'function' ? "function " + (dep.name || 'unnamed') + "()" : typeof dep; | |
| 8905 | + }).join(', '); | |
| 8906 | + throw new Error("createSelector expects all input-selectors to be functions, but received the following types: [" + dependencyTypes + "]"); | |
| 8907 | + } | |
| 8908 | + | |
| 8909 | + return dependencies; | |
| 8910 | +} | |
| 8911 | + | |
| 8912 | +function createSelectorCreator(memoize) { | |
| 8913 | + for (var _len = arguments.length, memoizeOptionsFromArgs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { | |
| 8914 | + memoizeOptionsFromArgs[_key - 1] = arguments[_key]; | |
| 8915 | + } | |
| 8916 | + | |
| 8917 | + var createSelector = function createSelector() { | |
| 8918 | + for (var _len2 = arguments.length, funcs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { | |
| 8919 | + funcs[_key2] = arguments[_key2]; | |
| 8920 | + } | |
| 8921 | + | |
| 8922 | + var _recomputations = 0; | |
| 8923 | + | |
| 8924 | + var _lastResult; // Due to the intricacies of rest params, we can't do an optional arg after `...funcs`. | |
| 8925 | + // So, start by declaring the default value here. | |
| 8926 | + // (And yes, the words 'memoize' and 'options' appear too many times in this next sequence.) | |
| 8927 | + | |
| 8928 | + | |
| 8929 | + var directlyPassedOptions = { | |
| 8930 | + memoizeOptions: undefined | |
| 8931 | + }; // Normally, the result func or "output selector" is the last arg | |
| 8932 | + | |
| 8933 | + var resultFunc = funcs.pop(); // If the result func is actually an _object_, assume it's our options object | |
| 8934 | + | |
| 8935 | + if (typeof resultFunc === 'object') { | |
| 8936 | + directlyPassedOptions = resultFunc; // and pop the real result func off | |
| 8937 | + | |
| 8938 | + resultFunc = funcs.pop(); | |
| 8939 | + } | |
| 8940 | + | |
| 8941 | + if (typeof resultFunc !== 'function') { | |
| 8942 | + throw new Error("createSelector expects an output function after the inputs, but received: [" + typeof resultFunc + "]"); | |
| 8943 | + } // Determine which set of options we're using. Prefer options passed directly, | |
| 8944 | + // but fall back to options given to createSelectorCreator. | |
| 8945 | + | |
| 8946 | + | |
| 8947 | + var _directlyPassedOption = directlyPassedOptions, | |
| 8948 | + _directlyPassedOption2 = _directlyPassedOption.memoizeOptions, | |
| 8949 | + memoizeOptions = _directlyPassedOption2 === void 0 ? memoizeOptionsFromArgs : _directlyPassedOption2; // Simplifying assumption: it's unlikely that the first options arg of the provided memoizer | |
| 8950 | + // is an array. In most libs I've looked at, it's an equality function or options object. | |
| 8951 | + // Based on that, if `memoizeOptions` _is_ an array, we assume it's a full | |
| 8952 | + // user-provided array of options. Otherwise, it must be just the _first_ arg, and so | |
| 8953 | + // we wrap it in an array so we can apply it. | |
| 8954 | + | |
| 8955 | + var finalMemoizeOptions = Array.isArray(memoizeOptions) ? memoizeOptions : [memoizeOptions]; | |
| 8956 | + var dependencies = getDependencies(funcs); | |
| 8957 | + var memoizedResultFunc = memoize.apply(void 0, [function recomputationWrapper() { | |
| 8958 | + _recomputations++; // apply arguments instead of spreading for performance. | |
| 8959 | + | |
| 8960 | + return resultFunc.apply(null, arguments); | |
| 8961 | + }].concat(finalMemoizeOptions)); // If a selector is called with the exact same arguments we don't need to traverse our dependencies again. | |
| 8962 | + | |
| 8963 | + var selector = memoize(function dependenciesChecker() { | |
| 8964 | + var params = []; | |
| 8965 | + var length = dependencies.length; | |
| 8966 | + | |
| 8967 | + for (var i = 0; i < length; i++) { | |
| 8968 | + // apply arguments instead of spreading and mutate a local list of params for performance. | |
| 8969 | + // @ts-ignore | |
| 8970 | + params.push(dependencies[i].apply(null, arguments)); | |
| 8971 | + } // apply arguments instead of spreading for performance. | |
| 8972 | + | |
| 8973 | + | |
| 8974 | + _lastResult = memoizedResultFunc.apply(null, params); | |
| 8975 | + return _lastResult; | |
| 8976 | + }); | |
| 8977 | + Object.assign(selector, { | |
| 8978 | + resultFunc: resultFunc, | |
| 8979 | + memoizedResultFunc: memoizedResultFunc, | |
| 8980 | + dependencies: dependencies, | |
| 8981 | + lastResult: function lastResult() { | |
| 8982 | + return _lastResult; | |
| 8983 | + }, | |
| 8984 | + recomputations: function recomputations() { | |
| 8985 | + return _recomputations; | |
| 8986 | + }, | |
| 8987 | + resetRecomputations: function resetRecomputations() { | |
| 8988 | + return _recomputations = 0; | |
| 8989 | + } | |
| 8990 | + }); | |
| 8991 | + return selector; | |
| 8992 | + }; // @ts-ignore | |
| 8993 | + | |
| 8994 | + | |
| 8995 | + return createSelector; | |
| 8996 | +} | |
| 8997 | +var createSelector = /* #__PURE__ */createSelectorCreator(_defaultMemoize__WEBPACK_IMPORTED_MODULE_0__.defaultMemoize); | |
| 8998 | +// Manual definition of state and output arguments | |
| 8999 | +var createStructuredSelector = function createStructuredSelector(selectors, selectorCreator) { | |
| 9000 | + if (selectorCreator === void 0) { | |
| 9001 | + selectorCreator = createSelector; | |
| 9002 | + } | |
| 9003 | + | |
| 9004 | + if (typeof selectors !== 'object') { | |
| 9005 | + throw new Error('createStructuredSelector expects first argument to be an object ' + ("where each property is a selector, instead received a " + typeof selectors)); | |
| 9006 | + } | |
| 9007 | + | |
| 9008 | + var objectKeys = Object.keys(selectors); | |
| 9009 | + var resultSelector = selectorCreator( // @ts-ignore | |
| 9010 | + objectKeys.map(function (key) { | |
| 9011 | + return selectors[key]; | |
| 9012 | + }), function () { | |
| 9013 | + for (var _len3 = arguments.length, values = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { | |
| 9014 | + values[_key3] = arguments[_key3]; | |
| 9015 | + } | |
| 9016 | + | |
| 9017 | + return values.reduce(function (composition, value, index) { | |
| 9018 | + composition[objectKeys[index]] = value; | |
| 9019 | + return composition; | |
| 9020 | + }, {}); | |
| 9021 | + }); | |
| 9022 | + return resultSelector; | |
| 9023 | +}; | |
| 9024 | + | |
| 3406 | 9025 | /***/ }) |
| 3407 | 9026 | |
| 3408 | 9027 | /******/ }); |
| 3409 | 9028 | /************************************************************************/ |
| @@ -3429,8 +9048,49 @@ | ||
| 3429 | 9048 | /******/ |
| 3430 | 9049 | /******/ // Return the exports of the module |
| 3431 | 9050 | /******/ return module.exports; |
| 3432 | 9051 | /******/ } |
| 9052 | +/******/ | |
| 9053 | +/************************************************************************/ | |
| 9054 | +/******/ /* webpack/runtime/define property getters */ | |
| 9055 | +/******/ (() => { | |
| 9056 | +/******/ // define getter functions for harmony exports | |
| 9057 | +/******/ __webpack_require__.d = (exports, definition) => { | |
| 9058 | +/******/ for(var key in definition) { | |
| 9059 | +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { | |
| 9060 | +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); | |
| 9061 | +/******/ } | |
| 9062 | +/******/ } | |
| 9063 | +/******/ }; | |
| 9064 | +/******/ })(); | |
| 9065 | +/******/ | |
| 9066 | +/******/ /* webpack/runtime/global */ | |
| 9067 | +/******/ (() => { | |
| 9068 | +/******/ __webpack_require__.g = (function() { | |
| 9069 | +/******/ if (typeof globalThis === 'object') return globalThis; | |
| 9070 | +/******/ try { | |
| 9071 | +/******/ return this || new Function('return this')(); | |
| 9072 | +/******/ } catch (e) { | |
| 9073 | +/******/ if (typeof window === 'object') return window; | |
| 9074 | +/******/ } | |
| 9075 | +/******/ })(); | |
| 9076 | +/******/ })(); | |
| 9077 | +/******/ | |
| 9078 | +/******/ /* webpack/runtime/hasOwnProperty shorthand */ | |
| 9079 | +/******/ (() => { | |
| 9080 | +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) | |
| 9081 | +/******/ })(); | |
| 9082 | +/******/ | |
| 9083 | +/******/ /* webpack/runtime/make namespace object */ | |
| 9084 | +/******/ (() => { | |
| 9085 | +/******/ // define __esModule on exports | |
| 9086 | +/******/ __webpack_require__.r = (exports) => { | |
| 9087 | +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { | |
| 9088 | +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | |
| 9089 | +/******/ } | |
| 9090 | +/******/ Object.defineProperty(exports, '__esModule', { value: true }); | |
| 9091 | +/******/ }; | |
| 9092 | +/******/ })(); | |
| 3433 | 9093 | /******/ |
| 3434 | 9094 | /************************************************************************/ |
| 3435 | 9095 | var __webpack_exports__ = {}; |
| 3436 | 9096 | // This entry needs to be wrapped in an IIFE because it needs to be in strict mode. |