!function(){"use strict";var e={d:function(t,n){for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{ELEMENT_STYLE_CHANGE_EVENT:function(){return k},createElement:function(){return g},createElementStyle:function(){return W},createElements:function(){return C},deleteElement:function(){return v},deleteElementStyle:function(){return F},dropElement:function(){return U},duplicateElement:function(){return S},duplicateElements:function(){return b},generateElementId:function(){return A},getAnchoredAncestorId:function(){return X},getAnchoredDescendantId:function(){return Q},getContainer:function(){return o},getCurrentDocumentContainer:function(){return $},getCurrentDocumentId:function(){return D},getElementEditorSettings:function(){return E},getElementLabel:function(){return j},getElementSetting:function(){return i},getElementSettings:function(){return s},getElementStyles:function(){return O},getElementType:function(){return u},getElements:function(){return L},getLinkInLinkRestriction:function(){return K},getSelectedElements:function(){return m},getWidgetsCache:function(){return c},isElementAnchored:function(){return Z},moveElement:function(){return y},moveElements:function(){return _},removeElements:function(){return T},replaceElement:function(){return J},selectElement:function(){return r},shouldCreateNewLocalStyle:function(){return Y},styleRerenderEvents:function(){return M},updateElementEditorSettings:function(){return I},updateElementSettings:function(){return V},updateElementStyle:function(){return z},useElementChildren:function(){return f},useElementEditorSettings:function(){return w},useElementSetting:function(){return l},useElementSettings:function(){return d},useParentElement:function(){return p},useSelectedElement:function(){return a}});var n=window.elementorV2.editorV1Adapters;function o(e){const t=window,n=t.elementor?.getContainer?.(e);return n??null}const r=e=>{try{const t=o(e);(0,n.__privateRunCommand)("document/elements/select",{container:t})}catch{}},i=(e,t)=>{const n=o(e);return n?.settings?.get(t)??null},s=(e,t)=>Object.fromEntries(t.map(t=>[t,i(e,t)])),l=(e,t)=>(0,n.__privateUseListenTo)((0,n.commandEndEvent)("document/elements/set-settings"),()=>i(e,t),[e,t]),d=(e,t)=>(0,n.__privateUseListenTo)((0,n.commandEndEvent)("document/elements/set-settings"),()=>t.reduce((t,n)=>{const o=i(e,n);return null!==o&&(t[n]=o),t},{}),[e,t.join(",")]);function c(){const e=window;return e?.elementor?.widgetsCache||null}function u(e){if(!e)return null;const t=c(),n=t?.[e];return n?.atomic_controls&&n?.atomic_props_schema?{key:e,controls:n.atomic_controls,propsSchema:n.atomic_props_schema,dependenciesPerTargetMapping:n.dependencies_per_target_mapping??{},title:n.title}:null}function m(){const e=window;return(e.elementor?.selection?.getElements?.()??[]).reduce((e,t)=>{const n=t.model.get("widgetType")||t.model.get("elType");return n&&e.push({id:t.model.get("id"),type:n}),e},[])}function a(){const e=(0,n.__privateUseListenTo)([(0,n.commandEndEvent)("document/elements/select"),(0,n.commandEndEvent)("document/elements/deselect"),(0,n.commandEndEvent)("document/elements/select-all"),(0,n.commandEndEvent)("document/elements/deselect-all")],m),[t]=e,o=u(t?.type);return 1===e.length&&o?{element:t,elementType:o}:{element:null,elementType:null}}function p(e){return(0,n.__privateUseListenTo)([(0,n.commandEndEvent)("document/elements/create")],()=>{if(!e)return null;const t=window,n=t?.elementor?.getContainer?.(e);return n?n.parent:null},[e])}function f(e,t){return(0,n.__privateUseListenTo)([(0,n.v1ReadyEvent)(),(0,n.commandEndEvent)("document/elements/create"),(0,n.commandEndEvent)("document/elements/delete"),(0,n.commandEndEvent)("document/elements/update"),(0,n.commandEndEvent)("document/elements/set-settings")],()=>{const n=o(e),r=t.reduce((e,t)=>(e[t]=[],e),{});return n?.children?.forEachRecursive?.(({model:e,id:t})=>{const n=e.get("elType");n&&n in r&&r[n].push({id:t})}),r},[e])}function E(e){const t=o(e);return t?.model.get("editor_settings")??{}}const w=e=>(0,n.__privateUseListenTo)((0,n.windowEvent)("elementor/element/update_editor_settings"),()=>E(e),[e]);function g({containerId:e,model:t,options:r}){const i=o(e);if(!i)throw new Error(`Container with ID "${e}" not found`);return(0,n.__privateRunCommandSync)("document/elements/create",{container:i,model:t,options:{edit:!1,...r}})}const I=({elementId:e,settings:t})=>{const r=o(e);if(!r)throw new Error(`Element with id ${e} not found`);const i=r.model.get("editor_settings")??{};r.model.set("editor_settings",{...i,...t}),(0,n.__privateRunCommandSync)("document/save/set-is-modified",{status:true},{internal:!0})};function v({elementId:e,options:t={}}){const r=o(e);if(!r)throw new Error(`Element with ID "${e}" not found`);(0,n.__privateRunCommand)("document/elements/delete",{container:r,options:t})}function y({elementId:e,targetContainerId:t,options:n={}}){const r=o(e),i=o(t);if(!r)throw new Error(`Element with ID "${e}" not found`);if(!i)throw new Error(`Target container with ID "${t}" not found`);const s=r.model.toJSON();return v({elementId:e,options:{...n,useHistory:!1}}),g({containerId:t,model:s,options:{edit:!1,...n,useHistory:!1}})}var h=window.wp.i18n;const _=({moves:e,title:t,subtitle:r=(0,h.__)("Elements moved","elementor")})=>(0,n.undoable)({do:({moves:e})=>{const t=[];return e.forEach(e=>{const{elementId:n}=e,r=o(n);if(!r)throw new Error(`Element with ID "${n}" not found`);const i={elementId:n,originalContainerId:r.parent?.id||"",originalIndex:r.parent?.children?.indexOf(r)??-1},s=y({...e,options:{...e.options,useHistory:!1}});t.push({elementId:n,originalPosition:i,move:e,element:s})}),{movedElements:t}},undo:(e,{movedElements:t})=>{[...t].reverse().forEach(({originalPosition:e})=>{const{elementId:t,originalContainerId:n,originalIndex:o}=e;y({elementId:t,targetContainerId:n,options:{useHistory:!1,at:o>=0?o:void 0}})})},redo:(e,{movedElements:t})=>{const n=[];return t.forEach(({move:e,originalPosition:t})=>{const o=y({...e,options:{...e.options,useHistory:!1}});n.push({elementId:e.elementId,originalPosition:t,move:e,element:o})}),{movedElements:n}}},{title:t,subtitle:r})({moves:e});function S({elementId:e,options:t={}}){const n=o(e);if(!n)throw new Error(`Element with ID "${e}" not found`);if(!n.parent)throw new Error(`Element with ID "${e}" has no parent container`);const r=n.parent,i=n.model.toJSON(),s=n.view?._index??0,l=!1!==t.clone?s+1:void 0;return g({containerId:r.id,model:i,options:{at:l,...t}})}const C=({elements:e,title:t,subtitle:r=(0,h.__)("Item added","elementor")})=>(0,n.undoable)({do:({elements:e})=>{const t=[];return e.forEach(e=>{const{options:n,...o}=e,r=g({...o,options:{...n,useHistory:!1}}),i=r.id;t.push({elementId:i,model:r.model?.toJSON()||{},createParams:{...e}})}),{createdElements:t}},undo:(e,{createdElements:t})=>{[...t].reverse().forEach(({elementId:e})=>{v({elementId:e,options:{useHistory:!1}})})},redo:(e,{createdElements:t})=>{const n=[];return t.forEach(({createParams:e,model:t})=>{const r=g({containerId:e.containerId,model:t,options:{...e.options,useHistory:!1}}).id,i=o(r);i&&n.push({elementId:r,model:i.model.toJSON(),createParams:e})}),{createdElements:n}}},{title:t,subtitle:r})({elements:e}),b=({elementIds:e,title:t,subtitle:r=(0,h.__)("Item duplicated","elementor"),onCreate:i})=>(0,n.undoable)({do:({elementIds:e})=>{const t=e.reduce((e,t)=>{const n=o(t);if(n?.parent){const n=S({elementId:t,options:{useHistory:!1,clone:!0}});e.push({id:n.id,model:n.model.toJSON(),originalElementId:t,modelToRestore:n.model.toJSON(),parentContainerId:n.parent?.id,at:n.view?._index})}return e},[]);return i?.(t),{duplicatedElements:t}},undo:(e,{duplicatedElements:t})=>{[...t].reverse().forEach(({id:e})=>{v({elementId:e,options:{useHistory:!1}})})},redo:(e,{duplicatedElements:t})=>{const n=t.reduce((e,t)=>{if(t.modelToRestore&&t.parentContainerId){const n=g({containerId:t.parentContainerId,model:t.modelToRestore,options:{useHistory:!1,clone:!1,at:t.at}});e.push({id:n.id,model:n.model.toJSON(),originalElementId:t.originalElementId,modelToRestore:t.modelToRestore,parentContainerId:t.parentContainerId,at:t.at})}return e},[]);return i?.(n),{duplicatedElements:n}}},{title:t,subtitle:r})({elementIds:e}),T=({elementIds:e,title:t,subtitle:r=(0,h.__)("Item removed","elementor")})=>(0,n.undoable)({do:({elementIds:e})=>{const t=[];return e.forEach(e=>{const n=o(e);if(n){const o=n.model.toJSON(),r=n.parent,i=n.view?._index??0;t.push({elementId:e,model:o,parent:r??null,at:i})}}),e.forEach(e=>{v({elementId:e,options:{useHistory:!1}})}),{elementIds:e,removedElements:t}},undo:(e,{removedElements:t})=>{[...t].reverse().forEach(({model:e,parent:t,at:n})=>{t&&e&&g({containerId:t.id,model:e,options:{useHistory:!1,at:n}})})},redo:(e,{elementIds:t,removedElements:n})=>(t.forEach(e=>{v({elementId:e,options:{useHistory:!1}})}),{elementIds:t,removedElements:n})},{title:t,subtitle:r})({elementIds:e}),O=e=>{const t=o(e);return t?.model.get("styles")||null};var H=window.elementorV2.utils;const R=(0,H.createError)({code:"element_not_found",message:"Element not found."}),P=(0,H.createError)({code:"style_not_found",message:"Style not found."}),x=(0,H.createError)({code:"element_type_not_exists",message:"Element type does not exist."}),N=(0,H.createError)({code:"element_label_not_exists",message:"Element label does not exist."});function j(e){e||(e=m()?.[0]?.id);const t=o(e),n=t?.model.get("widgetType")||t?.model.get("elType");if(!n)throw new x({context:{elementId:e}});const r=c()?.[n]?.title;if(!r)throw new N({context:{elementType:n}});return r}function $(){const e=window;return e.elementor?.documents?.getCurrent?.()?.container??null}function L(e){const t=e?o(e):$();if(!t)return[];const n=[...t.model.get("elements")??[]].flatMap(e=>L(e.get("id")));return[t,...n]}function D(){const e=window;return e.elementor?.documents?.getCurrentId?.()??null}const V=({id:e,props:t,withHistory:r=!0})=>{const i={container:o(e),settings:{...t}};r?(0,n.__privateRunCommandSync)("document/elements/settings",i):(0,n.__privateRunCommandSync)("document/elements/set-settings",i,{internal:!0})},A=()=>{const e=window;return e.elementorCommon?.helpers?.getUniqueId?.()??`el-${Date.now()}-${Math.random().toString(36).substring(2,9)}`},J=({currentElement:e,newElement:t,withHistory:n=!0})=>{const{containerId:r,index:i}=function(e,t){let n;const r=o(e.id)?.parent;if(!r)throw new Error(`Parent not found for element ${e.id}. Cannot replace element.`);const i=e.view?._index??0;if(void 0===i||-1===i)throw new Error(`Element ${e.id} not found in parent container. Cannot replace element.`);return n={containerId:r.id,index:i},"document"===r.id&&"widget"===t.elType&&(n=function(e,t){return{containerId:g({containerId:e,model:{elType:"container"},options:{at:t,useHistory:!1}}).id,index:0}}(r.id,i)),n}(e,t);g({containerId:r,model:t,options:{at:i,useHistory:n}}),v({elementId:e.id,options:{useHistory:n}})};function U({containerId:e,model:t,options:r}){const i=o(e);if(!i)throw new Error(`Container with ID "${e}" not found`);return(0,n.__privateRunCommandSync)("preview/drop",{container:i,model:t,options:r})}const k="elementor/editor-v2/editor-elements/style",M=[(0,n.commandEndEvent)("document/elements/create"),(0,n.commandEndEvent)("document/elements/duplicate"),(0,n.commandEndEvent)("document/elements/import"),(0,n.commandEndEvent)("document/elements/paste"),(0,n.windowEvent)(k)];var q=window.elementorV2.editorProps,B=window.elementorV2.editorStyles;function G(e,t){const r=o(e);if(!r)throw new R({context:{elementId:e}});const i=Object.keys(r.model.get("styles")??{}),s=function(e,t){const n=structuredClone(e.model.get("styles"))??{},o=Object.entries(t(n)).map(([e,t])=>(t.variants=function(e){return e.variants.filter(({props:e,custom_css:t})=>Object.keys(e).length>0||t?.raw)}(t),[e,t])).filter(([,e])=>!function(e){return 0===e.variants.length}(e)),r=Object.fromEntries(o);return e.model.set("styles",r),r}(r,t);return function(e,{oldIds:t,newIds:n}){const o=t.filter(e=>!n.includes(e)),r=structuredClone(function(e){return Object.entries(e.settings.toJSON()).filter(e=>{const[,t]=e;return q.classesPropTypeUtil.isValid(t)})}(e));r.forEach(([,e])=>{e.value=e.value.filter(e=>!o.includes(e))}),V({id:e.id,props:Object.fromEntries(r),withHistory:!1})}(r,{oldIds:i,newIds:Object.keys(s)}),window.dispatchEvent(new CustomEvent(k)),(0,n.__privateRunCommandSync)("document/save/set-is-modified",{status:!0},{internal:!0}),s}function W({styleId:e,elementId:t,classesProp:n,label:o,meta:r,props:s,custom_css:l=null,additionalVariants:d=[]}){let c=e;return G(t,e=>{c??=(0,B.generateId)(`e-${t}-`,Object.keys(e));const u=[{meta:r,props:s,custom_css:l},...d];return e[c]={id:c,label:o,type:"class",variants:u},function(e,t,n){const o=i(e,t),r=q.classesPropTypeUtil.create(e=>[...e??[],n],{base:o});V({id:e,props:{[t]:r},withHistory:!1})}(t,n,c),e}),c}function Y(e){return!e?.styleId&&!e?.provider}function z(e){G(e.elementId,t=>{const n=t[e.styleId];if(!n)throw new P({context:{styleId:e.styleId}});const o=(0,B.getVariantByMeta)(n,e.meta),r=("custom_css"in e?e.custom_css:o?.custom_css)??null;return o?(o.props=(0,q.mergeProps)(o.props,e.props),o.custom_css=r?.raw?r:null):n.variants.push({meta:e.meta,props:e.props,custom_css:r}),t})}function F(e,t){G(e,e=>(delete e[t],e))}function K(e){const t=Q(e);if(t)return{shouldRestrict:!0,reason:"descendant",elementId:t};const n=X(e);return n?{shouldRestrict:!0,reason:"ancestor",elementId:n}:{shouldRestrict:!1}}function Q(e){const t=ne(e);if(!t)return null;for(const n of Array.from(t.querySelectorAll("a"))){const t=te(n);if(t!==e)return t}return null}function X(e){const t=ne(e);if(!t||null===t.parentElement)return null;const n=t.parentElement.closest("a");return n?te(n):null}function Z(e){const t=ne(e);return!!t&&(!!oe(t.tagName)||ee(t))}function ee(e){for(const t of e.children)if(!re(t)){if(oe(t.tagName))return!0;if(ee(t))return!0}return!1}function te(e){return e.closest("[data-id]")?.dataset.id||null}function ne(e){try{return o(e)?.view?.el||null}catch{return null}}function oe(e){return"a"===e.toLowerCase()}function re(e){return e.hasAttribute("data-id")}(window.elementorV2=window.elementorV2||{}).editorElements=t}(),window.elementorV2.editorElements?.init?.();