/*! For license information please see frontend-handlers.js.LICENSE.txt */
!function(){"use strict";var e={"./packages/packages/core/frontend-handlers/src/handlers-registry.ts":function(e,n,t){t.r(n),t.d(n,{handlers:function(){return r},register:function(){return register},unregister:function(){return unregister}});const r=new Map,register=({elementType:e,id:n,callback:t})=>{r.has(e)||r.set(e,new Map),r.get(e)?.has(n)||r.get(e)?.set(n,t)},unregister=({elementType:e,id:n})=>{r.has(e)&&(n?(r.get(e)?.delete(n),0===r.get(e)?.size&&r.delete(e)):r.delete(e))}},"./packages/packages/core/frontend-handlers/src/init.ts":function(e,n,t){t.r(n),t.d(n,{init:function(){return init}});var r=t("./packages/packages/core/frontend-handlers/src/lifecycle-events.ts");function init(){window.addEventListener("elementor/element/render",e=>{const n=e,{id:t,type:o,element:a}=n.detail;(0,r.onElementDestroy)({elementType:o,elementId:t}),(0,r.onElementRender)({element:a,elementType:o,elementId:t})}),window.addEventListener("elementor/element/destroy",e=>{const n=e,{id:t,type:o}=n.detail;(0,r.onElementDestroy)({elementType:o,elementId:t})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll("[data-e-type]").forEach(e=>{const n=e,{eType:t,id:r}=n.dataset;t&&r&&window.dispatchEvent(new CustomEvent("elementor/element/render",{detail:{id:r,type:t,element:e}}))})})}},"./packages/packages/core/frontend-handlers/src/lifecycle-events.ts":function(e,n,t){t.r(n),t.d(n,{onElementDestroy:function(){return onElementDestroy},onElementRender:function(){return onElementRender}});var r=t("./packages/packages/core/frontend-handlers/src/handlers-registry.ts");const o=new Map,onElementRender=({element:e,elementType:n,elementId:t})=>{const a=new AbortController,s=[];r.handlers.has(n)&&(Array.from(r.handlers.get(n)?.values()??[]).forEach(n=>{const t=n({element:e,signal:a.signal});"function"==typeof t&&s.push(t)}),o.has(n)||o.set(n,new Map),o.get(n)?.set(t,()=>{a.abort(),s.forEach(e=>e())}))},onElementDestroy=({elementType:e,elementId:n})=>{const t=o.get(e)?.get(n);t&&(t(),o.get(e)?.delete(n),0===o.get(e)?.size&&o.delete(e))}}},n={};function __webpack_require__(t){var r=n[t];if(void 0!==r)return r.exports;var o=n[t]={exports:{}};return e[t](o,o.exports,__webpack_require__),o.exports}__webpack_require__.d=function(e,n){for(var t in n)__webpack_require__.o(n,t)&&!__webpack_require__.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},__webpack_require__.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var t={};!function(){__webpack_require__.r(t),__webpack_require__.d(t,{init:function(){return n.init},register:function(){return e.register},unregister:function(){return e.unregister}});var e=__webpack_require__("./packages/packages/core/frontend-handlers/src/handlers-registry.ts"),n=__webpack_require__("./packages/packages/core/frontend-handlers/src/init.ts")}(),(window.elementorV2=window.elementorV2||{}).frontendHandlers=t}(),window.elementorV2.frontendHandlers?.init?.();
//# sourceMappingURL=frontend-handlers.js.map