| @@ -1,6 +1,963 @@ | ||
| 1 | 1 | (self["webpackChunkelementorFrontend"] = self["webpackChunkelementorFrontend"] || []).push([["frontend-modules"],{ |
| 2 | 2 | |
| 3 | +/***/ "../app/assets/js/event-track/apps-event-tracking.js": | |
| 4 | +/*!***********************************************************!*\ | |
| 5 | + !*** ../app/assets/js/event-track/apps-event-tracking.js ***! | |
| 6 | + \***********************************************************/ | |
| 7 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 8 | + | |
| 9 | +"use strict"; | |
| 10 | + | |
| 11 | + | |
| 12 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 13 | +Object.defineProperty(exports, "__esModule", ({ | |
| 14 | + value: true | |
| 15 | +})); | |
| 16 | +exports.appsEventTrackingDispatch = exports.AppsEventTracking = void 0; | |
| 17 | +var _eventsConfig = _interopRequireDefault(__webpack_require__(/*! ../../../../core/common/modules/events-manager/assets/js/events-config */ "../core/common/modules/events-manager/assets/js/events-config.js")); | |
| 18 | +const EVENTS_MAP = { | |
| 19 | + PAGE_VIEWS_WEBSITE_TEMPLATES: 'page_views_website_templates', | |
| 20 | + KITS_CLOUD_UPGRADE_CLICKED: 'kits_cloud_upgrade_clicked', | |
| 21 | + EXPORT_KIT_CUSTOMIZATION: 'export_kit_customization', | |
| 22 | + IMPORT_KIT_CUSTOMIZATION: 'import_kit_customization', | |
| 23 | + KIT_IMPORT_STATUS: 'kit_import_status', | |
| 24 | + KIT_CLOUD_LIBRARY_APPLY: 'kit_cloud_library_apply', | |
| 25 | + KIT_CLOUD_LIBRARY_DELETE: 'kit_cloud_library_delete', | |
| 26 | + IMPORT_EXPORT_ADMIN_ACTION: 'ie_admin_action', | |
| 27 | + KIT_IMPORT_UPLOAD_FILE: 'kit_import_upload_file' | |
| 28 | +}; | |
| 29 | +const appsEventTrackingDispatch = (command, eventParams) => { | |
| 30 | + // Add existing eventParams key value pair to the data/details object. | |
| 31 | + const objectCreator = (array, obj) => { | |
| 32 | + for (const key of array) { | |
| 33 | + if (eventParams.hasOwnProperty(key) && eventParams[key] !== null) { | |
| 34 | + obj[key] = eventParams[key]; | |
| 35 | + } | |
| 36 | + } | |
| 37 | + return obj; | |
| 38 | + }; | |
| 39 | + const dataKeys = []; | |
| 40 | + const 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']; | |
| 41 | + const data = {}; | |
| 42 | + const details = {}; | |
| 43 | + const init = () => { | |
| 44 | + objectCreator(detailsKeys, details); | |
| 45 | + objectCreator(dataKeys, data); | |
| 46 | + const commandSplit = command.split('/'); | |
| 47 | + data.placement = commandSplit[0]; | |
| 48 | + data.event = commandSplit[1]; | |
| 49 | + | |
| 50 | + // If 'details' is not empty, add the details object to the data object. | |
| 51 | + if (Object.keys(details).length) { | |
| 52 | + data.details = details; | |
| 53 | + } | |
| 54 | + }; | |
| 55 | + init(); | |
| 56 | + $e.run(command, data); | |
| 57 | +}; | |
| 58 | +exports.appsEventTrackingDispatch = appsEventTrackingDispatch; | |
| 59 | +class AppsEventTracking { | |
| 60 | + static dispatchEvent(eventName, payload) { | |
| 61 | + return elementorCommon.eventsManager.dispatchEvent(eventName, payload); | |
| 62 | + } | |
| 63 | + static sendPageViewsWebsiteTemplates(page) { | |
| 64 | + return this.dispatchEvent(EVENTS_MAP.PAGE_VIEWS_WEBSITE_TEMPLATES, { | |
| 65 | + trigger: _eventsConfig.default.triggers.pageLoaded, | |
| 66 | + page_loaded: page, | |
| 67 | + secondary_location: page | |
| 68 | + }); | |
| 69 | + } | |
| 70 | + static sendKitsCloudUpgradeClicked(upgradeLocation) { | |
| 71 | + return this.dispatchEvent(EVENTS_MAP.KITS_CLOUD_UPGRADE_CLICKED, { | |
| 72 | + trigger: _eventsConfig.default.triggers.click, | |
| 73 | + secondary_location: upgradeLocation, | |
| 74 | + upgrade_location: upgradeLocation | |
| 75 | + }); | |
| 76 | + } | |
| 77 | + static sendExportKitCustomization(payload) { | |
| 78 | + return this.dispatchEvent(EVENTS_MAP.EXPORT_KIT_CUSTOMIZATION, { | |
| 79 | + trigger: _eventsConfig.default.triggers.click, | |
| 80 | + ...payload | |
| 81 | + }); | |
| 82 | + } | |
| 83 | + static sendImportKitCustomization(payload) { | |
| 84 | + return this.dispatchEvent(EVENTS_MAP.IMPORT_KIT_CUSTOMIZATION, { | |
| 85 | + trigger: _eventsConfig.default.triggers.click, | |
| 86 | + ...payload | |
| 87 | + }); | |
| 88 | + } | |
| 89 | + static sendKitImportStatus(error = null) { | |
| 90 | + return this.dispatchEvent(EVENTS_MAP.KIT_IMPORT_STATUS, { | |
| 91 | + kit_import_status: !error, | |
| 92 | + ...(error && { | |
| 93 | + kit_import_error: error.message | |
| 94 | + }) | |
| 95 | + }); | |
| 96 | + } | |
| 97 | + static sendKitCloudLibraryApply(kitId, kitApplyUrl) { | |
| 98 | + return this.dispatchEvent(EVENTS_MAP.KIT_CLOUD_LIBRARY_APPLY, { | |
| 99 | + trigger: _eventsConfig.default.triggers.click, | |
| 100 | + kit_cloud_id: kitId, | |
| 101 | + ...(kitApplyUrl && { | |
| 102 | + kit_apply_url: kitApplyUrl | |
| 103 | + }) | |
| 104 | + }); | |
| 105 | + } | |
| 106 | + static sendKitCloudLibraryDelete() { | |
| 107 | + return this.dispatchEvent(EVENTS_MAP.KIT_CLOUD_LIBRARY_DELETE, { | |
| 108 | + trigger: _eventsConfig.default.triggers.click | |
| 109 | + }); | |
| 110 | + } | |
| 111 | + static sendImportExportAdminAction(actionType) { | |
| 112 | + return this.dispatchEvent(EVENTS_MAP.IMPORT_EXPORT_ADMIN_ACTION, { | |
| 113 | + trigger: _eventsConfig.default.triggers.click, | |
| 114 | + action_type: actionType | |
| 115 | + }); | |
| 116 | + } | |
| 117 | + static sendKitImportUploadFile(status) { | |
| 118 | + return this.dispatchEvent(EVENTS_MAP.KIT_IMPORT_UPLOAD_FILE, { | |
| 119 | + kit_import_upload_file_status: status | |
| 120 | + }); | |
| 121 | + } | |
| 122 | +} | |
| 123 | +exports.AppsEventTracking = AppsEventTracking; | |
| 124 | + | |
| 125 | +/***/ }), | |
| 126 | + | |
| 127 | +/***/ "../app/assets/js/event-track/dashboard/action-control.js": | |
| 128 | +/*!****************************************************************!*\ | |
| 129 | + !*** ../app/assets/js/event-track/dashboard/action-control.js ***! | |
| 130 | + \****************************************************************/ | |
| 131 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 132 | + | |
| 133 | +"use strict"; | |
| 134 | + | |
| 135 | + | |
| 136 | +Object.defineProperty(exports, "__esModule", ({ | |
| 137 | + value: true | |
| 138 | +})); | |
| 139 | +exports["default"] = void 0; | |
| 140 | +__webpack_require__(/*! core-js/modules/esnext.iterator.constructor.js */ "../node_modules/core-js/modules/esnext.iterator.constructor.js"); | |
| 141 | +__webpack_require__(/*! core-js/modules/esnext.iterator.filter.js */ "../node_modules/core-js/modules/esnext.iterator.filter.js"); | |
| 142 | +var _wpDashboardTracking = _interopRequireWildcard(__webpack_require__(/*! ../wp-dashboard-tracking */ "../app/assets/js/event-track/wp-dashboard-tracking.js")); | |
| 143 | +var _utils = __webpack_require__(/*! ./utils */ "../app/assets/js/event-track/dashboard/utils.js"); | |
| 144 | +function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (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 (const 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); } | |
| 145 | +const EXCLUDED_SELECTORS = { | |
| 146 | + ADMIN_MENU: '#adminmenu', | |
| 147 | + TOP_BAR: '.e-admin-top-bar', | |
| 148 | + WP_ADMIN_BAR: '#wpadminbar', | |
| 149 | + SUBMENU: '.wp-submenu' | |
| 150 | +}; | |
| 151 | +class ActionControlTracking { | |
| 152 | + static init() { | |
| 153 | + if (!_utils.DashboardUtils.isElementorPage()) { | |
| 154 | + return; | |
| 155 | + } | |
| 156 | + this.attachDelegatedHandlers(); | |
| 157 | + } | |
| 158 | + static isExcludedElement(element) { | |
| 159 | + for (const selector of Object.values(EXCLUDED_SELECTORS)) { | |
| 160 | + if (element.closest(selector)) { | |
| 161 | + return true; | |
| 162 | + } | |
| 163 | + } | |
| 164 | + return false; | |
| 165 | + } | |
| 166 | + static attachDelegatedHandlers() { | |
| 167 | + document.addEventListener('click', event => { | |
| 168 | + const base = event.target && 1 === event.target.nodeType ? event.target : event.target?.parentElement; | |
| 169 | + if (!base) { | |
| 170 | + return; | |
| 171 | + } | |
| 172 | + const button = base.closest('button, input[type="submit"], input[type="button"], .button, .e-btn'); | |
| 173 | + if (button && !this.isExcludedElement(button)) { | |
| 174 | + this.trackControl(button, _wpDashboardTracking.CONTROL_TYPES.BUTTON); | |
| 175 | + return; | |
| 176 | + } | |
| 177 | + const link = base.closest('a'); | |
| 178 | + if (link && !this.isExcludedElement(link) && !this.isNavigationLink(link)) { | |
| 179 | + this.trackControl(link, _wpDashboardTracking.CONTROL_TYPES.LINK); | |
| 180 | + } | |
| 181 | + }, { | |
| 182 | + capture: false | |
| 183 | + }); | |
| 184 | + document.addEventListener('change', event => { | |
| 185 | + const base = event.target && 1 === event.target.nodeType ? event.target : event.target?.parentElement; | |
| 186 | + if (!base) { | |
| 187 | + return; | |
| 188 | + } | |
| 189 | + const toggle = base.closest('.elementor-control-type-switcher input, [role="switch"], .toggle-control input'); | |
| 190 | + if (toggle && !this.isExcludedElement(toggle)) { | |
| 191 | + this.trackControl(toggle, _wpDashboardTracking.CONTROL_TYPES.TOGGLE); | |
| 192 | + return; | |
| 193 | + } | |
| 194 | + const checkbox = base.closest('input[type="checkbox"]'); | |
| 195 | + if (checkbox && !this.isExcludedElement(checkbox)) { | |
| 196 | + this.trackControl(checkbox, _wpDashboardTracking.CONTROL_TYPES.CHECKBOX); | |
| 197 | + return; | |
| 198 | + } | |
| 199 | + const radio = base.closest('input[type="radio"]'); | |
| 200 | + if (radio && !this.isExcludedElement(radio)) { | |
| 201 | + this.trackControl(radio, _wpDashboardTracking.CONTROL_TYPES.RADIO); | |
| 202 | + return; | |
| 203 | + } | |
| 204 | + const select = base.closest('select'); | |
| 205 | + if (select && !this.isExcludedElement(select)) { | |
| 206 | + this.trackControl(select, _wpDashboardTracking.CONTROL_TYPES.SELECT); | |
| 207 | + } | |
| 208 | + }); | |
| 209 | + } | |
| 210 | + static isNavigationLink(link) { | |
| 211 | + const href = link.getAttribute('href'); | |
| 212 | + if (!href) { | |
| 213 | + return false; | |
| 214 | + } | |
| 215 | + if (href.startsWith('#') && href.includes('tab')) { | |
| 216 | + return true; | |
| 217 | + } | |
| 218 | + if (link.classList.contains('nav-tab')) { | |
| 219 | + return true; | |
| 220 | + } | |
| 221 | + const isInNavigation = link.closest('.wp-submenu, #adminmenu, .e-admin-top-bar, #wpadminbar'); | |
| 222 | + return !!isInNavigation; | |
| 223 | + } | |
| 224 | + static trackControl(element, controlType) { | |
| 225 | + const controlData = this.extractControlData(element, controlType); | |
| 226 | + _wpDashboardTracking.default.trackActionControl(controlData, controlType); | |
| 227 | + } | |
| 228 | + static extractControlData(element, controlType) { | |
| 229 | + const data = {}; | |
| 230 | + const id = element.getAttribute('id'); | |
| 231 | + if (id) { | |
| 232 | + data.id = id; | |
| 233 | + } | |
| 234 | + const name = element.getAttribute('name'); | |
| 235 | + if (name) { | |
| 236 | + data.name = name; | |
| 237 | + } | |
| 238 | + let text = ''; | |
| 239 | + if (_wpDashboardTracking.CONTROL_TYPES.BUTTON === controlType) { | |
| 240 | + text = element.value || element.textContent.trim() || element.getAttribute('aria-label'); | |
| 241 | + } else if (_wpDashboardTracking.CONTROL_TYPES.LINK === controlType) { | |
| 242 | + text = element.textContent.trim() || element.getAttribute('aria-label') || element.getAttribute('title'); | |
| 243 | + } else if (_wpDashboardTracking.CONTROL_TYPES.SELECT === controlType) { | |
| 244 | + const selectedOption = element.options[element.selectedIndex]; | |
| 245 | + text = selectedOption ? selectedOption.textContent.trim() : ''; | |
| 246 | + } else if (_wpDashboardTracking.CONTROL_TYPES.CHECKBOX === controlType || _wpDashboardTracking.CONTROL_TYPES.TOGGLE === controlType || _wpDashboardTracking.CONTROL_TYPES.RADIO === controlType) { | |
| 247 | + const label = element.labels ? element.labels[0] : null; | |
| 248 | + text = label ? label.textContent.trim() : ''; | |
| 249 | + data.checked = element.checked; | |
| 250 | + } | |
| 251 | + if (text) { | |
| 252 | + data.text = text; | |
| 253 | + } | |
| 254 | + const classes = element.className; | |
| 255 | + if (classes && 'string' === typeof classes) { | |
| 256 | + const relevantClasses = classes.split(' ').filter(cls => cls && !cls.startsWith('elementor-control-') && !cls.startsWith('wp-')).slice(0, 3); | |
| 257 | + if (relevantClasses.length > 0) { | |
| 258 | + data.classes = relevantClasses.join(' '); | |
| 259 | + } | |
| 260 | + } | |
| 261 | + if (_wpDashboardTracking.CONTROL_TYPES.LINK === controlType) { | |
| 262 | + const href = element.getAttribute('href'); | |
| 263 | + if (href && !href.startsWith('#')) { | |
| 264 | + data.href = href; | |
| 265 | + } | |
| 266 | + } | |
| 267 | + return data; | |
| 268 | + } | |
| 269 | +} | |
| 270 | +var _default = exports["default"] = ActionControlTracking; | |
| 271 | + | |
| 272 | +/***/ }), | |
| 273 | + | |
| 274 | +/***/ "../app/assets/js/event-track/dashboard/navigation.js": | |
| 275 | +/*!************************************************************!*\ | |
| 276 | + !*** ../app/assets/js/event-track/dashboard/navigation.js ***! | |
| 277 | + \************************************************************/ | |
| 278 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 279 | + | |
| 280 | +"use strict"; | |
| 281 | + | |
| 282 | + | |
| 283 | +Object.defineProperty(exports, "__esModule", ({ | |
| 284 | + value: true | |
| 285 | +})); | |
| 286 | +exports["default"] = void 0; | |
| 287 | +__webpack_require__(/*! core-js/modules/esnext.iterator.constructor.js */ "../node_modules/core-js/modules/esnext.iterator.constructor.js"); | |
| 288 | +__webpack_require__(/*! core-js/modules/esnext.iterator.for-each.js */ "../node_modules/core-js/modules/esnext.iterator.for-each.js"); | |
| 289 | +var _wpDashboardTracking = _interopRequireWildcard(__webpack_require__(/*! ../wp-dashboard-tracking */ "../app/assets/js/event-track/wp-dashboard-tracking.js")); | |
| 290 | +function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (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 (const 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); } | |
| 291 | +const ELEMENTOR_MENU_SELECTORS = { | |
| 292 | + ELEMENTOR_TOP_LEVEL: 'li#toplevel_page_elementor', | |
| 293 | + TEMPLATES_TOP_LEVEL: 'li#menu-posts-elementor_library', | |
| 294 | + ADMIN_MENU: '#adminmenu', | |
| 295 | + TOP_LEVEL_LINK: '.wp-menu-name', | |
| 296 | + SUBMENU_CONTAINER: '.wp-submenu', | |
| 297 | + SUBMENU_ITEM: '.wp-submenu li a', | |
| 298 | + SUBMENU_ITEM_TOP_LEVEL: '.wp-has-submenu' | |
| 299 | +}; | |
| 300 | +class NavigationTracking { | |
| 301 | + static init() { | |
| 302 | + this.attachElementorMenuTracking(); | |
| 303 | + this.attachTemplatesMenuTracking(); | |
| 304 | + } | |
| 305 | + static attachElementorMenuTracking() { | |
| 306 | + const elementorMenu = document.querySelector(ELEMENTOR_MENU_SELECTORS.ELEMENTOR_TOP_LEVEL); | |
| 307 | + if (!elementorMenu) { | |
| 308 | + return; | |
| 309 | + } | |
| 310 | + this.attachMenuTracking(elementorMenu, 'Elementor'); | |
| 311 | + } | |
| 312 | + static attachTemplatesMenuTracking() { | |
| 313 | + const templatesMenu = document.querySelector(ELEMENTOR_MENU_SELECTORS.TEMPLATES_TOP_LEVEL); | |
| 314 | + if (!templatesMenu) { | |
| 315 | + return; | |
| 316 | + } | |
| 317 | + this.attachMenuTracking(templatesMenu, 'Templates'); | |
| 318 | + } | |
| 319 | + static attachMenuTracking(menuElement, menuName) { | |
| 320 | + const topLevelLink = menuElement.querySelector('a.menu-top'); | |
| 321 | + const submenuContainer = menuElement.querySelector(ELEMENTOR_MENU_SELECTORS.SUBMENU_CONTAINER); | |
| 322 | + if (topLevelLink) { | |
| 323 | + topLevelLink.addEventListener('click', event => { | |
| 324 | + this.handleTopLevelClick(event); | |
| 325 | + }); | |
| 326 | + } | |
| 327 | + if (submenuContainer) { | |
| 328 | + const submenuItems = submenuContainer.querySelectorAll('li a'); | |
| 329 | + submenuItems.forEach(submenuItem => { | |
| 330 | + submenuItem.addEventListener('click', event => { | |
| 331 | + this.handleSubmenuClick(event, menuName); | |
| 332 | + }); | |
| 333 | + }); | |
| 334 | + this.observeSubmenuChanges(submenuContainer, menuName); | |
| 335 | + } | |
| 336 | + } | |
| 337 | + static observeSubmenuChanges(submenuContainer, menuName) { | |
| 338 | + const observer = new MutationObserver(mutations => { | |
| 339 | + mutations.forEach(mutation => { | |
| 340 | + if ('childList' === mutation.type) { | |
| 341 | + mutation.addedNodes.forEach(node => { | |
| 342 | + if (1 === node.nodeType && 'LI' === node.tagName) { | |
| 343 | + const link = node.querySelector('a'); | |
| 344 | + if (link) { | |
| 345 | + link.addEventListener('click', event => { | |
| 346 | + this.handleSubmenuClick(event, menuName); | |
| 347 | + }); | |
| 348 | + } | |
| 349 | + } | |
| 350 | + }); | |
| 351 | + } | |
| 352 | + }); | |
| 353 | + }); | |
| 354 | + observer.observe(submenuContainer, { | |
| 355 | + childList: true, | |
| 356 | + subtree: false | |
| 357 | + }); | |
| 358 | + } | |
| 359 | + static handleTopLevelClick(event) { | |
| 360 | + const link = event.currentTarget; | |
| 361 | + const itemId = this.extractItemId(link); | |
| 362 | + const area = this.determineNavArea(link); | |
| 363 | + _wpDashboardTracking.default.trackNavClicked(itemId, null, area); | |
| 364 | + } | |
| 365 | + static handleSubmenuClick(event, menuName) { | |
| 366 | + const link = event.currentTarget; | |
| 367 | + const itemId = this.extractItemId(link); | |
| 368 | + const area = this.determineNavArea(link); | |
| 369 | + _wpDashboardTracking.default.trackNavClicked(itemId, menuName, area); | |
| 370 | + } | |
| 371 | + static extractItemId(link) { | |
| 372 | + const textContent = link.textContent.trim(); | |
| 373 | + if (textContent) { | |
| 374 | + return textContent; | |
| 375 | + } | |
| 376 | + const href = link.getAttribute('href'); | |
| 377 | + if (href) { | |
| 378 | + const urlParams = new URLSearchParams(href.split('?')[1] || ''); | |
| 379 | + const page = urlParams.get('page'); | |
| 380 | + const postType = urlParams.get('post_type'); | |
| 381 | + if (page) { | |
| 382 | + return page; | |
| 383 | + } | |
| 384 | + if (postType) { | |
| 385 | + return postType; | |
| 386 | + } | |
| 387 | + } | |
| 388 | + const id = link.getAttribute('id'); | |
| 389 | + if (id) { | |
| 390 | + return id; | |
| 391 | + } | |
| 392 | + return 'unknown'; | |
| 393 | + } | |
| 394 | + static determineNavArea(link) { | |
| 395 | + const parentMenu = link.closest('li.menu-top'); | |
| 396 | + if (parentMenu) { | |
| 397 | + const isSubmenuItem = link.closest(ELEMENTOR_MENU_SELECTORS.SUBMENU_CONTAINER); | |
| 398 | + if (isSubmenuItem) { | |
| 399 | + const submenuElement = link.closest(ELEMENTOR_MENU_SELECTORS.SUBMENU_ITEM_TOP_LEVEL); | |
| 400 | + if (submenuElement.classList.contains('wp-not-current-submenu')) { | |
| 401 | + return _wpDashboardTracking.NAV_AREAS.HOVER_MENU; | |
| 402 | + } | |
| 403 | + return _wpDashboardTracking.NAV_AREAS.SUBMENU; | |
| 404 | + } | |
| 405 | + return _wpDashboardTracking.NAV_AREAS.LEFT_MENU; | |
| 406 | + } | |
| 407 | + return _wpDashboardTracking.NAV_AREAS.LEFT_MENU; | |
| 408 | + } | |
| 409 | +} | |
| 410 | +var _default = exports["default"] = NavigationTracking; | |
| 411 | + | |
| 412 | +/***/ }), | |
| 413 | + | |
| 414 | +/***/ "../app/assets/js/event-track/dashboard/screen-view.js": | |
| 415 | +/*!*************************************************************!*\ | |
| 416 | + !*** ../app/assets/js/event-track/dashboard/screen-view.js ***! | |
| 417 | + \*************************************************************/ | |
| 418 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 419 | + | |
| 420 | +"use strict"; | |
| 421 | + | |
| 422 | + | |
| 423 | +Object.defineProperty(exports, "__esModule", ({ | |
| 424 | + value: true | |
| 425 | +})); | |
| 426 | +exports["default"] = void 0; | |
| 427 | +__webpack_require__(/*! core-js/modules/esnext.iterator.constructor.js */ "../node_modules/core-js/modules/esnext.iterator.constructor.js"); | |
| 428 | +__webpack_require__(/*! core-js/modules/esnext.iterator.for-each.js */ "../node_modules/core-js/modules/esnext.iterator.for-each.js"); | |
| 429 | +var _wpDashboardTracking = _interopRequireWildcard(__webpack_require__(/*! ../wp-dashboard-tracking */ "../app/assets/js/event-track/wp-dashboard-tracking.js")); | |
| 430 | +var _utils = __webpack_require__(/*! ./utils */ "../app/assets/js/event-track/dashboard/utils.js"); | |
| 431 | +function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (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 (const 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); } | |
| 432 | +const SCREEN_SELECTORS = { | |
| 433 | + NAV_TAB_WRAPPER: '.nav-tab-wrapper', | |
| 434 | + NAV_TAB: '.nav-tab', | |
| 435 | + NAV_TAB_ACTIVE: '.nav-tab-active', | |
| 436 | + SETTINGS_FORM_PAGE: '.elementor-settings-form-page', | |
| 437 | + SETTINGS_FORM_PAGE_ACTIVE: '.elementor-settings-form-page.elementor-active' | |
| 438 | +}; | |
| 439 | +class ScreenViewTracking { | |
| 440 | + static trackedScreens = new Set(); | |
| 441 | + static init() { | |
| 442 | + if (!_utils.DashboardUtils.isElementorPage()) { | |
| 443 | + return; | |
| 444 | + } | |
| 445 | + this.trackInitialPageView(); | |
| 446 | + this.attachTabChangeTracking(); | |
| 447 | + } | |
| 448 | + static trackInitialPageView() { | |
| 449 | + const run = () => { | |
| 450 | + const screenData = this.getScreenData(); | |
| 451 | + if (screenData) { | |
| 452 | + this.trackScreen(screenData.screenId, screenData.screenType); | |
| 453 | + } | |
| 454 | + }; | |
| 455 | + if ('loading' === document.readyState) { | |
| 456 | + document.addEventListener('DOMContentLoaded', run, { | |
| 457 | + once: true | |
| 458 | + }); | |
| 459 | + } else { | |
| 460 | + run(); | |
| 461 | + } | |
| 462 | + } | |
| 463 | + static getScreenData() { | |
| 464 | + const urlParams = new URLSearchParams(window.location.search); | |
| 465 | + const page = urlParams.get('page'); | |
| 466 | + const postType = urlParams.get('post_type'); | |
| 467 | + const hash = window.location.hash; | |
| 468 | + let screenId = ''; | |
| 469 | + let screenType = _wpDashboardTracking.SCREEN_TYPES.APP_SCREEN; | |
| 470 | + if (page) { | |
| 471 | + screenId = page; | |
| 472 | + } else if (postType) { | |
| 473 | + screenId = postType; | |
| 474 | + } else { | |
| 475 | + screenId = this.getScreenIdFromBody(); | |
| 476 | + } | |
| 477 | + const hasNavTabs = document.querySelector(SCREEN_SELECTORS.NAV_TAB_WRAPPER); | |
| 478 | + const hasSettingsTabs = document.querySelectorAll(SCREEN_SELECTORS.SETTINGS_FORM_PAGE).length > 1; | |
| 479 | + if (hasNavTabs || hasSettingsTabs || hash) { | |
| 480 | + screenType = _wpDashboardTracking.SCREEN_TYPES.TAB; | |
| 481 | + if (hash) { | |
| 482 | + const tabId = hash.replace(/^#(tab-)?/, ''); | |
| 483 | + screenId = `${screenId}-${tabId}`; | |
| 484 | + } else if (hasNavTabs) { | |
| 485 | + const activeTab = document.querySelector(SCREEN_SELECTORS.NAV_TAB_ACTIVE); | |
| 486 | + if (activeTab) { | |
| 487 | + const tabText = activeTab.textContent.trim(); | |
| 488 | + const tabHref = activeTab.getAttribute('href'); | |
| 489 | + if (tabText) { | |
| 490 | + screenId = `${screenId}-${this.sanitizeScreenId(tabText)}`; | |
| 491 | + } else if (tabHref && tabHref.includes('#')) { | |
| 492 | + const tabId = tabHref.split('#')[1]; | |
| 493 | + screenId = `${screenId}-${tabId}`; | |
| 494 | + } | |
| 495 | + } | |
| 496 | + } else if (hasSettingsTabs) { | |
| 497 | + const activeSettingsTab = document.querySelector(SCREEN_SELECTORS.SETTINGS_FORM_PAGE_ACTIVE); | |
| 498 | + if (activeSettingsTab) { | |
| 499 | + const tabId = activeSettingsTab.id; | |
| 500 | + if (tabId) { | |
| 501 | + screenId = `${screenId}-${tabId}`; | |
| 502 | + } | |
| 503 | + } | |
| 504 | + } | |
| 505 | + } | |
| 506 | + return { | |
| 507 | + screenId, | |
| 508 | + screenType | |
| 509 | + }; | |
| 510 | + } | |
| 511 | + static getScreenIdFromBody() { | |
| 512 | + const body = document.body; | |
| 513 | + const bodyClasses = body.className.split(' '); | |
| 514 | + for (const cls of bodyClasses) { | |
| 515 | + if (cls.startsWith('elementor') && (cls.includes('page') || cls.includes('post-type'))) { | |
| 516 | + return cls; | |
| 517 | + } | |
| 518 | + } | |
| 519 | + return 'elementor-unknown'; | |
| 520 | + } | |
| 521 | + static sanitizeScreenId(text) { | |
| 522 | + return text.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, ''); | |
| 523 | + } | |
| 524 | + static attachTabChangeTracking() { | |
| 525 | + this.attachNavTabTracking(); | |
| 526 | + this.attachHashChangeTracking(); | |
| 527 | + this.attachSettingsTabTracking(); | |
| 528 | + } | |
| 529 | + static attachNavTabTracking() { | |
| 530 | + const wrapper = document.querySelector(SCREEN_SELECTORS.NAV_TAB_WRAPPER); | |
| 531 | + if (!wrapper) { | |
| 532 | + return; | |
| 533 | + } | |
| 534 | + const observer = new MutationObserver(mutations => { | |
| 535 | + for (const mutation of mutations) { | |
| 536 | + if ('childList' === mutation.type) { | |
| 537 | + const screenData = this.getScreenData(); | |
| 538 | + if (screenData) { | |
| 539 | + this.trackScreen(screenData.screenId, screenData.screenType); | |
| 540 | + } | |
| 541 | + break; | |
| 542 | + } | |
| 543 | + if ('attributes' === mutation.type && 'class' === mutation.attributeName) { | |
| 544 | + const target = mutation.target; | |
| 545 | + if (target && target.classList && target.classList.contains('nav-tab')) { | |
| 546 | + const screenData = this.getScreenData(); | |
| 547 | + if (screenData) { | |
| 548 | + this.trackScreen(screenData.screenId, screenData.screenType); | |
| 549 | + } | |
| 550 | + break; | |
| 551 | + } | |
| 552 | + } | |
| 553 | + } | |
| 554 | + }); | |
| 555 | + observer.observe(wrapper, { | |
| 556 | + attributes: true, | |
| 557 | + attributeFilter: ['class'], | |
| 558 | + subtree: true, | |
| 559 | + childList: true | |
| 560 | + }); | |
| 561 | + } | |
| 562 | + static attachHashChangeTracking() { | |
| 563 | + window.addEventListener('hashchange', () => { | |
| 564 | + const screenData = this.getScreenData(); | |
| 565 | + if (screenData) { | |
| 566 | + this.trackScreen(screenData.screenId, screenData.screenType); | |
| 567 | + } | |
| 568 | + }); | |
| 569 | + } | |
| 570 | + static attachSettingsTabTracking() { | |
| 571 | + const observer = new MutationObserver(() => { | |
| 572 | + const screenData = this.getScreenData(); | |
| 573 | + if (screenData) { | |
| 574 | + this.trackScreen(screenData.screenId, screenData.screenType); | |
| 575 | + } | |
| 576 | + }); | |
| 577 | + const settingsPages = document.querySelectorAll(SCREEN_SELECTORS.SETTINGS_FORM_PAGE); | |
| 578 | + settingsPages.forEach(page => { | |
| 579 | + observer.observe(page, { | |
| 580 | + attributes: true, | |
| 581 | + attributeFilter: ['class'] | |
| 582 | + }); | |
| 583 | + }); | |
| 584 | + } | |
| 585 | + static trackScreen(screenId, screenType = _wpDashboardTracking.SCREEN_TYPES.APP_SCREEN) { | |
| 586 | + const trackingKey = `${screenId}-${screenType}`; | |
| 587 | + if (this.trackedScreens.has(trackingKey)) { | |
| 588 | + return; | |
| 589 | + } | |
| 590 | + this.trackedScreens.add(trackingKey); | |
| 591 | + _wpDashboardTracking.default.trackScreenViewed(screenId, screenType); | |
| 592 | + } | |
| 593 | +} | |
| 594 | +var _default = exports["default"] = ScreenViewTracking; | |
| 595 | + | |
| 596 | +/***/ }), | |
| 597 | + | |
| 598 | +/***/ "../app/assets/js/event-track/dashboard/top-bar.js": | |
| 599 | +/*!*********************************************************!*\ | |
| 600 | + !*** ../app/assets/js/event-track/dashboard/top-bar.js ***! | |
| 601 | + \*********************************************************/ | |
| 602 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 603 | + | |
| 604 | +"use strict"; | |
| 605 | + | |
| 606 | + | |
| 607 | +Object.defineProperty(exports, "__esModule", ({ | |
| 608 | + value: true | |
| 609 | +})); | |
| 610 | +exports["default"] = void 0; | |
| 611 | +__webpack_require__(/*! core-js/modules/esnext.iterator.constructor.js */ "../node_modules/core-js/modules/esnext.iterator.constructor.js"); | |
| 612 | +__webpack_require__(/*! core-js/modules/esnext.iterator.filter.js */ "../node_modules/core-js/modules/esnext.iterator.filter.js"); | |
| 613 | +__webpack_require__(/*! core-js/modules/esnext.iterator.for-each.js */ "../node_modules/core-js/modules/esnext.iterator.for-each.js"); | |
| 614 | +var _wpDashboardTracking = _interopRequireWildcard(__webpack_require__(/*! ../wp-dashboard-tracking */ "../app/assets/js/event-track/wp-dashboard-tracking.js")); | |
| 615 | +function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (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 (const 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); } | |
| 616 | +const TOP_BAR_SELECTORS = { | |
| 617 | + TOP_BAR_ROOT: '.e-admin-top-bar', | |
| 618 | + BAR_BUTTON: '.e-admin-top-bar__bar-button', | |
| 619 | + BUTTON_TITLE: '.e-admin-top-bar__bar-button-title', | |
| 620 | + MAIN_AREA: '.e-admin-top-bar__main-area', | |
| 621 | + SECONDARY_AREA: '.e-admin-top-bar__secondary-area' | |
| 622 | +}; | |
| 623 | +class TopBarTracking { | |
| 624 | + static init() { | |
| 625 | + this.waitForTopBar(); | |
| 626 | + } | |
| 627 | + static waitForTopBar() { | |
| 628 | + const topBar = document.querySelector(TOP_BAR_SELECTORS.TOP_BAR_ROOT); | |
| 629 | + if (topBar) { | |
| 630 | + this.attachTopBarTracking(topBar); | |
| 631 | + return; | |
| 632 | + } | |
| 633 | + const observer = new MutationObserver((mutations, observerInstance) => { | |
| 634 | + const foundTopBar = document.querySelector(TOP_BAR_SELECTORS.TOP_BAR_ROOT); | |
| 635 | + if (foundTopBar) { | |
| 636 | + this.attachTopBarTracking(foundTopBar); | |
| 637 | + observerInstance.disconnect(); | |
| 638 | + } | |
| 639 | + }); | |
| 640 | + observer.observe(document.body, { | |
| 641 | + childList: true, | |
| 642 | + subtree: true | |
| 643 | + }); | |
| 644 | + setTimeout(() => { | |
| 645 | + observer.disconnect(); | |
| 646 | + }, 10000); | |
| 647 | + } | |
| 648 | + static attachTopBarTracking(topBar) { | |
| 649 | + const buttons = topBar.querySelectorAll(TOP_BAR_SELECTORS.BAR_BUTTON); | |
| 650 | + buttons.forEach(button => { | |
| 651 | + button.addEventListener('click', event => { | |
| 652 | + this.handleTopBarClick(event); | |
| 653 | + }); | |
| 654 | + }); | |
| 655 | + this.observeTopBarChanges(topBar); | |
| 656 | + } | |
| 657 | + static observeTopBarChanges(topBar) { | |
| 658 | + const observer = new MutationObserver(mutations => { | |
| 659 | + mutations.forEach(mutation => { | |
| 660 | + if ('childList' === mutation.type) { | |
| 661 | + mutation.addedNodes.forEach(node => { | |
| 662 | + if (1 === node.nodeType) { | |
| 663 | + if (node.matches && node.matches(TOP_BAR_SELECTORS.BAR_BUTTON)) { | |
| 664 | + node.addEventListener('click', event => { | |
| 665 | + this.handleTopBarClick(event); | |
| 666 | + }); | |
| 667 | + } else { | |
| 668 | + const buttons = node.querySelectorAll ? node.querySelectorAll(TOP_BAR_SELECTORS.BAR_BUTTON) : []; | |
| 669 | + buttons.forEach(button => { | |
| 670 | + button.addEventListener('click', event => { | |
| 671 | + this.handleTopBarClick(event); | |
| 672 | + }); | |
| 673 | + }); | |
| 674 | + } | |
| 675 | + } | |
| 676 | + }); | |
| 677 | + } | |
| 678 | + }); | |
| 679 | + }); | |
| 680 | + observer.observe(topBar, { | |
| 681 | + childList: true, | |
| 682 | + subtree: true | |
| 683 | + }); | |
| 684 | + } | |
| 685 | + static handleTopBarClick(event) { | |
| 686 | + const button = event.currentTarget; | |
| 687 | + const itemId = this.extractItemId(button); | |
| 688 | + _wpDashboardTracking.default.trackNavClicked(itemId, null, _wpDashboardTracking.NAV_AREAS.TOP_BAR); | |
| 689 | + } | |
| 690 | + static extractItemId(button) { | |
| 691 | + const titleElement = button.querySelector(TOP_BAR_SELECTORS.BUTTON_TITLE); | |
| 692 | + if (titleElement && titleElement.textContent.trim()) { | |
| 693 | + return titleElement.textContent.trim(); | |
| 694 | + } | |
| 695 | + const textContent = button.textContent.trim(); | |
| 696 | + if (textContent) { | |
| 697 | + return textContent; | |
| 698 | + } | |
| 699 | + const href = button.getAttribute('href'); | |
| 700 | + if (href) { | |
| 701 | + const urlParams = new URLSearchParams(href.split('?')[1] || ''); | |
| 702 | + const page = urlParams.get('page'); | |
| 703 | + if (page) { | |
| 704 | + return page; | |
| 705 | + } | |
| 706 | + if (href.includes('/wp-admin/')) { | |
| 707 | + const pathParts = href.split('/wp-admin/')[1]; | |
| 708 | + if (pathParts) { | |
| 709 | + return pathParts.split('?')[0]; | |
| 710 | + } | |
| 711 | + } | |
| 712 | + try { | |
| 713 | + const url = new URL(href, window.location.origin); | |
| 714 | + return url.pathname.split('/').filter(Boolean).pop() || url.hostname; | |
| 715 | + } catch (error) { | |
| 716 | + return href; | |
| 717 | + } | |
| 718 | + } | |
| 719 | + const dataInfo = button.getAttribute('data-info'); | |
| 720 | + if (dataInfo) { | |
| 721 | + return dataInfo; | |
| 722 | + } | |
| 723 | + const classes = button.className.split(' ').filter(cls => cls && 'e-admin-top-bar__bar-button' !== cls); | |
| 724 | + if (classes.length > 0) { | |
| 725 | + return classes.join('-'); | |
| 726 | + } | |
| 727 | + return 'unknown-top-bar-button'; | |
| 728 | + } | |
| 729 | +} | |
| 730 | +var _default = exports["default"] = TopBarTracking; | |
| 731 | + | |
| 732 | +/***/ }), | |
| 733 | + | |
| 734 | +/***/ "../app/assets/js/event-track/dashboard/utils.js": | |
| 735 | +/*!*******************************************************!*\ | |
| 736 | + !*** ../app/assets/js/event-track/dashboard/utils.js ***! | |
| 737 | + \*******************************************************/ | |
| 738 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 739 | + | |
| 740 | +"use strict"; | |
| 741 | + | |
| 742 | + | |
| 743 | +Object.defineProperty(exports, "__esModule", ({ | |
| 744 | + value: true | |
| 745 | +})); | |
| 746 | +exports.DashboardUtils = void 0; | |
| 747 | +__webpack_require__(/*! core-js/modules/esnext.iterator.constructor.js */ "../node_modules/core-js/modules/esnext.iterator.constructor.js"); | |
| 748 | +__webpack_require__(/*! core-js/modules/esnext.iterator.some.js */ "../node_modules/core-js/modules/esnext.iterator.some.js"); | |
| 749 | +const DashboardUtils = exports.DashboardUtils = { | |
| 750 | + isElementorPage() { | |
| 751 | + const urlParams = new URLSearchParams(window.location.search); | |
| 752 | + const page = urlParams.get('page'); | |
| 753 | + if (page && (page.startsWith('elementor') || page.includes('elementor'))) { | |
| 754 | + return true; | |
| 755 | + } | |
| 756 | + const postType = urlParams.get('post_type'); | |
| 757 | + if ('elementor_library' === postType) { | |
| 758 | + return true; | |
| 759 | + } | |
| 760 | + const body = document.body; | |
| 761 | + const bodyClasses = body.className.split(' '); | |
| 762 | + return bodyClasses.some(cls => cls.includes('elementor') && (cls.includes('page') || cls.includes('post-type'))); | |
| 763 | + } | |
| 764 | +}; | |
| 765 | + | |
| 766 | +/***/ }), | |
| 767 | + | |
| 768 | +/***/ "../app/assets/js/event-track/wp-dashboard-tracking.js": | |
| 769 | +/*!*************************************************************!*\ | |
| 770 | + !*** ../app/assets/js/event-track/wp-dashboard-tracking.js ***! | |
| 771 | + \*************************************************************/ | |
| 772 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 773 | + | |
| 774 | +"use strict"; | |
| 775 | + | |
| 776 | + | |
| 777 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 778 | +Object.defineProperty(exports, "__esModule", ({ | |
| 779 | + value: true | |
| 780 | +})); | |
| 781 | +exports["default"] = exports.SCREEN_TYPES = exports.NAV_AREAS = exports.CONTROL_TYPES = void 0; | |
| 782 | +var _navigation = _interopRequireDefault(__webpack_require__(/*! ./dashboard/navigation */ "../app/assets/js/event-track/dashboard/navigation.js")); | |
| 783 | +var _topBar = _interopRequireDefault(__webpack_require__(/*! ./dashboard/top-bar */ "../app/assets/js/event-track/dashboard/top-bar.js")); | |
| 784 | +var _screenView = _interopRequireDefault(__webpack_require__(/*! ./dashboard/screen-view */ "../app/assets/js/event-track/dashboard/screen-view.js")); | |
| 785 | +var _actionControl = _interopRequireDefault(__webpack_require__(/*! ./dashboard/action-control */ "../app/assets/js/event-track/dashboard/action-control.js")); | |
| 786 | +const SESSION_TIMEOUT_MINUTES = 30; | |
| 787 | +const MINUTE_MS = 60 * 1000; | |
| 788 | +const SESSION_TIMEOUT = SESSION_TIMEOUT_MINUTES * MINUTE_MS; | |
| 789 | +const ACTIVITY_CHECK_INTERVAL = 1 * MINUTE_MS; | |
| 790 | +const CONTROL_TYPES = exports.CONTROL_TYPES = { | |
| 791 | + BUTTON: 'button', | |
| 792 | + CHECKBOX: 'checkbox', | |
| 793 | + RADIO: 'radio', | |
| 794 | + LINK: 'link', | |
| 795 | + SELECT: 'select', | |
| 796 | + TOGGLE: 'toggle' | |
| 797 | +}; | |
| 798 | +const NAV_AREAS = exports.NAV_AREAS = { | |
| 799 | + LEFT_MENU: 'left_menu', | |
| 800 | + SUBMENU: 'submenu', | |
| 801 | + HOVER_MENU: 'hover_menu', | |
| 802 | + TOP_BAR: 'top_bar' | |
| 803 | +}; | |
| 804 | +const SCREEN_TYPES = exports.SCREEN_TYPES = { | |
| 805 | + TAB: 'tab', | |
| 806 | + POPUP: 'popup', | |
| 807 | + APP_SCREEN: 'app_screen' | |
| 808 | +}; | |
| 809 | +class WpDashboardTracking { | |
| 810 | + static sessionStartTime = Date.now(); | |
| 811 | + static lastActivityTime = Date.now(); | |
| 812 | + static sessionEnded = false; | |
| 813 | + static navItemsVisited = new Set(); | |
| 814 | + static activityCheckInterval = null; | |
| 815 | + static config = null; | |
| 816 | + static canSendEvents = false; | |
| 817 | + static initialized = false; | |
| 818 | + static init() { | |
| 819 | + if (this.initialized) { | |
| 820 | + return; | |
| 821 | + } | |
| 822 | + this.sessionStartTime = Date.now(); | |
| 823 | + this.lastActivityTime = Date.now(); | |
| 824 | + this.sessionEnded = false; | |
| 825 | + this.navItemsVisited = new Set(); | |
| 826 | + this.config = elementorCommon?.config || {}; | |
| 827 | + const editorEvents = this.config.editor_events || {}; | |
| 828 | + this.canSendEvents = editorEvents.can_send_events || false; | |
| 829 | + if (this.isEventsManagerAvailable()) { | |
| 830 | + this.startSessionMonitoring(); | |
| 831 | + this.attachActivityListeners(); | |
| 832 | + this.initialized = true; | |
| 833 | + } | |
| 834 | + } | |
| 835 | + static isEventsManagerAvailable() { | |
| 836 | + return elementorCommon?.eventsManager && 'function' === typeof elementorCommon.eventsManager.dispatchEvent; | |
| 837 | + } | |
| 838 | + static dispatchEvent(eventName, properties = {}) { | |
| 839 | + if (!this.canSendEvents || !this.isEventsManagerAvailable()) { | |
| 840 | + return; | |
| 841 | + } | |
| 842 | + try { | |
| 843 | + elementorCommon.eventsManager.dispatchEvent(eventName, properties); | |
| 844 | + } catch (error) { | |
| 845 | + this.canSendEvents = false; | |
| 846 | + } | |
| 847 | + } | |
| 848 | + static updateActivity() { | |
| 849 | + this.lastActivityTime = Date.now(); | |
| 850 | + this.sessionEnded = false; | |
| 851 | + } | |
| 852 | + static startSessionMonitoring() { | |
| 853 | + this.activityCheckInterval = setInterval(() => { | |
| 854 | + this.checkSessionTimeout(); | |
| 855 | + }, ACTIVITY_CHECK_INTERVAL); | |
| 856 | + window.addEventListener('beforeunload', () => { | |
| 857 | + this.trackSessionEnd('page_unload'); | |
| 858 | + }); | |
| 859 | + document.addEventListener('visibilitychange', () => { | |
| 860 | + if (document.hidden) { | |
| 861 | + const timeSinceLastActivity = Date.now() - this.lastActivityTime; | |
| 862 | + if (timeSinceLastActivity > SESSION_TIMEOUT) { | |
| 863 | + this.trackSessionEnd('tab_inactive'); | |
| 864 | + } | |
| 865 | + } | |
| 866 | + }); | |
| 867 | + } | |
| 868 | + static checkSessionTimeout() { | |
| 869 | + const timeSinceLastActivity = Date.now() - this.lastActivityTime; | |
| 870 | + if (timeSinceLastActivity > SESSION_TIMEOUT && !this.sessionEnded) { | |
| 871 | + this.trackSessionEnd('timeout'); | |
| 872 | + } | |
| 873 | + } | |
| 874 | + static attachActivityListeners() { | |
| 875 | + const events = ['mousedown', 'keydown', 'scroll', 'touchstart', 'click']; | |
| 876 | + events.forEach(event => { | |
| 877 | + document.addEventListener(event, () => { | |
| 878 | + this.updateActivity(); | |
| 879 | + }, { | |
| 880 | + capture: true, | |
| 881 | + passive: true | |
| 882 | + }); | |
| 883 | + }); | |
| 884 | + } | |
| 885 | + static formatDuration(milliseconds) { | |
| 886 | + const totalSeconds = Math.floor(milliseconds / 1000); | |
| 887 | + const minutes = Math.floor(totalSeconds / 60); | |
| 888 | + const seconds = totalSeconds % 60; | |
| 889 | + return `${minutes}:${seconds.toString().padStart(2, '0')}`; | |
| 890 | + } | |
| 891 | + static trackNavClicked(itemId, rootItem = null, area = NAV_AREAS.LEFT_MENU) { | |
| 892 | + this.updateActivity(); | |
| 893 | + this.navItemsVisited.add(itemId); | |
| 894 | + const properties = { | |
| 895 | + wpdash_nav_item_id: itemId, | |
| 896 | + wpdash_nav_area: area | |
| 897 | + }; | |
| 898 | + if (rootItem) { | |
| 899 | + properties.wpdash_nav_item_root = rootItem; | |
| 900 | + } | |
| 901 | + this.dispatchEvent('wpdash_nav_clicked', properties); | |
| 902 | + } | |
| 903 | + static trackScreenViewed(screenId, screenType = SCREEN_TYPES.TAB) { | |
| 904 | + this.updateActivity(); | |
| 905 | + const properties = { | |
| 906 | + wpdash_screen_id: screenId, | |
| 907 | + wpdash_screen_type: screenType | |
| 908 | + }; | |
| 909 | + this.dispatchEvent('wpdash_screen_viewed', properties); | |
| 910 | + } | |
| 911 | + static trackActionControl(controlData, controlType) { | |
| 912 | + this.updateActivity(); | |
| 913 | + const properties = { | |
| 914 | + wpdash_action_control_interacted: controlData, | |
| 915 | + wpdash_control_type: controlType | |
| 916 | + }; | |
| 917 | + this.dispatchEvent('wpdash_action_control', properties); | |
| 918 | + } | |
| 919 | + static trackPromoClicked(promoName, destination, clickPath) { | |
| 920 | + this.updateActivity(); | |
| 921 | + const properties = { | |
| 922 | + wpdash_promo_name: promoName, | |
| 923 | + wpdash_promo_destination: destination, | |
| 924 | + wpdash_promo_clicked_path: clickPath | |
| 925 | + }; | |
| 926 | + this.dispatchEvent('wpdash_promo_clicked', properties); | |
| 927 | + } | |
| 928 | + static trackSessionEnd(reason = 'timeout') { | |
| 929 | + if (this.sessionEnded) { | |
| 930 | + return; | |
| 931 | + } | |
| 932 | + this.sessionEnded = true; | |
| 933 | + const duration = Date.now() - this.sessionStartTime; | |
| 934 | + const properties = { | |
| 935 | + wpdash_endstate_nav_summary: Array.from(this.navItemsVisited), | |
| 936 | + wpdash_endstate_nav_count: this.navItemsVisited.size, | |
| 937 | + wpdash_endstate_duration: this.formatDuration(duration), | |
| 938 | + reason | |
| 939 | + }; | |
| 940 | + this.dispatchEvent('wpdash_session_end_state', properties); | |
| 941 | + } | |
| 942 | + static destroy() { | |
| 943 | + if (this.activityCheckInterval) { | |
| 944 | + clearInterval(this.activityCheckInterval); | |
| 945 | + } | |
| 946 | + this.initialized = false; | |
| 947 | + } | |
| 948 | +} | |
| 949 | +exports["default"] = WpDashboardTracking; | |
| 950 | +window.addEventListener('elementor/admin/init', () => { | |
| 951 | + WpDashboardTracking.init(); | |
| 952 | + _navigation.default.init(); | |
| 953 | + _topBar.default.init(); | |
| 954 | + _screenView.default.init(); | |
| 955 | + _actionControl.default.init(); | |
| 956 | +}); | |
| 957 | + | |
| 958 | +/***/ }), | |
| 959 | + | |
| 3 | 960 | /***/ "../app/modules/import-export-customization/assets/js/shared/registry/base.js": |
| 4 | 961 | /*!************************************************************************************!*\ |
| 5 | 962 | !*** ../app/modules/import-export-customization/assets/js/shared/registry/base.js ***! |
| 6 | 963 | \************************************************************************************/ |
| @@ -1683,9 +2640,11 @@ | ||
| 1683 | 2640 | var _scroll = _interopRequireDefault(__webpack_require__(/*! ./imports/utils/scroll */ "../assets/dev/js/modules/imports/utils/scroll.js")); |
| 1684 | 2641 | var _forceMethodImplementation = _interopRequireDefault(__webpack_require__(/*! ./imports/force-method-implementation */ "../assets/dev/js/modules/imports/force-method-implementation.js")); |
| 1685 | 2642 | 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"); |
| 1686 | 2643 | 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"); |
| 1687 | -const baseModules = { | |
| 2644 | +var _appsEventTracking = __webpack_require__(/*! elementor-app/event-track/apps-event-tracking */ "../app/assets/js/event-track/apps-event-tracking.js"); | |
| 2645 | +var _wpDashboardTracking = _interopRequireDefault(__webpack_require__(/*! elementor-app/event-track/wp-dashboard-tracking */ "../app/assets/js/event-track/wp-dashboard-tracking.js")); | |
| 2646 | +var _default = exports["default"] = window.elementorModules = { | |
| 1688 | 2647 | Module: _module.default, |
| 1689 | 2648 | ViewModule: _viewModule.default, |
| 1690 | 2649 | ArgsObject: _argsObject.default, |
| 1691 | 2650 | ForceMethodImplementation: _forceMethodImplementation.default, |
| @@ -1695,19 +2654,201 @@ | ||
| 1695 | 2654 | }, |
| 1696 | 2655 | importExport: { |
| 1697 | 2656 | createGetInitialState: _templateRegistryHelpers.createGetInitialState, |
| 1698 | 2657 | customizationDialogsRegistry: _customizationDialogs.customizationDialogsRegistry |
| 2658 | + }, | |
| 2659 | + appsEventTracking: { | |
| 2660 | + AppsEventTracking: _appsEventTracking.AppsEventTracking | |
| 2661 | + }, | |
| 2662 | + wpDashboardTracking: { | |
| 2663 | + WpDashboardTracking: _wpDashboardTracking.default | |
| 1699 | 2664 | } |
| 1700 | 2665 | }; |
| 1701 | -if (!window.elementorModules) { | |
| 1702 | - window.elementorModules = baseModules; | |
| 1703 | -} else { | |
| 1704 | - Object.assign(window.elementorModules, baseModules); | |
| 1705 | -} | |
| 1706 | -var _default = exports["default"] = window.elementorModules; | |
| 1707 | 2666 | |
| 1708 | 2667 | /***/ }), |
| 1709 | 2668 | |
| 2669 | +/***/ "../core/common/modules/events-manager/assets/js/events-config.js": | |
| 2670 | +/*!************************************************************************!*\ | |
| 2671 | + !*** ../core/common/modules/events-manager/assets/js/events-config.js ***! | |
| 2672 | + \************************************************************************/ | |
| 2673 | +/***/ ((__unused_webpack_module, exports) => { | |
| 2674 | + | |
| 2675 | +"use strict"; | |
| 2676 | + | |
| 2677 | + | |
| 2678 | +Object.defineProperty(exports, "__esModule", ({ | |
| 2679 | + value: true | |
| 2680 | +})); | |
| 2681 | +exports["default"] = void 0; | |
| 2682 | +const eventsConfig = { | |
| 2683 | + triggers: { | |
| 2684 | + click: 'Click', | |
| 2685 | + accordionClick: 'Accordion Click', | |
| 2686 | + toggleClick: 'Toggle Click', | |
| 2687 | + dropdownClick: 'Click Dropdown', | |
| 2688 | + editorLoaded: 'Editor Loaded', | |
| 2689 | + visible: 'Visible', | |
| 2690 | + pageLoaded: 'Page Loaded' | |
| 2691 | + }, | |
| 2692 | + locations: { | |
| 2693 | + widgetPanel: 'Widget Panel', | |
| 2694 | + topBar: 'Top Bar', | |
| 2695 | + elementorEditor: 'Elementor Editor', | |
| 2696 | + templatesLibrary: { | |
| 2697 | + library: 'Templates Library' | |
| 2698 | + }, | |
| 2699 | + app: { | |
| 2700 | + import: 'Import Kit', | |
| 2701 | + export: 'Export Kit', | |
| 2702 | + kitLibrary: 'Kit Library', | |
| 2703 | + cloudKitLibrary: 'Cloud Kit Library' | |
| 2704 | + }, | |
| 2705 | + variables: 'Variables Panel', | |
| 2706 | + admin: 'WP admin' | |
| 2707 | + }, | |
| 2708 | + secondaryLocations: { | |
| 2709 | + layout: 'Layout Section', | |
| 2710 | + basic: 'Basic Section', | |
| 2711 | + 'pro-elements': 'Pro Section', | |
| 2712 | + general: 'General Section', | |
| 2713 | + 'theme-elements': 'Site Section', | |
| 2714 | + 'theme-elements-single': 'Single Section', | |
| 2715 | + 'woocommerce-elements': 'WooCommerce Section', | |
| 2716 | + wordpress: 'WordPress Section', | |
| 2717 | + categories: 'Widgets Tab', | |
| 2718 | + global: 'Globals Tab', | |
| 2719 | + 'whats-new': 'What\'s New', | |
| 2720 | + 'document-settings': 'Document Settings icon', | |
| 2721 | + 'preview-page': 'Preview Page', | |
| 2722 | + 'publish-button': 'Publish Button', | |
| 2723 | + 'widget-panel': 'Widget Panel Icon', | |
| 2724 | + finder: 'Finder', | |
| 2725 | + help: 'Help', | |
| 2726 | + elementorLogoDropdown: 'top_bar_elementor_logo_dropdown', | |
| 2727 | + elementorLogo: 'Elementor Logo', | |
| 2728 | + eLogoMenu: 'E-logo Menu', | |
| 2729 | + notes: 'Notes', | |
| 2730 | + siteSettings: 'Site Settings', | |
| 2731 | + structure: 'Structure', | |
| 2732 | + documentNameDropdown: 'Document Name dropdown', | |
| 2733 | + responsiveControls: 'Responsive controls', | |
| 2734 | + launchpad: 'launchpad', | |
| 2735 | + checklistHeader: 'Checklist Header', | |
| 2736 | + checklistSteps: 'Checklist Steps', | |
| 2737 | + userPreferences: 'User Preferences', | |
| 2738 | + contextMenu: 'Context Menu', | |
| 2739 | + templateLibrary: { | |
| 2740 | + saveModal: 'Save to Modal', | |
| 2741 | + moveModal: 'Move to Modal', | |
| 2742 | + bulkMoveModal: 'Bulk Move to Modal', | |
| 2743 | + copyModal: 'Copy to Modal', | |
| 2744 | + bulkCopyModal: 'Bulk Copy to Modal', | |
| 2745 | + saveModalSelectFolder: 'Save to Modal - select folder', | |
| 2746 | + saveModalSelectConnect: 'Save to Modal - connect', | |
| 2747 | + saveModalSelectUpgrade: 'Save to Modal - upgrade', | |
| 2748 | + importModal: 'Import Modal', | |
| 2749 | + newFolderModal: 'New Folder Modal', | |
| 2750 | + deleteDialog: 'Delete Dialog', | |
| 2751 | + deleteFolderDialog: 'Delete Folder Dialog', | |
| 2752 | + renameDialog: 'Rename Dialog', | |
| 2753 | + createFolderDialog: 'Create Folder Dialog', | |
| 2754 | + applySettingsDialog: 'Apply Settings Dialog', | |
| 2755 | + cloudTab: 'Cloud Tab', | |
| 2756 | + siteTab: 'Site Tab', | |
| 2757 | + cloudTabFolder: 'Cloud Tab - Folder', | |
| 2758 | + cloudTabConnect: 'Cloud Tab - Connect', | |
| 2759 | + cloudTabUpgrade: 'Cloud Tab - Upgrade', | |
| 2760 | + morePopup: 'Context Menu', | |
| 2761 | + quotaBar: 'Quota Bar' | |
| 2762 | + }, | |
| 2763 | + kitLibrary: { | |
| 2764 | + cloudKitLibrary: 'kits_cloud_library', | |
| 2765 | + cloudKitLibraryConnect: 'kits_cloud_library_connect', | |
| 2766 | + cloudKitLibraryUpgrade: 'kits_cloud_library_upgrade', | |
| 2767 | + kitExportCustomization: 'kit_export_customization', | |
| 2768 | + kitExport: 'kit_export', | |
| 2769 | + kitExportCustomizationEdit: 'kit_export_customization_edit', | |
| 2770 | + kitExportSummary: 'kit_export_summary', | |
| 2771 | + kitImportUploadBox: 'kit_import_upload_box', | |
| 2772 | + kitImportCustomization: 'kit_import_customization', | |
| 2773 | + kitImportSummary: 'kit_import_summary' | |
| 2774 | + }, | |
| 2775 | + variablesPopover: 'Variables Popover', | |
| 2776 | + admin: { | |
| 2777 | + pluginToolsTab: 'plugin_tools_tab', | |
| 2778 | + pluginWebsiteTemplatesTab: 'plugin_website_templates_tab' | |
| 2779 | + } | |
| 2780 | + }, | |
| 2781 | + elements: { | |
| 2782 | + accordionSection: 'Accordion section', | |
| 2783 | + buttonIcon: 'Button Icon', | |
| 2784 | + mainCta: 'Main CTA', | |
| 2785 | + button: 'Button', | |
| 2786 | + link: 'Link', | |
| 2787 | + dropdown: 'Dropdown', | |
| 2788 | + toggle: 'Toggle', | |
| 2789 | + launchpadChecklist: 'Checklist popup' | |
| 2790 | + }, | |
| 2791 | + names: { | |
| 2792 | + v1: { | |
| 2793 | + layout: 'v1_widgets_tab_layout_section', | |
| 2794 | + basic: 'v1_widgets_tab_basic_section', | |
| 2795 | + 'pro-elements': 'v1_widgets_tab_pro_section', | |
| 2796 | + general: 'v1_widgets_tab_general_section', | |
| 2797 | + 'theme-elements': 'v1_widgets_tab_site_section', | |
| 2798 | + 'theme-elements-single': 'v1_widgets_tab_single_section', | |
| 2799 | + 'woocommerce-elements': 'v1_widgets_tab_woocommerce_section', | |
| 2800 | + wordpress: 'v1_widgets_tab_wordpress_section', | |
| 2801 | + categories: 'v1_widgets_tab', | |
| 2802 | + global: 'v1_globals_tab' | |
| 2803 | + }, | |
| 2804 | + topBar: { | |
| 2805 | + whatsNew: 'top_bar_whats_new', | |
| 2806 | + documentSettings: 'top_bar_document_settings_icon', | |
| 2807 | + previewPage: 'top_bar_preview_page', | |
| 2808 | + publishButton: 'top_bar_publish_button', | |
| 2809 | + widgetPanel: 'top_bar_widget_panel_icon', | |
| 2810 | + finder: 'top_bar_finder', | |
| 2811 | + help: 'top_bar_help', | |
| 2812 | + history: 'top_bar_elementor_logo_dropdown_history', | |
| 2813 | + userPreferences: 'top_bar_elementor_logo_dropdown_user_preferences', | |
| 2814 | + keyboardShortcuts: 'top_bar_elementor_logo_dropdown_keyboard_shortcuts', | |
| 2815 | + exitToWordpress: 'top_bar_elementor_logo_dropdown_exit_to_wordpress', | |
| 2816 | + themeBuilder: 'top_bar_elementor_logo_dropdown_theme_builder', | |
| 2817 | + notes: 'top_bar_notes', | |
| 2818 | + siteSettings: 'top_bar_site_setting', | |
| 2819 | + structure: 'top_bar_structure', | |
| 2820 | + documentNameDropdown: 'top_bar_document_name_dropdown', | |
| 2821 | + responsiveControls: 'top_bar_responsive_controls', | |
| 2822 | + launchpadOn: 'top_bar_checklist_icon_show', | |
| 2823 | + launchpadOff: 'top_bar_checklist_icon_hide', | |
| 2824 | + elementorLogoDropdown: 'open_e_menu', | |
| 2825 | + connectAccount: 'connect_account', | |
| 2826 | + accountConnected: 'account_connected' | |
| 2827 | + }, | |
| 2828 | + // ChecklistSteps event names are generated dynamically, based on stepId and action type taken: title, action, done, undone, upgrade | |
| 2829 | + elementorEditor: { | |
| 2830 | + checklist: { | |
| 2831 | + checklistHeaderClose: 'checklist_header_close_icon', | |
| 2832 | + checklistFirstPopup: 'checklist popup triggered' | |
| 2833 | + }, | |
| 2834 | + userPreferences: { | |
| 2835 | + checklistShow: 'checklist_userpreferences_toggle_show', | |
| 2836 | + checklistHide: 'checklist_userpreferences_toggle_hide' | |
| 2837 | + } | |
| 2838 | + }, | |
| 2839 | + variables: { | |
| 2840 | + open: 'open_variables_popover', | |
| 2841 | + add: 'add_new_variable', | |
| 2842 | + connect: 'connect_variable', | |
| 2843 | + save: 'save_new_variable' | |
| 2844 | + } | |
| 2845 | + } | |
| 2846 | +}; | |
| 2847 | +var _default = exports["default"] = eventsConfig; | |
| 2848 | + | |
| 2849 | +/***/ }), | |
| 2850 | + | |
| 1710 | 2851 | /***/ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js": |
| 1711 | 2852 | /*!***********************************************************************!*\ |
| 1712 | 2853 | !*** ../node_modules/@babel/runtime/helpers/interopRequireDefault.js ***! |
| 1713 | 2854 | \***********************************************************************/ |
| @@ -2573,9 +3714,9 @@ | ||
| 2573 | 3714 | |
| 2574 | 3715 | "use strict"; |
| 2575 | 3716 | |
| 2576 | 3717 | // `GetIteratorDirect(obj)` abstract operation |
| 2577 | -// https://tc39.es/ecma262/#sec-getiteratordirect | |
| 3718 | +// https://tc39.es/proposal-iterator-helpers/#sec-getiteratordirect | |
| 2578 | 3719 | module.exports = function (obj) { |
| 2579 | 3720 | return { |
| 2580 | 3721 | iterator: obj, |
| 2581 | 3722 | next: obj.next, |
| @@ -3223,9 +4364,9 @@ | ||
| 3223 | 4364 | var getMethod = __webpack_require__(/*! ../internals/get-method */ "../node_modules/core-js/internals/get-method.js"); |
| 3224 | 4365 | var IteratorPrototype = (__webpack_require__(/*! ../internals/iterators-core */ "../node_modules/core-js/internals/iterators-core.js").IteratorPrototype); |
| 3225 | 4366 | var createIterResultObject = __webpack_require__(/*! ../internals/create-iter-result-object */ "../node_modules/core-js/internals/create-iter-result-object.js"); |
| 3226 | 4367 | var iteratorClose = __webpack_require__(/*! ../internals/iterator-close */ "../node_modules/core-js/internals/iterator-close.js"); |
| 3227 | -var iteratorCloseAll = __webpack_require__(/*! ../internals/iterator-close-all */ "../node_modules/core-js/internals/iterator-close-all.js"); | |
| 4368 | +var iteratorCloseAll = __webpack_require__(/*! ./iterator-close-all */ "../node_modules/core-js/internals/iterator-close-all.js"); | |
| 3228 | 4369 | |
| 3229 | 4370 | var TO_STRING_TAG = wellKnownSymbol('toStringTag'); |
| 3230 | 4371 | var ITERATOR_HELPER = 'IteratorHelper'; |
| 3231 | 4372 | var WRAP_FOR_VALID_ITERATOR = 'WrapForValidIterator'; |
| @@ -4030,12 +5171,12 @@ | ||
| 4030 | 5171 | var SHARED = '__core-js_shared__'; |
| 4031 | 5172 | var store = module.exports = globalThis[SHARED] || defineGlobalProperty(SHARED, {}); |
| 4032 | 5173 | |
| 4033 | 5174 | (store.versions || (store.versions = [])).push({ |
| 4034 | - version: '3.46.0', | |
| 5175 | + version: '3.43.0', | |
| 4035 | 5176 | mode: IS_PURE ? 'pure' : 'global', |
| 4036 | - copyright: '© 2014-2025 Denis Pushkarev (zloirock.ru), 2025 CoreJS Company (core-js.io)', | |
| 4037 | - license: 'https://github.com/zloirock/core-js/blob/v3.46.0/LICENSE', | |
| 5177 | + copyright: '© 2014-2025 Denis Pushkarev (zloirock.ru)', | |
| 5178 | + license: 'https://github.com/zloirock/core-js/blob/v3.43.0/LICENSE', | |
| 4038 | 5179 | source: 'https://github.com/zloirock/core-js' |
| 4039 | 5180 | }); |
| 4040 | 5181 | |
| 4041 | 5182 | |
| @@ -4736,8 +5877,51 @@ | ||
| 4736 | 5877 | |
| 4737 | 5878 | |
| 4738 | 5879 | /***/ }), |
| 4739 | 5880 | |
| 5881 | +/***/ "../node_modules/core-js/modules/es.iterator.some.js": | |
| 5882 | +/*!***********************************************************!*\ | |
| 5883 | + !*** ../node_modules/core-js/modules/es.iterator.some.js ***! | |
| 5884 | + \***********************************************************/ | |
| 5885 | +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { | |
| 5886 | + | |
| 5887 | +"use strict"; | |
| 5888 | + | |
| 5889 | +var $ = __webpack_require__(/*! ../internals/export */ "../node_modules/core-js/internals/export.js"); | |
| 5890 | +var call = __webpack_require__(/*! ../internals/function-call */ "../node_modules/core-js/internals/function-call.js"); | |
| 5891 | +var iterate = __webpack_require__(/*! ../internals/iterate */ "../node_modules/core-js/internals/iterate.js"); | |
| 5892 | +var aCallable = __webpack_require__(/*! ../internals/a-callable */ "../node_modules/core-js/internals/a-callable.js"); | |
| 5893 | +var anObject = __webpack_require__(/*! ../internals/an-object */ "../node_modules/core-js/internals/an-object.js"); | |
| 5894 | +var getIteratorDirect = __webpack_require__(/*! ../internals/get-iterator-direct */ "../node_modules/core-js/internals/get-iterator-direct.js"); | |
| 5895 | +var iteratorClose = __webpack_require__(/*! ../internals/iterator-close */ "../node_modules/core-js/internals/iterator-close.js"); | |
| 5896 | +var iteratorHelperWithoutClosingOnEarlyError = __webpack_require__(/*! ../internals/iterator-helper-without-closing-on-early-error */ "../node_modules/core-js/internals/iterator-helper-without-closing-on-early-error.js"); | |
| 5897 | + | |
| 5898 | +var someWithoutClosingOnEarlyError = iteratorHelperWithoutClosingOnEarlyError('some', TypeError); | |
| 5899 | + | |
| 5900 | +// `Iterator.prototype.some` method | |
| 5901 | +// https://tc39.es/ecma262/#sec-iterator.prototype.some | |
| 5902 | +$({ target: 'Iterator', proto: true, real: true, forced: someWithoutClosingOnEarlyError }, { | |
| 5903 | + some: function some(predicate) { | |
| 5904 | + anObject(this); | |
| 5905 | + try { | |
| 5906 | + aCallable(predicate); | |
| 5907 | + } catch (error) { | |
| 5908 | + iteratorClose(this, 'throw', error); | |
| 5909 | + } | |
| 5910 | + | |
| 5911 | + if (someWithoutClosingOnEarlyError) return call(someWithoutClosingOnEarlyError, this, predicate); | |
| 5912 | + | |
| 5913 | + var record = getIteratorDirect(this); | |
| 5914 | + var counter = 0; | |
| 5915 | + return iterate(record, function (value, stop) { | |
| 5916 | + if (predicate(value, counter++)) return stop(); | |
| 5917 | + }, { IS_RECORD: true, INTERRUPTED: true }).stopped; | |
| 5918 | + } | |
| 5919 | +}); | |
| 5920 | + | |
| 5921 | + | |
| 5922 | +/***/ }), | |
| 5923 | + | |
| 4740 | 5924 | /***/ "../node_modules/core-js/modules/esnext.iterator.constructor.js": |
| 4741 | 5925 | /*!**********************************************************************!*\ |
| 4742 | 5926 | !*** ../node_modules/core-js/modules/esnext.iterator.constructor.js ***! |
| 4743 | 5927 | \**********************************************************************/ |
| @@ -4802,8 +5986,22 @@ | ||
| 4802 | 5986 | "use strict"; |
| 4803 | 5987 | |
| 4804 | 5988 | // TODO: Remove from `core-js@4` |
| 4805 | 5989 | __webpack_require__(/*! ../modules/es.iterator.map */ "../node_modules/core-js/modules/es.iterator.map.js"); |
| 5990 | + | |
| 5991 | + | |
| 5992 | +/***/ }), | |
| 5993 | + | |
| 5994 | +/***/ "../node_modules/core-js/modules/esnext.iterator.some.js": | |
| 5995 | +/*!***************************************************************!*\ | |
| 5996 | + !*** ../node_modules/core-js/modules/esnext.iterator.some.js ***! | |
| 5997 | + \***************************************************************/ | |
| 5998 | +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { | |
| 5999 | + | |
| 6000 | +"use strict"; | |
| 6001 | + | |
| 6002 | +// TODO: Remove from `core-js@4` | |
| 6003 | +__webpack_require__(/*! ../modules/es.iterator.some */ "../node_modules/core-js/modules/es.iterator.some.js"); | |
| 4806 | 6004 | |
| 4807 | 6005 | |
| 4808 | 6006 | /***/ }) |
| 4809 | 6007 | |