/*! For license information please see events.js.LICENSE.txt */
!function(){"use strict";var n={"./packages/packages/libs/events/src/use-mixpanel.ts":function(n,e,i){i.r(e),i.d(e,{canSendEvents:function(){return canSendEvents},enableTracking:function(){return enableTracking},getMixpanel:function(){return getMixpanel},initializeAndEnableTracking:function(){return initializeAndEnableTracking},initializeMixpanel:function(){return initializeMixpanel},isMixpanelReady:function(){return isMixpanelReady},isTrackingEnabled:function(){return isTrackingEnabled},setCanSendEvents:function(){return setCanSendEvents},trackEvent:function(){return trackEvent},useMixpanel:function(){return useMixpanel}});const getMixpanel=()=>{const n=window.elementorCommon?.eventsManager||{};return{dispatchEvent:n.dispatchEvent?.bind(n),config:n.config,canSendEvents:n.canSendEvents?.bind(n),initializeMixpanel:n.initializeMixpanel?.bind(n),enableTracking:n.enableTracking?.bind(n),isMixpanelReady:n.isMixpanelReady?.bind(n),trackingEnabled:n.trackingEnabled??!1,getMixpanelInstance:n.getMixpanelInstance?.bind(n)}},useMixpanel=()=>{const{dispatchEvent:n,config:e}=getMixpanel();return{dispatchEvent:n,config:e}},trackEvent=n=>{const{dispatchEvent:e}=getMixpanel();e?.(n.eventName,n)},canSendEvents=()=>getMixpanel().canSendEvents?.()??!1,setCanSendEvents=n=>{const e=window.elementorCommon?.config?.editor_events;e&&(e.can_send_events=n)},isMixpanelReady=()=>getMixpanel().isMixpanelReady?.()??!1,isTrackingEnabled=()=>getMixpanel().trackingEnabled,enableTracking=()=>getMixpanel().enableTracking?.(),initializeMixpanel=n=>getMixpanel().initializeMixpanel?.(n??(()=>{}));function initializeAndEnableTracking(n){const e=getMixpanel();if(e.dispatchEvent){if(!e.trackingEnabled)return e.isMixpanelReady?.()?(e.enableTracking?.(),void n?.(e.getMixpanelInstance?.())):void e.initializeMixpanel?.(i=>{e.enableTracking?.(),n?.(i)});n?.(e.getMixpanelInstance?.())}}}},e={};function __webpack_require__(i){var t=e[i];if(void 0!==t)return t.exports;var a=e[i]={exports:{}};return n[i](a,a.exports,__webpack_require__),a.exports}__webpack_require__.d=function(n,e){for(var i in e)__webpack_require__.o(e,i)&&!__webpack_require__.o(n,i)&&Object.defineProperty(n,i,{enumerable:!0,get:e[i]})},__webpack_require__.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},__webpack_require__.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})};var i={};!function(){__webpack_require__.r(i),__webpack_require__.d(i,{canSendEvents:function(){return n.canSendEvents},enableTracking:function(){return n.enableTracking},getMixpanel:function(){return n.getMixpanel},initializeAndEnableTracking:function(){return n.initializeAndEnableTracking},initializeMixpanel:function(){return n.initializeMixpanel},isMixpanelReady:function(){return n.isMixpanelReady},isTrackingEnabled:function(){return n.isTrackingEnabled},setCanSendEvents:function(){return n.setCanSendEvents},trackEvent:function(){return n.trackEvent},useMixpanel:function(){return n.useMixpanel}});var n=__webpack_require__("./packages/packages/libs/events/src/use-mixpanel.ts")}(),(window.elementorV2=window.elementorV2||{}).events=i}(),window.elementorV2.events?.init?.();
//# sourceMappingURL=events.js.map