← All changes
|
assets/js/packages/editor-canvas/editor-canvas.min.js
+198
-2
4.1.0-dev3
→
trunk
View file →
| @@ -1,2 +1,198 @@ | ||
| 1 | -/*! For license information please see editor-canvas.min.js.LICENSE.txt */ | |
| 2 | -!function(){"use strict";var e,t,n={1020:function(e,t,n){var r=n(7557),o=Symbol.for("react.element"),i=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),s=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function l(e,t,n){var r,l={},c=null,u=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)i.call(t,r)&&!a.hasOwnProperty(r)&&(l[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===l[r]&&(l[r]=t[r]);return{$$typeof:o,type:e,key:c,ref:u,props:l,_owner:s.current}}t.jsx=l,t.jsxs=l},3617:function(e){e.exports=window.ReactDOM},4848:function(e,t,n){e.exports=n(1020)},5338:function(e,t,n){var r=n(3617);t.H=r.createRoot,r.hydrateRoot},7557:function(e){e.exports=window.React}},r={};function o(e){var t=r[e];if(void 0!==t)return t.exports;var i=r[e]={exports:{}};return n[e](i,i.exports,o),i.exports}t=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},o.t=function(n,r){if(1&r&&(n=this(n)),8&r)return n;if("object"==typeof n&&n){if(4&r&&n.__esModule)return n;if(16&r&&"function"==typeof n.then)return n}var i=Object.create(null);o.r(i);var s={};e=e||[null,t({}),t([]),t(t)];for(var a=2&r&&n;("object"==typeof a||"function"==typeof a)&&!~e.indexOf(a);a=t(a))Object.getOwnPropertyNames(a).forEach(function(e){s[e]=function(){return n[e]}});return s.default=function(){return n},o.d(i,s),i},o.d=function(e,t){for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};o.r(i),o.d(i,{BREAKPOINTS_SCHEMA_URI:function(){return a},DOCUMENT_STRUCTURE_URI:function(){return es},GLOBAL_STYLES_IMPORTED_EVENT:function(){return ta},STYLE_SCHEMA_URI:function(){return b},UnknownStyleStateError:function(){return On},UnknownStyleTypeError:function(){return kn},WIDGET_SCHEMA_URI:function(){return v},canBeNestedTemplated:function(){return yi},createNestedTemplatedElementType:function(){return vi},createNestedTemplatedElementView:function(){return Ei},createPropsResolver:function(){return xn},createTemplatedElementView:function(){return gi},createTransformer:function(){return ur},createTransformersRegistry:function(){return _n},doAfterRender:function(){return na},endDragElementFromPanel:function(){return Xs},init:function(){return qs},isAtomicWidget:function(){return Us},registerElementType:function(){return Xi},registerModelExtensions:function(){return Yi},settingsTransformersRegistry:function(){return cr},startDragElementFromPanel:function(){return Ks},styleTransformersRegistry:function(){return An},stylesInheritanceTransformersRegistry:function(){return Rn}});var s=window.elementorV2.editorV1Adapters;const a="elementor://breakpoints/list";var l=window.elementorV2.editorElements,c=window.elementorV2.editorMcp,u=window.elementorV2.editorProps,d=window.elementorV2.editorStyles;function m(e){const t=e?.default_children;return Array.isArray(t)?t.filter(e=>e?.meta?.required??!1):[]}function p(e){return"object"==typeof e&&null!==e&&Object.keys(e).length>0}function f(e){return!!e&&!1!==e.meta?.llm_support&&"Component"!==e.title&&(!!e.atomic_props_schema||p(e.controls))}function h(e){return e?.atomic_props_schema?"v4":"v3"}function g(){const e=(0,l.getWidgetsCache)()??{};return Object.keys(e).filter(t=>f(e[t])).sort().map(t=>{const n=e[t],r="string"==typeof n?.meta?.description?n.meta.description:void 0;return{type:t,version:h(n),...r&&{description:r}}})}const y=new Set(["section","tab","tabs"]),v="elementor://widgets/schema/{widgetType}",b="elementor://styles/schema/{category}",w="elementor://styles/best-practices";var E=window.elementorV2.editor,T=o(7557),S=o.t(T,2),C=window.elementorV2.editorDocuments,x=window.elementorV2.editorStylesRepository,_=window.elementorV2.utils;const R=()=>((0,T.useEffect)(()=>{const e=A();return()=>{e()}},[]),null),A=()=>x.stylesRepository.subscribe((e,t)=>{e&&t&&Object.keys(t).forEach(n=>{if(!e[n]||(0,_.hash)(e[n])===(0,_.hash)(t[n]))return;const r=e[n],o=t[n];r.label!==o.label&&k(r.label,o.label)})}),k=(e,t)=>{Object.values((0,C.getV1DocumentsManager)().documents).forEach(n=>{const r=n.container;r.view?.el?.querySelectorAll(`.elementor .${e}`).forEach(n=>{n.classList.replace(e,t)})})};var O=window.elementorV2.ui;function P(){return"undefined"!=typeof window}function I(e){return $(e)?(e.nodeName||"").toLowerCase():"#document"}function N(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function L(e){var t;return null==(t=($(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function $(e){return!!P()&&(e instanceof Node||e instanceof N(e).Node)}function M(e){return!!P()&&(e instanceof Element||e instanceof N(e).Element)}function D(e){return!!P()&&(e instanceof HTMLElement||e instanceof N(e).HTMLElement)}function j(e){return!(!P()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof N(e).ShadowRoot)}function V(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=X(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&"inline"!==o&&"contents"!==o}function z(e){return/^(table|td|th)$/.test(I(e))}function U(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}const F=/transform|translate|scale|rotate|perspective|filter/,W=/paint|layout|strict|content/,B=e=>!!e&&"none"!==e;let H;function G(e){const t=M(e)?X(e):e;return B(t.transform)||B(t.translate)||B(t.scale)||B(t.rotate)||B(t.perspective)||!q()&&(B(t.backdropFilter)||B(t.filter))||F.test(t.willChange||"")||W.test(t.contain||"")}function q(){return null==H&&(H="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),H}function Y(e){return/^(html|body|#document)$/.test(I(e))}function X(e){return N(e).getComputedStyle(e)}function K(e){return M(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function J(e){if("html"===I(e))return e;const t=e.assignedSlot||e.parentNode||j(e)&&e.host||L(e);return j(t)?t.host:t}function Z(e){const t=J(e);return Y(t)?e.ownerDocument?e.ownerDocument.body:e.body:D(t)&&V(t)?t:Z(t)}function Q(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=Z(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),s=N(o);if(i){const e=ee(s);return t.concat(s,s.visualViewport||[],V(o)?o:[],e&&n?Q(e):[])}return t.concat(o,Q(o,[],n))}function ee(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var te=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"].join(","),ne="undefined"==typeof Element,re=ne?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,oe=!ne&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},ie=function(e,t){var n;void 0===t&&(t=!0);var r=null==e||null===(n=e.getAttribute)||void 0===n?void 0:n.call(e,"inert");return""===r||"true"===r||t&&e&&("function"==typeof e.closest?e.closest("[inert]"):ie(e.parentNode))},se=function(e,t,n){for(var r=[],o=Array.from(e);o.length;){var i=o.shift();if(!ie(i,!1))if("SLOT"===i.tagName){var s=i.assignedElements(),a=s.length?s:i.children,l=se(a,!0,n);n.flatten?r.push.apply(r,l):r.push({scopeParent:i,candidates:l})}else{re.call(i,te)&&n.filter(i)&&(t||!e.includes(i))&&r.push(i);var c=i.shadowRoot||"function"==typeof n.getShadowRoot&&n.getShadowRoot(i),u=!ie(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(i));if(c&&u){var d=se(!0===c?i.children:c.children,!0,n);n.flatten?r.push.apply(r,d):r.push({scopeParent:i,candidates:d})}else o.unshift.apply(o,i.children)}}return r},ae=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},le=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!ae(e)?0:e.tabIndex},ce=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},ue=function(e){return"INPUT"===e.tagName},de=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},me=function(e,t){return!(t.disabled||function(e){return ue(e)&&"hidden"===e.type}(t)||function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("full-native"===n&&"checkVisibility"in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});if("hidden"===getComputedStyle(e).visibility)return!0;var o=re.call(e,"details>summary:first-of-type")?e.parentElement:e;if(re.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"full-native"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return de(e)}else{if("function"==typeof r){for(var i=e;e;){var s=e.parentElement,a=oe(e);if(s&&!s.shadowRoot&&!0===r(s))return de(e);e=e.assignedSlot?e.assignedSlot:s||a===e.ownerDocument?s:a.host}e=i}if(function(e){var t,n,r,o,i=e&&oe(e),s=null===(t=i)||void 0===t?void 0:t.host,a=!1;if(i&&i!==e)for(a=!!(null!==(n=s)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(s)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!a&&s;){var l,c,u;a=!(null===(c=s=null===(l=i=oe(s))||void 0===l?void 0:l.host)||void 0===c||null===(u=c.ownerDocument)||void 0===u||!u.contains(s))}return a}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1}(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some(function(e){return"SUMMARY"===e.tagName})}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!re.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},pe=function(e,t){return!(function(e){return function(e){return ue(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||oe(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!o||o===e}(e)}(t)||le(t)<0||!me(e,t))},fe=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},he=function(e){var t=[],n=[];return e.forEach(function(e,r){var o=!!e.scopeParent,i=o?e.scopeParent:e,s=function(e,t){var n=le(e);return n<0&&t&&!ae(e)?0:n}(i,o),a=o?he(e.candidates):i;0===s?o?t.push.apply(t,a):t.push(i):n.push({documentOrder:r,tabIndex:s,item:e,isScope:o,content:a})}),n.sort(ce).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},ge=function(e,t){var n;return n=(t=t||{}).getShadowRoot?se([e],t.includeContainer,{filter:pe.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:fe}):function(e,t,n){if(ie(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(te));return t&&re.call(e,te)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,pe.bind(null,t)),he(n)};function ye(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&j(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function ve(e){return(null==e?void 0:e.ownerDocument)||document}function be(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var we="undefined"!=typeof document?T.useLayoutEffect:function(){};function Ee(e){const t=T.useRef(e);return we(()=>{t.current=e}),t}const Te={...S}.useInsertionEffect||(e=>e());function Se(e){const t=T.useRef(()=>{});return Te(()=>{t.current=e}),T.useCallback(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)},[])}const Ce=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function xe(e,t){const n=ge(e,Ce()),r=n.length;if(0===r)return;const o=function(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement}return t}(ve(e)),i=n.indexOf(o);return n[-1===i?1===t?0:r-1:i+t]}function _e(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!ye(n,r)}function Re(e){ge(e,Ce()).forEach(e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")})}function Ae(e){e.querySelectorAll("[data-tabindex]").forEach(e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")})}var ke=o(4848),Oe=o(3617);const Pe=Math.min,Ie=Math.max,Ne=Math.round,Le=Math.floor,$e=e=>({x:e,y:e}),Me={left:"right",right:"left",bottom:"top",top:"bottom"};function De(e,t){return"function"==typeof e?e(t):e}function je(e){return e.split("-")[0]}function Ve(e){return e.split("-")[1]}function ze(e){return"y"===e?"height":"width"}function Ue(e){const t=e[0];return"t"===t||"b"===t?"y":"x"}function Fe(e){return"x"===Ue(e)?"y":"x"}function We(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Be=["left","right"],He=["right","left"],Ge=["top","bottom"],qe=["bottom","top"];function Ye(e){const t=je(e);return Me[t]+e.slice(t.length)}function Xe(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Ke(e,t,n){let{reference:r,floating:o}=e;const i=Ue(t),s=Fe(t),a=ze(s),l=je(t),c="y"===i,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,m=r[a]/2-o[a]/2;let p;switch(l){case"top":p={x:u,y:r.y-o.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-o.width,y:d};break;default:p={x:r.x,y:r.y}}switch(Ve(t)){case"start":p[s]-=m*(n&&c?-1:1);break;case"end":p[s]+=m*(n&&c?-1:1)}return p}async function Je(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:m=!1,padding:p=0}=De(t,e),f=function(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}(p),h=a[m?"floating"===d?"reference":"floating":d],g=Xe(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(h)))||n?h:h.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),y="floating"===d?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,v=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),b=await(null==i.isElement?void 0:i.isElement(v))&&await(null==i.getScale?void 0:i.getScale(v))||{x:1,y:1},w=Xe(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:v,strategy:l}):y);return{top:(g.top-w.top+f.top)/b.y,bottom:(w.bottom-g.bottom+f.bottom)/b.y,left:(g.left-w.left+f.left)/b.x,right:(w.right-g.right+f.right)/b.x}}const Ze=new Set(["left","top"]);function Qe(e){const t=X(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=D(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Ne(n)!==i||Ne(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function et(e){return M(e)?e:e.contextElement}function tt(e){const t=et(e);if(!D(t))return $e(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Qe(t);let s=(i?Ne(n.width):n.width)/r,a=(i?Ne(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const nt=$e(0);function rt(e){const t=N(e);return q()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:nt}function ot(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=et(e);let s=$e(1);t&&(r?M(r)&&(s=tt(r)):s=tt(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==N(e))&&t}(i,n,r)?rt(i):$e(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const e=N(i),t=r&&M(r)?N(r):r;let n=e,o=ee(n);for(;o&&r&&t!==n;){const e=tt(o),t=o.getBoundingClientRect(),r=X(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,s=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=i,c+=s,n=N(o),o=ee(n)}}return Xe({width:u,height:d,x:l,y:c})}function it(e,t){const n=K(e).scrollLeft;return t?t.left+n:ot(L(e)).left+n}function st(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-it(e,n),y:n.top+t.scrollTop}}function at(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=N(e),r=L(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const e=q();(!e||e&&"fixed"===t)&&(a=o.offsetLeft,l=o.offsetTop)}const c=it(r);if(c<=0){const e=r.ownerDocument,t=e.body,n=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,s=Math.abs(r.clientWidth-t.clientWidth-o);s<=25&&(i-=s)}else c<=25&&(i+=c);return{width:i,height:s,x:a,y:l}}(e,n);else if("document"===t)r=function(e){const t=L(e),n=K(e),r=e.ownerDocument.body,o=Ie(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Ie(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+it(e);const a=-n.scrollTop;return"rtl"===X(r).direction&&(s+=Ie(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}(L(e));else if(M(t))r=function(e,t){const n=ot(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=D(e)?tt(e):$e(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=rt(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Xe(r)}function lt(e,t){const n=J(e);return!(n===t||!M(n)||Y(n))&&("fixed"===X(n).position||lt(n,t))}function ct(e,t,n){const r=D(t),o=L(t),i="fixed"===n,s=ot(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=$e(0);function c(){l.x=it(o)}if(r||!r&&!i)if(("body"!==I(t)||V(o))&&(a=K(t)),r){const e=ot(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&c();i&&!r&&o&&c();const u=!o||r||i?$e(0):st(o,a);return{x:s.left+a.scrollLeft-l.x-u.x,y:s.top+a.scrollTop-l.y-u.y,width:s.width,height:s.height}}function ut(e){return"static"===X(e).position}function dt(e,t){if(!D(e)||"fixed"===X(e).position)return null;if(t)return t(e);let n=e.offsetParent;return L(e)===n&&(n=n.ownerDocument.body),n}function mt(e,t){const n=N(e);if(U(e))return n;if(!D(e)){let t=J(e);for(;t&&!Y(t);){if(M(t)&&!ut(t))return t;t=J(t)}return n}let r=dt(e,t);for(;r&&z(r)&&ut(r);)r=dt(r,t);return r&&Y(r)&&ut(r)&&!G(r)?n:r||function(e){let t=J(e);for(;D(t)&&!Y(t);){if(G(t))return t;if(U(t))return null;t=J(t)}return null}(e)||n}const pt={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,s=L(r),a=!!t&&U(t.floating);if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=$e(1);const u=$e(0),d=D(r);if((d||!d&&!i)&&(("body"!==I(r)||V(s))&&(l=K(r)),d)){const e=ot(r);c=tt(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}const m=!s||d||i?$e(0):st(s,l);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+m.x,y:n.y*c.y-l.scrollTop*c.y+u.y+m.y}},getDocumentElement:L,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?U(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=Q(e,[],!1).filter(e=>M(e)&&"body"!==I(e)),o=null;const i="fixed"===X(e).position;let s=i?J(e):e;for(;M(s)&&!Y(s);){const t=X(s),n=G(s);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&("absolute"===o.position||"fixed"===o.position)||V(s)&&!n&<(e,s))?r=r.filter(e=>e!==s):o=t,s=J(s)}return t.set(e,r),r}(t,this._c):[].concat(n),r],s=at(t,i[0],o);let a=s.top,l=s.right,c=s.bottom,u=s.left;for(let e=1;e<i.length;e++){const n=at(t,i[e],o);a=Ie(n.top,a),l=Pe(n.right,l),c=Pe(n.bottom,c),u=Ie(n.left,u)}return{width:l-u,height:c-a,x:u,y:a}},getOffsetParent:mt,getElementRects:async function(e){const t=this.getOffsetParent||mt,n=this.getDimensions,r=await n(e.floating);return{reference:ct(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=Qe(e);return{width:t,height:n}},getScale:tt,isElement:M,isRTL:function(e){return"rtl"===X(e).direction}};function ft(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ht(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=et(e),u=o||i?[...c?Q(c):[],...t?Q(t):[]]:[];u.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)});const d=c&&a?function(e,t){let n,r=null;const o=L(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function s(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),i();const c=e.getBoundingClientRect(),{left:u,top:d,width:m,height:p}=c;if(a||t(),!m||!p)return;const f={rootMargin:-Le(d)+"px "+-Le(o.clientWidth-(u+m))+"px "+-Le(o.clientHeight-(d+p))+"px "+-Le(u)+"px",threshold:Ie(0,Pe(1,l))||1};let h=!0;function g(t){const r=t[0].intersectionRatio;if(r!==l){if(!h)return s();r?s(!1,r):n=setTimeout(()=>{s(!1,1e-7)},1e3)}1!==r||ft(c,e.getBoundingClientRect())||s(),h=!1}try{r=new IntersectionObserver(g,{...f,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(g,f)}r.observe(e)}(!0),i}(c,n):null;let m,p=-1,f=null;s&&(f=new ResizeObserver(e=>{let[r]=e;r&&r.target===c&&f&&t&&(f.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=f)||e.observe(t)})),n()}),c&&!l&&f.observe(c),t&&f.observe(t));let h=l?ot(e):null;return l&&function t(){const r=ot(e);h&&!ft(h,r)&&n(),h=r,m=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach(e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)}),null==d||d(),null==(e=f)||e.disconnect(),f=null,l&&cancelAnimationFrame(m)}}const gt=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:m,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:h=!0,...g}=De(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const y=je(o),v=Ue(a),b=je(a)===a,w=await(null==l.isRTL?void 0:l.isRTL(c.floating)),E=m||(b||!h?[Ye(a)]:function(e){const t=Ye(e);return[We(e),t,We(t)]}(a)),T="none"!==f;!m&&T&&E.push(...function(e,t,n,r){const o=Ve(e);let i=function(e,t,n){switch(e){case"top":case"bottom":return n?t?He:Be:t?Be:He;case"left":case"right":return t?Ge:qe;default:return[]}}(je(e),"start"===n,r);return o&&(i=i.map(e=>e+"-"+o),t&&(i=i.concat(i.map(We)))),i}(a,h,f,w));const S=[a,...E],C=await l.detectOverflow(t,g),x=[];let _=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&x.push(C[y]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=Ve(e),o=Fe(e),i=ze(o);let s="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Ye(s)),[s,Ye(s)]}(o,s,w);x.push(C[e[0]],C[e[1]])}if(_=[..._,{placement:o,overflows:x}],!x.every(e=>e<=0)){var R,A;const e=((null==(R=i.flip)?void 0:R.index)||0)+1,t=S[e];if(t&&("alignment"!==d||v===Ue(t)||_.every(e=>Ue(e.placement)!==v||e.overflows[0]>0)))return{data:{index:e,overflows:_},reset:{placement:t}};let n=null==(A=_.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:A.placement;if(!n)switch(p){case"bestFit":{var k;const e=null==(k=_.filter(e=>{if(T){const t=Ue(e.placement);return t===v||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:k[0];e&&(n=e);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},yt=(e,t,n)=>{const r=new Map,o={platform:pt,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=s.detectOverflow?s:{...s,detectOverflow:Je},l=await(null==s.isRTL?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=Ke(c,r,l),m=r,p=0;const f={};for(let n=0;n<i.length;n++){const h=i[n];if(!h)continue;const{name:g,fn:y}=h,{x:v,y:b,data:w,reset:E}=await y({x:u,y:d,initialPlacement:r,placement:m,strategy:o,middlewareData:f,rects:c,platform:a,elements:{reference:e,floating:t}});u=null!=v?v:u,d=null!=b?b:d,f[g]={...f[g],...w},E&&p<50&&(p++,"object"==typeof E&&(E.placement&&(m=E.placement),E.rects&&(c=!0===E.rects?await s.getElementRects({reference:e,floating:t,strategy:o}):E.rects),({x:u,y:d}=Ke(c,m,l))),n=-1)}return{x:u,y:d,placement:m,strategy:o,middlewareData:f}})(e,t,{...o,platform:i})};var vt="undefined"!=typeof document?T.useLayoutEffect:function(){};function bt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!==r--;)if(!bt(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!==r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!==r--;){const n=o[r];if(!("_owner"===n&&e.$$typeof||bt(e[n],t[n])))return!1}return!0}return e!=e&&t!=t}function wt(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Et(e,t){const n=wt(e);return Math.round(t*n)/n}function Tt(e){const t=T.useRef(e);return vt(()=>{t.current=e}),t}const St=(e,t)=>{const n=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),s=je(n),a=Ve(n),l="y"===Ue(n),c=Ze.has(s)?-1:1,u=i&&l?-1:1,d=De(t,e);let{mainAxis:m,crossAxis:p,alignmentAxis:f}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&"number"==typeof f&&(p="end"===a?-1*f:f),l?{x:p*u,y:m*c}:{x:m*c,y:p*u}}(t,e);return s===(null==(n=a.offset)?void 0:n.placement)&&null!=(r=a.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}}(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ct=(e,t)=>{const n=gt(e);return{name:n.name,fn:n.fn,options:[e,t]}},xt=(e,t)=>{const n=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...c}=De(e,t),u=await s.detectOverflow(t,c),d=je(o),m=Ve(o),p="y"===Ue(o),{width:f,height:h}=i.floating;let g,y;"top"===d||"bottom"===d?(g=d,y=m===(await(null==s.isRTL?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(y=d,g="end"===m?"top":"bottom");const v=h-u.top-u.bottom,b=f-u.left-u.right,w=Pe(h-u[g],v),E=Pe(f-u[y],b),T=!t.middlewareData.shift;let S=w,C=E;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(C=b),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(S=v),T&&!m){const e=Ie(u.left,0),t=Ie(u.right,0),n=Ie(u.top,0),r=Ie(u.bottom,0);p?C=f-2*(0!==e||0!==t?e+t:Ie(u.left,u.right)):S=h-2*(0!==n||0!==r?n+r:Ie(u.top,u.bottom))}await l({...t,availableWidth:C,availableHeight:S});const x=await s.getDimensions(a.floating);return f!==x.width||h!==x.height?{reset:{rects:!0}}:{}}}}(e);return{name:n.name,fn:n.fn,options:[e,t]}},_t="data-floating-ui-focusable",Rt="active",At="selected",kt={...S};let Ot=!1,Pt=0;const It=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Pt++,Nt=kt.useId||function(){const[e,t]=T.useState(()=>Ot?It():void 0);return we(()=>{null==e&&t(It())},[]),T.useEffect(()=>{Ot=!0},[]),e};const Lt=T.createContext(null),$t=T.createContext(null),Mt=()=>{var e;return(null==(e=T.useContext(Lt))?void 0:e.id)||null},Dt=()=>T.useContext($t);function jt(e){return"data-floating-ui-"+e}function Vt(e){-1!==e.current&&(clearTimeout(e.current),e.current=-1)}const zt=jt("safe-polygon");function Ut(e,t,n){if(n&&!be(n))return 0;if("number"==typeof e)return e;if("function"==typeof e){const n=e();return"number"==typeof n?n:null==n?void 0:n[t]}return null==e?void 0:e[t]}function Ft(e){return"function"==typeof e?e():e}function Wt(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,elements:s}=e,{enabled:a=!0,delay:l=0,handleClose:c=null,mouseOnly:u=!1,restMs:d=0,move:m=!0}=t,p=Dt(),f=Mt(),h=Ee(c),g=Ee(l),y=Ee(n),v=Ee(d),b=T.useRef(),w=T.useRef(-1),E=T.useRef(),S=T.useRef(-1),C=T.useRef(!0),x=T.useRef(!1),_=T.useRef(()=>{}),R=T.useRef(!1),A=Se(()=>{var e;const t=null==(e=o.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t});T.useEffect(()=>{if(a)return i.on("openchange",e),()=>{i.off("openchange",e)};function e(e){let{open:t}=e;t||(Vt(w),Vt(S),C.current=!0,R.current=!1)}},[a,i]),T.useEffect(()=>{if(!a)return;if(!h.current)return;if(!n)return;function e(e){A()&&r(!1,e,"hover")}const t=ve(s.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}},[s.floating,n,r,a,h,A]);const k=T.useCallback(function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const o=Ut(g.current,"close",b.current);o&&!E.current?(Vt(w),w.current=window.setTimeout(()=>r(!1,e,n),o)):t&&(Vt(w),r(!1,e,n))},[g,r]),O=Se(()=>{_.current(),E.current=void 0}),P=Se(()=>{if(x.current){const e=ve(s.floating).body;e.style.pointerEvents="",e.removeAttribute(zt),x.current=!1}}),I=Se(()=>!!o.current.openEvent&&["click","mousedown"].includes(o.current.openEvent.type));T.useEffect(()=>{if(a&&M(s.domReference)){const r=s.domReference,o=s.floating;return n&&r.addEventListener("mouseleave",i),m&&r.addEventListener("mousemove",e,{once:!0}),r.addEventListener("mouseenter",e),r.addEventListener("mouseleave",t),o&&(o.addEventListener("mouseleave",i),o.addEventListener("mouseenter",l),o.addEventListener("mouseleave",c)),()=>{n&&r.removeEventListener("mouseleave",i),m&&r.removeEventListener("mousemove",e),r.removeEventListener("mouseenter",e),r.removeEventListener("mouseleave",t),o&&(o.removeEventListener("mouseleave",i),o.removeEventListener("mouseenter",l),o.removeEventListener("mouseleave",c))}}function e(e){if(Vt(w),C.current=!1,u&&!be(b.current)||Ft(v.current)>0&&!Ut(g.current,"open"))return;const t=Ut(g.current,"open",b.current);t?w.current=window.setTimeout(()=>{y.current||r(!0,e,"hover")},t):n||r(!0,e,"hover")}function t(e){if(I())return void P();_.current();const t=ve(s.floating);if(Vt(S),R.current=!1,h.current&&o.current.floatingContext){n||Vt(w),E.current=h.current({...o.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){P(),O(),I()||k(e,!0,"safe-polygon")}});const r=E.current;return t.addEventListener("mousemove",r),void(_.current=()=>{t.removeEventListener("mousemove",r)})}("touch"!==b.current||!ye(s.floating,e.relatedTarget))&&k(e)}function i(e){I()||o.current.floatingContext&&(null==h.current||h.current({...o.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){P(),O(),I()||k(e)}})(e))}function l(){Vt(w)}function c(e){I()||k(e,!1)}},[s,a,e,u,m,k,O,P,r,n,y,p,g,h,o,I,v]),we(()=>{var e;if(a&&n&&null!=(e=h.current)&&null!=(e=e.__options)&&e.blockPointerEvents&&A()){x.current=!0;const e=s.floating;if(M(s.domReference)&&e){var t;const n=ve(s.floating).body;n.setAttribute(zt,"");const r=s.domReference,o=null==p||null==(t=p.nodesRef.current.find(e=>e.id===f))||null==(t=t.context)?void 0:t.elements.floating;return o&&(o.style.pointerEvents=""),n.style.pointerEvents="none",r.style.pointerEvents="auto",e.style.pointerEvents="auto",()=>{n.style.pointerEvents="",r.style.pointerEvents="",e.style.pointerEvents=""}}}},[a,n,f,s,p,h,A]),we(()=>{n||(b.current=void 0,R.current=!1,O(),P())},[n,O,P]),T.useEffect(()=>()=>{O(),Vt(w),Vt(S),P()},[a,s.domReference,O,P]);const N=T.useMemo(()=>{function e(e){b.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function o(){C.current||y.current||r(!0,t,"hover")}u&&!be(b.current)||n||0===Ft(v.current)||R.current&&e.movementX**2+e.movementY**2<2||(Vt(S),"touch"===b.current?o():(R.current=!0,S.current=window.setTimeout(o,Ft(v.current))))}}},[u,r,n,y,v]);return T.useMemo(()=>a?{reference:N}:{},[a,N])}const Bt={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},Ht=T.forwardRef(function(e,t){const[n,r]=T.useState();we(()=>{/apple/i.test(navigator.vendor)&&r("button")},[]);const o={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[jt("focus-guard")]:"",style:Bt};return(0,ke.jsx)("span",{...e,...o})}),Gt={clipPath:"inset(50%)",position:"fixed",top:0,left:0},qt=T.createContext(null),Yt=jt("portal");function Xt(e){const{children:t,id:n,root:r,preserveTabOrder:o=!0}=e,i=function(e){void 0===e&&(e={});const{id:t,root:n}=e,r=Nt(),o=Kt(),[i,s]=T.useState(null),a=T.useRef(null);return we(()=>()=>{null==i||i.remove(),queueMicrotask(()=>{a.current=null})},[i]),we(()=>{if(!r)return;if(a.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=r,n.setAttribute(Yt,""),e.appendChild(n),a.current=n,s(n)},[t,r]),we(()=>{if(null===n)return;if(!r)return;if(a.current)return;let e=n||(null==o?void 0:o.portalNode);e&&!$(e)&&(e=e.current),e=e||document.body;let i=null;t&&(i=document.createElement("div"),i.id=t,e.appendChild(i));const l=document.createElement("div");l.id=r,l.setAttribute(Yt,""),e=i||e,e.appendChild(l),a.current=l,s(l)},[t,n,r,o]),i}({id:n,root:r}),[s,a]=T.useState(null),l=T.useRef(null),c=T.useRef(null),u=T.useRef(null),d=T.useRef(null),m=null==s?void 0:s.modal,p=null==s?void 0:s.open,f=!!s&&!s.modal&&s.open&&o&&!(!r&&!i);return T.useEffect(()=>{if(i&&o&&!m)return i.addEventListener("focusin",e,!0),i.addEventListener("focusout",e,!0),()=>{i.removeEventListener("focusin",e,!0),i.removeEventListener("focusout",e,!0)};function e(e){i&&_e(e)&&("focusin"===e.type?Ae:Re)(i)}},[i,o,m]),T.useEffect(()=>{i&&(p||Ae(i))},[p,i]),(0,ke.jsxs)(qt.Provider,{value:T.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:l,afterOutsideRef:c,beforeInsideRef:u,afterInsideRef:d,portalNode:i,setFocusManagerState:a}),[o,i]),children:[f&&i&&(0,ke.jsx)(Ht,{"data-type":"outside",ref:l,onFocus:e=>{if(_e(e,i)){var t;null==(t=u.current)||t.focus()}else{const e=xe(ve(n=s?s.domReference:null).body,-1)||n;null==e||e.focus()}var n}}),f&&i&&(0,ke.jsx)("span",{"aria-owns":i.id,style:Gt}),i&&Oe.createPortal(t,i),f&&i&&(0,ke.jsx)(Ht,{"data-type":"outside",ref:c,onFocus:e=>{if(_e(e,i)){var t;null==(t=d.current)||t.focus()}else{const t=xe(ve(n=s?s.domReference:null).body,1)||n;null==t||t.focus(),(null==s?void 0:s.closeOnFocusOut)&&(null==s||s.onOpenChange(!1,e.nativeEvent,"focus-out"))}var n}})]})}const Kt=()=>T.useContext(qt);function Jt(e){void 0===e&&(e={});const{nodeId:t}=e,n=function(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=Nt(),i=T.useRef({}),[s]=T.useState(()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;null==(r=e.get(t))||r.delete(n)}}}()),a=null!=Mt(),[l,c]=T.useState(r.reference),u=Se((e,t,r)=>{i.current.openEvent=e?t:void 0,s.emit("openchange",{open:e,event:t,reason:r,nested:a}),null==n||n(e,t,r)}),d=T.useMemo(()=>({setPositionReference:c}),[]),m=T.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return T.useMemo(()=>({dataRef:i,open:t,onOpenChange:u,elements:m,events:s,floatingId:o,refs:d}),[t,u,m,s,o,d])}({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,s]=T.useState(null),[a,l]=T.useState(null),c=(null==o?void 0:o.domReference)||i,u=T.useRef(null),d=Dt();we(()=>{c&&(u.current=c)},[c]);const m=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,d]=T.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,p]=T.useState(r);bt(m,r)||p(r);const[f,h]=T.useState(null),[g,y]=T.useState(null),v=T.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),b=T.useCallback(e=>{e!==C.current&&(C.current=e,y(e))},[]),w=i||f,E=s||g,S=T.useRef(null),C=T.useRef(null),x=T.useRef(u),_=null!=l,R=Tt(l),A=Tt(o),k=Tt(c),O=T.useCallback(()=>{if(!S.current||!C.current)return;const e={placement:t,strategy:n,middleware:m};A.current&&(e.platform=A.current),yt(S.current,C.current,e).then(e=>{const t={...e,isPositioned:!1!==k.current};P.current&&!bt(x.current,t)&&(x.current=t,Oe.flushSync(()=>{d(t)}))})},[m,t,n,A,k]);vt(()=>{!1===c&&x.current.isPositioned&&(x.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[c]);const P=T.useRef(!1);vt(()=>(P.current=!0,()=>{P.current=!1}),[]),vt(()=>{if(w&&(S.current=w),E&&(C.current=E),w&&E){if(R.current)return R.current(w,E,O);O()}},[w,E,O,R,_]);const I=T.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:b}),[v,b]),N=T.useMemo(()=>({reference:w,floating:E}),[w,E]),L=T.useMemo(()=>{const e={position:n,left:0,top:0};if(!N.floating)return e;const t=Et(N.floating,u.x),r=Et(N.floating,u.y);return a?{...e,transform:"translate("+t+"px, "+r+"px)",...wt(N.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,a,N.floating,u.x,u.y]);return T.useMemo(()=>({...u,update:O,refs:I,elements:N,floatingStyles:L}),[u,O,I,N,L])}({...e,elements:{...o,...a&&{reference:a}}}),p=T.useCallback(e=>{const t=M(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;l(t),m.refs.setReference(t)},[m.refs]),f=T.useCallback(e=>{(M(e)||null===e)&&(u.current=e,s(e)),(M(m.refs.reference.current)||null===m.refs.reference.current||null!==e&&!M(e))&&m.refs.setReference(e)},[m.refs]),h=T.useMemo(()=>({...m.refs,setReference:f,setPositionReference:p,domReference:u}),[m.refs,f,p]),g=T.useMemo(()=>({...m.elements,domReference:c}),[m.elements,c]),y=T.useMemo(()=>({...m,...r,refs:h,elements:g,nodeId:t}),[m,h,g,t,r]);return we(()=>{r.dataRef.current.floatingContext=y;const e=null==d?void 0:d.nodesRef.current.find(e=>e.id===t);e&&(e.context=y)}),T.useMemo(()=>({...m,context:y,refs:h,elements:g}),[m,h,g,y])}function Zt(e,t,n){const r=new Map,o="item"===n;let i=e;if(o&&e){const{[Rt]:t,[At]:n,...r}=e;i=r}return{..."floating"===n&&{tabIndex:-1,[_t]:""},...i,...t.map(t=>{const r=t?t[n]:null;return"function"==typeof r?e?r(e):null:r}).concat(e).reduce((e,t)=>t?(Object.entries(t).forEach(t=>{let[n,i]=t;var s;o&&[Rt,At].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof i&&(null==(s=r.get(n))||s.push(i),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),i=0;i<t;i++)o[i]=arguments[i];return null==(e=r.get(n))?void 0:e.map(e=>e(...o)).find(e=>void 0!==e)})):e[n]=i)}),e):e,{})}}const Qt=[".e-off-canvas"];function en(){return en=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},en.apply(null,arguments)}const tn="elementor-preview-responsive-wrapper",nn=(0,O.styled)(O.Box,{shouldForwardProp:e=>"isSelected"!==e&&"isSmallerOffset"!==e&&"isGlobal"!==e})(({theme:e,isSelected:t,isSmallerOffset:n,isGlobal:r})=>({outline:`${t?"2px":"1px"} solid ${r?e.palette.global.main:e.palette.primary.light}`,outlineOffset:t&&!n?"-2px":"-1px",pointerEvents:"none"})),rn=({element:e,isSelected:t,id:n,isGlobal:r=!1})=>{const{context:o,floating:i,isVisible:s}=function({element:e,isSelected:t}){const[n,r]=(0,T.useState)(!1),{refs:o,floatingStyles:i,context:s}=Jt({open:n||t,onOpenChange:r,whileElementsMounted:ht,middleware:[xt(()=>({apply({elements:e,rects:t}){Object.assign(e.floating.style,{width:`${t.reference.width+2}px`,height:`${t.reference.height+2}px`})}})),St(({rects:e})=>-e.reference.height/2-e.floating.height/2)]});return(0,T.useEffect)(()=>{o.setReference(e)},[e,o]),{isVisible:n||t,context:s,floating:{setRef:o.setFloating,ref:o.floating,styles:i}}}({element:e,isSelected:t}),{getFloatingProps:a,getReferenceProps:l}=function(e){void 0===e&&(e=[]);const t=e.map(e=>null==e?void 0:e.reference),n=e.map(e=>null==e?void 0:e.floating),r=e.map(e=>null==e?void 0:e.item),o=T.useCallback(t=>Zt(t,e,"reference"),t),i=T.useCallback(t=>Zt(t,e,"floating"),n),s=T.useCallback(t=>Zt(t,e,"item"),r);return T.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:s}),[o,i,s])}([Wt(o)]),c=(()=>{const e=window.elementor?.$preview?.[0];return!!e&&Qt.map(t=>Array.from(e?.contentWindow?.document.body.querySelectorAll(t)??[])).flat().some(e=>e.checkVisibility({opacityProperty:!0,visibilityProperty:!0,contentVisibilityAuto:!0}))})();!function(e,t){(0,T.useEffect)(()=>{const n=e,{events:r,attrs:o}=function(e){const t=/^on(?=[A-Z])/;return Object.entries(e).reduce((e,[n,r])=>{if(!t.test(n))return e.attrs.push([n,r]),e;const o=n.replace(t,"").toLowerCase(),i=r;return e.events.push([o,i]),e},{events:[],attrs:[]})}(t());return r.forEach(([e,t])=>n.addEventListener(e,t)),o.forEach(([e,t])=>n.setAttribute(e,t)),()=>{r.forEach(([e,t])=>n.removeEventListener(e,t)),o.forEach(([e])=>n.removeAttribute(e))}},[t,e])}(e,l);const u=e.offsetHeight<=1;return s&&!c&&T.createElement(Xt,{id:tn},T.createElement(nn,en({ref:i.setRef,isSelected:t,isGlobal:r,style:i.styles,"data-element-overlay":n,role:"presentation",isSmallerOffset:u},a())))},on="atomic",sn=[{component:rn,shouldRender:()=>!0}];function an(){const e=(0,l.useSelectedElement)(),t=(0,s.__privateUseListenTo)([(0,s.windowEvent)("elementor/editor/element-rendered"),(0,s.windowEvent)("elementor/editor/element-destroyed")],()=>(0,l.getElements)().filter(e=>on in(e.view?.el?.dataset??{})).map(e=>({id:e.id,domElement:e.view?.getDomElement?.()?.get?.(0),isGlobal:e.model.get("isGlobal")??!1})).filter(e=>!!e.domElement)),n="edit"===(0,s.useEditMode)(),r=(0,s.__privateUseIsRouteActive)("panel/global");return n&&!r?t.map(({id:t,domElement:n,isGlobal:r})=>{const o=e.element?.id===t;return sn.map(({shouldRender:e,component:i},s)=>e({id:t,element:n,isSelected:o})&&T.createElement(i,{key:`${t}-${s}`,id:t,element:n,isSelected:o,isGlobal:r}))}):null}var ln=window.elementorV2.editorInteractions;function cn(e){const t=(0,T.useRef)(!1);(0,T.useEffect)(()=>{t.current||(t.current=!0,e())},[])}function un({provider:e},{provider:t}){return e.priority-t.priority}function dn({provider:e,setInteractionItems:t}){return()=>{try{const n=e.actions.all(),r=e.getKey();t(t=>({...t,[r]:{provider:e,items:n}}))}catch{}}}function mn(){const e=(0,s.__privateUseListenTo)((0,s.commandEndEvent)("editor/documents/attach-preview"),()=>(0,s.getCanvasIframeDocument)()?.head),t=function(){const[e,t]=(0,T.useState)({}),n=(0,T.useMemo)(()=>{try{return ln.interactionsRepository.getProviders().map(e=>({provider:e,subscriber:dn({provider:e,setInteractionItems:t})}))}catch{return[]}},[]);return(0,T.useEffect)(()=>{if(0===n.length)return;const e=n.map(({provider:e,subscriber:t})=>e.subscribe(()=>{try{t()}catch{}}));return()=>{e.forEach(e=>e())}},[n]),cn(()=>{0!==n.length&&(0,s.registerDataHook)("after","editor/documents/attach-preview",async()=>{n.forEach(({subscriber:e})=>{try{e()}catch{}})})}),(0,T.useMemo)(()=>Object.values(e).sort(un).flatMap(({items:e})=>e),[e])}();if(!e)return null;const n=JSON.stringify(Array.isArray(t)?t:[]);return T.createElement(O.Portal,{container:e},T.createElement("script",{type:"application/json","data-e-interactions":"true",dangerouslySetInnerHTML:{__html:n}}))}const pn="data-e-removed",fn="data-elementor-id",hn="elementor-post-",gn="-css";function yn(e){const t=[...e.attributes].map(e=>[e.name,e.value]);return Object.fromEntries(t)}var vn=window.elementorV2.editorResponsive;const bn=new Set;function wn(e,t=[]){return{then:n=>(t.push(n),wn(e,t)),execute:async()=>{let n;for(const r of t){if(e.aborted)break;n=await r(n,e)}}}}const En=e=>!!e&&"object"==typeof e&&"$$multi-props"in e&&!0===e["$$multi-props"],Tn=e=>({"$$multi-props":!0,value:e}),Sn=e=>e.value,Cn=3;function xn({transformers:e,schema:t,onPropResolve:n}){async function r({props:e,schema:r,signal:i,renderContext:s}){r=r??t;const a=Promise.all(Object.entries(r).map(async([t,r])=>{const a=e[t]??r.default,l=await o({value:a,key:t,type:r,signal:i,renderContext:s});return n?.({key:t,value:l}),En(l)?Sn(l):{[t]:l}}));return Object.assign({},...(await a).filter(Boolean))}async function o({value:t,key:n,type:i,signal:s,depth:a=0,renderContext:l}){if(null==t)return null;if(!(0,u.isTransformable)(t))return t;if(a>Cn)return null;if(!0===t.disabled)return null;let c=i;if("union"===i.kind&&(c=i.prop_types[t.$$type],!c))return null;if(t.$$type!==c.key)return null;let d=t.value;"object"===c.kind&&(d=await r({props:d,schema:c.shape,signal:s,renderContext:l})),"array"===c.kind&&(d=await Promise.all(d.map(e=>o({value:e,key:n,type:c.item_prop_type,depth:a,signal:s,renderContext:l}))));const m=e.get(t.$$type);if(!m)return null;try{return o({value:await m(d,{key:n,signal:s,renderContext:l,propType:i}),key:n,type:i,signal:s,depth:a+1,renderContext:l})}catch{return null}}return r}function _n(){const e={};let t=null;return{register(t,n){return e[t]=n,this},registerFallback(e){return t=e,this},get(n){return e[n]??t},all(){return{...e}}}}const Rn=_n(),An=_n(),kn=(0,_.createError)({code:"unknown_style_type",message:"Unknown style type"}),On=(0,_.createError)({code:"unknown_style_state",message:"Unknown style state"}),Pn={class:"."},In="desktop",Nn="normal";function Ln({resolve:e,breakpoints:t,selectorPrefix:n=""}){return async({styles:r,signal:o})=>{const i=new Set,s=r.filter(e=>{const t=function(e){const t=e.variants[0]?.meta?.breakpoint??In,n=e.variants[0]?.meta?.state??Nn;return`${e.id}-${t}-${n}`}(e);return!i.has(t)&&(i.add(t),!0)}).map(async r=>{const i=Object.values(r.variants).map(async i=>{const s=await async function({props:e,resolve:t,signal:n}){const r=await t({props:e,signal:n});return Object.entries(r).reduce((e,[t,n])=>(null===n||e.push(t+":"+n+";"),e),[]).join("")}({props:i.props,resolve:e,signal:o}),a=function(e){const t=(0,_.decodeString)(e?.raw||"");return t.trim()?t+"\n":""}(i.custom_css);return $n().for(r.cssName,r.type).withPrefix(n).withState(i.meta.state).withMediaQuery(i.meta.breakpoint?t[i.meta.breakpoint]:null).wrap(s+a)}),s=await Promise.all(i);return{id:r.id,breakpoint:r?.variants[0]?.meta?.breakpoint||"desktop",value:s.join(""),state:r?.variants[0]?.meta?.state||null}});return await Promise.all(s)}}function $n(e="",t){return{for:(n,r)=>{const o=Pn[r];if(!o)throw new kn({context:{type:r}});return $n(`${e}${o}${n}`,t)},withPrefix:n=>$n([n,e].filter(Boolean).join(" "),t),withState:n=>$n((0,d.getSelectorWithState)(e,n),t),withMediaQuery:n=>{if(!n?.type)return $n(e,t);const r=`${n.type}:${n.width}px`;return $n(e,e=>`@media(${r}){${e}}`)},wrap:n=>{const r=`${e}{${n}}`;return t?t(r):r}}}const Mn=".elementor";function Dn({provider:e},{provider:t}){return e.priority-t.priority}function jn({state:e},{state:t}){return(0,d.isClassState)(e)&&!(0,d.isClassState)(t)?-1:!(0,d.isClassState)(e)&&(0,d.isClassState)(t)?1:0}function Vn({provider:e,renderStyles:t,setStyleItems:n,getCache:r}){return function(){let i=null;return(...a)=>(i&&i.abort(),i=new AbortController,((i,a,l)=>wn(i.signal).then((n,i)=>{const c=r(),u=void 0!==l&&void 0!==a,d=c.orderedIds.length>0;return d&&e.isPregeneratedLink&&function(e,t){if(bn.has(e))return;const n=(0,s.getCanvasIframeDocument)();n&&(n.head.querySelectorAll('link[rel="stylesheet"]').forEach(e=>{const{id:n,href:r,media:o}=e;t({id:n,href:r,media:o})&&e.remove()}),bn.add(e))}(e.getKey(),e.isPregeneratedLink),u&&d?async function(n,r,i,s){const a=function(e,t){const n=[];for(const r of Object.keys(t)){const o=t[r],i=e[r];i&&o===i||n.push(r)}return n}(r,i);if(n.orderedIds=e.actions.all().map(e=>e.id).reverse(),a.length>0){const r=o(a.map(t=>e.actions.get(t)).filter(e=>!!e).map(t=>({...t,cssName:e.actions.resolveCssName(t.id)})));return t({styles:r,signal:s}).then(e=>(function(e,t,n){for(const n of t)e.itemsById.delete(n);for(const t of n){const n=e.itemsById.get(t.id)||[];n.push(t),e.itemsById.set(t.id,n)}}(n,a,e),zn(n)))}return zn(n)}(c,a,l,i):async function(n,r){const i=e.actions.all(),s=[...i].reverse().map(t=>({...t,cssName:e.actions.resolveCssName(t.id)}));return t({styles:o(s),signal:r}).then(e=>(function(e,t,n){e.orderedIds=t.map(e=>e.id).reverse(),e.itemsById.clear();for(const t of n){const n=e.itemsById.get(t.id)||[];n.push(t),e.itemsById.set(t.id,n)}}(n,i,e),zn(n)))}(c,i)}).then(t=>{n(n=>({...n,[e.getKey()]:{provider:e,items:t}}))}).execute())(i,...a))}();function o(e){return Object.values(e.reduce((e,t)=>(t.variants.forEach(n=>{const r=n.meta.breakpoint||"desktop";e[t.id]||(e[t.id]={}),e[t.id][r]||(e[t.id][r]={...t,variants:[]}),e[t.id][r].variants.push(n)}),e),{})).flatMap(e=>Object.values(e))}}function zn(e){return e.orderedIds.map(t=>e.itemsById.get(t)).filter(e=>void 0!==e).flat()}function Un(){return Un=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Un.apply(null,arguments)}function Fn(){const e=(0,s.__privateUseListenTo)((0,s.commandEndEvent)("editor/documents/attach-preview"),()=>(0,s.getCanvasIframeDocument)()?.head),t=function(){const e=function(e){const t=(0,vn.useBreakpointsMap)();return(0,T.useMemo)(()=>Ln({selectorPrefix:Mn,breakpoints:t,resolve:e}),[e,t])}((0,T.useMemo)(()=>xn({transformers:An,schema:(0,d.getStylesSchema)(),onPropResolve:({key:e,value:t})=>{"font-family"===e&&"string"==typeof t&&(0,s.enqueueFont)(t)}}),[])),t=(0,vn.useBreakpoints)(),[n,r]=(0,T.useState)({}),o=(0,T.useRef)(new Map),i=(0,T.useMemo)(()=>{const t=()=>({orderedIds:[],itemsById:new Map});return x.stylesRepository.getProviders().map(n=>({provider:n,subscriber:Vn({provider:n,renderStyles:e,setStyleItems:r,getCache:()=>(e=>{const n=function(e){try{return e.getKey()}catch{return null}}(e);return n?(o.current.has(n)||o.current.set(n,t()),o.current.get(n)):t()})(n)})}))},[e]);(0,T.useEffect)(()=>{const e=i.map(({provider:e,subscriber:t})=>e.subscribe(t));return()=>{e.forEach(e=>e())}},[i]),cn(()=>{(0,s.registerDataHook)("after","editor/documents/attach-preview",async()=>{bn.clear();const e=i.map(async({subscriber:e})=>e());await Promise.all(e)})});const a=(0,T.useMemo)(()=>{return e=t.map(e=>e.id),({breakpoint:t},{breakpoint:n})=>e.indexOf(t)-e.indexOf(n);var e},[t]);return(0,T.useMemo)(()=>Object.values(n).sort(Dn).flatMap(({items:e})=>e).sort(jn).sort(a),[n,a])}(),n=(0,s.__privateUseListenTo)((0,s.commandEndEvent)("editor/documents/attach-preview"),()=>{const e=(0,s.getCanvasIframeDocument)();if(!e)return[];const t=function(e){return[...e.body.querySelectorAll(`[${fn}]`)??[]].map(e=>e.getAttribute(fn)||"")}(e).map(e=>`${hn}${e}${gn}`),n=function(e){return[...e.head.querySelectorAll(`link[rel="stylesheet"][id^=${hn}][id$=${gn}]`)??[]]}(e).filter(e=>t.includes(e.getAttribute("id")??""));return n.forEach(e=>{e.hasAttribute(pn)||e.remove()}),n.map(e=>({...yn(e),id:e.getAttribute("id")??"",[pn]:!0}))});return e?T.createElement(O.Portal,{container:e},function(e){const t=new Map;return e.filter(e=>{const n=t.get(e.id);return n?!n.find(t=>t.breakpoint===e.breakpoint&&t.state===e.state)&&(n.push(e),!0):(t.set(e.id,[e]),!0)})}(t).map(e=>T.createElement("style",{key:`${e.id}-${e.breakpoint}-${e.state??"normal"}`},e.value)),n.map(e=>T.createElement("link",Un({},e,{key:e.id})))):null}var Wn=window.elementorV2.editorNotifications,Bn=window.wp.i18n;const Hn="e-form",Gn=new Set(["e-form-input","e-form-textarea","e-form-label","e-form-checkbox","e-form-submit-button","e-form-select","e-form-radio-button","e-form-file-upload","e-form-date-picker","e-form-time-picker"]);function qn(e){return e.model?.widgetType||e.model?.elType}function Yn(e){return e?.model.get("widgetType")||e?.model.get("elType")}function Xn(e){return e?.widgetType||e?.elType}function Kn(e){return function(e){return!!e?.view?.el?.closest('form,[data-element_type="e-form"]')}(e)}function Jn(e,t){return e.some(e=>Xn(e)===t||!!e.elements&&Jn(e.elements,t))}function Zn(e,t){return e.some(e=>{const n=Xn(e);return!(!n||!t.has(n))||!!e.elements&&Zn(e.elements,t)})}const Qn={type:"default",message:(0,Bn.__)("Form elements must be placed inside a form.","elementor"),id:"form-fields-outside-form-blocked"};function er(e){const t=qn(e);return!(!t||!Gn.has(t)||Kn(e.container)||(rr(),0))}function tr(e){const{containers:t=[e.container],target:n}=e;return!(!t.some(e=>{return!!e&&(t=e,n=Gn,(0,l.getAllDescendants)(t).some(e=>{const t=Yn(e);return!!t&&n.has(t)}));var t,n})||Kn(n)||function(e){return e.some(e=>Yn(e)===Hn)}(t)||(rr(),0))}function nr(e){const{storageType:t}=e;if("localstorage"!==t)return!1;const n=window?.elementorCommon?.storage?.get();return!!n?.clipboard?.elements&&!(!Zn(n.clipboard.elements,Gn)||Kn(e.container)||(r=n.clipboard.elements,r.length&&r.every(e=>Xn(e)===Hn))||(rr(),0));var r}function rr(){(0,Wn.notify)(Qn)}const or={type:"default",message:(0,Bn.__)("Forms can't be nested. Create separate forms instead.","elementor"),id:"form-nesting-blocked"};function ir(e){const t=qn(e);return!(!t||t!==Hn||!Kn(e.container)||(lr(),0))}function sr(e){const{containers:t=[e.container],target:n}=e;return!(!t.some(e=>{return!!e&&(t=e,n=Hn,(0,l.getAllDescendants)(t).some(e=>Yn(e)===n));var t,n})||!Kn(n)||(lr(),0))}function ar(e){const{storageType:t}=e;if("localstorage"!==t)return!1;const n=window?.elementorCommon?.storage?.get();return!!n?.clipboard?.elements&&!(!Jn(n.clipboard.elements,Hn)||!Kn(e.container)||(lr(),0))}function lr(){(0,Wn.notify)(or)}const cr=_n();function ur(e){return e}const dr=()=>"";const mr=e=>e&&0!==Object.keys(e).length?{min:e.min||null,max:e.max||null}:null,pr=e=>e.map(e=>{const t=(e.date||"").trim(),n=(e.time||"").trim();return t||n?`${t} ${n}`.trim():""}).join(" "),fr=e=>e?.content??"",hr=e=>e?.content??"",gr=({destination:e,isTargetBlank:t,tag:n})=>({href:"number"==typeof e?"#post-id-"+e:e,target:t?"_blank":"_self",tag:n??"a"}),yr=({id:e})=>e??null,vr=e=>e&&0!==Object.keys(e).length?{min:e.min||null,max:e.max||null}:null,br=e=>({id:e.id??null,url:e.url??null,alt:e.alt??null});var wr=window.elementorV2.wpMedia;const Er=async e=>{const{src:t,size:n}=e;if(!t?.id)return t?.url?{src:t.url,alt:t.alt??""}:null;const r=await(0,wr.getMediaAttachment)({id:t.id}),o=r?.sizes?.[n??""];return o?{src:o.url,height:o.height,width:o.width,alt:r.alt}:r?{src:r.url,height:r.height,width:r.width,alt:r.alt}:null},Tr=e=>e,{entries:Sr,setPrototypeOf:Cr,isFrozen:xr,getPrototypeOf:_r,getOwnPropertyDescriptor:Rr}=Object;let{freeze:Ar,seal:kr,create:Or}=Object,{apply:Pr,construct:Ir}="undefined"!=typeof Reflect&&Reflect;Ar||(Ar=function(e){return e}),kr||(kr=function(e){return e}),Pr||(Pr=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return e.apply(t,r)}),Ir||(Ir=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new e(...n)});const Nr=Yr(Array.prototype.forEach),Lr=Yr(Array.prototype.lastIndexOf),$r=Yr(Array.prototype.pop),Mr=Yr(Array.prototype.push),Dr=Yr(Array.prototype.splice),jr=Yr(String.prototype.toLowerCase),Vr=Yr(String.prototype.toString),zr=Yr(String.prototype.match),Ur=Yr(String.prototype.replace),Fr=Yr(String.prototype.indexOf),Wr=Yr(String.prototype.trim),Br=Yr(Object.prototype.hasOwnProperty),Hr=Yr(RegExp.prototype.test),Gr=(qr=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Ir(qr,t)});var qr;function Yr(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return Pr(e,t,r)}}function Xr(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:jr;Cr&&Cr(e,null);let r=t.length;for(;r--;){let o=t[r];if("string"==typeof o){const e=n(o);e!==o&&(xr(t)||(t[r]=e),o=e)}e[o]=!0}return e}function Kr(e){for(let t=0;t<e.length;t++)Br(e,t)||(e[t]=null);return e}function Jr(e){const t=Or(null);for(const[n,r]of Sr(e))Br(e,n)&&(Array.isArray(r)?t[n]=Kr(r):r&&"object"==typeof r&&r.constructor===Object?t[n]=Jr(r):t[n]=r);return t}function Zr(e,t){for(;null!==e;){const n=Rr(e,t);if(n){if(n.get)return Yr(n.get);if("function"==typeof n.value)return Yr(n.value)}e=_r(e)}return function(){return null}}const Qr=Ar(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),eo=Ar(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),to=Ar(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),no=Ar(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),ro=Ar(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),oo=Ar(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),io=Ar(["#text"]),so=Ar(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),ao=Ar(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),lo=Ar(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),co=Ar(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),uo=kr(/\{\{[\w\W]*|[\w\W]*\}\}/gm),mo=kr(/<%[\w\W]*|[\w\W]*%>/gm),po=kr(/\$\{[\w\W]*/gm),fo=kr(/^data-[\-\w.\u00B7-\uFFFF]+$/),ho=kr(/^aria-[\-\w]+$/),go=kr(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),yo=kr(/^(?:\w+script|data):/i),vo=kr(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),bo=kr(/^html$/i),wo=kr(/^[a-z][.\w]*(-[.\w]+)+$/i);var Eo=Object.freeze({__proto__:null,ARIA_ATTR:ho,ATTR_WHITESPACE:vo,CUSTOM_ELEMENT:wo,DATA_ATTR:fo,DOCTYPE_NAME:bo,ERB_EXPR:mo,IS_ALLOWED_URI:go,IS_SCRIPT_OR_DATA:yo,MUSTACHE_EXPR:uo,TMPLIT_EXPR:po});const To=function(){return"undefined"==typeof window?null:window};var So=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:To();const n=t=>e(t);if(n.version="3.3.0",n.removed=[],!t||!t.document||9!==t.document.nodeType||!t.Element)return n.isSupported=!1,n;let{document:r}=t;const o=r,i=o.currentScript,{DocumentFragment:s,HTMLTemplateElement:a,Node:l,Element:c,NodeFilter:u,NamedNodeMap:d=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:m,DOMParser:p,trustedTypes:f}=t,h=c.prototype,g=Zr(h,"cloneNode"),y=Zr(h,"remove"),v=Zr(h,"nextSibling"),b=Zr(h,"childNodes"),w=Zr(h,"parentNode");if("function"==typeof a){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let E,T="";const{implementation:S,createNodeIterator:C,createDocumentFragment:x,getElementsByTagName:_}=r,{importNode:R}=o;let A={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof Sr&&"function"==typeof w&&S&&void 0!==S.createHTMLDocument;const{MUSTACHE_EXPR:k,ERB_EXPR:O,TMPLIT_EXPR:P,DATA_ATTR:I,ARIA_ATTR:N,IS_SCRIPT_OR_DATA:L,ATTR_WHITESPACE:$,CUSTOM_ELEMENT:M}=Eo;let{IS_ALLOWED_URI:D}=Eo,j=null;const V=Xr({},[...Qr,...eo,...to,...ro,...io]);let z=null;const U=Xr({},[...so,...ao,...lo,...co]);let F=Object.seal(Or(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),W=null,B=null;const H=Object.seal(Or(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let G=!0,q=!0,Y=!1,X=!0,K=!1,J=!0,Z=!1,Q=!1,ee=!1,te=!1,ne=!1,re=!1,oe=!0,ie=!1,se=!0,ae=!1,le={},ce=null;const ue=Xr({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let de=null;const me=Xr({},["audio","video","img","source","image","track"]);let pe=null;const fe=Xr({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),he="http://www.w3.org/1998/Math/MathML",ge="http://www.w3.org/2000/svg",ye="http://www.w3.org/1999/xhtml";let ve=ye,be=!1,we=null;const Ee=Xr({},[he,ge,ye],Vr);let Te=Xr({},["mi","mo","mn","ms","mtext"]),Se=Xr({},["annotation-xml"]);const Ce=Xr({},["title","style","font","a","script"]);let xe=null;const _e=["application/xhtml+xml","text/html"];let Re=null,Ae=null;const ke=r.createElement("form"),Oe=function(e){return e instanceof RegExp||e instanceof Function},Pe=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Ae||Ae!==e){if(e&&"object"==typeof e||(e={}),e=Jr(e),xe=-1===_e.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,Re="application/xhtml+xml"===xe?Vr:jr,j=Br(e,"ALLOWED_TAGS")?Xr({},e.ALLOWED_TAGS,Re):V,z=Br(e,"ALLOWED_ATTR")?Xr({},e.ALLOWED_ATTR,Re):U,we=Br(e,"ALLOWED_NAMESPACES")?Xr({},e.ALLOWED_NAMESPACES,Vr):Ee,pe=Br(e,"ADD_URI_SAFE_ATTR")?Xr(Jr(fe),e.ADD_URI_SAFE_ATTR,Re):fe,de=Br(e,"ADD_DATA_URI_TAGS")?Xr(Jr(me),e.ADD_DATA_URI_TAGS,Re):me,ce=Br(e,"FORBID_CONTENTS")?Xr({},e.FORBID_CONTENTS,Re):ue,W=Br(e,"FORBID_TAGS")?Xr({},e.FORBID_TAGS,Re):Jr({}),B=Br(e,"FORBID_ATTR")?Xr({},e.FORBID_ATTR,Re):Jr({}),le=!!Br(e,"USE_PROFILES")&&e.USE_PROFILES,G=!1!==e.ALLOW_ARIA_ATTR,q=!1!==e.ALLOW_DATA_ATTR,Y=e.ALLOW_UNKNOWN_PROTOCOLS||!1,X=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,K=e.SAFE_FOR_TEMPLATES||!1,J=!1!==e.SAFE_FOR_XML,Z=e.WHOLE_DOCUMENT||!1,te=e.RETURN_DOM||!1,ne=e.RETURN_DOM_FRAGMENT||!1,re=e.RETURN_TRUSTED_TYPE||!1,ee=e.FORCE_BODY||!1,oe=!1!==e.SANITIZE_DOM,ie=e.SANITIZE_NAMED_PROPS||!1,se=!1!==e.KEEP_CONTENT,ae=e.IN_PLACE||!1,D=e.ALLOWED_URI_REGEXP||go,ve=e.NAMESPACE||ye,Te=e.MATHML_TEXT_INTEGRATION_POINTS||Te,Se=e.HTML_INTEGRATION_POINTS||Se,F=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Oe(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(F.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Oe(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(F.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(F.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),K&&(q=!1),ne&&(te=!0),le&&(j=Xr({},io),z=[],!0===le.html&&(Xr(j,Qr),Xr(z,so)),!0===le.svg&&(Xr(j,eo),Xr(z,ao),Xr(z,co)),!0===le.svgFilters&&(Xr(j,to),Xr(z,ao),Xr(z,co)),!0===le.mathMl&&(Xr(j,ro),Xr(z,lo),Xr(z,co))),e.ADD_TAGS&&("function"==typeof e.ADD_TAGS?H.tagCheck=e.ADD_TAGS:(j===V&&(j=Jr(j)),Xr(j,e.ADD_TAGS,Re))),e.ADD_ATTR&&("function"==typeof e.ADD_ATTR?H.attributeCheck=e.ADD_ATTR:(z===U&&(z=Jr(z)),Xr(z,e.ADD_ATTR,Re))),e.ADD_URI_SAFE_ATTR&&Xr(pe,e.ADD_URI_SAFE_ATTR,Re),e.FORBID_CONTENTS&&(ce===ue&&(ce=Jr(ce)),Xr(ce,e.FORBID_CONTENTS,Re)),se&&(j["#text"]=!0),Z&&Xr(j,["html","head","body"]),j.table&&(Xr(j,["tbody"]),delete W.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw Gr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw Gr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');E=e.TRUSTED_TYPES_POLICY,T=E.createHTML("")}else void 0===E&&(E=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML(e){return e},createScriptURL(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}}(f,i)),null!==E&&"string"==typeof T&&(T=E.createHTML(""));Ar&&Ar(e),Ae=e}},Ie=Xr({},[...eo,...to,...no]),Ne=Xr({},[...ro,...oo]),Le=function(e){Mr(n.removed,{element:e});try{w(e).removeChild(e)}catch(t){y(e)}},$e=function(e,t){try{Mr(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){Mr(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(te||ne)try{Le(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},Me=function(e){let t=null,n=null;if(ee)e="<remove></remove>"+e;else{const t=zr(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===xe&&ve===ye&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const o=E?E.createHTML(e):e;if(ve===ye)try{t=(new p).parseFromString(o,xe)}catch(e){}if(!t||!t.documentElement){t=S.createDocument(ve,"template",null);try{t.documentElement.innerHTML=be?T:o}catch(e){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),ve===ye?_.call(t,Z?"html":"body")[0]:Z?t.documentElement:i},De=function(e){return C.call(e.ownerDocument||e,e,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},je=function(e){return e instanceof m&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof d)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Ve=function(e){return"function"==typeof l&&e instanceof l};function ze(e,t,r){Nr(e,e=>{e.call(n,t,r,Ae)})}const Ue=function(e){let t=null;if(ze(A.beforeSanitizeElements,e,null),je(e))return Le(e),!0;const r=Re(e.nodeName);if(ze(A.uponSanitizeElement,e,{tagName:r,allowedTags:j}),J&&e.hasChildNodes()&&!Ve(e.firstElementChild)&&Hr(/<[/\w!]/g,e.innerHTML)&&Hr(/<[/\w!]/g,e.textContent))return Le(e),!0;if(7===e.nodeType)return Le(e),!0;if(J&&8===e.nodeType&&Hr(/<[/\w]/g,e.data))return Le(e),!0;if(!(H.tagCheck instanceof Function&&H.tagCheck(r))&&(!j[r]||W[r])){if(!W[r]&&We(r)){if(F.tagNameCheck instanceof RegExp&&Hr(F.tagNameCheck,r))return!1;if(F.tagNameCheck instanceof Function&&F.tagNameCheck(r))return!1}if(se&&!ce[r]){const t=w(e)||e.parentNode,n=b(e)||e.childNodes;if(n&&t)for(let r=n.length-1;r>=0;--r){const o=g(n[r],!0);o.__removalCount=(e.__removalCount||0)+1,t.insertBefore(o,v(e))}}return Le(e),!0}return e instanceof c&&!function(e){let t=w(e);t&&t.tagName||(t={namespaceURI:ve,tagName:"template"});const n=jr(e.tagName),r=jr(t.tagName);return!!we[e.namespaceURI]&&(e.namespaceURI===ge?t.namespaceURI===ye?"svg"===n:t.namespaceURI===he?"svg"===n&&("annotation-xml"===r||Te[r]):Boolean(Ie[n]):e.namespaceURI===he?t.namespaceURI===ye?"math"===n:t.namespaceURI===ge?"math"===n&&Se[r]:Boolean(Ne[n]):e.namespaceURI===ye?!(t.namespaceURI===ge&&!Se[r])&&!(t.namespaceURI===he&&!Te[r])&&!Ne[n]&&(Ce[n]||!Ie[n]):!("application/xhtml+xml"!==xe||!we[e.namespaceURI]))}(e)?(Le(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!Hr(/<\/no(script|embed|frames)/i,e.innerHTML)?(K&&3===e.nodeType&&(t=e.textContent,Nr([k,O,P],e=>{t=Ur(t,e," ")}),e.textContent!==t&&(Mr(n.removed,{element:e.cloneNode()}),e.textContent=t)),ze(A.afterSanitizeElements,e,null),!1):(Le(e),!0)},Fe=function(e,t,n){if(oe&&("id"===t||"name"===t)&&(n in r||n in ke))return!1;if(q&&!B[t]&&Hr(I,t));else if(G&&Hr(N,t));else if(H.attributeCheck instanceof Function&&H.attributeCheck(t,e));else if(!z[t]||B[t]){if(!(We(e)&&(F.tagNameCheck instanceof RegExp&&Hr(F.tagNameCheck,e)||F.tagNameCheck instanceof Function&&F.tagNameCheck(e))&&(F.attributeNameCheck instanceof RegExp&&Hr(F.attributeNameCheck,t)||F.attributeNameCheck instanceof Function&&F.attributeNameCheck(t,e))||"is"===t&&F.allowCustomizedBuiltInElements&&(F.tagNameCheck instanceof RegExp&&Hr(F.tagNameCheck,n)||F.tagNameCheck instanceof Function&&F.tagNameCheck(n))))return!1}else if(pe[t]);else if(Hr(D,Ur(n,$,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==Fr(n,"data:")||!de[e])if(Y&&!Hr(L,Ur(n,$,"")));else if(n)return!1;return!0},We=function(e){return"annotation-xml"!==e&&zr(e,M)},Be=function(e){ze(A.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||je(e))return;const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:z,forceKeepAttr:void 0};let o=t.length;for(;o--;){const i=t[o],{name:s,namespaceURI:a,value:l}=i,c=Re(s),u=l;let d="value"===s?u:Wr(u);if(r.attrName=c,r.attrValue=d,r.keepAttr=!0,r.forceKeepAttr=void 0,ze(A.uponSanitizeAttribute,e,r),d=r.attrValue,!ie||"id"!==c&&"name"!==c||($e(s,e),d="user-content-"+d),J&&Hr(/((--!?|])>)|<\/(style|title|textarea)/i,d)){$e(s,e);continue}if("attributename"===c&&zr(d,"href")){$e(s,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){$e(s,e);continue}if(!X&&Hr(/\/>/i,d)){$e(s,e);continue}K&&Nr([k,O,P],e=>{d=Ur(d,e," ")});const m=Re(e.nodeName);if(Fe(m,c,d)){if(E&&"object"==typeof f&&"function"==typeof f.getAttributeType)if(a);else switch(f.getAttributeType(m,c)){case"TrustedHTML":d=E.createHTML(d);break;case"TrustedScriptURL":d=E.createScriptURL(d)}if(d!==u)try{a?e.setAttributeNS(a,s,d):e.setAttribute(s,d),je(e)?Le(e):$r(n.removed)}catch(t){$e(s,e)}}else $e(s,e)}ze(A.afterSanitizeAttributes,e,null)},He=function e(t){let n=null;const r=De(t);for(ze(A.beforeSanitizeShadowDOM,t,null);n=r.nextNode();)ze(A.uponSanitizeShadowNode,n,null),Ue(n),Be(n),n.content instanceof s&&e(n.content);ze(A.afterSanitizeShadowDOM,t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,i=null,a=null,c=null;if(be=!e,be&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Ve(e)){if("function"!=typeof e.toString)throw Gr("toString is not a function");if("string"!=typeof(e=e.toString()))throw Gr("dirty is not a string, aborting")}if(!n.isSupported)return e;if(Q||Pe(t),n.removed=[],"string"==typeof e&&(ae=!1),ae){if(e.nodeName){const t=Re(e.nodeName);if(!j[t]||W[t])throw Gr("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof l)r=Me("\x3c!----\x3e"),i=r.ownerDocument.importNode(e,!0),1===i.nodeType&&"BODY"===i.nodeName||"HTML"===i.nodeName?r=i:r.appendChild(i);else{if(!te&&!K&&!Z&&-1===e.indexOf("<"))return E&&re?E.createHTML(e):e;if(r=Me(e),!r)return te?null:re?T:""}r&&ee&&Le(r.firstChild);const u=De(ae?e:r);for(;a=u.nextNode();)Ue(a),Be(a),a.content instanceof s&&He(a.content);if(ae)return e;if(te){if(ne)for(c=x.call(r.ownerDocument);r.firstChild;)c.appendChild(r.firstChild);else c=r;return(z.shadowroot||z.shadowrootmode)&&(c=R.call(o,c,!0)),c}let d=Z?r.outerHTML:r.innerHTML;return Z&&j["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&Hr(bo,r.ownerDocument.doctype.name)&&(d="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+d),K&&Nr([k,O,P],e=>{d=Ur(d,e," ")}),E&&re?E.createHTML(d):d},n.setConfig=function(){Pe(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Q=!0},n.clearConfig=function(){Ae=null,Q=!1},n.isValidAttribute=function(e,t,n){Ae||Pe({});const r=Re(e),o=Re(t);return Fe(r,o,n)},n.addHook=function(e,t){"function"==typeof t&&Mr(A[e],t)},n.removeHook=function(e,t){if(void 0!==t){const n=Lr(A[e],t);return-1===n?void 0:Dr(A[e],n,1)[0]}return $r(A[e])},n.removeHooks=function(e){A[e]=[]},n.removeAllHooks=function(){A={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}();const Co="width: 100%; height: 100%; overflow: unset;",xo=async(e,{signal:t})=>{const n=function(e){return"number"!=typeof e||e<=0?null:e}(e.id),r="string"==typeof e.url?e.url:null;let o=r;if(n&&!r){const e=await(0,wr.getMediaAttachment)({id:n});o=e?.url??null}const i="string"==typeof o?o:null;if(!i)return{html:null,url:null};const s=await async function(e,t){try{const n=await fetch(e,{signal:t});if(!n.ok)return null;const r=n.headers.get("content-type")??"";return r.includes("svg")||r.includes("xml")||e.endsWith(".svg")?await n.text():null}catch{return null}}(i,t),a=s?function(e){const t=So.sanitize(e,{USE_PROFILES:{svg:!0,svgFilters:!0}}),n=(new DOMParser).parseFromString(t,"image/svg+xml").querySelector("svg");if(!n)return null;n.setAttribute("fill","currentColor");const r=(n.getAttribute("style")??"").trim(),o=r?`${r.replace(/;$/,"")}; ${Co}`:Co;return n.setAttribute("style",o),n.outerHTML}(s):null;return{html:a,url:i}},_o=async e=>{const{id:t,url:n}=e;if(!t)return{id:null,url:n};const r=await(0,wr.getMediaAttachment)({id:t});return{id:t,url:r?.url??n}},Ro=e=>{const{color:t=null}=e;return t?`linear-gradient(${t}, ${t})`:null},Ao=e=>"radial"===e.type?`radial-gradient(circle at ${e.positions}, ${e.stops})`:`linear-gradient(${e.angle}deg, ${e.stops})`,ko=e=>{const{image:t,size:n=null,position:r=null,repeat:o=null,attachment:i=null}=e;return t?{src:t.src?`url(${t.src})`:null,repeat:o,attachment:i,size:n,position:r}:null},Oo=({width:e,height:t})=>`${e??"auto"} ${t??"auto"}`,Po=e=>{if(!e||0===e.length)return null;const t=e.map(e=>"string"==typeof e?{src:e,repeat:null,attachment:null,size:null,position:null}:e).filter(e=>e&&!!e.src);return 0===t.length?null:{"background-image":Io(t,"src","none",!0),"background-repeat":Io(t,"repeat","repeat"),"background-attachment":Io(t,"attachment","scroll"),"background-size":Io(t,"size","auto auto"),"background-position":Io(t,"position","0% 0%")}};function Io(e,t,n,r=!1){if(0===e.filter(e=>e?.[t]).length)return n;const o=e.map(e=>e[t]??n);return!r&&o.every(e=>e===o[0])?o[0]:o.join(",")}const No=e=>{const{color:t=null,"background-overlay":n=null,clip:r=null}=e;return Tn({...n,"background-color":t,"background-clip":r})},Lo=e=>`${e?.color} ${e?.offset??0}%`,$o=e=>t=>t?.length?t.filter(Boolean).join(e):null,Mo=(e,t)=>(n,{key:r})=>{const o=e.filter(e=>n[e]).map(e=>[t({propKey:r,key:e}),n[e]]);return Tn(Object.fromEntries(o))},Do=e=>e?.length<1?null:e.filter(Boolean).map(jo).join(" "),jo=e=>{if("drop-shadow"===e.func){const{xAxis:t,yAxis:n,blur:r,color:o}=e.args;return`drop-shadow(${t||"0px"} ${n||"0px"} ${r||"10px"} ${o||"transparent"})`}const t=e.args?.size;return e.func&&t?`${e.func}(${t})`:""},Vo=e=>{const t=e.flexGrow,n=e.flexShrink,r=e.flexBasis,o=null!=t,i=null!=n,s=null!=r;return o||i||s?o&&i&&s?`${t} ${n} ${"object"==typeof r&&void 0!==r.size?`${r.size}${r.unit||""}`:r}`:o&&i&&!s?`${t} ${n}`:o&&!i&&s?`${t} 1 ${"object"==typeof r&&void 0!==r.size?`${r.size}${r.unit||""}`:r}`:!o&&i&&s?`0 ${n} ${"object"==typeof r&&void 0!==r.size?`${r.size}${r.unit||""}`:r}`:!o||i||s?o||!i||s?o||i||!s?null:`0 1 ${"object"==typeof r&&void 0!==r.size?`${r.size}${r.unit||""}`:r}`:`0 ${n}`:`${t}`:null};function zo(e){return`${e??"0px"}`}const Uo=e=>`${zo(e?.x)} ${zo(e?.y)}`,Fo=({x:e,y:t})=>`${e??"0px"} ${t??"0px"}`,Wo=e=>[e.hOffset,e.vOffset,e.blur,e.spread,e.color,e.position].filter(Boolean).join(" "),Bo=e=>"auto"===e.unit?"auto":"custom"===e.unit?e.size:`${e.size}${e.unit}`,Ho=e=>e||0===e?"span "+e:null,Go=e=>{const t={"-webkit-text-stroke":`${e.width} ${e.color}`,stroke:`${e.color}`,"stroke-width":`${e.width}`};return Tn(t)},qo=e=>e?.length<1?null:e.join(" "),Yo="0px",Xo=e=>`translate3d(${e.x??Yo}, ${e.y??Yo}, ${e.z??Yo})`;function Ko(e){return`${e??"0px"}`}const Jo=e=>{const t=Ko(e.x),n=Ko(e.y),r=Ko(e.z);return"50%"===t&&"50%"===n&&"0px"===r?null:`${t} ${n} ${r}`},Zo="0deg",Qo=e=>[`rotateX(${e?.x??Zo})`,`rotateY(${e?.y??Zo})`,`rotateZ(${e?.z??Zo})`].join(" "),ei=e=>`scale3d(${e.x??1}, ${e.y??1}, ${e.z??1})`,ti="0deg",ni=e=>`skew(${e?.x??ti}, ${e?.y??ti})`;var ri=window.elementorV2.editorControls;const oi=e=>{if(e?.length<1)return null;const t=(()=>{const e=new Set;return ri.transitionProperties.forEach(t=>{t.properties.forEach(t=>{e.add(t.value)})}),e})(),n=e.map(e=>ii(e,t)).filter(Boolean);return 0===n.length?null:n.join(", ")},ii=(e,t)=>{if(!e.selection||!e.size)return"";const n=e.selection.value;return t.has(n)?`${n} ${e.size}`:""};var si=window.elementorV2.twing;function ai(e){return["a","article","aside","button","div","footer","h1","h2","h3","h4","h5","h6","header","main","nav","p","section","span"].includes(e)?e:"div"}function li(e){const t=["http:","https:","mailto:","tel:"];try{const n=new URL(e);return t.includes(n.protocol)?e:""}catch{return""}}function ci(){const e=window;return class extends e.elementor.modules.elements.views.Widget{onRender(...e){super.onRender(...e),this.#e("elementor/preview/atomic-widget/render"),this.#t("elementor/element/render")}onDestroy(...e){super.onDestroy(...e),this.#e("elementor/preview/atomic-widget/destroy"),this.#t("elementor/element/destroy")}attributes(){return{...super.attributes(),"data-atomic":"",style:"display: contents !important;"}}behaviors(){const e=["InlineEditing","Draggable","Resizable"],t=Object.entries(super.behaviors()).filter(([t])=>!e.includes(t));return Object.fromEntries(t)}getDomElement(){return this.$el.find(":first-child")}getHandlesOverlay(){return null}#e(e){window.top?.dispatchEvent(new CustomEvent(e,{detail:{id:this.model.get("id")}}))}#t(t){const n=this.getDomElement().get(0);n&&e.elementor?.$preview?.[0]?.contentWindow.dispatchEvent(new CustomEvent(t,{detail:{id:this.model.get("id"),type:this.model.get("widgetType"),element:n}}))}getContextMenuGroups(){return super.getContextMenuGroups().filter(e=>"save"!==e.name)}}}function ui({renderer:e,element:t}){const n=t.twig_main_template,r=t.base_styles_dictionary;return Object.entries(t.twig_templates).forEach(([t,n])=>{e.register(t,n)}),{templateKey:n,baseStylesDictionary:r,resolveProps:xn({transformers:cr,schema:t.atomic_props_schema})}}function di(e){e._ensureViewIsIntact(),e._isRendering=!0,e.resetChildViewContainer(),e.triggerMethod("before:render",e)}function mi(e){e._isRendering=!1,e.isRendered=!0,e.triggerMethod("render",e)}function pi(e){e.children?.each(e=>{e.render()})}async function fi(e){const t=[];e.children?.each(e=>{e._currentRenderPromise&&t.push(e._currentRenderPromise)}),t.length>0&&await Promise.all(t)}function hi(e){return!!(e.atomic_props_schema&&e.twig_templates&&e.twig_main_template&&e.base_styles_dictionary)}function gi({type:e,renderer:t,element:n}){const r=ci(),{templateKey:o,baseStylesDictionary:i,resolveProps:s}=ui({type:e,renderer:t,element:n});return class extends r{_abortController=null;_lastResolvedSettingsHash=null;_domUpdateWasSkipped=!1;getTemplateType(){return"twig"}getNamespaceKey(){return e}renderOnChange(){this.render()}getRenderContext(){return this._parent?.getRenderContext?.()}getResolverRenderContext(){return this._parent?.getResolverRenderContext?.()}invalidateRenderCache(){this._lastResolvedSettingsHash=null}render(){this._abortController?.abort(),this._abortController=new AbortController;const e=wn(this._abortController.signal).then(()=>this._beforeRender()).then(()=>this._renderTemplate()).then(()=>this._renderChildren()).then(()=>this._afterRender());return this._currentRenderPromise=e.execute(),this._currentRenderPromise}async _renderChildren(){this._shouldReuseChildren()?pi(this):super._renderChildren(),await fi(this)}_shouldReuseChildren(){return this._domUpdateWasSkipped&&this.children?.length>0}async _renderTemplate(){this.triggerMethod("before:render:template");const n=wn(this._abortController?.signal).then((e,t)=>{const n=this.model.get("settings").toJSON();return s({props:n,signal:t,renderContext:this.getResolverRenderContext()})}).then(e=>this.afterSettingsResolve(e)).then(async n=>{const r=JSON.stringify(n);if(r===this._lastResolvedSettingsHash&&this.isRendered)return this._domUpdateWasSkipped=!0,null;this._domUpdateWasSkipped=!1,this._lastResolvedSettingsHash=r;const s={id:this.model.get("id"),interaction_id:this.getInteractionId(),type:e,settings:n,base_styles:i};return t.render(o,s)}).then(e=>{null!==e&&this.$el.html(e)});await n.execute(),this.bindUIElements(),this.triggerMethod("render:template")}afterSettingsResolve(e){return e}_beforeRender(){di(this)}_afterRender(){mi(this)}_doAfterRender(e){this.isRendered?e():this.once("render",e)}_openEditingPanel(e){this._doAfterRender(()=>super._openEditingPanel(e))}getInteractionId(){const e=this.model.get("originId"),t=this.model.get("id");return e??t}}}function yi(e){return hi(e)&&"support_nesting"in e&&!!e.support_nesting}function vi({type:e,renderer:t,element:n,modelExtensions:r}){const o=window;return class extends o.elementor.modules.elements.types.Base{getType(){return e}getView(){return Ei({type:e,renderer:t,element:n})}getModel(){const e=o.elementor.modules.elements.models.AtomicElementBase;return r&&Object.keys(r).length>0?e.extend(r):e}}}function bi(e){const t=e.get("id"),n=e.get("originId"),r={"data-model-cid":e.cid??"","data-interaction-id":n??t,"x-ignore":"true"};return Object.entries(r).map(([e,t])=>`${e}="${t}"`).join(" ")}function wi(e){return["elementor-element","elementor-element-edit-mode",`elementor-element-${e.get("id")}`].join(" ")}function Ei({type:e,renderer:t,element:n}){const r=window,{templateKey:o,baseStylesDictionary:i,resolveProps:s}=ui({type:e,renderer:t,element:n}),a=r.elementor.modules.elements.views.createAtomicElementBase(e),c=a.prototype._renderChildren,u=a.prototype._openEditingPanel,d=a.prototype.addElement;return a.extend({_abortController:null,_lastResolvedSettingsHash:null,_domUpdateWasSkipped:!1,template:!1,attributes(){return{"data-model-cid":this.model.cid}},getTemplateType(){return"twig"},invalidateRenderCache(){this._lastResolvedSettingsHash=null},renderOnChange(){this.render()},render(){this._abortController?.abort(),this._abortController=new AbortController;const e=wn(this._abortController.signal).then(()=>this._beforeRender()).then(()=>this._renderTemplate()).then(()=>this._onTemplateReady()).then(()=>this._renderChildren()).then(()=>this._afterRender());return this._currentRenderPromise=e.execute(),this._currentRenderPromise},_beforeRender(){di(this)},_onTemplateReady(){this.dispatchPreviewEvent("elementor/element/render")},_afterRender(){mi(this),this.dispatchPreviewEvent("elementor/element/rendered"),requestAnimationFrame(()=>{this._initAlpine()}),this.model.trigger("render:complete"),window.dispatchEvent(new CustomEvent(l.ELEMENT_STYLE_CHANGE_EVENT))},async _renderTemplate(){const n=this.model;this.triggerMethod("before:render:template");const r=wn(this._abortController?.signal).then((e,t)=>{const r=n.get("settings").toJSON();return s({props:r,signal:t,renderContext:this.getResolverRenderContext?.()})}).then(async r=>{const s=JSON.stringify(r);if(s===this._lastResolvedSettingsHash&&this.isRendered)return this._domUpdateWasSkipped=!0,null;this._domUpdateWasSkipped=!1,this._lastResolvedSettingsHash=s;const a={id:n.get("id"),interaction_id:this.getInteractionId(),type:e,settings:r,base_styles:i,editor_attributes:bi(n),editor_classes:wi(n)};return t.render(o,a)}).then(e=>{null!==e&&this._attachTwigContent(e)});await r.execute(),this.bindUIElements(),this.triggerMethod("render:template")},getRenderContext(){return this._parent?.getRenderContext?.()},getResolverRenderContext(){return this._parent?.getResolverRenderContext?.()},getChildType(){const e=n.allowed_child_types??[];return e&&e.length>0?e:a.prototype.getChildType.call(this)},_attachTwigContent(e){const t=r.jQuery(e),n=this.$el.get(0),o=t.get(0);if(!n||!o)return;this._destroyAlpine();const i=this.getHandlesOverlay()?.get(0)?.outerHTML??"",s=n.tagName!==o.tagName,a=s?(n.ownerDocument??document).createElement(o.tagName):n;Array.from(o.attributes).forEach(e=>{a.setAttribute(e.name,e.value)}),a.innerHTML=i+o.innerHTML,s&&(n.replaceWith(a),this.setElement(r.jQuery(a)))},async _renderChildren(){this._shouldReuseChildren()?pi(this):c.call(this),await fi(this),this._removeChildrenPlaceholder()},_shouldReuseChildren(){return this._domUpdateWasSkipped&&this.children?.length>0},_removeChildrenPlaceholder(){const e=this.$el.get(0);if(!e)return;const t=Array.from(e.childNodes).find(e=>e.nodeType===Node.COMMENT_NODE&&"elementor-children-placeholder"===e.nodeValue?.trim());t?.remove()},getChildViewContainer(){return this.childViewContainer="",this.$el},attachBuffer(e,t){const n=this.$el.get(0);if(!n)return;const r=Array.from(n.childNodes).find(e=>e.nodeType===Node.COMMENT_NODE&&"elementor-children-placeholder"===e.nodeValue?.trim());r?(r.parentNode?.insertBefore(t,r),r.remove()):n.append(t)},getDomElement(){return this.$el},onBeforeDestroy(){this._abortController?.abort()},onDestroy(){this.dispatchPreviewEvent("elementor/element/destroy")},_destroyAlpine(){const e=this.$el.get(0);if(!e)return;if(!e.getAttribute("x-data"))return;const t=e.ownerDocument?.defaultView;t?.Alpine?.destroyTree(e)},_initAlpine(){const e=this.$el.get(0);if(!e)return;if(e.removeAttribute("x-ignore"),!e.getAttribute("x-data"))return;const t=e.ownerDocument?.defaultView;t?.Alpine?.initTree(e)},_doAfterRender(e){this.isRendered?e():this.once("render",e)},_openEditingPanel(e){this._doAfterRender(()=>u.call(this,e))},addElement(e,t){return this.isRendered?d.call(this,e,t):function(e,t,n={}){const r=e.getContainer(),o={...t};if(o.id||(o.id=(0,l.generateElementId)()),o.elements||(o.elements=[]),!(0,l.addModelToParent)(r.id,o,n))return;const i=o.id,s=(0,l.findModelInDocument)(i);if(!s)return;const a={id:i,settings:{get:()=>({}),set:()=>({}),toJSON:()=>({})},parent:r,model:s,view:void 0,lookup(){return(0,l.getContainer)(i)??a}};return e.once("render",()=>{e.model?.trigger?.("navigator:add",s,n)}),!1!==n.edit&&function(e,t){e.once("render",()=>{const n=(0,l.getContainer)(t);n?.model?.trigger?n.model.trigger("request:edit"):e.model?.trigger?.("request:edit")})}(e,i),{getContainer:()=>a}}(this,e,t)},getInteractionId(){const e=this.model.get("originId"),t=this.model.get("id");return e??t}})}var Ti=o(5338);const Si="before",Ci="after",xi="never";class _i{constructor(e){this.getSetting=e.getSetting,this.setSetting=e.setSetting,this.element=e.element,this.type=e.type,this.id=e.id,this.refreshView=e.refreshView,this.reactRoot=e.reactRoot,this.reactContainer=e.reactContainer}static getTypes(){return null}shouldRenderReplacement(){return!0}originalMethodsToTrigger(){return{_beforeRender:Si,_afterRender:Ci,renderOnChange:xi,onDestroy:xi,render:xi}}}const Ri=["#elementor-editor-wrapper-v2","#elementor-navigator","#elementor-panel"],Ai={backgroundColor:"transparent",border:"none",outline:"none",boxShadow:"none",padding:"0",margin:"0",borderRadius:"0",overflow:"hidden",opacity:"0",pointerEvents:"none",position:"absolute",display:"block"},ki={"e-button":"text","e-form-label":"text","e-heading":"title","e-paragraph":"paragraph","e-form-submit-button":"text"},Oi=(e,t)=>t?e.querySelector(t):null,Pi=(e,t)=>{const n=Ni(e,t);n&&e.body.removeChild(n)},Ii=e=>`inline-editing-toolbar-anchor-${e}`,Ni=(e,t)=>e.getElementById(Ii(t)),Li=(e,t,n)=>{const{width:r,height:o}=t;Object.assign(e.style,{...Ai,top:t.top-n.top+"px",left:t.left-n.left+"px",width:`${r}px`,height:`${o}px`})},$i={name:"horizontalShifter",fn(e){const{x:t,y:n,elements:{reference:r,floating:o}}=e,i={...e,x:t,y:n};if(t<0)return i.x=0,i;const s=r.getBoundingClientRect(),a=t+o.offsetWidth,l=r.ownerDocument.body.offsetWidth;if(a>l&&s.right<a){const e=a-l;return i.x=t-e,i}return i}},Mi=({elementClasses:e,initialValue:t,expectedTag:n,rootElement:r,contentElement:o,id:i,setValue:s,requestDestroy:a})=>{const[l,c]=(0,T.useState)(!0),[u,d]=(0,T.useState)(null),{onSelectionEnd:m,anchor:p,clearAnchor:f}=((e,t)=>{const[n,r]=(0,T.useState)(null);(0,T.useEffect)(()=>{n||Pi(e,t)},[n,e,t]);const o=(0,T.useCallback)(()=>{r(null)},[]);return{onSelectionEnd:n=>{const o=!n.state.selection.empty;Pi(e,t),r(o?((e,t)=>{const n=e.defaultView,r=n?.getSelection();if(!r)return null;const o=r.getRangeAt(0).getBoundingClientRect(),i=e.body.getBoundingClientRect(),s=e.createElement("span");return Li(s,o,i),s.setAttribute("id",Ii(t)),e.body.appendChild(s),s})(e,t):null)},anchor:n,clearAnchor:o}})(r.ownerDocument,i);(0,T.useEffect)(()=>{l||(f(),a())},[l,f,a]);const h=(0,T.useCallback)(()=>{d(null),c(!1)},[]);return(e=>{const t=(0,T.useCallback)(()=>queueMicrotask(e),[e]);(0,T.useEffect)(()=>(Ri.forEach(e=>document?.querySelector(e)?.addEventListener("mousedown",t)),()=>Ri.forEach(e=>document?.querySelector(e)?.removeEventListener("mousedown",t))),[])})(h),(0,T.useEffect)(()=>{const e=o.ownerDocument,t=e=>{o.contains(e.target)||h()};return e.addEventListener("mousedown",t),()=>e.removeEventListener("mousedown",t)},[o,h]),l?T.createElement(O.ThemeProvider,null,T.createElement(Di,{expectedTag:n,rootElement:r,id:i}),T.createElement(ri.InlineEditor,{onEditorCreate:d,mountElement:o,editorProps:{attributes:{style:"outline: none; display: inherit; justify-content: inherit; align-items: inherit; flex-direction: inherit; text-align: inherit;"}},elementClasses:e,value:t,setValue:s,onBlur:h,autofocus:!0,onSelectionEnd:m}),p&&u&&T.createElement(ji,{anchor:p,editor:u,id:i})):null},Di=({expectedTag:e,rootElement:t,id:n})=>{const r=Oi(t,e),[o,i]=(0,T.useState)(r);return(0,T.useEffect)(()=>{i(Oi(t,e))},[e,t]),o?T.createElement(rn,{element:o,id:n,isSelected:!0}):null},ji=({anchor:e,editor:t,id:n})=>{const{refs:r,floatingStyles:o}=Jt({placement:"top",strategy:"fixed",transform:!1,whileElementsMounted:ht,middleware:[$i,Ct()]});return(0,T.useLayoutEffect)(()=>(r.setReference(e),()=>r.setReference(null)),[e,r]),T.createElement(Xt,{id:tn},T.createElement(O.Box,{ref:r.setFloating,role:"presentation",style:{...o,pointerEvents:"none"}},T.createElement(ri.InlineEditorToolbar,{editor:t,elementId:n})))},Vi=new Set([u.htmlV3PropTypeUtil.key,u.stringPropTypeUtil.key]);class zi extends _i{handlerAttached=!1;editing=!1;getReplacementKey(){return"inline-editing"}static getTypes(){return Object.keys(ki)}isEditingModeActive(){return this.editing}shouldRenderReplacement(){return this.isInlineEditingEligible()&&"edit"===(0,s.getCurrentEditMode)()}handleRenderInlineEditor=()=>{!this.isEditingModeActive()&&this.isInlineEditingEligible()&&this.renderInlineEditor()};renderOnChange(){this.isEditingModeActive()||this.refreshView()}onDestroy(){this.resetInlineEditorRoot()}_beforeRender(){this.resetInlineEditorRoot()}_afterRender(){this.isInlineEditingEligible()&&!this.handlerAttached&&(this.element.addEventListener("click",this.handleRenderInlineEditor),this.handlerAttached=!0)}originalMethodsToTrigger(){const e=this.isEditingModeActive()?xi:Si,t=this.isEditingModeActive()?xi:Ci;return{_beforeRender:e,_afterRender:t,renderOnChange:t,onDestroy:Ci,render:e}}resetInlineEditorRoot(){this.element.removeEventListener("click",this.handleRenderInlineEditor),this.handlerAttached=!1,this.reactRoot.render(null),this.editing=!1}unmountInlineEditor(){this.resetInlineEditorRoot(),this.refreshView()}isInlineEditingEligible(){const e=this.getInlineEditablePropertyName();return(({rawValue:e,propTypeFromSchema:t})=>null==e?(e=>{return!!e&&(!(!("key"in e)||(t=e.key,!Vi.has(t)))||"union"===e.kind&&[...Vi].some(t=>e.prop_types[t]));var t})(t):u.htmlV3PropTypeUtil.isValid(e)||u.stringPropTypeUtil.isValid(e))({rawValue:this.getSetting(e),propTypeFromSchema:this.getInlineEditablePropType()})}getInlineEditablePropertyName(){return ki[this.type]??""}getInlineEditablePropType(){const e=(0,l.getElementType)(this.type)?.propsSchema,t=this.getInlineEditablePropertyName();return e?.[t]??null}getInlineEditablePropValue(){const e=this.getInlineEditablePropType(),t=this.getInlineEditablePropertyName();return this.getSetting(t)??e?.default??null}getExtractedContentValue(){const e=this.getInlineEditablePropValue(),t=u.htmlV3PropTypeUtil.extract(e);return u.stringPropTypeUtil.extract(t?.content??null)??""}setContentValue(e){const t=this.getInlineEditablePropertyName(),n=e||"",r=(0,u.parseHtmlChildren)(n),o=u.htmlV3PropTypeUtil.create({content:r.content?u.stringPropTypeUtil.create(r.content):null,children:r.children});(0,s.undoable)({do:()=>{const e=this.getInlineEditablePropValue();return this.runCommand(t,o),e},undo:(e,n)=>{this.runCommand(t,n??null)}},{title:(0,l.getElementLabel)(this.id),subtitle:(0,Bn.__)("%s edited","elementor").replace("%s",this.getInlineEditablePropTypeKey()??"Inline editing"),debounce:{wait:800}})()}getInlineEditablePropTypeKey(){const e=this.getInlineEditablePropType();if(!e)return null;if("union"===e.kind){const t=[u.htmlV3PropTypeUtil.key,u.stringPropTypeUtil.key];for(const n of t)if(e.prop_types[n])return n;return null}return"key"in e&&"string"==typeof e.key?e.key:null}runCommand(e,t){(0,s.__privateRunCommandSync)("document/elements/set-settings",{container:(0,l.getContainer)(this.id),settings:{[e]:t}},{internal:!0}),(0,s.__privateRunCommandSync)("document/save/set-is-modified",{status:!0},{internal:!0})}getExpectedTag(){const e=this.getTagPropType();return u.stringPropTypeUtil.extract(this.getSetting("tag")??null)??u.stringPropTypeUtil.extract(e?.default??null)??null}getTagPropType(){const e=(0,l.getElementType)(this.type)?.propsSchema;if(!e?.tag)return null;const t=e.tag??null;return"union"===t.kind?t.prop_types.string??null:t}renderInlineEditor(){this.isEditingModeActive()&&this.resetInlineEditorRoot();const e=this.element.children?.[0];if(!e)return;const t=e.classList.toString(),n=this.getExtractedContentValue(),r=this.getExpectedTag();e.innerHTML="",this.editing=!0,this.reactRoot.render(T.createElement(Mi,{elementClasses:t,initialValue:n,expectedTag:r,rootElement:this.element,contentElement:e,id:this.id,setValue:this.setContentValue.bind(this),requestDestroy:this.unmountInlineEditor.bind(this)}))}}const Ui=new Map,Fi=()=>{Wi(zi)},Wi=e=>{const t=e.getTypes();t&&t.forEach(t=>{Ui.set(t,e)})},Bi=e=>{const t=gi(e);return class extends t{#n=null;#r;#o;#i;constructor(...e){super(...e);const t=this.model.get("settings");this.#o=this.el.ownerDocument.createElement("div"),this.#o.style.display="none",this.el.ownerDocument.body.appendChild(this.#o),this.#i=(0,Ti.H)(this.#o),this.#r={getSetting:t.get.bind(t),setSetting:t.set.bind(t),element:this.el,type:this?.model?.get("widgetType")??this.container?.model?.get("elType")??null,id:this?.model?.get("id")??null,refreshView:this.refreshView.bind(this),reactRoot:this.#i,reactContainer:this.#o}}refreshView(){this.invalidateRenderCache?.(),this.render()}renderOnChange(){this.#s("renderOnChange")}render(){const e=this.#r,t=e.type,n=t?(r=t,Ui.get(r)??null):null;var r;n&&!this.#n&&(this.#n=new n(e)),this.#s("render")}onDestroy(){this.#s("onDestroy"),this.#i.unmount(),this.#o.remove()}_afterRender(){this.#s("_afterRender")}_beforeRender(){this.#s("_beforeRender")}#s(e){const n=t.prototype[e].bind(this),r=this.#n?.shouldRenderReplacement(),o=r&&this.#n?.[e]?.bind(this.#n);if(!o||!r)return n();const i=this.#n?.originalMethodsToTrigger()[e]??"never";"before"===i&&n(),o(),"after"===i&&n()}}},Hi=({type:e,renderer:t,element:n})=>{const r=window,o=Bi({type:e,renderer:t,element:n});return class extends r.elementor.modules.elements.types.Widget{getType(){return e}getView(){return o}}},Gi={},qi={};function Yi(e,t){qi[e]=t}function Xi(e,t){Gi[e]=t}function Ki(){(0,s.__privateListenTo)((0,s.v1ReadyEvent)(),()=>{const e=(0,l.getWidgetsCache)()??{},t=window,n=function(){const e=(0,si.createArrayLoader)({}),t=(0,si.createEnvironment)(e);return t.registerEscapingStrategy(ai,"html_tag"),t.registerEscapingStrategy(li,"full_url"),{register:e.setTemplate,render:t.render}}();!function(e){Object.entries(e).forEach(([e,t])=>{t.meta?.is_pro_promotion&&Xi(e,e=>function({type:e,renderer:t,element:n}){if(!yi(n))throw new Error(`Element "${e}" is not a valid nested templated element.`);const r=vi({type:e,renderer:t,element:n});let o=null;return class extends r{getView(){if(!o){const e=(new r).getView();o=function(e){return class extends e{_afterRender(){super._afterRender(),this.$el.off("click",".e-form-placeholder__remove-btn"),this.$el.on("click",".e-form-placeholder__remove-btn",e=>{e.preventDefault(),e.stopPropagation(),window.$e.run("document/elements/delete",{container:this.container})}),this.$el.off("click",".e-form-placeholder__unlock-btn"),this.$el.on("click",".e-form-placeholder__unlock-btn",e=>{e.stopPropagation()})}_renderChildren(){}behaviors(){const e=["InlineEditing","Draggable","Resizable"],t=Object.entries(super.behaviors()).filter(([t])=>!e.includes(t));return Object.fromEntries(t)}getContextMenuGroups(){return super.getContextMenuGroups().filter(e=>"save"!==e.name)}onDestroy(...e){super.onDestroy(...e),this.$el.off("click",".e-form-placeholder__remove-btn"),this.$el.off("click",".e-form-placeholder__unlock-btn")}}}(e)}return o}}}(e))})}(e),Object.entries(e).forEach(([e,r])=>{if(!r.atomic)return;const o=function(e,t,n){if(yi(n)){const r=Gi[e];return r?r({type:e,renderer:t,element:n}):function(e,t,n){return vi({type:e,renderer:t,element:n,modelExtensions:qi[e]})}(e,t,n)}if(!hi(n))return function(e){const t=window;return class extends t.elementor.modules.elements.types.Widget{getType(){return e}getView(){return ci()}}}(e);const r=Gi[e];return r?r({type:e,renderer:t,element:n}):Hi({type:e,renderer:t,element:n})}(e,n,r);!function(e,t,n,r){if(!(hi(n)||yi(n)))return;const o=e.elementor.elementsManager,i=Boolean(o.getElementTypeClass(t));try{o.registerElementType(new r)}catch{yi(n)&&i&&(o.elementTypes[t]=new r)}}(t,e,r,o)})})}const Ji={modifyDefaultChildren(e){if(!Array.isArray(e)||0===e.length)return e;const[t]=e,n=this.get("editor_settings")?.initial_position;if(!n||!t||"object"!=typeof t)return e;const r=t;return[{...r,settings:{...r.settings,paragraph:u.htmlV3PropTypeUtil.create({content:u.stringPropTypeUtil.create(`Tab ${n}`),children:[]})}},...e.slice(1)]}},Zi="elementor://context/available-widgets",Qi="elementor://context/available-widgets/v4",es="elementor://document/structure";function ts(){const e=window,t=e.elementor?.documents?.getCurrent?.();if(!t)return{error:"No active document found"};const n=(t.container?.children||[]).map(e=>rs(e));return{documentId:t.id,documentType:t.config.type,title:t.config.settings?.post_title||"Untitled",elements:n.filter(e=>null!==e)}}function ns(e){if(e.model?.config?.atomic)return"v4";const t=e.model?.attributes?.widgetType;return t&&(0,l.getWidgetsCache)()?.[t]?.atomic_props_schema?"v4":"v3"}function rs(e){if(!e||!e.model)return null;const t=e.model.attributes,n={id:t.id,elType:t.elType,widgetType:t.widgetType||void 0,version:ns(e)},r=t.title||e.model?.editor_settings?.title;return r&&(n.title=r),e.children&&e.children.length>0&&(n.children=e.children.map(e=>rs(e)).filter(e=>null!==e)),n}const os="elementor://context/editor-state";function is(){try{const e=window.elementor?.$previewContents?.[0];if(!e)return null;const t=[],n=e.cloneNode(!0);n.querySelectorAll(".elementor-editor-element-settings, #elementor-add-new-section").forEach(e=>{e.remove()});const r=(e,n=!1)=>{const o=e.classList?.contains("elementor-element")||n;if(e.nodeType===Node.TEXT_NODE&&o){const n=e.textContent?.trim().replace(/\s+/g," ");n&&n.length>2&&t.push(n)}else e.childNodes.forEach(e=>{r(e,o)})};r(n);const o=t.join(" ");return o.length>500?o.slice(0,500)+"...":o}catch{return null}}function ss(){try{const e=window,t=e.elementor?.documents?.getCurrent?.(),n=t?.config?.settings?.post_title;if(n)return n;let r=document.title||"Page";return r=r.split(/\s*[‹»|–—-]\s*/)[0],r.trim()||"Page"}catch{return"Page"}}const as="elementor://context/general",ls="elementor://context/selected-element";function cs(){const e=(0,l.getSelectedElements)();return 1!==e.length?{elementDisplayName:null,elementType:null,properties:null,selectedElementId:null,selectedParentId:null,version:null,widgetType:null}:us((0,l.getContainer)(e[0].id))}function us(e){if(!e?.id)return{elementDisplayName:null,elementType:null,properties:null,selectedElementId:null,selectedParentId:null,version:null,widgetType:null};const t=e.model.get("widgetType")??null,n=e.type??"widget";return{elementDisplayName:ps(e),elementType:n,properties:ms(e,t),selectedElementId:e.id,selectedParentId:e.parent?.id??null,version:ds(e,t),widgetType:t}}function ds(e,t){return e.model?.config?.atomic||t&&(0,l.getWidgetsCache)()?.[t]?.atomic_props_schema?"v4":"v3"}function ms(e,t){const n=e.settings?.toJSON?.();if(!n||"object"!=typeof n)return null;const r=t?(0,l.getWidgetsCache)()?.[t]:null,o=r?.controls,i={};for(const[e,t]of Object.entries(n)){if(null==t||""===t)continue;const n=o?.[e]?.default;void 0!==n&&JSON.stringify(t)===JSON.stringify(n)||(i[e]=t)}return Object.keys(i).length>0?i:null}function ps(e){try{if(e.label)return e.label;const t=e.model?.get?.("widgetType");return t?(t.charAt(0).toUpperCase()+t.slice(1)).replace(/-/g," "):"container"===e.type?"Container":"section"===e.type?"Section":`Element ${e.id}`}catch{return`Element ${e.id}`}}function fs(e,t){const n=window.elementorV2.editorVariables.Utils;return u.Schema.adjustLlmPropValueSchema(e,{forceKey:t,transformers:n.globalVariablesLLMResolvers})}const hs=e=>{const{elementId:t,propertyName:n,propertyValue:r,elementType:o}=e;if("_styles"===n){const e=(0,l.getElementStyles)(t)||{},n=r,o=(0,d.getStylesSchema)(),i=Object.fromEntries(Object.entries(n).map(([e,t])=>{if("custom_css"===e)return[e,t];const{key:n,kind:r}=o?.[e]||{};if(!n&&"union"!==r)throw new Error(`_styles property ${e} is not supported.`);return[e,fs(t,n)]}));let s;Object.keys(n).forEach(e=>{const t=o[e];if("custom_css"===e){let t=n[e];return"object"==typeof t&&t&&t.value&&(t=String(t.value)),t||(t=""),void(s={raw:btoa(t)})}if(!t)throw new Error(`Style property ${e} is not supported.`);if("plain"===t.kind&&"object"!=typeof n[e]){const r=(0,u.getPropSchemaFromCache)(t.key);if(r){const t=r.create(n[e]);n[e]=t}}}),delete i.custom_css;const a=Object.values(e).find(e=>"local"===e.label);return void(a?(0,l.updateElementStyle)({elementId:t,styleId:a.id,meta:{breakpoint:"desktop",state:null},...void 0!==s?{custom_css:s}:{},props:{...i}}):(0,l.createElementStyle)({elementId:t,...void 0!==s?{custom_css:s}:{},classesProp:"classes",label:"local",meta:{breakpoint:"desktop",state:null},props:{...i}}))}const i=(0,l.getWidgetsCache)()?.[o]?.atomic_props_schema;if(!i)throw new Error(`No prop schema found for element type: ${o}`);if(!i[n]){const e=Object.keys(i);throw new Error(`Property "${n}" does not exist on element type "${o}". Available properties are: ${e.join(", ")}`)}const a=i[n].key,c=fs(r,a),{valid:m,jsonSchema:p}=u.Schema.validatePropValue(i[n],r);if(!m)throw new Error(`Invalid PropValue for elementId: ${t}. PropKey: ${a}, PropValue: ${JSON.stringify(r)}\nExpected Schema: ${p}`);(0,l.updateElementSettings)({id:t,props:{[n]:c},withHistory:!1}),(0,s.__privateRunCommandSync)("document/save/set-is-modified",{status:!0},{internal:!0})};let gs=null;const ys={get widgetsSchema(){if(!gs){const e={},t=(0,l.getWidgetsCache)();if(!t)return{};Object.entries(t).forEach(([t,n])=>{n.atomic_props_schema&&(e[t]=structuredClone(n.atomic_props_schema))}),gs=e}return gs},validateProps(e,t,n=[]){if(!e)throw new Error("No schema provided for validation.");const r=[];let o=!1;return Object.entries(t).forEach(([t,i])=>{if(n.includes(t))return;const s=e[t];if(s)if(u.Schema.isPropKeyConfigurable(t,s)){const{valid:e}=u.Schema.validatePropValue(s,i);e||r.push(`Invalid property "${t}". Validate input with resource [${b.replace("{category}",t)}]`)}else r.push(`Property "${t}" is not configurable.`);else r.push(`Property "${t}" is not defined in the schema.`),o=!0}),o&&r.push("Available properties: "+Object.keys(e).join(", ")),{errors:r,valid:0===r.length}},validateStyles(e){const t=(0,d.getStylesSchema)(),n=e.custom_css,r=this.validateProps(t,e,["custom_css","$intention"]),o=()=>{r.valid=!1,r.errors=r.errors||[],r.errors.push('Invalid property "custom_css". Expected a string value.')};return n&&"object"==typeof n?"string"!=typeof n.value&&o():"string"!=typeof n&&null!=n&&o(),r},validatePropSchema(e,t,n=[]){const r=this.widgetsSchema[e];return r?this.validateProps(r,t,n):{valid:!1,errors:[`No schema found for widget type "${e}".`]}}};class vs{constructor(e,t){this.elementType=e,this.requiredTemplates=m(t[e])}enforce(e){if(0===this.requiredTemplates.length)return;const t=[];for(const n of Array.from(e.children))this.collectMissingRequiredErrors(n,t);if(t.length)throw new Error(`${t.join("\n")}\nUse the widget schema resource; under llm_guidance.required_direct_children for V4 widgets.`)}collectMissingRequiredErrors(e,t){if(e.tagName===this.elementType){const n=new Set(Array.from(e.children).map(e=>e.tagName)),r=this.requiredTemplates.map(e=>e.widgetType??e.elType??"").filter(e=>e&&!n.has(e));if(r.length){const n=e.getAttribute("configuration-id"),o=n?`<${e.tagName} configuration-id="${n}">`:`<${e.tagName}>`;t.push(`${o} Missing required direct child element tag(s): ${r.join(", ")}.`)}}for(const n of Array.from(e.children))this.collectMissingRequiredErrors(n,t)}}class bs{elementConfig={};elementStylesConfig={};elementCustomCSS={};rootContainers=[];api={createElement:l.createElement,deleteElement:l.deleteElement,getWidgetsCache:l.getWidgetsCache,generateElementId:l.generateElementId,getContainer:l.getContainer,doUpdateElementProperty:hs};static fromXMLString(e,t={}){const n=(new DOMParser).parseFromString(e,"application/xml"),r=n.querySelector("parsererror");if(r)throw new Error("Failed to parse XML string: "+r.textContent);return new bs({xml:n,api:t})}constructor(e){const{api:t={},elementConfig:n={},stylesConfig:r={},customCSS:o={},xml:i}=e;this.xml=i,Object.assign(this.api,t),this.setElementConfig(n),this.setStylesConfig(r),this.setCustomCSS(o)}setElementConfig(e){this.elementConfig=e}setStylesConfig(e){this.elementStylesConfig=e}setCustomCSS(e){this.elementCustomCSS=e}getXML(){return this.xml}buildModelTree(e,t){const n=e.tagName,r="widget"===t[n]?.elType,o=this.api.generateElementId(),i=Array.from(e.children).map(e=>this.buildModelTree(e,t));e.setAttribute("id",o);const s={id:o,skipDefaultChildren:!0,elements:i,editor_settings:{title:e.getAttribute("configuration-id")??void 0},elType:"widget"};return r?{...s,elType:"widget",widgetType:n}:{...s,elType:n}}async awaitViewRender(e){const t=e.view;t?._currentRenderPromise instanceof Promise?await t._currentRenderPromise:await Promise.resolve()}validateChildTypes(e,t){const n=[],r=t[e.tagName]?.allowed_child_types;if(r?.length)for(const t of Array.from(e.children))r.includes(t.tagName)||n.push(`"${t.tagName}" is not allowed as a child of "${e.tagName}". Allowed: ${r.join(", ")}`);for(const r of Array.from(e.children))n.push(...this.validateChildTypes(r,t));return n}matchNodeByConfigId(e){const t=this.xml.querySelector(`[configuration-id="${e}"]`);if(!t)throw new Error(`Configuration id "${e}" does not have target node.`);const n=t.getAttribute("id");if(!n)throw new Error(`Node with configuration id "${e}" does not have element id.`);const r=this.api.getContainer(n);if(!r)throw new Error(`Element with id "${n}" not found but should exist.`);return{element:r,node:t}}async applyProperties(){const e=[],t=[],n={},r=new Set([...Object.keys(this.elementConfig),...Object.keys(this.elementStylesConfig),...Object.keys(this.elementCustomCSS)]);for(const o of r){let r,i;try{({element:r,node:i}=this.matchNodeByConfigId(o))}catch(n){const r=n.message;this.elementConfig[o]&&e.push(r),(this.elementStylesConfig[o]||this.elementCustomCSS[o])&&t.push(r);continue}const s=this.elementConfig[o];if(s)for(const[t,n]of Object.entries(s))try{this.api.doUpdateElementProperty({elementId:r.id,propertyName:t,propertyValue:n,elementType:i.tagName})}catch(t){e.push(t.message)}const a=this.elementStylesConfig[o];if(a){const e={};for(const[o,i]of Object.entries(a)){const{valid:s,errors:l}=ys.validateStyles({[o]:i});s?e[o]=i:(a.$intention&&(n[r.id]=n[r.id]||[],n[r.id].push(o)),t.push(...l||[]))}if(Object.keys(e).length>0)try{this.api.doUpdateElementProperty({elementId:r.id,propertyName:"_styles",propertyValue:e,elementType:i.tagName})}catch(e){t.push(String(e))}}const l=this.elementCustomCSS[o];if(l)try{this.api.doUpdateElementProperty({elementId:r.id,propertyName:"_styles",propertyValue:{custom_css:l},elementType:i.tagName})}catch(e){t.push(String(e))}await this.awaitViewRender(r)}return{configErrors:e,styleErrors:t,invalidStyles:n}}async build(e){const t=this.api.getWidgetsCache()||{};new Set(this.xml.querySelectorAll("*")).forEach(e=>{if(!t[e.tagName])throw new Error(`Unknown widget type: ${e.tagName}`)}),Object.keys(t).filter(e=>m(t[e]).length>0).forEach(e=>{new vs(e,t).enforce(this.xml)});const n=[];for(const e of Array.from(this.xml.children))n.push(...this.validateChildTypes(e,t));if(n.length)throw new Error(`Invalid element structure:\n${n.join("\n")}`);const r=Array.from(this.xml.children);for(const n of r){const r=this.buildModelTree(n,t);try{const t=this.api.createElement({container:e,model:r,options:{useHistory:!1}});this.rootContainers.push(t),await this.awaitViewRender(t)}catch(e){const t=this.api.getContainer(r.id);throw t&&this.api.deleteElement({container:t,options:{useHistory:!1}}),e}}const{configErrors:o,styleErrors:i,invalidStyles:s}=await this.applyProperties();return{configErrors:o,styleErrors:i,invalidStyles:s,rootContainers:[...this.rootContainers]}}}const ws="elementor://canvas/tools/build-compositions-guide",Es=()=>{const e=(0,c.toolPrompts)("build-compositions");return e.description(`\n# RESOURCES (Read before use)\n- [elementor://global-classes] - Check FIRST for reusable classes\n- [elementor://global-variables] - ONLY use variables defined here\n- [${Zi}/v4]\n\n# TOOL SUPPORT\nThis tool support v4 elements only\n\n# WORKFLOW\n1. Check/create global classes via "create-global-class" tool\n2. Build composition (THIS TOOL) - minimal inline styles\n3. Apply classes via "apply-global-class" tool\n\n# XML STRUCTURE\n- Use widget tags: \`<e-button configuration-id="btn1"></e-button>\`\n- Containers: "e-flexbox", "e-div-block", "e-tabs"\n- Every element needs unique "configuration-id"\n- No attributes, classes, IDs, or text nodes in XML\n\n## NESTED ELEMENTS\nSome elements have internal tree structures (nesting). When using these elements, you MUST build the FULL tree in XML.\n- Check \`llm_guidance.nesting\` in widget schemas for structure requirements\n- \`llm_guidance.required_direct_children\` lists element types that must appear as direct child tags in XML (from widget defaults)\n- \`allowed_child_types\` lists which element types can be nested inside\n- \`allowed_parents\` lists which element types this element can be placed inside\n\n# CONFIGURATION\n- Map configuration-id → elementConfig (props) + stylesConfig (layout only)\n- All PropValues require \`$$type\` matching schema\n- NO LINKS in configuration\n- Retry on errors up to 10x\n\nNote about configuration ids: These names are visible to the end-user, make sure they make sense, related and relevant.\n\n# DESIGN PHILOSOPHY: CONTEXT-DRIVEN CREATIVITY\n\n**Use the user's context aggressively.** Business type, brand personality, target audience, and purpose should drive every design decision. A law firm needs gravitas; a children's app needs playfulness. Don't default to generic.\n\n## SIZING: DEFAULT IS NO SIZE (CRITICAL)\n\n**DO NOT specify height or width unless you have a specific visual reason.**\n\nFlexbox and CSS already handle sizing automatically:\n- Containers grow to fit their content\n- Flex children distribute space via flex properties, not width/height\n- Text elements size to their content\n\nWHEN TO SPECIFY SIZE:\n- min-height on ROOT section for viewport-spanning hero (use min-height, NOT height)\n- max-width for contained content areas (e.g., max-width: 60rem)\n- Explicit aspect ratios for media containers\n\nNEVER SPECIFY:\n- height on nested containers (causes overflow)\n- width on flex children (use flex-basis or gap instead)\n- 100vh on anything except root-level sections\n- Any size "just to be safe" - if unsure, OMIT IT\n\nvh units are VIEWPORT-relative. Nested 100vh inside 100vh = 200vh overflow.\n\nGOOD: \`<e-flexbox>content naturally sizes</e-flexbox>\`\nBAD: \`<e-flexbox style="height:100vh"><e-div-block style="height:100vh">overflow</e-div-block></e-flexbox>\`\n\n## Layout Variety (Break the Template)\n- AVOID: Full-width 100vh hero → three columns → testimonials → CTA (every AI does this)\n- VARY heights: Use auto-height sections with generous padding (6rem+). Let content breathe\n- VARY widths: Not everything spans full width. Use contained sections (max-width: 960px) mixed with edge-to-edge\n- ASYMMETRIC grids: 2:1, 1:3, offset layouts. Avoid equal column widths\n- Negative space as design element: Large margins create focus and sophistication\n- Break alignment intentionally: Offset headings, overlapping elements, broken grids\n\n## Visual Depth & Effects\n- Layer elements: Overlapping cards, text over images, floating elements\n- Subtle shadows with color tint (not pure black): \`box-shadow: 0 20px 60px rgba(<brand-color-here>, 0.15)\`\n- Gradient overlays on images for text readability\n- Border radius variation: Mix sharp (0) and soft (1rem+) corners purposefully\n- Backdrop blur for glassmorphism where appropriate\n- Micro-interactions via CSS: hover transforms, transitions (0.3s ease)\n\n## Typography with Character\n- Display fonts for headlines (from user's brand or contextually appropriate)\n- Size contrast: 4rem+ headlines vs 1rem body. Make hierarchy unmistakable\n- Letter-spacing: Tight for large headlines (-0.02em), loose for small caps (0.1em)\n- Line-height: Tight for headlines (1.1), generous for body (1.6-1.8)\n- Text decoration: Underlines, highlights, gradient text for emphasis\n\n## Color with Purpose\n- Extract palette from user context (brand colors, industry norms, mood)\n- 60-30-10 rule: dominant, secondary, accent\n- Tinted neutrals over pure grays: warm (#faf8f5, #2d2a26) or cool (#f5f7fa, #1e2430)\n- Color blocking: Large colored sections create visual rhythm\n- Gradient directions: Diagonal (135deg, 225deg) feel more dynamic than vertical\n\n## Spacing Strategy\n- Section padding: 6rem-10rem vertical, creating breathing room\n- Rhythm variation: Tight groups (2rem) with generous gaps between (6rem)\n- Use rem/em exclusively for responsive scaling\n- Generous padding on CTAs: min 1rem 2.5rem\n\n# HARD CONSTRAINTS\n- Variables ONLY from [elementor://global-variables] (others throw errors)\n- Avoid SVG widgets unless assets are pre-uploaded\n- Check \`llm_guidance\` in widget schemas\n\n# PARAMETERS\n- **xmlStructure**: Valid XML with configuration-id attributes\n- **elementConfig**: configuration-id → widget PropValues\n- **stylesConfig**: configuration-id → style PropValues (layout only)\n- **customCSS**: configuration-id → CSS rules (no selectors, semicolon-separated)\n `),e.example('\nSection with heading + button (NO explicit heights - content sizes naturally):\n{\n xmlStructure: "<e-flexbox configuration-id="Main Section"><e-heading configuration-id="Section Title"></e-heading><e-button configuration-id="Call to Action"></e-button></e-flexbox>",\n elementConfig: {\n "section1": { "tag": { "$$type": "string", "value": "section" } }\n },\n customCSS: {\n "Section Title": "padding: 6rem 4rem; background: linear-gradient(135deg, #faf8f5 0%, #f0ebe4 100%);"\n },\n stylesConfig: {\n "Section Title": {\n "font-size": { "$$type": "size", "value": { "size": { "$$type": "number", "value": 3.5 }, "unit": { "$$type": "string", "value": "rem" } } },\n "color": { "$$type": "color", "value": { "$$type": "string", "value": "#2d2a26" } }\n }\n }\n}\nNote: No height/width specified on any element - flexbox handles layout automatically.\n'),e.parameter("xmlStructure","Valid XML structure with custom elementor tags and configuration-id attributes."),e.parameter("elementConfig","Record mapping configuration IDs to widget PropValues."),e.parameter("stylesConfig","Record mapping configuration IDs to style PropValues (layout/positioning only)."),e.instruction("Element IDs in the returned XML represent actual widgets. Use these IDs for subsequent styling or configuration changes."),e.prompt()};var Ts=window.elementorV2.schema;const Ss={xmlStructure:Ts.z.string().describe("The XML structure representing the composition to be built"),elementConfig:Ts.z.record(Ts.z.string().describe("The configuration id"),Ts.z.record(Ts.z.string().describe("property name"),Ts.z.any().describe(`The PropValue for the property, refer to ${v}`))).describe("A record mapping element IDs to their configuration objects. REQUIRED"),stylesConfig:Ts.z.record(Ts.z.string().describe("The configuration id"),Ts.z.record(Ts.z.string().describe("StyleSchema property name"),Ts.z.any().describe(`The PropValue for the style property. MANDATORY, refer to [${b}]`))).describe(`A record mapping element IDs to their styles configuration objects. Use the actual styles schema from [${b}].`).default({}),customCSS:Ts.z.record(Ts.z.string().describe("The configuration id"),Ts.z.string().describe("The custom CSS for the element. MANDATORY")).describe("A record mapping element IDs to their custom CSS.").default({})},Cs={errors:Ts.z.string().describe("Error message if the composition building failed").optional(),xmlStructure:Ts.z.string().describe("The built XML structure as a string. Must use this XML after completion of building the composition, it contains real IDs.").optional(),llm_instructions:Ts.z.string().describe("Instructions what to do next, Important to follow these instructions!").optional()},xs="elementor://canvas/tools/configure-element-guide",_s=()=>{const e=(0,c.toolPrompts)("configure-element");return e.description(`\nConfigure an existing element on the page.\n\n# **CRITICAL - REQUIRED INFORMATION (Must read before using this tool)**\n1. [${v}]\n Required to understand which widgets are available, and what are their configuration schemas.\n Every widgetType (i.e. e-heading, e-button) that is supported has it's own property schema, that you must follow in order to apply parameter values correctly.\n2. [${b}]\n Required to understand the styles schema for the widgets. All widgets share the same styles schema, grouped by categories.\n Use this resource to understand which style properties are available for each element, and how to structure the "stylePropertiesToChange" parameter.\n3. If not sure about the PropValues schema, you can use the "get-element-configuration-values" tool to retrieve the current PropValues configuration of the element.\n\nBefore using this tool, check the definitions of the elements PropTypes at the resource "widget-schema-by-type" at editor-canvas__elementor://widgets/schema/{widgetType}\nAll widgets share a common _style property for styling, which uses the common styles schema.\nRetrieve and check the common styles schema at the resource list "styles-schema" at editor-canvas__elementor://styles/schema/{category}\n\n# When to use this tool\nWhen a user requires to change anything in an element, such as updating text, colors, sizes, or other configurable properties.\nThis tool handles elements of type "widget".\nThis tool handles styling elements, using the "stylePropertiesToChange" parameter.\n\nTo CLEAR a property (i.e., set it to default or none), provide null as a value.\n\nThe element's schema must be known before using this tool.\nThe style schema must be known before using this tool.\n\nAttached resource link describing how PropType schema should be parsed as PropValue for this tool.\n\nRead carefully the PropType Schema of the element and it's styles, then apply correct PropValue according to the schema.\n\nPropValue structure:\n{\n "$$type": string, // MANDATORY as defined in the PropType schema under the "key" property\n value: unknown // The value according to the PropType schema for kinds of "array", use array with PropValues items inside. For "object", read the shape property of the PropType schema. For "plain", use strings.\n}\n\n<IMPORTANT>\nALWAYS MAKE SURE you have the PropType schemas for the element you are configuring, and the common-styles schema for styling. If you are not sure, retrieve the schema from the resources mentioned above.\n</IMPORTANT>\n\nYou can use multiple property changes at once by providing multiple entries in the propertiesToChange object, including _style alongside non-style props.\nSome properties are nested, use the root property name, then objects with nested values inside, as the complete schema suggests.\n\nMake sure you have the "widget-schema-by-type" resource available to retrieve the PropType schema for the element type you are configuring.\nMake sure you have the "styles-schema" resources available to retrieve the common styles schema.\n\n# How to configure elements\nWe use a dedicated PropType Schema for configuring elements, including styles. When you configure an element, you must use the EXACT PropType Value as defined in the schema.\nFor styleProperties, use the style schema provided, as it also uses the PropType format.\nFor all non-primitive types, provide the key property as defined in the schema as $$type in the generated object, as it is MANDATORY for parsing.\n\nUse the EXACT "PROP-TYPE" Schema given, and ALWAYS include the "key" property from the original configuration for every property you are changing.\n`),e.parameter("elementId","The ID of the element to configure. MANDATORY."),e.parameter("elementType","The type of the element to configure (i.e. e-heading, e-button). MANDATORY."),e.parameter("propertiesToChange","An object containing the properties to change, with their new values. MANDATORY. When updating a style only, provide an empty object."),e.parameter("stylePropertiesToChange","An object containing the style properties to change, with their new values. OPTIONAL."),e.example(`\n\`\`\`json\n{\n propertiesToChange: {\n // List of properties TO CHANGE, following the PropType schema for the element as defined in the resource [${v}]\n title: {\n $$type: 'string',\n value: 'New Title Text'\n },\n border: {\n $$type: 'boolean',\n value: false\n },\n },\n stylePropertiesToChange: {\n 'line-height': {\n $$type: 'size',\n value: {\n size: {\n $$type: 'number',\n value: 20\n },\n unit: {\n $$type: 'string',\n value: 'px'\n }\n }\n }\n },\n elementId: 'element-id',\n elementType: 'element-type'\n};\n\`\`\`\n`),e.instruction("The $$type property is MANDATORY for every value; it is required to parse the value and apply application-level effects."),e.instruction("\nV4 only: If MCP fails, give manual steps using V4 UI.\n\nV4 Editor structure:\nPanel tabs: General (→ Settings section: ID, Tag, Link), Style, Interactions.\nNO Advanced tab. Never mention Advanced tab.\n"),e.prompt()},Rs=(_s(),{propertiesToChange:Ts.z.record(Ts.z.string().describe("The property name."),Ts.z.any().describe(`PropValue, refer to [${v}] by correct type, as appears in elementType`),Ts.z.any()).describe("An object record containing property names and their new values to be set on the element"),stylePropertiesToChange:Ts.z.record(Ts.z.string().describe("The style property name"),Ts.z.any().describe(`The style PropValue, refer to [${b}] how to generate values`),Ts.z.any()).describe("An object record containing style property names and their new values to be set on the element").default({}),elementType:Ts.z.string().describe("The type of the element to retrieve the schema"),elementId:Ts.z.string().describe("The unique id of the element to configure")}),As={success:Ts.z.boolean().describe("Whether the configuration change was successful, only if propertyName and propertyValue are provided")};function ks(e){const{propertyName:t,elementId:n,elementType:r,error:o,propertyType:i}=e;return`Failed to update property "${t}" on element "${n}": ${o.message}.\n${"prop"===i?`\nCheck the element's PropType schema at the resource [${v.replace("{widgetType}",r)}] for type "${r}" to ensure the property exists and the value matches the expected PropType.\nNow that you have this information, ensure you have the schema and try again.`:`\nCheck the styles schema at the resource [${b.replace("{category}",t)}] at editor-canvas__elementor://styles/schema/{category} to ensure the style property exists and the value matches the expected PropType.\n`};\n}`}const Os={elementId:Ts.z.string()},Ps={properties:Ts.z.record(Ts.z.string(),Ts.z.any()).describe("A record mapping PropTypes to their corresponding PropValues"),style:Ts.z.record(Ts.z.string(),Ts.z.any()).describe("A record mapping StyleSchema properties to their corresponding PropValues"),childElements:Ts.z.array(Ts.z.object({id:Ts.z.string(),elementType:Ts.z.string(),childElements:Ts.z.array(Ts.z.any()).describe("An array of child element IDs, when applicable, same structure recursively")})).describe("An array of child element IDs, when applicable, with recursive structure")},Is=e=>(e.children||[]).map(e=>({id:e.id,elementType:e.model.get("elType")||e.model.get("widgetType")||"unknown",childElements:Is(e)})),Ns=e=>{(e=>{const{resource:t}=e;t("styles-best-practices",w,{description:"Styling best practices"},async()=>({contents:[{uri:w,text:`# Styling best practices\nPrefer using "em" and "rem" values for text-related sizes, padding and spacing. Use percentages for dynamic sizing relative to parent containers.\nThis flexboxes are by default "flex" with "stretch" alignment. To ensure proper layout, define the "justify-content" and "align-items" as in the schema.\n\nWhen applicable for styles, apply style PropValues using the ${b}.\nThe css string must follow standard CSS syntax, with properties and values separated by semicolons, no selectors, or nesting rules allowed.\n\n** CRITICAL - VARIABLES **\nWhen using global variables, ensure that the variables are defined in the elementor://global-variables resource.\nVariables from the user context ARE NOT SUPPORTED AND WILL RESOLVE IN ERROR.\n\n`}]})),t("styles-schema",new c.ResourceTemplate(b,{list:()=>({resources:[...Object.keys((0,d.getStylesSchema)())].filter(e=>"all"!==e).map(e=>({uri:`elementor://styles/schema/${e}`,name:"Style schema for "+e}))})}),{description:"Common styles schema for the specified category (applicable for V4 elements only)"},async(e,t)=>{const n="string"==typeof t.category?t.category:t.category?.[0],r=(0,d.getStylesSchema)()[n];if(!r)throw new Error(`No styles schema found for category: ${n}`);const o=u.Schema.propTypeToJsonSchema(r);return{contents:[{uri:e.toString(),mimeType:"application/json",text:JSON.stringify(u.Schema.enrichWithIntention(o,'Desired CSS in format "property: value;"'))}]}}),t("widget-schema-by-type",new c.ResourceTemplate(v,{list:()=>{const e=(0,l.getWidgetsCache)()||{};return{resources:Object.keys(e).filter(t=>f(e[t])).map(e=>({uri:`elementor://widgets/schema/${e}`,name:"Widget schema for "+e}))}}}),{description:"PropType schema for the specified widget type"},async(e,t)=>{const n="string"==typeof t.widgetType?t.widgetType:t.widgetType?.[0],r=(0,l.getWidgetsCache)()?.[n];if(!r)throw new Error(`No prop schema found for element type: ${n}`);const o=r.atomic_props_schema;if(!o){if(!p(r.controls))throw new Error(`No prop schema found for element type: ${n}`);const t=function(e){if(!p(e))return{};const t={};for(const[n,r]of Object.entries(e)){if(!r||"object"!=typeof r)continue;const e=r,o="string"==typeof e.type?e.type:void 0;if(o&&y.has(o))continue;const i={};if(Object.prototype.hasOwnProperty.call(e,"default")&&(i.default=e.default),o&&(i.type=o),Object.prototype.hasOwnProperty.call(e,"options")&&void 0!==e.options){const t=e.options;t&&"object"==typeof t&&!Array.isArray(t)?i.options=Object.keys(t):i.options=t}t[n]=i}return t}(r.controls);return{contents:[{uri:e.toString(),mimeType:"application/json",text:JSON.stringify({widget_version:"v3",message:"This widget exists in the editor but has no atomic props schema (V4). Use control_metadata as non-authoritative hints from legacy controls.",fields_note:"All settings are optional; there is no JSON schema for this widget type.",properties:t})}]}}const i=Object.fromEntries(Object.entries(o).filter(([e,t])=>u.Schema.isPropKeyConfigurable(e,t)).map(([e,t])=>[e,u.Schema.propTypeToJsonSchema(t)])),s="string"==typeof r?.meta?.description?r.meta.description:void 0,a={},c=r?.base_styles;c&&Object.values(c).forEach(e=>{e.variants.forEach(e=>{Object.assign(a,e.props)})});const d=Object.keys(a).length>0,f={can_have_children:!!r?.meta?.is_container};d&&(f.instructions="These are the default styles applied to the widget. Override only when necessary.",f.default_styles=a);const h=r.allowed_child_types,g=(0,l.getWidgetsCache)()||{},v=Object.entries(g).filter(([,e])=>e.allowed_child_types?.includes(n)).map(([e])=>e);(h?.length||v.length)&&(f.nesting={...h?.length?{allowed_child_types:h}:{},...v.length?{allowed_parents:v}:{}});const b=m(r).map(e=>e.widgetType??e.elType??"").filter(e=>Boolean(e));return b.length&&(f.required_direct_children=b),{contents:[{uri:e.toString(),mimeType:"application/json",text:JSON.stringify({type:"object",properties:i,description:s,llm_guidance:f})}]}})})(e),(e=>{const{resource:t,sendResourceUpdated:n}=e,r=(e,t=()=>!0)=>{const n=g().filter(t);return{contents:[{uri:e,mimeType:"application/json",text:JSON.stringify(n,null,2)}]}};t("available-widgets-v4",Qi,{description:"All registered v4 version widgets"},async()=>r(Qi,e=>"v4"===e.version)),t("available-widgets",Zi,{description:"All registered widget types with v3/v4 version metadata and description."},async()=>r(Zi));const o=(0,s.v1ReadyEvent)().name,i=()=>{0!==g().length&&(window.removeEventListener(o,i),n({uri:Zi,...r(Zi)}),n({uri:Qi,...r(Qi,e=>"v4"===e.version)}))};window.addEventListener(o,i),i()})(e),(e=>{const{resource:t,sendResourceUpdated:n}=e;let r=null;const o=()=>{const e=ts(),t=JSON.stringify(e,null,2);t!==r&&(r=t,n({uri:es}))};(0,s.__privateListenTo)([(0,s.commandEndEvent)("document/elements/create"),(0,s.commandEndEvent)("document/elements/delete"),(0,s.commandEndEvent)("document/elements/move"),(0,s.commandEndEvent)("document/elements/copy"),(0,s.commandEndEvent)("document/elements/paste"),(0,s.commandEndEvent)("editor/documents/attach-preview"),(0,s.commandEndEvent)("editor/documents/switch")],o),o(),t("document-structure",es,{description:"Document structure."},async()=>({contents:[{uri:es,text:JSON.stringify(ts(),null,2)}]}))})(e),(e=>{const{resource:t,sendResourceUpdated:n}=e;let r=null;const o=e=>{const t=JSON.stringify(e);t!==r&&(r=t,n({uri:ls}))};(0,s.__privateListenTo)([(0,s.commandEndEvent)("document/elements/select"),(0,s.commandEndEvent)("document/elements/deselect-all"),(0,s.commandEndEvent)("document/elements/settings")],e=>{if("command"!==e.type)return;const t=e;if("document/elements/deselect-all"===t.command)return void o({elementDisplayName:null,elementType:null,properties:null,selectedElementId:null,selectedParentId:null,version:null,widgetType:null});if("document/elements/select"!==t.command&&"document/elements/settings"!==t.command)return;const{container:n}=t.args||{};o(n?.id?us(n):cs())}),o(cs()),t("selected-element",ls,{description:"Currently selected Elementor element context."},async()=>({contents:[{uri:ls,text:JSON.stringify(cs(),null,2)}]}))})(e),(e=>{const{resource:t,sendResourceUpdated:n}=e;let r="";const o=()=>({currentlyViewedScreen:"The user is currently viewing the Elementor editor",pageContent:is(),pageTitle:ss()});(0,s.__privateListenTo)([(0,s.commandEndEvent)("editor/documents/switch"),(0,s.commandEndEvent)("editor/documents/attach-preview")],()=>{const e=JSON.stringify(o());e!==r&&(r=e,n({uri:os}))}),r=JSON.stringify(o()),t("editor-state",os,{description:"Editor page title, preview text snapshot, and viewed screen label."},async()=>({contents:[{uri:os,text:JSON.stringify(o(),null,2)}]}))})(e),(e=>{const{resource:t,sendResourceUpdated:n}=e;let r=null;const o=()=>{const e=window,t=Intl.DateTimeFormat().resolvedOptions().timeZone,n=new URLSearchParams(location.search).get("post"),r=n?Number(n):null,o=null!==r&&Number.isFinite(r)?r:null,i=(()=>{const e=window,t=e.elementor?.documents?.getCurrent?.()?.config?.settings?.post_title;return t?.trim()?t:null})(),s=new URL(window.location.href),a=s.pathname+s.search,l=i||"Elementor Editor",c=e.angieConfig?.plugins;return{timezone:t,postId:o,currentPage:{pageName:l,pageTitle:i,pageUrl:a},...c&&{plugins:c}}},i=()=>{const e=JSON.stringify(o());e!==r&&(r=e,n({uri:as}))};t("general-context",as,{description:"General context: timezone, post id, and current page."},async()=>({contents:[{uri:as,mimeType:"application/json",text:JSON.stringify(o(),null,2)}]})),(0,s.__privateListenTo)([(0,s.commandEndEvent)("editor/documents/switch"),(0,s.commandEndEvent)("editor/documents/attach-preview"),(0,s.commandEndEvent)("document/elements/settings")],i),i()})(e),(e=>{const{addTool:t,resource:n}=e;n("build-compositions-guide",ws,{title:"Build Compositions Guide",description:"Detailed guide for using the build-compositions tool",mimeType:"text/plain"},async e=>({contents:[{uri:e.href,mimeType:"text/plain",text:Es()}]})),t({name:"build-compositions",description:"Build V4 element compositions on the Elementor canvas. Read the guide resource before use.",schema:Ss,requiredResources:[{description:"Build compositions guide",uri:ws},{description:"Widgets schema",uri:v},{description:"Styles schema",uri:b},{description:"Global Classes",uri:"elementor://global-classes"},{description:"Global Variables",uri:"elementor://global-variables"},{description:"Styles best practices",uri:w},{description:"Available widgets for this tool",uri:Qi}],outputSchema:Cs,modelPreferences:{hints:[{name:"claude-sonnet-4-5"}]},handler:async e=>{!function(e){const t=(new DOMParser).parseFromString(e,"application/xml");if(t.querySelector("parsererror"))throw new Error("Failed to parse XML string: "+t);const n=(0,l.getWidgetsCache)()??{};for(const e of t.querySelectorAll("*")){const t=e.tagName,r=n[t];if(r&&"widget"===r.elType&&!r.atomic_props_schema)throw new Error(`This tool does not support V3 elements. Please use the elementor-v3-mcp tools instead for element type: ${t}`)}}(e.xmlStructure);const{xmlStructure:t,elementConfig:n,stylesConfig:r,customCSS:o}=e;let i="";const s=[],a=[],c=(0,l.getContainer)("document"),u=(0,C.getCurrentDocument)(),d=function(e,t){const n=e.children?.[0];return t===C.COMPONENT_DOCUMENT_TYPE&&n?n:e}(c,u?.type.value);try{const e=bs.fromXMLString(t,{createElement:l.createElement,deleteElement:l.deleteElement,getWidgetsCache:l.getWidgetsCache});e.setElementConfig(n),e.setStylesConfig(r),e.setCustomCSS(o);const{invalidStyles:c,configErrors:u,rootContainers:m}=await e.build(d);a.push(...m),i=(new XMLSerializer).serializeToString(e.getXML()),u.length?s.push(...u.map(e=>new Error(e))):Object.entries(c).forEach(([e,t])=>{const n={value:t.join(";\n")};hs({elementId:e,propertyName:"_styles",propertyValue:{_styles:{custom_css:n}},elementType:"widget"})})}catch(e){s.push(e)}if(s.length){a.forEach(e=>{(0,l.deleteElement)({container:e,options:{useHistory:!1}})});const e=s.map(e=>"string"==typeof e?e:e instanceof Error?e.message||String(e):"object"==typeof e&&null!==e?JSON.stringify(e):String(e)).filter(e=>e&&""!==e.trim()&&"{}"!==e&&"null"!==e&&"undefined"!==e);if(0===e.length)throw new Error("Failed to build composition: Unknown error occurred. No error details available.");const t=`Failed to build composition with the following errors:\n\n${e.join("\n\n")}`;throw new Error(t)}return{xmlStructure:i,errors:s?.length?s.map(e=>"string"==typeof e?e:e.message).join("\n\n"):void 0,llm_instructions:'The composition was built successfully with element IDs embedded in the XML.\n\n**CRITICAL NEXT STEPS** (Follow in order):\n1. **Apply Global Classes**: Use "apply-global-class" tool to apply the global classes you created BEFORE building this composition\n - Check the created element IDs in the returned XML\n - Apply semantic classes (heading-primary, button-cta, etc.) to appropriate elements\n\n2. **Fine-tune if needed**: Use "configure-element" tool only for element-specific adjustments that don\'t warrant global classes\n\nRemember: Global classes ensure design consistency and reusability. Don\'t skip applying them!\n'}}})})(e),(e=>{const{addTool:t}=e;t({name:"get-element-configuration-values",description:"Retrieve the element's configuration PropValues for a specific element by unique ID.",schema:Os,outputSchema:Ps,modelPreferences:{intelligencePriority:.6,speedPriority:.9},handler:async({elementId:e})=>{const t=(0,l.getContainer)(e);if(!t)throw new Error(`Element with ID ${e} not found.`);const n=t.model.get("widgetType")||t.model.get("elType")||"",r=(0,l.getWidgetsCache)()?.[n];if(!r)throw new Error(`Unknown element type: ${n}. Check the available-widgets resource for valid types.`);if(!r.atomic_props_schema)throw new Error(`This tool does not support V3 elements. Please use the elementor-v3-mcp tools instead for element type: ${n}`);const o=t.settings,i=(0,l.getWidgetsCache)()?.[n]?.atomic_props_schema;if(!o||!i)throw new Error(`No settings or prop schema found for element ID: ${e}`);const s={},a={};u.Schema.configurableKeys(i).forEach(e=>{s[e]=structuredClone(o.get(e))});const c=(0,l.getElementStyles)(e)||{},d=Object.values(c).find(e=>"local"===e.label);if(d){const e=d.variants.find(e=>"desktop"===e.meta.breakpoint&&!e.meta.state);if(e){const t=e.props||{};Object.keys(t).forEach(e=>{void 0!==t[e]&&(a[e]=structuredClone(t[e]))}),e.custom_css&&(a.custom_css=atob(e.custom_css.raw))}}return{properties:{...s},style:{...a},childElements:Is(t)}}})})(e),(e=>{const{addTool:t,resource:n}=e;n("configure-element-guide",xs,{title:"Configure Element Guide",description:"Detailed guide for using the configure-element tool",mimeType:"text/plain"},async e=>({contents:[{uri:e.href,mimeType:"text/plain",text:_s()}]})),t({name:"configure-element",description:"Configure an existing V4 element's properties and styles. Read the guide resource before use.",schema:Rs,outputSchema:As,requiredResources:[{description:"Widgets schema",uri:v},{description:"Styles schema",uri:b},{description:"Configure element guide",uri:xs}],modelPreferences:{hints:[{name:"claude-sonnet-4-5"}],intelligencePriority:.8,speedPriority:.7},handler:({elementId:e,propertiesToChange:t,elementType:n,stylePropertiesToChange:r})=>{const o=(0,l.getWidgetsCache)()?.[n];if(!o)throw new Error(`Unknown element type: ${n}. Check the available-widgets resource for valid types.`);if(!o.atomic_props_schema)throw new Error(`This tool does not support V3 elements. Please use the elementor-v3-mcp tools instead for element type: ${n}`);const i=Object.entries(t),{valid:s,errors:a}=ys.validatePropSchema(n,t),{valid:c,errors:u}=ys.validateStyles(r||{});if(!s){const t=`Failed to configure element "${e}" due to invalid properties: ${a?.join("\n- ")}`;throw new Error(t)}if(!c){const t=`Failed to configure element "${e}" due to invalid style properties: ${u?.join("\n- ")}`;throw new Error(t)}for(const[t,r]of i)try{hs({elementId:e,elementType:n,propertyName:t,propertyValue:r})}catch(r){const o=ks({propertyName:t,elementId:e,elementType:n,error:r,propertyType:"prop"});throw new Error(o)}for(const[t,o]of Object.entries(r||{}))try{hs({elementId:e,elementType:n,propertyName:"_styles",propertyValue:{[t]:o}})}catch(r){const o=ks({propertyName:`(style) ${t}`,elementId:e,elementType:n,propertyType:"style",error:r});throw new Error(o)}return{success:!0}}})})(e),(e=>{const{resource:t,sendResourceUpdated:n}=e,r=()=>{const{breakpoints:e}=window.elementor?.config?.responsive||{};return e?Object.values(e).filter(e=>e.is_enabled).map(e=>{const{direction:t,label:n,value:r}=e;return{label:n,constraint:t,value:r}}):[]},o=()=>({contents:[{uri:a,mimeType:"application/json",text:JSON.stringify(r())}]});t("breakpoints ",a,{description:"Breakpoints list."},()=>o()),window.addEventListener((0,s.v1ReadyEvent)().name,()=>{n({uri:a,...o()})})})(e)},Ls=v.replace("{widgetType}","element-schema"),$s=`Elementor Canvas MCP\nThis MCP enables creation, configuration, and styling of elements on the Elementor canvas using the build_composition tool.\n\n# Core Concepts\n\n## PropValues Structure\nAll data in Elementor uses PropValues - a typed wrapper for values:\n\`\`\`json\n{\n "$$type": "the-prop-type-schema-kind",\n "value": "the-actual-value-as-defined-for-the-propType"\n}\n\`\`\`\nThe \`$$type\` defines how Elementor interprets the value. Providing the correct \`$$type\` is critical - incorrect types will be rejected.\n\n## Design System Resources\n- **Global Variables**: Reusable colors, sizes, and fonts (\`elementor://global-variables\`)\n- **Global Classes**: Reusable style sets that can be applied to elements (\`elementor://global-classes\`)\n- **Widget Schemas**: Configuration options for each widget type (\`${v}\`)\n- **Style Schema**: Common styles shared across all widgets and containers (\`${b}\`)\n\n# Building Compositions with build_composition\n\nThe \`build_composition\` tool is the primary way to create elements. It accepts structure (XML), configuration, and styling in a single operation.\n\n## Complete Workflow\n\n### 1. Parse User Requirements\nUnderstand what needs to be built: structure, content, and styling.\n\n### 2. Check Global Resources FIRST\nAlways check existing resources before building:\n- List \`elementor://global-variables\` for available variables (colors, sizes, fonts)\n- List \`elementor://global-classes\` for available style sets\n- **Always prefer using existing global resources over creating inline styles**\n\n### 3. Retrieve Widget Schemas\nFor each widget you'll use:\n- List \`${v}\` to see available widgets\n- Retrieve configuration schema from \`${Ls}\` for each widget\n- Check the \`llm_guidance\` property to understand if a widget is a container (can have children)\n\n### 4. Build XML Structure\nCreate valid XML with configuration-ids:\n- Each element must have a unique \`configuration-id\` attribute\n- No text nodes, classes, or IDs in XML - structure only\n- Example:\n\`\`\`xml\n<e-container configuration-id="container-1">\n <e-heading configuration-id="heading-1" />\n <e-text configuration-id="text-1" />\n</e-container>\n\`\`\`\n\n### 5. Create elementConfig\nMap each configuration-id to its widget properties using PropValues:\n- Use correct \`$$type\` matching the widget's schema\n- Use global variables in PropValues where applicable\n- Example:\n\`\`\`json\n{\n "heading-1": {\n "text": { "$$type": "string", "value": "Welcome" },\n "tag": { "$$type": "string", "value": "h1" }\n }\n}\n\`\`\`\n\n### 6. Create stylesConfig\nMap each configuration-id to style PropValues from \`${b}\`:\n- Use global variables for colors, sizes, and fonts\n- Example using global variable:\n\`\`\`json\n{\n "heading-1": {\n "color": { "$$type": "global-color-variable", "value": "primary-color-id" },\n "font-size": { "$$type": "size", "value": "2rem" }\n }\n}\n\`\`\`\n\n### 7. Execute build_composition\nCall the tool with your XML structure, elementConfig, and stylesConfig. The response will contain the created element IDs.\nAt the response you will also find llm_instructions for you to do afterwards, read and follow them!\n\n## Key Points\n\n- **PropValue Types**: Arrays that accept union types are typed as mixed arrays\n- **Visual Sizing**: Widget sizes MUST be defined in stylesConfig. Widget properties like image "size" control resolution, not visual appearance\n- **Global Variables**: Reference by ID in PropValues (e.g., \`{ "$$type": "global-color-variable", "value": "variable-id" }\`)\n- **Naming Conventions**: Use meaningful, purpose-based names (e.g., "primary-button", "heading-large"), not value-based names (e.g., "blue-style", "20px-padding")\n\n## Example: e-image PropValue Structure\n\`\`\`json\n{\n "$$type": "image",\n "value": {\n "src": {\n "$$type": "image-src",\n "value": {\n "url": { "$$type": "url", "value": "https://example.com/image.jpg" }\n }\n },\n "size": { "$$type": "string", "value": "full" }\n }\n}\n\`\`\`\nNote: The "size" property controls image resolution/loading, not visual size. Set visual dimensions in stylesConfig.\n`,Ms={href:"https://go.elementor.com/element-link-inside-link-infotip",target:"_blank",color:"inherit",variant:"text",sx:{marginInlineStart:"20px"},children:"Learn more"};function Ds(e){const{containers:t=[e.container],storageType:n}=e,r=t;if("localstorage"!==n)return!1;const o=window?.elementorCommon?.storage?.get();if(!o?.clipboard?.elements)return!1;const i=o.clipboard.elements,s={type:"default",message:(0,Bn.__)("To paste a link to this element, first remove the link from it's parent container.","elementor"),id:"paste-in-link-blocked",additionalActionProps:[Ms]},a=Vs(i,r);return a&&(0,Wn.notify)(s),a}function js(e){const{containers:t=[e.container],target:n}=e,r=t,o=n,i={type:"default",message:(0,Bn.__)("To drag a link to this element, first remove the link from it's parent container.","elementor"),id:"move-in-link-blocked",additionalActionProps:[Ms]},s=Vs(r,[o]);return s&&(0,Wn.notify)(i),s}function Vs(e,t){return!(!e?.length||!t?.length)&&(!!e.some(e=>!!e?.id&&((0,l.isElementAnchored)(e.id)||!!(0,l.getAnchoredDescendantId)(e.id)))&&t.some(e=>!!e?.id&&((0,l.isElementAnchored)(e.id)||!!(0,l.getAnchoredAncestorId)(e.id))))}function zs(e){const{containers:t=[e.container]}=e;return t.some(Us)}function Us(e){return!!e&&Boolean(Ws(e))}function Fs(e){const t=Ws(e);if(!t)return null;const[n]=Object.entries(t).find(([,e])=>"plain"===e.kind&&e.key===u.CLASSES_PROP_KEY)??[];return n??null}function Ws(e){const t=e?.model.get("widgetType")||e?.model.get("elType"),n=(0,l.getWidgetsCache)(),r=n?.[t];return r?.atomic_props_schema??null}function Bs(e){return e.length>1?(0,Bn.__)("Elements","elementor"):(0,l.getElementLabel)(e[0].id)}const Hs=()=>(0,s.undoable)({do:({containers:e,newStyle:t})=>e.map(e=>{const n=e.id,r=Fs(e);if(!r)return null;const o=(0,l.getElementStyles)(e.id),[i,s]=Object.entries(o??{})[0]??[],a=Object.keys(s??{}).length?s:null,c={styleId:i,originalStyle:a};if(i)t.variants.forEach(({meta:e,props:t,custom_css:r})=>{(0,l.updateElementStyle)({elementId:n,styleId:i,meta:e,props:t,custom_css:r})});else{const[e]=t.variants,o=t.variants.slice(1);c.styleId=(0,l.createElementStyle)({elementId:n,classesProp:r,label:x.ELEMENTS_STYLES_RESERVED_LABEL,...e,additionalVariants:o})}return c}),undo:({containers:e},t)=>{e.forEach((e,n)=>{const r=t[n];if(!r)return;if(!r.originalStyle)return void(0,l.deleteElementStyle)(e.id,r.styleId);const o=Fs(e);if(!o)return;const[i]=r.originalStyle.variants,s=r.originalStyle.variants.slice(1);(0,l.createElementStyle)({elementId:e.id,classesProp:o,label:x.ELEMENTS_STYLES_RESERVED_LABEL,styleId:r.styleId,...i,additionalVariants:s})})}},{title:({containers:e})=>Bs(e),subtitle:(0,Bn.__)("Style Pasted","elementor")});const Gs=()=>(0,s.undoable)({do:({containers:e})=>e.map(e=>{const t=e.model.get("id"),n=(0,l.getElementStyles)(t);return Object.keys(n??{}).forEach(e=>(0,l.deleteElementStyle)(t,e)),n}),undo:({containers:e},t)=>{e.forEach((e,n)=>{const r=Fs(e);if(!r)return;const o=e.model.get("id"),i=t[n];Object.entries(i??{}).forEach(([e,t])=>{const[n]=t.variants,i=t.variants.slice(1);(0,l.createElementStyle)({elementId:o,classesProp:r,styleId:e,label:x.ELEMENTS_STYLES_RESERVED_LABEL,...n,additionalVariants:i})})})}},{title:({containers:e})=>Bs(e),subtitle:(0,Bn.__)("Style Reset","elementor")});function qs(){An.register("size",Bo).register("shadow",Wo).register("stroke",Go).register("dimensions",Mo(["block-start","block-end","inline-start","inline-end"],({propKey:e,key:t})=>`${e}-${t}`)).register("filter",Do).register("backdrop-filter",Do).register("box-shadow",$o(",")).register("background",No).register("background-overlay",Po).register("background-color-overlay",Ro).register("background-image-overlay",ko).register("background-gradient-overlay",Ao).register("gradient-color-stop",$o(",")).register("color-stop",Lo).register("background-image-position-offset",Fo).register("background-image-size-scale",Oo).register("image-src",br).register("image",Er).register("object-position",Fo).register("span",Ho).register("transform-origin",Jo).register("perspective-origin",Uo).register("transform-move",Xo).register("transform-scale",ei).register("transform-rotate",Qo).register("transform-skew",ni).register("transform-functions",qo).register("transform",Mo(["transform-functions","transform-origin","perspective","perspective-origin"],({key:e})=>"transform-functions"===e?"transform":e)).register("transition",oi).register("layout-direction",Mo(["row","column"],({propKey:e,key:t})=>`${t}-${e}`)).register("flex",Vo).register("border-width",Mo(["block-start","block-end","inline-start","inline-end"],({key:e})=>`border-${e}-width`)).register("border-radius",Mo(["start-start","start-end","end-start","end-end"],({key:e})=>`border-${e}-radius`)).registerFallback(Tr),function(){const e=Hs();(0,s.blockCommand)({command:"document/elements/paste-style",condition:zs}),(0,s.__privateListenTo)((0,s.commandStartEvent)("document/elements/paste-style"),t=>function(e,t){const{containers:n=[e.container],storageKey:r}=e,o=n.filter(Us);if(!o.length)return;const i=function(e="clipboard"){try{const t=JSON.parse(localStorage.getItem("elementor")??"{}");return t[e]?.elements}catch{return}}(r),[s]=i??[],a=(0,l.getContainer)(s.id);if(!s||!a||!Us(a))return;const c=s.styles,d=Object.values(c??{})[0],m=function(e,t){const n=Fs(e);if(!n)return[];const r=(0,l.getElementSetting)(e.id,n);return r?.value.filter(e=>e!==t?.id)??[]}(a,d);m.length&&function(e,t){e.forEach(e=>{const n=Fs(e);if(!n)return;const r=(0,l.getElementSetting)(e.id,n),o=u.classesPropTypeUtil.extract(r)??[],i=u.classesPropTypeUtil.create(Array.from(new Set([...t,...o])));(0,l.updateElementSettings)({id:e.id,props:{[n]:i}})})}(o,m),d&&t({containers:o,newStyle:d})}(t.args,e))}(),function(){const e=Gs();(0,s.blockCommand)({command:"document/elements/reset-style",condition:zs}),(0,s.__privateListenTo)((0,s.commandStartEvent)("document/elements/reset-style"),t=>function(e,t){const{containers:n=[e.container]}=e,r=n.filter(Us);r.length&&t({containers:r})}(t.args,e))}(),(0,s.blockCommand)({command:"document/elements/paste",condition:Ds}),(0,s.blockCommand)({command:"document/elements/move",condition:js}),(0,s.blockCommand)({command:"document/elements/create",condition:ir}),(0,s.blockCommand)({command:"document/elements/move",condition:sr}),(0,s.blockCommand)({command:"document/elements/paste",condition:ar}),(0,s.blockCommand)({command:"document/elements/create",condition:er}),(0,s.blockCommand)({command:"document/elements/move",condition:tr}),(0,s.blockCommand)({command:"document/elements/paste",condition:nr}),Fi(),Ki(),cr.register("classes",function(){const e=new Map;return t=>t.map(t=>function(e,t){if(!t.has(e)){const n=x.stylesRepository.getProviders().find(t=>t.actions.all().find(t=>t.id===e));if(!n)return e;t.set(e,n.getKey())}const n=t.get(e),r=x.stylesRepository.getProviderByKey(n);return r?.actions.resolveCssName(e)??e}(t,e)).filter(Boolean)}()).register("link",gr).register("query",yr).register("image",Er).register("image-src",br).register("svg-src",xo).register("video-src",_o).register("attributes",dr).register("date-time",pr).register("html-v2",fr).register("html-v3",hr).register("date-range",mr).register("time-range",vr).registerFallback(Tr),(0,E.injectIntoTop)({id:"elements-overlays",component:an}),(0,E.injectIntoTop)({id:"canvas-style-render",component:Fn}),(0,E.injectIntoTop)({id:"canvas-interactions-render",component:mn}),(0,E.injectIntoLogic)({id:"classes-rename",component:R}),Ns((0,c.getMCPByDomain)("canvas",{instructions:"Everything related to V4 ( Atomic ) canvas.\n# Canvas workflow for new compositions\n- Configure elements settings and styles\n- Build compositions/sections out of V4 atomic elements using context aware designs using the website resources\n- Get and retrieve element configuration values\n",docs:$s})),Yi("e-tab",Ji)}const Ys=["elementor-element"],Xs=()=>{Qs()?.panelElements?.trigger("element:drag:end")},Ks=(e,t)=>{Js(t);const n=Qs();n?.editor.reply("element:dragged",null),n?.panelElements.reply("element:selected",ea(e)).trigger("element:drag:start")},Js=e=>{const t={groups:Zs(e)};e.dataTransfer?.setData(JSON.stringify(t),"true")},Zs=e=>{const t=e.dataTransfer?.getData("text/plain");return t?JSON.parse(t).groups:Ys},Qs=()=>{const e=window,t=e.elementor?.channels;if(!t)throw new Error("Elementor channels not found: Elementor editor is not initialized or channels are unavailable.");return t},ea=({settings:e,...t})=>{const n=window,r=n.elementor?.modules?.elements?.models?.Element;if(!r)throw new Error("Elementor legacy Element model not found in editor modules");return{model:new r({...t,custom:{isPreset:!!e,preset_settings:e}})}},ta="elementor/global-styles/imported";function na(e,t){const n=e.map(e=>{const t=(0,l.getContainer)(e)?.view;if(t&&function(e){return"function"==typeof e?._doAfterRender}(t))return new Promise(e=>t._doAfterRender(e))}).filter(Boolean);n.length>0?Promise.all(n).then(()=>t(e)):t(e)}(window.elementorV2=window.elementorV2||{}).editorCanvas=i}(),window.elementorV2.editorCanvas?.init?.(); | |
| 1 | +/*! | |
| 2 | +* tabbable 6.4.0 | |
| 3 | +* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE | |
| 4 | +*/ | |
| 5 | +/** | |
| 6 | +* @license React | |
| 7 | +* react-jsx-runtime.production.min.js | |
| 8 | +* | |
| 9 | +* Copyright (c) Facebook, Inc. and its affiliates. | |
| 10 | +* | |
| 11 | +* This source code is licensed under the MIT license found in the | |
| 12 | +* LICENSE file in the root directory of this source tree. | |
| 13 | +*/ | |
| 14 | +/*! @license DOMPurify 3.3.0 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.0/LICENSE */ | |
| 15 | +(function(e,t){var n=Object.create,r=Object.defineProperty,__name=(e,t)=>r(e,`name`,{value:t,configurable:!0}),i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,__esmMin=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},__commonJSMin=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),__exportAll=(e,t)=>{let n={};for(var i in e)r(n,i,{get:e[i],enumerable:!0});return t||r(n,Symbol.toStringTag,{value:`Module`}),n},__copyProps=(e,t,n,o)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=a(t),l=0,u=c.length,d;l<u;l++)d=c[l],!s.call(e,d)&&d!==n&&r(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(o=i(t,d))||o.enumerable});return e},__toESM=(e,t,i)=>(i=e==null?{}:n(o(e)),__copyProps(t||!e||!e.__esModule?r(i,`default`,{value:e,enumerable:!0}):i,e));let c=__toESM(e,1);e=__toESM(e);let l=__toESM(t,1);t=__toESM(t);function hasWindow(){return typeof window<`u`}function getNodeName(e){return isNode(e)?(e.nodeName||``).toLowerCase():`#document`}function getWindow(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function getDocumentElement(e){return((isNode(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function isNode(e){return hasWindow()?e instanceof Node||e instanceof getWindow(e).Node:!1}function isElement(e){return hasWindow()?e instanceof Element||e instanceof getWindow(e).Element:!1}function isHTMLElement(e){return hasWindow()?e instanceof HTMLElement||e instanceof getWindow(e).HTMLElement:!1}function isShadowRoot(e){return!hasWindow()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof getWindow(e).ShadowRoot}function isOverflowElement(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=getComputedStyle$1(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function isTableElement(e){return/^(table|td|th)$/.test(getNodeName(e))}function isTopLayer(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}function isContainingBlock(e){let t=isElement(e)?getComputedStyle$1(e):e;return isNotNone(t.transform)||isNotNone(t.translate)||isNotNone(t.scale)||isNotNone(t.rotate)||isNotNone(t.perspective)||!isWebKit()&&(isNotNone(t.backdropFilter)||isNotNone(t.filter))||u.test(t.willChange||``)||d.test(t.contain||``)}function getContainingBlock(e){let t=getParentNode(e);for(;isHTMLElement(t)&&!isLastTraversableNode(t);){if(isContainingBlock(t))return t;if(isTopLayer(t))return null;t=getParentNode(t)}return null}function isWebKit(){return f??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),f}function isLastTraversableNode(e){return/^(html|body|#document)$/.test(getNodeName(e))}function getComputedStyle$1(e){return getWindow(e).getComputedStyle(e)}function getNodeScroll(e){return isElement(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function getParentNode(e){if(getNodeName(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||isShadowRoot(e)&&e.host||getDocumentElement(e);return isShadowRoot(t)?t.host:t}function getNearestOverflowAncestor(e){let t=getParentNode(e);return isLastTraversableNode(t)?e.ownerDocument?e.ownerDocument.body:e.body:isHTMLElement(t)&&isOverflowElement(t)?t:getNearestOverflowAncestor(t)}function getOverflowAncestors(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=getNearestOverflowAncestor(e),i=r===e.ownerDocument?.body,a=getWindow(r);if(i){let e=getFrameElement(a);return t.concat(a,a.visualViewport||[],isOverflowElement(r)?r:[],e&&n?getOverflowAncestors(e):[])}else return t.concat(r,getOverflowAncestors(r,[],n))}function getFrameElement(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var u,d,isNotNone,f,p=__esmMin((()=>{u=/transform|translate|scale|rotate|perspective|filter/,d=/paint|layout|strict|content/,isNotNone=e=>!!e&&e!==`none`,__name(getComputedStyle$1,`getComputedStyle`)}));function clamp(e,t,n){return v(e,_(t,n))}function evaluate(e,t){return typeof e==`function`?e(t):e}function getSide(e){return e.split(`-`)[0]}function getAlignment(e){return e.split(`-`)[1]}function getOppositeAxis(e){return e===`x`?`y`:`x`}function getAxisLength(e){return e===`y`?`height`:`width`}function getSideAxis(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function getAlignmentAxis(e){return getOppositeAxis(getSideAxis(e))}function getAlignmentSides(e,t,n){n===void 0&&(n=!1);let r=getAlignment(e),i=getAlignmentAxis(e),a=getAxisLength(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=getOppositePlacement(o)),[o,getOppositePlacement(o)]}function getExpandedPlacements(e){let t=getOppositePlacement(e);return[getOppositeAlignmentPlacement(e),t,getOppositeAlignmentPlacement(t)]}function getOppositeAlignmentPlacement(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}function getSideList(e,t,n){switch(e){case`top`:case`bottom`:return n?t?C:S:t?S:C;case`left`:case`right`:return t?w:T;default:return[]}}function getOppositeAxisPlacements(e,t,n,r){let i=getAlignment(e),a=getSideList(getSide(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(getOppositeAlignmentPlacement)))),a}function getOppositePlacement(e){let t=getSide(e);return x[t]+e.slice(t.length)}function expandPaddingObject(e){return{top:0,right:0,bottom:0,left:0,...e}}function getPaddingObject(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:expandPaddingObject(e)}function rectToClientRect(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}var m,h,g,_,v,y,b,createCoords,x,S,C,w,T,E=__esmMin((()=>{m=[`top`,`right`,`bottom`,`left`],h=[`start`,`end`],g=m.reduce((e,t)=>e.concat(t,t+`-`+h[0],t+`-`+h[1]),[]),_=Math.min,v=Math.max,y=Math.round,b=Math.floor,createCoords=e=>({x:e,y:e}),x={left:`right`,right:`left`,bottom:`top`,top:`bottom`},S=[`left`,`right`],C=[`right`,`left`],w=[`top`,`bottom`],T=[`bottom`,`top`]})),D,O,k,A,j,M,N,P,F,I,L,ee,R,z,B,te,ne,re,ie,ae,oe,se,ce,le,ue,de,fe,V,H,pe,me,he=__esmMin((()=>{D=[`input:not([inert]):not([inert] *)`,`select:not([inert]):not([inert] *)`,`textarea:not([inert]):not([inert] *)`,`a[href]:not([inert]):not([inert] *)`,`button:not([inert]):not([inert] *)`,`[tabindex]:not(slot):not([inert]):not([inert] *)`,`audio[controls]:not([inert]):not([inert] *)`,`video[controls]:not([inert]):not([inert] *)`,`[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)`,`details>summary:first-of-type:not([inert]):not([inert] *)`,`details:not([inert]):not([inert] *)`],O=D.join(`,`),k=typeof Element>`u`,A=k?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,j=!k&&Element.prototype.getRootNode?function(e){return e?.getRootNode?.call(e)}:function(e){return e?.ownerDocument},M=function isInert(e,t){t===void 0&&(t=!0);var n=e?.getAttribute?.call(e,`inert`);return n===``||n===`true`||t&&e&&(typeof e.closest==`function`?e.closest(`[inert]`):M(e.parentNode))},N=function isContentEditable(e){var t=e?.getAttribute?.call(e,`contenteditable`);return t===``||t===`true`},P=function getCandidates(e,t,n){if(M(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(O));return t&&A.call(e,O)&&r.unshift(e),r=r.filter(n),r},F=function getCandidatesIteratively(e,t,n){for(var r=[],i=Array.from(e);i.length;){var a=i.shift();if(!M(a,!1))if(a.tagName===`SLOT`){var o=a.assignedElements(),s=F(o.length?o:a.children,!0,n);n.flatten?r.push.apply(r,s):r.push({scopeParent:a,candidates:s})}else{A.call(a,O)&&n.filter(a)&&(t||!e.includes(a))&&r.push(a);var c=a.shadowRoot||typeof n.getShadowRoot==`function`&&n.getShadowRoot(a),l=!M(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(c&&l){var u=F(c===!0?a.children:c.children,!0,n);n.flatten?r.push.apply(r,u):r.push({scopeParent:a,candidates:u})}else i.unshift.apply(i,a.children)}}return r},I=function hasTabIndex(e){return!isNaN(parseInt(e.getAttribute(`tabindex`),10))},L=function getTabIndex(e){if(!e)throw Error(`No node provided`);return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||N(e))&&!I(e)?0:e.tabIndex},ee=function getSortOrderTabIndex(e,t){var n=L(e);return n<0&&t&&!I(e)?0:n},R=function sortOrderedTabbables(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},z=function isInput(e){return e.tagName===`INPUT`},B=function isHiddenInput(e){return z(e)&&e.type===`hidden`},te=function isDetailsWithSummary(e){return e.tagName===`DETAILS`&&Array.prototype.slice.apply(e.children).some(function(e){return e.tagName===`SUMMARY`})},ne=function getCheckedRadio(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},re=function isTabbableRadio(e){if(!e.name)return!0;var t=e.form||j(e),n=function queryRadios(e){return t.querySelectorAll(`input[type="radio"][name="`+e+`"]`)},r;if(typeof window<`u`&&window.CSS!==void 0&&typeof window.CSS.escape==`function`)r=n(window.CSS.escape(e.name));else try{r=n(e.name)}catch(e){return console.error(`Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s`,e.message),!1}var i=ne(r,e.form);return!i||i===e},ie=function isRadio(e){return z(e)&&e.type===`radio`},ae=function isNonTabbableRadio(e){return ie(e)&&!re(e)},oe=function isNodeAttached(e){var t=e&&j(e),n=t?.host,r=!1;if(t&&t!==e){var i,a,o;for(r=!!((i=n)!=null&&(a=i.ownerDocument)!=null&&a.contains(n)||e!=null&&(o=e.ownerDocument)!=null&&o.contains(e));!r&&n;){var s,c;t=j(n),n=t?.host,r=!!((s=n)!=null&&(c=s.ownerDocument)!=null&&c.contains(n))}}return r},se=function isZeroArea(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},ce=function isHidden(e,t){var n=t.displayCheck,r=t.getShadowRoot;if(n===`full-native`&&`checkVisibility`in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});if(getComputedStyle(e).visibility===`hidden`)return!0;var i=A.call(e,`details>summary:first-of-type`)?e.parentElement:e;if(A.call(i,`details:not([open]) *`))return!0;if(!n||n===`full`||n===`full-native`||n===`legacy-full`){if(typeof r==`function`){for(var a=e;e;){var o=e.parentElement,s=j(e);if(o&&!o.shadowRoot&&r(o)===!0)return se(e);e=e.assignedSlot?e.assignedSlot:!o&&s!==e.ownerDocument?s.host:o}e=a}if(oe(e))return!e.getClientRects().length;if(n!==`legacy-full`)return!0}else if(n===`non-zero-area`)return se(e);return!1},le=function isDisabledFromFieldset(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName===`FIELDSET`&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if(r.tagName===`LEGEND`)return A.call(t,`fieldset[disabled] *`)?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},ue=function isNodeMatchingSelectorFocusable(e,t){return!(t.disabled||B(t)||ce(t,e)||te(t)||le(t))},de=function isNodeMatchingSelectorTabbable(e,t){return!(ae(t)||L(t)<0||!ue(e,t))},fe=function isShadowRootTabbable(e){var t=parseInt(e.getAttribute(`tabindex`),10);return!!(isNaN(t)||t>=0)},V=function sortByOrder(e){var t=[],n=[];return e.forEach(function(e,r){var i=!!e.scopeParent,a=i?e.scopeParent:e,o=ee(a,i),s=i?V(e.candidates):a;o===0?i?t.push.apply(t,s):t.push(a):n.push({documentOrder:r,tabIndex:o,item:e,isScope:i,content:s})}),n.sort(R).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},H=function tabbable(e,t){t||={};var n=t.getShadowRoot?F([e],t.includeContainer,{filter:de.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:fe}):P(e,t.includeContainer,de.bind(null,t));return V(n)},pe=function focusable(e,t){return t||={},t.getShadowRoot?F([e],t.includeContainer,{filter:ue.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):P(e,t.includeContainer,ue.bind(null,t))},me=function isTabbable(e,t){if(t||={},!e)throw Error(`No node provided`);return A.call(e,O)!==!1&&de(t,e)}}));function getPlatform(){let e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function getUserAgent(){let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(e=>{let{brand:t,version:n}=e;return t+`/`+n}).join(` `):navigator.userAgent}function isSafari(){return/apple/i.test(navigator.vendor)}function isAndroid(){let e=/android/i;return e.test(getPlatform())||e.test(getUserAgent())}function isMac(){return getPlatform().toLowerCase().startsWith(`mac`)&&!navigator.maxTouchPoints}function isJSDOM(){return getUserAgent().includes(`jsdom/`)}function activeElement(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function contains$1(e,t){if(!e||!t)return!1;let n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&isShadowRoot(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function getTarget$1(e){return`composedPath`in e?e.composedPath()[0]:e.target}function isEventTargetWithin(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function isRootElement(e){return e.matches(`html,body`)}function getDocument$1(e){return e?.ownerDocument||document}function isTypeableElement(e){return isHTMLElement(e)&&e.matches(_e)}function isTypeableCombobox(e){return e?e.getAttribute(`role`)===`combobox`&&isTypeableElement(e):!1}function matchesFocusVisible(e){if(!e||isJSDOM())return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function getFloatingFocusElement(e){return e?e.hasAttribute(ge)?e:e.querySelector(`[data-floating-ui-focusable]`)||e:null}function getNodeChildren$1(e,t,n){return n===void 0&&(n=!0),e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...getNodeChildren$1(e,t.id,n)])}function getDeepestNode(e,t){let n,r=-1;function findDeepest(t,i){i>r&&(n=t,r=i),getNodeChildren$1(e,t).forEach(e=>{findDeepest(e.id,i+1)})}return findDeepest(t,0),e.find(e=>e.id===n)}function getNodeAncestors(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function stopEvent(e){e.preventDefault(),e.stopPropagation()}function isReactEvent(e){return`nativeEvent`in e}function isVirtualClick(e){return e.mozInputSource===0&&e.isTrusted?!0:isAndroid()&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function isVirtualPointerEvent(e){return isJSDOM()?!1:!isAndroid()&&e.width===0&&e.height===0||isAndroid()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function isMouseLikePointerType(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function useLatestRef$1(e){let t=c.useRef(e);return W(()=>{t.current=e}),t}function useEffectEvent(e){let t=c.useRef(()=>{});return Se(()=>{t.current=e}),c.useCallback(function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.current==null?void 0:t.current(...n)},[])}function isDifferentGridRow(e,t,n){return Math.floor(e/t)!==n}function isIndexOutOfListBounds(e,t){return t<0||t>=e.current.length}function getMinListIndex(e,t){return findNonDisabledListIndex(e,{disabledIndices:t})}function getMaxListIndex(e,t){return findNonDisabledListIndex(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function findNonDisabledListIndex(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:i,amount:a=1}=t===void 0?{}:t,o=n;do o+=r?-a:a;while(o>=0&&o<=e.current.length-1&&isListIndexDisabled(e,o,i));return o}function getGridNavigatedIndex(e,t){let{event:n,orientation:r,loop:i,rtl:a,cols:o,disabledIndices:s,minIndex:c,maxIndex:l,prevIndex:u,stopEvent:d=!1}=t,f=u;if(n.key===ye){if(d&&stopEvent(n),u===-1)f=l;else if(f=findNonDisabledListIndex(e,{startingIndex:f,amount:o,decrement:!0,disabledIndices:s}),i&&(u-o<c||f<0)){let e=u%o,t=l%o,n=l-(t-e);f=t===e?l:t>e?n:n-o}isIndexOutOfListBounds(e,f)&&(f=u)}if(n.key===be&&(d&&stopEvent(n),u===-1?f=c:(f=findNonDisabledListIndex(e,{startingIndex:u,amount:o,disabledIndices:s}),i&&u+o>l&&(f=findNonDisabledListIndex(e,{startingIndex:u%o-o,amount:o,disabledIndices:s}))),isIndexOutOfListBounds(e,f)&&(f=u)),r===`both`){let t=b(u/o);n.key===(a?U:ve)&&(d&&stopEvent(n),u%o===o-1?i&&(f=findNonDisabledListIndex(e,{startingIndex:u-u%o-1,disabledIndices:s})):(f=findNonDisabledListIndex(e,{startingIndex:u,disabledIndices:s}),i&&isDifferentGridRow(f,o,t)&&(f=findNonDisabledListIndex(e,{startingIndex:u-u%o-1,disabledIndices:s}))),isDifferentGridRow(f,o,t)&&(f=u)),n.key===(a?ve:U)&&(d&&stopEvent(n),u%o===0?i&&(f=findNonDisabledListIndex(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s})):(f=findNonDisabledListIndex(e,{startingIndex:u,decrement:!0,disabledIndices:s}),i&&isDifferentGridRow(f,o,t)&&(f=findNonDisabledListIndex(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}))),isDifferentGridRow(f,o,t)&&(f=u));let r=b(l/o)===t;isIndexOutOfListBounds(e,f)&&(f=i&&r?n.key===(a?ve:U)?l:findNonDisabledListIndex(e,{startingIndex:u-u%o-1,disabledIndices:s}):u)}return f}function createGridCellMap(e,t,n){let r=[],i=0;return e.forEach((e,a)=>{let{width:o,height:s}=e,c=!1;for(n&&(i=0);!c;){let e=[];for(let n=0;n<o;n++)for(let r=0;r<s;r++)e.push(i+n+r*t);i%t+o<=t&&e.every(e=>r[e]==null)?(e.forEach(e=>{r[e]=a}),c=!0):i++}}),[...r]}function getGridCellIndexOfCorner(e,t,n,r,i){if(e===-1)return-1;let a=n.indexOf(e),o=t[e];switch(i){case`tl`:return a;case`tr`:return o?a+o.width-1:a;case`bl`:return o?a+(o.height-1)*r:a;case`br`:return n.lastIndexOf(e)}}function getGridCellIndices(e,t){return t.flatMap((t,n)=>e.includes(t)?[n]:[])}function isListIndexDisabled(e,t,n){if(typeof n==`function`)return n(t);if(n)return n.includes(t);let r=e.current[t];return r==null||r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`}function getTabbableIn(e,t){let n=H(e,getTabbableOptions()),r=n.length;if(r===0)return;let i=activeElement(getDocument$1(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function getNextTabbable(e){return getTabbableIn(getDocument$1(e).body,1)||e}function getPreviousTabbable(e){return getTabbableIn(getDocument$1(e).body,-1)||e}function isOutsideEvent(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!contains$1(n,r)}function disableFocusInside(e){H(e,getTabbableOptions()).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function enableFocusInside(e){e.querySelectorAll(`[data-tabindex]`).forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}var ge,_e,U,ve,ye,be,W,xe,Se,getTabbableOptions,Ce=__esmMin((()=>{p(),E(),he(),ge=`data-floating-ui-focusable`,_e=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,U=`ArrowLeft`,ve=`ArrowRight`,ye=`ArrowUp`,be=`ArrowDown`,__name(contains$1,`contains`),__name(getTarget$1,`getTarget`),__name(getDocument$1,`getDocument`),__name(getNodeChildren$1,`getNodeChildren`),W=typeof document<`u`?c.useLayoutEffect:function noop(){},xe={...c},__name(useLatestRef$1,`useLatestRef`),Se=xe.useInsertionEffect||(e=>e()),getTabbableOptions=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver==`function`&&ResizeObserver.toString().includes(`[native code]`)?`full`:`none`})})),we=__commonJSMin((e=>{var t=globalThis.React,n=Symbol.for(`react.element`),r=Symbol.for(`react.fragment`),i=Object.prototype.hasOwnProperty,a=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function q(e,t,r){var s,c={},l=null,u=null;for(s in r!==void 0&&(l=``+r),t.key!==void 0&&(l=``+t.key),t.ref!==void 0&&(u=t.ref),t)i.call(t,s)&&!o.hasOwnProperty(s)&&(c[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps,t)c[s]===void 0&&(c[s]=t[s]);return{$$typeof:n,type:e,key:l,ref:u,props:c,_owner:a.current}}e.Fragment=r,e.jsx=q,e.jsxs=q})),Te=__commonJSMin(((e,t)=>{t.exports=we()}));function computeCoordsFromPlacement(e,t,n){let{reference:r,floating:i}=e,a=getSideAxis(t),o=getAlignmentAxis(t),s=getAxisLength(o),c=getSide(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(getAlignment(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function detectOverflow$1(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=evaluate(t,e),p=getPaddingObject(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=rectToClientRect(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=rectToClientRect(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}function getPlacementList(e,t,n){return(e?[...n.filter(t=>getAlignment(t)===e),...n.filter(t=>getAlignment(t)!==e)]:n.filter(e=>getSide(e)===e)).filter(n=>!e||getAlignment(n)===e||(t?getOppositeAlignmentPlacement(n)!==n:!1))}function getSideOffsets(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function isAnySideFullyClipped(e){return m.some(t=>e[t]>=0)}function getBoundingRect(e){let t=_(...e.map(e=>e.left)),n=_(...e.map(e=>e.top)),r=v(...e.map(e=>e.right)),i=v(...e.map(e=>e.bottom));return{x:t,y:n,width:r-t,height:i-n}}function getRectsByLine(e){let t=e.slice().sort((e,t)=>e.y-t.y),n=[],r=null;for(let e=0;e<t.length;e++){let i=t[e];!r||i.y-r.y>r.height/2?n.push([i]):n[n.length-1].push(i),r=i}return n.map(e=>rectToClientRect(getBoundingRect(e)))}async function convertValueToCoords(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=getSide(n),s=getAlignment(n),c=getSideAxis(n)===`y`,l=Ae.has(o)?-1:1,u=a&&c?-1:1,d=evaluate(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var G,Ee,K,De,J,Oe,ke,Ae,je,Me,Ne,Pe,Fe=__esmMin((()=>{E(),__name(detectOverflow$1,`detectOverflow`),G=50,Ee=__name(async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:detectOverflow$1},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=computeCoordsFromPlacement(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<G&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=computeCoordsFromPlacement(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},`computePosition`),K=__name(e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=evaluate(e,t)||{};if(l==null)return{};let d=getPaddingObject(u),f={x:n,y:r},p=getAlignmentAxis(i),m=getAxisLength(p),h=await o.getDimensions(l),g=p===`y`,v=g?`top`:`left`,y=g?`bottom`:`right`,b=g?`clientHeight`:`clientWidth`,x=a.reference[m]+a.reference[p]-f[p]-a.floating[m],S=f[p]-a.reference[p],C=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),w=C?C[b]:0;(!w||!await(o.isElement==null?void 0:o.isElement(C)))&&(w=s.floating[b]||a.floating[m]);let T=x/2-S/2,E=w/2-h[m]/2-1,D=_(d[v],E),O=_(d[y],E),k=D,A=w-h[m]-O,j=w/2-h[m]/2+T,M=clamp(k,j,A),N=!c.arrow&&getAlignment(i)!=null&&j!==M&&a.reference[m]/2-(j<k?D:O)-h[m]/2<0,P=N?j<k?j-k:j-A:0;return{[p]:f[p]+P,data:{[p]:M,centerOffset:j-M-P,...N&&{alignmentOffset:P}},reset:N}}}),`arrow`),De=__name(function(e){return e===void 0&&(e={}),{name:`autoPlacement`,options:e,async fn(t){let{rects:n,middlewareData:r,placement:i,platform:a,elements:o}=t,{crossAxis:s=!1,alignment:c,allowedPlacements:l=g,autoAlignment:u=!0,...d}=evaluate(e,t),f=c!==void 0||l===g?getPlacementList(c||null,u,l):l,p=await a.detectOverflow(t,d),m=r.autoPlacement?.index||0,h=f[m];if(h==null)return{};let _=getAlignmentSides(h,n,await(a.isRTL==null?void 0:a.isRTL(o.floating)));if(i!==h)return{reset:{placement:f[0]}};let v=[p[getSide(h)],p[_[0]],p[_[1]]],y=[...r.autoPlacement?.overflows||[],{placement:h,overflows:v}],b=f[m+1];if(b)return{data:{index:m+1,overflows:y},reset:{placement:b}};let x=y.map(e=>{let t=getAlignment(e.placement);return[e.placement,t&&s?e.overflows.slice(0,2).reduce((e,t)=>e+t,0):e.overflows[0],e.overflows]}).sort((e,t)=>e[1]-t[1]),S=x.filter(e=>e[2].slice(0,getAlignment(e[0])?2:3).every(e=>e<=0))[0]?.[0]||x[0][0];return S===i?{}:{data:{index:m+1,overflows:y},reset:{placement:S}}}}},`autoPlacement`),J=__name(function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=evaluate(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=getSide(r),_=getSideAxis(o),v=getSide(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[getOppositePlacement(o)]:getExpandedPlacements(o)),x=p!==`none`;!d&&x&&b.push(...getOppositeAxisPlacements(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=getAlignmentSides(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===getSideAxis(t)||T.every(e=>getSideAxis(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=getSideAxis(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}},`flip`),Oe=__name(function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=evaluate(e,t);switch(i){case`referenceHidden`:{let e=getSideOffsets(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:isAnySideFullyClipped(e)}}}case`escaped`:{let e=getSideOffsets(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:isAnySideFullyClipped(e)}}}default:return{}}}}},`hide`),ke=__name(function(e){return e===void 0&&(e={}),{name:`inline`,options:e,async fn(t){let{placement:n,elements:r,rects:i,platform:a,strategy:o}=t,{padding:s=2,x:c,y:l}=evaluate(e,t),u=Array.from(await(a.getClientRects==null?void 0:a.getClientRects(r.reference))||[]),d=getRectsByLine(u),f=rectToClientRect(getBoundingRect(u)),p=getPaddingObject(s);function getBoundingClientRect(){if(d.length===2&&d[0].left>d[1].right&&c!=null&&l!=null)return d.find(e=>c>e.left-p.left&&c<e.right+p.right&&l>e.top-p.top&&l<e.bottom+p.bottom)||f;if(d.length>=2){if(getSideAxis(n)===`y`){let e=d[0],t=d[d.length-1],r=getSide(n)===`top`,i=e.top,a=t.bottom,o=r?e.left:t.left,s=r?e.right:t.right;return{top:i,bottom:a,left:o,right:s,width:s-o,height:a-i,x:o,y:i}}let e=getSide(n)===`left`,t=v(...d.map(e=>e.right)),r=_(...d.map(e=>e.left)),i=d.filter(n=>e?n.left===r:n.right===t),a=i[0].top,o=i[i.length-1].bottom,s=r,c=t;return{top:a,bottom:o,left:s,right:c,width:c-s,height:o-a,x:s,y:a}}return f}let m=await a.getElementRects({reference:{getBoundingClientRect},floating:r.floating,strategy:o});return i.reference.x!==m.reference.x||i.reference.y!==m.reference.y||i.reference.width!==m.reference.width||i.reference.height!==m.reference.height?{reset:{rects:m}}:{}}}},`inline`),Ae=new Set([`left`,`top`]),je=__name(function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await convertValueToCoords(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},`offset`),Me=__name(function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=evaluate(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=getSideAxis(getSide(i)),p=getOppositeAxis(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=clamp(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=clamp(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},`shift`),Ne=__name(function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=evaluate(e,t),u={x:n,y:r},d=getSideAxis(i),f=getOppositeAxis(d),p=u[f],m=u[d],h=evaluate(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Ae.has(getSide(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},`limitShift`),Pe=__name(function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply=()=>{},...c}=evaluate(e,t),l=await o.detectOverflow(t,c),u=getSide(i),d=getAlignment(i),f=getSideAxis(i)===`y`,{width:p,height:m}=a.floating,h,g;u===`top`||u===`bottom`?(h=u,g=d===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(g=u,h=d===`end`?`top`:`bottom`);let y=m-l.top-l.bottom,b=p-l.left-l.right,x=_(m-l[h],y),S=_(p-l[g],b),C=!t.middlewareData.shift,w=x,T=S;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(T=b),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(w=y),C&&!d){let e=v(l.left,0),t=v(l.right,0),n=v(l.top,0),r=v(l.bottom,0);f?T=p-2*(e!==0||t!==0?e+t:v(l.left,l.right)):w=m-2*(n!==0||r!==0?n+r:v(l.top,l.bottom))}await apply({...t,availableWidth:T,availableHeight:w});let E=await o.getDimensions(s.floating);return p!==E.width||m!==E.height?{reset:{rects:!0}}:{}}}},`size`)}));function getCssDimensions(e){let t=getComputedStyle$1(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=isHTMLElement(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=y(n)!==a||y(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function unwrapElement(e){return isElement(e)?e:e.contextElement}function getScale(e){let t=unwrapElement(e);if(!isHTMLElement(t))return createCoords(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=getCssDimensions(t),o=(a?y(n.width):n.width)/r,s=(a?y(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}function getVisualOffsets(e){let t=getWindow(e);return!isWebKit()||!t.visualViewport?Ie:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function shouldAddVisualOffsets(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==getWindow(e)?!1:t}function getBoundingClientRect(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=unwrapElement(e),o=createCoords(1);t&&(r?isElement(r)&&(o=getScale(r)):o=getScale(e));let s=shouldAddVisualOffsets(a,n,r)?getVisualOffsets(a):createCoords(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=getWindow(a),t=r&&isElement(r)?getWindow(r):r,n=e,i=getFrameElement(n);for(;i&&r&&t!==n;){let e=getScale(i),t=i.getBoundingClientRect(),r=getComputedStyle$1(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=getWindow(i),i=getFrameElement(n)}}return rectToClientRect({width:u,height:d,x:c,y:l})}function getWindowScrollBarX(e,t){let n=getNodeScroll(e).scrollLeft;return t?t.left+n:getBoundingClientRect(getDocumentElement(e)).left+n}function getHTMLOffset(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-getWindowScrollBarX(e,n),y:n.top+t.scrollTop}}function convertOffsetParentRelativeRectToViewportRelativeRect(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=getDocumentElement(r),s=t?isTopLayer(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=createCoords(1),u=createCoords(0),d=isHTMLElement(r);if((d||!d&&!a)&&((getNodeName(r)!==`body`||isOverflowElement(o))&&(c=getNodeScroll(r)),d)){let e=getBoundingClientRect(r);l=getScale(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?getHTMLOffset(o,c):createCoords(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function getClientRects(e){return Array.from(e.getClientRects())}function getDocumentRect(e){let t=getDocumentElement(e),n=getNodeScroll(e),r=e.ownerDocument.body,i=v(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=v(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+getWindowScrollBarX(e),s=-n.scrollTop;return getComputedStyle$1(r).direction===`rtl`&&(o+=v(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}function getViewportRect(e,t){let n=getWindow(e),r=getDocumentElement(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=isWebKit();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=getWindowScrollBarX(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Le&&(a-=o)}else l<=Le&&(a+=l);return{width:a,height:o,x:s,y:c}}function getInnerBoundingClientRect(e,t){let n=getBoundingClientRect(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=isHTMLElement(e)?getScale(e):createCoords(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function getClientRectFromClippingAncestor(e,t,n){let r;if(t===`viewport`)r=getViewportRect(e,n);else if(t===`document`)r=getDocumentRect(getDocumentElement(e));else if(isElement(t))r=getInnerBoundingClientRect(t,n);else{let n=getVisualOffsets(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return rectToClientRect(r)}function hasFixedPositionAncestor(e,t){let n=getParentNode(e);return n===t||!isElement(n)||isLastTraversableNode(n)?!1:getComputedStyle$1(n).position===`fixed`||hasFixedPositionAncestor(n,t)}function getClippingElementAncestors(e,t){let n=t.get(e);if(n)return n;let r=getOverflowAncestors(e,[],!1).filter(e=>isElement(e)&&getNodeName(e)!==`body`),i=null,a=getComputedStyle$1(e).position===`fixed`,o=a?getParentNode(e):e;for(;isElement(o)&&!isLastTraversableNode(o);){let t=getComputedStyle$1(o),n=isContainingBlock(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||isOverflowElement(o)&&!n&&hasFixedPositionAncestor(e,o))?r=r.filter(e=>e!==o):i=t,o=getParentNode(o)}return t.set(e,r),r}function getClippingRect(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?isTopLayer(t)?[]:getClippingElementAncestors(t,this._c):[].concat(n),r],o=getClientRectFromClippingAncestor(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=getClientRectFromClippingAncestor(t,a[e],i);s=v(n.top,s),c=_(n.right,c),l=_(n.bottom,l),u=v(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function getDimensions(e){let{width:t,height:n}=getCssDimensions(e);return{width:t,height:n}}function getRectRelativeToOffsetParent(e,t,n){let r=isHTMLElement(t),i=getDocumentElement(t),a=n===`fixed`,o=getBoundingClientRect(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=createCoords(0);function setLeftRTLScrollbarOffset(){c.x=getWindowScrollBarX(i)}if(r||!r&&!a)if((getNodeName(t)!==`body`||isOverflowElement(i))&&(s=getNodeScroll(t)),r){let e=getBoundingClientRect(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&setLeftRTLScrollbarOffset();a&&!r&&i&&setLeftRTLScrollbarOffset();let l=i&&!r&&!a?getHTMLOffset(i,s):createCoords(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function isStaticPositioned(e){return getComputedStyle$1(e).position===`static`}function getTrueOffsetParent(e,t){if(!isHTMLElement(e)||getComputedStyle$1(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return getDocumentElement(e)===n&&(n=n.ownerDocument.body),n}function getOffsetParent(e,t){let n=getWindow(e);if(isTopLayer(e))return n;if(!isHTMLElement(e)){let t=getParentNode(e);for(;t&&!isLastTraversableNode(t);){if(isElement(t)&&!isStaticPositioned(t))return t;t=getParentNode(t)}return n}let r=getTrueOffsetParent(e,t);for(;r&&isTableElement(r)&&isStaticPositioned(r);)r=getTrueOffsetParent(r,t);return r&&isLastTraversableNode(r)&&isStaticPositioned(r)&&!isContainingBlock(r)?n:r||getContainingBlock(e)||n}function isRTL(e){return getComputedStyle$1(e).direction===`rtl`}function rectsAreEqual(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function observeMove(e,t){let n=null,r,i=getDocumentElement(e);function cleanup(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function refresh(a,o){a===void 0&&(a=!1),o===void 0&&(o=1),cleanup();let s=e.getBoundingClientRect(),{left:c,top:l,width:u,height:d}=s;if(a||t(),!u||!d)return;let f=b(l),p=b(i.clientWidth-(c+u)),m=b(i.clientHeight-(l+d)),h=b(c),g={rootMargin:-f+`px `+-p+`px `+-m+`px `+-h+`px`,threshold:v(0,_(1,o))||1},y=!0;function handleObserve(t){let n=t[0].intersectionRatio;if(n!==o){if(!y)return refresh();n?refresh(!1,n):r=setTimeout(()=>{refresh(!1,1e-7)},1e3)}n===1&&!rectsAreEqual(s,e.getBoundingClientRect())&&refresh(),y=!1}try{n=new IntersectionObserver(handleObserve,{...g,root:i.ownerDocument})}catch{n=new IntersectionObserver(handleObserve,g)}n.observe(e)}return refresh(!0),cleanup}function autoUpdate(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=unwrapElement(e),u=i||a?[...l?getOverflowAncestors(l):[],...t?getOverflowAncestors(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?observeMove(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?getBoundingClientRect(e):null;c&&frameLoop();function frameLoop(){let t=getBoundingClientRect(e);h&&!rectsAreEqual(h,t)&&n(),h=t,m=requestAnimationFrame(frameLoop)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Ie,Le,getElementRects,Re,ze,Be,Ve,He,Ue,We,Ge,Ke,qe,Je,computePosition,Ye=__esmMin((()=>{Fe(),E(),p(),Ie=createCoords(0),Le=25,getElementRects=async function(e){let t=this.getOffsetParent||getOffsetParent,n=this.getDimensions,r=await n(e.floating);return{reference:getRectRelativeToOffsetParent(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},Re={convertOffsetParentRelativeRectToViewportRelativeRect,getDocumentElement,getClippingRect,getOffsetParent,getElementRects,getClientRects,getDimensions,getScale,isElement,isRTL},ze=detectOverflow$1,Be=je,Ve=De,He=Me,Ue=J,We=Pe,Ge=Oe,Ke=K,qe=ke,Je=Ne,computePosition=(e,t,n)=>{let r=new Map,i={platform:Re,...n},a={...i.platform,_c:r};return Ee(e,t,{...i,platform:a})}}));function deepEqual(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!deepEqual(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!deepEqual(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function getDPR(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function roundByDPR(e,t){let n=getDPR(e);return Math.round(t*n)/n}function useLatestRef(e){let t=c.useRef(e);return Xe(()=>{t.current=e}),t}function useFloating$1(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:u,open:d}=e,[f,p]=c.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,h]=c.useState(r);deepEqual(m,r)||h(r);let[g,_]=c.useState(null),[v,y]=c.useState(null),b=c.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=c.useCallback(e=>{e!==T.current&&(T.current=e,y(e))},[]),S=a||g,C=o||v,w=c.useRef(null),T=c.useRef(null),E=c.useRef(f),D=u!=null,O=useLatestRef(u),k=useLatestRef(i),A=useLatestRef(d),j=c.useCallback(()=>{if(!w.current||!T.current)return;let e={placement:t,strategy:n,middleware:m};k.current&&(e.platform=k.current),computePosition(w.current,T.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!deepEqual(E.current,t)&&(E.current=t,l.flushSync(()=>{p(t)}))})},[m,t,n,k,A]);Xe(()=>{d===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[d]);let M=c.useRef(!1);Xe(()=>(M.current=!0,()=>{M.current=!1}),[]),Xe(()=>{if(S&&(w.current=S),C&&(T.current=C),S&&C){if(O.current)return O.current(S,C,j);j()}},[S,C,j,O,D]);let N=c.useMemo(()=>({reference:w,floating:T,setReference:b,setFloating:x}),[b,x]),P=c.useMemo(()=>({reference:S,floating:C}),[S,C]),F=c.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=roundByDPR(P.floating,f.x),r=roundByDPR(P.floating,f.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...getDPR(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,P.floating,f.x,f.y]);return c.useMemo(()=>({...f,update:j,refs:N,elements:P,floatingStyles:F}),[f,j,N,P,F])}var Xe,arrow$1,offset,shift,limitShift,flip,size,autoPlacement,hide,inline,arrow,Ze=__esmMin((()=>{Ye(),Xe=typeof document<`u`?c.useLayoutEffect:function noop(){},__name(useFloating$1,`useFloating`),arrow$1=e=>{function isRef(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(t){let{element:n,padding:r}=typeof e==`function`?e(t):e;return n&&isRef(n)?n.current==null?{}:Ke({element:n.current,padding:r}).fn(t):n?Ke({element:n,padding:r}).fn(t):{}}}},offset=(e,t)=>{let n=Be(e);return{name:n.name,fn:n.fn,options:[e,t]}},shift=(e,t)=>{let n=He(e);return{name:n.name,fn:n.fn,options:[e,t]}},limitShift=(e,t)=>({fn:Je(e).fn,options:[e,t]}),flip=(e,t)=>{let n=Ue(e);return{name:n.name,fn:n.fn,options:[e,t]}},size=(e,t)=>{let n=We(e);return{name:n.name,fn:n.fn,options:[e,t]}},autoPlacement=(e,t)=>{let n=Ve(e);return{name:n.name,fn:n.fn,options:[e,t]}},hide=(e,t)=>{let n=Ge(e);return{name:n.name,fn:n.fn,options:[e,t]}},inline=(e,t)=>{let n=qe(e);return{name:n.name,fn:n.fn,options:[e,t]}},arrow=(e,t)=>{let n=arrow$1(e);return{name:n.name,fn:n.fn,options:[e,t]}}})),Qe=__exportAll({Composite:()=>$,CompositeItem:()=>ct,FloatingArrow:()=>pt,FloatingDelayGroup:()=>FloatingDelayGroup,FloatingFocusManager:()=>FloatingFocusManager,FloatingList:()=>FloatingList,FloatingNode:()=>FloatingNode,FloatingOverlay:()=>Pt,FloatingPortal:()=>FloatingPortal,FloatingTree:()=>FloatingTree,NextFloatingDelayGroup:()=>NextFloatingDelayGroup,arrow:()=>arrow,autoPlacement:()=>autoPlacement,autoUpdate:()=>autoUpdate,computePosition:()=>computePosition,detectOverflow:()=>ze,flip:()=>flip,getOverflowAncestors:()=>getOverflowAncestors,hide:()=>hide,inline:()=>inline,inner:()=>inner,limitShift:()=>limitShift,offset:()=>offset,platform:()=>Re,safePolygon:()=>safePolygon,shift:()=>shift,size:()=>size,useClick:()=>useClick,useClientPoint:()=>useClientPoint,useDelayGroup:()=>useDelayGroup,useDelayGroupContext:()=>useDelayGroupContext,useDismiss:()=>useDismiss,useFloating:()=>useFloating,useFloatingNodeId:()=>useFloatingNodeId,useFloatingParentNodeId:()=>useFloatingParentNodeId,useFloatingPortalNode:()=>useFloatingPortalNode,useFloatingRootContext:()=>useFloatingRootContext,useFloatingTree:()=>useFloatingTree,useFocus:()=>useFocus,useHover:()=>useHover,useId:()=>ft,useInnerOffset:()=>useInnerOffset,useInteractions:()=>useInteractions,useListItem:()=>useListItem,useListNavigation:()=>useListNavigation,useMergeRefs:()=>useMergeRefs,useNextDelayGroup:()=>useNextDelayGroup,useRole:()=>useRole,useTransitionStatus:()=>useTransitionStatus,useTransitionStyles:()=>useTransitionStyles,useTypeahead:()=>useTypeahead});function useMergeRefs(t){let n=e.useRef(void 0),r=e.useCallback(e=>{let n=t.map(t=>{if(t!=null){if(typeof t==`function`){let n=t,r=n(e);return typeof r==`function`?r:()=>{n(null)}}return t.current=e,()=>{t.current=null}}});return()=>{n.forEach(e=>e?.())}},t);return e.useMemo(()=>t.every(e=>e==null)?null:e=>{n.current&&=(n.current(),void 0),e!=null&&(n.current=r(e))},t)}function sortByDocumentPosition(e,t){let n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}function FloatingList(t){let{children:n,elementsRef:r,labelsRef:i}=t,[a,o]=e.useState(()=>new Set),s=e.useCallback(e=>{o(t=>new Set(t).add(e))},[]),c=e.useCallback(e=>{o(t=>{let n=new Set(t);return n.delete(e),n})},[]),l=e.useMemo(()=>{let e=new Map;return Array.from(a.keys()).sort(sortByDocumentPosition).forEach((t,n)=>{e.set(t,n)}),e},[a]);return(0,Y.jsx)($e.Provider,{value:e.useMemo(()=>({register:s,unregister:c,map:l,elementsRef:r,labelsRef:i}),[s,c,l,r,i]),children:n})}function useListItem(t){t===void 0&&(t={});let{label:n}=t,{register:r,unregister:i,map:a,elementsRef:o,labelsRef:s}=e.useContext($e),[c,l]=e.useState(null),u=e.useRef(null),d=e.useCallback(e=>{if(u.current=e,c!==null&&(o.current[c]=e,s)){let t=n!==void 0;s.current[c]=t?n:e?.textContent??null}},[c,o,s,n]);return W(()=>{let e=u.current;if(e)return r(e),()=>{i(e)}},[r,i]),W(()=>{let e=u.current?a.get(u.current):null;e!=null&&l(e)},[a]),e.useMemo(()=>({ref:d,index:c??-1}),[c,d])}function renderJsx(t,n){return typeof t==`function`?t(n):t?e.cloneElement(t,n):(0,Y.jsx)(`div`,{...n})}function useFloatingId(){let[t,n]=e.useState(()=>ut?genId():void 0);return W(()=>{t??n(genId())},[]),e.useEffect(()=>{ut=!0},[]),t}function createEventEmitter(){let e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}function useFloatingNodeId(e){let t=ft(),n=useFloatingTree(),r=useFloatingParentNodeId(),i=e||r;return W(()=>{if(!t)return;let e={id:t,parentId:i};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,i]),t}function FloatingNode(t){let{children:n,id:r}=t,i=useFloatingParentNodeId();return(0,Y.jsx)(mt.Provider,{value:e.useMemo(()=>({id:r,parentId:i}),[r,i]),children:n})}function FloatingTree(t){let{children:n}=t,r=e.useRef([]),i=e.useCallback(e=>{r.current=[...r.current,e]},[]),a=e.useCallback(e=>{r.current=r.current.filter(t=>t!==e)},[]),[o]=e.useState(()=>createEventEmitter());return(0,Y.jsx)(ht.Provider,{value:e.useMemo(()=>({nodesRef:r,addNode:i,removeNode:a,events:o}),[i,a,o]),children:n})}function createAttribute(e){return`data-floating-ui-`+e}function clearTimeoutIfSet(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}function getDelay(e,t,n){if(n&&!isMouseLikePointerType(n))return 0;if(typeof e==`number`)return e;if(typeof e==`function`){let n=e();return typeof n==`number`?n:n?.[t]}return e?.[t]}function getRestMs(e){return typeof e==`function`?e():e}function useHover(t,n){n===void 0&&(n={});let{open:r,onOpenChange:i,dataRef:a,events:o,elements:s}=t,{enabled:c=!0,delay:l=0,handleClose:u=null,mouseOnly:d=!1,restMs:f=0,move:p=!0}=n,m=useFloatingTree(),h=useFloatingParentNodeId(),g=useLatestRef$1(u),_=useLatestRef$1(l),v=useLatestRef$1(r),y=useLatestRef$1(f),b=e.useRef(),x=e.useRef(-1),S=e.useRef(),C=e.useRef(-1),w=e.useRef(!0),T=e.useRef(!1),E=e.useRef(()=>{}),D=e.useRef(!1),O=useEffectEvent(()=>{let e=a.current.openEvent?.type;return e?.includes(`mouse`)&&e!==`mousedown`});e.useEffect(()=>{if(!c)return;function onOpenChange(e){let{open:t}=e;t||(clearTimeoutIfSet(x),clearTimeoutIfSet(C),w.current=!0,D.current=!1)}return o.on(`openchange`,onOpenChange),()=>{o.off(`openchange`,onOpenChange)}},[c,o]),e.useEffect(()=>{if(!c||!g.current||!r)return;function onLeave(e){O()&&i(!1,e,`hover`)}let e=getDocument$1(s.floating).documentElement;return e.addEventListener(`mouseleave`,onLeave),()=>{e.removeEventListener(`mouseleave`,onLeave)}},[s.floating,r,i,c,g,O]);let k=e.useCallback(function(e,t,n){t===void 0&&(t=!0),n===void 0&&(n=`hover`);let r=getDelay(_.current,`close`,b.current);r&&!S.current?(clearTimeoutIfSet(x),x.current=window.setTimeout(()=>i(!1,e,n),r)):t&&(clearTimeoutIfSet(x),i(!1,e,n))},[_,i]),A=useEffectEvent(()=>{E.current(),S.current=void 0}),j=useEffectEvent(()=>{if(T.current){let e=getDocument$1(s.floating).body;e.style.pointerEvents=``,e.removeAttribute(gt),T.current=!1}}),M=useEffectEvent(()=>a.current.openEvent?[`click`,`mousedown`].includes(a.current.openEvent.type):!1);e.useEffect(()=>{if(!c)return;function onReferenceMouseEnter(e){if(clearTimeoutIfSet(x),w.current=!1,d&&!isMouseLikePointerType(b.current)||getRestMs(y.current)>0&&!getDelay(_.current,`open`))return;let t=getDelay(_.current,`open`,b.current);t?x.current=window.setTimeout(()=>{v.current||i(!0,e,`hover`)},t):r||i(!0,e,`hover`)}function onReferenceMouseLeave(e){if(M()){j();return}E.current();let t=getDocument$1(s.floating);if(clearTimeoutIfSet(C),D.current=!1,g.current&&a.current.floatingContext){r||clearTimeoutIfSet(x),S.current=g.current({...a.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){j(),A(),M()||k(e,!0,`safe-polygon`)}});let n=S.current;t.addEventListener(`mousemove`,n),E.current=()=>{t.removeEventListener(`mousemove`,n)};return}(b.current!==`touch`||!contains$1(s.floating,e.relatedTarget))&&k(e)}function onScrollMouseLeave(e){M()||a.current.floatingContext&&(g.current==null||g.current({...a.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){j(),A(),M()||k(e)}})(e))}function onFloatingMouseEnter(){clearTimeoutIfSet(x)}function onFloatingMouseLeave(e){M()||k(e,!1)}if(isElement(s.domReference)){let e=s.domReference,t=s.floating;return r&&e.addEventListener(`mouseleave`,onScrollMouseLeave),p&&e.addEventListener(`mousemove`,onReferenceMouseEnter,{once:!0}),e.addEventListener(`mouseenter`,onReferenceMouseEnter),e.addEventListener(`mouseleave`,onReferenceMouseLeave),t&&(t.addEventListener(`mouseleave`,onScrollMouseLeave),t.addEventListener(`mouseenter`,onFloatingMouseEnter),t.addEventListener(`mouseleave`,onFloatingMouseLeave)),()=>{r&&e.removeEventListener(`mouseleave`,onScrollMouseLeave),p&&e.removeEventListener(`mousemove`,onReferenceMouseEnter),e.removeEventListener(`mouseenter`,onReferenceMouseEnter),e.removeEventListener(`mouseleave`,onReferenceMouseLeave),t&&(t.removeEventListener(`mouseleave`,onScrollMouseLeave),t.removeEventListener(`mouseenter`,onFloatingMouseEnter),t.removeEventListener(`mouseleave`,onFloatingMouseLeave))}}},[s,c,t,d,p,k,A,j,i,r,v,m,_,g,a,M,y]),W(()=>{var e;if(c&&r&&(e=g.current)!=null&&(e=e.__options)!=null&&e.blockPointerEvents&&O()){T.current=!0;let e=s.floating;if(isElement(s.domReference)&&e){var t;let n=getDocument$1(s.floating).body;n.setAttribute(gt,``);let r=s.domReference,i=m==null||(t=m.nodesRef.current.find(e=>e.id===h))==null||(t=t.context)==null?void 0:t.elements.floating;return i&&(i.style.pointerEvents=``),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,e.style.pointerEvents=`auto`,()=>{n.style.pointerEvents=``,r.style.pointerEvents=``,e.style.pointerEvents=``}}}},[c,r,h,s,m,g,O]),W(()=>{r||(b.current=void 0,D.current=!1,A(),j())},[r,A,j]),e.useEffect(()=>()=>{A(),clearTimeoutIfSet(x),clearTimeoutIfSet(C),j()},[c,s.domReference,A,j]);let N=e.useMemo(()=>{function setPointerRef(e){b.current=e.pointerType}return{onPointerDown:setPointerRef,onPointerEnter:setPointerRef,onMouseMove(e){let{nativeEvent:t}=e;function handleMouseMove(){!w.current&&!v.current&&i(!0,t,`hover`)}d&&!isMouseLikePointerType(b.current)||r||getRestMs(y.current)===0||D.current&&e.movementX**2+e.movementY**2<2||(clearTimeoutIfSet(C),b.current===`touch`?handleMouseMove():(D.current=!0,C.current=window.setTimeout(handleMouseMove,getRestMs(y.current))))}}},[d,i,r,v,y]);return e.useMemo(()=>c?{reference:N}:{},[c,N])}function FloatingDelayGroup(t){let{children:n,delay:r,timeoutMs:i=0}=t,[a,o]=e.useReducer((e,t)=>({...e,...t}),{delay:r,timeoutMs:i,initialDelay:r,currentId:null,isInstantPhase:!1}),s=e.useRef(null),c=e.useCallback(e=>{o({currentId:e})},[]);return W(()=>{a.currentId?s.current===null?s.current=a.currentId:a.isInstantPhase||o({isInstantPhase:!0}):(a.isInstantPhase&&o({isInstantPhase:!1}),s.current=null)},[a.currentId,a.isInstantPhase]),(0,Y.jsx)(_t.Provider,{value:e.useMemo(()=>({...a,setState:o,setCurrentId:c}),[a,c]),children:n})}function useDelayGroup(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,floatingId:i}=e,{id:a,enabled:o=!0}=t,s=a??i,c=useDelayGroupContext(),{currentId:l,setCurrentId:u,initialDelay:d,setState:f,timeoutMs:p}=c;return W(()=>{o&&l&&(f({delay:{open:1,close:getDelay(d,`close`)}}),l!==s&&r(!1))},[o,s,r,f,l,d]),W(()=>{function unset(){r(!1),f({delay:d,currentId:null})}if(o&&l&&!n&&l===s){if(p){let e=window.setTimeout(unset,p);return()=>{clearTimeout(e)}}unset()}},[o,n,f,l,s,r,d,p]),W(()=>{o&&(u===NOOP||!n||u(s))},[o,n,u,s]),c}function NextFloatingDelayGroup(t){let{children:n,delay:r,timeoutMs:i=0}=t,a=e.useRef(r),o=e.useRef(r),s=e.useRef(null),c=e.useRef(null),l=e.useRef(-1);return(0,Y.jsx)(vt.Provider,{value:e.useMemo(()=>({hasProvider:!0,delayRef:a,initialDelayRef:o,currentIdRef:s,timeoutMs:i,currentContextRef:c,timeoutIdRef:l}),[i]),children:n})}function useNextDelayGroup(t,n){n===void 0&&(n={});let{open:r,onOpenChange:i,floatingId:a}=t,{enabled:o=!0}=n,{currentIdRef:s,delayRef:c,timeoutMs:l,initialDelayRef:u,currentContextRef:d,hasProvider:f,timeoutIdRef:p}=e.useContext(vt),[m,h]=e.useState(!1);return W(()=>{function unset(){var e;h(!1),(e=d.current)==null||e.setIsInstantPhase(!1),s.current=null,d.current=null,c.current=u.current}if(o&&s.current&&!r&&s.current===a){if(h(!1),l)return p.current=window.setTimeout(unset,l),()=>{clearTimeout(p.current)};unset()}},[o,r,a,s,c,l,u,d,p]),W(()=>{if(!o||!r)return;let e=d.current,t=s.current;d.current={onOpenChange:i,setIsInstantPhase:h},s.current=a,c.current={open:0,close:getDelay(u.current,`close`)},t!==null&&t!==a?(clearTimeoutIfSet(p),h(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1)):(h(!1),e?.setIsInstantPhase(!1))},[o,r,a,i,s,c,l,u,d,p]),W(()=>()=>{d.current=null},[d]),e.useMemo(()=>({hasProvider:f,delayRef:c,isInstantPhase:m}),[f,c,m])}function enqueueFocus(e,t){t===void 0&&(t={});let{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(yt);let exec=()=>e?.focus({preventScroll:n});i?exec():yt=requestAnimationFrame(exec)}function contains(e,t){if(!e||!t)return!1;let n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&isShadowRoot(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function getTarget(e){return`composedPath`in e?e.composedPath()[0]:e.target}function getDocument(e){return e?.ownerDocument||document}function getCounterMap(e){return e===`inert`?bt.inert:e===`aria-hidden`?bt[`aria-hidden`]:bt.none}function unwrapHost(e){return e?isShadowRoot(e)?e.host:unwrapHost(e.parentNode):null}function applyAttributeToOthers(e,t,n,r){let i=`data-floating-ui-inert`,a=r?`inert`:n?`aria-hidden`:null,o=correctElements(t,e),s=new Set,c=new Set(o),l=[];St[i]||(St[i]=new WeakMap);let u=St[i];o.forEach(keep),deep(t),s.clear();function keep(e){!e||s.has(e)||(s.add(e),e.parentNode&&keep(e.parentNode))}function deep(e){!e||c.has(e)||[].forEach.call(e.children,e=>{if(getNodeName(e)!==`script`)if(s.has(e))deep(e);else{let t=a?e.getAttribute(a):null,n=t!==null&&t!==`false`,r=getCounterMap(a),o=(r.get(e)||0)+1,s=(u.get(e)||0)+1;r.set(e,o),u.set(e,s),l.push(e),o===1&&n&&xt.add(e),s===1&&e.setAttribute(i,``),!n&&a&&e.setAttribute(a,a===`inert`?``:`true`)}})}return Ct++,()=>{l.forEach(e=>{let t=getCounterMap(a),n=(t.get(e)||0)-1,r=(u.get(e)||0)-1;t.set(e,n),u.set(e,r),n||(!xt.has(e)&&a&&e.removeAttribute(a),xt.delete(e)),r||e.removeAttribute(i)}),Ct--,Ct||(bt.inert=new WeakMap,bt[`aria-hidden`]=new WeakMap,bt.none=new WeakMap,xt=new WeakSet,St={})}}function markOthers(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);let r=getDocument(e[0]).body;return applyAttributeToOthers(e.concat(Array.from(r.querySelectorAll(`[aria-live],[role="status"],output`))),r,t,n)}function useFloatingPortalNode(t){t===void 0&&(t={});let{id:n,root:r}=t,i=ft(),a=usePortalContext(),[o,s]=e.useState(null),c=e.useRef(null);return W(()=>()=>{o?.remove(),queueMicrotask(()=>{c.current=null})},[o]),W(()=>{if(!i||c.current)return;let e=n?document.getElementById(n):null;if(!e)return;let t=document.createElement(`div`);t.id=i,t.setAttribute(Ot,``),e.appendChild(t),c.current=t,s(t)},[n,i]),W(()=>{if(r===null||!i||c.current)return;let e=r||a?.portalNode;e&&!isNode(e)&&(e=e.current),e||=document.body;let t=null;n&&(t=document.createElement(`div`),t.id=n,e.appendChild(t));let o=document.createElement(`div`);o.id=i,o.setAttribute(Ot,``),e=t||e,e.appendChild(o),c.current=o,s(o)},[n,r,i,a]),o}function FloatingPortal(n){let{children:r,id:i,root:a,preserveTabOrder:o=!0}=n,s=useFloatingPortalNode({id:i,root:a}),[c,l]=e.useState(null),u=e.useRef(null),d=e.useRef(null),f=e.useRef(null),p=e.useRef(null),m=c?.modal,h=c?.open,g=!!c&&!c.modal&&c.open&&o&&!!(a||s);return e.useEffect(()=>{if(!s||!o||m)return;function onFocus(e){s&&isOutsideEvent(e)&&(e.type===`focusin`?enableFocusInside:disableFocusInside)(s)}return s.addEventListener(`focusin`,onFocus,!0),s.addEventListener(`focusout`,onFocus,!0),()=>{s.removeEventListener(`focusin`,onFocus,!0),s.removeEventListener(`focusout`,onFocus,!0)}},[s,o,m]),e.useEffect(()=>{s&&(h||enableFocusInside(s))},[h,s]),(0,Y.jsxs)(Dt.Provider,{value:e.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:u,afterOutsideRef:d,beforeInsideRef:f,afterInsideRef:p,portalNode:s,setFocusManagerState:l}),[o,s]),children:[g&&s&&(0,Y.jsx)(Tt,{"data-type":`outside`,ref:u,onFocus:e=>{if(isOutsideEvent(e,s)){var t;(t=f.current)==null||t.focus()}else getPreviousTabbable(c?c.domReference:null)?.focus()}}),g&&s&&(0,Y.jsx)(`span`,{"aria-owns":s.id,style:Et}),s&&t.createPortal(r,s),g&&s&&(0,Y.jsx)(Tt,{"data-type":`outside`,ref:d,onFocus:e=>{if(isOutsideEvent(e,s)){var t;(t=p.current)==null||t.focus()}else getNextTabbable(c?c.domReference:null)?.focus(),c!=null&&c.closeOnFocusOut&&c?.onOpenChange(!1,e.nativeEvent,`focus-out`)}})]})}function useLiteMergeRefs(t){return e.useMemo(()=>e=>{t.forEach(t=>{t&&(t.current=e)})},t)}function clearDisconnectedPreviouslyFocusedElements(){At=At.filter(e=>e.deref()?.isConnected)}function addPreviouslyFocusedElement(e){clearDisconnectedPreviouslyFocusedElements(),e&&getNodeName(e)!==`body`&&(At.push(new WeakRef(e)),At.length>kt&&(At=At.slice(-20)))}function getPreviouslyFocusedElement(){return clearDisconnectedPreviouslyFocusedElements(),At[At.length-1]?.deref()}function getFirstTabbableElement(e){let t=getTabbableOptions();return me(e,t)?e:H(e,t)[0]||e}function handleTabIndex(e,t){var n;if(!t.current.includes(`floating`)&&!((n=e.getAttribute(`role`))!=null&&n.includes(`dialog`)))return;let r=getTabbableOptions(),i=pe(e,r).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return me(e,r)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),a=e.getAttribute(`tabindex`);t.current.includes(`floating`)||i.length===0?a!==`0`&&e.setAttribute(`tabindex`,`0`):(a!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function FloatingFocusManager(t){let{context:n,children:r,disabled:i=!1,order:a=[`content`],guards:o=!0,initialFocus:s=0,returnFocus:c=!0,restoreFocus:l=!1,modal:u=!0,visuallyHiddenDismiss:d=!1,closeOnFocusOut:f=!0,outsideElementsInert:p=!1,getInsideElements:_getInsideElements=()=>[]}=t,{open:m,onOpenChange:h,events:g,dataRef:_,elements:{domReference:v,floating:y}}=n,b=useEffectEvent(()=>_.current.floatingContext?.nodeId),x=useEffectEvent(_getInsideElements),S=typeof s==`number`&&s<0,C=isTypeableCombobox(v)&&S,w=supportsInert(),T=!w||o,E=!T||w&&p,D=useLatestRef$1(a),O=useLatestRef$1(s),k=useLatestRef$1(c),A=useFloatingTree(),j=usePortalContext(),M=e.useRef(null),N=e.useRef(null),P=e.useRef(!1),F=e.useRef(!1),I=e.useRef(-1),L=e.useRef(-1),ee=j!=null,R=getFloatingFocusElement(y),z=useEffectEvent(function(e){return e===void 0&&(e=R),e?H(e,getTabbableOptions()):[]}),B=useEffectEvent(e=>{let t=z(e);return D.current.map(e=>v&&e===`reference`?v:R&&e===`floating`?R:t).filter(Boolean).flat()});e.useEffect(()=>{if(i||!u)return;function onKeyDown(e){if(e.key===`Tab`){contains$1(R,activeElement(getDocument$1(R)))&&z().length===0&&!C&&stopEvent(e);let t=B(),n=getTarget$1(e);D.current[0]===`reference`&&n===v&&(stopEvent(e),e.shiftKey?enqueueFocus(t[t.length-1]):enqueueFocus(t[1])),D.current[1]===`floating`&&n===R&&e.shiftKey&&(stopEvent(e),enqueueFocus(t[0]))}}let e=getDocument$1(R);return e.addEventListener(`keydown`,onKeyDown),()=>{e.removeEventListener(`keydown`,onKeyDown)}},[i,v,R,u,D,C,z,B]),e.useEffect(()=>{if(i||!y)return;function handleFocusIn(e){let t=getTarget$1(e),n=z().indexOf(t);n!==-1&&(I.current=n)}return y.addEventListener(`focusin`,handleFocusIn),()=>{y.removeEventListener(`focusin`,handleFocusIn)}},[i,y,z]),e.useEffect(()=>{if(i||!f)return;function handlePointerDown(){F.current=!0,setTimeout(()=>{F.current=!1})}function handleFocusOutside(e){let t=e.relatedTarget,n=e.currentTarget,r=getTarget$1(e);queueMicrotask(()=>{let i=b(),a=!(contains$1(v,t)||contains$1(y,t)||contains$1(t,y)||contains$1(j?.portalNode,t)||t!=null&&t.hasAttribute(createAttribute(`focus-guard`))||A&&(getNodeChildren$1(A.nodesRef.current,i).find(e=>contains$1(e.context?.elements.floating,t)||contains$1(e.context?.elements.domReference,t))||getNodeAncestors(A.nodesRef.current,i).find(e=>[e.context?.elements.floating,getFloatingFocusElement(e.context?.elements.floating)].includes(t)||e.context?.elements.domReference===t)));if(n===v&&R&&handleTabIndex(R,D),l&&n!==v&&!(r!=null&&r.isConnected)&&activeElement(getDocument$1(R))===getDocument$1(R).body){isHTMLElement(R)&&R.focus();let e=I.current,t=z(),n=t[e]||t[t.length-1]||R;isHTMLElement(n)&&n.focus()}if(_.current.insideReactTree){_.current.insideReactTree=!1;return}(C||!u)&&t&&a&&!F.current&&t!==getPreviouslyFocusedElement()&&(P.current=!0,h(!1,e,`focus-out`))})}let e=!!(!A&&j);function markInsideReactTree(){clearTimeoutIfSet(L),_.current.insideReactTree=!0,L.current=window.setTimeout(()=>{_.current.insideReactTree=!1})}if(y&&isHTMLElement(v))return v.addEventListener(`focusout`,handleFocusOutside),v.addEventListener(`pointerdown`,handlePointerDown),y.addEventListener(`focusout`,handleFocusOutside),e&&y.addEventListener(`focusout`,markInsideReactTree,!0),()=>{v.removeEventListener(`focusout`,handleFocusOutside),v.removeEventListener(`pointerdown`,handlePointerDown),y.removeEventListener(`focusout`,handleFocusOutside),e&&y.removeEventListener(`focusout`,markInsideReactTree,!0)}},[i,v,y,R,u,A,j,h,f,l,z,C,b,D,_]);let te=e.useRef(null),ne=e.useRef(null),re=useLiteMergeRefs([te,j?.beforeInsideRef]),ie=useLiteMergeRefs([ne,j?.afterInsideRef]);e.useEffect(()=>{var e,t;if(i||!y)return;let n=Array.from((j==null||(e=j.portalNode)==null?void 0:e.querySelectorAll(`[`+createAttribute(`portal`)+`]`))||[]),r=(t=(A?getNodeAncestors(A.nodesRef.current,b()):[]).find(e=>isTypeableCombobox(e.context?.elements.domReference||null)))==null||(t=t.context)==null?void 0:t.elements.domReference,a=[y,r,...n,...x(),M.current,N.current,te.current,ne.current,j?.beforeOutsideRef.current,j?.afterOutsideRef.current,D.current.includes(`reference`)||C?v:null].filter(e=>e!=null),o=u||C?markOthers(a,!E,E):markOthers(a);return()=>{o()}},[i,v,y,u,D,j,C,T,E,A,b,x]),W(()=>{if(i||!isHTMLElement(R))return;let e=activeElement(getDocument$1(R));queueMicrotask(()=>{let t=B(R),n=O.current,r=(typeof n==`number`?t[n]:n.current)||R,i=contains$1(R,e);!S&&!i&&m&&enqueueFocus(r,{preventScroll:r===R})})},[i,m,R,S,B,O]),W(()=>{if(i||!R)return;let e=getDocument$1(R);addPreviouslyFocusedElement(activeElement(e));function onOpenChange(e){let{reason:t,event:n,nested:r}=e;if([`hover`,`safe-polygon`].includes(t)&&n.type===`mouseleave`&&(P.current=!0),t===`outside-press`)if(r)P.current=!1;else if(isVirtualClick(n)||isVirtualPointerEvent(n))P.current=!1;else{let e=!1;document.createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?P.current=!1:P.current=!0}}g.on(`openchange`,onOpenChange);let t=e.createElement(`span`);t.setAttribute(`tabindex`,`-1`),t.setAttribute(`aria-hidden`,`true`),Object.assign(t.style,wt),ee&&v&&v.insertAdjacentElement(`afterend`,t);function getReturnElement(){if(typeof k.current==`boolean`){let e=v||getPreviouslyFocusedElement();return e&&e.isConnected?e:t}return k.current.current||t}return()=>{g.off(`openchange`,onOpenChange);let n=activeElement(e),r=contains$1(y,n)||A&&getNodeChildren$1(A.nodesRef.current,b(),!1).some(e=>contains$1(e.context?.elements.floating,n)),i=getReturnElement();queueMicrotask(()=>{let a=getFirstTabbableElement(i);k.current&&!P.current&&isHTMLElement(a)&&(a===n||n===e.body||r)&&a.focus({preventScroll:!0}),t.remove()})}},[i,y,R,k,_,g,A,ee,v,b]),e.useEffect(()=>(queueMicrotask(()=>{P.current=!1}),()=>{queueMicrotask(clearDisconnectedPreviouslyFocusedElements)}),[i]),W(()=>{if(!i&&j)return j.setFocusManagerState({modal:u,closeOnFocusOut:f,open:m,onOpenChange:h,domReference:v}),()=>{j.setFocusManagerState(null)}},[i,j,u,m,h,f,v]),W(()=>{i||R&&handleTabIndex(R,D)},[i,R,D]);function renderDismissButton(e){return i||!d||!u?null:(0,Y.jsx)(jt,{ref:e===`start`?M:N,onClick:e=>h(!1,e.nativeEvent),children:typeof d==`string`?d:`Dismiss`})}let ae=!i&&T&&(!u||!C)&&(ee||u);return(0,Y.jsxs)(Y.Fragment,{children:[ae&&(0,Y.jsx)(Tt,{"data-type":`inside`,ref:re,onFocus:e=>{if(u){let e=B();enqueueFocus(a[0]===`reference`?e[0]:e[e.length-1])}else if(j!=null&&j.preserveTabOrder&&j.portalNode)if(P.current=!1,isOutsideEvent(e,j.portalNode))getNextTabbable(v)?.focus();else{var t;(t=j.beforeOutsideRef.current)==null||t.focus()}}}),!C&&renderDismissButton(`start`),r,renderDismissButton(`end`),ae&&(0,Y.jsx)(Tt,{"data-type":`inside`,ref:ie,onFocus:e=>{if(u)enqueueFocus(B()[0]);else if(j!=null&&j.preserveTabOrder&&j.portalNode)if(f&&(P.current=!0),isOutsideEvent(e,j.portalNode))getPreviousTabbable(v)?.focus();else{var t;(t=j.afterOutsideRef.current)==null||t.focus()}}})]})}function enableScrollLock(){let e=getPlatform(),t=/iP(hone|ad|od)|iOS/.test(e)||e===`MacIntel`&&navigator.maxTouchPoints>1,n=document.body.style,r=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?`paddingLeft`:`paddingRight`,i=window.innerWidth-document.documentElement.clientWidth,a=n.left?parseFloat(n.left):window.scrollX,o=n.top?parseFloat(n.top):window.scrollY;if(n.overflow=`hidden`,n.setProperty(Nt,i+`px`),i&&(n[r]=i+`px`),t){let e=window.visualViewport?.offsetLeft||0,t=window.visualViewport?.offsetTop||0;Object.assign(n,{position:`fixed`,top:-(o-Math.floor(t))+`px`,left:-(a-Math.floor(e))+`px`,right:`0`})}return()=>{Object.assign(n,{overflow:``,[r]:``}),n.removeProperty(Nt),t&&(Object.assign(n,{position:``,top:``,left:``,right:``}),window.scrollTo(a,o))}}function isButtonTarget(e){return isHTMLElement(e.target)&&e.target.tagName===`BUTTON`}function isAnchorTarget(e){return isHTMLElement(e.target)&&e.target.tagName===`A`}function isSpaceIgnored(e){return isTypeableElement(e)}function useClick(t,n){n===void 0&&(n={});let{open:r,onOpenChange:i,dataRef:a,elements:{domReference:o}}=t,{enabled:s=!0,event:c=`click`,toggle:l=!0,ignoreMouse:u=!1,keyboardHandlers:d=!0,stickIfOpen:f=!0}=n,p=e.useRef(),m=e.useRef(!1),h=e.useMemo(()=>({onPointerDown(e){p.current=e.pointerType},onMouseDown(e){let t=p.current;e.button===0&&c!==`click`&&(isMouseLikePointerType(t,!0)&&u||(r&&l&&(!(a.current.openEvent&&f)||a.current.openEvent.type===`mousedown`)?i(!1,e.nativeEvent,`click`):(e.preventDefault(),i(!0,e.nativeEvent,`click`))))},onClick(e){let t=p.current;if(c===`mousedown`&&p.current){p.current=void 0;return}isMouseLikePointerType(t,!0)&&u||(r&&l&&(!(a.current.openEvent&&f)||a.current.openEvent.type===`click`)?i(!1,e.nativeEvent,`click`):i(!0,e.nativeEvent,`click`))},onKeyDown(e){p.current=void 0,!(e.defaultPrevented||!d||isButtonTarget(e))&&(e.key===` `&&!isSpaceIgnored(o)&&(e.preventDefault(),m.current=!0),!isAnchorTarget(e)&&e.key===`Enter`&&i(!(r&&l),e.nativeEvent,`click`))},onKeyUp(e){e.defaultPrevented||!d||isButtonTarget(e)||isSpaceIgnored(o)||e.key===` `&&m.current&&(m.current=!1,i(!(r&&l),e.nativeEvent,`click`))}}),[a,o,c,u,d,i,r,f,l]);return e.useMemo(()=>s?{reference:h}:{},[s,h])}function createVirtualElement(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=a.width,u=a.height,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,l=0,u=0,!i||c?(l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f):i&&!c&&(u=t.axis===`x`?a.height:u,l=t.axis===`y`?a.width:l),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function isMouseBasedEvent(e){return e!=null&&e.clientX!=null}function useClientPoint(t,n){n===void 0&&(n={});let{open:r,dataRef:i,elements:{floating:a,domReference:o},refs:s}=t,{enabled:c=!0,axis:l=`both`,x:u=null,y:d=null}=n,f=e.useRef(!1),p=e.useRef(null),[m,h]=e.useState(),[g,_]=e.useState([]),v=useEffectEvent((e,t)=>{f.current||i.current.openEvent&&!isMouseBasedEvent(i.current.openEvent)||s.setPositionReference(createVirtualElement(o,{x:e,y:t,axis:l,dataRef:i,pointerType:m}))}),y=useEffectEvent(e=>{u==null&&d==null&&(r?p.current||_([]):v(e.clientX,e.clientY))}),b=isMouseLikePointerType(m)?a:r,x=e.useCallback(()=>{if(!b||!c||u!=null||d!=null)return;let e=getWindow(a);function handleMouseMove(t){let n=getTarget$1(t);contains$1(a,n)?(e.removeEventListener(`mousemove`,handleMouseMove),p.current=null):v(t.clientX,t.clientY)}if(!i.current.openEvent||isMouseBasedEvent(i.current.openEvent)){e.addEventListener(`mousemove`,handleMouseMove);let cleanup=()=>{e.removeEventListener(`mousemove`,handleMouseMove),p.current=null};return p.current=cleanup,cleanup}s.setPositionReference(o)},[b,c,u,d,a,i,s,o,v]);e.useEffect(()=>x(),[x,g]),e.useEffect(()=>{c&&!a&&(f.current=!1)},[c,a]),e.useEffect(()=>{!c&&r&&(f.current=!0)},[c,r]),W(()=>{c&&(u!=null||d!=null)&&(f.current=!1,v(u,d))},[c,u,d,v]);let S=e.useMemo(()=>{function setPointerTypeRef(e){let{pointerType:t}=e;h(t)}return{onPointerDown:setPointerTypeRef,onPointerEnter:setPointerTypeRef,onMouseMove:y,onMouseEnter:y}},[y]);return e.useMemo(()=>c?{reference:S}:{},[c,S])}function useDismiss(t,n){n===void 0&&(n={});let{open:r,onOpenChange:i,elements:a,dataRef:o}=t,{enabled:s=!0,escapeKey:c=!0,outsidePress:l=!0,outsidePressEvent:u=`pointerdown`,referencePress:d=!1,referencePressEvent:f=`pointerdown`,ancestorScroll:p=!1,bubbles:m,capture:h}=n,g=useFloatingTree(),_=useEffectEvent(typeof l==`function`?l:()=>!1),v=typeof l==`function`?_:l,y=e.useRef(!1),{escapeKey:b,outsidePress:x}=normalizeProp(m),{escapeKey:S,outsidePress:C}=normalizeProp(h),w=e.useRef(!1),T=useEffectEvent(e=>{if(!r||!s||!c||e.key!==`Escape`||w.current)return;let t=o.current.floatingContext?.nodeId,n=g?getNodeChildren$1(g.nodesRef.current,t):[];if(!b&&(e.stopPropagation(),n.length>0)){let e=!0;if(n.forEach(t=>{var n;if((n=t.context)!=null&&n.open&&!t.context.dataRef.current.__escapeKeyBubbles){e=!1;return}}),!e)return}i(!1,isReactEvent(e)?e.nativeEvent:e,`escape-key`)}),E=useEffectEvent(e=>{var t;let callback=()=>{var t;T(e),(t=getTarget$1(e))==null||t.removeEventListener(`keydown`,callback)};(t=getTarget$1(e))==null||t.addEventListener(`keydown`,callback)}),D=useEffectEvent(e=>{let t=o.current.insideReactTree;o.current.insideReactTree=!1;let n=y.current;if(y.current=!1,u===`click`&&n||t||typeof v==`function`&&!v(e))return;let r=getTarget$1(e),s=`[`+createAttribute(`inert`)+`]`,c=getDocument$1(a.floating).querySelectorAll(s),l=isElement(r)?r:null;for(;l&&!isLastTraversableNode(l);){let e=getParentNode(l);if(isLastTraversableNode(e)||!isElement(e))break;l=e}if(c.length&&isElement(r)&&!isRootElement(r)&&!contains$1(r,a.floating)&&Array.from(c).every(e=>!contains$1(l,e)))return;if(isHTMLElement(r)&&A){let t=isLastTraversableNode(r),n=getComputedStyle$1(r),i=/auto|scroll/,a=t||i.test(n.overflowX),o=t||i.test(n.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=n.direction===`rtl`,u=c&&(l?e.offsetX<=r.offsetWidth-r.clientWidth:e.offsetX>r.clientWidth),d=s&&e.offsetY>r.clientHeight;if(u||d)return}let d=o.current.floatingContext?.nodeId,f=g&&getNodeChildren$1(g.nodesRef.current,d).some(t=>isEventTargetWithin(e,t.context?.elements.floating));if(isEventTargetWithin(e,a.floating)||isEventTargetWithin(e,a.domReference)||f)return;let p=g?getNodeChildren$1(g.nodesRef.current,d):[];if(p.length>0){let e=!0;if(p.forEach(t=>{var n;if((n=t.context)!=null&&n.open&&!t.context.dataRef.current.__outsidePressBubbles){e=!1;return}}),!e)return}i(!1,e,`outside-press`)}),O=useEffectEvent(e=>{var t;let callback=()=>{var t;D(e),(t=getTarget$1(e))==null||t.removeEventListener(u,callback)};(t=getTarget$1(e))==null||t.addEventListener(u,callback)});e.useEffect(()=>{if(!r||!s)return;o.current.__escapeKeyBubbles=b,o.current.__outsidePressBubbles=x;let e=-1;function onScroll(e){i(!1,e,`ancestor-scroll`)}function handleCompositionStart(){window.clearTimeout(e),w.current=!0}function handleCompositionEnd(){e=window.setTimeout(()=>{w.current=!1},isWebKit()?5:0)}let t=getDocument$1(a.floating);c&&(t.addEventListener(`keydown`,S?E:T,S),t.addEventListener(`compositionstart`,handleCompositionStart),t.addEventListener(`compositionend`,handleCompositionEnd)),v&&t.addEventListener(u,C?O:D,C);let n=[];return p&&(isElement(a.domReference)&&(n=getOverflowAncestors(a.domReference)),isElement(a.floating)&&(n=n.concat(getOverflowAncestors(a.floating))),!isElement(a.reference)&&a.reference&&a.reference.contextElement&&(n=n.concat(getOverflowAncestors(a.reference.contextElement)))),n=n.filter(e=>e!==t.defaultView?.visualViewport),n.forEach(e=>{e.addEventListener(`scroll`,onScroll,{passive:!0})}),()=>{c&&(t.removeEventListener(`keydown`,S?E:T,S),t.removeEventListener(`compositionstart`,handleCompositionStart),t.removeEventListener(`compositionend`,handleCompositionEnd)),v&&t.removeEventListener(u,C?O:D,C),n.forEach(e=>{e.removeEventListener(`scroll`,onScroll)}),window.clearTimeout(e)}},[o,a,c,v,u,r,i,p,s,b,x,T,S,E,D,C,O]),e.useEffect(()=>{o.current.insideReactTree=!1},[o,v,u]);let k=e.useMemo(()=>({onKeyDown:T,...d&&{[Ft[f]]:e=>{i(!1,e.nativeEvent,`reference-press`)},...f!==`click`&&{onClick(e){i(!1,e.nativeEvent,`reference-press`)}}}}),[T,i,d,f]),A=e.useMemo(()=>{function setMouseDownOrUpInside(e){e.button===0&&(y.current=!0)}return{onKeyDown:T,onMouseDown:setMouseDownOrUpInside,onMouseUp:setMouseDownOrUpInside,[It[u]]:()=>{o.current.insideReactTree=!0}}},[T,u,o]);return e.useMemo(()=>s?{reference:k,floating:A}:{},[s,k,A])}function useFloatingRootContext(t){let{open:n=!1,onOpenChange:r,elements:i}=t,a=ft(),o=e.useRef({}),[s]=e.useState(()=>createEventEmitter()),c=useFloatingParentNodeId()!=null,[l,u]=e.useState(i.reference),d=useEffectEvent((e,t,n)=>{o.current.openEvent=e?t:void 0,s.emit(`openchange`,{open:e,event:t,reason:n,nested:c}),r?.(e,t,n)}),f=e.useMemo(()=>({setPositionReference:u}),[]),p=e.useMemo(()=>({reference:l||i.reference||null,floating:i.floating||null,domReference:i.reference}),[l,i.reference,i.floating]);return e.useMemo(()=>({dataRef:o,open:n,onOpenChange:d,elements:p,events:s,floatingId:a,refs:f}),[n,d,p,s,a,f])}function useFloating(t){t===void 0&&(t={});let{nodeId:n}=t,r=useFloatingRootContext({...t,elements:{reference:null,floating:null,...t.elements}}),i=t.rootContext||r,a=i.elements,[o,s]=e.useState(null),[c,l]=e.useState(null),u=a?.domReference||o,d=e.useRef(null),f=useFloatingTree();W(()=>{u&&(d.current=u)},[u]);let p=useFloating$1({...t,elements:{...a,...c&&{reference:c}}}),m=e.useCallback(e=>{let t=isElement(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;l(t),p.refs.setReference(t)},[p.refs]),h=e.useCallback(e=>{(isElement(e)||e===null)&&(d.current=e,s(e)),(isElement(p.refs.reference.current)||p.refs.reference.current===null||e!==null&&!isElement(e))&&p.refs.setReference(e)},[p.refs]),g=e.useMemo(()=>({...p.refs,setReference:h,setPositionReference:m,domReference:d}),[p.refs,h,m]),_=e.useMemo(()=>({...p.elements,domReference:u}),[p.elements,u]),v=e.useMemo(()=>({...p,...i,refs:g,elements:_,nodeId:n}),[p,g,_,n,i]);return W(()=>{i.dataRef.current.floatingContext=v;let e=f?.nodesRef.current.find(e=>e.id===n);e&&(e.context=v)}),e.useMemo(()=>({...p,context:v,refs:g,elements:_}),[p,g,_,v])}function isMacSafari(){return isMac()&&isSafari()}function useFocus(t,n){n===void 0&&(n={});let{open:r,onOpenChange:i,events:a,dataRef:o,elements:s}=t,{enabled:c=!0,visibleOnly:l=!0}=n,u=e.useRef(!1),d=e.useRef(-1),f=e.useRef(!0);e.useEffect(()=>{if(!c)return;let e=getWindow(s.domReference);function onBlur(){!r&&isHTMLElement(s.domReference)&&s.domReference===activeElement(getDocument$1(s.domReference))&&(u.current=!0)}function onKeyDown(){f.current=!0}function onPointerDown(){f.current=!1}return e.addEventListener(`blur`,onBlur),isMacSafari()&&(e.addEventListener(`keydown`,onKeyDown,!0),e.addEventListener(`pointerdown`,onPointerDown,!0)),()=>{e.removeEventListener(`blur`,onBlur),isMacSafari()&&(e.removeEventListener(`keydown`,onKeyDown,!0),e.removeEventListener(`pointerdown`,onPointerDown,!0))}},[s.domReference,r,c]),e.useEffect(()=>{if(!c)return;function onOpenChange(e){let{reason:t}=e;(t===`reference-press`||t===`escape-key`)&&(u.current=!0)}return a.on(`openchange`,onOpenChange),()=>{a.off(`openchange`,onOpenChange)}},[a,c]),e.useEffect(()=>()=>{clearTimeoutIfSet(d)},[]);let p=e.useMemo(()=>({onMouseLeave(){u.current=!1},onFocus(e){if(u.current)return;let t=getTarget$1(e.nativeEvent);if(l&&isElement(t)){if(isMacSafari()&&!e.relatedTarget){if(!f.current&&!isTypeableElement(t))return}else if(!matchesFocusVisible(t))return}i(!0,e.nativeEvent,`focus`)},onBlur(e){u.current=!1;let t=e.relatedTarget,n=e.nativeEvent,r=isElement(t)&&t.hasAttribute(createAttribute(`focus-guard`))&&t.getAttribute(`data-type`)===`outside`;d.current=window.setTimeout(()=>{let e=activeElement(s.domReference?s.domReference.ownerDocument:document);!t&&e===s.domReference||contains$1(o.current.floatingContext?.refs.floating.current,e)||contains$1(s.domReference,e)||r||i(!1,n,`focus`)})}}),[o,s.domReference,i,l]);return e.useMemo(()=>c?{reference:p}:{},[c,p])}function mergeProps(e,t,n){let r=new Map,i=n===`item`,a=e;if(i&&e){let{[X]:t,[tt]:n,...r}=e;a=r}return{...n===`floating`&&{tabIndex:-1,[et]:``},...a,...t.map(t=>{let r=t?t[n]:null;return typeof r==`function`?e?r(e):null:r}).concat(e).reduce((e,t)=>(t&&Object.entries(t).forEach(t=>{let[n,a]=t;if(!(i&&[X,tt].includes(n)))if(n.indexOf(`on`)===0){if(r.has(n)||r.set(n,[]),typeof a==`function`){var o;(o=r.get(n))==null||o.push(a),e[n]=function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return r.get(n)?.map(e=>e(...t)).find(e=>e!==void 0)}}}else e[n]=a}),e),{})}}function useInteractions(t){t===void 0&&(t=[]);let n=t.map(e=>e?.reference),r=t.map(e=>e?.floating),i=t.map(e=>e?.item),a=e.useCallback(e=>mergeProps(e,t,`reference`),n),o=e.useCallback(e=>mergeProps(e,t,`floating`),r),s=e.useCallback(e=>mergeProps(e,t,`item`),i);return e.useMemo(()=>({getReferenceProps:a,getFloatingProps:o,getItemProps:s}),[a,o,s])}function doSwitch(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function isMainOrientationKey(e,t){return doSwitch(t,e===rt||e===Q,e===Z||e===nt)}function isMainOrientationToEndKey(e,t,n){return doSwitch(t,e===Q,n?e===Z:e===nt)||e===`Enter`||e===` `||e===``}function isCrossOrientationOpenKey(e,t,n){return doSwitch(t,n?e===Z:e===nt,e===Q)}function isCrossOrientationCloseKey(e,t,n,r){return t===`both`||t===`horizontal`&&r&&r>1?e===Lt:doSwitch(t,n?e===nt:e===Z,e===rt)}function useListNavigation(t,n){let{open:r,onOpenChange:i,elements:a,floatingId:o}=t,{listRef:s,activeIndex:c,onNavigate:unstable_onNavigate=()=>{},enabled:l=!0,selectedIndex:u=null,allowEscape:d=!1,loop:f=!1,nested:p=!1,rtl:m=!1,virtual:h=!1,focusItemOnOpen:g=`auto`,focusItemOnHover:_=!0,openOnArrowKeyDown:v=!0,disabledIndices:y=void 0,orientation:b=`vertical`,parentOrientation:x,cols:S=1,scrollItemIntoView:C=!0,virtualItemRef:w,itemSizes:T,dense:E=!1}=n,D=useLatestRef$1(getFloatingFocusElement(a.floating)),O=useFloatingParentNodeId(),k=useFloatingTree();W(()=>{t.dataRef.current.orientation=b},[t,b]);let A=useEffectEvent(()=>{unstable_onNavigate(N.current===-1?null:N.current)}),j=isTypeableCombobox(a.domReference),M=e.useRef(g),N=e.useRef(u??-1),P=e.useRef(null),F=e.useRef(!0),I=e.useRef(A),L=e.useRef(!!a.floating),ee=e.useRef(r),R=e.useRef(!1),z=e.useRef(!1),B=useLatestRef$1(y),te=useLatestRef$1(r),ne=useLatestRef$1(C),re=useLatestRef$1(u),[ie,ae]=e.useState(),[oe,se]=e.useState(),ce=useEffectEvent(()=>{function runFocus(e){if(h){var t;(t=e.id)!=null&&t.endsWith(`-fui-option`)&&(e.id=o+`-`+Math.random().toString(16).slice(2,10)),ae(e.id),k?.events.emit(`virtualfocus`,e),w&&(w.current=e)}else enqueueFocus(e,{sync:R.current,preventScroll:!0})}let e=s.current[N.current],t=z.current;e&&runFocus(e),(R.current?e=>e():requestAnimationFrame)(()=>{let n=s.current[N.current]||e;if(!n)return;e||runFocus(n);let r=ne.current;r&&ue&&(t||!F.current)&&(n.scrollIntoView==null||n.scrollIntoView(typeof r==`boolean`?{block:`nearest`,inline:`nearest`}:r))})});W(()=>{l&&(r&&a.floating?M.current&&u!=null&&(z.current=!0,N.current=u,A()):L.current&&(N.current=-1,I.current()))},[l,r,a.floating,u,A]),W(()=>{if(l&&r&&a.floating)if(c==null){if(R.current=!1,re.current!=null)return;if(L.current&&(N.current=-1,ce()),(!ee.current||!L.current)&&M.current&&(P.current!=null||M.current===!0&&P.current==null)){let e=0,waitForListPopulated=()=>{s.current[0]==null?(e<2&&(e?requestAnimationFrame:queueMicrotask)(waitForListPopulated),e++):(N.current=P.current==null||isMainOrientationToEndKey(P.current,b,m)||p?getMinListIndex(s,B.current):getMaxListIndex(s,B.current),P.current=null,A())};waitForListPopulated()}}else isIndexOutOfListBounds(s,c)||(N.current=c,ce(),z.current=!1)},[l,r,a.floating,c,re,p,s,b,m,A,ce,B]),W(()=>{var e;if(!l||a.floating||!k||h||!L.current)return;let t=k.nodesRef.current,n=(e=t.find(e=>e.id===O))==null||(e=e.context)==null?void 0:e.elements.floating,r=activeElement(getDocument$1(a.floating)),i=t.some(e=>e.context&&contains$1(e.context.elements.floating,r));n&&!i&&F.current&&n.focus({preventScroll:!0})},[l,a.floating,k,O,h]),W(()=>{if(!l||!k||!h||O)return;function handleVirtualFocus(e){se(e.id),w&&(w.current=e)}return k.events.on(`virtualfocus`,handleVirtualFocus),()=>{k.events.off(`virtualfocus`,handleVirtualFocus)}},[l,k,h,O,w]),W(()=>{I.current=A,ee.current=r,L.current=!!a.floating}),W(()=>{r||(P.current=null,M.current=g)},[r,g]);let le=c!=null,ue=e.useMemo(()=>{function syncCurrentTarget(e){if(!te.current)return;let t=s.current.indexOf(e);t!==-1&&N.current!==t&&(N.current=t,A())}return{onFocus(e){let{currentTarget:t}=e;R.current=!0,syncCurrentTarget(t)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},onMouseMove(e){let{currentTarget:t}=e;R.current=!0,z.current=!1,_&&syncCurrentTarget(t)},onPointerLeave(e){let{pointerType:t}=e;if(!(!F.current||t===`touch`)&&(R.current=!0,_&&(N.current=-1,A(),!h))){var n;(n=D.current)==null||n.focus({preventScroll:!0})}}}},[te,D,_,s,A,h]),de=e.useCallback(()=>{var e;return x??(k==null||(e=k.nodesRef.current.find(e=>e.id===O))==null||(e=e.context)==null||(e=e.dataRef)==null?void 0:e.current.orientation)},[O,k,x]),fe=useEffectEvent(e=>{if(F.current=!1,R.current=!0,e.which===229||!te.current&&e.currentTarget===D.current)return;if(p&&isCrossOrientationCloseKey(e.key,b,m,S)){isMainOrientationKey(e.key,de())||stopEvent(e),i(!1,e.nativeEvent,`list-navigation`),isHTMLElement(a.domReference)&&(h?k?.events.emit(`virtualfocus`,a.domReference):a.domReference.focus());return}let t=N.current,n=getMinListIndex(s,y),o=getMaxListIndex(s,y);if(j||(e.key===`Home`&&(stopEvent(e),N.current=n,A()),e.key===`End`&&(stopEvent(e),N.current=o,A())),S>1){let t=T||Array.from({length:s.current.length},()=>({width:1,height:1})),r=createGridCellMap(t,S,E),i=r.findIndex(e=>e!=null&&!isListIndexDisabled(s,e,y)),a=r.reduce((e,t,n)=>t!=null&&!isListIndexDisabled(s,t,y)?n:e,-1),c=r[getGridNavigatedIndex({current:r.map(e=>e==null?null:s.current[e])},{event:e,orientation:b,loop:f,rtl:m,cols:S,disabledIndices:getGridCellIndices([...(typeof y==`function`?null:y)||s.current.map((e,t)=>isListIndexDisabled(s,t,y)?t:void 0),void 0],r),minIndex:i,maxIndex:a,prevIndex:getGridCellIndexOfCorner(N.current>o?n:N.current,t,r,S,e.key===Q?`bl`:e.key===(m?Z:nt)?`tr`:`tl`),stopEvent:!0})];if(c!=null&&(N.current=c,A()),b===`both`)return}if(isMainOrientationKey(e.key,b)){if(stopEvent(e),r&&!h&&activeElement(e.currentTarget.ownerDocument)===e.currentTarget){N.current=isMainOrientationToEndKey(e.key,b,m)?n:o,A();return}isMainOrientationToEndKey(e.key,b,m)?f?N.current=t>=o?d&&t!==s.current.length?-1:n:findNonDisabledListIndex(s,{startingIndex:t,disabledIndices:y}):N.current=Math.min(o,findNonDisabledListIndex(s,{startingIndex:t,disabledIndices:y})):f?N.current=t<=n?d&&t!==-1?s.current.length:o:findNonDisabledListIndex(s,{startingIndex:t,decrement:!0,disabledIndices:y}):N.current=Math.max(n,findNonDisabledListIndex(s,{startingIndex:t,decrement:!0,disabledIndices:y})),isIndexOutOfListBounds(s,N.current)&&(N.current=-1),A()}}),V=e.useMemo(()=>h&&r&&le&&{"aria-activedescendant":oe||ie},[h,r,le,oe,ie]),H=e.useMemo(()=>({"aria-orientation":b===`both`?void 0:b,...j?{}:V,onKeyDown:fe,onPointerMove(){F.current=!0}}),[V,fe,b,j]),pe=e.useMemo(()=>{function checkVirtualMouse(e){g===`auto`&&isVirtualClick(e.nativeEvent)&&(M.current=!0)}function checkVirtualPointer(e){M.current=g,g===`auto`&&isVirtualPointerEvent(e.nativeEvent)&&(M.current=!0)}return{...V,onKeyDown(e){F.current=!1;let t=e.key.startsWith(`Arrow`),n=[`Home`,`End`].includes(e.key),a=t||n,o=isCrossOrientationOpenKey(e.key,b,m),c=isCrossOrientationCloseKey(e.key,b,m,S),l=isCrossOrientationOpenKey(e.key,de(),m),d=isMainOrientationKey(e.key,b),f=(p?l:d)||e.key===`Enter`||e.key.trim()===``;if(h&&r){let t=k?.nodesRef.current.find(e=>e.parentId==null),r=k&&t?getDeepestNode(k.nodesRef.current,t.id):null;if(a&&r&&w){let t=new KeyboardEvent(`keydown`,{key:e.key,bubbles:!0});if(o||c){let n=r.context?.elements.domReference===e.currentTarget,i=c&&!n?r.context?.elements.domReference:o?s.current.find(e=>e?.id===ie):null;i&&(stopEvent(e),i.dispatchEvent(t),se(void 0))}if((d||n)&&r.context&&r.context.open&&r.parentId&&e.currentTarget!==r.context.elements.domReference){var g;stopEvent(e),(g=r.context.elements.domReference)==null||g.dispatchEvent(t);return}}return fe(e)}if(!(!r&&!v&&t)){if(f){let t=isMainOrientationKey(e.key,de());P.current=p&&t?null:e.key}if(p){l&&(stopEvent(e),r?(N.current=getMinListIndex(s,B.current),A()):i(!0,e.nativeEvent,`list-navigation`));return}d&&(u!=null&&(N.current=u),stopEvent(e),!r&&v?i(!0,e.nativeEvent,`list-navigation`):fe(e),r&&A())}},onFocus(){r&&!h&&(N.current=-1,A())},onPointerDown:checkVirtualPointer,onPointerEnter:checkVirtualPointer,onMouseDown:checkVirtualMouse,onClick:checkVirtualMouse}},[ie,V,S,fe,B,g,s,p,A,i,r,v,b,de,m,u,k,h,w]);return e.useMemo(()=>l?{reference:pe,floating:H,item:ue}:{},[l,pe,H,ue])}function useRole(t,n){n===void 0&&(n={});let{open:r,elements:i,floatingId:a}=t,{enabled:o=!0,role:s=`dialog`}=n,c=ft(),l=i.domReference?.id||c,u=e.useMemo(()=>getFloatingFocusElement(i.floating)?.id||a,[i.floating,a]),d=Rt.get(s)??s,f=useFloatingParentNodeId()!=null,p=e.useMemo(()=>d===`tooltip`||s===`label`?{[`aria-`+(s===`label`?`labelledby`:`describedby`)]:r?u:void 0}:{"aria-expanded":r?`true`:`false`,"aria-haspopup":d===`alertdialog`?`dialog`:d,"aria-controls":r?u:void 0,...d===`listbox`&&{role:`combobox`},...d===`menu`&&{id:l},...d===`menu`&&f&&{role:`menuitem`},...s===`select`&&{"aria-autocomplete":`none`},...s===`combobox`&&{"aria-autocomplete":`list`}},[d,u,f,r,l,s]),m=e.useMemo(()=>{let e={id:u,...d&&{role:d}};return d===`tooltip`||s===`label`?e:{...e,...d===`menu`&&{"aria-labelledby":l}}},[d,u,l,s]),h=e.useCallback(e=>{let{active:t,selected:n}=e,r={role:`option`,...t&&{id:u+`-fui-option`}};switch(s){case`select`:case`combobox`:return{...r,"aria-selected":n}}return{}},[u,s]);return e.useMemo(()=>o?{reference:p,floating:m,item:h}:{},[o,p,m,h])}function execWithArgsOrReturn(e,t){return typeof e==`function`?e(t):e}function useDelayUnmount(t,n){let[r,i]=e.useState(t);return t&&!r&&i(!0),e.useEffect(()=>{if(!t&&r){let e=setTimeout(()=>i(!1),n);return()=>clearTimeout(e)}},[t,r,n]),r}function useTransitionStatus(n,r){r===void 0&&(r={});let{open:i,elements:{floating:a}}=n,{duration:o=250}=r,s=(typeof o==`number`?o:o.close)||0,[c,l]=e.useState(`unmounted`),u=useDelayUnmount(i,s);return!u&&c===`close`&&l(`unmounted`),W(()=>{if(a){if(i){l(`initial`);let e=requestAnimationFrame(()=>{t.flushSync(()=>{l(`open`)})});return()=>{cancelAnimationFrame(e)}}l(`close`)}},[i,a]),{isMounted:u,status:c}}function useTransitionStyles(t,n){n===void 0&&(n={});let{initial:r={opacity:0},open:i,close:a,common:o,duration:s=250}=n,c=t.placement,l=c.split(`-`)[0],u=e.useMemo(()=>({side:l,placement:c}),[l,c]),d=typeof s==`number`,f=(d?s:s.open)||0,p=(d?s:s.close)||0,[m,h]=e.useState(()=>({...execWithArgsOrReturn(o,u),...execWithArgsOrReturn(r,u)})),{isMounted:g,status:_}=useTransitionStatus(t,{duration:s}),v=useLatestRef$1(r),y=useLatestRef$1(i),b=useLatestRef$1(a),x=useLatestRef$1(o);return W(()=>{let e=execWithArgsOrReturn(v.current,u),t=execWithArgsOrReturn(b.current,u),n=execWithArgsOrReturn(x.current,u),r=execWithArgsOrReturn(y.current,u)||Object.keys(e).reduce((e,t)=>(e[t]=``,e),{});if(_===`initial`&&h(t=>({transitionProperty:t.transitionProperty,...n,...e})),_===`open`&&h({transitionProperty:Object.keys(r).map(camelCaseToKebabCase).join(`,`),transitionDuration:f+`ms`,...n,...r}),_===`close`){let r=t||e;h({transitionProperty:Object.keys(r).map(camelCaseToKebabCase).join(`,`),transitionDuration:p+`ms`,...n,...r})}},[p,b,v,y,x,f,_,u]),{isMounted:g,styles:m}}function useTypeahead(t,n){let{open:r,dataRef:i}=t,{listRef:a,activeIndex:o,onMatch:s,onTypingChange:c,enabled:l=!0,findMatch:u=null,resetMs:d=750,ignoreKeys:f=[],selectedIndex:p=null}=n,m=e.useRef(-1),h=e.useRef(``),g=e.useRef(p??o??-1),_=e.useRef(null),v=useEffectEvent(s),y=useEffectEvent(c),b=useLatestRef$1(u),x=useLatestRef$1(f);W(()=>{r&&(clearTimeoutIfSet(m),_.current=null,h.current=``)},[r]),W(()=>{r&&h.current===``&&(g.current=p??o??-1)},[r,p,o]);let S=useEffectEvent(e=>{e?i.current.typing||(i.current.typing=e,y(e)):i.current.typing&&(i.current.typing=e,y(e))}),C=useEffectEvent(e=>{function getMatchingIndex(e,t,n){let r=b.current?b.current(t,n):t.find(e=>e?.toLocaleLowerCase().indexOf(n.toLocaleLowerCase())===0);return r?e.indexOf(r):-1}let t=a.current;if(h.current.length>0&&h.current[0]!==` `&&(getMatchingIndex(t,t,h.current)===-1?S(!1):e.key===` `&&stopEvent(e)),t==null||x.current.includes(e.key)||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;r&&e.key!==` `&&(stopEvent(e),S(!0)),t.every(e=>!e||e[0]?.toLocaleLowerCase()!==e[1]?.toLocaleLowerCase())&&h.current===e.key&&(h.current=``,g.current=_.current),h.current+=e.key,clearTimeoutIfSet(m),m.current=window.setTimeout(()=>{h.current=``,g.current=_.current,S(!1)},d);let n=g.current,i=getMatchingIndex(t,[...t.slice((n||0)+1),...t.slice(0,(n||0)+1)],h.current);i===-1?e.key!==` `&&(h.current=``,S(!1)):(v(i),_.current=i)}),w=e.useMemo(()=>({onKeyDown:C}),[C]),T=e.useMemo(()=>({onKeyDown:C,onKeyUp(e){e.key===` `&&S(!1)}}),[C,S]);return e.useMemo(()=>l?{reference:w,floating:T}:{},[l,w,T])}function getArgsWithCustomFloatingHeight(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}function useInnerOffset(n,r){let{open:i,elements:a}=n,{enabled:o=!0,overflowRef:s,scrollRef:c,onChange:l}=r,u=useEffectEvent(l),d=e.useRef(!1),f=e.useRef(null),p=e.useRef(null);e.useEffect(()=>{if(!o)return;function onWheel(n){if(n.ctrlKey||!e||s.current==null)return;let r=n.deltaY,i=s.current.top>=-.5,a=s.current.bottom>=-.5,o=e.scrollHeight-e.clientHeight,c=r<0?-1:1,l=r<0?`max`:`min`;e.scrollHeight<=e.clientHeight||(!i&&r>0||!a&&r<0?(n.preventDefault(),t.flushSync(()=>{u(e=>e+Math[l](r,o*c))})):/firefox/i.test(getUserAgent())&&(e.scrollTop+=r))}let e=c?.current||a.floating;if(i&&e)return e.addEventListener(`wheel`,onWheel),requestAnimationFrame(()=>{f.current=e.scrollTop,s.current!=null&&(p.current={...s.current})}),()=>{f.current=null,p.current=null,e.removeEventListener(`wheel`,onWheel)}},[o,i,a.floating,s,c,u]);let m=e.useMemo(()=>({onKeyDown(){d.current=!0},onWheel(){d.current=!1},onPointerMove(){d.current=!1},onScroll(){let e=c?.current||a.floating;if(!(!s.current||!e||!d.current)){if(f.current!==null){let n=e.scrollTop-f.current;(s.current.bottom<-.5&&n<-1||s.current.top<-.5&&n>1)&&t.flushSync(()=>u(e=>e+n))}requestAnimationFrame(()=>{f.current=e.scrollTop})}}}),[a.floating,u,s,c]);return e.useMemo(()=>o?{floating:m}:{},[o,m])}function getNodeChildren(e,t,n){return n===void 0&&(n=!0),e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...getNodeChildren(e,t.id,n)])}function isPointInPolygon(e,t){let[n,r]=e,i=!1,a=t.length;for(let e=0,o=a-1;e<a;o=e++){let[a,s]=t[e]||[0,0],[c,l]=t[o]||[0,0];s>=r!=l>=r&&n<=(c-a)*(r-s)/(l-s)+a&&(i=!i)}return i}function isInside(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function safePolygon(e){e===void 0&&(e={});let{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e,i={current:-1},a=!1,o=null,s=null,c=typeof performance<`u`?performance.now():0;function getCursorSpeed(e,t){let n=performance.now(),r=n-c;if(o===null||s===null||r===0)return o=e,s=t,c=n,null;let i=e-o,a=t-s,l=Math.sqrt(i*i+a*a)/r;return o=e,s=t,c=n,l}let fn=e=>{let{x:n,y:o,placement:s,elements:c,onClose:l,nodeId:u,tree:d}=e;return function onMouseMove(e){function close(){clearTimeoutIfSet(i),l()}if(clearTimeoutIfSet(i),!c.domReference||!c.floating||s==null||n==null||o==null)return;let{clientX:f,clientY:p}=e,m=[f,p],h=getTarget(e),g=e.type===`mouseleave`,_=contains(c.floating,h),v=contains(c.domReference,h),y=c.domReference.getBoundingClientRect(),b=c.floating.getBoundingClientRect(),x=s.split(`-`)[0],S=n>b.right-b.width/2,C=o>b.bottom-b.height/2,w=isInside(m,y),T=b.width>y.width,E=b.height>y.height,D=(T?y:b).left,O=(T?y:b).right,k=(E?y:b).top,A=(E?y:b).bottom;if(_&&(a=!0,!g))return;if(v&&(a=!1),v&&!g){a=!0;return}if(g&&isElement(e.relatedTarget)&&contains(c.floating,e.relatedTarget)||d&&getNodeChildren(d.nodesRef.current,u).length)return;if(x===`top`&&o>=y.bottom-1||x===`bottom`&&o<=y.top+1||x===`left`&&n>=y.right-1||x===`right`&&n<=y.left+1)return close();let j=[];switch(x){case`top`:j=[[D,y.top+1],[D,b.bottom-1],[O,b.bottom-1],[O,y.top+1]];break;case`bottom`:j=[[D,b.top+1],[D,y.bottom-1],[O,y.bottom-1],[O,b.top+1]];break;case`left`:j=[[b.right-1,A],[b.right-1,k],[y.left+1,k],[y.left+1,A]];break;case`right`:j=[[y.right-1,A],[y.right-1,k],[b.left+1,k],[b.left+1,A]];break}function getPolygon(e){let[n,r]=e;switch(x){case`top`:return[[T?n+t/2:S?n+t*4:n-t*4,r+t+1],[T?n-t/2:S?n+t*4:n-t*4,r+t+1],[b.left,S||T?b.bottom-t:b.top],[b.right,S?T?b.bottom-t:b.top:b.bottom-t]];case`bottom`:return[[T?n+t/2:S?n+t*4:n-t*4,r-t],[T?n-t/2:S?n+t*4:n-t*4,r-t],[b.left,S||T?b.top+t:b.bottom],[b.right,S?T?b.top+t:b.bottom:b.top+t]];case`left`:{let e=[n+t+1,E?r+t/2:C?r+t*4:r-t*4],i=[n+t+1,E?r-t/2:C?r+t*4:r-t*4];return[[C||E?b.right-t:b.left,b.top],[C?E?b.right-t:b.left:b.right-t,b.bottom],e,i]}case`right`:return[[n-t,E?r+t/2:C?r+t*4:r-t*4],[n-t,E?r-t/2:C?r+t*4:r-t*4],[C||E?b.left+t:b.right,b.top],[C?E?b.left+t:b.right:b.left+t,b.bottom]]}}if(!isPointInPolygon([f,p],j)){if(a&&!w)return close();if(!g&&r){let t=getCursorSpeed(e.clientX,e.clientY);if(t!==null&&t<.1)return close()}isPointInPolygon([f,p],getPolygon([n,o]))?!a&&r&&(i.current=window.setTimeout(close,40)):close()}}};return fn.__options={blockPointerEvents:n},fn}var Y,$e,et,X,tt,Z,nt,rt,Q,it,at,ot,st,$,ct,lt,ut,dt,genId,ft,pt,mt,ht,useFloatingParentNodeId,useFloatingTree,gt,NOOP,_t,useDelayGroupContext,vt,yt,bt,xt,St,Ct,supportsInert,correctElements,wt,Tt,Et,Dt,Ot,usePortalContext,kt,At,jt,Mt,Nt,cleanup,Pt,Ft,It,normalizeProp,Lt,Rt,camelCaseToKebabCase,inner,zt=__esmMin((()=>{Ce(),Y=Te(),p(),he(),Ze(),E(),$e=e.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}}),et=`data-floating-ui-focusable`,X=`active`,tt=`selected`,Z=`ArrowLeft`,nt=`ArrowRight`,rt=`ArrowUp`,Q=`ArrowDown`,it=e.createContext({activeIndex:0,onNavigate:()=>{}}),at=[Z,nt],ot=[rt,Q],st=[...at,...ot],$=e.forwardRef(function Composite(t,n){let{render:r,orientation:i=`both`,loop:a=!0,rtl:o=!1,cols:s=1,disabledIndices:c,activeIndex:l,onNavigate:u,itemSizes:d,dense:f=!1,...p}=t,[m,h]=e.useState(0),g=l??m,_=useEffectEvent(u??h),v=e.useRef([]),y=r&&typeof r!=`function`?r.props:{},b=e.useMemo(()=>({activeIndex:g,onNavigate:_}),[g,_]),x=s>1;function handleKeyDown(e){if(!st.includes(e.key))return;let t=g,n=getMinListIndex(v,c),r=getMaxListIndex(v,c),l=o?Z:nt,u=o?nt:Z;if(x){let u=d||Array.from({length:v.current.length},()=>({width:1,height:1})),p=createGridCellMap(u,s,f),m=p.findIndex(e=>e!=null&&!isListIndexDisabled(v,e,c)),h=p.reduce((e,t,n)=>t!=null&&!isListIndexDisabled(v,t,c)?n:e,-1),_=p[getGridNavigatedIndex({current:p.map(e=>e?v.current[e]:null)},{event:e,orientation:i,loop:a,rtl:o,cols:s,disabledIndices:getGridCellIndices([...(typeof c==`function`?null:c)||v.current.map((e,t)=>isListIndexDisabled(v,t,c)?t:void 0),void 0],p),minIndex:m,maxIndex:h,prevIndex:getGridCellIndexOfCorner(g>r?n:g,u,p,s,e.key===Q?`bl`:e.key===l?`tr`:`tl`)})];_!=null&&(t=_)}let p={horizontal:[l],vertical:[Q],both:[l,Q]}[i],m={horizontal:[u],vertical:[rt],both:[u,rt]}[i],h=x?st:{horizontal:at,vertical:ot,both:st}[i];if(t===g&&[...p,...m].includes(e.key)&&(t=a&&t===r&&p.includes(e.key)?n:a&&t===n&&m.includes(e.key)?r:findNonDisabledListIndex(v,{startingIndex:t,decrement:m.includes(e.key),disabledIndices:c})),t!==g&&!isIndexOutOfListBounds(v,t)){var y;e.stopPropagation(),h.includes(e.key)&&e.preventDefault(),_(t),(y=v.current[t])==null||y.focus()}}let S={...p,...y,ref:n,"aria-orientation":i===`both`?void 0:i,onKeyDown(e){p.onKeyDown==null||p.onKeyDown(e),y.onKeyDown==null||y.onKeyDown(e),handleKeyDown(e)}};return(0,Y.jsx)(it.Provider,{value:b,children:(0,Y.jsx)(FloatingList,{elementsRef:v,children:renderJsx(r,S)})})}),ct=e.forwardRef(function CompositeItem(t,n){let{render:r,...i}=t,a=r&&typeof r!=`function`?r.props:{},{activeIndex:o,onNavigate:s}=e.useContext(it),{ref:c,index:l}=useListItem(),u=useMergeRefs([c,n,a.ref]),d=o===l;return renderJsx(r,{...i,...a,ref:u,tabIndex:d?0:-1,"data-active":d?``:void 0,onFocus(e){i.onFocus==null||i.onFocus(e),a.onFocus==null||a.onFocus(e),s(l)}})}),lt={...e},ut=!1,dt=0,genId=()=>`floating-ui-`+Math.random().toString(36).slice(2,6)+dt++,ft=lt.useId||useFloatingId,pt=e.forwardRef(function FloatingArrow(t,n){let{context:{placement:r,elements:{floating:i},middlewareData:{arrow:a,shift:o}},width:s=14,height:c=7,tipRadius:l=0,strokeWidth:u=0,staticOffset:d,stroke:f,d:p,style:{transform:m,...h}={},...g}=t,_=ft(),[v,y]=e.useState(!1);if(W(()=>{i&&getComputedStyle$1(i).direction===`rtl`&&y(!0)},[i]),!i)return null;let[b,x]=r.split(`-`),S=b===`top`||b===`bottom`,C=d;(S&&o!=null&&o.x||!S&&o!=null&&o.y)&&(C=null);let w=u*2,T=w/2,E=s/2*(l/-8+1),D=c/2*l/4,O=!!p,k=C&&x===`end`?`bottom`:`top`,A=C&&x===`end`?`right`:`left`;C&&v&&(A=x===`end`?`left`:`right`);let j=a?.x==null?``:C||a.x,M=a?.y==null?``:C||a.y,N=p||`M0,0`+(` H`+s)+(` L`+(s-E)+`,`+(c-D))+(` Q`+s/2+`,`+c+` `+E+`,`+(c-D))+` Z`,P={top:O?`rotate(180deg)`:``,left:O?`rotate(90deg)`:`rotate(-90deg)`,bottom:O?``:`rotate(180deg)`,right:O?`rotate(-90deg)`:`rotate(90deg)`}[b];return(0,Y.jsxs)(`svg`,{...g,"aria-hidden":!0,ref:n,width:O?s:s+w,height:s,viewBox:`0 0 `+s+` `+(c>s?c:s),style:{position:`absolute`,pointerEvents:`none`,[A]:j,[k]:M,[b]:S||O?`100%`:`calc(100% - `+w/2+`px)`,transform:[P,m].filter(e=>!!e).join(` `),...h},children:[w>0&&(0,Y.jsx)(`path`,{clipPath:`url(#`+_+`)`,fill:`none`,stroke:f,strokeWidth:w+ +!p,d:N}),(0,Y.jsx)(`path`,{stroke:w&&!p?g.fill:`none`,d:N}),(0,Y.jsx)(`clipPath`,{id:_,children:(0,Y.jsx)(`rect`,{x:-T,y:T*(O?-1:1),width:s+w,height:s})})]})}),mt=e.createContext(null),ht=e.createContext(null),useFloatingParentNodeId=()=>e.useContext(mt)?.id||null,useFloatingTree=()=>e.useContext(ht),gt=createAttribute(`safe-polygon`),NOOP=()=>{},_t=e.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:NOOP,setState:NOOP,isInstantPhase:!1}),useDelayGroupContext=()=>e.useContext(_t),vt=e.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeoutIdRef:{current:-1},currentIdRef:{current:null},currentContextRef:{current:null}}),yt=0,bt={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap},xt=new WeakSet,St={},Ct=0,supportsInert=()=>typeof HTMLElement<`u`&&`inert`in HTMLElement.prototype,correctElements=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=unwrapHost(t);return e.contains(n)?n:null}).filter(e=>e!=null),wt={border:0,clip:`rect(0 0 0 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:0,position:`fixed`,whiteSpace:`nowrap`,width:`1px`,top:0,left:0},Tt=e.forwardRef(function FocusGuard(t,n){let[r,i]=e.useState();W(()=>{isSafari()&&i(`button`)},[]);let a={ref:n,tabIndex:0,role:r,"aria-hidden":!r||void 0,[createAttribute(`focus-guard`)]:``,style:wt};return(0,Y.jsx)(`span`,{...t,...a})}),Et={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},Dt=e.createContext(null),Ot=createAttribute(`portal`),usePortalContext=()=>e.useContext(Dt),kt=20,At=[],jt=e.forwardRef(function VisuallyHiddenDismiss(e,t){return(0,Y.jsx)(`button`,{...e,type:`button`,ref:t,tabIndex:-1,style:wt})}),Mt=0,Nt=`--floating-ui-scrollbar-width`,cleanup=()=>{},Pt=e.forwardRef(function FloatingOverlay(e,t){let{lockScroll:n=!1,...r}=e;return W(()=>{if(n)return Mt++,Mt===1&&(cleanup=enableScrollLock()),()=>{Mt--,Mt===0&&cleanup()}},[n]),(0,Y.jsx)(`div`,{ref:t,...r,style:{position:`fixed`,overflow:`auto`,top:0,right:0,bottom:0,left:0,...r.style}})}),Ft={pointerdown:`onPointerDown`,mousedown:`onMouseDown`,click:`onClick`},It={pointerdown:`onPointerDownCapture`,mousedown:`onMouseDownCapture`,click:`onClickCapture`},normalizeProp=e=>({escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}),Lt=`Escape`,Rt=new Map([[`select`,`listbox`],[`combobox`,`listbox`],[`label`,!1]]),camelCaseToKebabCase=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(e,t)=>(t?`-`:``)+e.toLowerCase()),inner=e=>({name:`inner`,options:e,async fn(n){let{listRef:r,overflowRef:i,onFallbackChange:a,offset:o=0,index:s=0,minItemsVisible:c=4,referenceOverflowThreshold:l=0,scrollRef:u,...d}=evaluate(e,n),{rects:f,platform:p,elements:{floating:m}}=n,h=r.current[s],g=u?.current||m,b=m.clientTop||g.clientTop,x=m.clientTop!==0,S=g.clientTop!==0,C=m===g;if(!h)return{};let w={...n,...await offset(-h.offsetTop-m.clientTop-f.reference.height/2-h.offsetHeight/2-o).fn(n)},T=await p.detectOverflow(getArgsWithCustomFloatingHeight(w,g.scrollHeight+b+m.clientTop),d),E=await p.detectOverflow(w,{...d,elementContext:`reference`}),D=v(0,T.top),O=w.y+D,k=(g.scrollHeight>g.clientHeight?e=>e:y)(v(0,g.scrollHeight+(x&&C||S?b*2:0)-D-v(0,T.bottom)));if(g.style.maxHeight=k+`px`,g.scrollTop=D,a){let e=g.offsetHeight<h.offsetHeight*_(c,r.current.length)-1||E.top>=-l||E.bottom>=-l;t.flushSync(()=>a(e))}return i&&(i.current=await p.detectOverflow(getArgsWithCustomFloatingHeight({...w,y:O},g.offsetHeight+b+m.clientTop),d)),{y:O}}})})),Bt=__commonJSMin(((e,t)=>{var{entries:n,setPrototypeOf:r,isFrozen:i,getPrototypeOf:a,getOwnPropertyDescriptor:o}=Object,{freeze:s,seal:c,create:l}=Object,{apply:u,construct:d}=typeof Reflect<`u`&&Reflect;s||=function freeze(e){return e},c||=function seal(e){return e},u||=function apply(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return e.apply(t,r)},d||=function construct(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new e(...n)};var f=unapply(Array.prototype.forEach),p=unapply(Array.prototype.lastIndexOf),m=unapply(Array.prototype.pop),h=unapply(Array.prototype.push),g=unapply(Array.prototype.splice),_=unapply(String.prototype.toLowerCase),v=unapply(String.prototype.toString),y=unapply(String.prototype.match),b=unapply(String.prototype.replace),x=unapply(String.prototype.indexOf),S=unapply(String.prototype.trim),C=unapply(Object.prototype.hasOwnProperty),w=unapply(RegExp.prototype.test),T=unconstruct(TypeError);function unapply(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return u(e,t,r)}}function unconstruct(e){return function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return d(e,n)}}function addToSet(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:_;r&&r(e,null);let a=t.length;for(;a--;){let r=t[a];if(typeof r==`string`){let e=n(r);e!==r&&(i(t)||(t[a]=e),r=e)}e[r]=!0}return e}function cleanArray(e){for(let t=0;t<e.length;t++)C(e,t)||(e[t]=null);return e}function clone(e){let t=l(null);for(let[r,i]of n(e))C(e,r)&&(Array.isArray(i)?t[r]=cleanArray(i):i&&typeof i==`object`&&i.constructor===Object?t[r]=clone(i):t[r]=i);return t}function lookupGetter(e,t){for(;e!==null;){let n=o(e,t);if(n){if(n.get)return unapply(n.get);if(typeof n.value==`function`)return unapply(n.value)}e=a(e)}function fallbackValue(){return null}return fallbackValue}var E=s(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),D=s(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),O=s([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),k=s([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),A=s(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),j=s([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),M=s([`#text`]),N=s(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns.slot`.split(`.`)),P=s(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),F=s(`accent.accentunder.align.bevelled.close.columnsalign.columnlines.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lspace.lquote.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),I=s([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),L=c(/\{\{[\w\W]*|[\w\W]*\}\}/gm),ee=c(/<%[\w\W]*|[\w\W]*%>/gm),R=c(/\$\{[\w\W]*/gm),z=c(/^data-[\-\w.\u00B7-\uFFFF]+$/),B=c(/^aria-[\-\w]+$/),te=c(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ne=c(/^(?:\w+script|data):/i),re=c(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ie=c(/^html$/i),ae=c(/^[a-z][.\w]*(-[.\w]+)+$/i),oe=Object.freeze({__proto__:null,ARIA_ATTR:B,ATTR_WHITESPACE:re,CUSTOM_ELEMENT:ae,DATA_ATTR:z,DOCTYPE_NAME:ie,ERB_EXPR:ee,IS_ALLOWED_URI:te,IS_SCRIPT_OR_DATA:ne,MUSTACHE_EXPR:L,TMPLIT_EXPR:R}),se={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},ce=function getGlobal(){return typeof window>`u`?null:window},le=function _createTrustedTypesPolicy(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},ue=function _createHooksMap(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function createDOMPurify(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ce(),DOMPurify=e=>createDOMPurify(e);if(DOMPurify.version=`3.3.0`,DOMPurify.removed=[],!e||!e.document||e.document.nodeType!==se.document||!e.Element)return DOMPurify.isSupported=!1,DOMPurify;let{document:t}=e,r=t,i=r.currentScript,{DocumentFragment:a,HTMLTemplateElement:o,Node:c,Element:u,NodeFilter:d,NamedNodeMap:L=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:ee,DOMParser:R,trustedTypes:z}=e,B=u.prototype,ne=lookupGetter(B,`cloneNode`),re=lookupGetter(B,`remove`),ae=lookupGetter(B,`nextSibling`),de=lookupGetter(B,`childNodes`),fe=lookupGetter(B,`parentNode`);if(typeof o==`function`){let e=t.createElement(`template`);e.content&&e.content.ownerDocument&&(t=e.content.ownerDocument)}let V,H=``,{implementation:pe,createNodeIterator:me,createDocumentFragment:he,getElementsByTagName:ge}=t,{importNode:_e}=r,U=ue();DOMPurify.isSupported=typeof n==`function`&&typeof fe==`function`&&pe&&pe.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:ve,ERB_EXPR:ye,TMPLIT_EXPR:be,DATA_ATTR:W,ARIA_ATTR:xe,IS_SCRIPT_OR_DATA:Se,ATTR_WHITESPACE:Ce,CUSTOM_ELEMENT:we}=oe,{IS_ALLOWED_URI:Te}=oe,G=null,Ee=addToSet({},[...E,...D,...O,...A,...M]),K=null,De=addToSet({},[...N,...P,...F,...I]),J=Object.seal(l(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Oe=null,ke=null,Ae=Object.seal(l(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),je=!0,Me=!0,Ne=!1,Pe=!0,Fe=!1,Ie=!0,Le=!1,Re=!1,ze=!1,Be=!1,Ve=!1,He=!1,Ue=!0,We=!1,Ge=!0,Ke=!1,qe={},Je=null,Ye=addToSet({},[`annotation-xml`,`audio`,`colgroup`,`desc`,`foreignobject`,`head`,`iframe`,`math`,`mi`,`mn`,`mo`,`ms`,`mtext`,`noembed`,`noframes`,`noscript`,`plaintext`,`script`,`style`,`svg`,`template`,`thead`,`title`,`video`,`xmp`]),Xe=null,Ze=addToSet({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Qe=null,Y=addToSet({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),$e=`http://www.w3.org/1998/Math/MathML`,et=`http://www.w3.org/2000/svg`,X=`http://www.w3.org/1999/xhtml`,tt=X,Z=!1,nt=null,rt=addToSet({},[$e,et,X],v),Q=addToSet({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),it=addToSet({},[`annotation-xml`]),at=addToSet({},[`title`,`style`,`font`,`a`,`script`]),ot=null,st=[`application/xhtml+xml`,`text/html`],$=null,ct=null,lt=t.createElement(`form`),ut=function isRegexOrFunction(e){return e instanceof RegExp||e instanceof Function},dt=function _parseConfig(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(ct&&ct===e)){if((!e||typeof e!=`object`)&&(e={}),e=clone(e),ot=st.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,$=ot===`application/xhtml+xml`?v:_,G=C(e,`ALLOWED_TAGS`)?addToSet({},e.ALLOWED_TAGS,$):Ee,K=C(e,`ALLOWED_ATTR`)?addToSet({},e.ALLOWED_ATTR,$):De,nt=C(e,`ALLOWED_NAMESPACES`)?addToSet({},e.ALLOWED_NAMESPACES,v):rt,Qe=C(e,`ADD_URI_SAFE_ATTR`)?addToSet(clone(Y),e.ADD_URI_SAFE_ATTR,$):Y,Xe=C(e,`ADD_DATA_URI_TAGS`)?addToSet(clone(Ze),e.ADD_DATA_URI_TAGS,$):Ze,Je=C(e,`FORBID_CONTENTS`)?addToSet({},e.FORBID_CONTENTS,$):Ye,Oe=C(e,`FORBID_TAGS`)?addToSet({},e.FORBID_TAGS,$):clone({}),ke=C(e,`FORBID_ATTR`)?addToSet({},e.FORBID_ATTR,$):clone({}),qe=C(e,`USE_PROFILES`)?e.USE_PROFILES:!1,je=e.ALLOW_ARIA_ATTR!==!1,Me=e.ALLOW_DATA_ATTR!==!1,Ne=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Pe=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Fe=e.SAFE_FOR_TEMPLATES||!1,Ie=e.SAFE_FOR_XML!==!1,Le=e.WHOLE_DOCUMENT||!1,Be=e.RETURN_DOM||!1,Ve=e.RETURN_DOM_FRAGMENT||!1,He=e.RETURN_TRUSTED_TYPE||!1,ze=e.FORCE_BODY||!1,Ue=e.SANITIZE_DOM!==!1,We=e.SANITIZE_NAMED_PROPS||!1,Ge=e.KEEP_CONTENT!==!1,Ke=e.IN_PLACE||!1,Te=e.ALLOWED_URI_REGEXP||te,tt=e.NAMESPACE||X,Q=e.MATHML_TEXT_INTEGRATION_POINTS||Q,it=e.HTML_INTEGRATION_POINTS||it,J=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&ut(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(J.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&ut(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(J.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements==`boolean`&&(J.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Fe&&(Me=!1),Ve&&(Be=!0),qe&&(G=addToSet({},M),K=[],qe.html===!0&&(addToSet(G,E),addToSet(K,N)),qe.svg===!0&&(addToSet(G,D),addToSet(K,P),addToSet(K,I)),qe.svgFilters===!0&&(addToSet(G,O),addToSet(K,P),addToSet(K,I)),qe.mathMl===!0&&(addToSet(G,A),addToSet(K,F),addToSet(K,I))),e.ADD_TAGS&&(typeof e.ADD_TAGS==`function`?Ae.tagCheck=e.ADD_TAGS:(G===Ee&&(G=clone(G)),addToSet(G,e.ADD_TAGS,$))),e.ADD_ATTR&&(typeof e.ADD_ATTR==`function`?Ae.attributeCheck=e.ADD_ATTR:(K===De&&(K=clone(K)),addToSet(K,e.ADD_ATTR,$))),e.ADD_URI_SAFE_ATTR&&addToSet(Qe,e.ADD_URI_SAFE_ATTR,$),e.FORBID_CONTENTS&&(Je===Ye&&(Je=clone(Je)),addToSet(Je,e.FORBID_CONTENTS,$)),Ge&&(G[`#text`]=!0),Le&&addToSet(G,[`html`,`head`,`body`]),G.table&&(addToSet(G,[`tbody`]),delete Oe.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw T(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw T(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);V=e.TRUSTED_TYPES_POLICY,H=V.createHTML(``)}else V===void 0&&(V=le(z,i)),V!==null&&typeof H==`string`&&(H=V.createHTML(``));s&&s(e),ct=e}},ft=addToSet({},[...D,...O,...k]),pt=addToSet({},[...A,...j]),mt=function _checkValidNamespace(e){let t=fe(e);(!t||!t.tagName)&&(t={namespaceURI:tt,tagName:`template`});let n=_(e.tagName),r=_(t.tagName);return nt[e.namespaceURI]?e.namespaceURI===et?t.namespaceURI===X?n===`svg`:t.namespaceURI===$e?n===`svg`&&(r===`annotation-xml`||Q[r]):!!ft[n]:e.namespaceURI===$e?t.namespaceURI===X?n===`math`:t.namespaceURI===et?n===`math`&&it[r]:!!pt[n]:e.namespaceURI===X?t.namespaceURI===et&&!it[r]||t.namespaceURI===$e&&!Q[r]?!1:!pt[n]&&(at[n]||!ft[n]):!!(ot===`application/xhtml+xml`&&nt[e.namespaceURI]):!1},ht=function _forceRemove(e){h(DOMPurify.removed,{element:e});try{fe(e).removeChild(e)}catch{re(e)}},gt=function _removeAttribute(e,t){try{h(DOMPurify.removed,{attribute:t.getAttributeNode(e),from:t})}catch{h(DOMPurify.removed,{attribute:null,from:t})}if(t.removeAttribute(e),e===`is`)if(Be||Ve)try{ht(t)}catch{}else try{t.setAttribute(e,``)}catch{}},_t=function _initDocument(e){let n=null,r=null;if(ze)e=`<remove></remove>`+e;else{let t=y(e,/^[\r\n\t ]+/);r=t&&t[0]}ot===`application/xhtml+xml`&&tt===X&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=V?V.createHTML(e):e;if(tt===X)try{n=new R().parseFromString(i,ot)}catch{}if(!n||!n.documentElement){n=pe.createDocument(tt,`template`,null);try{n.documentElement.innerHTML=Z?H:i}catch{}}let a=n.body||n.documentElement;return e&&r&&a.insertBefore(t.createTextNode(r),a.childNodes[0]||null),tt===X?ge.call(n,Le?`html`:`body`)[0]:Le?n.documentElement:a},vt=function _createNodeIterator(e){return me.call(e.ownerDocument||e,e,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},yt=function _isClobbered(e){return e instanceof ee&&(typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||!(e.attributes instanceof L)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`)},bt=function _isNode(e){return typeof c==`function`&&e instanceof c};function _executeHooks(e,t,n){f(e,e=>{e.call(DOMPurify,t,n,ct)})}let xt=function _sanitizeElements(e){let t=null;if(_executeHooks(U.beforeSanitizeElements,e,null),yt(e))return ht(e),!0;let n=$(e.nodeName);if(_executeHooks(U.uponSanitizeElement,e,{tagName:n,allowedTags:G}),Ie&&e.hasChildNodes()&&!bt(e.firstElementChild)&&w(/<[/\w!]/g,e.innerHTML)&&w(/<[/\w!]/g,e.textContent)||e.nodeType===se.progressingInstruction||Ie&&e.nodeType===se.comment&&w(/<[/\w]/g,e.data))return ht(e),!0;if(!(Ae.tagCheck instanceof Function&&Ae.tagCheck(n))&&(!G[n]||Oe[n])){if(!Oe[n]&&Ct(n)&&(J.tagNameCheck instanceof RegExp&&w(J.tagNameCheck,n)||J.tagNameCheck instanceof Function&&J.tagNameCheck(n)))return!1;if(Ge&&!Je[n]){let t=fe(e)||e.parentNode,n=de(e)||e.childNodes;if(n&&t){let r=n.length;for(let i=r-1;i>=0;--i){let r=ne(n[i],!0);r.__removalCount=(e.__removalCount||0)+1,t.insertBefore(r,ae(e))}}}return ht(e),!0}return e instanceof u&&!mt(e)||(n===`noscript`||n===`noembed`||n===`noframes`)&&w(/<\/no(script|embed|frames)/i,e.innerHTML)?(ht(e),!0):(Fe&&e.nodeType===se.text&&(t=e.textContent,f([ve,ye,be],e=>{t=b(t,e,` `)}),e.textContent!==t&&(h(DOMPurify.removed,{element:e.cloneNode()}),e.textContent=t)),_executeHooks(U.afterSanitizeElements,e,null),!1)},St=function _isValidAttribute(e,n,r){if(Ue&&(n===`id`||n===`name`)&&(r in t||r in lt))return!1;if(!(Me&&!ke[n]&&w(W,n))&&!(je&&w(xe,n))&&!(Ae.attributeCheck instanceof Function&&Ae.attributeCheck(n,e))){if(!K[n]||ke[n]){if(!(Ct(e)&&(J.tagNameCheck instanceof RegExp&&w(J.tagNameCheck,e)||J.tagNameCheck instanceof Function&&J.tagNameCheck(e))&&(J.attributeNameCheck instanceof RegExp&&w(J.attributeNameCheck,n)||J.attributeNameCheck instanceof Function&&J.attributeNameCheck(n,e))||n===`is`&&J.allowCustomizedBuiltInElements&&(J.tagNameCheck instanceof RegExp&&w(J.tagNameCheck,r)||J.tagNameCheck instanceof Function&&J.tagNameCheck(r))))return!1}else if(!Qe[n]&&!w(Te,b(r,Ce,``))&&!((n===`src`||n===`xlink:href`||n===`href`)&&e!==`script`&&x(r,`data:`)===0&&Xe[e])&&!(Ne&&!w(Se,b(r,Ce,``)))&&r)return!1}return!0},Ct=function _isBasicCustomElement(e){return e!==`annotation-xml`&&y(e,we)},wt=function _sanitizeAttributes(e){_executeHooks(U.beforeSanitizeAttributes,e,null);let{attributes:t}=e;if(!t||yt(e))return;let n={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:K,forceKeepAttr:void 0},r=t.length;for(;r--;){let{name:i,namespaceURI:a,value:o}=t[r],s=$(i),c=o,l=i===`value`?c:S(c);if(n.attrName=s,n.attrValue=l,n.keepAttr=!0,n.forceKeepAttr=void 0,_executeHooks(U.uponSanitizeAttribute,e,n),l=n.attrValue,We&&(s===`id`||s===`name`)&&(gt(i,e),l=`user-content-`+l),Ie&&w(/((--!?|])>)|<\/(style|title|textarea)/i,l)){gt(i,e);continue}if(s===`attributename`&&y(l,`href`)){gt(i,e);continue}if(n.forceKeepAttr)continue;if(!n.keepAttr){gt(i,e);continue}if(!Pe&&w(/\/>/i,l)){gt(i,e);continue}Fe&&f([ve,ye,be],e=>{l=b(l,e,` `)});let u=$(e.nodeName);if(!St(u,s,l)){gt(i,e);continue}if(V&&typeof z==`object`&&typeof z.getAttributeType==`function`&&!a)switch(z.getAttributeType(u,s)){case`TrustedHTML`:l=V.createHTML(l);break;case`TrustedScriptURL`:l=V.createScriptURL(l);break}if(l!==c)try{a?e.setAttributeNS(a,i,l):e.setAttribute(i,l),yt(e)?ht(e):m(DOMPurify.removed)}catch{gt(i,e)}}_executeHooks(U.afterSanitizeAttributes,e,null)},Tt=function _sanitizeShadowDOM(e){let t=null,n=vt(e);for(_executeHooks(U.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)_executeHooks(U.uponSanitizeShadowNode,t,null),xt(t),wt(t),t.content instanceof a&&_sanitizeShadowDOM(t.content);_executeHooks(U.afterSanitizeShadowDOM,e,null)};return DOMPurify.sanitize=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=null,i=null,o=null,s=null;if(Z=!e,Z&&(e=`<!-->`),typeof e!=`string`&&!bt(e))if(typeof e.toString==`function`){if(e=e.toString(),typeof e!=`string`)throw T(`dirty is not a string, aborting`)}else throw T(`toString is not a function`);if(!DOMPurify.isSupported)return e;if(Re||dt(t),DOMPurify.removed=[],typeof e==`string`&&(Ke=!1),Ke){if(e.nodeName){let t=$(e.nodeName);if(!G[t]||Oe[t])throw T(`root node is forbidden and cannot be sanitized in-place`)}}else if(e instanceof c)n=_t(`<!---->`),i=n.ownerDocument.importNode(e,!0),i.nodeType===se.element&&i.nodeName===`BODY`||i.nodeName===`HTML`?n=i:n.appendChild(i);else{if(!Be&&!Fe&&!Le&&e.indexOf(`<`)===-1)return V&&He?V.createHTML(e):e;if(n=_t(e),!n)return Be?null:He?H:``}n&&ze&&ht(n.firstChild);let l=vt(Ke?e:n);for(;o=l.nextNode();)xt(o),wt(o),o.content instanceof a&&Tt(o.content);if(Ke)return e;if(Be){if(Ve)for(s=he.call(n.ownerDocument);n.firstChild;)s.appendChild(n.firstChild);else s=n;return(K.shadowroot||K.shadowrootmode)&&(s=_e.call(r,s,!0)),s}let u=Le?n.outerHTML:n.innerHTML;return Le&&G[`!doctype`]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&w(ie,n.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+n.ownerDocument.doctype.name+`> | |
| 16 | +`+u),Fe&&f([ve,ye,be],e=>{u=b(u,e,` `)}),V&&He?V.createHTML(u):u},DOMPurify.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};dt(e),Re=!0},DOMPurify.clearConfig=function(){ct=null,Re=!1},DOMPurify.isValidAttribute=function(e,t,n){ct||dt({});let r=$(e),i=$(t);return St(r,i,n)},DOMPurify.addHook=function(e,t){typeof t==`function`&&h(U[e],t)},DOMPurify.removeHook=function(e,t){if(t!==void 0){let n=p(U[e],t);return n===-1?void 0:g(U[e],n,1)[0]}return m(U[e])},DOMPurify.removeHooks=function(e){U[e]=[]},DOMPurify.removeAllHooks=function(){U=ue()},DOMPurify}t.exports=createDOMPurify()})),Vt=__commonJSMin((e=>{var t=globalThis.ReactDOM;e.createRoot=t.createRoot,e.hydrateRoot=t.hydrateRoot})),Ht=__toESM(__commonJSMin(((e,t)=>{var n=Object.create,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,__export=(e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})},__copyProps=(e,t,n,o)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of a(t))!s.call(e,c)&&c!==n&&r(e,c,{get:()=>t[c],enumerable:!(o=i(t,c))||o.enumerable});return e},__toESM=(e,t,i)=>(i=e==null?{}:n(o(e)),__copyProps(t||!e||!e.__esModule?r(i,`default`,{value:e,enumerable:!0}):i,e)),__toCommonJS=e=>__copyProps(r({},`__esModule`,{value:!0}),e),c={};__export(c,{BREAKPOINTS_SCHEMA_FULL_URI:()=>_,BREAKPOINTS_SCHEMA_URI:()=>g,DOCUMENT_STRUCTURE_URI:()=>hr,ELEMENT_ADDED_EVENT:()=>Ti,GLOBAL_STYLES_IMPORTED_EVENT:()=>bi,SpotlightBackdrop:()=>SpotlightBackdrop,UnknownStyleStateError:()=>X,UnknownStyleTypeError:()=>et,WIDGET_SCHEMA_FULL_URI:()=>m,WIDGET_SCHEMA_URI:()=>p,canBeNestedTemplated:()=>canBeNestedTemplated,convertCssToAtomic:()=>convertCssToAtomic,convertStyleBlocksToAtomic:()=>convertStyleBlocksToAtomic,createNestedTemplatedElementType:()=>createNestedTemplatedElementType,createNestedTemplatedElementView:()=>createNestedTemplatedElementView,createPropsResolver:()=>createPropsResolver,createTemplatedElementView:()=>createTemplatedElementView,createTransformer:()=>createTransformer,createTransformersRegistry:()=>createTransformersRegistry,doAfterRender:()=>doAfterRender,endDragElementFromPanel:()=>endDragElementFromPanel,formatGridTrackRepeat:()=>formatGridTrackRepeat,init:()=>init,isAtomicWidget:()=>isAtomicWidget,isGridTrackProperty:()=>isGridTrackProperty,registerElementType:()=>registerElementType,registerModelExtensions:()=>registerModelExtensions,settingsTransformersRegistry:()=>ft,startDragElementFromPanel:()=>startDragElementFromPanel,styleTransformersRegistry:()=>Je,stylesInheritanceTransformersRegistry:()=>qe,useCanvasDocument:()=>useCanvasDocument,useEscapeOnCanvas:()=>useEscapeOnCanvas,waitForChildrenToComplete:()=>waitForChildrenToComplete}),t.exports=__toCommonJS(c);var l=globalThis.elementorV2.editorV1Adapters,u=globalThis.elementorV2.editorMcp,d=globalThis.elementorV2.httpClient,f=`editor-canvas`,p=`elementor://widgets/schema/{widgetType}`,m=`${f}_${p}`;`${f}`;var h=`elementor/v1/mcp-proxy`,listWidgetTypes=async()=>{let{data:e}=await(0,d.httpService)().post(h,{tool:`list-widget-schemas`,input:{summary:!0}});return(e.data?.widgets??[]).map(e=>e.type)},fetchWidgetSchema=async e=>{let{data:t}=await(0,d.httpService)().post(h,{tool:`get-widget-schema`,input:{widget_type:e}});return t.data??{}},initWidgetsSchemaResource=e=>{let{resource:t}=e;t(`widget-schema-by-type`,new u.ResourceTemplate(p,{list:async()=>({resources:(await listWidgetTypes()).map(e=>({uri:`elementor://widgets/schema/${e}`,name:`Widget schema for `+e}))})}),{description:`PropType schema for the specified widget type`},async(e,t)=>{let n=typeof t.widgetType==`string`?t.widgetType:t.widgetType?.[0];if(!n)throw Error(`No widget type provided.`);let r=await fetchWidgetSchema(n);return{contents:[{uri:e.toString(),mimeType:`application/json`,text:JSON.stringify(r)}]}})},g=`elementor://breakpoints/list`,_=`${f}_${g}`,initBreakpointsResource=e=>{let{resource:t,sendResourceUpdated:n}=e,getBreakpointsList=()=>{let{breakpoints:e}=window.elementor?.config?.responsive||{};return e?Object.values(e).filter(e=>e.is_enabled).map(e=>{let{direction:t,label:n,value:r}=e;return{label:n,constraint:t,value:r}}):[]},buildResourceResponse=()=>({contents:[{uri:g,mimeType:`application/json`,text:JSON.stringify(getBreakpointsList())}]});t(`breakpoints `,g,{description:`Breakpoints list.`},()=>buildResourceResponse()),window.addEventListener((0,l.v1ReadyEvent)().name,()=>{n({uri:g,...buildResourceResponse()})})},v=globalThis.elementorV2.httpClient,y=`elementor/v1/css-to-atomic`,b=`default`,convertBlocks=async e=>{let{data:t}=await(0,v.httpService)().post(y,{blocks:e});return t.data},convertStyleBlocksToAtomic=async e=>convertBlocks(e),convertCssToAtomic=async e=>(await convertStyleBlocksToAtomic({[b]:e}))[b],x=globalThis.elementorV2.editor,S=globalThis.elementorV2.editorMcp,C=globalThis.React,w=globalThis.elementorV2.editorDocuments,T=globalThis.elementorV2.editorStylesRepository,E=globalThis.elementorV2.utils,ClassesRename=()=>((0,C.useEffect)(()=>{let e=subscribeToStylesRepository();return()=>{e()}},[]),null),subscribeToStylesRepository=()=>T.stylesRepository.subscribe((e,t)=>{!e||!t||Object.keys(t).forEach(n=>{if(!(e[n]&&(0,E.hash)(e[n])!==(0,E.hash)(t[n])))return;let r=e[n],i=t[n];r.label!==i.label&&renameClass(r.label,i.label)})}),renameClass=(e,t)=>{Object.values((0,w.getV1DocumentsManager)().documents).forEach(n=>{n.container.view?.el?.querySelectorAll(`.elementor .${e}`).forEach(n=>{n.classList.replace(e,t)})})},D=__toESM(globalThis.React),O=globalThis.elementorV2.editorElements,k=globalThis.elementorV2.editorV1Adapters,A=globalThis.React,j=globalThis.React,M=globalThis.elementorV2.utils;function useElementRect(e){let[t,n]=(0,j.useState)(new DOMRect(0,0,0,0)),r=(0,M.throttle)(()=>{n(e?.getBoundingClientRect()??new DOMRect(0,0,0,0))},20,!0);return useScrollListener({element:e,onChange:r}),useResizeListener({element:e,onChange:r}),useMutationsListener({element:e,onChange:r}),(0,j.useEffect)(()=>()=>{r.cancel()},[r]),t}function useScrollListener({element:e,onChange:t}){(0,j.useEffect)(()=>{if(!e)return;let n=e.ownerDocument?.defaultView;return n?.addEventListener(`scroll`,t,{passive:!0}),()=>{n?.removeEventListener(`scroll`,t)}},[e,t])}function useResizeListener({element:e,onChange:t}){(0,j.useEffect)(()=>{if(!e)return;let n=new ResizeObserver(t);n.observe(e);let r=e.ownerDocument?.defaultView;return r?.addEventListener(`resize`,t,{passive:!0}),()=>{n.disconnect(),r?.removeEventListener(`resize`,t)}},[e,t])}function useMutationsListener({element:e,onChange:t}){(0,j.useEffect)(()=>{if(!e)return;let n=new MutationObserver(t);return n.observe(e,{childList:!0,subtree:!0}),()=>{n.disconnect()}},[e,t])}var N=globalThis.React,P=globalThis.elementorV2.editorElements,F=globalThis.elementorV2.editorV1Adapters;function toGridTracks(e){return{columns:parseTrackList(e.gridTemplateColumns),rows:parseTrackList(e.gridTemplateRows),columnGap:resolveGapPx(e.columnGap,e.width),rowGap:resolveGapPx(e.rowGap,e.height),padding:{top:toPx(e.paddingTop),right:toPx(e.paddingRight),bottom:toPx(e.paddingBottom),left:toPx(e.paddingLeft)},borderColor:e.getPropertyValue(`--e-a-border-color-bold`).trim()}}function computeCellRects(e,t,n){let{columns:r,rows:i,columnGap:a,rowGap:o,padding:s}=e,c=r.length>0,l=i.length>0;if(!c&&!l)return[];let u=c?computeTrackSegments(r,a,s.left):[{start:s.left,size:t-s.left-s.right}],d=l?computeTrackSegments(i,o,s.top):[{start:s.top,size:n-s.top-s.bottom}],f=[];for(let e of d)for(let t of u)f.push({x:t.start,y:e.start,width:t.size,height:e.size});return f}function computeGridLines(e,t,n){let{columns:r,rows:i,columnGap:a,rowGap:o,padding:s}=e,c=r.length>0,l=i.length>0;if(!c&&!l)return{vertical:[],horizontal:[]};let u=c?computeTrackSegments(r,a,s.left):[{start:s.left,size:t-s.left-s.right}],d=l?computeTrackSegments(i,o,s.top):[{start:s.top,size:n-s.top-s.bottom}],f=uniqueSorted(u.flatMap(e=>[e.start,e.start+e.size])),p=uniqueSorted(d.flatMap(e=>[e.start,e.start+e.size])),m=p[0],h=p[p.length-1],g=f[0],_=f[f.length-1];return{vertical:f.map(e=>({x1:e,y1:m,x2:e,y2:h})),horizontal:p.map(e=>({x1:g,y1:e,x2:_,y2:e}))}}function uniqueSorted(e){return Array.from(new Set(e)).sort((e,t)=>e-t)}function computeTrackSegments(e,t,n){let r=[],i=n;for(let n=0;n<e.length;n++)r.push({start:i,size:e[n]}),i+=e[n],n<e.length-1&&(i+=t);return r}function snapToHalfPixel(e){return Math.round(e)+.5}function parseTrackList(e){return!e||e===`none`?[]:e.trim().split(/\s+/).map(toPx).filter(e=>e>0)}function toPx(e){let t=parseFloat(e);return Number.isFinite(t)?t:0}function resolveGapPx(e,t){if(e.trim().endsWith(`%`)){let n=parseFloat(e),r=parseFloat(t);return Number.isFinite(n)&&Number.isFinite(r)?n/100*r:0}return toPx(e)}var I=globalThis.React;function useGridChildren(e){let[t,n]=(0,I.useState)(0);return(0,I.useEffect)(()=>{if(!e)return;let bump=()=>n(e=>e+1),t=new ResizeObserver(bump),r=new Set,syncChildren=()=>{for(let n of Array.from(e.children))r.has(n)||(t.observe(n),r.add(n));for(let n of r)n.parentElement!==e&&(t.unobserve(n),r.delete(n))};syncChildren();let i=new MutationObserver(()=>{syncChildren(),bump()});return i.observe(e,{childList:!0}),()=>{i.disconnect(),t.disconnect(),r.clear()}},[e]),t}var L={columns:[],rows:[],columnGap:0,rowGap:0,padding:{top:0,right:0,bottom:0,left:0},borderColor:``},ee=`elementor/device-mode/change`;function useGridTracks(e,t){let[n,r]=(0,N.useState)(L),i=(0,F.__privateUseListenTo)([(0,F.windowEvent)(P.ELEMENT_STYLE_CHANGE_EVENT),(0,F.windowEvent)(ee)],()=>({})),a=useGridChildren(e);return(0,N.useEffect)(()=>{let t=e?.ownerDocument?.defaultView;if(!e||!t){r(L);return}let n=t.requestAnimationFrame(()=>{r(toGridTracks(t.getComputedStyle(e)))});return()=>{t.cancelAnimationFrame(n)}},[e,t.width,t.height,i,a]),n}function findFirstEmptyCell(e,t,n){if(!e||t===0||n===0)return null;let r=e.ownerDocument?.defaultView;if(!r)return null;let i=r.getComputedStyle(e).gridAutoFlow.trim().startsWith(`column`),a=Array.from({length:n},()=>Array(t).fill(!1)),o=[],s=[];for(let t of Array.from(e.children)){if(!t.classList.contains(`elementor-element`))continue;let e=r.getComputedStyle(t);if(e.display===`none`)continue;let n=resolvePlacement(e.gridColumnStart,e.gridColumnEnd),i=resolvePlacement(e.gridRowStart,e.gridRowEnd);n.start!==null||i.start!==null?o.push({col:n.start,colSpan:n.span,row:i.start,rowSpan:i.span}):s.push({colSpan:n.span,rowSpan:i.span})}for(let e of o)fillMatrix(a,e.col??0,e.row??0,e.colSpan,e.rowSpan);for(let e of s){let t=findNextFreeSlot(a,e.colSpan,e.rowSpan,i);t&&fillMatrix(a,t.col,t.row,e.colSpan,e.rowSpan)}return scanFirstEmpty(a,i)}function resolvePlacement(e,t){let n=parseLineValue(e),r=parseLineValue(t);if(typeof n==`number`){let e=n-1;return typeof r==`number`?{start:e,span:Math.max(1,r-n)}:isSpan(r)?{start:e,span:r.n}:{start:e,span:1}}if(isSpan(n)){if(typeof r==`number`){let e=r-1-n.n;return{start:e>=0?e:null,span:n.n}}return{start:null,span:n.n}}if(typeof r==`number`){let e=r-2;return{start:e>=0?e:null,span:1}}return isSpan(r)?{start:null,span:r.n}:{start:null,span:1}}function parseLineValue(e){let t=e.trim();if(t===``||t===`auto`)return`auto`;let n=t.match(/^span\s+(\d+)$/);if(n){let e=parseInt(n[1],10);return{kind:`span`,n:Math.max(1,e)}}let r=parseInt(t,10);return Number.isFinite(r)&&r>0?r:`auto`}function isSpan(e){return typeof e==`object`&&!!e&&`kind`in e&&e.kind===`span`}function fillMatrix(e,t,n,r,i){let a=e.length,o=a>0?e[0].length:0,s=Math.max(0,n),c=Math.max(0,t),l=Math.min(a,n+i),u=Math.min(o,t+r);for(let t=s;t<l;t++)for(let n=c;n<u;n++)e[t][n]=!0}function findNextFreeSlot(e,t,n,r){let i=e.length,a=(i>0?e[0].length:0)-t,o=i-n;if(a<0||o<0)return null;if(r){for(let r=0;r<=a;r++)for(let i=0;i<=o;i++)if(canFit(e,r,i,t,n))return{row:i,col:r}}else for(let r=0;r<=o;r++)for(let i=0;i<=a;i++)if(canFit(e,i,r,t,n))return{row:r,col:i};return null}function canFit(e,t,n,r,i){for(let a=n;a<n+i;a++)for(let n=t;n<t+r;n++)if(e[a][n])return!1;return!0}function scanFirstEmpty(e,t){let n=e.length,r=n>0?e[0].length:0;if(t){for(let t=0;t<r;t++)for(let r=0;r<n;r++)if(!e[r][t])return{row:r,col:t}}else for(let t=0;t<n;t++)for(let n=0;n<r;n++)if(!e[t][n])return{row:t,col:n};return null}var R=`--e-grid-empty-cell-row`,z=`--e-grid-empty-cell-col`,B=`--e-grid-empty-cell-visibility`,clearGridEmptyCellStyles=e=>{e.style.removeProperty(R),e.style.removeProperty(z),e.style.removeProperty(B)},GridEmptyCellPositioner=({element:e})=>{let t=useGridTracks(e,useElementRect(e));return(0,A.useEffect)(()=>{if(!e)return;let n=findFirstEmptyCell(e,t.columns.length,t.rows.length);return n?(e.style.setProperty(R,String(n.row+1)),e.style.setProperty(z,String(n.col+1)),e.style.setProperty(B,`visible`),()=>{clearGridEmptyCellStyles(e)}):(e.style.removeProperty(R),e.style.removeProperty(z),e.style.setProperty(B,`hidden`),()=>clearGridEmptyCellStyles(e))},[e,t]),null},te=__toESM(globalThis.React),ne=globalThis.elementorV2.editorElements,re=globalThis.elementorV2.ui,ie=(zt(),__toCommonJS(Qe)),ae=globalThis.React,oe=(zt(),__toCommonJS(Qe));function useFloatingOnElement({element:e,isSelected:t}){let[n,r]=(0,ae.useState)(!1),{refs:i,floatingStyles:a,context:o}=(0,oe.useFloating)({open:n||t,onOpenChange:r,whileElementsMounted:oe.autoUpdate,middleware:[(0,oe.size)(()=>({apply({elements:e,rects:t}){Object.assign(e.floating.style,{width:`${t.reference.width+2}px`,height:`${t.reference.height+2}px`})}})),(0,oe.offset)(({rects:e})=>-e.reference.height/2-e.floating.height/2)]});return(0,ae.useEffect)(()=>{i.setReference(e)},[e,i]),{isVisible:n||t,context:o,floating:{setRef:i.setFloating,ref:i.floating,styles:a}}}var se=__toESM(globalThis.React),ce=globalThis.elementorV2.ui,le=(zt(),__toCommonJS(Qe)),ue=globalThis.React;function useBindReactPropsToElement(e,t){(0,ue.useEffect)(()=>{let n=e,{events:r,attrs:i}=groupProps(t());return r.forEach(([e,t])=>n.addEventListener(e,t)),i.forEach(([e,t])=>n.setAttribute(e,t)),()=>{r.forEach(([e,t])=>n.removeEventListener(e,t)),i.forEach(([e])=>n.removeAttribute(e))}},[t,e])}function groupProps(e){let t=/^on(?=[A-Z])/;return Object.entries(e).reduce((e,[n,r])=>{if(!t.test(n))return e.attrs.push([n,r]),e;let i=n.replace(t,``).toLowerCase(),a=r;return e.events.push([i,a]),e},{events:[],attrs:[]})}var de=[`.e-off-canvas`],useHasOverlapping=()=>{let e=window.elementor?.$preview?.[0];return e?de.map(t=>Array.from(e?.contentWindow?.document.body.querySelectorAll(t)??[])).flat().some(e=>e.checkVisibility({opacityProperty:!0,visibilityProperty:!0,contentVisibilityAuto:!0})):!1},fe=1,V=new Set([`e-form-input`]);function shouldUseSmallerOutlineOffset(e,t){return e.offsetHeight<=fe||t!==void 0&&V.has(t)}var H=`elementor-preview-responsive-wrapper`,pe=(0,ce.styled)(ce.Box,{shouldForwardProp:e=>e!==`isSelected`&&e!==`isSmallerOffset`&&e!==`isGlobal`})(({theme:e,isSelected:t,isSmallerOffset:n,isGlobal:r})=>({outline:`${t?`2px`:`1px`} solid ${r?e.palette.global.main:e.palette.primary.light}`,outlineOffset:t&&!n?`-2px`:`-1px`,pointerEvents:`none`})),OutlineOverlay=({element:e,isSelected:t,id:n,isGlobal:r=!1,widgetType:i})=>{let{context:a,floating:o,isVisible:s}=useFloatingOnElement({element:e,isSelected:t}),{getFloatingProps:c,getReferenceProps:l}=(0,le.useInteractions)([(0,le.useHover)(a)]),u=useHasOverlapping();useBindReactPropsToElement(e,l);let d=shouldUseSmallerOutlineOffset(e,i);return s&&!u&&se.createElement(le.FloatingPortal,{id:H},se.createElement(pe,{ref:o.setRef,isSelected:t,isGlobal:r,style:o.styles,"data-element-overlay":n,role:`presentation`,isSmallerOffset:d,...c()}))},me=__toESM(globalThis.React),he=globalThis.React,ge=__toESM(globalThis.React),_e=`rgba(0, 0, 0, 0.12)`;function Cell({x:e,y:t,width:n,height:r,color:i}){return ge.createElement(`rect`,{x:e,y:t,width:n,height:r,fill:`none`,stroke:i||_e,strokeWidth:1,strokeDasharray:`2 2`,vectorEffect:`non-scaling-stroke`})}var U=__toESM(globalThis.React),ve=19;function FirstEmptyCell({rect:e,color:t}){let n=Math.min(ve,e.width,e.height);if(n<=0)return null;let r=e.x+e.width/2,i=e.y+e.height/2;return U.createElement(`i`,{className:`eicon-plus`,"aria-hidden":`true`,style:{position:`absolute`,left:r,top:i,transform:`translate(-50%, -50%)`,fontSize:n,color:t,lineHeight:1,pointerEvents:`none`}})}var ye=__toESM(globalThis.React),be=`rgba(0, 0, 0, 0.12)`;function Line({x1:e,y1:t,x2:n,y2:r,color:i}){return ye.createElement(`line`,{x1:e,y1:t,x2:n,y2:r,stroke:i||be,strokeWidth:1,strokeDasharray:`2 2`,vectorEffect:`non-scaling-stroke`})}var renderCells=(e,t)=>e.map((e,n)=>me.createElement(Cell,{key:n,x:snapToHalfPixel(e.x),y:snapToHalfPixel(e.y),width:Math.round(e.width),height:Math.round(e.height),color:t})),renderLines=(e,t,n)=>{let{vertical:r,horizontal:i}=computeGridLines(e,t,n);return[...r.map((t,n)=>me.createElement(Line,{key:`v${n}`,x1:snapToHalfPixel(t.x1),y1:Math.round(t.y1),x2:snapToHalfPixel(t.x2),y2:Math.round(t.y2),color:e.borderColor})),...i.map((t,n)=>me.createElement(Line,{key:`h${n}`,x1:Math.round(t.x1),y1:snapToHalfPixel(t.y1),x2:Math.round(t.x2),y2:snapToHalfPixel(t.y2),color:e.borderColor}))]},isDragActiveFromDom=e=>!!e?.querySelector(`.e-dragging-over, .elementor-dragging-on-child, .elementor-draggable-over, .elementor-widget-placeholder, .elementor-sortable-placeholder`);function GridOutline({element:e,tracks:t,width:n,height:r}){let i=(0,he.useMemo)(()=>computeCellRects(t,n,r),[t,n,r]),a=t.columnGap>0||t.rowGap>0,o=(0,he.useMemo)(()=>findFirstEmptyCell(e,t.columns.length,t.rows.length),[e,t]),s=o&&t.columns.length>0?i[o.row*t.columns.length+o.col]:null;return me.createElement(me.Fragment,null,me.createElement(`svg`,{width:n,height:r,style:{position:`absolute`,inset:0,overflow:`visible`},xmlns:`http://www.w3.org/2000/svg`},a?renderCells(i,t.borderColor):renderLines(t,n,r)),s&&!isDragActiveFromDom(e)&&me.createElement(FirstEmptyCell,{rect:s,color:t.borderColor}))}var GridOutlineOverlay=({element:e,id:t,isSelected:n})=>{let r=(0,ne.useElementEditorSettings)(t)?.grid_outline,i=useElementRect(e),a=useGridTracks(e,i),{floating:o}=useFloatingOnElement({element:e,isSelected:n});return r===!1||a.columns.length===0&&a.rows.length===0?null:te.createElement(ie.FloatingPortal,{id:H},te.createElement(re.Box,{ref:o.setRef,style:{...o.styles,pointerEvents:`none`},"data-grid-outline":t,role:`presentation`},te.createElement(GridOutline,{element:e,tracks:a,width:i.width,height:i.height})))},hasGridStyleDisplay=e=>e.computedStyleMap().get(`display`)?.toString()===`grid`,W=`atomic`,xe=[{component:OutlineOverlay,shouldRender:()=>!0},{component:GridEmptyCellPositioner,shouldRender:({element:e})=>hasGridStyleDisplay(e)},{component:GridOutlineOverlay,shouldRender:({isSelected:e,element:t})=>e&&hasGridStyleDisplay(t)}];function ElementsOverlays(){let e=(0,O.useSelectedElement)(),t=useElementsDom(),n=(0,k.useEditMode)()===`edit`,r=(0,k.__privateUseIsRouteActive)(`panel/global`);return n&&!r?t.map(({id:t,domElement:n,isGlobal:r,widgetType:i})=>{let a=e.element?.id===t;return xe.map(({shouldRender:e,component:o},s)=>e({id:t,element:n,isSelected:a,widgetType:i})&&D.createElement(o,{key:`${t}-${s}`,id:t,element:n,isSelected:a,isGlobal:r,widgetType:i}))}):null}function useElementsDom(){return(0,k.__privateUseListenTo)([(0,k.windowEvent)(`elementor/editor/element-rendered`),(0,k.windowEvent)(`elementor/editor/element-destroyed`)],()=>(0,O.getElements)().filter(e=>isV4Element(e.view?.el?.dataset)).map(e=>({id:e.id,domElement:e.view?.getDomElement?.()?.get?.(0),isGlobal:e.model.get(`isGlobal`)??!1,widgetType:e.model.get(`widgetType`)})).filter(e=>!!e.domElement))}function isV4Element(e){return e?W in e||`eType`in e:!1}var Se=__toESM(globalThis.React),Ce=globalThis.elementorV2.editorV1Adapters,we=globalThis.elementorV2.ui,Te=globalThis.React,G=globalThis.elementorV2.editorInteractions,Ee=globalThis.elementorV2.editorV1Adapters,K=globalThis.React;function useOnMount(e){let t=(0,K.useRef)(!1);(0,K.useEffect)(()=>{t.current||(t.current=!0,e())},[])}function useInteractionsItems(){let[e,t]=(0,Te.useState)({}),n=(0,Te.useMemo)(()=>{try{return G.interactionsRepository.getProviders().map(e=>({provider:e,subscriber:createProviderSubscriber({provider:e,setInteractionItems:t})}))}catch{return[]}},[]);return(0,Te.useEffect)(()=>{if(n.length===0)return;let e=n.map(({provider:e,subscriber:t})=>{let safeSubscriber=()=>{try{t()}catch{}};return e.subscribe(safeSubscriber)});return()=>{e.forEach(e=>e())}},[n]),useOnMount(()=>{n.length!==0&&(0,Ee.registerDataHook)(`after`,`editor/documents/attach-preview`,async()=>{n.forEach(({subscriber:e})=>{try{e()}catch{}})})}),(0,Te.useMemo)(()=>Object.values(e).sort(sortByProviderPriority).flatMap(({items:e})=>e),[e])}function sortByProviderPriority({provider:e},{provider:t}){return e.priority-t.priority}function createProviderSubscriber({provider:e,setInteractionItems:t}){return()=>{try{let n=e.actions.all(),r=e.getKey();t(t=>({...t,[r]:{provider:e,items:n}}))}catch{}}}function InteractionsRenderer(){let e=usePortalContainer(),t=useInteractionsItems();if(!e)return null;let n=JSON.stringify(Array.isArray(t)?t:[]);return Se.createElement(we.Portal,{container:e},Se.createElement(`script`,{type:`application/json`,"data-e-interactions":`true`,dangerouslySetInnerHTML:{__html:n}}))}function usePortalContainer(){return(0,Ce.__privateUseListenTo)((0,Ce.commandEndEvent)(`editor/documents/attach-preview`),()=>(0,Ce.getCanvasIframeDocument)()?.head)}var De=__toESM(globalThis.React),J=globalThis.elementorV2.editorV1Adapters,Oe=globalThis.elementorV2.ui,ke=globalThis.elementorV2.editorV1Adapters,Ae=`data-e-removed`,je=`data-elementor-id`,Me=`elementor-post-`,Ne=`-css`;function useDocumentsCssLinks(){return(0,ke.__privateUseListenTo)((0,ke.commandEndEvent)(`editor/documents/attach-preview`),()=>{let e=(0,ke.getCanvasIframeDocument)();if(!e)return[];let t=getDocumentsIdsInCanvas(e).map(e=>`${Me}${e}${Ne}`),n=getDocumentsCssLinks(e).filter(e=>t.includes(e.getAttribute(`id`)??``));return n.forEach(e=>{e.hasAttribute(Ae)||e.remove()}),n.map(e=>({...getLinkAttrs(e),id:e.getAttribute(`id`)??``,[Ae]:!0}))})}function getDocumentsIdsInCanvas(e){return[...e.body.querySelectorAll(`[${je}]`)??[]].map(e=>e.getAttribute(je)||``)}function getDocumentsCssLinks(e){return[...e.head.querySelectorAll(`link[rel="stylesheet"][id^=${Me}][id$=${Ne}]`)??[]]}function getLinkAttrs(e){let t=[...e.attributes].map(e=>[e.name,e.value]);return Object.fromEntries(t)}var Pe=globalThis.React,Fe=globalThis.elementorV2.editorResponsive,Ie=globalThis.elementorV2.editorStyles,Le=globalThis.elementorV2.editorStylesRepository,Re=globalThis.elementorV2.editorV1Adapters;function abortPreviousRuns(e){let t=null;return(...n)=>(t&&t.abort(),t=new AbortController,e(t,...n))}var ze=globalThis.elementorV2.editorV1Adapters,Be=new Set;function removeProviderPregeneratedLinks(e,t){if(Be.has(e))return;let n=(0,ze.getCanvasIframeDocument)();n&&(n.head.querySelectorAll(`link[rel="stylesheet"]`).forEach(e=>{let{id:n,href:r,media:i}=e;t({id:n,href:r,media:i})&&e.remove()}),Be.add(e))}function resetRemovedProviders(){Be.clear()}function signalizedProcess(e,t=[]){return{then:n=>(t.push(n),signalizedProcess(e,t)),execute:async()=>{let n;for(let r of t){if(e.aborted)break;n=await r(n,e)}}}}var Ve=globalThis.React,He=globalThis.elementorV2.editorStyles,Ue=globalThis.elementorV2.editorV1Adapters,We=globalThis.elementorV2.editorProps,isMultiProps=e=>!!e&&typeof e==`object`&&`$$multi-props`in e&&e[`$$multi-props`]===!0,createMultiPropsValue=e=>({"$$multi-props":!0,value:e}),getMultiPropsValue=e=>e.value,Ge=3;function createPropsResolver({transformers:e,schema:t,onPropResolve:n}){async function resolve({props:e,schema:r,signal:i,renderContext:a}){r??=t;let o=Promise.all(Object.entries(r).map(async([t,r])=>{let o=e[t]??r.default,s=await transform({value:o,key:t,type:r,signal:i,renderContext:a});return n?.({key:t,value:s,propValue:o,propType:r}),isMultiProps(s)?getMultiPropsValue(s):{[t]:s}}));return Object.assign({},...(await o).filter(Boolean))}async function transform({value:t,key:n,type:r,signal:i,depth:a=0,renderContext:o}){if(t==null)return null;if(!(0,We.isTransformable)(t))return t;if(a>Ge||t.disabled===!0)return null;let s=r;if(r.kind===`union`&&(s=r.prop_types[t.$$type],!s)||(s=s,t.$$type!==s.key))return null;let c=t.value;s.kind===`object`&&(c=await resolve({props:c,schema:s.shape,signal:i,renderContext:o})),s.kind===`array`&&(c=await Promise.all(c.map(e=>transform({value:e,key:n,type:s.item_prop_type,depth:a,signal:i,renderContext:o}))));let l=e.get(t.$$type);if(!l)return null;try{return transform({value:await l(c,{key:n,signal:i,renderContext:o,propType:r}),key:n,type:r,signal:i,depth:a+1,renderContext:o})}catch{return null}}return resolve}var Ke=globalThis.elementorV2.editorProps,maybeEnqueueFontFromStyleProp=(e,t,n)=>{if(!(0,Ke.isTransformable)(t)||t.disabled)return;let r=e.kind===`union`?t.$$type:e.key,i=(0,Ke.getPropSchemaFromCache)(r);if(!i||!(`getEnqueueFontFamily`in i)||typeof i.getEnqueueFontFamily!=`function`)return;let a=t.value;if(typeof a!=`string`)return;let o=i.getEnqueueFontFamily(a);o&&n(o)};function createTransformersRegistry(){let e={},t=null;return{register(t,n){return e[t]=n,this},registerFallback(e){return t=e,this},get(n){return e[n]??t},all(){return{...e}}}}var qe=createTransformersRegistry(),Je=createTransformersRegistry();function useStylePropResolver(){return(0,Ve.useMemo)(()=>createPropsResolver({transformers:Je,schema:(0,He.getStylesSchema)(),onPropResolve:({propValue:e,propType:t})=>{maybeEnqueueFontFromStyleProp(t,e,Ue.enqueueFont)}}),[])}var Ye=globalThis.React,Xe=globalThis.elementorV2.editorResponsive,Ze=globalThis.elementorV2.editorStyles,Y=globalThis.elementorV2.utils,$e=globalThis.elementorV2.utils,et=(0,$e.createError)({code:`unknown_style_type`,message:`Unknown style type`}),X=(0,$e.createError)({code:`unknown_style_state`,message:`Unknown style state`}),tt={class:`.`},Z=`desktop`,nt=`normal`;function getStyleUniqueKey(e){let t=e.variants[0]?.meta?.breakpoint??Z,n=e.variants[0]?.meta?.state??nt;return`${e.id}-${t}-${n}`}function createStylesRenderer({resolve:e,breakpoints:t,selectorPrefix:n=``}){return async({styles:r,signal:i})=>{let a=new Set,o=r.filter(e=>{let t=getStyleUniqueKey(e);return a.has(t)?!1:(a.add(t),!0)}).map(async r=>{let a=Object.values(r.variants).map(async a=>{let o=await propsToCss({props:a.props,resolve:e,signal:i}),s=customCssToString(a.custom_css);return createStyleWrapper().for(r.cssName,r.type).withPrefix(n).withState(a.meta.state).withMediaQuery(a.meta.breakpoint?t[a.meta.breakpoint]:null).wrap(o+s)}),o=await Promise.all(a);return{id:r.id,breakpoint:r?.variants[0]?.meta?.breakpoint||`desktop`,value:o.join(``),state:r?.variants[0]?.meta?.state||null}});return await Promise.all(o)}}function createStyleWrapper(e=``,t){return{for:(n,r)=>{let i=tt[r];if(!i)throw new et({context:{type:r}});return createStyleWrapper(`${e}${i}${n}`,t)},withPrefix:n=>createStyleWrapper([n,e].filter(Boolean).join(` `),t),withState:n=>createStyleWrapper((0,Ze.getSelectorWithState)(e,n),t),withMediaQuery:n=>{if(!n?.type)return createStyleWrapper(e,t);let r=`${n.type}:${n.width}px`;return createStyleWrapper(e,e=>`@media(${r}){${e}}`)},wrap:n=>{let r=`${e}{${n}}`;return t?t(r):r}}}async function propsToCss({props:e,resolve:t,signal:n}){let r=await t({props:e,signal:n});return Object.entries(r).reduce((e,[t,n])=>(n===null||e.push(t+`:`+n+`;`),e),[]).join(``)}function customCssToString(e){let t=(0,Y.decodeString)(e?.raw||``);return t.trim()?t+` | |
| 17 | +`:``}var rt=`.elementor`;function useStyleRenderer(e){let t=(0,Xe.useBreakpointsMap)();return(0,Ye.useMemo)(()=>createStylesRenderer({selectorPrefix:rt,breakpoints:t,resolve:e}),[e,t])}function useStyleItems(){let e=useStyleRenderer(useStylePropResolver()),t=(0,Fe.useBreakpoints)(),[n,r]=(0,Pe.useState)({}),i=(0,Pe.useRef)(new Map),a=(0,Pe.useMemo)(()=>{let createEmptyCache=()=>({orderedIds:[],itemsById:new Map}),getCache=e=>{let t=safeGetKey(e);return t?(i.current.has(t)||i.current.set(t,createEmptyCache()),i.current.get(t)):createEmptyCache()};return Le.stylesRepository.getProviders().map(t=>({provider:t,subscriber:createProviderSubscriber2({provider:t,renderStyles:e,setStyleItems:r,getCache:()=>getCache(t)})}))},[e]);(0,Pe.useEffect)(()=>{let e=a.map(({provider:e,subscriber:t})=>e.subscribe(t));return()=>{e.forEach(e=>e())}},[a]),useOnMount(()=>{(0,Re.registerDataHook)(`after`,`editor/documents/attach-preview`,async()=>{resetRemovedProviders();let e=a.map(async({subscriber:e})=>e());await Promise.all(e)})});let o=(0,Pe.useMemo)(()=>createBreakpointSorter(t.map(e=>e.id)),[t]);return(0,Pe.useMemo)(()=>Object.values(n).sort(prioritySorter).flatMap(({items:e})=>e).sort(stateSorter).sort(o),[n,o])}function prioritySorter({provider:e},{provider:t}){return e.priority-t.priority}function stateSorter({state:e},{state:t}){return(0,Ie.isClassState)(e)&&!(0,Ie.isClassState)(t)?-1:!(0,Ie.isClassState)(e)&&(0,Ie.isClassState)(t)?1:0}function createBreakpointSorter(e){return({breakpoint:t},{breakpoint:n})=>e.indexOf(t)-e.indexOf(n)}function safeGetKey(e){try{return e.getKey()}catch{return null}}function createProviderSubscriber2({provider:e,renderStyles:t,setStyleItems:n,getCache:r}){return abortPreviousRuns((t,i,a)=>signalizedProcess(t.signal).then((t,n)=>{let o=r(),s=a!==void 0&&i!==void 0,c=o.orderedIds.length>0;return c&&e.isPregeneratedLink&&removeProviderPregeneratedLinks(e.getKey(),e.isPregeneratedLink),s&&c?updateItems(o,i,a,n):createItems(o,n)}).then(t=>{n(n=>({...n,[e.getKey()]:{provider:e,items:t}}))}).execute());async function updateItems(n,r,i,a){let o=getChangedStyleIds(r,i);return n.orderedIds=e.actions.all().map(e=>e.id).reverse(),o.length>0?t({styles:breakToBreakpoints(o.map(t=>e.actions.get(t)).filter(e=>!!e).map(t=>({...t,cssName:e.actions.resolveCssName(t.id)}))),signal:a}).then(e=>(updateCacheItems(n,o,e),getOrderedItems(n))):getOrderedItems(n)}async function createItems(n,r){let i=e.actions.all();return t({styles:breakToBreakpoints([...i].reverse().map(t=>({...t,cssName:e.actions.resolveCssName(t.id)}))),signal:r}).then(e=>(rebuildCache(n,i,e),getOrderedItems(n)))}function breakToBreakpoints(e){return Object.values(e.reduce((e,t)=>(t.variants.forEach(n=>{let r=n.meta.breakpoint||`desktop`;e[t.id]||(e[t.id]={}),e[t.id][r]||(e[t.id][r]={...t,variants:[]}),e[t.id][r].variants.push(n)}),e),{})).flatMap(e=>Object.values(e))}}function getChangedStyleIds(e,t){let n=[];for(let r of Object.keys(t)){let i=t[r],a=e[r];(!a||i!==a)&&n.push(r)}return n}function getOrderedItems(e){return e.orderedIds.map(t=>e.itemsById.get(t)).filter(e=>e!==void 0).flat()}function updateCacheItems(e,t,n){for(let n of t)e.itemsById.delete(n);for(let t of n){let n=e.itemsById.get(t.id)||[];n.push(t),e.itemsById.set(t.id,n)}}function rebuildCache(e,t,n){e.orderedIds=t.map(e=>e.id).reverse(),e.itemsById.clear();for(let t of n){let n=e.itemsById.get(t.id)||[];n.push(t),e.itemsById.set(t.id,n)}}function StyleRenderer(){let e=usePortalContainer2(),t=useStyleItems(),n=useDocumentsCssLinks();return e?De.createElement(Oe.Portal,{container:e},filterUniqueStyleDefinitions(t).map(e=>De.createElement(`style`,{key:`${e.id}-${e.breakpoint}-${e.state??`normal`}`},e.value)),n.map(e=>De.createElement(`link`,{...e,key:e.id}))):null}function usePortalContainer2(){return(0,J.__privateUseListenTo)((0,J.commandEndEvent)(`editor/documents/attach-preview`),()=>(0,J.getCanvasIframeDocument)()?.head)}function filterUniqueStyleDefinitions(e){let t=new Map;return e.filter(e=>{let n=t.get(e.id);return n?n.find(t=>t.breakpoint===e.breakpoint&&t.state===e.state)?!1:(n.push(e),!0):(t.set(e.id,[e]),!0)})}var Q=globalThis.elementorV2.editorNotifications,it=globalThis.elementorV2.editorV1Adapters,at=globalThis.wp.i18n,ot=globalThis.elementorV2.editorElements,st=`e-form`,$=new Set([`e-form-input`,`e-form-textarea`,`e-form-label`,`e-form-checkbox`,`e-form-submit-button`,`e-form-select`,`e-form-radio-button`,`e-form-file-upload`,`e-form-date-picker`,`e-form-time-picker`]);function getArgsElementType(e){return e.model?.widgetType||e.model?.elType}function getElementType(e){return e?.model.get(`widgetType`)||e?.model.get(`elType`)}function getClipboardElementType(e){return e?.widgetType||e?.elType}function isElementWithinFormSelector(e){return!!e?.view?.el?.closest(`form,[data-element_type="e-form"]`)}function isWithinForm(e){return isElementWithinFormSelector(e)}function hasElementType(e,t){return(0,ot.getAllDescendants)(e).some(e=>getElementType(e)===t)}function hasElementTypes(e,t){return(0,ot.getAllDescendants)(e).some(e=>{let n=getElementType(e);return n?t.has(n):!1})}function hasClipboardElementType(e,t){return e.some(e=>getClipboardElementType(e)===t?!0:e.elements?hasClipboardElementType(e.elements,t):!1)}function hasClipboardElementTypes(e,t){return e.some(e=>{let n=getClipboardElementType(e);return n&&t.has(n)?!0:e.elements?hasClipboardElementTypes(e.elements,t):!1})}function movedContainersIncludeAtomicFormRoot(e){return e.some(e=>getElementType(e)===st)}function clipboardRootsAreAtomicForms(e){return e.length?e.every(e=>getClipboardElementType(e)===st):!1}var ct={type:`default`,message:(0,at.__)(`Form elements must be placed inside a form.`,`elementor`),id:`form-fields-outside-form-blocked`};function initFormAncestorEnforcement(){(0,it.blockCommand)({command:`document/elements/create`,condition:blockFormFieldCreate}),(0,it.blockCommand)({command:`document/elements/move`,condition:blockFormFieldMove}),(0,it.blockCommand)({command:`document/elements/paste`,condition:blockFormFieldPaste})}function blockFormFieldCreate(e){let t=getArgsElementType(e);return!t||!$.has(t)?!1:(e.containers??[e.container]).some(e=>!isWithinForm(e))?(handleBlockedFormField(),!0):!1}function blockFormFieldMove(e){let{containers:t=[e.container],target:n}=e;return t.some(e=>e?!hasElementType(e,st)&&hasElementTypes(e,$):!1)&&!isWithinForm(n)&&!movedContainersIncludeAtomicFormRoot(t)?(handleBlockedFormField(),!0):!1}function blockFormFieldPaste(e){let{storageType:t}=e;if(t!==`localstorage`)return!1;let n=window?.elementorCommon?.storage?.get();return n?.clipboard?.elements&&hasClipboardElementTypes(n.clipboard.elements,$)&&!isWithinForm(e.container)&&!clipboardRootsAreAtomicForms(n.clipboard.elements)?(handleBlockedFormField(),!0):!1}function handleBlockedFormField(){(0,Q.notify)(ct)}var lt=globalThis.elementorV2.editorNotifications,ut=globalThis.elementorV2.editorV1Adapters,dt={type:`default`,message:(0,globalThis.wp.i18n.__)(`Forms can't be nested. Create separate forms instead.`,`elementor`),id:`form-nesting-blocked`};function initFormNestingPrevention(){(0,ut.blockCommand)({command:`document/elements/create`,condition:blockFormCreate}),(0,ut.blockCommand)({command:`document/elements/move`,condition:blockFormMove}),(0,ut.blockCommand)({command:`document/elements/paste`,condition:blockFormPaste})}function blockFormCreate(e){let t=getArgsElementType(e);return t&&t===st&&isWithinForm(e.container)?(handleBlockedFormField2(),!0):!1}function blockFormMove(e){let{containers:t=[e.container],target:n}=e;return t.some(e=>e?hasElementType(e,st):!1)&&isWithinForm(n)?(handleBlockedFormField2(),!0):!1}function blockFormPaste(e){let{storageType:t}=e;if(t!==`localstorage`)return!1;let n=window?.elementorCommon?.storage?.get();return n?.clipboard?.elements&&hasClipboardElementType(n.clipboard.elements,st)&&isWithinForm(e.container)?(handleBlockedFormField2(),!0):!1}function handleBlockedFormField2(){(0,lt.notify)(dt)}var ft=createTransformersRegistry();function createTransformer(e){return e}var pt=createTransformer(()=>``),mt=globalThis.elementorV2.editorStylesRepository;function transformClassId(e,t){if(!t.has(e)){let n=mt.stylesRepository.getProviders().find(t=>t.actions.all().find(t=>t.id===e));if(!n)return e;t.set(e,n.getKey())}let n=t.get(e);return mt.stylesRepository.getProviderByKey(n)?.actions.resolveCssName(e)??e}function createClassesTransformer(){let e=new Map;return createTransformer(t=>t.map(t=>transformClassId(t,e)).filter(Boolean))}var ht=createTransformer(e=>!e||Object.keys(e).length===0?null:{min:e.min||null,max:e.max||null}),gt=createTransformer(e=>e.map(e=>{let t=(e.date||``).trim(),n=(e.time||``).trim();return!t&&!n?``:`${t} ${n}`.trim()}).join(` `)),_t=__toESM(Bt()),vt=[`href`,`target`,`class`,`id`,`style`,`title`,`lang`,`dir`,`role`];function getAllowedHtmlWrapperTags(){return window.elementorCommon?.config?.allowedHTMLWrapperTags??[]}function sanitizeEscapedHtml(e){if(!e)return``;let t=[...getAllowedHtmlWrapperTags()];return _t.default.sanitize(e,{ALLOWED_TAGS:t,ALLOWED_ATTR:[...vt],ALLOW_DATA_ATTR:!0,ALLOW_ARIA_ATTR:!0})}var yt=createTransformer(e=>sanitizeEscapedHtml(e)),bt=createTransformer(e=>e?.content??``),xt=createTransformer(e=>e?.content??``),St=createTransformer(({destination:e,isTargetBlank:t,tag:n})=>({href:typeof e==`number`?`#post-id-`+e:e,target:t?`_blank`:`_self`,tag:n??`a`})),Ct=createTransformer(({id:e})=>e??null),wt=createTransformer(e=>!e||Object.keys(e).length===0?null:{min:e.min||null,max:e.max||null}),Tt=__toESM(Bt()),Et=`width: 100%; height: 100%; overflow: unset;`;function processSvgContent(e){let t=Tt.default.sanitize(e,{USE_PROFILES:{svg:!0,svgFilters:!0}}),n=new DOMParser().parseFromString(t,`image/svg+xml`).querySelector(`svg`);if(!n)return null;n.setAttribute(`fill`,`currentColor`);let r=(n.getAttribute(`style`)??``).trim(),i=r?`${r.replace(/;$/,``)}; ${Et}`:Et;return n.setAttribute(`style`,i),n.outerHTML}var Dt={width:0,height:1,path:4},Ot=new Map,kt=createTransformer(async(e,{signal:t})=>{let n=typeof e.value==`string`?e.value:null,r=typeof e.library==`string`?e.library:null;if(!n||!r)return{html:null,url:null};let i=getFontAwesomeIconName(n),a=getFontAwesomeJsonFileName(r);if(!i||!a)return{html:null,url:null};let o=(await fetchFontAwesomeIcons(a,t))?.[i];return o?{html:processSvgContent(buildFontAwesomeSvg(o)),url:null}:{html:null,url:null}});function getFontAwesomeIconName(e){return e.match(/^fa\S*\s+fa-(.+)$/)?.[1]??null}function getFontAwesomeJsonFileName(e){return e.startsWith(`fa-`)?e.replace(/^fa-/,``):null}function getAssetsBaseUrl(){let e=window.elementorCommon?.config?.urls?.assets;return typeof e==`string`&&e!==``?e:null}async function fetchFontAwesomeIcons(e,t){let n=Ot.get(e);if(n)return n;let r=await loadFontAwesomeIcons(e,t);return r&&Ot.set(e,r),r}async function loadFontAwesomeIcons(e,t){let n=getAssetsBaseUrl();if(!n)return null;try{let r=await fetch(`${n}lib/font-awesome/json/${e}.json`,{signal:t});return r.ok?(await r.json()).icons??null:null}catch{return null}}function buildFontAwesomeSvg(e){return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${e[Dt.width]} ${e[Dt.height]}"><path d="${e[Dt.path]}"></path></svg>`}var At=createTransformer(e=>({id:e.id??null,url:e.url??null,alt:e.alt??null})),jt=globalThis.elementorV2.wpMedia,Mt=createTransformer(async e=>{let{src:t,size:n}=e;if(!t?.id)return t?.url?{src:t.url,alt:t.alt??``}:null;let r=await(0,jt.getMediaAttachment)({id:t.id}),i=r?.sizes?.[n??``];return i?{src:i.url,height:i.height,width:i.width,alt:r.alt}:r?{src:r.url,height:r.height,width:r.width,alt:r.alt}:null}),Nt=createTransformer(e=>e),Pt=globalThis.elementorV2.wpMedia;async function fetchSvgContent(e,t){try{let n=await fetch(e,{signal:t});if(!n.ok)return null;let r=n.headers.get(`content-type`)??``;return r.includes(`svg`)||r.includes(`xml`)||e.endsWith(`.svg`)?await n.text():null}catch{return null}}function resolveSvgSrcId(e){return typeof e!=`number`||e<=0?null:e}var Ft=createTransformer(async(e,{signal:t})=>{let n=resolveSvgSrcId(e.id),r=typeof e.url==`string`?e.url:null,i=r;n&&!r&&(i=(await(0,Pt.getMediaAttachment)({id:n}))?.url??null);let a=typeof i==`string`?i:null;if(!a)return{html:null,url:null};let o=await fetchSvgContent(a,t);return{html:o?processSvgContent(o):null,url:a}}),It=globalThis.elementorV2.wpMedia,Lt=createTransformer(async e=>{let{id:t,url:n}=e;return t?{id:t,url:(await(0,It.getMediaAttachment)({id:t}))?.url??n}:{id:null,url:n}});function initSettingsTransformers(){ft.register(`classes`,createClassesTransformer()).register(`link`,St).register(`query`,Ct).register(`image`,Mt).register(`image-src`,At).register(`svg-src`,Ft).register(`icon`,kt).register(`video-src`,Lt).register(`attributes`,pt).register(`date-time`,gt).register(`html-v2`,bt).register(`html-v3`,xt).register(`escaped-html`,yt).register(`date-range`,ht).register(`time-range`,wt).registerFallback(Nt)}var Rt=createTransformer(e=>{let{color:t=null}=e;return t?`linear-gradient(${t}, ${t})`:null}),Ht=createTransformer(e=>e.type===`radial`?`radial-gradient(circle at ${e.positions}, ${e.stops})`:`linear-gradient(${e.angle}deg, ${e.stops})`),Ut=createTransformer(e=>{let{image:t,size:n=null,position:r=null,repeat:i=null,attachment:a=null}=e;return t?{src:t.src?`url(${t.src})`:null,repeat:i,attachment:a,size:n,position:r}:null}),Wt=createTransformer(({width:e,height:t})=>`${e??`auto`} ${t??`auto`}`),Gt=createTransformer(e=>{if(!e||e.length===0)return null;let t=normalizeOverlayValues(e);return t.length===0?null:{"background-image":getValuesString(t,`src`,`none`,!0),"background-repeat":getValuesString(t,`repeat`,`repeat`),"background-attachment":getValuesString(t,`attachment`,`scroll`),"background-size":getValuesString(t,`size`,`auto auto`),"background-position":getValuesString(t,`position`,`0% 0%`)}});function normalizeOverlayValues(e){return e.map(e=>typeof e==`string`?{src:e,repeat:null,attachment:null,size:null,position:null}:e).filter(e=>e&&!!e.src)}function getValuesString(e,t,n,r=!1){if(e.filter(e=>e?.[t]).length===0)return n;let i=e.map(e=>e[t]??n);return!r&&i.every(e=>e===i[0])?i[0]:i.join(`,`)}var Kt=createTransformer(e=>{let{color:t=null,"background-overlay":n=null,clip:r=null}=e;return createMultiPropsValue({...n,"background-color":t,"background-clip":r})}),qt=createTransformer(e=>`${e?.color} ${e?.offset??0}%`),createCombineArrayTransformer=e=>createTransformer(t=>t?.length?t.filter(Boolean).join(e):null),createMultiPropsTransformer=(e,t)=>createTransformer((n,{key:r})=>{let i=e.filter(e=>n[e]).map(e=>[t({propKey:r,key:e}),n[e]]);return createMultiPropsValue(Object.fromEntries(i))}),Jt=createTransformer(e=>e?.length<1?null:e.filter(Boolean).map(mapToFilterFunctionString).join(` `)),mapToFilterFunctionString=e=>{if(e.func===`drop-shadow`){let{xAxis:t,yAxis:n,blur:r,color:i}=e.args;return`drop-shadow(${t||`0px`} ${n||`0px`} ${r||`10px`} ${i||`transparent`})`}let t=e.args?.size;return!e.func||!t?``:`${e.func}(${t})`},Yt=0,Xt=1,Zt=`auto`,formatBasis=e=>typeof e==`object`&&e.size!==void 0?`${e.size}${e.unit||``}`:e,Qt=createTransformer(e=>{let t=e.flexGrow,n=e.flexShrink,r=e.flexBasis,i=t!=null,a=n!=null,o=r!=null;return!i&&!a&&!o?null:`${i?t:Yt} ${a?n:Xt} ${o?formatBasis(r):Zt}`}),$t=createTransformer(e=>{if(typeof e!=`string`||!e.trim())return null;let t=e.trim();return t.startsWith(`"`)&&t.endsWith(`"`)||t.startsWith(`'`)&&t.endsWith(`'`)?t:`"${t}"`}),en=new Set([`grid-template-columns`,`grid-template-rows`]),isGridTrackProperty=e=>en.has(e),formatGridTrackRepeat=e=>!Number.isFinite(e)||e<1?null:`repeat(${e}, 1fr)`,tn=createTransformer(e=>e.unit===`custom`?e.size:e.unit===`fr`?formatGridTrackRepeat(Math.trunc(Number(e.size))):`${e.size}${e.unit}`),nn=`0px`;function getVal(e){return`${e??nn}`}var rn=createTransformer(e=>`${getVal(e?.x)} ${getVal(e?.y)}`),an=createTransformer(({x:e,y:t})=>`${e??`0px`} ${t??`0px`}`),on=createTransformer(e=>[e.hOffset,e.vOffset,e.blur,e.spread,e.color,e.position].filter(Boolean).join(` `)),sn=createTransformer(e=>e.unit===`auto`?`auto`:e.unit===`custom`?e.size:`${e.size}${e.unit}`),cn=createTransformer(e=>e?.trim()||null),ln=createTransformer(e=>createMultiPropsValue({"-webkit-text-stroke":`${e.width} ${e.color}`,stroke:`${e.color}`,"stroke-width":`${e.width}`})),un=createTransformer(e=>e?.length<1?null:e.join(` `)),dn=`0px`,pn=createTransformer(e=>`translate3d(${e.x??dn}, ${e.y??dn}, ${e.z??dn})`),mn=`0px`,hn=`50%`,gn=mn;function getVal2(e){return`${e??mn}`}var _n=createTransformer(e=>{let t=getVal2(e.x),n=getVal2(e.y),r=getVal2(e.z);return t===hn&&n===hn&&r===gn?null:`${t} ${n} ${r}`}),vn=`0deg`,yn=createTransformer(e=>[`rotateX(${e?.x??vn})`,`rotateY(${e?.y??vn})`,`rotateZ(${e?.z??vn})`].join(` `)),bn=createTransformer(e=>`scale3d(${e.x??1}, ${e.y??1}, ${e.z??1})`),xn=`0deg`,Sn=createTransformer(e=>`skew(${e?.x??xn}, ${e?.y??xn})`),Cn=globalThis.elementorV2.editorControls,getAllowedProperties=()=>{let e=new Set;return Cn.transitionProperties.forEach(t=>{t.properties.forEach(t=>{e.add(t.value)})}),e},wn=createTransformer(e=>{if(e?.length<1)return null;let t=getAllowedProperties(),n=e.map(e=>mapToTransitionString(e,t)).filter(Boolean);return n.length===0?null:n.join(`, `)}),mapToTransitionString=(e,t)=>{if(!e.selection||!e.size)return``;let n=e.selection.value;return t.has(n)?`${n} ${e.size}`:``};function initStyleTransformers(){Je.register(`font-family`,$t).register(`size`,sn).register(`grid-track-size`,tn).register(`shadow`,on).register(`stroke`,ln).register(`dimensions`,createMultiPropsTransformer([`block-start`,`block-end`,`inline-start`,`inline-end`],({propKey:e,key:t})=>`${e}-${t}`)).register(`filter`,Jt).register(`backdrop-filter`,Jt).register(`box-shadow`,createCombineArrayTransformer(`,`)).register(`background`,Kt).register(`background-overlay`,Gt).register(`background-color-overlay`,Rt).register(`background-image-overlay`,Ut).register(`background-gradient-overlay`,Ht).register(`gradient-color-stop`,createCombineArrayTransformer(`,`)).register(`color-stop`,qt).register(`background-image-position-offset`,an).register(`background-image-size-scale`,Wt).register(`image-src`,At).register(`image`,Mt).register(`object-position`,an).register(`span`,cn).register(`transform-origin`,_n).register(`perspective-origin`,rn).register(`transform-move`,pn).register(`transform-scale`,bn).register(`transform-rotate`,yn).register(`transform-skew`,Sn).register(`transform-functions`,un).register(`transform`,createMultiPropsTransformer([`transform-functions`,`transform-origin`,`perspective`,`perspective-origin`],({key:e})=>e===`transform-functions`?`transform`:e)).register(`transition`,wn).register(`layout-direction`,createMultiPropsTransformer([`row`,`column`],({propKey:e,key:t})=>`${t}-${e}`)).register(`flex`,Qt).register(`border-width-v2`,createMultiPropsTransformer([`block-start`,`block-end`,`inline-start`,`inline-end`],({key:e})=>`border-${e}-width`)).register(`border-radius-v2`,createMultiPropsTransformer([`start-start`,`start-end`,`end-start`,`end-end`],({key:e})=>`border-${e}-radius`)).registerFallback(Nt)}var Tn=globalThis.elementorV2.editorElements,En=globalThis.elementorV2.editorV1Adapters,Dn=globalThis.elementorV2.twing;function createDomRenderer(){let e=(0,Dn.createArrayLoader)({}),t=(0,Dn.createEnvironment)(e);return t.registerEscapingStrategy(escapeHtmlTag,`html_tag`),t.registerEscapingStrategy(escapeURL,`full_url`),{register:e.setTemplate,render:t.render}}function getAllowedHtmlWrapperTags2(){return window.elementorCommon?.config?.allowedHTMLWrapperTags??[]}function escapeHtmlTag(e){let t=getAllowedHtmlWrapperTags2(),n=e?.toLowerCase?.()??``;return t.includes(n)?e:`div`}function escapeURL(e){let t=[`http:`,`https:`,`mailto:`,`tel:`];try{let n=new URL(e);return t.includes(n.protocol)?e:``}catch{return``}}function createElementType(e){let t=window;return class extends t.elementor.modules.elements.types.Widget{getType(){return e}getView(){return createElementViewClassDeclaration()}}}function createElementViewClassDeclaration(){let e=window;return class extends e.elementor.modules.elements.views.Widget{onRender(...e){super.onRender(...e),this.#e(`elementor/preview/atomic-widget/render`),this.#t(`elementor/element/render`)}onDestroy(...e){super.onDestroy(...e),this.#e(`elementor/preview/atomic-widget/destroy`),this.#t(`elementor/element/destroy`)}attributes(){return{...super.attributes(),"data-atomic":``,style:`display: contents !important;`}}behaviors(){let e=[`InlineEditing`,`Draggable`,`Resizable`],t=Object.entries(super.behaviors()).filter(([t])=>!e.includes(t));return Object.fromEntries(t)}getDomElement(){return this.$el.find(`:first-child`)}getHandlesOverlay(){return null}#e(e){window.top?.dispatchEvent(new CustomEvent(e,{detail:{id:this.model.get(`id`)}}))}#t(t){let n=this.getDomElement().get(0);n&&e.elementor?.$preview?.[0]?.contentWindow.dispatchEvent(new CustomEvent(t,{detail:{id:this.model.get(`id`),type:this.model.get(`widgetType`),element:n}}))}getContextMenuGroups(){return super.getContextMenuGroups().filter(e=>e.name!==`save`)}}}var On=globalThis.elementorV2.editorElements,kn=`a`;function computeHtmlTag(e,t,n={}){if((n.followLink??!0)&&settingsHaveActiveLink(e)){let t=e.link;return extractLinkHtmlTag(isRecord(t)?t:{})}let r=extractHtmlTagValue(e.tag);return r!==null&&r!==``?r:t}function settingsHaveActiveLink(e){let t=e.link;if(!isRecord(t))return!1;let n=extractHtmlTagValue(t.href);if(n!==null&&n!==``)return!0;let r=t.attributes;return typeof r==`string`&&r!==``}function extractLinkHtmlTag(e){let t=extractHtmlTagValue(e.tag);return t!==null&&t!==``?t:kn}function extractHtmlTagValue(e){return isRecord(e)&&typeof e.value==`string`?e.value:typeof e==`string`?e:null}function isRecord(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var An=globalThis.elementorV2.editorElements;function createPendingElement(e,t,n={}){let r=e.getContainer(),i={...t};if(i.id||=(0,An.generateElementId)(),i.elements||=[],!(0,An.addModelToParent)(r.id,i,n))return;let a=i.id,o=(0,An.findModelInDocument)(a);if(!o)return;let s={id:a,settings:{get:()=>({}),set:()=>({}),toJSON:()=>({})},parent:r,model:o,view:void 0,lookup(){return(0,An.getContainer)(a)??s}};return e.once(`render`,()=>{e.model?.trigger?.(`navigator:add`,o,n)}),n.edit!==!1&&selectChildWhenWrapperRenders(e,a),{getContainer:()=>s}}function selectChildWhenWrapperRenders(e,t){e.once(`render`,()=>{let n=(0,An.getContainer)(t);if(n?.model?.trigger){n.model.trigger(`request:edit`);return}e.model?.trigger?.(`request:edit`)})}function setupTwigRenderer({renderer:e,element:t}){let n=t.twig_main_template,r=t.base_styles_dictionary;return Object.entries(t.twig_templates).forEach(([t,n])=>{e.register(t,n)}),{templateKey:n,baseStylesDictionary:r,resolveProps:createPropsResolver({transformers:ft,schema:t.atomic_props_schema}),defaultHtmlTag:t.default_html_tag??`div`,htmlTagFollowsLink:t.html_tag_follows_link??!0}}function createBeforeRender(e){e._ensureViewIsIntact(),e._isRendering=!0,e.resetChildViewContainer(),e.triggerMethod(`before:render`,e)}function createAfterRender(e){e._isRendering=!1,e.isRendered=!0,e.triggerMethod(`render`,e)}function rerenderExistingChildren(e){e.children?.each(e=>{e.render()})}async function waitForChildrenToComplete(e){let t=[];e.children?.each(e=>{e._currentRenderPromise&&t.push(e._currentRenderPromise)}),t.length>0&&await Promise.all(t)}function canBeTemplated(e){return!!(e.atomic_props_schema&&e.twig_templates&&e.twig_main_template&&e.base_styles_dictionary)}function createTemplatedElementView({type:e,renderer:t,element:n}){let r=createElementViewClassDeclaration(),{templateKey:i,baseStylesDictionary:a,resolveProps:o,defaultHtmlTag:s,htmlTagFollowsLink:c}=setupTwigRenderer({type:e,renderer:t,element:n});return class extends r{_abortController=null;_lastResolvedSettingsHash=null;_domUpdateWasSkipped=!1;getTemplateType(){return`twig`}getNamespaceKey(){return e}renderOnChange(){this.render()}getRenderContext(){return this._parent?.getRenderContext?.()}getResolverRenderContext(){return this._parent?.getResolverRenderContext?.()}invalidateRenderCache(){this._lastResolvedSettingsHash=null}render(){this._abortController?.abort(),this._abortController=new AbortController;let e=signalizedProcess(this._abortController.signal).then(()=>this._beforeRender()).then(()=>this._renderTemplate()).then(()=>this._renderChildren()).then(()=>this._afterRender());return this._currentRenderPromise=e.execute(),this._currentRenderPromise}async _renderChildren(){this._shouldReuseChildren()?rerenderExistingChildren(this):super._renderChildren(),await waitForChildrenToComplete(this)}_shouldReuseChildren(){return this._domUpdateWasSkipped&&this.children?.length>0}async _renderTemplate(){this.triggerMethod(`before:render:template`),await signalizedProcess(this._abortController?.signal).then((e,t)=>{let n=this.model.get(`settings`).toJSON();return o({props:n,signal:t,renderContext:this.getResolverRenderContext()})}).then(e=>this.afterSettingsResolve(e)).then(async n=>{let r=JSON.stringify(n);if(r===this._lastResolvedSettingsHash&&this.isRendered)return this._domUpdateWasSkipped=!0,null;this._domUpdateWasSkipped=!1,this._lastResolvedSettingsHash=r;let o={id:this.model.get(`id`),interaction_id:this.getInteractionId(),type:e,settings:n,tag:computeHtmlTag(n,s,{followLink:c}),base_styles:a,...this.getResolverRenderContext?.()??{}};return t.render(i,o)}).then(e=>{e!==null&&this.$el.html(e)}).execute(),this.bindUIElements(),this.triggerMethod(`render:template`)}afterSettingsResolve(e){return e}_beforeRender(){createBeforeRender(this)}_afterRender(){createAfterRender(this)}_doAfterRender(e){this.isRendered?e():this.once(`render`,e)}_openEditingPanel(e){this._doAfterRender(()=>super._openEditingPanel(e))}getInteractionId(){let e=this.model.get(`originId`),t=this.model.get(`id`);return e??t}}}var jn=Symbol(`styles-reference-untracked`);function canBeNestedTemplated(e){return canBeTemplated(e)&&`support_nesting`in e&&!!e.support_nesting}function createNestedTemplatedElementType({type:e,renderer:t,element:n,modelExtensions:r}){let i=window;return class extends i.elementor.modules.elements.types.Base{getType(){return e}getView(){return createNestedTemplatedElementView({type:e,renderer:t,element:n})}getModel(){let e=i.elementor.modules.elements.models.AtomicElementBase;return r&&Object.keys(r).length>0?e.extend(r):e}}}function buildEditorAttributes(e){let t=e.get(`id`),n=e.get(`originId`),r={"data-model-cid":e.cid??``,"data-interaction-id":n??t,"x-ignore":`true`};return Object.entries(r).map(([e,t])=>`${e}="${t}"`).join(` `)}function buildEditorClasses(e){return[`elementor-element`,`elementor-element-edit-mode`,`elementor-element-${e.get(`id`)}`].join(` `)}function createNestedTemplatedElementView({type:e,renderer:t,element:n}){let r=window,{templateKey:i,baseStylesDictionary:a,resolveProps:o,defaultHtmlTag:s,htmlTagFollowsLink:c}=setupTwigRenderer({type:e,renderer:t,element:n}),l=r.elementor.modules.elements.views.createAtomicElementBase(e),u=l.prototype._renderChildren,d=l.prototype._openEditingPanel,f=l.prototype.addElement;return l.extend({_abortController:null,_lastResolvedSettingsHash:null,_lastRenderedStyles:jn,_domUpdateWasSkipped:!1,template:!1,attributes(){return{"data-model-cid":this.model.cid}},getTemplateType(){return`twig`},invalidateRenderCache(){this._lastResolvedSettingsHash=null},renderOnChange(){this.render()},render(){this._abortController?.abort(),this._abortController=new AbortController;let e=signalizedProcess(this._abortController.signal).then(()=>this._beforeRender()).then(()=>this._renderTemplate()).then(()=>this._onTemplateReady()).then(()=>this._renderChildren()).then(()=>this._afterRender());return this._currentRenderPromise=e.execute(),this._currentRenderPromise},_beforeRender(){createBeforeRender(this)},_onTemplateReady(){this.dispatchPreviewEvent(`elementor/element/render`)},_afterRender(){createAfterRender(this),this.dispatchPreviewEvent(`elementor/element/rendered`),requestAnimationFrame(()=>{this._initAlpine()}),this.model.trigger(`render:complete`),this._notifyStylesChanged()},_notifyStylesChanged(){let e=this.model.get(`styles`);(this._lastRenderedStyles===jn||e!==this._lastRenderedStyles)&&(this._lastRenderedStyles=e,window.dispatchEvent(new CustomEvent(On.ELEMENT_STYLE_CHANGE_EVENT)))},async _renderTemplate(){let n=this.model;this.triggerMethod(`before:render:template`),await signalizedProcess(this._abortController?.signal).then((e,t)=>{let r=n.get(`settings`).toJSON();return o({props:r,signal:t,renderContext:this.getResolverRenderContext?.()})}).then(async r=>{let o=this.afterSettingsResolve(r),l=JSON.stringify(o);if(l===this._lastResolvedSettingsHash&&this.isRendered)return this._domUpdateWasSkipped=!0,null;this._domUpdateWasSkipped=!1,this._lastResolvedSettingsHash=l;let u={id:n.get(`id`),interaction_id:this.getInteractionId(),type:e,settings:o,tag:computeHtmlTag(o,s,{followLink:c}),base_styles:a,editor_attributes:buildEditorAttributes(n),editor_classes:buildEditorClasses(n),...this.getResolverRenderContext?.()??{}};return t.render(i,u)}).then(e=>{e!==null&&this._attachTwigContent(e)}).execute(),this.bindUIElements(),this.triggerMethod(`render:template`)},afterSettingsResolve(e){return e},getRenderContext(){return this._parent?.getRenderContext?.()},getResolverRenderContext(){return this._parent?.getResolverRenderContext?.()},getChildType(){let e=n.allowed_child_types??[];return e&&e.length>0?e:l.prototype.getChildType.call(this)},_attachTwigContent(e){let t=r.jQuery(e),n=this.$el.get(0),i=t.get(0);if(!n||!i)return;this._destroyAlpine();let a=this.getHandlesOverlay()?.get(0)?.outerHTML??``,o=n.tagName!==i.tagName,s=o?(n.ownerDocument??document).createElement(i.tagName):n;Array.from(i.attributes).forEach(e=>{s.setAttribute(e.name,e.value)}),s.innerHTML=a+i.innerHTML,o&&(n.replaceWith(s),this.setElement(r.jQuery(s)))},async _renderChildren(){this._shouldReuseChildren()?rerenderExistingChildren(this):u.call(this),await waitForChildrenToComplete(this),this._removeChildrenPlaceholder()},_shouldReuseChildren(){return this._domUpdateWasSkipped&&this.children?.length>0},_removeChildrenPlaceholder(){let e=this.$el.get(0);e&&Array.from(e.childNodes).find(e=>e.nodeType===Node.COMMENT_NODE&&e.nodeValue?.trim()===`elementor-children-placeholder`)?.remove()},getChildViewContainer(){return this.childViewContainer=``,this.$el},attachBuffer(e,t){let n=this.$el.get(0);if(!n)return;let r=Array.from(n.childNodes).find(e=>e.nodeType===Node.COMMENT_NODE&&e.nodeValue?.trim()===`elementor-children-placeholder`);r?(r.parentNode?.insertBefore(t,r),r.remove()):n.append(t)},getDomElement(){return this.$el},onBeforeDestroy(){this._abortController?.abort()},onDestroy(){this.dispatchPreviewEvent(`elementor/element/destroy`)},_destroyAlpine(){let e=this.$el.get(0);e&&e.getAttribute(`x-data`)&&(e.ownerDocument?.defaultView)?.Alpine?.destroyTree(e)},_initAlpine(){let e=this.$el.get(0);e&&(e.removeAttribute(`x-ignore`),e.getAttribute(`x-data`)&&(e.ownerDocument?.defaultView)?.Alpine?.initTree(e))},_doAfterRender(e){this.isRendered?e():this.once(`render`,e)},_openEditingPanel(e){this._doAfterRender(()=>d.call(this,e))},addElement(e,t){return this.isRendered?f.call(this,e,t):createPendingElement(this,e,t)},getInteractionId(){let e=this.model.get(`originId`),t=this.model.get(`id`);return e??t}})}function createProPromotionNestedType({type:e,renderer:t,element:n}){if(!canBeNestedTemplated(n))throw Error(`Element "${e}" is not a valid nested templated element.`);let r=createNestedTemplatedElementType({type:e,renderer:t,element:n}),i=null;return class extends r{getView(){return i||=createPromotionView(new r().getView()),i}}}function createPromotionView(e){return class extends e{_afterRender(){super._afterRender();let e=`.e-pro-promotion-placeholder__remove-btn`,t=`.e-pro-promotion-placeholder__unlock-btn`;this.$el.off(`click`,e),this.$el.on(`click`,e,e=>{e.preventDefault(),e.stopPropagation(),window.$e.run(`document/elements/delete`,{container:this.container})}),this.$el.off(`click`,t),this.$el.on(`click`,t,e=>{e.stopPropagation()})}async _renderChildren(){}behaviors(){let e=[`InlineEditing`,`Draggable`,`Resizable`],t=Object.entries(super.behaviors()).filter(([t])=>!e.includes(t));return Object.fromEntries(t)}getContextMenuGroups(){return super.getContextMenuGroups().filter(e=>e.name!==`save`)}onDestroy(...e){super.onDestroy(...e),this.$el.off(`click`,`.e-pro-promotion-placeholder__remove-btn`),this.$el.off(`click`,`.e-pro-promotion-placeholder__unlock-btn`)}}}var Mn=Vt(),Nn=__toESM(globalThis.React),Pn=globalThis.elementorV2.editorElements,Fn=globalThis.elementorV2.editorProps,In=globalThis.elementorV2.editorV1Adapters,Ln=globalThis.wp.i18n,Rn={before:`before`,after:`after`,never:`never`},ReplacementBase=class{getSetting;setSetting;element;type;id;refreshView;reactRoot;reactContainer;constructor(e){this.getSetting=e.getSetting,this.setSetting=e.setSetting,this.element=e.element,this.type=e.type,this.id=e.id,this.refreshView=e.refreshView,this.reactRoot=e.reactRoot,this.reactContainer=e.reactContainer}static getTypes(){return null}shouldRenderReplacement(){return!0}originalMethodsToTrigger(){return{_beforeRender:Rn.before,_afterRender:Rn.after,renderOnChange:Rn.never,onDestroy:Rn.never,render:Rn.never}}},zn=__toESM(globalThis.React),Bn=globalThis.React,Vn=globalThis.elementorV2.editorControls,Hn=globalThis.elementorV2.ui,Un=(zt(),__toCommonJS(Qe)),Wn=globalThis.React,Gn=[`#elementor-editor-wrapper-v2`,`#elementor-navigator`,`#elementor-panel`],Kn=`inline-editing-toolbar-anchor`,qn={backgroundColor:`transparent`,border:`none`,outline:`none`,boxShadow:`none`,padding:`0`,margin:`0`,borderRadius:`0`,overflow:`hidden`,opacity:`0`,pointerEvents:`none`,position:`absolute`,display:`block`},Jn={"e-button":`text`,"e-form-label":`text`,"e-heading":`title`,"e-paragraph":`paragraph`,"e-form-submit-button":`text`},getInlineEditorElement=(e,t)=>t?e.querySelector(t):null,useOnClickOutsideIframe=e=>{let t=(0,Wn.useCallback)(()=>queueMicrotask(e),[e]);(0,Wn.useEffect)(()=>(Gn.forEach(e=>document?.querySelector(e)?.addEventListener(`mousedown`,t)),()=>Gn.forEach(e=>document?.querySelector(e)?.removeEventListener(`mousedown`,t))),[])},useRenderToolbar=(e,t)=>{let[n,r]=(0,Wn.useState)(null);(0,Wn.useEffect)(()=>{n||removeToolbarAnchor(e,t)},[n,e,t]);let onSelectionEnd=n=>{let i=!n.state.selection.empty;removeToolbarAnchor(e,t),r(i?createAnchorBasedOnSelection(e,t):null)};return{onSelectionEnd,anchor:n,clearAnchor:(0,Wn.useCallback)(()=>{r(null)},[])}},createAnchorBasedOnSelection=(e,t)=>{let n=e.defaultView?.getSelection();if(!n)return null;let r=n.getRangeAt(0).getBoundingClientRect(),i=e.body.getBoundingClientRect(),a=e.createElement(`span`);return styleToolbarAnchor(a,r,i),a.setAttribute(`id`,getToolbarAnchorId(t)),e.body.appendChild(a),a},removeToolbarAnchor=(e,t)=>{let n=getToolbarAnchor(e,t);n&&e.body.removeChild(n)},getToolbarAnchorId=e=>`${Kn}-${e}`,getToolbarAnchor=(e,t)=>e.getElementById(getToolbarAnchorId(t)),styleToolbarAnchor=(e,t,n)=>{let{width:r,height:i}=t;Object.assign(e.style,{...qn,top:`${t.top-n.top}px`,left:`${t.left-n.left}px`,width:`${r}px`,height:`${i}px`})},Yn={name:`horizontalShifter`,fn(e){let{x:t,y:n,elements:{reference:r,floating:i}}=e,a={...e,x:t,y:n};if(t<0)return a.x=0,a;let o=r.getBoundingClientRect(),s=t+i.offsetWidth,c=r.ownerDocument.body.offsetWidth;return s>c&&o.right<s&&(a.x=t-(s-c)),a}},CanvasInlineEditor=({elementClasses:e,initialValue:t,expectedTag:n,rootElement:r,contentElement:i,id:a,setValue:o,requestDestroy:s})=>{let[c,l]=(0,Bn.useState)(!0),[u,d]=(0,Bn.useState)(null),{onSelectionEnd:f,anchor:p,clearAnchor:m}=useRenderToolbar(r.ownerDocument,a);(0,Bn.useEffect)(()=>{c||(m(),s())},[c,m,s]);let h=(0,Bn.useCallback)(()=>{d(null),l(!1)},[]);return useOnClickOutsideIframe(h),(0,Bn.useEffect)(()=>{let e=i.ownerDocument,handleClickAway=e=>{i.contains(e.target)||h()};return e.addEventListener(`mousedown`,handleClickAway),()=>e.removeEventListener(`mousedown`,handleClickAway)},[i,h]),c?zn.createElement(Hn.ThemeProvider,null,zn.createElement(InlineEditingOverlay,{expectedTag:n,rootElement:r,id:a}),zn.createElement(Vn.InlineEditor,{onEditorCreate:d,mountElement:i,editorProps:{attributes:{style:`outline: none; display: inherit; justify-content: inherit; align-items: inherit; flex-direction: inherit; text-align: inherit;`}},elementClasses:e,value:t,setValue:o,onBlur:h,autofocus:!0,onSelectionEnd:f}),p&&u&&zn.createElement(InlineEditingToolbar,{anchor:p,editor:u,id:a})):null},InlineEditingOverlay=({expectedTag:e,rootElement:t,id:n})=>{let r=getInlineEditorElement(t,e),[i,a]=(0,Bn.useState)(r);return(0,Bn.useEffect)(()=>{a(getInlineEditorElement(t,e))},[e,t]),i?zn.createElement(OutlineOverlay,{element:i,id:n,isSelected:!0}):null},InlineEditingToolbar=({anchor:e,editor:t,id:n})=>{let{refs:r,floatingStyles:i}=(0,Un.useFloating)({placement:`top`,strategy:`fixed`,transform:!1,whileElementsMounted:Un.autoUpdate,middleware:[Yn,(0,Un.flip)()]});return(0,Bn.useLayoutEffect)(()=>(r.setReference(e),()=>r.setReference(null)),[e,r]),zn.createElement(Un.FloatingPortal,{id:H},zn.createElement(Hn.Box,{ref:r.setFloating,role:`presentation`,style:{...i,pointerEvents:`none`}},zn.createElement(Vn.InlineEditorToolbar,{editor:t,elementId:n})))},Xn=globalThis.elementorV2.editorProps,hasKey=e=>`key`in e,Zn=new Set([Xn.escapedHtmlPropTypeUtil.key,Xn.htmlV3PropTypeUtil.key,Xn.stringPropTypeUtil.key]),isCoreTextPropTypeKey=e=>Zn.has(e),isAllowedBySchema=e=>e?hasKey(e)&&isCoreTextPropTypeKey(e.key)?!0:e.kind===`union`&&[...Zn].some(t=>e.prop_types[t]):!1,isInlineEditingAllowed=({rawValue:e,propTypeFromSchema:t})=>e==null?isAllowedBySchema(t):Xn.escapedHtmlPropTypeUtil.isValid(e)||Xn.htmlV3PropTypeUtil.isValid(e)||Xn.stringPropTypeUtil.isValid(e),Qn=800,InlineEditingReplacement=class extends ReplacementBase{handlerAttached=!1;editing=!1;getReplacementKey(){return`inline-editing`}static getTypes(){return Object.keys(Jn)}isEditingModeActive(){return this.editing}shouldRenderReplacement(){return this.isInlineEditingEligible()&&(0,In.getCurrentEditMode)()===`edit`}handleRenderInlineEditor=()=>{this.isEditingModeActive()||!this.isInlineEditingEligible()||this.renderInlineEditor()};renderOnChange(){this.isEditingModeActive()||this.refreshView()}onDestroy(){this.resetInlineEditorRoot()}_beforeRender(){this.resetInlineEditorRoot()}_afterRender(){this.isInlineEditingEligible()&&!this.handlerAttached&&(this.element.addEventListener(`click`,this.handleRenderInlineEditor),this.handlerAttached=!0)}originalMethodsToTrigger(){let e=this.isEditingModeActive()?Rn.never:Rn.before,t=this.isEditingModeActive()?Rn.never:Rn.after;return{_beforeRender:e,_afterRender:t,renderOnChange:t,onDestroy:Rn.after,render:e}}resetInlineEditorRoot(){this.element.removeEventListener(`click`,this.handleRenderInlineEditor),this.handlerAttached=!1,this.reactRoot.render(null),this.editing=!1}unmountInlineEditor(){this.resetInlineEditorRoot(),this.refreshView()}isInlineEditingEligible(){let e=this.getInlineEditablePropertyName();return isInlineEditingAllowed({rawValue:this.getSetting(e),propTypeFromSchema:this.getInlineEditablePropType()})}getInlineEditablePropertyName(){return Jn[this.type]??``}getInlineEditablePropType(){let e=(0,Pn.getElementType)(this.type)?.propsSchema,t=this.getInlineEditablePropertyName();return e?.[t]??null}getInlineEditablePropValue(){let e=this.getInlineEditablePropType(),t=this.getInlineEditablePropertyName();return this.getSetting(t)??e?.default??null}getExtractedContentValue(){let e=this.getInlineEditablePropValue();if(Fn.escapedHtmlPropTypeUtil.isValid(e))return Fn.escapedHtmlPropTypeUtil.extract(e)??``;let t=Fn.htmlV3PropTypeUtil.extract(e);return Fn.stringPropTypeUtil.extract(t?.content??null)??``}createContentPropValue(e){let t=e||``;return this.getInlineEditablePropTypeKey()===Fn.htmlV3PropTypeUtil.key?Fn.htmlV3PropTypeUtil.create({content:Fn.stringPropTypeUtil.create(t),children:[]}):Fn.escapedHtmlPropTypeUtil.create(t)}setContentValue(e){let t=this.getInlineEditablePropertyName(),n=this.createContentPropValue(e);(0,In.undoable)({do:()=>{let e=this.getInlineEditablePropValue();return this.runCommand(t,n),e},undo:(e,n)=>{this.runCommand(t,n??null)}},{title:(0,Pn.getElementLabel)(this.id),subtitle:(0,Ln.__)(`%s edited`,`elementor`).replace(`%s`,this.getInlineEditablePropTypeKey()??`Inline editing`),debounce:{wait:Qn}})()}getInlineEditablePropTypeKey(){let e=this.getInlineEditablePropType();if(!e)return null;if(e.kind===`union`){let t=[Fn.escapedHtmlPropTypeUtil.key,Fn.htmlV3PropTypeUtil.key,Fn.stringPropTypeUtil.key];for(let n of t)if(e.prop_types[n])return n;return null}return`key`in e&&typeof e.key==`string`?e.key:null}runCommand(e,t){(0,In.__privateRunCommandSync)(`document/elements/set-settings`,{container:(0,Pn.getContainer)(this.id),settings:{[e]:t}},{internal:!0}),(0,In.__privateRunCommandSync)(`document/save/set-is-modified`,{status:!0},{internal:!0})}getExpectedTag(){let e=this.getTagPropType();return Fn.stringPropTypeUtil.extract(this.getSetting(`tag`)??null)??Fn.stringPropTypeUtil.extract(e?.default??null)??null}getTagPropType(){let e=(0,Pn.getElementType)(this.type)?.propsSchema;if(!e?.tag)return null;let t=e.tag??null;return t.kind===`union`?t.prop_types.string??null:t}renderInlineEditor(){this.isEditingModeActive()&&this.resetInlineEditorRoot();let e=this.element.children?.[0];if(!e)return;let t=e.classList.toString(),n=this.getExtractedContentValue(),r=this.getExpectedTag();e.innerHTML=``,this.editing=!0,this.reactRoot.render(Nn.createElement(CanvasInlineEditor,{elementClasses:t,initialValue:n,expectedTag:r,rootElement:this.element,contentElement:e,id:this.id,setValue:this.setContentValue.bind(this),requestDestroy:this.unmountInlineEditor.bind(this)}))}},$n=new Map,initViewReplacements=()=>{registerReplacement(InlineEditingReplacement)},registerReplacement=e=>{let t=e.getTypes();t&&t.forEach(t=>{$n.set(t,e)})},getReplacement=e=>$n.get(e)??null,createViewWithReplacements=e=>{let t=createTemplatedElementView(e);return class extends t{#e=null;#t;#n;#r;constructor(...e){super(...e);let t=this.model.get(`settings`);this.#n=this.el.ownerDocument.createElement(`div`),this.#n.style.display=`none`,this.el.ownerDocument.body.appendChild(this.#n),this.#r=(0,Mn.createRoot)(this.#n),this.#t={getSetting:t.get.bind(t),setSetting:t.set.bind(t),element:this.el,type:this?.model?.get(`widgetType`)??this.container?.model?.get(`elType`)??null,id:this?.model?.get(`id`)??null,refreshView:this.refreshView.bind(this),reactRoot:this.#r,reactContainer:this.#n}}refreshView(){this.invalidateRenderCache?.(),this.render()}renderOnChange(){this.#i(`renderOnChange`)}render(){let e=this.#t,t=e.type,n=t?getReplacement(t):null;n&&!this.#e&&(this.#e=new n(e)),this.#i(`render`)}onDestroy(){this.#i(`onDestroy`),this.#r.unmount(),this.#n.remove()}_afterRender(){this.#i(`_afterRender`)}_beforeRender(){this.#i(`_beforeRender`)}#i(e){let n=t.prototype[e].bind(this),r=this.#e?.shouldRenderReplacement(),i=r&&this.#e?.[e]?.bind(this.#e);if(!i||!r)return n();let a=this.#e?.originalMethodsToTrigger()[e]??`never`;a===`before`&&n(),i(),a===`after`&&n()}}},createTemplatedElementTypeWithReplacements=({type:e,renderer:t,element:n})=>{let r=window,i=createViewWithReplacements({type:e,renderer:t,element:n});return class extends r.elementor.modules.elements.types.Widget{getType(){return e}getView(){return i}}},er={},tr={};function registerModelExtensions(e,t){tr[e]=t}function registerElementType(e,t){er[e]=t,(0,En.__privateIsReady)()&®isterElementInLegacyManager(e,createDomRenderer())}function initLegacyViews(){(0,En.__privateListenTo)((0,En.v1ReadyEvent)(),()=>{let e=(0,Tn.getWidgetsCache)()??{},t=createDomRenderer();registerProPromotionTypes(e),Object.keys(e).forEach(e=>{registerElementInLegacyManager(e,t)})})}function registerElementInLegacyManager(e,t){let n=((0,Tn.getWidgetsCache)()??{})[e];n?.atomic&&tryRegisterElement(window,e,n,resolveElementType(e,t,n))}function registerProPromotionTypes(e){Object.entries(e).forEach(([e,t])=>{t.meta?.is_pro_promotion&®isterElementType(e,e=>createProPromotionNestedType(e))})}function resolveElementType(e,t,n){if(canBeNestedTemplated(n)){let r=er[e];return r?r({type:e,renderer:t,element:n}):createNestedTemplatedType(e,t,n)}if(!canBeTemplated(n))return createElementType(e);let r=er[e];return r?r({type:e,renderer:t,element:n}):createTemplatedElementTypeWithReplacements({type:e,renderer:t,element:n})}function tryRegisterElement(e,t,n,r){if(!(canBeTemplated(n)||canBeNestedTemplated(n)))return;let i=e.elementor.elementsManager,a=!!i.getElementTypeClass(t);try{i.registerElementType(new r)}catch{canBeNestedTemplated(n)&&a&&(i.elementTypes[t]=new r)}}function createNestedTemplatedType(e,t,n){return createNestedTemplatedElementType({type:e,renderer:t,element:n,modelExtensions:tr[e]})}var nr=`e-list`;function initListType(){registerElementType(nr,e=>createListType(e))}function createListType(e){let t=createNestedTemplatedElementType(e),n=null;return class extends t{getView(){return n||=createListView(e),n}}}function createListView(e){return createNestedTemplatedElementView(e).extend({getRenderContext(){let e=this._parent?.getRenderContext?.(),t=this.model.get(`settings`)?.get?.(`show_markers`),n=t?.value??t??!0;return{...e,show_markers:n}},getResolverRenderContext(){let e=this._parent?.getResolverRenderContext?.(),t=this.model.get(`settings`)?.get?.(`show_markers`),n=t?.value??t??!0;return{...e,show_markers:n}}})}var rr=globalThis.elementorV2.editorProps,ir={modifyDefaultChildren(e){if(!Array.isArray(e)||e.length===0)return e;let[t]=e,n=this.get(`editor_settings`)?.initial_position;if(!n||!t||typeof t!=`object`)return e;let r=t;return[{...r,settings:{...r.settings,paragraph:rr.escapedHtmlPropTypeUtil.create(`Tab ${n}`)}},...e.slice(1)]}};function initTabsModelExtensions(){registerModelExtensions(`e-tab`,ir)}var ar=globalThis.elementorV2.editorProps,or=globalThis.elementorV2.httpClient,sr=`elementor/v1/mcp-proxy`,cr=`elementor://context/available-widgets`,lr=`elementor://context/available-widgets/v4`,fetchWidgets=async()=>{let{data:e}=await(0,or.httpService)().post(sr,{tool:`list-widget-schemas`,input:{summary:!0}});return e.data?.widgets??[]},buildContents=async e=>{let t=await fetchWidgets();return{contents:[{uri:e,mimeType:`application/json`,text:JSON.stringify(t,null,2)}]}},initAvailableWidgetsResource=e=>{let{resource:t}=e;t(`available-widgets-v4`,lr,{description:`All registered v4 version widgets`},async()=>buildContents(lr)),t(`available-widgets`,cr,{description:`All registered v4 widget types with description.`},async()=>buildContents(cr))},ur=globalThis.elementorV2.httpClient,dr=`elementor/v1/mcp-proxy`,fr=`elementor://style/best-practices`,initBestPracticesResource=e=>{let{resource:t}=e;t(`style-best-practices`,fr,{description:`Design quality guidelines for avoiding generic AI output: typography, color strategy, spacing, motion, and visual hierarchy best practices.`,mimeType:`text/markdown`},async e=>{let{data:t}=await(0,ur.httpService)().get(dr,{params:{uri:e.href}});return{contents:[{uri:e.href,mimeType:`text/markdown`,text:t.data}]}})},pr=globalThis.elementorV2.editorElements,mr=globalThis.elementorV2.editorV1Adapters,hr=`elementor://document/structure`,initDocumentStructureResource=e=>{let{resource:t,sendResourceUpdated:n}=e,r=null,updateDocumentStructure=()=>{let e=getDocumentStructure(),t=JSON.stringify(e,null,2);t!==r&&(r=t,n({uri:hr}))};(0,mr.__privateListenTo)([(0,mr.commandEndEvent)(`document/elements/create`),(0,mr.commandEndEvent)(`document/elements/delete`),(0,mr.commandEndEvent)(`document/elements/move`),(0,mr.commandEndEvent)(`document/elements/copy`),(0,mr.commandEndEvent)(`document/elements/paste`),(0,mr.commandEndEvent)(`editor/documents/attach-preview`),(0,mr.commandEndEvent)(`editor/documents/switch`)],updateDocumentStructure),updateDocumentStructure(),t(`document-structure`,hr,{description:`Document structure.`},async()=>({contents:[{uri:hr,text:JSON.stringify(getDocumentStructure(),null,2)}]}))};function getDocumentStructure(){let e=window.elementor?.documents?.getCurrent?.();if(!e)return{error:`No active document found`};let t=(e.container?.children||[]).map(e=>extractElementData(e));return{documentId:e.id,documentType:e.config.type,title:e.config.settings?.post_title||`Untitled`,elements:t.filter(e=>e!==null)}}function resolveElementVersion(e){if(e.model?.config?.atomic)return`v4`;let t=e.model?.attributes?.widgetType;return t&&(0,pr.getWidgetsCache)()?.[t]?.atomic_props_schema?`v4`:`v3`}function extractElementData(e){if(!e||!e.model)return null;let t=e.model.attributes,n={id:t.id,elType:t.elType,widgetType:t.widgetType||void 0,version:resolveElementVersion(e)},r=t.title||e.model?.editor_settings?.title||e.model.getTitle?.();return r&&(n.title=r),e.children&&e.children.length>0&&(n.children=e.children.map(e=>extractElementData(e)).filter(e=>e!==null)),n}var gr=globalThis.elementorV2.httpClient,_r=`elementor://dynamic-tags`,vr=`elementor/v1/mcp-proxy`,fetchDynamicTags=async()=>{let{data:e}=await(0,gr.httpService)().get(vr,{params:{uri:_r}});return e.data??`[]`},initDynamicTagsResource=e=>{let{resource:t}=e;t(`dynamic-tags`,_r,{description:`List of available dynamic tags. To bind a property to a dynamic source, set its value to { "$$type": "dynamic", "value": { "name": <tag name>, "settings": { ... } } } using a tag whose name appears in that property's allowed list, and populate "settings" per the tag entry here.`,mimeType:`application/json`},async e=>({contents:[{uri:e.href,mimeType:`application/json`,text:await fetchDynamicTags()}]}))},yr=globalThis.elementorV2.editorV1Adapters,br=`The user is currently viewing the Elementor editor`,xr=500,Sr=2,Cr=`elementor://context/editor-state`,initEditorStateResource=e=>{let{resource:t,sendResourceUpdated:n}=e,r=``,buildState=()=>({currentlyViewedScreen:br,pageContent:getPageContentFromPreview(),pageTitle:getPageTitle()}),notifyIfChanged=()=>{let e=JSON.stringify(buildState());e!==r&&(r=e,n({uri:Cr}))};(0,yr.__privateListenTo)([(0,yr.commandEndEvent)(`editor/documents/switch`),(0,yr.commandEndEvent)(`editor/documents/attach-preview`)],notifyIfChanged),r=JSON.stringify(buildState()),t(`editor-state`,Cr,{description:`Editor page title, preview text snapshot, and viewed screen label.`},async()=>({contents:[{uri:Cr,text:JSON.stringify(buildState(),null,2)}]}))};function getPageContentFromPreview(){try{let e=window.elementor?.$previewContents?.[0];if(!e)return null;let t=[],n=e.cloneNode(!0);n.querySelectorAll(`.elementor-editor-element-settings, #elementor-add-new-section`).forEach(e=>{e.remove()});let walk=(e,n=!1)=>{let r=e.classList?.contains(`elementor-element`)||n;if(e.nodeType===Node.TEXT_NODE&&r){let n=e.textContent?.trim().replace(/\s+/g,` `);n&&n.length>Sr&&t.push(n)}else e.childNodes.forEach(e=>{walk(e,r)})};walk(n);let r=t.join(` `);return r.length>xr?r.slice(0,xr)+`...`:r}catch{return null}}function getPageTitle(){try{let e=(window.elementor?.documents?.getCurrent?.())?.config?.settings?.post_title;if(e)return e;let t=document.title||`Page`;return t=t.split(/\s*[‹»|–—-]\s*/)[0],t.trim()||`Page`}catch{return`Page`}}var wr=globalThis.elementorV2.editorV1Adapters,Tr=`elementor://context/general`,initGeneralContextResource=e=>{let{resource:t,sendResourceUpdated:n}=e,r=null,getPageTitle2=()=>{let e=window.elementor?.documents?.getCurrent?.()?.config?.settings?.post_title;return e?.trim()?e:null},buildPayload=()=>{let e=window,t=Intl.DateTimeFormat().resolvedOptions().timeZone,n=new URLSearchParams(location.search).get(`post`),r=n?Number(n):null,i=r!==null&&Number.isFinite(r)?r:null,a=getPageTitle2(),o=new URL(window.location.href),s=o.pathname+o.search,c=a||`Elementor Editor`,l=e.angieConfig?.plugins;return{timezone:t,postId:i,currentPage:{pageName:c,pageTitle:a,pageUrl:s},...l&&{plugins:l}}},pushUpdateIfChanged=()=>{let e=JSON.stringify(buildPayload());e!==r&&(r=e,n({uri:Tr}))};t(`general-context`,Tr,{description:`General context: timezone, post id, and current page.`},async()=>({contents:[{uri:Tr,mimeType:`application/json`,text:JSON.stringify(buildPayload(),null,2)}]})),(0,wr.__privateListenTo)([(0,wr.commandEndEvent)(`editor/documents/switch`),(0,wr.commandEndEvent)(`editor/documents/attach-preview`),(0,wr.commandEndEvent)(`document/elements/settings`)],pushUpdateIfChanged),pushUpdateIfChanged()},Er=globalThis.elementorV2.editorElements,Dr=globalThis.elementorV2.editorV1Adapters,Or=`elementor://context/selected-element`,initSelectedElementResource=e=>{let{resource:t,sendResourceUpdated:n}=e,r=null,publishIfChanged=e=>{let t=JSON.stringify(e);t!==r&&(r=t,n({uri:Or}))},onCommand=e=>{if(e.type!==`command`)return;let t=e;if(t.command===`document/elements/deselect-all`){publishIfChanged(createEmptySelectedElementPayload());return}if(t.command!==`document/elements/select`&&t.command!==`document/elements/settings`)return;let{container:n}=t.args||{};if(n?.id){publishIfChanged(buildPayloadFromContainer(n));return}publishIfChanged(readSelectionFromEditor())};(0,Dr.__privateListenTo)([(0,Dr.commandEndEvent)(`document/elements/select`),(0,Dr.commandEndEvent)(`document/elements/deselect-all`),(0,Dr.commandEndEvent)(`document/elements/settings`)],onCommand),publishIfChanged(readSelectionFromEditor()),t(`selected-element`,Or,{description:`Currently selected Elementor element context.`},async()=>({contents:[{uri:Or,text:JSON.stringify(readSelectionFromEditor(),null,2)}]}))};function createEmptySelectedElementPayload(){return{elementDisplayName:null,elementType:null,properties:null,selectedElementId:null,selectedParentId:null,version:null,widgetType:null}}function readSelectionFromEditor(){let e=(0,Er.getSelectedElements)();return e.length===1?buildPayloadFromContainer((0,Er.getContainer)(e[0].id)):createEmptySelectedElementPayload()}function buildPayloadFromContainer(e){if(!e?.id)return createEmptySelectedElementPayload();let t=e.model.get(`widgetType`)??null,n=e.type??`widget`;return{elementDisplayName:getElementDisplayName(e),elementType:n,properties:getElementProperties(e,t),selectedElementId:e.id,selectedParentId:e.parent?.id??null,version:resolveElementVersion2(e,t),widgetType:t}}function resolveElementVersion2(e,t){return e.model?.config?.atomic||t&&(0,Er.getWidgetsCache)()?.[t]?.atomic_props_schema?`v4`:`v3`}function getElementProperties(e,t){let n=e.settings?.toJSON?.();if(!n||typeof n!=`object`)return null;let r=(t?(0,Er.getWidgetsCache)()?.[t]:null)?.controls,i={};for(let[e,t]of Object.entries(n)){if(t==null||t===``)continue;let n=r?.[e]?.default;(n===void 0||JSON.stringify(t)!==JSON.stringify(n))&&(i[e]=t)}return Object.keys(i).length>0?i:null}function getElementDisplayName(e){try{if(e.label)return e.label;let t=e.model?.get?.(`widgetType`);return t?(t.charAt(0).toUpperCase()+t.slice(1)).replace(/-/g,` `):e.type===`container`?`Container`:e.type===`section`?`Section`:`Element ${e.id}`}catch{return`Element ${e.id}`}}var kr=globalThis.elementorV2.editorElements,Ar=globalThis.elementorV2.editorMcp,jr=globalThis.elementorV2.editorProps,Mr=globalThis.elementorV2.editorElements,Nr=globalThis.elementorV2.editorProps,Pr=globalThis.elementorV2.editorStyles,Fr=globalThis.elementorV2.editorV1Adapters,Ir=` | |
| 18 | +`,mergeCustomCssText=(...e)=>e.map(e=>e?.trim()).filter(e=>!!e).join(Ir),readStoredCustomCssText=e=>{if(!e)return``;try{return atob(e)}catch{return``}},Lr=globalThis.elementorV2.editorElements;function buildAliasToCanonicalMap(e){let t={};for(let[n,r]of Object.entries(e)){let e=r.meta?.aliases;if(Array.isArray(e))for(let r of e)typeof r==`string`&&r&&(t[r]=n)}return t}function resolveCanonicalPropName(e,t){let n=(0,Lr.getWidgetsCache)()?.[e]?.atomic_props_schema;return!n||n[t]?t:buildAliasToCanonicalMap(n)[t]??t}function resolveCanonicalPropKeys(e,t){let n=(0,Lr.getWidgetsCache)()?.[e]?.atomic_props_schema;if(!n)return{...t};let r=buildAliasToCanonicalMap(n),i={};for(let[e,r]of Object.entries(t))n[e]&&(i[e]=r);for(let[e,a]of Object.entries(t)){if(n[e])continue;let t=r[e];if(!t){i[e]=a;continue}Object.prototype.hasOwnProperty.call(i,t)||(i[t]=a)}return i}var Rr=globalThis.elementorV2.editorV1Adapters,zr=`dynamic`,Br=[`fallback`],getAtomicDynamicTags=()=>(0,Rr.getElementorConfig)().atomicDynamicTags?.tags??{},getDynamicTagNamesByCategories=e=>{if(!e.length)return[];let t=new Set(e);return Object.values(getAtomicDynamicTags()).filter(e=>e.categories?.some(e=>t.has(e))).map(e=>e.name)},dynamicTagLLMResolver=e=>{let t=e??{},n=t.name?getAtomicDynamicTags()[t.name]:void 0;return n?{$$type:zr,value:{name:n.name,group:n.group,settings:buildStrictSettings(n.props_schema??{},t.settings??{})}}:{$$type:zr,value:{name:t.name??``,group:``,settings:{}}}},buildStrictSettings=(e,t)=>{let n={};for(let[r,i]of Object.entries(e)){if(Br.includes(r))continue;let e=t[r]===void 0?defaultSettingValue(i):wrapSettingValue(t[r],i);e!=null&&(n[r]=e)}return n},wrapSettingValue=(e,t)=>typeof e==`object`&&e?e:t.key?{$$type:t.key,value:e}:e,defaultSettingValue=e=>{if(e.initial_value!==null&&e.initial_value!==void 0)return e.initial_value;if(e.default!==null&&e.default!==void 0)return wrapSettingValue(e.default,e)},Vr={breakpoint:`desktop`,state:null},UnsupportedPropertyError=class extends Error{elementType;propertyName;constructor(e,t,n){super(`Property "${t}" does not exist on element type "${e}". Available properties are: ${n.join(`, `)}`),this.name=`UnsupportedPropertyError`,this.elementType=e,this.propertyName=t}};function resolvePropValue(e,t){let n=window.elementorV2.editorVariables.Utils;return Nr.Schema.adjustLlmPropValueSchema(e,{forceKey:t,transformers:{...n.globalVariablesLLMResolvers,[zr]:dynamicTagLLMResolver}})}var doUpdateElementProperty=e=>{let{elementId:t,propertyValue:n,elementType:r,customCssWriteMode:i=`replace`}=e,a=e.propertyName===`_styles`?e.propertyName:resolveCanonicalPropName(r,e.propertyName);if(a===`_styles`){let e=(0,Mr.getElementStyles)(t)||{},r=n,a=(0,Pr.getStylesSchema)(),o=Object.fromEntries(Object.entries(r).map(([e,t])=>{if(e===`custom_css`)return[e,t];let{key:n,kind:r}=a?.[e]||{};if(!n&&r!==`union`)throw Error(`_styles property ${e} is not supported.`);return t===null?[e,null]:[e,resolvePropValue(t,n)]})),s=Object.values(e).find(e=>e.label===`local`),c=s?readStoredCustomCssText((0,Pr.getVariantByMeta)(s,Vr)?.custom_css?.raw):``,l;Object.keys(r).forEach(e=>{let t=a[e];if(e===`custom_css`){let t=r[e];typeof t==`object`&&t&&t.value&&(t=String(t.value)),t||=``;let n=i===`merge-with-stored`?mergeCustomCssText(c,t):String(t);l=n?{raw:btoa(n)}:{raw:btoa(``)};return}if(!t)throw Error(`Style property ${e} is not supported.`);if(t.kind===`plain`&&typeof r[e]!=`object`){let n=(0,Nr.getPropSchemaFromCache)(t.key);if(n){let t=n.create(r[e]);r[e]=t}}}),delete o.custom_css,s?(0,Mr.updateElementStyle)({elementId:t,styleId:s.id,meta:{breakpoint:`desktop`,state:null},...l===void 0?{}:{custom_css:l},props:{...o}}):(0,Mr.createElementStyle)({elementId:t,...l===void 0?{}:{custom_css:l},classesProp:`classes`,label:`local`,meta:{breakpoint:`desktop`,state:null},props:{...o}});return}let o=(0,Mr.getWidgetsCache)()?.[r]?.atomic_props_schema;if(!o)throw Error(`No prop schema found for element type: ${r}`);if(!o[a])throw new UnsupportedPropertyError(r,a,Object.keys(o));let s=o[a].key,c=resolvePropValue(n,s),{valid:l,jsonSchema:u}=Nr.Schema.validatePropValue(o[a],n);if(!l)throw Error(`Invalid PropValue for elementId: ${t}. PropKey: ${s}, PropValue: ${JSON.stringify(n)} | |
| 19 | +Expected Schema: ${u}`);(0,Mr.updateElementSettings)({id:t,props:{[a]:c},withHistory:!1}),(0,Fr.__privateRunCommandSync)(`document/save/set-is-modified`,{status:!0},{internal:!0})},Hr=globalThis.elementorV2.editorMcp,Ur=`elementor://canvas/tools/configure-element-guide`,generatePrompt=()=>{let e=(0,Hr.toolPrompts)(`configure-element`);return e.description(` | |
| 20 | +Configure an existing element on the page. | |
| 21 | + | |
| 22 | +# **CRITICAL - REQUIRED INFORMATION (Must read before using this tool)** | |
| 23 | +1. [${p}] \u2014 **Widget properties** (\`propertiesToChange\`): each widgetType (e.g. e-heading, e-button) has its own PropType schema; values must be PropValues with \`$$type\`. | |
| 24 | +2. [elementor://global-variables] \u2014 **Design tokens for styling**: use labels in CSS as \`var(--label)\` or \`var(--label, fallback)\`; only variables listed here are valid. | |
| 25 | +3. **Styling** (\`style\` parameter): flat map of CSS property \u2192 value strings \u2014 **not** PropValues. The server converts to native styles; unconvertible declarations become custom CSS. | |
| 26 | +4. **Current state**: \`get-element-configuration-values\` returns \`properties\` as PropValues and \`style\` in stored form; when writing, send raw CSS in \`style\`, not copied PropValues. | |
| 27 | + | |
| 28 | +Before using this tool, read the widget PropType schema at editor-canvas__elementor://widgets/schema/{widgetType} | |
| 29 | + | |
| 30 | +# When to use this tool | |
| 31 | +When a user requires to change anything in an element, such as updating text, colors, sizes, or other configurable properties. | |
| 32 | +This tool handles elements of type "widget". | |
| 33 | +This tool handles styling elements, using the "style" parameter (raw CSS as a property \u2192 value map). | |
| 34 | + | |
| 35 | +To CLEAR a property (i.e., set it to default or none), provide null as a value - example: \`background-color: null\`. | |
| 36 | + | |
| 37 | +The element's schema must be known before using this tool. | |
| 38 | + | |
| 39 | +**PropValue structure (for \`propertiesToChange\` only \u2014 not for \`style\`):** | |
| 40 | +{ | |
| 41 | + "$$type": string, // MANDATORY as defined in the PropType schema under the "key" property | |
| 42 | + value: unknown // The value according to the PropType schema for kinds of "array", use array with PropValues items inside. For "object", read the shape property of the PropType schema. For "plain", use strings. | |
| 43 | +} | |
| 44 | + | |
| 45 | +<IMPORTANT> | |
| 46 | +ALWAYS MAKE SURE you have the PropType schemas for the element you are configuring. If you are not sure, retrieve the schema from the resources mentioned above. | |
| 47 | +</IMPORTANT> | |
| 48 | + | |
| 49 | +You can use multiple property changes at once by providing multiple entries in the propertiesToChange object. | |
| 50 | +Some properties are nested, use the root property name, then objects with nested values inside, as the complete schema suggests. | |
| 51 | + | |
| 52 | +Make sure you have the "widget-schema-by-type" resource available to retrieve the PropType schema for the element type you are configuring. | |
| 53 | + | |
| 54 | +# How to configure elements | |
| 55 | +We use a dedicated PropType Schema for configuring element properties (propertiesToChange). When you configure an element property, you must use the EXACT PropType Value as defined in the schema. | |
| 56 | +For styling, use the "style" parameter with raw CSS declarations (property \u2192 value strings) - e.g. \`color: var(--primary-text, #000); height: 4rem;\`; | |
| 57 | +For all non-primitive entries in \`propertiesToChange\`, provide the schema \`key\` as \`$$type\` in the generated object, as it is MANDATORY for parsing. | |
| 58 | + | |
| 59 | +Use the EXACT PropType schema given, and ALWAYS include the \`key\` from the schema for every property you are changing in \`propertiesToChange\`. | |
| 60 | + | |
| 61 | +# Dynamic tags | |
| 62 | +A value can be made dynamic wherever its schema exposes a variant with "$$type": "dynamic". This may be the property root OR a NESTED field: for example an image is made dynamic on its "src" (the root stays "image"), NOT on the whole "image" value. | |
| 63 | +Put the dynamic object EXACTLY at the node whose schema offers the "dynamic" variant, in place of the static variant. The variant's "name" enumerates the tags allowed at that node. | |
| 64 | +1. Read the [${_r}] resource for each allowed tag's settings schema. | |
| 65 | +2. Provide, at that node: | |
| 66 | +{ | |
| 67 | + "$$type": "dynamic", | |
| 68 | + "value": { | |
| 69 | + "name": "<allowed tag name>", | |
| 70 | + "settings": { /* strictly per the tag's settings schema */ } | |
| 71 | + } | |
| 72 | +} | |
| 73 | +Image example: { "$$type": "image", "value": { "src": { "$$type": "dynamic", "value": { "name": "<image tag>", "settings": { ... } } } } } | |
| 74 | +Do NOT send "group" (it is resolved automatically). Use { "settings": {} } only when the tag has no settings. | |
| 75 | +`),e.parameter(`elementId`,`The ID of the element to configure. MANDATORY.`),e.parameter(`elementType`,`The type of the element to configure (i.e. e-heading, e-button). MANDATORY.`),e.parameter(`propertiesToChange`,`An object containing the properties to change, with their new values. MANDATORY. When updating a style only, provide an empty object.`),e.parameter(`style`,`A flat map of raw CSS declarations (property → value), e.g. { "line-height": "1.25rem", "color": "var(--primary-text, #000)" }. font-family must be a single Google Font name or a var(--label) — no fallback stacks. Set a value to null to reset that property to its default. OPTIONAL.`),e.example(` | |
| 76 | +\`\`\`json | |
| 77 | +{ | |
| 78 | + propertiesToChange: { | |
| 79 | + // List of properties TO CHANGE, following the PropType schema for the element as defined in the resource [${p}] | |
| 80 | + title: { | |
| 81 | + $$type: 'string', | |
| 82 | + value: 'New Title Text' | |
| 83 | + }, | |
| 84 | + border: { | |
| 85 | + $$type: 'boolean', | |
| 86 | + value: false | |
| 87 | + }, | |
| 88 | + }, | |
| 89 | + style: { | |
| 90 | + 'line-height': '1.25rem', | |
| 91 | + 'color': 'var(--primary-text, #000)' | |
| 92 | + }, | |
| 93 | + elementId: 'element-id', | |
| 94 | + elementType: 'element-type' | |
| 95 | +}; | |
| 96 | +\`\`\` | |
| 97 | +`),e.instruction(`The $$type property is MANDATORY for every value in propertiesToChange; it is not used in the style parameter (raw CSS only).`),e.instruction("\nV4 only: If MCP fails, give manual steps using V4 UI.\n\nV4 Editor structure:\nPanel tabs: General (→ Settings section: ID, Tag, and Link where the widget supports it), Style, Interactions.\nNO Advanced tab. Never mention Advanced tab.\nNote: `link` is valid only when the element's PropType schema (which you must already have) includes a `link` property. Sending `link` to a widget whose schema lacks it is skipped and reported in the response `warnings` (other changes still apply) and the link is lost.\n"),e.prompt()},Wr=globalThis.elementorV2.schema,Gr={propertiesToChange:Wr.z.record(Wr.z.string().describe(`The property name.`),Wr.z.any().describe(`PropValue, refer to [${p}] by correct type, as appears in elementType`),Wr.z.any()).describe(`An object record containing property names and their new values to be set on the element`),style:Wr.z.record(Wr.z.string().describe(`A CSS property name, e.g. "color", "margin-top".`),Wr.z.string().nullable().describe(`A CSS value, e.g. "red", "10px", "1px solid #000". Use null to reset the property to its default.`)).describe(`Raw CSS declarations as a flat property→value map. Converted to native styles server-side; any declaration that cannot be converted is stored as the element custom CSS. A null value resets that property to its default.`).default({}),elementType:Wr.z.string().describe(`The type of the element to retrieve the schema`),elementId:Wr.z.string().describe(`The unique id of the element to configure`)},Kr={success:Wr.z.boolean().describe(`Whether the configuration change was successful, only if propertyName and propertyValue are provided`),warnings:Wr.z.string().describe(`Non-fatal notices. Present when some props were skipped because they are not in the element schema (e.g. a "link" on a widget with no link prop). Other changes were still applied.`).optional()},initConfigureElementTool=e=>{let{addTool:t,resource:n}=e;n(`configure-element-guide`,Ur,{title:`Configure Element Guide`,description:`Detailed guide for using the configure-element tool`,mimeType:`text/plain`},async e=>({contents:[{uri:e.href,mimeType:`text/plain`,text:generatePrompt()}]})),t({name:`configure-element`,description:`Configure an existing V4 element's properties and styles. Read the guide resource before use.`,schema:Gr,outputSchema:Kr,requiredResources:[{description:`Widgets schema`,uri:p},{description:`Configure element guide`,uri:Ur},{description:`Dynamic tags catalog`,uri:_r}],handler:async({elementId:e,propertiesToChange:t,elementType:n,style:r})=>{let i=(0,kr.getWidgetsCache)()?.[n];if(!i)throw Error(`Unknown element type: ${n}. Check the available-widgets resource for valid types.`);let a=(0,kr.getContainer)(e);if(!a)throw Error(`Element with id ${e} not found`);if(a.settings.get(`widgetType`)!==n&&a.type!==n)throw Error(`Element with ID ${e} is not of type ${n}`);if(!i.atomic_props_schema)throw Error(`This tool does not support V3 elements. Please use the elementor-v3-mcp tools instead for element type: ${n}`);let o=resolveCanonicalPropKeys(n,t),s=Object.entries(o),c=[];for(let[t,r]of s){if(!jr.Schema.isPropKeyConfigurable(t))throw Error(`Not allowed to update ${t}`);try{doUpdateElementProperty({elementId:e,elementType:n,propertyName:t,propertyValue:r})}catch(r){if(r instanceof UnsupportedPropertyError){c.push(r.propertyName);continue}let i=createUpdateErrorMessage({propertyName:t,elementId:e,elementType:n,error:r,propertyType:`prop`});throw Error(i)}}return await applyStyleFromCss({elementId:e,elementType:n,style:r}),{success:!0,warnings:c.length?`Skipped unsupported props (not in the "${n}" schema; other changes were applied): ${c.join(`, `)}.`:void 0}}})};async function applyStyleFromCss(e){let{elementId:t,elementType:n,style:r}=e;if(!r||Object.keys(r).length===0)return;let{props:i,customCss:a}=await convertCssToAtomic(r),o={...i};if(a&&(o.custom_css=a),Object.keys(o).length!==0)try{doUpdateElementProperty({elementId:t,elementType:n,propertyName:`_styles`,propertyValue:o,customCssWriteMode:`merge-with-stored`}),(0,Ar.dispatchMcpStylesAppliedEvent)({styleValue:o})}catch(e){throw Error(createUpdateErrorMessage({propertyName:`(style)`,elementId:t,elementType:n,propertyType:`style`,error:e}))}}function createUpdateErrorMessage(e){let{propertyName:t,elementId:n,elementType:r,error:i,propertyType:a}=e;return`Failed to update property "${t}" on element "${n}": ${i.message}. | |
| 98 | +${a===`prop`?` | |
| 99 | +Check the element's PropType schema at the resource [${p.replace(`{widgetType}`,r)}] for type "${r}" to ensure the property exists and the value matches the expected PropType. | |
| 100 | +Now that you have this information, ensure you have the schema and try again.`:` | |
| 101 | +Provide styling as raw CSS via the "style" parameter (a flat map of CSS property → value). Declarations that cannot be converted are stored as the element custom CSS.`}; | |
| 102 | +}`}var qr=globalThis.elementorV2.editorDocuments,Jr=globalThis.elementorV2.httpClient,Yr=globalThis.elementorV2.schema,Xr=globalThis.elementorV2.httpClient;function getMcpErrorMessage(e,t){if(e instanceof Xr.AxiosError){let t=e.response?.data;if(t?.message)return t.code?`${t.code}: ${t.message}`:t.message}return e instanceof Error?e.message:`${t} failed with an unknown error.`}var Zr=`elementor/v1/mcp-proxy`,initGetPageStructureTool=e=>{let{addTool:t}=e;t({name:`get-page-structure`,description:`Returns a lean Elementor element tree skeleton (id, elType, widgetType, title, nested elements) for a post or page. If no postId is provided, uses the currently open document. Optionally scope to a subtree with elementId. Set includeContent=true (requires elementId) to also return each node's settings and styles.`,schema:{postId:Yr.z.number().optional().describe(`WordPress post ID of the Elementor document. If omitted, uses the currently open document.`),elementId:Yr.z.string().optional().describe(`If provided, returns only the subtree rooted at that element id.`),includeContent:Yr.z.boolean().optional().describe(`If true, includes each node's settings and styles (same shape build-composition accepts as input). Requires elementId.`)},outputSchema:{elements:Yr.z.array(Yr.z.any()).describe(`Skeleton of Elementor elements (id, elType, widgetType, title, nested elements). When includeContent is true, each node also includes settings and styles.`)},handler:async({postId:e,elementId:t,includeContent:n})=>{let r=e??(0,qr.getCurrentDocument)()?.id;if(!r)throw Error(`No post ID provided and no active document found.`);try{let{data:e}=await(0,Jr.httpService)().post(Zr,{tool:`get-page-structure`,input:{post_id:r,...t?{element_id:t}:{},...n?{include_content:!0}:{}}});return{elements:e.data.elements}}catch(e){throw Error(getMcpErrorMessage(e,`get-page-structure`))}}})},initCanvasMcp=e=>{ar.Schema.setDynamicTagNamesResolver(getDynamicTagNamesByCategories),initWidgetsSchemaResource(e),initAvailableWidgetsResource(e),initDocumentStructureResource(e),initDynamicTagsResource(e),initSelectedElementResource(e),initEditorStateResource(e),initGeneralContextResource(e),initBestPracticesResource(e),initConfigureElementTool(e),initGetPageStructureTool(e),initBreakpointsResource(e)},Qr=`Elementor Canvas MCP | |
| 103 | +This MCP enables configuration and styling of existing V4 elements on the Elementor canvas using the configure-element tool. | |
| 104 | + | |
| 105 | +# Core Concepts | |
| 106 | + | |
| 107 | +## PropValues Structure | |
| 108 | +All data in Elementor uses PropValues - a typed wrapper for values: | |
| 109 | +\`\`\`json | |
| 110 | +{ | |
| 111 | + "$$type": "the-prop-type-schema-kind", | |
| 112 | + "value": "the-actual-value-as-defined-for-the-propType" | |
| 113 | +} | |
| 114 | +\`\`\` | |
| 115 | +The \`$$type\` defines how Elementor interprets the value. Providing the correct \`$$type\` is critical - incorrect types will be rejected. | |
| 116 | + | |
| 117 | +## Design System Resources | |
| 118 | +- **Global Variables**: Reusable colors, sizes, and fonts (\`elementor://global-variables\`) | |
| 119 | +- **Global Classes**: Reusable style sets that can be applied to elements (\`elementor://global-classes\`) | |
| 120 | +- **Widget Schemas**: Configuration options for each widget type (\`${p}\`) | |
| 121 | + | |
| 122 | +# Configuring Elements with configure-element | |
| 123 | + | |
| 124 | +The \`configure-element\` tool updates settings and styles on existing V4 elements. Read the configure-element guide resource before use. | |
| 125 | + | |
| 126 | +## Complete Workflow | |
| 127 | + | |
| 128 | +### 1. Parse User Requirements | |
| 129 | +Understand what needs to change: content, settings, or styling on existing elements. | |
| 130 | + | |
| 131 | +### 2. Check Global Resources FIRST | |
| 132 | +Always check existing resources before styling: | |
| 133 | +- List \`elementor://global-variables\` for available variables (colors, sizes, fonts) | |
| 134 | +- List \`elementor://global-classes\` for available style sets | |
| 135 | +- **Always prefer using existing global resources over creating inline styles** | |
| 136 | + | |
| 137 | +### 3. Retrieve Widget Schemas | |
| 138 | +For each element you will configure: | |
| 139 | +- List \`${p}\` to see available widgets | |
| 140 | +- Retrieve configuration schema from \`${p.replace(`{widgetType}`,`element-schema`)}\` for each widget | |
| 141 | +- Check the \`llm_guidance\` property for container nesting, \`default_styles\`, and \`default_settings\` | |
| 142 | + | |
| 143 | +### 4. Get Current Element State | |
| 144 | +Use page structure and element configuration resources to find element IDs and current values. | |
| 145 | + | |
| 146 | +### 5. Create propertiesToChange | |
| 147 | +Map property names to PropValues using the widget schema: | |
| 148 | +- Use correct \`$$type\` matching the widget's schema | |
| 149 | +- Use global variables in PropValues where applicable | |
| 150 | +- Example: | |
| 151 | +\`\`\`json | |
| 152 | +{ | |
| 153 | + "text": { "$$type": "string", "value": "Welcome" }, | |
| 154 | + "tag": { "$$type": "string", "value": "h1" } | |
| 155 | +} | |
| 156 | +\`\`\` | |
| 157 | + | |
| 158 | +### 6. Create style | |
| 159 | +Provide raw CSS declarations (property \u2192 value strings). The server converts them to native styles and stores any unconvertible declarations as the element custom CSS. | |
| 160 | +- Example: | |
| 161 | +\`\`\`json | |
| 162 | +{ | |
| 163 | + "color": "#1a1a1a", | |
| 164 | + "font-size": "2rem" | |
| 165 | +} | |
| 166 | +\`\`\` | |
| 167 | + | |
| 168 | +### 7. Execute configure-element | |
| 169 | +Call the tool with elementId, elementType, propertiesToChange, and style as needed. | |
| 170 | + | |
| 171 | +## Key Points | |
| 172 | + | |
| 173 | +- **PropValue Types**: Arrays that accept union types are typed as mixed arrays | |
| 174 | +- **Visual Sizing**: Widget sizes MUST be defined via the style parameter (raw CSS). Widget properties like image "size" control resolution, not visual appearance | |
| 175 | +- **Global Variables**: Reference by label/name: (e.g. var(--card-background-color) | |
| 176 | +- **Naming Conventions**: Use meaningful, purpose-based names (e.g., "primary-button", "heading-large"), not value-based names (e.g., "blue-style", "20px-padding") | |
| 177 | + | |
| 178 | +## Example: e-image PropValue Structure | |
| 179 | +\`\`\`json | |
| 180 | +{ | |
| 181 | + "$$type": "image", | |
| 182 | + "value": { | |
| 183 | + "src": { | |
| 184 | + "$$type": "image-src", | |
| 185 | + "value": { | |
| 186 | + "url": { "$$type": "url", "value": "https://example.com/image.jpg" } | |
| 187 | + } | |
| 188 | + }, | |
| 189 | + "size": { "$$type": "string", "value": "full" } | |
| 190 | + } | |
| 191 | +} | |
| 192 | +\`\`\` | |
| 193 | +Note: The "size" property controls image resolution/loading, not visual size. Set visual dimensions via the style parameter (raw CSS). | |
| 194 | +`,$r=globalThis.elementorV2.editorElements,ei=globalThis.elementorV2.editorNotifications,ti=globalThis.elementorV2.editorV1Adapters,ni=globalThis.wp.i18n;function initLinkInLinkPrevention(){(0,ti.blockCommand)({command:`document/elements/paste`,condition:blockLinkInLinkPaste}),(0,ti.blockCommand)({command:`document/elements/move`,condition:blockLinkInLinkMove})}var ri={href:`https://go.elementor.com/element-link-inside-link-infotip`,target:`_blank`,color:`inherit`,variant:`text`,sx:{marginInlineStart:`20px`},children:`Learn more`};function blockLinkInLinkPaste(e){let{containers:t=[e.container],storageType:n}=e,r=t;if(n!==`localstorage`)return!1;let i=window?.elementorCommon?.storage?.get();if(!i?.clipboard?.elements)return!1;let a=i.clipboard.elements,o={type:`default`,message:(0,ni.__)(`To paste a link to this element, first remove the link from it's parent container.`,`elementor`),id:`paste-in-link-blocked`,additionalActionProps:[ri]},s=shouldBlock(a,r);return s&&(0,ei.notify)(o),s}function blockLinkInLinkMove(e){let{containers:t=[e.container],target:n}=e,r=t,i=n,a={type:`default`,message:(0,ni.__)(`To drag a link to this element, first remove the link from it's parent container.`,`elementor`),id:`move-in-link-blocked`,additionalActionProps:[ri]},o=shouldBlock(r,[i]);return o&&(0,ei.notify)(a),o}function shouldBlock(e,t){return!e?.length||!t?.length||!e.some(e=>e?.id?(0,$r.isElementAnchored)(e.id)||!!(0,$r.getAnchoredDescendantId)(e.id):!1)?!1:t.some(e=>e?.id?(0,$r.isElementAnchored)(e.id)||!!(0,$r.getAnchoredAncestorId)(e.id):!1)}var ii=globalThis.elementorV2.editorElements,ai=globalThis.elementorV2.editorProps,oi=globalThis.elementorV2.editorV1Adapters,si=globalThis.elementorV2.editorElements,ci=globalThis.elementorV2.editorProps,li=globalThis.wp.i18n;function hasAtomicWidgets(e){let{containers:t=[e.container]}=e;return t.some(isAtomicWidget)}function isAtomicWidget(e){return e?!!getContainerSchema(e):!1}function getClassesProp(e){let t=getContainerSchema(e);if(!t)return null;let[n]=Object.entries(t).find(([,e])=>e.kind===`plain`&&e.key===ci.CLASSES_PROP_KEY)??[];return n??null}function getContainerSchema(e){let t=e?.model.get(`widgetType`)||e?.model.get(`elType`);return(0,si.getWidgetsCache)()?.[t]?.atomic_props_schema??null}function getClipboardElements(e=`clipboard`){try{return JSON.parse(localStorage.getItem(`elementor`)??`{}`)[e]?.elements}catch{return}}function getTitleForContainers(e){return e.length>1?(0,li.__)(`Elements`,`elementor`):(0,si.getElementLabel)(e[0].id)}var ui=globalThis.elementorV2.editorElements,di=globalThis.elementorV2.editorStylesRepository,fi=globalThis.elementorV2.editorV1Adapters,pi=globalThis.wp.i18n,undoablePasteElementStyle=()=>(0,fi.undoable)({do:({containers:e,newStyle:t})=>e.map(e=>{let n=e.id,r=getClassesProp(e);if(!r)return null;let i=(0,ui.getElementStyles)(e.id),[a,o]=Object.entries(i??{})[0]??[],s={styleId:a,originalStyle:Object.keys(o??{}).length?o:null};if(a)t.variants.forEach(({meta:e,props:t,custom_css:r})=>{(0,ui.updateElementStyle)({elementId:n,styleId:a,meta:e,props:t,custom_css:r})});else{let[e]=t.variants,i=t.variants.slice(1);s.styleId=(0,ui.createElementStyle)({elementId:n,classesProp:r,label:di.ELEMENTS_STYLES_RESERVED_LABEL,...e,additionalVariants:i})}return s}),undo:({containers:e},t)=>{e.forEach((e,n)=>{let r=t[n];if(!r)return;if(!r.originalStyle){(0,ui.deleteElementStyle)(e.id,r.styleId);return}let i=getClassesProp(e);if(!i)return;let[a]=r.originalStyle.variants,o=r.originalStyle.variants.slice(1);(0,ui.createElementStyle)({elementId:e.id,classesProp:i,label:di.ELEMENTS_STYLES_RESERVED_LABEL,styleId:r.styleId,...a,additionalVariants:o})})}},{title:({containers:e})=>getTitleForContainers(e),subtitle:(0,pi.__)(`Style Pasted`,`elementor`)});function initPasteStyleCommand(){let e=undoablePasteElementStyle();(0,oi.blockCommand)({command:`document/elements/paste-style`,condition:hasAtomicWidgets}),(0,oi.__privateListenTo)((0,oi.commandStartEvent)(`document/elements/paste-style`),t=>pasteStyles(t.args,e))}function pasteStyles(e,t){let{containers:n=[e.container],storageKey:r}=e,i=n.filter(isAtomicWidget);if(!i.length)return;let[a]=getClipboardElements(r)??[],o=(0,ii.getContainer)(a.id);if(!a||!o||!isAtomicWidget(o))return;let s=a.styles,c=Object.values(s??{})[0],l=getClassesWithoutLocalStyle(o,c);l.length&&pasteClasses(i,l),c&&t({containers:i,newStyle:c})}function getClassesWithoutLocalStyle(e,t){let n=getClassesProp(e);return n?(0,ii.getElementSetting)(e.id,n)?.value.filter(e=>e!==t?.id)??[]:[]}function pasteClasses(e,t){e.forEach(e=>{let n=getClassesProp(e);if(!n)return;let r=(0,ii.getElementSetting)(e.id,n),i=ai.classesPropTypeUtil.extract(r)??[],a=ai.classesPropTypeUtil.create(Array.from(new Set([...t,...i])));(0,ii.updateElementSettings)({id:e.id,props:{[n]:a}})})}var mi=globalThis.elementorV2.editorV1Adapters,hi=globalThis.elementorV2.editorElements,gi=globalThis.elementorV2.editorStylesRepository,_i=globalThis.elementorV2.editorV1Adapters,vi=globalThis.wp.i18n,undoableResetElementStyle=()=>(0,_i.undoable)({do:({containers:e})=>e.map(e=>{let t=e.model.get(`id`),n=(0,hi.getElementStyles)(t);return Object.keys(n??{}).forEach(e=>(0,hi.deleteElementStyle)(t,e)),n}),undo:({containers:e},t)=>{e.forEach((e,n)=>{let r=getClassesProp(e);if(!r)return;let i=e.model.get(`id`),a=t[n];Object.entries(a??{}).forEach(([e,t])=>{let[n]=t.variants,a=t.variants.slice(1);(0,hi.createElementStyle)({elementId:i,classesProp:r,styleId:e,label:gi.ELEMENTS_STYLES_RESERVED_LABEL,...n,additionalVariants:a})})})}},{title:({containers:e})=>getTitleForContainers(e),subtitle:(0,vi.__)(`Style Reset`,`elementor`)});function initResetStyleCommand(){let e=undoableResetElementStyle();(0,mi.blockCommand)({command:`document/elements/reset-style`,condition:hasAtomicWidgets}),(0,mi.__privateListenTo)((0,mi.commandStartEvent)(`document/elements/reset-style`),t=>resetStyles(t.args,e))}function resetStyles(e,t){let{containers:n=[e.container]}=e,r=n.filter(isAtomicWidget);r.length&&t({containers:r})}function initStyleCommands(){initPasteStyleCommand(),initResetStyleCommand()}function init(){initStyleTransformers(),initStyleCommands(),initLinkInLinkPrevention(),initFormNestingPrevention(),initFormAncestorEnforcement(),initViewReplacements(),initLegacyViews(),initSettingsTransformers(),(0,x.injectIntoTop)({id:`elements-overlays`,component:ElementsOverlays}),(0,x.injectIntoTop)({id:`canvas-style-render`,component:StyleRenderer}),(0,x.injectIntoTop)({id:`canvas-interactions-render`,component:InteractionsRenderer}),(0,x.injectIntoLogic)({id:`classes-rename`,component:ClassesRename}),initCanvasMcp((0,S.getMCPByDomain)(`canvas`,{instructions:`Everything related to V4 ( Atomic ) canvas. | |
| 195 | +# Canvas workflow | |
| 196 | +- Configure element settings and styles with configure-element | |
| 197 | +- Get page structure and element configuration values | |
| 198 | +`,docs:Qr})),initTabsModelExtensions(),initListType()}var yi=[`elementor-element`],endDragElementFromPanel=()=>{getElementorChannels()?.panelElements?.trigger(`element:drag:end`)},startDragElementFromPanel=(e,t)=>{setDragGroups(t);let n=getElementorChannels();n?.editor.reply(`element:dragged`,null),n?.panelElements.reply(`element:selected`,getLegacyPanelElementView(e)).trigger(`element:drag:start`)},setDragGroups=e=>{let t={groups:getDragGroups(e)};e.dataTransfer?.setData(JSON.stringify(t),`true`)},getDragGroups=e=>{let t=e.dataTransfer?.getData(`text/plain`);return t?JSON.parse(t).groups:yi},getElementorChannels=()=>{let e=window.elementor?.channels;if(!e)throw Error(`Elementor channels not found: Elementor editor is not initialized or channels are unavailable.`);return e},getLegacyPanelElementView=({settings:e,...t})=>{let n=window.elementor?.modules?.elements?.models?.Element;if(!n)throw Error(`Elementor legacy Element model not found in editor modules`);return{model:new n({...t,custom:{isPreset:!!e,preset_settings:e}})}},bi=`elementor/global-styles/imported`,xi=__toESM(globalThis.React);function SpotlightBackdrop({canvas:e,element:t,onExit:n,ariaLabel:r}){let i=useElementRect(t),a={position:`fixed`,top:0,left:0,width:`100vw`,height:`100vh`,backgroundColor:`rgba(0, 0, 0, 0.5)`,zIndex:999,pointerEvents:`painted`,cursor:`pointer`,clipPath:t?getRectClipPath(i,e.defaultView):void 0},handleKeyDown=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),n())};return xi.createElement(`div`,{style:a,onClick:n,onKeyDown:handleKeyDown,role:`button`,tabIndex:0,"aria-label":r})}function getRectClipPath(e,t){let{x:n,y:r,width:i,height:a}=e,{innerWidth:o,innerHeight:s}=t;return`path(evenodd, 'M 0 0 L ${o} 0 L ${o} ${s} L 0 ${s} Z M ${n} ${r} L ${n+i} ${r} L ${n+i} ${r+a} L ${n} ${r+a} L ${n} ${r} Z')`}var Si=globalThis.elementorV2.editorV1Adapters;function useCanvasDocument(){return(0,Si.__privateUseListenTo)((0,Si.commandEndEvent)(`editor/documents/attach-preview`),()=>(0,Si.getCanvasIframeDocument)())}var Ci=globalThis.React;function useEscapeOnCanvas(e,t){(0,Ci.useEffect)(()=>{if(!e)return;let handleEsc=e=>{e.key===`Escape`&&t()};return e.body.addEventListener(`keydown`,handleEsc),()=>{e.body.removeEventListener(`keydown`,handleEsc)}},[e,t])}var wi=globalThis.elementorV2.editorElements;function doAfterRender(e,t){let n=e.map(e=>{let t=(0,wi.getContainer)(e)?.view;if(!(!t||!hasDoAfterRender(t)))return new Promise(e=>t._doAfterRender(e))}).filter(Boolean);n.length>0?Promise.all(n).then(()=>t(e)):t(e)}function hasDoAfterRender(e){return typeof e?._doAfterRender==`function`}var Ti=`elementor/canvas/element-added`;0&&(t.exports={BREAKPOINTS_SCHEMA_FULL_URI:_,BREAKPOINTS_SCHEMA_URI:g,DOCUMENT_STRUCTURE_URI:hr,ELEMENT_ADDED_EVENT:Ti,GLOBAL_STYLES_IMPORTED_EVENT:bi,SpotlightBackdrop,UnknownStyleStateError:X,UnknownStyleTypeError:et,WIDGET_SCHEMA_FULL_URI:m,WIDGET_SCHEMA_URI:p,canBeNestedTemplated,convertCssToAtomic,convertStyleBlocksToAtomic,createNestedTemplatedElementType,createNestedTemplatedElementView,createPropsResolver,createTemplatedElementView,createTransformer,createTransformersRegistry,doAfterRender,endDragElementFromPanel,formatGridTrackRepeat,init,isAtomicWidget,isGridTrackProperty,registerElementType,registerModelExtensions,settingsTransformersRegistry:ft,startDragElementFromPanel,styleTransformersRegistry:Je,stylesInheritanceTransformersRegistry:qe,useCanvasDocument,useEscapeOnCanvas,waitForChildrenToComplete})}))());(window.elementorV2=window.elementorV2||{}).editorCanvas=Ht})(React,ReactDOM),window.elementorV2.editorCanvas?.init?.(); | |