| @@ -1,66 +1,75 @@ | ||
| 1 | -(function() { | |
| 1 | +/******/ (() => { // webpackBootstrap | |
| 2 | +/******/ "use strict"; | |
| 3 | +/*!**************************************************************!*\ | |
| 4 | + !*** ../modules/pro-install/assets/js/pro-install-events.js ***! | |
| 5 | + \**************************************************************/ | |
| 2 | 6 | |
| 3 | -//#region \0rolldown/runtime.js | |
| 4 | - var __defProp = Object.defineProperty; | |
| 5 | - var __name = (target, value) => __defProp(target, "name", { | |
| 6 | - value, | |
| 7 | - configurable: true | |
| 8 | - }); | |
| 9 | 7 | |
| 10 | -//#endregion | |
| 8 | +function getDispatchEvent() { | |
| 9 | + var _window$elementorComm, _window$elementorComm2, _eventsManager$dispat; | |
| 10 | + var isEnabled = (_window$elementorComm = window.elementorCommon) === null || _window$elementorComm === void 0 || (_window$elementorComm = _window$elementorComm.config) === null || _window$elementorComm === void 0 || (_window$elementorComm = _window$elementorComm.experimentalFeatures) === null || _window$elementorComm === void 0 ? void 0 : _window$elementorComm.editor_events; | |
| 11 | + if (!isEnabled) { | |
| 12 | + return null; | |
| 13 | + } | |
| 14 | + var eventsManager = (_window$elementorComm2 = window.elementorCommon) === null || _window$elementorComm2 === void 0 ? void 0 : _window$elementorComm2.eventsManager; | |
| 15 | + return (eventsManager === null || eventsManager === void 0 || (_eventsManager$dispat = eventsManager.dispatchEvent) === null || _eventsManager$dispat === void 0 ? void 0 : _eventsManager$dispat.bind(eventsManager)) || null; | |
| 16 | +} | |
| 17 | +function trackEditorEvent(eventName, eventData) { | |
| 18 | + var dispatchEvent = getDispatchEvent(); | |
| 19 | + if (!dispatchEvent) { | |
| 20 | + return; | |
| 21 | + } | |
| 22 | + dispatchEvent(eventName, eventData); | |
| 23 | +} | |
| 24 | +window.trackUpgradeNowClickEvent = function () { | |
| 25 | + trackEditorEvent('upgrade_subscription', { | |
| 26 | + app_type: 'editor', | |
| 27 | + location: 'Elementor WP-admin pages', | |
| 28 | + secondaryLocation: 'Connect account page', | |
| 29 | + trigger: 'click' | |
| 30 | + }); | |
| 31 | +}; | |
| 32 | +window.trackConnectAccountEvent = function () { | |
| 33 | + Promise.resolve(trackEditorEvent('connect_account', { | |
| 34 | + app_type: 'editor', | |
| 35 | + location: 'Elementor WP-admin pages', | |
| 36 | + secondaryLocation: 'Connect account page', | |
| 37 | + trigger: 'click' | |
| 38 | + })).catch(function () {}); | |
| 39 | +}; | |
| 40 | +window.trackOpenConnectPageEvent = function () { | |
| 41 | + trackEditorEvent('open_connect_page', { | |
| 42 | + app_type: 'editor', | |
| 43 | + location: 'Elementor WP-admin pages', | |
| 44 | + secondaryLocation: 'Connect account page', | |
| 45 | + trigger: 'page_load' | |
| 46 | + }); | |
| 47 | +}; | |
| 48 | +window.trackProInstallEvent = function () { | |
| 49 | + trackEditorEvent('pro_install', { | |
| 50 | + app_type: 'editor', | |
| 51 | + location: 'Elementor WP-admin pages', | |
| 52 | + secondaryLocation: 'Connect account page', | |
| 53 | + trigger: 'click' | |
| 54 | + }); | |
| 55 | +}; | |
| 11 | 56 | |
| 12 | -//#region modules/pro-install/assets/js/pro-install-events.js | |
| 13 | - function getDispatchEvent() { | |
| 14 | - var _window$elementorComm; | |
| 15 | - var _window$elementorComm2; | |
| 16 | - var _eventsManager$dispat; | |
| 17 | - if (!((_window$elementorComm = window.elementorCommon) === null || _window$elementorComm === void 0 || (_window$elementorComm = _window$elementorComm.config) === null || _window$elementorComm === void 0 || (_window$elementorComm = _window$elementorComm.experimentalFeatures) === null || _window$elementorComm === void 0 ? void 0 : _window$elementorComm.editor_events)) return null; | |
| 18 | - var eventsManager = (_window$elementorComm2 = window.elementorCommon) === null || _window$elementorComm2 === void 0 ? void 0 : _window$elementorComm2.eventsManager; | |
| 19 | - return (eventsManager === null || eventsManager === void 0 || (_eventsManager$dispat = eventsManager.dispatchEvent) === null || _eventsManager$dispat === void 0 ? void 0 : _eventsManager$dispat.bind(eventsManager)) || null; | |
| 20 | - } | |
| 21 | - function trackEditorEvent(eventName, eventData) { | |
| 22 | - var dispatchEvent = getDispatchEvent(); | |
| 23 | - if (!dispatchEvent) return; | |
| 24 | - dispatchEvent(eventName, eventData); | |
| 25 | - } | |
| 26 | - window.trackUpgradeNowClickEvent = function() { | |
| 27 | - trackEditorEvent("upgrade_subscription", { | |
| 28 | - location: "Elementor WP-admin pages", | |
| 29 | - secondaryLocation: "Connect account page", | |
| 30 | - trigger: "click" | |
| 31 | - }); | |
| 32 | - }; | |
| 33 | - window.trackConnectAccountEvent = function() { | |
| 34 | - Promise.resolve(trackEditorEvent("connect_account", { | |
| 35 | - location: "Elementor WP-admin pages", | |
| 36 | - secondaryLocation: "Connect account page", | |
| 37 | - trigger: "click" | |
| 38 | - })).catch(function() {}); | |
| 39 | - }; | |
| 40 | - window.trackOpenConnectPageEvent = function() { | |
| 41 | - trackEditorEvent("open_connect_page", { | |
| 42 | - location: "Elementor WP-admin pages", | |
| 43 | - secondaryLocation: "Connect account page", | |
| 44 | - trigger: "page_load" | |
| 45 | - }); | |
| 46 | - }; | |
| 47 | - window.trackProInstallEvent = function() { | |
| 48 | - trackEditorEvent("pro_install", { | |
| 49 | - location: "Elementor WP-admin pages", | |
| 50 | - secondaryLocation: "Connect account page", | |
| 51 | - trigger: "click" | |
| 52 | - }); | |
| 53 | - }; | |
| 54 | - document.addEventListener("DOMContentLoaded", function() { | |
| 55 | - window.trackOpenConnectPageEvent(); | |
| 56 | - var upgradeButton = document.querySelector(".elementor-pro-connect-promotion .elementor-box-action .button-upgrade"); | |
| 57 | - if (upgradeButton) upgradeButton.addEventListener("click", window.trackUpgradeNowClickEvent); | |
| 58 | - var connectButton = document.querySelector("#elementor-connect-license"); | |
| 59 | - if (connectButton) connectButton.addEventListener("click", window.trackConnectAccountEvent); | |
| 60 | - var proInstallButton = document.querySelector("#elementor-connect-install-pro"); | |
| 61 | - if (proInstallButton) proInstallButton.addEventListener("click", window.trackProInstallEvent); | |
| 62 | - }); | |
| 63 | - | |
| 64 | -//#endregion | |
| 65 | -})(); | |
| 57 | +// Attach events on DOM ready | |
| 58 | +document.addEventListener('DOMContentLoaded', function () { | |
| 59 | + window.trackOpenConnectPageEvent(); | |
| 60 | + var upgradeButton = document.querySelector('.elementor-pro-connect-promotion .elementor-box-action .button-upgrade'); | |
| 61 | + if (upgradeButton) { | |
| 62 | + upgradeButton.addEventListener('click', window.trackUpgradeNowClickEvent); | |
| 63 | + } | |
| 64 | + var connectButton = document.querySelector('#elementor-connect-license'); | |
| 65 | + if (connectButton) { | |
| 66 | + connectButton.addEventListener('click', window.trackConnectAccountEvent); | |
| 67 | + } | |
| 68 | + var proInstallButton = document.querySelector('#elementor-connect-install-pro'); | |
| 69 | + if (proInstallButton) { | |
| 70 | + proInstallButton.addEventListener('click', window.trackProInstallEvent); | |
| 71 | + } | |
| 72 | +}); | |
| 73 | +/******/ })() | |
| 74 | +; | |
| 66 | 75 | //# sourceMappingURL=pro-install-events.js.map |