/*! For license information please see editor-elements.js.LICENSE.txt */
!function(){"use strict";var e={"@elementor/editor-v1-adapters":function(e){e.exports=window.elementorV2.editorV1Adapters}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};!function(){n.r(r),n.d(r,{getElementSetting:function(){return u},getElementStyles:function(){return c},getElements:function(){return w},getSelectedElements:function(){return g},getVariantByMeta:function(){return m},getWidgetsCache:function(){return p},isElementInContainer:function(){return y},updateSettings:function(){return E},updateStyle:function(){return _},useElementSetting:function(){return s},useElementStyleProp:function(){return d},useElementStyles:function(){return a},useElementType:function(){return f},useElementsDomRef:function(){return i},useSelectedElement:function(){return v}});var e=n("@elementor/editor-v1-adapters");function t(){const e=window;return e.elementor?.documents?.getCurrent?.()?.container??null}var o="data-atomic";function i(){return(0,e.__privateUseListenTo)([(0,e.windowEvent)("elementor/preview/atomic-widget/render"),(0,e.windowEvent)("elementor/preview/atomic-widget/destroy"),(0,e.windowEvent)("elementor/editor/element-rendered"),(0,e.windowEvent)("elementor/editor/element-destroyed")],(()=>function(){const e=t();return e?.view?[...e.view.el.querySelectorAll(`[${o}]`)]:[]}()))}function l(e){const t=window,n=t.elementor?.getContainer?.(e);return n??null}var u=(e,t)=>{const n=l(e),r=n?.settings?.get(t);return r??null},s=(t,n)=>(0,e.__privateUseListenTo)((0,e.commandEndEvent)("document/elements/set-settings"),(()=>u(t,n)),[t,n]),c=e=>{const t=l(e);return t?.model.get("styles")||null},d=({elementID:t,styleDefID:n,meta:r,propName:o})=>(0,e.__privateUseListenTo)((0,e.commandEndEvent)("document/atomic-widgets/styles"),(()=>{if(!n)return null;const e=c(t)?.[n];if(!e)return null;const i=m(e,r);return i?.props[o]??null}),[t,n,o,r]);function m(e,t){return e.variants.find((e=>e.meta.breakpoint===t.breakpoint&&e.meta.state===t.state))}function a(t){return(0,e.__privateUseListenTo)((0,e.commandEndEvent)("document/atomic-widgets/styles"),(()=>c(t)??{}),[t])}function p(){const e=window;return e?.elementor?.widgetsCache||null}function f(t){return(0,e.__privateUseListenTo)((0,e.commandEndEvent)("editor/documents/load"),(()=>{if(!t)return null;const e=p(),n=e?.[t];return n?.atomic_controls&&n?.atomic_props_schema?{key:t,controls:n.atomic_controls,propsSchema:n.atomic_props_schema,title:n.title}:null}),[t])}function g(){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 v(){const t=(0,e.__privateUseListenTo)([(0,e.commandEndEvent)("document/elements/select"),(0,e.commandEndEvent)("document/elements/deselect")],g),[n]=t,r=f(n?.type);return 1===t.length&&r?{element:n,elementType:r}:{element:null,elementType:null}}function w(e){const n=e?l(e):t();if(!n)return[];const r=n.children?.flatMap((e=>w(e.id)))??[];return[n,...r]}var y=(e,t)=>t.model.get("id")===e.id&&t.model.get("widgetType")===e.type||!!(t.children&&t.children.length>0)&&t.children.some((t=>y(e,t))),E=({id:t,props:n})=>{const r=l(t);(0,e.__privateRunCommand)("document/elements/settings",{container:r,settings:{...n}})},_=async({elementID:t,styleDefID:n,meta:r,props:o,bind:i,label:u})=>{const s=l(t);await(0,e.__privateRunCommand)("document/atomic-widgets/styles",{container:s,styleDefID:n,bind:i,meta:r,props:o,label:u})}}(),(window.elementorV2=window.elementorV2||{}).editorElements=r}();