@avocadostudio-ai/cli 0.1.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,235 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/loaded-MIY725CK-DUPDdSS5.js","assets/index-DaRt8zrp.js","assets/index-CM2p2yNB.js","assets/index-C0aP_ANq.css","assets/index-Cqq_JD7D.js","assets/loaded-F37CNCVG-Cg4RQXYq.js","assets/loaded-H325ZSK5-VDlQcHWH.js","assets/full-N67EAB2Q-5hqHUblQ.js","assets/Render-CU35UAWV-C1VtWmg6.js","assets/chunk-2CNEFIQP-W9Nm3hTe.js","assets/Editor-EPSED64A-5GXOZwWs.js"])))=>i.map(i=>d[i]);
2
+ import{c as ka,r as h,u as Tg,j as c,R as Rg,a as Lg,b as Hu,P as Vu,d as Yr,A as Wu,e as Uu,f as Ng,g as qu,h as zg,i as $g,k as Fg,l as Bg,m as Hg,F as Vg,D as Wg,C as Ug,n as qg,o as fo,p as Zu,q as Lo,s as Yu,t as Ia,_ as gn,v as ys,w as ur,x as Zg,y as Yg,z as Gg,B as Kg,S as Xg,E as Jg,U as Qg,G as ev,H as tv,I as nv,J as rv,K as sv,L as ov,V as iv,M as Zl,N as av,O as lv,Q as cv,T as Yl,W as uv,X as dv,Y as fv,Z as pv,$ as hv,a0 as gv,a1 as Ut,a2 as vv,a3 as mv}from"./index-CM2p2yNB.js";/**
3
+ * @license lucide-react v0.575.0 - ISC
4
+ *
5
+ * This source code is licensed under the ISC license.
6
+ * See the LICENSE file in the root directory of this source tree.
7
+ */const yv=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],bv=ka("arrow-left",yv);/**
8
+ * @license lucide-react v0.575.0 - ISC
9
+ *
10
+ * This source code is licensed under the ISC license.
11
+ * See the LICENSE file in the root directory of this source tree.
12
+ */const _v=[["path",{d:"M12 6V2H8",key:"1155em"}],["path",{d:"M15 11v2",key:"i11awn"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 16a2 2 0 0 1-2 2H8.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 4 20.286V8a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2z",key:"11gyqh"}],["path",{d:"M9 11v2",key:"1ueba0"}]],xv=ka("bot-message-square",_v);/**
13
+ * @license lucide-react v0.575.0 - ISC
14
+ *
15
+ * This source code is licensed under the ISC license.
16
+ * See the LICENSE file in the root directory of this source tree.
17
+ */const wv=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],Sv=ka("history",wv);var No="Popover",[Gu]=Fg(No,[qu]),bs=qu(),[kv,vn]=Gu(No),Ku=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:s,onOpenChange:o,modal:i=!1}=e,a=bs(t),l=h.useRef(null),[u,d]=h.useState(!1),[f,p]=Tg({prop:r,defaultProp:s??!1,onChange:o,caller:No});return c.jsx(Rg,{...a,children:c.jsx(kv,{scope:t,contentId:Lg(),triggerRef:l,open:f,onOpenChange:p,onOpenToggle:h.useCallback(()=>p(v=>!v),[p]),hasCustomAnchor:u,onCustomAnchorAdd:h.useCallback(()=>d(!0),[]),onCustomAnchorRemove:h.useCallback(()=>d(!1),[]),modal:i,children:n})})};Ku.displayName=No;var Xu="PopoverAnchor",Iv=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=vn(Xu,n),o=bs(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:a}=s;return h.useEffect(()=>(i(),()=>a()),[i,a]),c.jsx(Wu,{...o,...r,ref:t})});Iv.displayName=Xu;var Ju="PopoverTrigger",Qu=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=vn(Ju,n),o=bs(n),i=Hu(t,s.triggerRef),a=c.jsx(Vu.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":sd(s.open),...r,ref:i,onClick:Yr(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?a:c.jsx(Wu,{asChild:!0,...o,children:a})});Qu.displayName=Ju;var Ea="PopoverPortal",[Ev,Cv]=Gu(Ea,{forceMount:void 0}),ed=e=>{const{__scopePopover:t,forceMount:n,children:r,container:s}=e,o=vn(Ea,t);return c.jsx(Ev,{scope:t,forceMount:n,children:c.jsx(Uu,{present:n||o.open,children:c.jsx(Ng,{asChild:!0,container:s,children:r})})})};ed.displayName=Ea;var rr="PopoverContent",td=h.forwardRef((e,t)=>{const n=Cv(rr,e.__scopePopover),{forceMount:r=n.forceMount,...s}=e,o=vn(rr,e.__scopePopover);return c.jsx(Uu,{present:r||o.open,children:o.modal?c.jsx(Pv,{...s,ref:t}):c.jsx(Av,{...s,ref:t})})});td.displayName=rr;var jv=Bg("PopoverContent.RemoveScroll"),Pv=h.forwardRef((e,t)=>{const n=vn(rr,e.__scopePopover),r=h.useRef(null),s=Hu(t,r),o=h.useRef(!1);return h.useEffect(()=>{const i=r.current;if(i)return zg(i)},[]),c.jsx($g,{as:jv,allowPinchZoom:!0,children:c.jsx(nd,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Yr(e.onCloseAutoFocus,i=>{var a;i.preventDefault(),o.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Yr(e.onPointerDownOutside,i=>{const a=i.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,u=a.button===2||l;o.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:Yr(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),Av=h.forwardRef((e,t)=>{const n=vn(rr,e.__scopePopover),r=h.useRef(!1),s=h.useRef(!1);return c.jsx(nd,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var i,a;(i=e.onCloseAutoFocus)==null||i.call(e,o),o.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),o.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:o=>{var l,u;(l=e.onInteractOutside)==null||l.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const i=o.target;((u=n.triggerRef.current)==null?void 0:u.contains(i))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),nd=h.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:i,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:d,...f}=e,p=vn(rr,n),v=bs(n);return Hg(),c.jsx(Vg,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:c.jsx(Wg,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:d,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>p.onOpenChange(!1),children:c.jsx(Ug,{"data-state":sd(p.open),role:"dialog",id:p.contentId,...v,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),rd="PopoverClose",Ov=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=vn(rd,n);return c.jsx(Vu.button,{type:"button",...r,ref:t,onClick:Yr(e.onClick,()=>s.onOpenChange(!1))})});Ov.displayName=rd;var Mv="PopoverArrow",Dv=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=bs(n);return c.jsx(qg,{...s,...r,ref:t})});Dv.displayName=Mv;function sd(e){return e?"open":"closed"}const Gl=e=>Symbol.iterator in e,Kl=e=>"entries"in e,Xl=(e,t)=>{const n=e instanceof Map?e:new Map(e.entries()),r=t instanceof Map?t:new Map(t.entries());if(n.size!==r.size)return!1;for(const[s,o]of n)if(!r.has(s)||!Object.is(o,r.get(s)))return!1;return!0},Tv=(e,t)=>{const n=e[Symbol.iterator](),r=t[Symbol.iterator]();let s=n.next(),o=r.next();for(;!s.done&&!o.done;){if(!Object.is(s.value,o.value))return!1;s=n.next(),o=r.next()}return!!s.done&&!!o.done};function Rv(e,t){return Object.is(e,t)?!0:typeof e!="object"||e===null||typeof t!="object"||t===null||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?!1:Gl(e)&&Gl(t)?Kl(e)&&Kl(t)?Xl(e,t):Tv(e,t):Xl({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)})}function Ke(e){const t=fo.useRef(void 0);return n=>{const r=e(n);return Rv(t.current,r)?t.current:t.current=r}}var Lv=Object.create,Ca=Object.defineProperty,Nv=Object.defineProperties,zv=Object.getOwnPropertyDescriptor,$v=Object.getOwnPropertyDescriptors,ja=Object.getOwnPropertyNames,po=Object.getOwnPropertySymbols,Fv=Object.getPrototypeOf,Pa=Object.prototype.hasOwnProperty,od=Object.prototype.propertyIsEnumerable,Jl=(e,t,n)=>t in e?Ca(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,O=(e,t)=>{for(var n in t||(t={}))Pa.call(t,n)&&Jl(e,n,t[n]);if(po)for(var n of po(t))od.call(t,n)&&Jl(e,n,t[n]);return e},z=(e,t)=>Nv(e,$v(t)),Kt=(e,t)=>{var n={};for(var r in e)Pa.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&po)for(var r of po(e))t.indexOf(r)<0&&od.call(e,r)&&(n[r]=e[r]);return n},Bv=(e,t)=>function(){return e&&(t=(0,e[ja(e)[0]])(e=0)),t},Hv=(e,t)=>function(){return t||(0,e[ja(e)[0]])((t={exports:{}}).exports,t),t.exports},Vv=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of ja(t))!Pa.call(e,s)&&s!==n&&Ca(e,s,{get:()=>t[s],enumerable:!(r=zv(t,s))||r.enumerable});return e},Wv=(e,t,n)=>(n=e!=null?Lv(Fv(e)):{},Vv(!e||!e.__esModule?Ca(n,"default",{value:e,enumerable:!0}):n,e)),Ee=(e,t,n)=>new Promise((r,s)=>{var o=l=>{try{a(n.next(l))}catch(u){s(u)}},i=l=>{try{a(n.throw(l))}catch(u){s(u)}},a=l=>l.done?r(l.value):Promise.resolve(l.value).then(o,i);a((n=n.apply(e,t)).next())}),P=Bv({"../tsup-config/react-import.js"(){}});P();var id={RichTextEditor:"_RichTextEditor_z25h4_1","RichTextEditor--editor":"_RichTextEditor--editor_z25h4_50","RichTextEditor--disabled":"_RichTextEditor--disabled_z25h4_107","RichTextEditor--isActive":"_RichTextEditor--isActive_z25h4_111","RichTextEditor-menu":"_RichTextEditor-menu_z25h4_117"},ti,Ql;function Uv(){if(Ql)return ti;Ql=1,ti=n,n.flatten=n,n.unflatten=r;function e(s){return s&&s.constructor&&typeof s.constructor.isBuffer=="function"&&s.constructor.isBuffer(s)}function t(s){return s}function n(s,o){o=o||{};const i=o.delimiter||".",a=o.maxDepth,l=o.transformKey||t,u={};function d(f,p,v){v=v||1,Object.keys(f).forEach(function(g){const m=f[g],w=o.safe&&Array.isArray(m),S=Object.prototype.toString.call(m),k=e(m),y=S==="[object Object]"||S==="[object Array]",b=p?p+i+l(g):l(g);if(!w&&!k&&y&&Object.keys(m).length&&(!o.maxDepth||v<a))return d(m,b,v+1);u[b]=m})}return d(s),u}function r(s,o){o=o||{};const i=o.delimiter||".",a=o.overwrite||!1,l=o.transformKey||t,u={};if(e(s)||Object.prototype.toString.call(s)!=="[object Object]")return s;function f(g){const m=Number(g);return isNaN(m)||g.indexOf(".")!==-1||o.object?g:m}function p(g,m,w){return Object.keys(w).reduce(function(S,k){return S[g+i+k]=w[k],S},m)}function v(g){const m=Object.prototype.toString.call(g),w=m==="[object Array]",S=m==="[object Object]";if(g){if(w)return!g.length;if(S)return!Object.keys(g).length}else return!0}return s=Object.keys(s).reduce(function(g,m){const w=Object.prototype.toString.call(s[m]);return!(w==="[object Object]"||w==="[object Array]")||v(s[m])?(g[m]=s[m],g):p(m,g,n(s[m],o))},{}),Object.keys(s).forEach(function(g){const m=g.split(i).map(l);let w=f(m.shift()),S=f(m[0]),k=u;for(;S!==void 0;){if(w==="__proto__")return;const y=Object.prototype.toString.call(k[w]),b=y==="[object Object]"||y==="[object Array]";if(!a&&!b&&typeof k[w]<"u")return;(a&&!b||!a&&k[w]==null)&&(k[w]=typeof S=="number"&&!o.object?[]:{}),k=k[w],m.length>0&&(w=f(m.shift()),S=f(m[0]))}k[w]=r(s[g],o)}),u}return ti}var qv=Uv();const Zv=Zu(qv);let Ds;const Yv=new Uint8Array(16);function Gv(){if(!Ds&&(Ds=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Ds))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ds(Yv)}const Ue=[];for(let e=0;e<256;++e)Ue.push((e+256).toString(16).slice(1));function Kv(e,t=0){return Ue[e[t+0]]+Ue[e[t+1]]+Ue[e[t+2]]+Ue[e[t+3]]+"-"+Ue[e[t+4]]+Ue[e[t+5]]+"-"+Ue[e[t+6]]+Ue[e[t+7]]+"-"+Ue[e[t+8]]+Ue[e[t+9]]+"-"+Ue[e[t+10]]+Ue[e[t+11]]+Ue[e[t+12]]+Ue[e[t+13]]+Ue[e[t+14]]+Ue[e[t+15]]}const Xv=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),ec={randomUUID:Xv};function tc(e,t,n){if(ec.randomUUID&&!e)return ec.randomUUID();e=e||{};const r=e.random||(e.rng||Gv)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Kv(r)}P();P();P();var Aa=(e,t)=>Object.keys(t).reduce((n,r)=>t[r].type==="slot"?O({[r]:[]},n):n,e),Oa=e=>!!e&&typeof e.then=="function",nc=e=>e.reduce((t,n)=>O(O({},t),n),{}),Pi=e=>e.some(Oa),ho=({value:e,fields:t,mappers:n,propKey:r="",propPath:s="",id:o="",config:i,recurseSlots:a=!1})=>{var l,u,d;const f=(l=t[r])==null?void 0:l.type,p=n[f];if(p&&f==="slot"){const v=e||[],g=a?v.map(m=>{var w;const S=i.components[m.type];if(!S)throw new Error(`Could not find component config for ${m.type}`);const k=(w=S.fields)!=null?w:{};return ho({value:z(O({},m),{props:Aa(m.props,k)}),fields:k,mappers:n,id:m.props.id,config:i,recurseSlots:a})}):v;return Pi(g)?Promise.all(g):p({value:g,parentId:o,propName:s,field:t[r],propPath:s})}else if(p&&t[r])return p({value:e,parentId:o,propName:r,field:t[r],propPath:s});if(e&&typeof e=="object")if(Array.isArray(e)){const v=((u=t[r])==null?void 0:u.type)==="array"?t[r].arrayFields:null;if(!v)return e;const g=e.map((m,w)=>ho({value:m,fields:v,mappers:n,propKey:r,propPath:`${s}[${w}]`,id:o,config:i,recurseSlots:a}));return Pi(g)?Promise.all(g):g}else{if("$$typeof"in e)return e;{const v=((d=t[r])==null?void 0:d.type)==="object"?t[r].objectFields:t;return ad({value:e,fields:v,mappers:n,id:o,getPropPath:g=>`${s}.${g}`,config:i,recurseSlots:a})}}return e},ad=({value:e,fields:t,mappers:n,id:r,getPropPath:s,config:o,recurseSlots:i})=>{const a=Object.entries(e).map(([l,u])=>{const d={value:u,fields:t,mappers:n,propKey:l,propPath:s(l),id:r,config:o,recurseSlots:i},f=ho(d);return Oa(f)?f.then(p=>({[l]:p})):{[l]:f}},{});return Pi(a)?Promise.all(a).then(nc):nc(a)};function dr(e,t,n,r=!1,s=!0){var o,i,a,l,u;const d="type"in e?e.type:"root",f=d==="root"?n.root:(o=n.components)==null?void 0:o[d],p=ad({value:s?Aa((i=e.props)!=null?i:{},(a=f==null?void 0:f.fields)!=null?a:{}):e.props,fields:(l=f==null?void 0:f.fields)!=null?l:{},mappers:t,id:e.props&&(u=e.props.id)!=null?u:"root",getPropPath:v=>v,config:n,recurseSlots:r});return Oa(p)?p.then(v=>z(O({},e),{props:v})):z(O({},e),{props:p})}function ld(e,t,n){var r,s;const o=u=>dr(u,{slot:({value:d,parentId:f,propName:p})=>{var v;const g=d;return(v=n(g,{parentId:f,propName:p}))!=null?v:g}},t,!0);if("props"in e)return o(e);const i=e,a=(r=i.zones)!=null?r:{},l=i.content.map(o);return{root:o(i.root),content:(s=n(l,{parentId:"root",propName:"default-zone"}))!=null?s:l,zones:Object.keys(a).reduce((u,d)=>z(O({},u),{[d]:a[d].map(o)}),{})}}P();var ts="root",Ai="default-zone",Ge=`${ts}:${Ai}`;P();P();var Jv=(e,t)=>dr(e,{slot:()=>null},t),{flatten:Qv,unflatten:em}=Zv,tm=e=>e!=null&&Object.prototype.toString.call(e)==="[object Object]",cd="__puck_[]",ud="__puck_{}";function nm(e={}){const t={};for(const n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;const r=e[n];Array.isArray(r)&&r.length===0?t[n]=cd:tm(r)&&Object.keys(r).length===0?t[n]=ud:t[n]=r}return t}function rm(e={}){const t={};for(const n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;const r=e[n];r===cd?t[n]=[]:r===ud?t[n]={}:t[n]=r}return t}var sm=(e,t)=>z(O({},e),{props:nm(Qv(Jv(e,t).props))}),om=e=>{const t=em(rm(e.props));return z(O({},e),{props:t})};P();var _s=e=>"type"in e?e:z(O({},e),{props:z(O({},e.props),{id:"root"}),type:"root"});P();P();P();var im=e=>e?e&&e.indexOf(":")>-1?e.split(":"):[Ge,e]:[];function am(e,t,n,r=[]){Object.entries(t.zones||{}).forEach(([s,o])=>{const[i]=im(s);i===e.props.id&&n(r,s,o)})}function ht(e,t,n=s=>s,r=s=>s){var s;let o={};const i={},a={},l=(y,b,j,C,A)=>{var _;const[I]=b.split(":"),x=((_=n(j,b,C))!=null?_:j)||[],[M,D]=b.split(":"),L=`${A||I}:${D}`,N=x.map((F,B)=>d(F,[...y,L],B));return i[L]={contentIds:N.map(F=>F.props.id),type:C},[L,N]},u=(y,b,j)=>{am(y,e.data,(C,A,_)=>{const[I,x]=l(C,A,_,"dropzone",b);o[I]=x},j)},d=(y,b,j)=>{const C=r(y,b,j);if(!C)return y;const A=C.props.id,_=z(O({},dr(C,{slot:({value:N,parentId:F,propPath:B})=>{const K=N,$=`${F}:${B}`,[U,Z]=l(b,$,K,"slot",F);return Z}},t).props),{id:A});u(y,A,b);const I=z(O({},C),{props:_}),x=b[b.length-1],[M,D]=x?x.split(":"):[null,""];a[A]={data:I,flatData:sm(I,t),path:b,parentId:M,zone:D};const L=z(O({},I),{props:O({},I.props)});return _.id==="root"&&(delete L.type,delete L.props.id),L},f=e.data.zones||{},[p,v]=l([],Ge,e.data.content,"root"),g=v,m=Object.keys(o);Object.keys(f||{}).forEach(y=>{const[b]=y.split(":");if(m.includes(y))return;const[j,C]=l([Ge],y,f[y],"dropzone",b);o[y]=C},o);let w=_s({props:O({},(s=e.data.root.props)!=null?s:e.data.root)});e.data.root.readOnly&&(w.readOnly=e.data.root.readOnly);const S=d(w,[],-1),k=O(O({},e.data.root),S);return z(O({},e),{data:{root:k,content:g,zones:O(O({},e.data.zones),o)},indexes:{nodes:O(O({},e.indexes.nodes),a),zones:O(O({},e.indexes.zones),i)}})}P();var it=e=>e?`${e}-${tc()}`:tc();P();var dd=(e,t)=>{if(t===Ge)return e;const n=z(O({},e),{zones:e.zones?O({},e.zones):{}});return n.zones[t]=n.zones[t]||[],n};P();P();var lm=(e,t,n)=>{if(typeof t.state=="object"){const r=O(O({},e),t.state);return t.state.indexes?r:(console.warn("`set` is expensive and may cause unnecessary re-renders. Consider using a more atomic action instead."),ht(r,n.config))}return O(O({},e),t.state(e))};P();P();var sr=(e,t,n)=>{const r=Array.from(e||[]);return r.splice(t,0,n),r};P();var ns=(e,t)=>{const[n]=e.split(":"),r=t.indexes.nodes[n];return((r==null?void 0:r.path)||[]).map(s=>s.split(":")[0])};P();var Ma=(e,t,n=!1)=>{const r=it(e.type);return ld(z(O({},e),{props:n?z(O({},e.props),{id:r}):O({},e.props)}),t,s=>s.map(o=>{const i=it(o.type);return z(O({},o),{props:n?z(O({},o.props),{id:i}):O({id:i},o.props)})}))};function fd(e,t,n){const r=t.id||it(t.componentType),s=Ma({type:t.componentType,props:z(O({},n.config.components[t.componentType].defaultProps||{}),{id:r})},n.config),[o]=t.destinationZone.split(":"),i=ns(t.destinationZone,e);return ht(e,n.config,(a,l)=>l===t.destinationZone?sr(a||[],t.destinationIndex,s):a,(a,l)=>a.props.id===r||a.props.id===o||i.includes(a.props.id)||l.includes(t.destinationZone)?a:null)}P();var cm=(e,t,n)=>{const[r]=t.destinationZone.split(":"),s=ns(t.destinationZone,e),o=e.indexes.zones[t.destinationZone].contentIds[t.destinationIndex];if(o!==t.data.props.id)throw new Error(`Can't change the id during a replace action. Please us "remove" and "insert" to define a new node.`);const a=[],l=ld(t.data,n.config,(d,f)=>(a.push(`${f.parentId}:${f.propName}`),d.map(p=>{const v=it(p.type);return z(O({},p),{props:O({id:v},p.props)})}))),u=z(O({},e),{ui:O(O({},e.ui),t.ui)});return Object.keys(e.indexes.zones).forEach(d=>{d.split(":")[0]===o&&(a.includes(d)||delete u.indexes.zones[d])}),ht(u,n.config,(d,f)=>{const p=[...d];return f===t.destinationZone&&(p[t.destinationIndex]=l),p},(d,f)=>{const p=f.map(v=>v.split(":")[0]);return d.props.id===l.props.id?l:d.props.id===r||s.indexOf(d.props.id)>-1||p.indexOf(l.props.id)>-1?d:null})};P();var um=(e,t,n)=>ht(e,n.config,r=>r,r=>r.props.id==="root"?z(O({},r),{props:O(O({},r.props),t.root.props),readOnly:t.root.readOnly}):r);P();P();function xt(e,t){var n,r;const s=(n=t.indexes.zones)==null?void 0:n[e.zone||Ge];return s?(r=t.indexes.nodes[s.contentIds[e.index]])==null?void 0:r.data:void 0}function dm(e,t,n){const r=xt({index:t.sourceIndex,zone:t.sourceZone},e),s=ns(t.sourceZone,e),o=z(O({},r),{props:z(O({},r.props),{id:it(r.type)})}),i=ht(e,n.config,(a,l)=>l===t.sourceZone?sr(a,t.sourceIndex+1,r):a,(a,l,u)=>{const d=l[l.length-1];if(l.map(v=>v.split(":")[0]).indexOf(o.props.id)>-1)return z(O({},a),{props:z(O({},a.props),{id:it(a.type)})});if(d===t.sourceZone&&u===t.sourceIndex+1)return o;const[p]=t.sourceZone.split(":");return p===a.props.id||s.indexOf(a.props.id)>-1?a:null});return z(O({},i),{ui:z(O({},i.ui),{itemSelector:{index:t.sourceIndex+1,zone:t.sourceZone}})})}P();P();P();var Oi=(e,t)=>{const n=Array.from(e);return n.splice(t,1),n},pd=(e,t,n)=>{if(t.sourceZone===t.destinationZone&&t.sourceIndex===t.destinationIndex)return e;const r=xt({zone:t.sourceZone,index:t.sourceIndex},e);if(!r)return e;const s=ns(t.sourceZone,e),o=ns(t.destinationZone,e);return ht(e,n.config,(i,a)=>a===t.sourceZone&&a===t.destinationZone?sr(Oi(i,t.sourceIndex),t.destinationIndex,r):a===t.sourceZone?Oi(i,t.sourceIndex):a===t.destinationZone?sr(i,t.destinationIndex,r):i,(i,a)=>{const[l]=t.sourceZone.split(":"),[u]=t.destinationZone.split(":"),d=i.props.id;return l===d||u===d||r.props.id===d||s.indexOf(d)>-1||o.indexOf(d)>-1||a.includes(t.destinationZone)?i:null})},fm=(e,t,n)=>pd(e,{sourceIndex:t.sourceIndex,sourceZone:t.destinationZone,destinationIndex:t.destinationIndex,destinationZone:t.destinationZone},n);P();var pm=(e,t,n)=>{const r=xt({index:t.index,zone:t.zone},e),s=Object.entries(e.indexes.nodes).reduce((i,[a,l])=>l.path.map(d=>d.split(":")[0]).includes(r.props.id)?[...i,a]:i,[r.props.id]),o=ht(e,n.config,(i,a)=>a===t.zone?Oi(i,t.index):i);return Object.keys(o.data.zones||{}).forEach(i=>{const a=i.split(":")[0];s.includes(a)&&o.data.zones&&delete o.data.zones[i]}),Object.keys(o.indexes.zones).forEach(i=>{const a=i.split(":")[0];s.includes(a)&&delete o.indexes.zones[i]}),s.forEach(i=>{delete o.indexes.nodes[i]}),o};P();var Xs={};function hm(e,t){return Xs[t.zone]?z(O({},e),{data:z(O({},e.data),{zones:z(O({},e.data.zones),{[t.zone]:Xs[t.zone]})}),indexes:z(O({},e.indexes),{zones:z(O({},e.indexes.zones),{[t.zone]:z(O({},e.indexes.zones[t.zone]),{contentIds:Xs[t.zone].map(n=>n.props.id),type:"dropzone"})})})}):z(O({},e),{data:dd(e.data,t.zone)})}function gm(e,t){const n=O({},e.data.zones||{}),r=O({},e.indexes.zones||{});return n[t.zone]&&(Xs[t.zone]=n[t.zone],delete n[t.zone]),delete r[t.zone],z(O({},e),{data:z(O({},e.data),{zones:n}),indexes:z(O({},e.indexes),{zones:r})})}P();var vm=(e,t,n)=>typeof t.data=="object"?(console.warn("`setData` is expensive and may cause unnecessary re-renders. Consider using a more atomic action instead."),ht(z(O({},e),{data:O(O({},e.data),t.data)}),n.config)):ht(z(O({},e),{data:O(O({},e.data),t.data(e.data))}),n.config);P();var mm=(e,t)=>typeof t.ui=="object"?z(O({},e),{ui:O(O({},e.ui),t.ui)}):z(O({},e),{ui:O(O({},e.ui),t.ui(e.ui))});P();var rs=e=>{const{data:t,ui:n}=e;return{data:t,ui:n}};P();function ym(e,t,n){return(r,s)=>{const o=e(r,s),i=!["registerZone","unregisterZone","setData","setUi","set"].includes(s.type);return(typeof s.recordHistory<"u"?s.recordHistory:i)&&t&&t(o),n==null||n(s,rs(o),rs(r)),o}}function rc({record:e,onAction:t,appStore:n}){return ym((r,s)=>s.type==="set"?lm(r,s,n):s.type==="insert"?fd(r,s,n):s.type==="replace"?cm(r,s,n):s.type==="replaceRoot"?um(r,s,n):s.type==="duplicate"?dm(r,s,n):s.type==="reorder"?fm(r,s,n):s.type==="move"?pd(r,s,n):s.type==="remove"?pm(r,s,n):s.type==="registerZone"?hm(r,s):s.type==="unregisterZone"?gm(r,s):s.type==="setData"?vm(r,s,n):s.type==="setUi"?mm(r,s):r,e,t)}var bm=Object.getOwnPropertyNames,_m=Object.getOwnPropertySymbols,xm=Object.prototype.hasOwnProperty;function sc(e,t){return function(r,s,o){return e(r,s,o)&&t(r,s,o)}}function Ts(e){return function(n,r,s){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,s);var o=s.cache,i=o.get(n),a=o.get(r);if(i&&a)return i===r&&a===n;o.set(n,r),o.set(r,n);var l=e(n,r,s);return o.delete(n),o.delete(r),l}}function oc(e){return bm(e).concat(_m(e))}var wm=Object.hasOwn||(function(e,t){return xm.call(e,t)});function On(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var Sm="__v",km="__o",Im="_owner",ic=Object.getOwnPropertyDescriptor,ac=Object.keys;function Em(e,t,n){var r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function Cm(e,t){return On(e.getTime(),t.getTime())}function jm(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function Pm(e,t){return e===t}function lc(e,t,n){var r=e.size;if(r!==t.size)return!1;if(!r)return!0;for(var s=new Array(r),o=e.entries(),i,a,l=0;(i=o.next())&&!i.done;){for(var u=t.entries(),d=!1,f=0;(a=u.next())&&!a.done;){if(s[f]){f++;continue}var p=i.value,v=a.value;if(n.equals(p[0],v[0],l,f,e,t,n)&&n.equals(p[1],v[1],p[0],v[0],e,t,n)){d=s[f]=!0;break}f++}if(!d)return!1;l++}return!0}var Am=On;function Om(e,t,n){var r=ac(e),s=r.length;if(ac(t).length!==s)return!1;for(;s-- >0;)if(!hd(e,t,n,r[s]))return!1;return!0}function Er(e,t,n){var r=oc(e),s=r.length;if(oc(t).length!==s)return!1;for(var o,i,a;s-- >0;)if(o=r[s],!hd(e,t,n,o)||(i=ic(e,o),a=ic(t,o),(i||a)&&(!i||!a||i.configurable!==a.configurable||i.enumerable!==a.enumerable||i.writable!==a.writable)))return!1;return!0}function Mm(e,t){return On(e.valueOf(),t.valueOf())}function Dm(e,t){return e.source===t.source&&e.flags===t.flags}function cc(e,t,n){var r=e.size;if(r!==t.size)return!1;if(!r)return!0;for(var s=new Array(r),o=e.values(),i,a;(i=o.next())&&!i.done;){for(var l=t.values(),u=!1,d=0;(a=l.next())&&!a.done;){if(!s[d]&&n.equals(i.value,a.value,i.value,a.value,e,t,n)){u=s[d]=!0;break}d++}if(!u)return!1}return!0}function Tm(e,t){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function Rm(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function hd(e,t,n,r){return(r===Im||r===km||r===Sm)&&(e.$$typeof||t.$$typeof)?!0:wm(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}var Lm="[object Arguments]",Nm="[object Boolean]",zm="[object Date]",$m="[object Error]",Fm="[object Map]",Bm="[object Number]",Hm="[object Object]",Vm="[object RegExp]",Wm="[object Set]",Um="[object String]",qm="[object URL]",Zm=Array.isArray,uc=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,dc=Object.assign,Ym=Object.prototype.toString.call.bind(Object.prototype.toString);function Gm(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areErrorsEqual,s=e.areFunctionsEqual,o=e.areMapsEqual,i=e.areNumbersEqual,a=e.areObjectsEqual,l=e.arePrimitiveWrappersEqual,u=e.areRegExpsEqual,d=e.areSetsEqual,f=e.areTypedArraysEqual,p=e.areUrlsEqual;return function(g,m,w){if(g===m)return!0;if(g==null||m==null)return!1;var S=typeof g;if(S!==typeof m)return!1;if(S!=="object")return S==="number"?i(g,m,w):S==="function"?s(g,m,w):!1;var k=g.constructor;if(k!==m.constructor)return!1;if(k===Object)return a(g,m,w);if(Zm(g))return t(g,m,w);if(uc!=null&&uc(g))return f(g,m,w);if(k===Date)return n(g,m,w);if(k===RegExp)return u(g,m,w);if(k===Map)return o(g,m,w);if(k===Set)return d(g,m,w);var y=Ym(g);return y===zm?n(g,m,w):y===Vm?u(g,m,w):y===Fm?o(g,m,w):y===Wm?d(g,m,w):y===Hm?typeof g.then!="function"&&typeof m.then!="function"&&a(g,m,w):y===qm?p(g,m,w):y===$m?r(g,m,w):y===Lm?a(g,m,w):y===Nm||y===Bm||y===Um?l(g,m,w):!1}}function Km(e){var t=e.circular,n=e.createCustomConfig,r=e.strict,s={areArraysEqual:r?Er:Em,areDatesEqual:Cm,areErrorsEqual:jm,areFunctionsEqual:Pm,areMapsEqual:r?sc(lc,Er):lc,areNumbersEqual:Am,areObjectsEqual:r?Er:Om,arePrimitiveWrappersEqual:Mm,areRegExpsEqual:Dm,areSetsEqual:r?sc(cc,Er):cc,areTypedArraysEqual:r?Er:Tm,areUrlsEqual:Rm};if(n&&(s=dc({},s,n(s))),t){var o=Ts(s.areArraysEqual),i=Ts(s.areMapsEqual),a=Ts(s.areObjectsEqual),l=Ts(s.areSetsEqual);s=dc({},s,{areArraysEqual:o,areMapsEqual:i,areObjectsEqual:a,areSetsEqual:l})}return s}function Xm(e){return function(t,n,r,s,o,i,a){return e(t,n,a)}}function Jm(e){var t=e.circular,n=e.comparator,r=e.createState,s=e.equals,o=e.strict;if(r)return function(l,u){var d=r(),f=d.cache,p=f===void 0?t?new WeakMap:void 0:f,v=d.meta;return n(l,u,{cache:p,equals:s,meta:v,strict:o})};if(t)return function(l,u){return n(l,u,{cache:new WeakMap,equals:s,meta:void 0,strict:o})};var i={cache:void 0,equals:s,meta:void 0,strict:o};return function(l,u){return n(l,u,i)}}var ss=mn();mn({strict:!0});mn({circular:!0});mn({circular:!0,strict:!0});mn({createInternalComparator:function(){return On}});mn({strict:!0,createInternalComparator:function(){return On}});mn({circular:!0,createInternalComparator:function(){return On}});mn({circular:!0,createInternalComparator:function(){return On},strict:!0});function mn(e){e===void 0&&(e={});var t=e.circular,n=t===void 0?!1:t,r=e.createInternalComparator,s=e.createState,o=e.strict,i=o===void 0?!1:o,a=Km(e),l=Gm(a),u=r?r(l):Xm(l);return Jm({circular:n,comparator:l,createState:s,equals:u,strict:i})}P();var os=[{width:360,height:"auto",icon:"Smartphone",label:"Small"},{width:768,height:"auto",icon:"Tablet",label:"Medium"},{width:1280,height:"auto",icon:"Monitor",label:"Large"},{width:"100%",height:"auto",icon:"FullWidth",label:"Full-width"}];P();P();var Da=(e,t)=>e?Object.keys(e.props||{}).reduce((n,r)=>{const s=(e==null?void 0:e.props)||{},o=(t==null?void 0:t.props)||{};return z(O({},n),{[r]:!ss(o[r],s[r])})},{}):{},fc={lastChange:{}},gd=(e,t,...n)=>Ee(null,[e,t,...n],function*(r,s,o={},i,a,l="replace",u=null){const d="type"in r&&r.type!=="root"?s.components[r.type]:s.root,f=O({},r),p=(d==null?void 0:d.resolveData)&&r.props,v="id"in r.props?r.props.id:"root";if(p){const{item:w=null,resolved:S={},parentId:k=null}=fc.lastChange[v]||{},b=!(k===null)&&(u==null?void 0:u.props.id)!==k,j=r&&!ss(r,w);if(l==="move"&&!b||l!=="move"&&l!=="force"&&!j)return{node:S,didChange:!1};const A=Da(r,w);i&&i(r);const{props:_,readOnly:I={}}=yield d.resolveData(r,{changed:A,lastData:w,metadata:O(O({},o),d.metadata),trigger:l,parent:u});f.props=O(O({},r.props),_),Object.keys(I).length&&(f.readOnly=I)}const g=_s(f);let m=yield dr(f,{slot:w=>Ee(null,[w],function*({value:S}){const k=S;return yield Promise.all(k.map(y=>Ee(null,null,function*(){return(yield gd(y,s,o,i,a,l,g)).node})))})},s);return p&&a&&a(f),fc.lastChange[v]={item:r,resolved:m,parentId:u==null?void 0:u.props.id},{node:m,didChange:!ss(r,m)}});P();var Mi={data:{content:[],root:{},zones:{}},ui:{leftSideBarVisible:!0,rightSideBarVisible:!0,arrayState:{},itemSelector:null,componentList:{},isDragging:!1,previewMode:"edit",viewports:{current:{width:os[0].width,height:os[0].height||"auto"},options:[],controlsVisible:!0},field:{focus:null},plugin:{current:null}},indexes:{nodes:{},zones:{}}},Qm=Hv({"../../node_modules/classnames/index.js"(e,t){P(),(function(){var n={}.hasOwnProperty;function r(){for(var i="",a=0;a<arguments.length;a++){var l=arguments[a];l&&(i=o(i,s(l)))}return i}function s(i){if(typeof i=="string"||typeof i=="number")return i;if(typeof i!="object")return"";if(Array.isArray(i))return r.apply(null,i);if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]"))return i.toString();var a="";for(var l in i)n.call(i,l)&&i[l]&&(a=o(a,l));return a}function o(i,a){return a?i?i+" "+a:i+a:i}typeof t<"u"&&t.exports?(r.default=r,t.exports=r):typeof define=="function"&&typeof define.amd=="object"&&define.amd?define("classnames",[],function(){return r}):window.classNames=r})()}});P();var ey=Wv(Qm()),ty=(e,t,n={baseClass:""})=>(r={})=>{if(typeof r=="string"){const s=r;return t[`${e}-${s}`]&&n.baseClass+t[`${e}-${s}`]||""}else if(typeof r=="object"){const s=r,o={};for(let a in s)o[t[`${e}--${a}`]]=s[a];const i=t[e];return n.baseClass+(0,ey.default)(O({[i]:!!i},o))}else return n.baseClass+t[e]||""},te=ty;/*! Bundled license information:
18
+
19
+ classnames/index.js:
20
+ (*!
21
+ Copyright (c) 2018 Jed Watson.
22
+ Licensed under the MIT License (MIT), see
23
+ http://jedwatson.github.io/classnames
24
+ *)
25
+ */P();P();P();var ny=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),vd=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();P();P();var ry={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},sy=h.forwardRef((e,t)=>{var n=e,{color:r="currentColor",size:s=24,strokeWidth:o=2,absoluteStrokeWidth:i,className:a="",children:l,iconNode:u}=n,d=Kt(n,["color","size","strokeWidth","absoluteStrokeWidth","className","children","iconNode"]);return h.createElement("svg",O(z(O({ref:t},ry),{width:s,height:s,stroke:r,strokeWidth:i?Number(o)*24/Number(s):o,className:vd("lucide",a)}),d),[...u.map(([f,p])=>h.createElement(f,p)),...Array.isArray(l)?l:[l]])}),ee=(e,t)=>{const n=h.forwardRef((r,s)=>{var o=r,{className:i}=o,a=Kt(o,["className"]);return h.createElement(sy,O({ref:s,iconNode:t,className:vd(`lucide-${ny(e)}`,i)},a))});return n.displayName=`${e}`,n},Ta=ee("AlignLeft",[["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 18H3",key:"1amg6g"}],["path",{d:"M21 6H3",key:"1jwq7v"}]]);P();var oy=ee("Heading",[["path",{d:"M6 12h12",key:"8npq4p"}],["path",{d:"M6 20V4",key:"1w1bmo"}],["path",{d:"M18 20V4",key:"o2hl4u"}]]);P();var zo=ee("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);P();P();var md=ee("AlignCenter",[["path",{d:"M17 12H7",key:"16if0g"}],["path",{d:"M19 18H5",key:"18s9l3"}],["path",{d:"M21 6H3",key:"1jwq7v"}]]);P();var yd=ee("AlignJustify",[["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M3 18h18",key:"1h113x"}],["path",{d:"M3 6h18",key:"d0wm0j"}]]);P();var bd=ee("AlignRight",[["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M21 18H7",key:"1ygte8"}],["path",{d:"M21 6H3",key:"1jwq7v"}]]);P();var iy=ee("Bold",[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]]);P();var or=ee("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);P();var ay=ee("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);P();var _d=ee("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);P();var ly=ee("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);P();var cy=ee("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);P();var xd=ee("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);P();var uy=ee("CornerLeftUp",[["polyline",{points:"14 9 9 4 4 9",key:"m9oyvo"}],["path",{d:"M20 20h-7a4 4 0 0 1-4-4V4",key:"1blwi3"}]]);P();var dy=ee("EllipsisVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);P();var fy=ee("Expand",[["path",{d:"m21 21-6-6m6 6v-4.8m0 4.8h-4.8",key:"1c15vz"}],["path",{d:"M3 16.2V21m0 0h4.8M3 21l6-6",key:"1fsnz2"}],["path",{d:"M21 7.8V3m0 0h-4.8M21 3l-6 6",key:"hawz9i"}],["path",{d:"M3 7.8V3m0 0h4.8M3 3l6 6",key:"u9ee12"}]]);P();var pc=ee("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);P();var py=ee("Hammer",[["path",{d:"m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9",key:"eefl8a"}],["path",{d:"m18 15 4-4",key:"16gjal"}],["path",{d:"m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172V7l-2.26-2.26a6 6 0 0 0-4.202-1.756L9 2.96l.92.82A6.18 6.18 0 0 1 12 8.4V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5",key:"b7pghm"}]]);P();var hy=ee("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);P();var gy=ee("Heading1",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"m17 12 3-2v8",key:"1hhhft"}]]);P();var vy=ee("Heading2",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}]]);P();var my=ee("Heading3",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2",key:"68ncm8"}],["path",{d:"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2",key:"1ejuhz"}]]);P();var yy=ee("Heading4",[["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17 10v3a1 1 0 0 0 1 1h3",key:"tj5zdr"}],["path",{d:"M21 10v8",key:"1kdml4"}],["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}]]);P();var by=ee("Heading5",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17 13v-3h4",key:"1nvgqp"}],["path",{d:"M17 17.7c.4.2.8.3 1.3.3 1.5 0 2.7-1.1 2.7-2.5S19.8 13 18.3 13H17",key:"2nebdn"}]]);P();var _y=ee("Heading6",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["circle",{cx:"19",cy:"16",r:"2",key:"15mx69"}],["path",{d:"M20 10c-2 2-3 3.5-3 6",key:"f35dl0"}]]);P();var xy=ee("Italic",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]);P();var wd=ee("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);P();var wy=ee("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);P();var Sd=ee("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);P();var kd=ee("ListOrdered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);P();var Sy=ee("LockOpen",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]]);P();var ky=ee("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);P();var Iy=ee("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);P();var Ey=ee("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);P();var Cy=ee("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);P();var Id=ee("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);P();var jy=ee("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);P();var Py=ee("PanelRight",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);P();var Ay=ee("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);P();var Oy=ee("Quote",[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]);P();var My=ee("RectangleEllipsis",[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M17 12h.01",key:"1m0b6t"}],["path",{d:"M7 12h.01",key:"eqddd0"}]]);P();var Dy=ee("Redo2",[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]]);P();var Ty=ee("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);P();var Ry=ee("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);P();var Ly=ee("Smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);P();var Ny=ee("SquareCode",[["path",{d:"M10 9.5 8 12l2 2.5",key:"3mjy60"}],["path",{d:"m14 9.5 2 2.5-2 2.5",key:"1bir2l"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);P();var zy=ee("Strikethrough",[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]]);P();var $y=ee("Tablet",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["line",{x1:"12",x2:"12.01",y1:"18",y2:"18",key:"1dp563"}]]);P();var Fy=ee("ToyBrick",[["rect",{width:"18",height:"12",x:"3",y:"8",rx:"1",key:"158fvp"}],["path",{d:"M10 8V5c0-.6-.4-1-1-1H6a1 1 0 0 0-1 1v3",key:"s0042v"}],["path",{d:"M19 8V5c0-.6-.4-1-1-1h-3a1 1 0 0 0-1 1v3",key:"9wmeh2"}]]);P();var Ed=ee("Trash",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]]);P();var $o=ee("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);P();var By=ee("Underline",[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]]);P();var Hy=ee("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);P();var Vy=ee("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);P();var Wy=ee("ZoomIn",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]);P();var Uy=ee("ZoomOut",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]);P();P();P();var hc={ControlLeft:"ctrl",ControlRight:"ctrl",MetaLeft:"meta",MetaRight:"meta",ShiftLeft:"shift",ShiftRight:"shift",KeyA:"a",KeyB:"b",KeyC:"c",KeyD:"d",KeyE:"e",KeyF:"f",KeyG:"g",KeyH:"h",KeyI:"i",KeyJ:"j",KeyK:"k",KeyL:"l",KeyM:"m",KeyN:"n",KeyO:"o",KeyP:"p",KeyQ:"q",KeyR:"r",KeyS:"s",KeyT:"t",KeyU:"u",KeyV:"v",KeyW:"w",KeyX:"x",KeyY:"y",KeyZ:"z",Delete:"delete",Backspace:"backspace",AltRight:"altRight"},Lt=Yu()(Ia(e=>({held:{},hold:t=>e(n=>n.held[t]?n:{held:z(O({},n.held),{[t]:!0})}),release:t=>e(n=>n.held[t]?{held:z(O({},n.held),{[t]:!1})}:n),reset:(t={})=>e(()=>({held:t})),triggers:{}}))),Cd=e=>{const t=o=>{if(o.getModifierState("AltGraph")){Lt.getState().hold("altRight");return}const i=hc[o.code];if(i){Lt.getState().hold(i);const{held:a,triggers:l}=Lt.getState();Object.values(l).forEach(({combo:u,cb:d})=>{Object.entries(u).every(([p,v])=>v===!!a[p])&&Object.entries(a).every(([p,v])=>v===!!u[p])&&d(o)!==!1&&o.preventDefault()}),i!=="meta"&&i!=="ctrl"&&i!=="shift"&&Lt.getState().release(i)}},n=o=>{if(!o.getModifierState("AltGraph")&&o.code==="ControlRight"){Lt.getState().release("altRight");return}const i=hc[o.code];i&&(i==="meta"?Lt.getState().reset():Lt.getState().release(i))},r=o=>{document.visibilityState==="hidden"&&Lt.getState().reset()},s=()=>{Lt.getState().reset()};return window.addEventListener("blur",s),e.addEventListener("keydown",t),e.addEventListener("keyup",n),e.addEventListener("visibilitychange",r),()=>{e.removeEventListener("keydown",t),e.removeEventListener("keyup",n),e.removeEventListener("visibilitychange",r),window.removeEventListener("blur",s)}},qy=()=>{h.useEffect(()=>Cd(document),[])},zt=(e,t)=>{h.useEffect(()=>Lt.setState(n=>({triggers:z(O({},n.triggers),{[`${Object.keys(e).join("+")}`]:{combo:e,cb:t}})})),[])},gc=0;function Zy(e,t=300){let n;return(...r)=>{clearTimeout(n),n=setTimeout(()=>{e(...r)},t)}}var vc=e=>z(O({},e),{ui:z(O({},e.ui),{field:z(O({},e.ui.field),{focus:null})})}),Yy=(e,t)=>{const n=Zy(r=>{const{histories:s,index:o}=t().history,i={state:r,id:it("history")},a=[...s.slice(0,o+1),i];e({history:z(O({},t().history),{histories:a,index:a.length-1})})},250);return{initialAppState:{},index:gc,histories:[],hasPast:()=>t().history.index>gc,hasFuture:()=>t().history.index<t().history.histories.length-1,prevHistory:()=>{const{history:r}=t();return r.hasPast()?r.histories[r.index-1]:null},nextHistory:()=>{const r=t().history;return r.hasFuture()?r.histories[r.index+1]:null},currentHistory:()=>t().history.histories[t().history.index],back:()=>{var r;const{history:s,dispatch:o}=t();if(s.hasPast()){const i=vc(((r=s.prevHistory())==null?void 0:r.state)||s.initialAppState);o({type:"set",state:i}),e({history:z(O({},s),{index:s.index-1})})}},forward:()=>{var r;const{history:s,dispatch:o}=t();if(s.hasFuture()){const i=(r=s.nextHistory())==null?void 0:r.state;o({type:"set",state:i?vc(i):{}}),e({history:z(O({},s),{index:s.index+1})})}},setHistories:r=>{var s;const{dispatch:o,history:i}=t();o({type:"set",state:((s=r[r.length-1])==null?void 0:s.state)||i.initialAppState}),e({history:z(O({},i),{histories:r,index:r.length-1})})},setHistoryIndex:r=>{var s;const{dispatch:o,history:i}=t();o({type:"set",state:((s=i.histories[r])==null?void 0:s.state)||i.initialAppState}),e({history:z(O({},i),{index:r})})},record:n}};function Gy(e,{histories:t,index:n,initialAppState:r}){h.useEffect(()=>e.setState({history:z(O({},e.getState().history),{histories:t,index:n,initialAppState:r})}),[t,n,r]);const s=()=>{e.getState().history.back()},o=()=>{e.getState().history.forward()};zt({altRight:!1,meta:!0,z:!0},s),zt({altRight:!1,meta:!0,shift:!0,z:!0},o),zt({altRight:!1,meta:!0,y:!0},o),zt({altRight:!1,ctrl:!0,z:!0},s),zt({altRight:!1,ctrl:!0,shift:!0,z:!0},o),zt({altRight:!1,ctrl:!0,y:!0},o)}P();var Ky=(e,t)=>{const n=new Map;return{registerNode:(r,s)=>{n.set(r,s)},unregisterNode:r=>{n.delete(r)},syncNode:r=>{var s;r&&((s=n.get(r))==null||s.sync())},syncNodes:r=>{r.forEach(s=>{var o;s&&((o=n.get(s))==null||o.sync())})},setOverlayVisible:(r,s)=>{if(!r)return;const o=n.get(r);if(o){if(s){o.showOverlay();return}o.hideOverlay()}}}};P();P();var mc=(e,t)=>{const n=[];return ht(e,t,r=>r,r=>(n.push(r),r)),n},Xy=(e,t)=>{const n=(...s)=>Ee(null,[...s],function*(o={},i){const{state:a,permissions:l,config:u}=t(),{cache:d,globalPermissions:f}=l,p=(S,k=!1)=>Ee(null,null,function*(){var y,b;const{config:j,state:C,setComponentLoading:A}=t(),_=d[S.props.id],I=C.indexes.nodes,x=(y=I[S.props.id])==null?void 0:y.parentId,M=x?I[x]:null,D=(b=M==null?void 0:M.data)!=null?b:null,L=S.type==="root"?j.root:j.components[S.type];if(!L)return;const N=O(O({},f),L.permissions);if(L.resolvePermissions){const F=Da(S,_==null?void 0:_.lastData),B=Object.values(F).some($=>$===!0),K=(_==null?void 0:_.lastParentId)!==x;if(B||K||k){const $=A(S.props.id,!0,50),U=yield L.resolvePermissions(S,{changed:F,lastPermissions:(_==null?void 0:_.lastPermissions)||null,permissions:N,appState:rs(C),lastData:(_==null?void 0:_.lastData)||null,parent:D}),Z=t().permissions;e({permissions:z(O({},Z),{cache:z(O({},Z.cache),{[S.props.id]:{lastParentId:x,lastData:S,lastPermissions:U}}),resolvedPermissions:z(O({},Z.resolvedPermissions),{[S.props.id]:U})})}),$()}}}),v=(S=!1)=>{const{state:k}=t();p({type:"root",props:z(O({},k.data.root.props),{id:"root"})},S)},{item:g,type:m,root:w}=o;g?yield p(g,i):m?mc(a,u).filter(S=>S.type===m).map(S=>Ee(null,null,function*(){yield p(S,i)})):w?v(i):mc(a,u).map(S=>Ee(null,null,function*(){yield p(S,i)}))});return{cache:{},globalPermissions:{drag:!0,edit:!0,delete:!0,duplicate:!0,insert:!0},resolvedPermissions:{},getPermissions:({item:s,type:o,root:i}={})=>{const{config:a,permissions:l}=t(),{globalPermissions:u,resolvedPermissions:d}=l;if(s){const f=a.components[s.type],p=O(O({},u),f==null?void 0:f.permissions),v=d[s.props.id];return v?O(O({},u),v):p}else if(o){const f=a.components[o];return O(O({},u),f==null?void 0:f.permissions)}else if(i){const f=a.root,p=O(O({},u),f==null?void 0:f.permissions),v=d.root;return v?O(O({},u),v):p}return u},resolvePermissions:n,refreshPermissions:s=>n(s,!0)}},Jy=(e,t)=>{h.useEffect(()=>{const{permissions:n}=e.getState(),{globalPermissions:r}=n;e.setState({permissions:z(O({},n),{globalPermissions:O(O({},r),t)})}),n.resolvePermissions()},[t]),h.useEffect(()=>e.subscribe(n=>n.state.data,()=>{e.getState().permissions.resolvePermissions()}),[]),h.useEffect(()=>e.subscribe(n=>n.config,()=>{e.getState().permissions.resolvePermissions()}),[])};P();var Qy=(e,t)=>({fields:{},loading:!1,lastResolvedData:{},id:void 0}),eb=(e,t)=>{const n=h.useCallback(r=>Ee(null,null,function*(){var s,o;const{fields:i,lastResolvedData:a}=e.getState().fields,l=e.getState().metadata,u=e.getState().state.indexes.nodes,d=u[t||"root"],f=d==null?void 0:d.data,p=d!=null&&d.parentId?u[d.parentId]:null,v=(p==null?void 0:p.data)||null,{getComponentConfig:g,state:m}=e.getState(),w=g(f==null?void 0:f.type);if(!f||!w)return;const S=w.fields||{},k=w.resolveFields;let y=i;if(r&&(e.setState(b=>({fields:z(O({},b.fields),{fields:S,id:t})})),y=S),k){const b=setTimeout(()=>{e.setState(_=>({fields:z(O({},_.fields),{loading:!0})}))},50),j=((s=a.props)==null?void 0:s.id)===t?a:null,C=Da(f,j),A=yield k(f,{changed:C,fields:S,lastFields:y,metadata:O(O({},l),w.metadata),lastData:j,appState:rs(m),parent:v});if(clearTimeout(b),((o=e.getState().selectedItem)==null?void 0:o.props.id)!==t)return;e.setState({fields:{fields:A,loading:!1,lastResolvedData:f,id:t}})}else e.setState(b=>({fields:z(O({},b.fields),{fields:S,id:t})}))}),[t]);h.useEffect(()=>(n(!0),e.subscribe(r=>r.state.indexes.nodes[t||"root"],()=>n())),[t])};P();var tb=e=>{if("type"in e&&e.type!=="root")throw new Error("Converting non-root item to root.");const{readOnly:t}=e;if(e.props){if("id"in e.props){const n=e.props,{id:r}=n;return{props:Kt(n,["id"]),readOnly:t}}return{props:e.props,readOnly:t}}return{props:{},readOnly:t}},nb={title:{type:"text"}},jd=e=>Yu()(Ia((t,n)=>{var r,s;return z(O({instanceId:it(),state:Mi,config:{components:{}},componentState:{},plugins:[],overrides:{},viewports:os,zoomConfig:{autoZoom:1,rootHeight:0,zoom:1},status:"LOADING",iframe:{},_experimentalFullScreenCanvas:!1,_experimentalVirtualization:!1,metadata:{},fieldTransforms:{}},e),{fields:Qy(),history:Yy(t,n),nodes:Ky(),permissions:Xy(t,n),getCurrentData:()=>{var o;const i=n();return(o=i.selectedItem)!=null?o:i.state.data.root},getComponentConfig:o=>{var i;const{config:a,selectedItem:l}=n(),u=((i=a.root)==null?void 0:i.fields)||nb;return o&&o!=="root"?a.components[o]:l?a.components[l.type]:z(O({},a.root),{fields:u})},selectedItem:(r=e==null?void 0:e.state)!=null&&r.ui.itemSelector?xt((s=e==null?void 0:e.state)==null?void 0:s.ui.itemSelector,e.state):null,dispatch:o=>t(i=>{var a,l;const{record:u}=n().history,f=rc({record:u,appStore:i})(i.state,o),p=f.ui.itemSelector?xt(f.ui.itemSelector,f):null;return(l=(a=n()).onAction)==null||l.call(a,o,f,n().state),z(O({},i),{state:f,selectedItem:p})}),setZoomConfig:o=>t({zoomConfig:o}),setStatus:o=>t({status:o}),setComponentState:o=>t({componentState:o}),pendingLoadTimeouts:{},setComponentLoading:(o,i=!0,a=0)=>{const{setComponentState:l,pendingLoadTimeouts:u}=n(),d=it(),f=()=>{var g;const{componentState:m}=n();l(z(O({},m),{[o]:z(O({},m[o]),{loadingCount:(((g=m[o])==null?void 0:g.loadingCount)||0)+1})}))},p=()=>{var g;const{componentState:m}=n();clearTimeout(v),delete u[d],t({pendingLoadTimeouts:u}),l(z(O({},m),{[o]:z(O({},m[o]),{loadingCount:Math.max((((g=m[o])==null?void 0:g.loadingCount)||0)-1,0)})}))},v=setTimeout(()=>{i?f():p(),delete u[d],t({pendingLoadTimeouts:u})},a);return t({pendingLoadTimeouts:z(O({},u),{[o]:v})}),p},unsetComponentLoading:o=>{const{setComponentLoading:i}=n();i(o,!1)},setUi:(o,i)=>t(a=>{const u=rc({record:()=>{},appStore:a})(a.state,{type:"setUi",ui:o,recordHistory:i}),d=u.ui.itemSelector?xt(u.ui.itemSelector,u):null;return z(O({},a),{state:u,selectedItem:d})}),resolveComponentData:(o,i)=>Ee(null,null,function*(){var a,l;const{config:u,metadata:d,setComponentLoading:f,permissions:p,state:v}=n(),g="id"in o.props?o.props.id:"root",m=(a=v.indexes.nodes[g])==null?void 0:a.parentId,w=m?v.indexes.nodes[m]:null,S=(l=w==null?void 0:w.data)!=null?l:null,k={};return yield gd(o,u,d,y=>{const b="id"in y.props?y.props.id:"root";k[b]=f(b,!0,50)},y=>Ee(null,null,function*(){const b="id"in y.props?y.props.id:"root";"type"in y?yield p.refreshPermissions({item:y}):yield p.refreshPermissions({root:!0}),k[b]()}),i,S)}),resolveAndCommitData:()=>Ee(null,null,function*(){const{config:o,state:i,dispatch:a,resolveComponentData:l}=n();ht(i,o,u=>u,(u,d)=>(d.length>1||l(u,"load").then(f=>{const{state:p}=n(),v=p.indexes.nodes[f.node.props.id];if(v&&f.didChange)if(f.node.props.id==="root")a({type:"replaceRoot",root:tb(f.node)});else{const g=`${v.parentId}:${v.zone}`,w=p.indexes.zones[g].contentIds.indexOf(f.node.props.id);a({type:"replace",data:f.node,destinationIndex:w,destinationZone:g})}}),u))})})})),Ra=h.createContext(jd());function H(e){const t=h.useContext(Ra);return Lo(t,e)}function Ae(){return h.useContext(Ra)}P();var Pd=h.createContext({}),ze=()=>h.useContext(Pd);P();P();P();var Ad={Select:"_Select_xjbef_1","Select-button":"_Select-button_xjbef_6","Select--hasOptions":"_Select--hasOptions_xjbef_19","Select--disabled":"_Select--disabled_xjbef_23","Select-buttonIcon":"_Select-buttonIcon_xjbef_27","Select--standalone":"_Select--standalone_xjbef_33","Select--actionBar":"_Select--actionBar_xjbef_38","Select--hasValue":"_Select--hasValue_xjbef_44","Select-items":"_Select-items_xjbef_61",SelectItem:"_SelectItem_xjbef_72","SelectItem--isSelected":"_SelectItem--isSelected_xjbef_87","SelectItem-icon":"_SelectItem-icon_xjbef_93"};P();P();P();var yc=(e,t,n)=>{const r=Array.from(e),[s]=r.splice(t,1);return r.splice(n,0,s),r};P();var rb=(e,t,n)=>{const r=Array.from(e);return r.splice(t,1),r.splice(t,0,n),r};P();P();P();P();var sb="Invariant failed";function ob(e,t){throw new Error(sb)}var Rs=function(t){var n=t.top,r=t.right,s=t.bottom,o=t.left,i=r-o,a=s-n,l={top:n,right:r,bottom:s,left:o,width:i,height:a,x:o,y:n,center:{x:(r+o)/2,y:(s+n)/2}};return l},ib=function(t,n){return{top:t.top-n.top,left:t.left-n.left,bottom:t.bottom+n.bottom,right:t.right+n.right}},bc=function(t,n){return{top:t.top+n.top,left:t.left+n.left,bottom:t.bottom-n.bottom,right:t.right-n.right}},ni={top:0,right:0,bottom:0,left:0},ab=function(t){var n=t.borderBox,r=t.margin,s=r===void 0?ni:r,o=t.border,i=o===void 0?ni:o,a=t.padding,l=a===void 0?ni:a,u=Rs(ib(n,s)),d=Rs(bc(n,i)),f=Rs(bc(d,l));return{marginBox:u,borderBox:Rs(n),paddingBox:d,contentBox:f,margin:s,border:i,padding:l}},mt=function(t){var n=t.slice(0,-2),r=t.slice(-2);if(r!=="px")return 0;var s=Number(n);return isNaN(s)&&ob(),s},lb=function(t,n){var r={top:mt(n.marginTop),right:mt(n.marginRight),bottom:mt(n.marginBottom),left:mt(n.marginLeft)},s={top:mt(n.paddingTop),right:mt(n.paddingRight),bottom:mt(n.paddingBottom),left:mt(n.paddingLeft)},o={top:mt(n.borderTopWidth),right:mt(n.borderRightWidth),bottom:mt(n.borderBottomWidth),left:mt(n.borderLeftWidth)};return ab({borderBox:t,margin:r,padding:s,border:o})},Od=function(t){var n=t.getBoundingClientRect(),r=window.getComputedStyle(t);return lb(n,r)},cb=(e,t,n)=>{const r=Od(t),{width:s,height:o}=r.contentBox,i=e.height==="auto"?o:e.height;let a=0,l=1;if(typeof e.width=="number"&&(e.width>s||i>o)){const u=Math.min(s/e.width,1),d=Math.min(o/i,1);n=u,u<d?a=i/n:(a=i,n=d),l=n}else l=1,n=1,a=i;return{autoZoom:l,rootHeight:a,zoom:n}},Md=e=>{const t=Ae();return r=>{const{state:s,zoomConfig:o,setZoomConfig:i}=t.getState(),{viewports:a}=s.ui,l=(r==null?void 0:r.viewports)||a;e.current&&i(cb(l==null?void 0:l.current,e.current,o.zoom))}},Fn=te("Select",Ad),Dd=te("SelectItem",Ad),ub=({children:e,isSelected:t,onClick:n})=>c.jsx("button",{className:Dd({isSelected:t}),onClick:n,children:e}),db=({children:e,options:t,onChange:n,value:r,defaultValue:s,mode:o,disabled:i=!1})=>{const[a,l]=h.useState(!1),u=t.length>0,d=i||!u;return c.jsx("div",{className:Fn({hasValue:r!==s,hasOptions:u,actionBar:o==="actionBar",standalone:o==="standalone",disabled:d}),children:c.jsxs(Ku,{open:a,onOpenChange:l,children:[u?c.jsx(Qu,{asChild:!0,children:c.jsxs("button",{className:Fn("button"),children:[c.jsx("span",{className:Fn("buttonIcon"),children:e}),c.jsx(or,{size:12})]})}):c.jsx("div",{children:c.jsxs("div",{className:Fn("button"),children:[c.jsx("span",{className:Fn("buttonIcon"),children:e}),c.jsx(or,{size:12})]})}),t.length>0&&c.jsx(ed,{children:c.jsx(td,{align:"start",children:c.jsx("ul",{className:Fn("items"),"data-puck-rte-menu":!0,children:t.map(f=>{const p=f.icon;return c.jsx("li",{children:c.jsxs(ub,{isSelected:r===f.value,onClick:()=>{n(f.value),l(!1)},children:[p&&c.jsx("div",{className:Dd("icon"),children:c.jsx(p,{size:16})}),f.label]})},f.value)})})})})]})})};function La({renderDefaultIcon:e,onChange:t,options:n,value:r,defaultValue:s}){var o,i;const{inline:a,readOnly:l}=ze(),u=h.useMemo(()=>n.reduce((f,p)=>z(O({},f),{[p.value]:p}),{}),[n]),d=(i=r&&((o=u[r])==null?void 0:o.icon))!=null?i:e;return c.jsx(db,{options:n,onChange:t,value:r,defaultValue:s,mode:a?"actionBar":"standalone",disabled:l,children:c.jsx(d,{})})}/*! Bundled license information:
26
+
27
+ lucide-react/dist/esm/shared/src/utils.js:
28
+ lucide-react/dist/esm/defaultAttributes.js:
29
+ lucide-react/dist/esm/Icon.js:
30
+ lucide-react/dist/esm/createLucideIcon.js:
31
+ lucide-react/dist/esm/icons/align-left.js:
32
+ lucide-react/dist/esm/icons/heading.js:
33
+ lucide-react/dist/esm/icons/list.js:
34
+ lucide-react/dist/esm/icons/align-center.js:
35
+ lucide-react/dist/esm/icons/align-justify.js:
36
+ lucide-react/dist/esm/icons/align-right.js:
37
+ lucide-react/dist/esm/icons/bold.js:
38
+ lucide-react/dist/esm/icons/chevron-down.js:
39
+ lucide-react/dist/esm/icons/chevron-right.js:
40
+ lucide-react/dist/esm/icons/chevron-up.js:
41
+ lucide-react/dist/esm/icons/circle-check-big.js:
42
+ lucide-react/dist/esm/icons/code.js:
43
+ lucide-react/dist/esm/icons/copy.js:
44
+ lucide-react/dist/esm/icons/corner-left-up.js:
45
+ lucide-react/dist/esm/icons/ellipsis-vertical.js:
46
+ lucide-react/dist/esm/icons/expand.js:
47
+ lucide-react/dist/esm/icons/globe.js:
48
+ lucide-react/dist/esm/icons/hammer.js:
49
+ lucide-react/dist/esm/icons/hash.js:
50
+ lucide-react/dist/esm/icons/heading-1.js:
51
+ lucide-react/dist/esm/icons/heading-2.js:
52
+ lucide-react/dist/esm/icons/heading-3.js:
53
+ lucide-react/dist/esm/icons/heading-4.js:
54
+ lucide-react/dist/esm/icons/heading-5.js:
55
+ lucide-react/dist/esm/icons/heading-6.js:
56
+ lucide-react/dist/esm/icons/italic.js:
57
+ lucide-react/dist/esm/icons/layers.js:
58
+ lucide-react/dist/esm/icons/layout-grid.js:
59
+ lucide-react/dist/esm/icons/link.js:
60
+ lucide-react/dist/esm/icons/list-ordered.js:
61
+ lucide-react/dist/esm/icons/lock-open.js:
62
+ lucide-react/dist/esm/icons/lock.js:
63
+ lucide-react/dist/esm/icons/maximize-2.js:
64
+ lucide-react/dist/esm/icons/minimize-2.js:
65
+ lucide-react/dist/esm/icons/minus.js:
66
+ lucide-react/dist/esm/icons/monitor.js:
67
+ lucide-react/dist/esm/icons/panel-left.js:
68
+ lucide-react/dist/esm/icons/panel-right.js:
69
+ lucide-react/dist/esm/icons/plus.js:
70
+ lucide-react/dist/esm/icons/quote.js:
71
+ lucide-react/dist/esm/icons/rectangle-ellipsis.js:
72
+ lucide-react/dist/esm/icons/redo-2.js:
73
+ lucide-react/dist/esm/icons/search.js:
74
+ lucide-react/dist/esm/icons/sliders-horizontal.js:
75
+ lucide-react/dist/esm/icons/smartphone.js:
76
+ lucide-react/dist/esm/icons/square-code.js:
77
+ lucide-react/dist/esm/icons/strikethrough.js:
78
+ lucide-react/dist/esm/icons/tablet.js:
79
+ lucide-react/dist/esm/icons/toy-brick.js:
80
+ lucide-react/dist/esm/icons/trash.js:
81
+ lucide-react/dist/esm/icons/type.js:
82
+ lucide-react/dist/esm/icons/underline.js:
83
+ lucide-react/dist/esm/icons/undo-2.js:
84
+ lucide-react/dist/esm/icons/x.js:
85
+ lucide-react/dist/esm/icons/zoom-in.js:
86
+ lucide-react/dist/esm/icons/zoom-out.js:
87
+ lucide-react/dist/esm/lucide-react.js:
88
+ (**
89
+ * @license lucide-react v0.468.0 - ISC
90
+ *
91
+ * This source code is licensed under the ISC license.
92
+ * See the LICENSE file in the root directory of this source tree.
93
+ *)
94
+ */P();var _c={left:{label:"Left",icon:Ta},center:{label:"Center",icon:md},right:{label:"Right",icon:bd},justify:{label:"Justify",icon:yd}},fb=e=>{var t;let n=[];return(e==null?void 0:e.textAlign)!==!1&&((t=e==null?void 0:e.textAlign)!=null&&t.alignments?(e!=null&&e.textAlign.alignments.includes("left")&&n.push("left"),e!=null&&e.textAlign.alignments.includes("center")&&n.push("center"),e!=null&&e.textAlign.alignments.includes("right")&&n.push("right"),e!=null&&e.textAlign.alignments.includes("justify")&&n.push("justify")):n=["left","center","right","justify"]),h.useMemo(()=>n.map(r=>({value:r,label:_c[r].label,icon:_c[r].icon})),[n])};P();var xc={h1:{label:"Heading 1",icon:gy},h2:{label:"Heading 2",icon:vy},h3:{label:"Heading 3",icon:my},h4:{label:"Heading 4",icon:yy},h5:{label:"Heading 5",icon:by},h6:{label:"Heading 6",icon:_y}},pb=e=>{var t;let n=[];return(e==null?void 0:e.heading)!==!1&&((t=e==null?void 0:e.heading)!=null&&t.levels?(e!=null&&e.heading.levels.includes(1)&&n.push("h1"),e!=null&&e.heading.levels.includes(2)&&n.push("h2"),e!=null&&e.heading.levels.includes(3)&&n.push("h3"),e!=null&&e.heading.levels.includes(4)&&n.push("h4"),e!=null&&e.heading.levels.includes(5)&&n.push("h5"),e!=null&&e.heading.levels.includes(6)&&n.push("h6")):n=["h1","h2","h3","h4","h5","h6"]),h.useMemo(()=>n.map(r=>({value:r,label:xc[r].label,icon:xc[r].icon})),[n])};P();var wc={ul:{label:"Bullet list",icon:zo},ol:{label:"Numbered list",icon:kd}},hb=e=>{let t=[];return(e==null?void 0:e.listItem)!==!1&&(t=["ul","ol"]),h.useMemo(()=>t.map(n=>({value:n,label:wc[n].label,icon:wc[n].icon})),[t])};P();P();var Td={ActionBar:"_ActionBar_1nmyk_1","ActionBar-label":"_ActionBar-label_1nmyk_18",ActionBarAction:"_ActionBarAction_1nmyk_30","ActionBar-group":"_ActionBar-group_1nmyk_38","ActionBarAction--disabled":"_ActionBarAction--disabled_1nmyk_71","ActionBarAction--active":"_ActionBarAction--active_1nmyk_93","ActionBar-separator":"_ActionBar-separator_1nmyk_102"},is=te("ActionBar",Td),gb=te("ActionBarAction",Td),pt=({label:e,children:t})=>c.jsxs("div",{className:is(),onClick:n=>{n.stopPropagation()},children:[e&&c.jsx(pt.Group,{children:c.jsx("div",{className:is("label"),children:e})}),t]}),Rd=({children:e,label:t,onClick:n,active:r=!1,disabled:s})=>c.jsx("button",{type:"button",className:gb({active:r,disabled:s}),onClick:n,title:t,tabIndex:0,disabled:s,children:e}),vb=({children:e})=>c.jsx("div",{className:is("group"),children:e}),mb=({label:e})=>c.jsx("div",{className:is("label"),children:e}),yb=()=>c.jsx("div",{className:is("separator")});pt.Action=Rd;pt.Label=mb;pt.Group=vb;pt.Separator=yb;P();P();var bb={IconButton:"_IconButton_ffob9_1","IconButton--active":"_IconButton--active_ffob9_14","IconButton--disabled":"_IconButton--disabled_ffob9_24","IconButton-title":"_IconButton-title_ffob9_37"};P();P();var _b={Loader:"_Loader_nacdm_13","loader-animation":"_loader-animation_nacdm_1"},xb=te("Loader",_b),Mn=e=>{var t=e,{color:n,size:r=16}=t,s=Kt(t,["color","size"]);return c.jsx("span",O({className:xb(),style:{width:r,height:r,color:n},"aria-label":"loading"},s))},Sc=te("IconButton",bb),jt=({active:e=!1,children:t,href:n,onClick:r,type:s,disabled:o,tabIndex:i,newTab:a,fullWidth:l,title:u,suppressHydrationWarning:d})=>{const[f,p]=h.useState(!1),v=n?"a":"button";return c.jsxs(v,{className:Sc({active:e,disabled:o,fullWidth:l}),onClick:m=>{r&&(p(!0),Promise.resolve(r(m)).then(()=>{p(!1)}))},type:s,disabled:o||f,tabIndex:i,target:a?"_blank":void 0,rel:a?"noreferrer":void 0,href:n,title:u,suppressHydrationWarning:d,children:[c.jsx("span",{className:Sc("title"),children:u}),t,f&&c.jsxs(c.Fragment,{children:["  ",c.jsx(Mn,{size:14})]})]})};P();P();var wb={RichTextMenu:"_RichTextMenu_k97eh_1","RichTextMenu--form":"_RichTextMenu--form_k97eh_7","RichTextMenu-group":"_RichTextMenu-group_k97eh_17","RichTextMenu--inline":"_RichTextMenu--inline_k97eh_35"};P();P();P();P();P();var Sb={Control:"_Control_1aveu_1","Control--inline":"_Control--inline_1aveu_6"},kc=te("Control",Sb);function at({icon:e,disabled:t,active:n,onClick:r,title:s}){const{inline:o}=ze();return o?c.jsx("span",{className:kc({inline:!0}),children:c.jsx(Rd,{onClick:r,disabled:t,active:n,label:s,children:e})}):c.jsx("span",{className:kc(),children:c.jsx(jt,{onClick:r,disabled:t,active:n,title:s,children:e})})}function kb(){const{editor:e,editorState:t}=ze();return c.jsx(at,{icon:c.jsx(Ta,{}),onClick:n=>{n.stopPropagation(),e==null||e.chain().focus().setTextAlign("left").run()},disabled:!(t!=null&&t.canAlignLeft),active:t==null?void 0:t.isAlignLeft,title:"Align left"})}P();function Ib(){const{editor:e,editorState:t}=ze();return c.jsx(at,{icon:c.jsx(md,{}),onClick:n=>{n.stopPropagation(),e==null||e.chain().focus().setTextAlign("center").run()},disabled:!(t!=null&&t.canAlignCenter),active:t==null?void 0:t.isAlignCenter,title:"Align center"})}P();function Eb(){const{editor:e,editorState:t}=ze();return c.jsx(at,{icon:c.jsx(bd,{}),onClick:n=>{n.stopPropagation(),e==null||e.chain().focus().setTextAlign("right").run()},disabled:!(t!=null&&t.canAlignRight),active:t==null?void 0:t.isAlignRight,title:"Align right"})}P();function Cb(){const{editor:e,editorState:t}=ze();return c.jsx(at,{icon:c.jsx(yd,{}),onClick:n=>{n.stopPropagation(),e==null||e.chain().focus().setTextAlign("justify").run()},disabled:!(t!=null&&t.canAlignJustify),active:t==null?void 0:t.isAlignJustify,title:"Justify"})}P();P();function jb(){const e=ze(),t=fb(e.options);return c.jsx(La,{options:t,onChange:()=>{},value:"left",defaultValue:"left",renderDefaultIcon:Ta})}var Pb=h.lazy(()=>gn(()=>import("./loaded-MIY725CK-DUPDdSS5.js"),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.AlignSelectLoaded}))),Ld=()=>c.jsx(h.Suspense,{fallback:c.jsx(jb,{}),children:c.jsx(Pb,{})});P();function Di(){const{editor:e,editorState:t}=ze();return c.jsx(at,{icon:c.jsx(iy,{}),onClick:n=>{n.stopPropagation(),e==null||e.chain().focus().toggleBold().run()},disabled:!(t!=null&&t.canBold),active:t==null?void 0:t.isBold,title:"Bold"})}P();function Ti(){const{editor:e,editorState:t}=ze();return c.jsx(at,{icon:c.jsx(xy,{}),onClick:n=>{n.stopPropagation(),e==null||e.chain().focus().toggleItalic().run()},disabled:!(t!=null&&t.canItalic),active:t==null?void 0:t.isItalic,title:"Italic"})}P();function Ri(){const{editor:e,editorState:t}=ze();return c.jsx(at,{icon:c.jsx(By,{}),onClick:n=>{n.stopPropagation(),e==null||e.chain().focus().toggleUnderline().run()},disabled:!(t!=null&&t.canUnderline),active:t==null?void 0:t.isUnderline,title:"Underline"})}P();function Ab(){const{editor:e,editorState:t}=ze();return c.jsx(at,{icon:c.jsx(zy,{}),onClick:n=>{n.stopPropagation(),e==null||e.chain().focus().toggleStrike().run()},disabled:!(t!=null&&t.canStrike),active:t==null?void 0:t.isStrike,title:"Strikethrough"})}P();function Ob(){const{editor:e,editorState:t}=ze();return c.jsx(at,{icon:c.jsx(cy,{}),onClick:n=>{n.stopPropagation(),e==null||e.chain().focus().toggleCode().run()},disabled:!(t!=null&&t.canInlineCode),active:t==null?void 0:t.isInlineCode,title:"Inline code"})}P();function Mb(){const{editor:e,editorState:t}=ze();return c.jsx(at,{icon:c.jsx(zo,{}),onClick:n=>{n.stopPropagation(),e==null||e.chain().focus().toggleBulletList().run()},disabled:!(t!=null&&t.canBulletList),active:t==null?void 0:t.isBulletList,title:"Bullet list"})}P();function Db(){const{editor:e,editorState:t}=ze();return c.jsx(at,{icon:c.jsx(kd,{}),onClick:n=>{n.stopPropagation(),e==null||e.chain().focus().toggleOrderedList().run()},disabled:!(t!=null&&t.canOrderedList),active:t==null?void 0:t.isOrderedList,title:"Ordered list"})}P();function Tb(){const{editor:e,editorState:t}=ze();return c.jsx(at,{icon:c.jsx(Ny,{}),onClick:n=>{n.stopPropagation(),e==null||e.chain().focus().toggleCodeBlock().run()},disabled:!(t!=null&&t.canCodeBlock),active:t==null?void 0:t.isCodeBlock,title:"Code block"})}P();function Rb(){const{editor:e,editorState:t}=ze();return c.jsx(at,{icon:c.jsx(Oy,{}),onClick:n=>{n.stopPropagation(),e==null||e.chain().focus().toggleBlockquote().run()},disabled:!(t!=null&&t.canBlockquote),active:t==null?void 0:t.isBlockquote,title:"Blockquote"})}P();function Lb(){const{editor:e,editorState:t}=ze();return c.jsx(at,{icon:c.jsx(Cy,{}),onClick:n=>{n.stopPropagation(),e==null||e.chain().focus().setHorizontalRule().run()},disabled:!(t!=null&&t.canHorizontalRule),title:"Horizontal rule"})}P();P();function Nb(){const e=ze(),t=pb(e.options);return c.jsx(La,{options:t,onChange:()=>{},value:"p",defaultValue:"p",renderDefaultIcon:oy})}var zb=h.lazy(()=>gn(()=>import("./loaded-F37CNCVG-Cg4RQXYq.js"),__vite__mapDeps([5,1,2,3,4])).then(e=>({default:e.HeadingSelectLoaded}))),Nd=()=>c.jsx(h.Suspense,{fallback:c.jsx(Nb,{}),children:c.jsx(zb,{})});P();P();function $b(){const e=ze(),t=hb(e.options);return c.jsx(La,{options:t,onChange:()=>{},value:"p",defaultValue:"p",renderDefaultIcon:zo})}var Fb=h.lazy(()=>gn(()=>import("./loaded-H325ZSK5-VDlQcHWH.js"),__vite__mapDeps([6,1,2,3,4])).then(e=>({default:e.ListSelectLoaded}))),zd=()=>c.jsx(h.Suspense,{fallback:c.jsx($b,{}),children:c.jsx(Fb,{})}),$d=te("RichTextMenu",wb),Ic=({children:e})=>c.jsx($e,{children:e}),$e=({children:e})=>{const{inline:t}=ze();return c.jsx("div",{className:$d({inline:t,form:!t}),"data-puck-rte-menu":!0,children:e})},Ar=({children:e})=>c.jsx("div",{className:$d("group"),children:e});$e.Group=Ar;$e.Control=at;$e.AlignCenter=Ib;$e.AlignJustify=Cb;$e.AlignLeft=kb;$e.AlignRight=Eb;$e.AlignSelect=Ld;$e.Blockquote=Rb;$e.Bold=Di;$e.BulletList=Mb;$e.CodeBlock=Tb;$e.HeadingSelect=Nd;$e.HorizontalRule=Lb;$e.InlineCode=Ob;$e.Italic=Ti;$e.ListSelect=zd;$e.OrderedList=Db;$e.Strikethrough=Ab;$e.Underline=Ri;var Fd=({editor:e=null,editorState:t=null,field:n,readOnly:r,inline:s})=>{const{renderMenu:o,renderInlineMenu:i}=n,a=h.useMemo(()=>i||Ic,[i]),l=h.useMemo(()=>o||Ic,[o]);return c.jsx(Pd.Provider,{value:{editor:e,editorState:t,inline:s,options:n.options,readOnly:r},children:s?c.jsx(a,{editor:e,editorState:t,readOnly:r,children:c.jsxs(Ar,{children:[c.jsx(Di,{}),c.jsx(Ti,{}),c.jsx(Ri,{})]})}):c.jsxs(l,{editor:e,editorState:t,readOnly:r,children:[c.jsxs(Ar,{children:[c.jsx(Nd,{}),c.jsx(zd,{})]}),c.jsxs(Ar,{children:[c.jsx(Di,{}),c.jsx(Ti,{}),c.jsx(Ri,{})]}),c.jsx(Ar,{children:c.jsx(Ld,{})})]})})};P();var Ec=te("RichTextEditor",id),Bd=h.memo(({children:e,menu:t,readOnly:n=!1,field:r,inline:s=!1,editor:o,id:i})=>{const{initialHeight:a}=r,l=H(p=>{var v;return((v=p.currentRichText)==null?void 0:v.id)===i&&s===p.currentRichText.inline}),u=Ae(),d=h.useCallback(p=>{var v,g;(p.metaKey||p.ctrlKey)&&p.key.toLowerCase()==="i"&&(p.stopPropagation(),p.preventDefault(),(g=o==null?void 0:(v=o.commands).toggleItalic)==null||g.call(v)),p.key.toLowerCase()==="backspace"&&p.stopPropagation()},[o]),f=h.useCallback(p=>{var v,g;const m=!!((g=(v=p.relatedTarget)==null?void 0:v.closest)!=null&&g.call(v,"[data-puck-rte-menu]"));p.relatedTarget&&!m?u.setState({currentRichText:null}):p.stopPropagation()},[u]);return c.jsxs("div",{className:Ec({editor:!s,inline:s,isActive:l,disabled:n}),style:s?{}:{height:a??192,overflowY:"auto"},onKeyDownCapture:d,onBlur:f,children:[!s&&c.jsx("div",{className:Ec("menu"),children:t}),e]})});Bd.displayName="EditorInner";P();var Bb=h.lazy(()=>gn(()=>import("./full-N67EAB2Q-5hqHUblQ.js"),__vite__mapDeps([7,1,2,3,4])).then(e=>({default:e.LoadedRichTextMenuFull}))),Hb=e=>c.jsx(h.Suspense,{fallback:c.jsx(Fd,O({},e)),children:c.jsx(Bb,O({},e))});P();P();P();P();P();P();var Hd=(e,t=e)=>({slot:({value:n,propName:r,field:s,isReadOnly:o})=>{const i=o?t:e;return l=>i(z(O({allow:(s==null?void 0:s.type)==="slot"?s.allow:[],disallow:(s==null?void 0:s.type)==="slot"?s.disallow:[]},l),{zone:r,content:n}))}});P();P();P();function Vd(e,t,n){return Object.keys(e).reduce((r,s)=>{const o=s;return z(O({},r),{[o]:i=>{var a=i,{parentId:l}=a,u=Kt(a,["parentId"]);const d=u.propPath.replace(/\[\d+\]/g,"[*]"),f=(t==null?void 0:t[u.propPath])||(t==null?void 0:t[d])||n||!1,p=e[o];return p==null?void 0:p(z(O({},u),{isReadOnly:f,componentId:l}))}})},{})}function Vb(e,t,n,r,s){const o=h.useMemo(()=>Vd(n,r,s),[n,r,s]),i=h.useMemo(()=>dr(t,o,e).props,[e,t,o]);return h.useMemo(()=>O(O({},t.props),i),[t.props,i])}function Fo(e,t,n,r=n,s,o){return Vb(e,t,Hd(n,r),s,o)}P();P();var Wb=te("RichTextEditor",id);function Wd({content:e}){return c.jsx("div",{className:Wb(),children:c.jsx("div",{className:"rich-text",dangerouslySetInnerHTML:{__html:e}})})}P();var Li=(e,t,n)=>{if(!e)return null;if(t.length===0)return n(e);const[r,...s]=t;return Array.isArray(e)?e.map(o=>Li(o,t,n)):z(O({},e),{[r]:Li(e[r],s,n)})};function Bo(e,t){const n=(o,i=[])=>{if(!o)return[];const a=[];for(const[l,u]of Object.entries(o)){const d=[...i,l];u.type==="richtext"&&a.push({path:d,field:u}),u.type==="array"&&"arrayFields"in u&&a.push(...n(u.arrayFields,d)),u.type==="object"&&"objectFields"in u&&a.push(...n(u.objectFields,d))}return a},r=h.useMemo(()=>n(e),[e]);return h.useMemo(()=>{if(!(r!=null&&r.length))return{};const o=h.lazy(()=>gn(()=>import("./Render-CU35UAWV-C1VtWmg6.js"),__vite__mapDeps([8,9,4,2,3])).then(a=>({default:a.RichTextRender})));let i=O({},t);for(const{path:a,field:l}of r)i=Li(i,a,u=>c.jsx(h.Suspense,{fallback:c.jsx(Wd,{content:u}),children:c.jsx(o,{content:u,field:l})},it()));return i},[r,t,e])}P();var Na=e=>c.jsx(Ud,O({},e)),Ub=({config:e,item:t,metadata:n})=>{const r=e.components[t.type],s=Fo(e,t,i=>c.jsx(Na,z(O({},i),{config:e,metadata:n}))),o=Bo(r.fields,s);return c.jsx(r.render,z(O(O({},s),o),{puck:z(O({},s.puck),{metadata:n||{}})}))},Ud=h.forwardRef(function({className:t,style:n,content:r,config:s,metadata:o,as:i},a){const l=i??"div";return c.jsx(l,{className:t,style:n,ref:a,children:r.map(u=>s.components[u.type]?c.jsx(Ub,{config:s,item:u,metadata:o},u.props.id):null)})}),qb=Symbol.for("preact-signals");function Ho(){if(Zt>1)Zt--;else{var e,t=!1;for((function(){var s=vo;for(vo=void 0;s!==void 0;)s.S.v===s.v&&(s.S.i=s.i),s=s.o})();Gr!==void 0;){var n=Gr;for(Gr=void 0,go++;n!==void 0;){var r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&Zd(n))try{n.c()}catch(s){t||(e=s,t=!0)}n=r}}if(go=0,Zt--,t)throw e}}function Re(e){if(Zt>0)return e();Ni=++Zb,Zt++;try{return e()}finally{Ho()}}var ge=void 0;function xe(e){var t=ge;ge=void 0;try{return e()}finally{ge=t}}var Gr=void 0,Zt=0,go=0,Zb=0,Ni=0,vo=void 0,mo=0;function qd(e){if(ge!==void 0){var t=e.n;if(t===void 0||t.t!==ge)return t={i:0,S:e,p:ge.s,n:void 0,t:ge,e:void 0,x:void 0,r:t},ge.s!==void 0&&(ge.s.n=t),ge.s=t,e.n=t,32&ge.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=ge.s,t.n=void 0,ge.s.n=t,ge.s=t),t}}function lt(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=t==null?void 0:t.watched,this.Z=t==null?void 0:t.unwatched,this.name=t==null?void 0:t.name}lt.prototype.brand=qb;lt.prototype.h=function(){return!0};lt.prototype.S=function(e){var t=this,n=this.t;n!==e&&e.e===void 0&&(e.x=n,this.t=e,n!==void 0?n.e=e:xe(function(){var r;(r=t.W)==null||r.call(t)}))};lt.prototype.U=function(e){var t=this;if(this.t!==void 0){var n=e.e,r=e.x;n!==void 0&&(n.x=r,e.e=void 0),r!==void 0&&(r.e=n,e.x=void 0),e===this.t&&(this.t=r,r===void 0&&xe(function(){var s;(s=t.Z)==null||s.call(t)}))}};lt.prototype.subscribe=function(e){var t=this;return dt(function(){var n=t.value,r=ge;ge=void 0;try{e(n)}finally{ge=r}},{name:"sub"})};lt.prototype.valueOf=function(){return this.value};lt.prototype.toString=function(){return this.value+""};lt.prototype.toJSON=function(){return this.value};lt.prototype.peek=function(){var e=ge;ge=void 0;try{return this.value}finally{ge=e}};Object.defineProperty(lt.prototype,"value",{get:function(){var e=qd(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(go>100)throw new Error("Cycle detected");(function(n){Zt!==0&&go===0&&n.l!==Ni&&(n.l=Ni,vo={S:n,v:n.v,i:n.i,o:vo})})(this),this.v=e,this.i++,mo++,Zt++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Ho()}}}});function xs(e,t){return new lt(e,t)}function Zd(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function Yd(e){for(var t=e.s;t!==void 0;t=t.n){var n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function Gd(e){for(var t=e.s,n=void 0;t!==void 0;){var r=t.p;t.i===-1?(t.S.U(t),r!==void 0&&(r.n=t.n),t.n!==void 0&&(t.n.p=r)):n=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=r}e.s=n}function Dn(e,t){lt.call(this,void 0),this.x=e,this.s=void 0,this.g=mo-1,this.f=4,this.W=t==null?void 0:t.watched,this.Z=t==null?void 0:t.unwatched,this.name=t==null?void 0:t.name}Dn.prototype=new lt;Dn.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===mo))return!0;if(this.g=mo,this.f|=1,this.i>0&&!Zd(this))return this.f&=-2,!0;var e=ge;try{Yd(this),ge=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(n){this.v=n,this.f|=16,this.i++}return ge=e,Gd(this),this.f&=-2,!0};Dn.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}lt.prototype.S.call(this,e)};Dn.prototype.U=function(e){if(this.t!==void 0&&(lt.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}};Dn.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}};Object.defineProperty(Dn.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=qd(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function Cc(e,t){return new Dn(e,t)}function Kd(e){var t=e.m;if(e.m=void 0,typeof t=="function"){Zt++;var n=ge;ge=void 0;try{t()}catch(r){throw e.f&=-2,e.f|=8,za(e),r}finally{ge=n,Ho()}}}function za(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Kd(e)}function Yb(e){if(ge!==this)throw new Error("Out-of-order effect");Gd(this),ge=e,this.f&=-2,8&this.f&&za(this),Ho()}function fr(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t==null?void 0:t.name}fr.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.m=t)}finally{e()}};fr.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Kd(this),Yd(this),Zt++;var e=ge;return ge=this,Yb.bind(this,e)};fr.prototype.N=function(){2&this.f||(this.f|=2,this.u=Gr,Gr=this)};fr.prototype.d=function(){this.f|=8,1&this.f||za(this)};fr.prototype.dispose=function(){this.d()};function dt(e,t){var n=new fr(e,t);try{n.c()}catch(s){throw n.d(),s}var r=n.d.bind(n);return r[Symbol.dispose]=r,r}var Gb=Object.create,$a=Object.defineProperty,Kb=Object.defineProperties,Xb=Object.getOwnPropertyDescriptor,Jb=Object.getOwnPropertyDescriptors,jc=Object.getOwnPropertySymbols,Qb=Object.prototype.hasOwnProperty,e_=Object.prototype.propertyIsEnumerable,t_=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),pr=e=>{throw TypeError(e)},zi=(e,t,n)=>t in e?$a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,n_=(e,t)=>{for(var n in t||(t={}))Qb.call(t,n)&&zi(e,n,t[n]);if(jc)for(var n of jc(t))e_.call(t,n)&&zi(e,n,t[n]);return e},r_=(e,t)=>Kb(e,Jb(t)),Pc=(e,t)=>$a(e,"name",{value:t,configurable:!0}),s_=e=>{var t;return[,,,Gb((t=void 0)!=null?t:null)]},Xd=["class","method","getter","setter","accessor","field","value","get","set"],Or=e=>e!==void 0&&typeof e!="function"?pr("Function expected"):e,o_=(e,t,n,r,s)=>({kind:Xd[e],name:t,metadata:r,addInitializer:o=>n._?pr("Already initialized"):s.push(Or(o||null))}),Jd=(e,t)=>zi(t,t_("metadata"),e[3]),bn=(e,t,n,r)=>{for(var s=0,o=e[t>>1],i=o&&o.length;s<i;s++)t&1?o[s].call(n):r=o[s].call(n,r);return r},hr=(e,t,n,r,s,o)=>{var i,a,l,u,d,f=t&7,p=!!(t&8),v=!!(t&16),g=f>3?e.length+1:f?p?1:2:0,m=Xd[f+5],w=f>3&&(e[g-1]=[]),S=e[g]||(e[g]=[]),k=f&&(!v&&!p&&(s=s.prototype),f<5&&(f>3||!v)&&Xb(f<4?s:{get[n](){return yt(this,o)},set[n](b){return ln(this,o,b)}},n));f?v&&f<4&&Pc(o,(f>2?"set ":f>1?"get ":"")+n):Pc(s,n);for(var y=r.length-1;y>=0;y--)u=o_(f,n,l={},e[3],S),f&&(u.static=p,u.private=v,d=u.access={has:v?b=>i_(s,b):b=>n in b},f^3&&(d.get=v?b=>(f^1?yt:a_)(b,s,f^4?o:k.get):b=>b[n]),f>2&&(d.set=v?(b,j)=>ln(b,s,j,f^4?o:k.set):(b,j)=>b[n]=j)),a=(0,r[y])(f?f<4?v?o:k[m]:f>4?void 0:{get:k.get,set:k.set}:s,u),l._=1,f^4||a===void 0?Or(a)&&(f>4?w.unshift(a):f?v?o=a:k[m]=a:s=a):typeof a!="object"||a===null?pr("Object expected"):(Or(i=a.get)&&(k.get=i),Or(i=a.set)&&(k.set=i),Or(i=a.init)&&w.unshift(i));return f||Jd(e,s),k&&$a(s,n,k),v?f^4?o:k:s},Fa=(e,t,n)=>t.has(e)||pr("Cannot "+n),i_=(e,t)=>Object(t)!==t?pr('Cannot use the "in" operator on this value'):e.has(t),yt=(e,t,n)=>(Fa(e,t,"read from private field"),n?n.call(e):t.get(e)),Mr=(e,t,n)=>t.has(e)?pr("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ln=(e,t,n,r)=>(Fa(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),a_=(e,t,n)=>(Fa(e,t,"access private method"),n);function yo(e,t){if(t){let n;return Cc(()=>{const r=e();return r&&n&&t(n,r)?n:(n=r,r)})}return Cc(e)}function Yt(e,t){if(Object.is(e,t))return!0;if(e===null||t===null)return!1;if(typeof e=="function"&&typeof t=="function")return e===t;if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:!e.some((r,s)=>!Yt(r,t[s]));if(typeof e=="object"&&typeof t=="object"){const n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:!n.some(o=>!Yt(e[o],t[o]))}return!1}function fe({get:e},t){return{init(n){return xs(n)},get(){return e.call(this).value},set(n){const r=e.call(this);r.peek()!==n&&(r.value=n)}}}function Ve(e,t){const n=new WeakMap;return function(){let r=n.get(this);return r||(r=yo(e.bind(this)),n.set(this,r)),r.value}}function ri(e=!0){return function(t,n){n.addInitializer(function(){const r=n.kind==="field"?this:n.static?this:Object.getPrototypeOf(this),s=Object.getOwnPropertyDescriptor(r,n.name);s&&Object.defineProperty(r,n.name,r_(n_({},s),{enumerable:e}))})}}function ws(...e){const t=e.map(dt);return()=>t.forEach(n=>n())}var Qd,ef,tf,nf,rf,sf,st,Ba,si,$i,Fi,Qe,Ha,oi,of,Bi,Va,ii,Hi,Vi;sf=[fe],rf=[fe],nf=[fe],tf=[ri()],ef=[ri()],Qd=[ri()];var Tn=class{constructor(e,t=Object.is){this.defaultValue=e,this.equals=t,bn(st,5,this),Mr(this,Qe),Mr(this,Ba,bn(st,8,this)),bn(st,11,this),Mr(this,Ha,bn(st,12,this)),bn(st,15,this),Mr(this,Va,bn(st,16,this)),bn(st,19,this),this.reset=this.reset.bind(this),this.reset()}get current(){return yt(this,Qe,Hi)}get initial(){return yt(this,Qe,$i)}get previous(){return yt(this,Qe,of)}set current(e){const t=xe(()=>yt(this,Qe,Hi));e&&t&&this.equals(t,e)||Re(()=>{yt(this,Qe,$i)||ln(this,Qe,e,Fi),ln(this,Qe,t,Bi),ln(this,Qe,e,Vi)})}reset(e=this.defaultValue){Re(()=>{ln(this,Qe,void 0,Bi),ln(this,Qe,e,Fi),ln(this,Qe,e,Vi)})}};st=s_();Ba=new WeakMap;Qe=new WeakSet;Ha=new WeakMap;Va=new WeakMap;si=hr(st,20,"#initial",sf,Qe,Ba),$i=si.get,Fi=si.set;oi=hr(st,20,"#previous",rf,Qe,Ha),of=oi.get,Bi=oi.set;ii=hr(st,20,"#current",nf,Qe,Va),Hi=ii.get,Vi=ii.set;hr(st,2,"current",tf,Tn);hr(st,2,"initial",ef,Tn);hr(st,2,"previous",Qd,Tn);Jd(st,Tn);function ai(e){return xe(()=>{const t={};for(const n in e)t[n]=e[n];return t})}var _n,l_=class{constructor(){Mr(this,_n,new WeakMap)}get(e,t){var n;return e?(n=yt(this,_n).get(e))==null?void 0:n.get(t):void 0}set(e,t,n){var r;if(e)return yt(this,_n).has(e)||yt(this,_n).set(e,new Map),(r=yt(this,_n).get(e))==null?void 0:r.set(t,n)}clear(e){var t;return e?(t=yt(this,_n).get(e))==null?void 0:t.clear():void 0}};_n=new WeakMap;var c_=Object.create,af=Object.defineProperty,u_=Object.getOwnPropertyDescriptor,Ac=Object.getOwnPropertySymbols,d_=Object.prototype.hasOwnProperty,f_=Object.prototype.propertyIsEnumerable,lf=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Vo=e=>{throw TypeError(e)},Oc=Math.pow,Wi=(e,t,n)=>t in e?af(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,p_=(e,t)=>{for(var n in t||(t={}))d_.call(t,n)&&Wi(e,n,t[n]);if(Ac)for(var n of Ac(t))f_.call(t,n)&&Wi(e,n,t[n]);return e},h_=e=>{var t;return[,,,c_((t=e==null?void 0:e[lf("metadata")])!=null?t:null)]},cf=["class","method","getter","setter","accessor","field","value","get","set"],uf=e=>e!==void 0&&typeof e!="function"?Vo("Function expected"):e,g_=(e,t,n,r,s)=>({kind:cf[e],name:t,metadata:r,addInitializer:o=>n._?Vo("Already initialized"):s.push(uf(o||null))}),v_=(e,t)=>Wi(t,lf("metadata"),e[3]),m_=(e,t,n,r)=>{for(var s=0,o=e[t>>1],i=o&&o.length;s<i;s++)o[s].call(n);return r},df=(e,t,n,r,s,o)=>{for(var i,a,l,u,d=t&7,f=!1,p=!1,v=2,g=cf[d+5],m=e[v]||(e[v]=[]),w=(s=s.prototype,u_(s,n)),S=r.length-1;S>=0;S--)l=g_(d,n,a={},e[3],m),l.static=f,l.private=p,u=l.access={has:k=>n in k},u.get=k=>k[n],i=(0,r[S])(w[g],l),a._=1,uf(i)&&(w[g]=i);return w&&af(s,n,w),s},ff=(e,t,n)=>t.has(e)||Vo("Cannot "+n),y_=(e,t,n)=>(ff(e,t,"read from private field"),t.get(e)),b_=(e,t,n)=>t.has(e)?Vo("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),__=(e,t,n,r)=>(ff(e,t,"write to private field"),t.set(e,n),n),tt=class Ui{constructor(t,n){this.x=t,this.y=n}static delta(t,n){return new Ui(t.x-n.x,t.y-n.y)}static distance(t,n){return Math.hypot(t.x-n.x,t.y-n.y)}static equals(t,n){return t.x===n.x&&t.y===n.y}static from({x:t,y:n}){return new Ui(t,n)}},At=class xn{constructor(t,n,r,s){this.left=t,this.top=n,this.width=r,this.height=s,this.scale={x:1,y:1}}get inverseScale(){return{x:1/this.scale.x,y:1/this.scale.y}}translate(t,n){const{top:r,left:s,width:o,height:i,scale:a}=this,l=new xn(s+t,r+n,o,i);return l.scale=p_({},a),l}get boundingRectangle(){const{width:t,height:n,left:r,top:s,right:o,bottom:i}=this;return{width:t,height:n,left:r,top:s,right:o,bottom:i}}get center(){const{left:t,top:n,right:r,bottom:s}=this;return new tt((t+r)/2,(n+s)/2)}get area(){const{width:t,height:n}=this;return t*n}equals(t){if(!(t instanceof xn))return!1;const{left:n,top:r,width:s,height:o}=this;return n===t.left&&r===t.top&&s===t.width&&o===t.height}containsPoint(t){const{top:n,left:r,bottom:s,right:o}=this;return n<=t.y&&t.y<=s&&r<=t.x&&t.x<=o}intersectionArea(t){return t instanceof xn?x_(this,t):0}intersectionRatio(t){const{area:n}=this,r=this.intersectionArea(t);return r/(t.area+n-r)}get bottom(){const{top:t,height:n}=this;return t+n}get right(){const{left:t,width:n}=this;return t+n}get aspectRatio(){const{width:t,height:n}=this;return t/n}get corners(){return[{x:this.left,y:this.top},{x:this.right,y:this.top},{x:this.left,y:this.bottom},{x:this.right,y:this.bottom}]}static from({top:t,left:n,width:r,height:s}){return new xn(n,t,r,s)}static delta(t,n,r={x:"center",y:"center"}){const s=(o,i)=>{const a=r[i],l=i==="x"?o.left:o.top,u=i==="x"?o.width:o.height;return a=="start"?l:a=="end"?l+u:l+u/2};return tt.delta({x:s(t,"x"),y:s(t,"y")},{x:s(n,"x"),y:s(n,"y")})}static intersectionRatio(t,n){return xn.from(t).intersectionRatio(xn.from(n))}};function x_(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),s=Math.min(t.left+t.width,e.left+e.width),o=Math.min(t.top+t.height,e.top+e.height),i=s-r,a=o-n;return r<s&&n<o?i*a:0}var pf,hf,qi,Js,Ss,Wo=class extends(qi=Tn,hf=[Ve],pf=[Ve],qi){constructor(t){const n=tt.from(t);super(n,(r,s)=>tt.equals(r,s)),m_(Ss,5,this),b_(this,Js,0),this.velocity={x:0,y:0}}get delta(){return tt.delta(this.current,this.initial)}get direction(){const{current:t,previous:n}=this;if(!n)return null;const r={x:t.x-n.x,y:t.y-n.y};return!r.x&&!r.y?null:Math.abs(r.x)>Math.abs(r.y)?r.x>0?"right":"left":r.y>0?"down":"up"}get current(){return super.current}set current(t){const{current:n}=this,r=tt.from(t),s={x:r.x-n.x,y:r.y-n.y},o=Date.now(),i=o-y_(this,Js),a=l=>Math.round(l/i*100);Re(()=>{__(this,Js,o),this.velocity={x:a(s.x),y:a(s.y)},super.current=r})}reset(t=this.defaultValue){super.reset(tt.from(t)),this.velocity={x:0,y:0}}};Ss=h_(qi);Js=new WeakMap;df(Ss,2,"delta",hf,Wo);df(Ss,2,"direction",pf,Wo);v_(Ss,Wo);function li({x:e,y:t},n){const r=Math.abs(e),s=Math.abs(t);return typeof n=="number"?Math.sqrt(Oc(r,2)+Oc(s,2))>n:"x"in n&&"y"in n?r>n.x&&s>n.y:"x"in n?r>n.x:"y"in n?s>n.y:!1}var gf=(e=>(e.Horizontal="x",e.Vertical="y",e))(gf||{}),vf=Object.values(gf),w_=Object.create,Wa=Object.defineProperty,S_=Object.defineProperties,k_=Object.getOwnPropertyDescriptor,I_=Object.getOwnPropertyDescriptors,bo=Object.getOwnPropertySymbols,mf=Object.prototype.hasOwnProperty,yf=Object.prototype.propertyIsEnumerable,bf=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),gr=e=>{throw TypeError(e)},Zi=(e,t,n)=>t in e?Wa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_f=(e,t)=>{for(var n in t||(t={}))mf.call(t,n)&&Zi(e,n,t[n]);if(bo)for(var n of bo(t))yf.call(t,n)&&Zi(e,n,t[n]);return e},xf=(e,t)=>S_(e,I_(t)),Mc=(e,t)=>Wa(e,"name",{value:t,configurable:!0}),wf=(e,t)=>{var n={};for(var r in e)mf.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&bo)for(var r of bo(e))t.indexOf(r)<0&&yf.call(e,r)&&(n[r]=e[r]);return n},vr=e=>{var t;return[,,,w_((t=e==null?void 0:e[bf("metadata")])!=null?t:null)]},Sf=["class","method","getter","setter","accessor","field","value","get","set"],Dr=e=>e!==void 0&&typeof e!="function"?gr("Function expected"):e,E_=(e,t,n,r,s)=>({kind:Sf[e],name:t,metadata:r,addInitializer:o=>n._?gr("Already initialized"):s.push(Dr(o||null))}),Rn=(e,t)=>Zi(t,bf("metadata"),e[3]),ae=(e,t,n,r)=>{for(var s=0,o=e[t>>1],i=o&&o.length;s<i;s++)t&1?o[s].call(n):r=o[s].call(n,r);return r},pe=(e,t,n,r,s,o)=>{var i,a,l,u,d,f=t&7,p=!!(t&8),v=!!(t&16),g=f>3?e.length+1:f?p?1:2:0,m=Sf[f+5],w=f>3&&(e[g-1]=[]),S=e[g]||(e[g]=[]),k=f&&(!v&&!p&&(s=s.prototype),f<5&&(f>3||!v)&&k_(f<4?s:{get[n](){return Ze(this,o)},set[n](b){return Ct(this,o,b)}},n));f?v&&f<4&&Mc(o,(f>2?"set ":f>1?"get ":"")+n):Mc(s,n);for(var y=r.length-1;y>=0;y--)u=E_(f,n,l={},e[3],S),f&&(u.static=p,u.private=v,d=u.access={has:v?b=>C_(s,b):b=>n in b},f^3&&(d.get=v?b=>(f^1?Ze:j_)(b,s,f^4?o:k.get):b=>b[n]),f>2&&(d.set=v?(b,j)=>Ct(b,s,j,f^4?o:k.set):(b,j)=>b[n]=j)),a=(0,r[y])(f?f<4?v?o:k[m]:f>4?void 0:{get:k.get,set:k.set}:s,u),l._=1,f^4||a===void 0?Dr(a)&&(f>4?w.unshift(a):f?v?o=a:k[m]=a:s=a):typeof a!="object"||a===null?gr("Object expected"):(Dr(i=a.get)&&(k.get=i),Dr(i=a.set)&&(k.set=i),Dr(i=a.init)&&w.unshift(i));return f||Rn(e,s),k&&Wa(s,n,k),v?f^4?o:k:s},Ua=(e,t,n)=>t.has(e)||gr("Cannot "+n),C_=(e,t)=>Object(t)!==t?gr('Cannot use the "in" operator on this value'):e.has(t),Ze=(e,t,n)=>(Ua(e,t,"read from private field"),n?n.call(e):t.get(e)),Se=(e,t,n)=>t.has(e)?gr("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ct=(e,t,n,r)=>(Ua(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),j_=(e,t,n)=>(Ua(e,t,"access private method"),n);function kf(e,t){return{plugin:e,options:t}}function qa(e){return t=>kf(e,t)}function Za(e){return typeof e=="function"?{plugin:e,options:void 0}:e}var If,as,Ya,Qs;If=[fe];var Je=class{constructor(e,t){this.manager=e,this.options=t,Se(this,Ya,ae(as,8,this,!1)),ae(as,11,this),Se(this,Qs,new Set)}enable(){this.disabled=!1}disable(){this.disabled=!0}isDisabled(){return xe(()=>this.disabled)}configure(e){this.options=e}registerEffect(e){const t=dt(e.bind(this));return Ze(this,Qs).add(t),t}destroy(){Ze(this,Qs).forEach(e=>e())}static configure(e){return kf(this,e)}};as=vr(null);Ya=new WeakMap;Qs=new WeakMap;pe(as,4,"disabled",If,Je,Ya);Rn(as,Je);var Uo=class extends Je{},eo,ci=class{constructor(e){this.manager=e,this.instances=new Map,Se(this,eo,[])}get values(){return Array.from(this.instances.values())}set values(e){const t=e.map(Za).reduceRight((r,s)=>r.some(({plugin:o})=>o===s.plugin)?r:[s,...r],[]),n=t.map(({plugin:r})=>r);for(const r of Ze(this,eo))if(!n.includes(r)){if(r.prototype instanceof Uo)continue;this.unregister(r)}for(const{plugin:r,options:s}of t)this.register(r,s);Ct(this,eo,n)}get(e){return this.instances.get(e)}register(e,t){const n=this.instances.get(e);if(n)return n.options!==t&&(n.options=t),n;const r=new e(this.manager,t);return this.instances.set(e,r),r}unregister(e){const t=this.instances.get(e);t&&(t.destroy(),this.instances.delete(e))}destroy(){for(const e of this.instances.values())e.destroy();this.instances.clear()}};eo=new WeakMap;function P_(e,t){return e.priority===t.priority?e.type===t.type?t.value-e.value:t.type-e.type:t.priority-e.priority}var Ls=[],Zn,Yn,A_=class extends Je{constructor(e){super(e),Se(this,Zn),Se(this,Yn),this.computeCollisions=this.computeCollisions.bind(this),Ct(this,Yn,xs(Ls)),this.destroy=ws(()=>{const t=this.computeCollisions(),n=xe(()=>this.manager.dragOperation.position.current);if(t!==Ls){const r=Ze(this,Zn);if(Ct(this,Zn,n),r&&n.x==r.x&&n.y==r.y)return}else Ct(this,Zn,void 0);Ze(this,Yn).value=t},()=>{const{dragOperation:t}=this.manager;t.status.initialized&&this.forceUpdate()})}forceUpdate(e=!0){xe(()=>{e?Ze(this,Yn).value=this.computeCollisions():Ct(this,Zn,void 0)})}computeCollisions(e,t){const{registry:n,dragOperation:r}=this.manager,{source:s,shape:o,status:i}=r;if(!i.initialized||!o)return Ls;const a=[],l=[];for(const u of e??n.droppables){if(u.disabled||s&&!u.accepts(s))continue;const d=t??u.collisionDetector;if(!d)continue;l.push(u),u.shape;const f=xe(()=>d({droppable:u,dragOperation:r}));f&&(u.collisionPriority!=null&&(f.priority=u.collisionPriority),a.push(f))}return l.length===0?Ls:(a.sort(P_),a)}get collisions(){return Ze(this,Yn).value}};Zn=new WeakMap;Yn=new WeakMap;var O_=class{constructor(){this.registry=new Map}addEventListener(e,t){const{registry:n}=this,r=new Set(n.get(e));return r.add(t),n.set(e,r),()=>this.removeEventListener(e,t)}removeEventListener(e,t){const{registry:n}=this,r=new Set(n.get(e));r.delete(t),n.set(e,r)}dispatch(e,...t){const{registry:n}=this,r=n.get(e);if(r)for(const s of r)s(...t)}},M_=class extends O_{constructor(e){super(),this.manager=e}dispatch(e,t){const n=[t,this.manager];super.dispatch(e,...n)}};function to(e,t=!0){let n=!1;return xf(_f({},e),{cancelable:t,get defaultPrevented(){return n},preventDefault(){t&&(n=!0)}})}var D_=class extends Uo{constructor(e){super(e);const t=(r,s)=>r.map(({id:o})=>o).join("")===s.map(({id:o})=>o).join("");let n=[];this.destroy=ws(()=>{const{dragOperation:r,collisionObserver:s}=e;r.status.initializing&&(n=[],s.enable())},()=>{const{collisionObserver:r,monitor:s}=e,{collisions:o}=r;if(r.isDisabled())return;const i=to({collisions:o});if(s.dispatch("collision",i),i.defaultPrevented||t(o,n))return;n=o;const[a]=o;xe(()=>{var l;(a==null?void 0:a.id)!==((l=e.dragOperation.target)==null?void 0:l.id)&&(r.disable(),e.actions.setDropTarget(a==null?void 0:a.id).then(()=>{r.enable()}))})})}},bt=(e=>(e[e.Lowest=0]="Lowest",e[e.Low=1]="Low",e[e.Normal=2]="Normal",e[e.High=3]="High",e[e.Highest=4]="Highest",e))(bt||{}),Ht=(e=>(e[e.Collision=0]="Collision",e[e.ShapeIntersection=1]="ShapeIntersection",e[e.PointerIntersection=2]="PointerIntersection",e))(Ht||{}),Ef,Cf,jf,Pf,Af,Of,Mf,wt,Ga;Mf=[fe],Of=[Ve],Af=[Ve],Pf=[Ve],jf=[Ve],Cf=[Ve],Ef=[Ve];var Xt=class{constructor(){ae(wt,5,this),Se(this,Ga,ae(wt,8,this,"idle")),ae(wt,11,this)}get current(){return this.value}get idle(){return this.value==="idle"}get initializing(){return this.value==="initializing"}get initialized(){const{value:e}=this;return e!=="idle"&&e!=="initialization-pending"}get dragging(){return this.value==="dragging"}get dropped(){return this.value==="dropped"}set(e){this.value=e}};wt=vr(null);Ga=new WeakMap;pe(wt,4,"value",Mf,Xt,Ga);pe(wt,2,"current",Of,Xt);pe(wt,2,"idle",Af,Xt);pe(wt,2,"initializing",Pf,Xt);pe(wt,2,"initialized",jf,Xt);pe(wt,2,"dragging",Cf,Xt);pe(wt,2,"dropped",Ef,Xt);Rn(wt,Xt);var T_=class{constructor(e){this.manager=e}setDragSource(e){const{dragOperation:t}=this.manager;t.sourceIdentifier=typeof e=="string"||typeof e=="number"?e:e.id}setDropTarget(e){return xe(()=>{const{dragOperation:t}=this.manager,n=e??null;if(t.targetIdentifier===n)return Promise.resolve(!1);t.targetIdentifier=n;const r=to({operation:t.snapshot()});return t.status.dragging&&this.manager.monitor.dispatch("dragover",r),this.manager.renderer.rendering.then(()=>r.defaultPrevented)})}start(e){return xe(()=>{const{dragOperation:t}=this.manager;if(e.source!=null&&this.setDragSource(e.source),!t.source)throw new Error("Cannot start a drag operation without a drag source");if(!t.status.idle)throw new Error("Cannot start a drag operation while another is active");const r=new AbortController,{event:s,coordinates:o}=e;Re(()=>{t.status.set("initialization-pending"),t.shape=null,t.canceled=!1,t.activatorEvent=s??null,t.position.reset(o)});const i=to({operation:t.snapshot()});return this.manager.monitor.dispatch("beforedragstart",i),i.defaultPrevented?(t.reset(),r.abort(),r):(t.status.set("initializing"),t.controller=r,this.manager.renderer.rendering.then(()=>{if(r.signal.aborted)return;const{status:a}=t;a.current==="initializing"&&(t.status.set("dragging"),this.manager.monitor.dispatch("dragstart",{nativeEvent:s,operation:t.snapshot(),cancelable:!1}))}),r)})}move(e){return xe(()=>{var t,n;const{dragOperation:r}=this.manager,{status:s,controller:o}=r;if(!s.dragging||!o||o.signal.aborted)return;const i=to({nativeEvent:e.event,operation:r.snapshot(),by:e.by,to:e.to},(t=e.cancelable)!=null?t:!0);((n=e.propagate)==null||n)&&this.manager.monitor.dispatch("dragmove",i),queueMicrotask(()=>{var a,l,u,d,f;if(i.defaultPrevented)return;const p=(f=e.to)!=null?f:{x:r.position.current.x+((l=(a=e.by)==null?void 0:a.x)!=null?l:0),y:r.position.current.y+((d=(u=e.by)==null?void 0:u.y)!=null?d:0)};r.position.current=p})})}stop(e={}){return xe(()=>{var t,n;const{dragOperation:r}=this.manager,{controller:s}=r;if(!s||s.signal.aborted)return;let o;const i=()=>{const l={resume:()=>{},abort:()=>{}};return o=new Promise((u,d)=>{l.resume=u,l.abort=d}),l};s.abort();const a=()=>{this.manager.renderer.rendering.then(()=>{r.status.set("dropped");const l=xe(()=>{var d;return((d=r.source)==null?void 0:d.status)==="dropping"}),u=()=>{r.controller===s&&(r.controller=void 0),r.reset()};if(l){const{source:d}=r,f=dt(()=>{(d==null?void 0:d.status)==="idle"&&(f(),u())})}else this.manager.renderer.rendering.then(u)})};r.canceled=(t=e.canceled)!=null?t:!1,this.manager.monitor.dispatch("dragend",{nativeEvent:e.event,operation:r.snapshot(),canceled:(n=e.canceled)!=null?n:!1,suspend:i}),o?o.then(a).catch(()=>r.reset()):a()})}},Df,Tf,Rf,Lf,ut,Ka,Xa,Ja,Qa;Lf=[fe],Rf=[fe],Tf=[fe],Df=[fe];var yn=class{constructor(e,t){Se(this,Ka,ae(ut,8,this)),ae(ut,11,this),Se(this,Xa,ae(ut,12,this)),ae(ut,15,this),Se(this,Ja,ae(ut,16,this)),ae(ut,19,this),Se(this,Qa,ae(ut,20,this)),ae(ut,23,this);const{effects:n,id:r,data:s={},disabled:o=!1,register:i=!0}=e;let a=r;this.manager=t,this.id=r,this.data=s,this.disabled=o,this.effects=()=>{var l;return[()=>{const{id:u,manager:d}=this;if(u!==a)return d==null||d.registry.register(this),()=>d==null?void 0:d.registry.unregister(this)},...(l=n==null?void 0:n())!=null?l:[]]},this.register=this.register.bind(this),this.unregister=this.unregister.bind(this),this.destroy=this.destroy.bind(this),t&&i&&queueMicrotask(this.register)}register(){var e;return(e=this.manager)==null?void 0:e.registry.register(this)}unregister(){var e;(e=this.manager)==null||e.registry.unregister(this)}destroy(){var e;(e=this.manager)==null||e.registry.unregister(this)}};ut=vr(null);Ka=new WeakMap;Xa=new WeakMap;Ja=new WeakMap;Qa=new WeakMap;pe(ut,4,"manager",Lf,yn,Ka);pe(ut,4,"id",Rf,yn,Xa);pe(ut,4,"data",Tf,yn,Ja);pe(ut,4,"disabled",Df,yn,Qa);Rn(ut,yn);var Dc=class{constructor(){this.map=xs(new Map),this.cleanupFunctions=new WeakMap,this.register=(e,t)=>{const n=this.map.peek(),r=n.get(e),s=()=>this.unregister(e,t);if(r===t)return s;if(r){const a=this.cleanupFunctions.get(r);a==null||a(),this.cleanupFunctions.delete(r)}const o=new Map(n);o.set(e,t),this.map.value=o;const i=ws(...t.effects());return this.cleanupFunctions.set(t,i),s},this.unregister=(e,t)=>{const n=this.map.peek();if(n.get(e)!==t)return;const r=this.cleanupFunctions.get(t);r==null||r(),this.cleanupFunctions.delete(t);const s=new Map(n);s.delete(e),this.map.value=s}}[Symbol.iterator](){return this.map.peek().values()}get value(){return this.map.value.values()}has(e){return this.map.value.has(e)}get(e){return this.map.value.get(e)}destroy(){for(const e of this){const t=this.cleanupFunctions.get(e);t==null||t(),e.destroy()}this.map.value=new Map}},Nf,zf,$f,Ff,Bf,Hf,Yi,ot,el,tl,nl,$t=class extends(Yi=yn,Hf=[fe],Bf=[fe],Ff=[fe],$f=[Ve],zf=[Ve],Nf=[Ve],Yi){constructor(t,n){var r=t,{modifiers:s,type:o,sensors:i}=r,a=wf(r,["modifiers","type","sensors"]);super(a,n),ae(ot,5,this),Se(this,el,ae(ot,8,this)),ae(ot,11,this),Se(this,tl,ae(ot,12,this)),ae(ot,15,this),Se(this,nl,ae(ot,16,this,this.isDragSource?"dragging":"idle")),ae(ot,19,this),this.type=o,this.sensors=i,this.modifiers=s,this.alignment=a.alignment}get isDropping(){return this.status==="dropping"&&this.isDragSource}get isDragging(){return this.status==="dragging"&&this.isDragSource}get isDragSource(){var t,n;return((n=(t=this.manager)==null?void 0:t.dragOperation.source)==null?void 0:n.id)===this.id}};ot=vr(Yi);el=new WeakMap;tl=new WeakMap;nl=new WeakMap;pe(ot,4,"type",Hf,$t,el);pe(ot,4,"modifiers",Bf,$t,tl);pe(ot,4,"status",Ff,$t,nl);pe(ot,2,"isDropping",$f,$t);pe(ot,2,"isDragging",zf,$t);pe(ot,2,"isDragSource",Nf,$t);Rn(ot,$t);var Vf,Wf,Uf,qf,Zf,Yf,Gi,Be,rl,sl,ol,il,al,Ft=class extends(Gi=yn,Yf=[fe],Zf=[fe],qf=[fe],Uf=[fe],Wf=[fe],Vf=[Ve],Gi){constructor(t,n){var r=t,{accept:s,collisionDetector:o,collisionPriority:i,type:a}=r,l=wf(r,["accept","collisionDetector","collisionPriority","type"]);super(l,n),ae(Be,5,this),Se(this,rl,ae(Be,8,this)),ae(Be,11,this),Se(this,sl,ae(Be,12,this)),ae(Be,15,this),Se(this,ol,ae(Be,16,this)),ae(Be,19,this),Se(this,il,ae(Be,20,this)),ae(Be,23,this),Se(this,al,ae(Be,24,this)),ae(Be,27,this),this.accept=s,this.collisionDetector=o,this.collisionPriority=i,this.type=a}accepts(t){const{accept:n}=this;return n?typeof n=="function"?n(t):t.type?Array.isArray(n)?n.includes(t.type):t.type===n:!1:!0}get isDropTarget(){var t,n;return((n=(t=this.manager)==null?void 0:t.dragOperation.target)==null?void 0:n.id)===this.id}};Be=vr(Gi);rl=new WeakMap;sl=new WeakMap;ol=new WeakMap;il=new WeakMap;al=new WeakMap;pe(Be,4,"accept",Yf,Ft,rl);pe(Be,4,"type",Zf,Ft,sl);pe(Be,4,"collisionDetector",qf,Ft,ol);pe(Be,4,"collisionPriority",Uf,Ft,il);pe(Be,4,"shape",Wf,Ft,al);pe(Be,2,"isDropTarget",Vf,Ft);Rn(Be,Ft);var ir=class extends Je{constructor(e,t){super(e,t),this.manager=e,this.options=t}},Tc=class extends Je{constructor(e,t){super(e,t),this.manager=e,this.options=t}apply(e){return e.transform}},R_=class{constructor(e){this.draggables=new Dc,this.droppables=new Dc,this.plugins=new ci(e),this.sensors=new ci(e),this.modifiers=new ci(e)}register(e,t){if(e instanceof $t)return this.draggables.register(e.id,e);if(e instanceof Ft)return this.droppables.register(e.id,e);if(e.prototype instanceof Tc)return this.modifiers.register(e,t);if(e.prototype instanceof ir)return this.sensors.register(e,t);if(e.prototype instanceof Je)return this.plugins.register(e,t);throw new Error("Invalid instance type")}unregister(e){if(e instanceof yn)return e instanceof $t?this.draggables.unregister(e.id,e):e instanceof Ft?this.droppables.unregister(e.id,e):()=>{};if(e.prototype instanceof Tc)return this.modifiers.unregister(e);if(e.prototype instanceof ir)return this.sensors.unregister(e);if(e.prototype instanceof Je)return this.plugins.unregister(e);throw new Error("Invalid instance type")}destroy(){this.draggables.destroy(),this.droppables.destroy(),this.plugins.destroy(),this.sensors.destroy(),this.modifiers.destroy()}},Gf,Kf,Xf,Jf,Qf,ep,tp,np,rp,Tr,no,Gn,Pe,ll,cl,ul,dl,fl,Rr;rp=[Ve],np=[fe],tp=[fe],ep=[fe],Qf=[fe],Jf=[fe],Xf=[Ve],Kf=[Ve],Gf=[Ve];var Mt=class{constructor(e){ae(Pe,5,this),Se(this,Tr),Se(this,no),Se(this,Gn,new Tn(void 0,(t,n)=>t&&n?t.equals(n):t===n)),this.status=new Xt,Se(this,ll,ae(Pe,8,this,!1)),ae(Pe,11,this),Se(this,cl,ae(Pe,12,this,null)),ae(Pe,15,this),Se(this,ul,ae(Pe,16,this,null)),ae(Pe,19,this),Se(this,dl,ae(Pe,20,this,null)),ae(Pe,23,this),Se(this,fl,ae(Pe,24,this,[])),ae(Pe,27,this),this.position=new Wo({x:0,y:0}),Se(this,Rr,{x:0,y:0}),Ct(this,Tr,e)}get shape(){const{current:e,initial:t,previous:n}=Ze(this,Gn);return!e||!t?null:{current:e,initial:t,previous:n}}set shape(e){e?Ze(this,Gn).current=e:Ze(this,Gn).reset()}get source(){var e;const t=this.sourceIdentifier;if(t==null)return null;const n=Ze(this,Tr).registry.draggables.get(t);return n&&Ct(this,no,n),(e=n??Ze(this,no))!=null?e:null}get target(){var e;const t=this.targetIdentifier;return t!=null&&(e=Ze(this,Tr).registry.droppables.get(t))!=null?e:null}get transform(){const{x:e,y:t}=this.position.delta;let n={x:e,y:t};for(const r of this.modifiers)n=r.apply(xf(_f({},this.snapshot()),{transform:n}));return Ct(this,Rr,n),n}snapshot(){return xe(()=>({source:this.source,target:this.target,activatorEvent:this.activatorEvent,transform:Ze(this,Rr),shape:this.shape?ai(this.shape):null,position:ai(this.position),status:ai(this.status),canceled:this.canceled}))}reset(){Re(()=>{this.status.set("idle"),this.sourceIdentifier=null,this.targetIdentifier=null,Ze(this,Gn).reset(),this.position.reset({x:0,y:0}),Ct(this,Rr,{x:0,y:0}),this.modifiers=[]})}};Pe=vr(null);Tr=new WeakMap;no=new WeakMap;Gn=new WeakMap;ll=new WeakMap;cl=new WeakMap;ul=new WeakMap;dl=new WeakMap;fl=new WeakMap;Rr=new WeakMap;pe(Pe,2,"shape",rp,Mt);pe(Pe,4,"canceled",np,Mt,ll);pe(Pe,4,"activatorEvent",tp,Mt,cl);pe(Pe,4,"sourceIdentifier",ep,Mt,ul);pe(Pe,4,"targetIdentifier",Qf,Mt,dl);pe(Pe,4,"modifiers",Jf,Mt,fl);pe(Pe,2,"source",Xf,Mt);pe(Pe,2,"target",Kf,Mt);pe(Pe,2,"transform",Gf,Mt);Rn(Pe,Mt);var L_={get rendering(){return Promise.resolve()}},N_=class{constructor(t){this.destroy=()=>{this.dragOperation.status.idle||this.actions.stop({canceled:!0}),this.dragOperation.modifiers.forEach(d=>d.destroy()),this.registry.destroy(),this.collisionObserver.destroy()};const{plugins:n=[],sensors:r=[],modifiers:s=[],renderer:o=L_}=t??{},i=new M_(this),a=new R_(this);this.registry=a,this.monitor=i,this.renderer=o,this.actions=new T_(this),this.dragOperation=new Mt(this),this.collisionObserver=new A_(this),this.plugins=[D_,...n],this.modifiers=s,this.sensors=r;const{destroy:l}=this,u=ws(()=>{var d,f,p;const v=xe(()=>this.dragOperation.modifiers),g=this.modifiers;v!==g&&v.forEach(m=>m.destroy()),this.dragOperation.modifiers=(p=(f=(d=this.dragOperation.source)==null?void 0:d.modifiers)==null?void 0:f.map(m=>{const{plugin:w,options:S}=Za(m);return new w(this,S)}))!=null?p:g});this.destroy=()=>{u(),l()}}get plugins(){return this.registry.plugins.values}set plugins(t){this.registry.plugins.values=t}get modifiers(){return this.registry.modifiers.values}set modifiers(t){this.registry.modifiers.values=t}get sensors(){return this.registry.sensors.values}set sensors(t){this.registry.sensors.values=t}},sp=e=>{throw TypeError(e)},pl=(e,t,n)=>t.has(e)||sp("Cannot "+n),ue=(e,t,n)=>(pl(e,t,"read from private field"),t.get(e)),ct=(e,t,n)=>t.has(e)?sp("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ft=(e,t,n,r)=>(pl(e,t,"write to private field"),t.set(e,n),n),op=(e,t,n)=>(pl(e,t,"access private method"),n);function qo(e){return e?e instanceof KeyframeEffect?!0:"getKeyframes"in e&&typeof e.getKeyframes=="function":!1}function ip(e,t){const n=e.getAnimations();if(n.length>0)for(const r of n){if(r.playState!=="running")continue;const{effect:s}=r,i=(qo(s)?s.getKeyframes():[]).filter(t);if(i.length>0)return[i[i.length-1],r]}return null}function Zo(e){const{width:t,height:n,top:r,left:s,bottom:o,right:i}=e.getBoundingClientRect();return{width:t,height:n,top:r,left:s,bottom:o,right:i}}var ap=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function hl(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function gl(e){return"nodeType"in e}function Jt(e){var t,n,r;return e?hl(e)?e:gl(e)?"defaultView"in e?(t=e.defaultView)!=null?t:window:(r=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?r:window:window:window}function lp(e){const{Document:t}=Jt(e);return e instanceof t||"nodeType"in e&&e.nodeType===Node.DOCUMENT_NODE}function An(e){return!e||hl(e)?!1:e instanceof Jt(e).HTMLElement||"namespaceURI"in e&&typeof e.namespaceURI=="string"&&e.namespaceURI.endsWith("html")}function cp(e){return e instanceof Jt(e).SVGElement||"namespaceURI"in e&&typeof e.namespaceURI=="string"&&e.namespaceURI.endsWith("svg")}function Bt(e){return e?hl(e)?e.document:gl(e)?lp(e)?e:An(e)||cp(e)?e.ownerDocument:document:document:document}function z_(e){const{documentElement:t}=Bt(e),n=t.clientWidth,r=t.clientHeight;return{top:0,left:0,right:n,bottom:r,width:n,height:r}}function $_(e,t){if(F_(e)&&e.open===!1)return!1;const{overflow:n,overflowX:r,overflowY:s}=getComputedStyle(e);return n==="visible"&&r==="visible"&&s==="visible"}function F_(e){return e.tagName==="DETAILS"}function ls(e,t=e.getBoundingClientRect(),n=0){var r;let s=t;const{ownerDocument:o}=e,i=(r=o.defaultView)!=null?r:window;let a=e.parentElement;for(;a&&a!==o.documentElement;){if(!$_(a)){const p=a.getBoundingClientRect(),v=n*(p.bottom-p.top),g=n*(p.right-p.left),m=n*(p.bottom-p.top),w=n*(p.right-p.left);s={top:Math.max(s.top,p.top-v),right:Math.min(s.right,p.right+g),bottom:Math.min(s.bottom,p.bottom+m),left:Math.max(s.left,p.left-w),width:0,height:0},s.width=s.right-s.left,s.height=s.bottom-s.top}a=a.parentElement}const l=i.innerWidth,u=i.innerHeight,d=n*u,f=n*l;return s={top:Math.max(s.top,0-d),right:Math.min(s.right,l+f),bottom:Math.min(s.bottom,u+d),left:Math.max(s.left,0-f),width:0,height:0},s.width=s.right-s.left,s.height=s.bottom-s.top,s.width<0&&(s.width=0),s.height<0&&(s.height=0),s}function up(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function B_(e){const t="input, textarea, select, canvas, [contenteditable]",n=e.cloneNode(!0),r=Array.from(e.querySelectorAll(t));return Array.from(n.querySelectorAll(t)).forEach((o,i)=>{const a=r[i];if(Rc(o)&&Rc(a)&&(o.type!=="file"&&(o.value=a.value),o.type==="radio"&&o.name&&(o.name=`Cloned__${o.name}`)),Lc(o)&&Lc(a)&&a.width>0&&a.height>0){const l=o.getContext("2d");l==null||l.drawImage(a,0,0)}}),n}function Rc(e){return"value"in e}function Lc(e){return e.tagName==="CANVAS"}function dp(e,{x:t,y:n}){const r=e.elementFromPoint(t,n);if(H_(r)){const{contentDocument:s}=r;if(s){const{left:o,top:i}=r.getBoundingClientRect();return dp(s,{x:t-o,y:n-i})}}return r}function H_(e){return(e==null?void 0:e.tagName)==="IFRAME"}var Ki=new WeakMap,fp=class{constructor(){this.entries=new Set,this.clear=()=>{for(const e of this.entries){const[t,{type:n,listener:r,options:s}]=e;t.removeEventListener(n,r,s)}this.entries.clear()}}bind(e,t){const n=Array.isArray(t)?t:[t],r=[];for(const s of n){const{type:o,listener:i,options:a}=s,l=[e,s];e.addEventListener(o,i,a),this.entries.add(l),r.push(l)}return function(){for(const[o,{type:i,listener:a,options:l}]of r)o.removeEventListener(i,a,l)}}};function ar(e){const t=e==null?void 0:e.ownerDocument.defaultView;if(t&&t.self!==t.parent)return t.frameElement}function V_(e){const t=new Set;let n=ar(e);for(;n;)t.add(n),n=ar(n);return t}function W_(e,t){const n=setTimeout(e,t);return()=>clearTimeout(n)}function pp(e,t){const n=()=>performance.now();let r,s;return function(...o){const i=this;s?(r==null||r(),r=W_(()=>{e.apply(i,o),s=n()},t-(n()-s))):(e.apply(i,o),s=n())}}function U_(e,t){return e===t?!0:!e||!t?!1:e.top==t.top&&e.left==t.left&&e.right==t.right&&e.bottom==t.bottom}function q_(e,t=e.getBoundingClientRect()){const{width:n,height:r}=ls(e,t);return n>0&&r>0}var Z_=ap?ResizeObserver:class{observe(){}unobserve(){}disconnect(){}},ro,Y_=class extends Z_{constructor(e){super(t=>{if(!ue(this,ro)){ft(this,ro,!0);return}e(t,this)}),ct(this,ro,!1)}};ro=new WeakMap;var Nc=Array.from({length:100},(e,t)=>t/100),hp=75,wn,_o,on,Sn,Lr,qe,Kr,Nr,xo,gp,vp,mp=class{constructor(e,t,n={debug:!1,skipInitial:!1}){this.element=e,this.callback=t,ct(this,xo),this.disconnect=()=>{var o,i,a;ft(this,Kr,!0),(o=ue(this,on))==null||o.disconnect(),(i=ue(this,Sn))==null||i.disconnect(),ue(this,Lr).disconnect(),(a=ue(this,qe))==null||a.remove()},ct(this,wn,!0),ct(this,_o),ct(this,on),ct(this,Sn),ct(this,Lr),ct(this,qe),ct(this,Kr,!1),ct(this,Nr,pp(()=>{var o,i,a;const{element:l}=this;if((o=ue(this,Sn))==null||o.disconnect(),ue(this,Kr)||!ue(this,wn)||!l.isConnected)return;const u=(i=l.ownerDocument)!=null?i:document,{innerHeight:d,innerWidth:f}=(a=u.defaultView)!=null?a:window,p=l.getBoundingClientRect(),v=ls(l,p),{top:g,left:m,bottom:w,right:S}=v,k=-Math.floor(g),y=-Math.floor(m),b=-Math.floor(f-S),j=-Math.floor(d-w),C=`${k}px ${b}px ${j}px ${y}px`;this.boundingClientRect=p,ft(this,Sn,new IntersectionObserver(A=>{const[_]=A,{intersectionRect:I}=_;(_.intersectionRatio!==1?_.intersectionRatio:At.intersectionRatio(I,ls(l)))!==1&&ue(this,Nr).call(this)},{threshold:Nc,rootMargin:C,root:u})),ue(this,Sn).observe(l),op(this,xo,gp).call(this)},hp)),this.boundingClientRect=e.getBoundingClientRect(),ft(this,wn,q_(e,this.boundingClientRect));let r=!0;this.callback=o=>{r&&(r=!1,n.skipInitial)||t(o)};const s=e.ownerDocument;n!=null&&n.debug&&(ft(this,qe,document.createElement("div")),ue(this,qe).style.background="rgba(0,0,0,0.15)",ue(this,qe).style.position="fixed",ue(this,qe).style.pointerEvents="none",s.body.appendChild(ue(this,qe))),ft(this,Lr,new IntersectionObserver(o=>{var i,a;const l=o[o.length-1],{boundingClientRect:u,isIntersecting:d}=l,{width:f,height:p}=u,v=ue(this,wn);ft(this,wn,d),!(!f&&!p)&&(v&&!d?((i=ue(this,Sn))==null||i.disconnect(),this.callback(null),(a=ue(this,on))==null||a.disconnect(),ft(this,on,void 0),ue(this,qe)&&(ue(this,qe).style.visibility="hidden")):ue(this,Nr).call(this),d&&!ue(this,on)&&(ft(this,on,new Y_(ue(this,Nr))),ue(this,on).observe(e)))},{threshold:Nc,root:s})),ue(this,wn)&&!n.skipInitial&&this.callback(this.boundingClientRect),ue(this,Lr).observe(e)}};wn=new WeakMap;_o=new WeakMap;on=new WeakMap;Sn=new WeakMap;Lr=new WeakMap;qe=new WeakMap;Kr=new WeakMap;Nr=new WeakMap;xo=new WeakSet;gp=function(){ue(this,Kr)||(op(this,xo,vp).call(this),!U_(this.boundingClientRect,ue(this,_o))&&(this.callback(this.boundingClientRect),ft(this,_o,this.boundingClientRect)))};vp=function(){if(ue(this,qe)){const{top:e,left:t,width:n,height:r}=ls(this.element);ue(this,qe).style.overflow="hidden",ue(this,qe).style.visibility="visible",ue(this,qe).style.top=`${Math.floor(e)}px`,ue(this,qe).style.left=`${Math.floor(t)}px`,ue(this,qe).style.width=`${Math.floor(n)}px`,ue(this,qe).style.height=`${Math.floor(r)}px`}};var Ns=new WeakMap,zs=new WeakMap;function G_(e,t){let n=Ns.get(e);return n||(n={disconnect:new mp(e,s=>{const o=Ns.get(e);o&&o.callbacks.forEach(i=>i(s))},{skipInitial:!0}).disconnect,callbacks:new Set}),n.callbacks.add(t),Ns.set(e,n),()=>{n.callbacks.delete(t),n.callbacks.size===0&&(Ns.delete(e),n.disconnect())}}function K_(e,t){const n=new Set;for(const r of e){const s=G_(r,t);n.add(s)}return()=>n.forEach(r=>r())}function X_(e,t){var n;const r=e.ownerDocument;if(!zs.has(r)){const i=new AbortController,a=new Set;document.addEventListener("scroll",l=>a.forEach(u=>u(l)),{capture:!0,passive:!0,signal:i.signal}),zs.set(r,{disconnect:()=>i.abort(),listeners:a})}const{listeners:s,disconnect:o}=(n=zs.get(r))!=null?n:{};return!s||!o?()=>{}:(s.add(t),()=>{s.delete(t),s.size===0&&(o(),zs.delete(r))})}var zr,$r,so,Xi,J_=class{constructor(e,t,n){this.callback=t,ct(this,zr),ct(this,$r,!1),ct(this,so),ct(this,Xi,pp(i=>{if(!ue(this,$r)&&i.target&&"contains"in i.target&&typeof i.target.contains=="function"){for(const a of ue(this,so))if(i.target.contains(a)){this.callback(ue(this,zr).boundingClientRect);break}}},hp));const r=V_(e),s=K_(r,t),o=X_(e,ue(this,Xi));ft(this,so,r),ft(this,zr,new mp(e,t,n)),this.disconnect=()=>{ue(this,$r)||(ft(this,$r,!0),s(),o(),ue(this,zr).disconnect())}}};zr=new WeakMap;$r=new WeakMap;so=new WeakMap;Xi=new WeakMap;function Ji(e){return"showPopover"in e&&"hidePopover"in e&&typeof e.showPopover=="function"&&typeof e.hidePopover=="function"}function Fr(e){try{Ji(e)&&e.isConnected&&e.hasAttribute("popover")&&!e.matches(":popover-open")&&e.showPopover()}catch{}}function zc(e){return!ap||!e?!1:e===Bt(e).scrollingElement}function yp(e){const t=Jt(e),n=zc(e)?z_(e):Zo(e),r=zc(e)?{height:t.innerHeight,width:t.innerWidth}:{height:e.clientHeight,width:e.clientWidth},s={current:{x:e.scrollLeft,y:e.scrollTop},max:{x:e.scrollWidth-r.width,y:e.scrollHeight-r.height}},o=s.current.y<=0,i=s.current.x<=0,a=s.current.y>=s.max.y,l=s.current.x>=s.max.x;return{rect:n,position:s,isTop:o,isLeft:i,isBottom:a,isRight:l}}function Q_(e,t){const{isTop:n,isBottom:r,isLeft:s,isRight:o,position:i}=yp(e),{x:a,y:l}=t??{x:0,y:0},u=!n&&i.current.y+l>0,d=!r&&i.current.y+l<i.max.y,f=!s&&i.current.x+a>0,p=!o&&i.current.x+a<i.max.x;return{top:u,bottom:d,left:f,right:p,x:f||p,y:u||d}}var vl=class{constructor(t){this.scheduler=t,this.pending=!1,this.tasks=new Set,this.resolvers=new Set,this.flush=()=>{const{tasks:n,resolvers:r}=this;this.pending=!1,this.tasks=new Set,this.resolvers=new Set;for(const s of n)s();for(const s of r)s()}}schedule(t){return this.tasks.add(t),this.pending||(this.pending=!0,this.scheduler(this.flush)),new Promise(n=>this.resolvers.add(n))}},wo=new vl(e=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(e):e()}),ex=new vl(e=>setTimeout(e,50)),So=new Map,tx=So.clear.bind(So);function Ot(e,t=!1){if(!t)return $c(e);let n=So.get(e);return n||(n=$c(e),So.set(e,n),ex.schedule(tx),n)}function $c(e){return Jt(e).getComputedStyle(e)}function nx(e,t=Ot(e,!0)){return t.position==="fixed"||t.position==="sticky"}function rx(e,t=Ot(e,!0)){const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const o=t[s];return typeof o=="string"?n.test(o):!1})}var sx={excludeElement:!0};function Qi(e,t=sx){const{limit:n,excludeElement:r}=t,s=new Set;function o(i){if(n!=null&&s.size>=n||!i)return s;if(lp(i)&&i.scrollingElement!=null&&!s.has(i.scrollingElement))return s.add(i.scrollingElement),s;if(!An(i))return cp(i)?o(i.parentElement):s;if(s.has(i))return s;const a=Ot(i,!0);if(r&&i===e||rx(i,a)&&s.add(i),nx(i,a)){const{scrollingElement:l}=i.ownerDocument;return l&&s.add(l),s}return o(i.parentNode)}return e?o(e):s}function ox(e){const[t]=Qi(e,{limit:1});return t??null}function lr(e,t=window.frameElement){const n={x:0,y:0,scaleX:1,scaleY:1};if(!e)return n;let r=ar(e);for(;r;){if(r===t)return n;const s=Zo(r),{x:o,y:i}=ix(r,s);n.x=n.x+s.left,n.y=n.y+s.top,n.scaleX=n.scaleX*o,n.scaleY=n.scaleY*i,r=ar(r)}return n}function ix(e,t=Zo(e)){const n=Math.round(t.width),r=Math.round(t.height);if(An(e))return{x:n/e.offsetWidth,y:r/e.offsetHeight};const s=Ot(e,!0);return{x:(parseFloat(s.width)||n)/n,y:(parseFloat(s.height)||r)/r}}function ax(e){if(e==="none")return null;const t=e.split(" "),n=parseFloat(t[0]),r=parseFloat(t[1]);return isNaN(n)&&isNaN(r)?null:{x:isNaN(n)?r:n,y:isNaN(r)?n:r}}function cs(e){if(e==="none")return null;const[t,n,r="0"]=e.split(" "),s={x:parseFloat(t),y:parseFloat(n),z:parseInt(r,10)};return isNaN(s.x)&&isNaN(s.y)?null:{x:isNaN(s.x)?0:s.x,y:isNaN(s.y)?0:s.y,z:isNaN(s.z)?0:s.z}}function ml(e){var t,n,r,s,o,i,a,l,u;const{scale:d,transform:f,translate:p}=e,v=ax(d),g=cs(p),m=lx(f);if(!m&&!v&&!g)return null;const w={x:(t=v==null?void 0:v.x)!=null?t:1,y:(n=v==null?void 0:v.y)!=null?n:1},S={x:(r=g==null?void 0:g.x)!=null?r:0,y:(s=g==null?void 0:g.y)!=null?s:0},k={x:(o=m==null?void 0:m.x)!=null?o:0,y:(i=m==null?void 0:m.y)!=null?i:0,scaleX:(a=m==null?void 0:m.scaleX)!=null?a:1,scaleY:(l=m==null?void 0:m.scaleY)!=null?l:1};return{x:S.x+k.x,y:S.y+k.y,z:(u=g==null?void 0:g.z)!=null?u:0,scaleX:w.x*k.scaleX,scaleY:w.y*k.scaleY}}function lx(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}var _t=(e=>(e[e.Idle=0]="Idle",e[e.Forward=1]="Forward",e[e.Reverse=-1]="Reverse",e))(_t||{}),cx={x:.2,y:.2},ux={x:10,y:10};function dx(e,t,n,r=25,s=cx,o=ux){const{x:i,y:a}=t,{rect:l,isTop:u,isBottom:d,isLeft:f,isRight:p}=yp(e),v=lr(e),g=Ot(e,!0),m=ml(g),w=m!==null?(m==null?void 0:m.scaleX)<0:!1,S=m!==null?(m==null?void 0:m.scaleY)<0:!1,k=new At(l.left*v.scaleX+v.x,l.top*v.scaleY+v.y,l.width*v.scaleX,l.height*v.scaleY),y={x:0,y:0},b={x:0,y:0},j={height:k.height*s.y,width:k.width*s.x};return(!u||S&&!d)&&a<=k.top+j.height&&(n==null?void 0:n.y)!==1&&i>=k.left-o.x&&i<=k.right+o.x?(y.y=S?1:-1,b.y=r*Math.abs((k.top+j.height-a)/j.height)):(!d||S&&!u)&&a>=k.bottom-j.height&&(n==null?void 0:n.y)!==-1&&i>=k.left-o.x&&i<=k.right+o.x&&(y.y=S?-1:1,b.y=r*Math.abs((k.bottom-j.height-a)/j.height)),(!p||w&&!f)&&i>=k.right-j.width&&(n==null?void 0:n.x)!==-1&&a>=k.top-o.y&&a<=k.bottom+o.y?(y.x=w?-1:1,b.x=r*Math.abs((k.right-j.width-i)/j.width)):(!f||w&&!p)&&i<=k.left+j.width&&(n==null?void 0:n.x)!==1&&a>=k.top-o.y&&a<=k.bottom+o.y&&(y.x=w?1:-1,b.x=r*Math.abs((k.left+j.width-i)/j.width)),{direction:y,speed:b}}function fx(e){return"scrollIntoViewIfNeeded"in e&&typeof e.scrollIntoViewIfNeeded=="function"}function bp(e,t=!1){if(fx(e)){e.scrollIntoViewIfNeeded(t);return}if(!An(e))return e.scrollIntoView();var n=ox(e);if(!An(n))return;const r=Ot(n,!0),s=parseInt(r.getPropertyValue("border-top-width")),o=parseInt(r.getPropertyValue("border-left-width")),i=e.offsetTop-n.offsetTop<n.scrollTop,a=e.offsetTop-n.offsetTop+e.clientHeight-s>n.scrollTop+n.clientHeight,l=e.offsetLeft-n.offsetLeft<n.scrollLeft,u=e.offsetLeft-n.offsetLeft+e.clientWidth-o>n.scrollLeft+n.clientWidth,d=i&&!a;(i||a)&&t&&(n.scrollTop=e.offsetTop-n.offsetTop-n.clientHeight/2-s+e.clientHeight/2),(l||u)&&t&&(n.scrollLeft=e.offsetLeft-n.offsetLeft-n.clientWidth/2-o+e.clientWidth/2),(i||a||l||u)&&!t&&e.scrollIntoView(d)}function px(e,t,n){const{scaleX:r,scaleY:s,x:o,y:i}=t,a=e.left+o+(1-r)*parseFloat(n),l=e.top+i+(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),u=r?e.width*r:e.width,d=s?e.height*s:e.height;return{width:u,height:d,top:l,right:a+u,bottom:l+d,left:a}}function hx(e,t,n){const{scaleX:r,scaleY:s,x:o,y:i}=t,a=e.left-o-(1-r)*parseFloat(n),l=e.top-i-(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),u=r?e.width/r:e.width,d=s?e.height/s:e.height;return{width:u,height:d,top:l,right:a+u,bottom:l+d,left:a}}function _p({element:e,keyframes:t,options:n}){return e.animate(t,n).finished}function Fc(e,t=Ot(e).translate,n=!0){if(n){const r=ip(e,s=>"translate"in s);if(r){const{translate:s=""}=r[0];if(typeof s=="string"){const o=cs(s);if(o)return o}}}if(t){const r=cs(t);if(r)return r}return{x:0,y:0,z:0}}var gx=new vl(e=>setTimeout(e,0)),Xr=new Map,vx=Xr.clear.bind(Xr);function mx(e){const t=e.ownerDocument;let n=Xr.get(t);if(n)return n;n=t.getAnimations(),Xr.set(t,n),gx.schedule(vx);const r=n.filter(s=>qo(s.effect)&&s.effect.target===e);return Xr.set(e,r),n}function yx(e,t){const n=mx(e).filter(r=>{var s,o;if(qo(r.effect)){const{target:i}=r.effect;if((o=i&&((s=t.isValidTarget)==null?void 0:s.call(t,i)))!=null?o:!0)return r.effect.getKeyframes().some(l=>{for(const u of t.properties)if(l[u])return!0})}}).map(r=>{const{effect:s,currentTime:o}=r,i=s==null?void 0:s.getComputedTiming().duration;if(!(r.pending||r.playState==="finished")&&typeof i=="number"&&typeof o=="number"&&o<i)return r.currentTime=i,()=>{r.currentTime=o}});if(n.length>0)return()=>n.forEach(r=>r==null?void 0:r())}var It=class extends At{constructor(e,t={}){var n,r,s,o;const{frameTransform:i=lr(e),ignoreTransforms:a,getBoundingClientRect:l=Zo}=t,u=yx(e,{properties:["transform","translate","scale","width","height"],isValidTarget:j=>(j!==e||up())&&j.contains(e)}),d=l(e);let{top:f,left:p,width:v,height:g}=d,m;const w=Ot(e),S=ml(w),k={x:(n=S==null?void 0:S.scaleX)!=null?n:1,y:(r=S==null?void 0:S.scaleY)!=null?r:1},y=bx(e,w);u==null||u(),S&&(m=hx(d,S,w.transformOrigin),(a||y)&&(f=m.top,p=m.left,v=m.width,g=m.height));const b={width:(s=m==null?void 0:m.width)!=null?s:v,height:(o=m==null?void 0:m.height)!=null?o:g};if(y&&!a&&m){const j=px(m,y,w.transformOrigin);f=j.top,p=j.left,v=j.width,g=j.height,k.x=y.scaleX,k.y=y.scaleY}i&&(a||(p*=i.scaleX,v*=i.scaleX,f*=i.scaleY,g*=i.scaleY),p+=i.x,f+=i.y),super(p,f,v,g),this.scale=k,this.intrinsicWidth=b.width,this.intrinsicHeight=b.height}};function bx(e,t){var n;const r=e.getAnimations();let s=null;if(!r.length)return null;for(const o of r){if(o.playState!=="running")continue;const i=qo(o.effect)?o.effect.getKeyframes():[],a=i[i.length-1];if(!a)continue;const{transform:l,translate:u,scale:d}=a;if(l||u||d){const f=ml({transform:typeof l=="string"&&l?l:t.transform,translate:typeof u=="string"&&u?u:t.translate,scale:typeof d=="string"&&d?d:t.scale});f&&(s=s?{x:s.x+f.x,y:s.y+f.y,z:(n=s.z)!=null?n:f.z,scaleX:s.scaleX*f.scaleX,scaleY:s.scaleY*f.scaleY}:f)}}return s}function Jr(e){return"style"in e&&typeof e.style=="object"&&e.style!==null&&"setProperty"in e.style&&"removeProperty"in e.style&&typeof e.style.setProperty=="function"&&typeof e.style.removeProperty=="function"}var _x=class{constructor(e){this.element=e,this.initial=new Map}set(e,t=""){const{element:n}=this;if(Jr(n))for(const[r,s]of Object.entries(e)){const o=`${t}${r}`;this.initial.has(o)||this.initial.set(o,n.style.getPropertyValue(o)),n.style.setProperty(o,typeof s=="string"?s:`${s}px`)}}remove(e,t=""){const{element:n}=this;if(Jr(n))for(const r of e){const s=`${t}${r}`;n.style.removeProperty(s)}}reset(){const{element:e}=this;if(Jr(e)){for(const[t,n]of this.initial)e.style.setProperty(t,n);e.getAttribute("style")===""&&e.removeAttribute("style")}}};function mr(e){return e?e instanceof Jt(e).Element||gl(e)&&e.nodeType===Node.ELEMENT_NODE:!1}function us(e){if(!e)return!1;const{KeyboardEvent:t}=Jt(e.target);return e instanceof t}function xx(e){if(!e)return!1;const{PointerEvent:t}=Jt(e.target);return e instanceof t}function wx(e){if(!mr(e))return!1;const{tagName:t}=e;return t==="INPUT"||t==="TEXTAREA"||Sx(e)}function Sx(e){return e.hasAttribute("contenteditable")&&e.getAttribute("contenteditable")!=="false"}var ui={};function ea(e){const t=ui[e]==null?0:ui[e]+1;return ui[e]=t,`${e}-${t}`}var kx=({dragOperation:e,droppable:t})=>{const n=e.position.current;if(!n)return null;const{id:r}=t;if(!t.shape)return null;if(t.shape.containsPoint(n)){const s=tt.distance(t.shape.center,n);return{id:r,value:1/s,type:Ht.PointerIntersection,priority:bt.High}}return null},Ix=({dragOperation:e,droppable:t})=>{const{shape:n}=e;if(!t.shape||!(n!=null&&n.current))return null;const r=n.current.intersectionArea(t.shape);if(r){const{position:s}=e,o=tt.distance(t.shape.center,s.current),a=r/(n.current.area+t.shape.area-r)/o;return{id:t.id,value:a,type:Ht.ShapeIntersection,priority:bt.Normal}}return null},xp=e=>{var t;return(t=kx(e))!=null?t:Ix(e)},Ex=e=>{const{dragOperation:t,droppable:n}=e,{shape:r,position:s}=t;if(!n.shape)return null;const o=r?At.from(r.current.boundingRectangle).corners:void 0,a=At.from(n.shape.boundingRectangle).corners.reduce((l,u,d)=>{var f;return l+tt.distance(tt.from(u),(f=o==null?void 0:o[d])!=null?f:s.current)},0)/4;return{id:n.id,value:1/a,type:Ht.Collision,priority:bt.Normal}},Cx=Object.create,yl=Object.defineProperty,jx=Object.defineProperties,Px=Object.getOwnPropertyDescriptor,Ax=Object.getOwnPropertyDescriptors,ko=Object.getOwnPropertySymbols,wp=Object.prototype.hasOwnProperty,Sp=Object.prototype.propertyIsEnumerable,kp=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),yr=e=>{throw TypeError(e)},ta=(e,t,n)=>t in e?yl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ds=(e,t)=>{for(var n in t||(t={}))wp.call(t,n)&&ta(e,n,t[n]);if(ko)for(var n of ko(t))Sp.call(t,n)&&ta(e,n,t[n]);return e},bl=(e,t)=>jx(e,Ax(t)),Bc=(e,t)=>yl(e,"name",{value:t,configurable:!0}),Ip=(e,t)=>{var n={};for(var r in e)wp.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ko)for(var r of ko(e))t.indexOf(r)<0&&Sp.call(e,r)&&(n[r]=e[r]);return n},ks=e=>{var t;return[,,,Cx((t=e==null?void 0:e[kp("metadata")])!=null?t:null)]},Ep=["class","method","getter","setter","accessor","field","value","get","set"],Br=e=>e!==void 0&&typeof e!="function"?yr("Function expected"):e,Ox=(e,t,n,r,s)=>({kind:Ep[e],name:t,metadata:r,addInitializer:o=>n._?yr("Already initialized"):s.push(Br(o||null))}),br=(e,t)=>ta(t,kp("metadata"),e[3]),We=(e,t,n,r)=>{for(var s=0,o=e[t>>1],i=o&&o.length;s<i;s++)t&1?o[s].call(n):r=o[s].call(n,r);return r},Qt=(e,t,n,r,s,o)=>{var i,a,l,u,d,f=t&7,p=!!(t&8),v=!!(t&16),g=f>3?e.length+1:f?p?1:2:0,m=Ep[f+5],w=f>3&&(e[g-1]=[]),S=e[g]||(e[g]=[]),k=f&&(!v&&!p&&(s=s.prototype),f<5&&(f>3||!v)&&Px(f<4?s:{get[n](){return Ye(this,o)},set[n](b){return Pt(this,o,b)}},n));f?v&&f<4&&Bc(o,(f>2?"set ":f>1?"get ":"")+n):Bc(s,n);for(var y=r.length-1;y>=0;y--)u=Ox(f,n,l={},e[3],S),f&&(u.static=p,u.private=v,d=u.access={has:v?b=>Mx(s,b):b=>n in b},f^3&&(d.get=v?b=>(f^1?Ye:na)(b,s,f^4?o:k.get):b=>b[n]),f>2&&(d.set=v?(b,j)=>Pt(b,s,j,f^4?o:k.set):(b,j)=>b[n]=j)),a=(0,r[y])(f?f<4?v?o:k[m]:f>4?void 0:{get:k.get,set:k.set}:s,u),l._=1,f^4||a===void 0?Br(a)&&(f>4?w.unshift(a):f?v?o=a:k[m]=a:s=a):typeof a!="object"||a===null?yr("Object expected"):(Br(i=a.get)&&(k.get=i),Br(i=a.set)&&(k.set=i),Br(i=a.init)&&w.unshift(i));return f||br(e,s),k&&yl(s,n,k),v?f^4?o:k:s},_l=(e,t,n)=>t.has(e)||yr("Cannot "+n),Mx=(e,t)=>Object(t)!==t?yr('Cannot use the "in" operator on this value'):e.has(t),Ye=(e,t,n)=>(_l(e,t,"read from private field"),n?n.call(e):t.get(e)),Xe=(e,t,n)=>t.has(e)?yr("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Pt=(e,t,n,r)=>(_l(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),na=(e,t,n)=>(_l(e,t,"access private method"),n),Hc={role:"button",roleDescription:"draggable"},Dx="dnd-kit-description",Tx="dnd-kit-announcement",Rx={draggable:"To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item in a given direction. Press space again to drop the item in its new position, or press escape to cancel."},Lx={dragstart({operation:{source:e}}){if(e)return`Picked up draggable item ${e.id}.`},dragover({operation:{source:e,target:t}}){if(!(!e||e.id===(t==null?void 0:t.id)))return t?`Draggable item ${e.id} was moved over droppable target ${t.id}.`:`Draggable item ${e.id} is no longer over a droppable target.`},dragend({operation:{source:e,target:t},canceled:n}){if(e)return n?`Dragging was cancelled. Draggable item ${e.id} was dropped.`:t?`Draggable item ${e.id} was dropped over droppable target ${t.id}`:`Draggable item ${e.id} was dropped.`}};function Nx(e){const t=e.tagName.toLowerCase();return["input","select","textarea","a","button"].includes(t)}function zx(e,t){const n=document.createElement("div");return n.id=e,n.style.setProperty("display","none"),n.textContent=t,n}function $x(e){const t=document.createElement("div");return t.id=e,t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-atomic","true"),t.style.setProperty("position","fixed"),t.style.setProperty("width","1px"),t.style.setProperty("height","1px"),t.style.setProperty("margin","-1px"),t.style.setProperty("border","0"),t.style.setProperty("padding","0"),t.style.setProperty("overflow","hidden"),t.style.setProperty("clip","rect(0 0 0 0)"),t.style.setProperty("clip-path","inset(100%)"),t.style.setProperty("white-space","nowrap"),t}var Fx=["dragover","dragmove"],Bx=class extends Je{constructor(e,t){super(e);const{id:n,idPrefix:{description:r=Dx,announcement:s=Tx}={},announcements:o=Lx,screenReaderInstructions:i=Rx,debounce:a=500}=t??{},l=n?`${r}-${n}`:ea(r),u=n?`${s}-${n}`:ea(s);let d,f,p,v;const g=(j=v)=>{!p||!j||(p==null?void 0:p.nodeValue)!==j&&(p.nodeValue=j)},m=()=>wo.schedule(g),w=Hx(m,a),S=Object.entries(o).map(([j,C])=>this.manager.monitor.addEventListener(j,(A,_)=>{const I=p;if(!I)return;const x=C==null?void 0:C(A,_);x&&I.nodeValue!==x&&(v=x,Fx.includes(j)?w():(m(),w.cancel()))})),k=()=>{let j=[];d!=null&&d.isConnected||(d=zx(l,i.draggable),j.push(d)),f!=null&&f.isConnected||(f=$x(u),p=document.createTextNode(""),f.appendChild(p),j.push(f)),j.length>0&&document.body.append(...j)},y=new Set;function b(){for(const j of y)j()}this.registerEffect(()=>{var j;y.clear();for(const C of this.manager.registry.draggables.value){const A=(j=C.handle)!=null?j:C.element;if(A){(!d||!f)&&y.add(k),(!Nx(A)||up())&&!A.hasAttribute("tabindex")&&y.add(()=>A.setAttribute("tabindex","0")),!A.hasAttribute("role")&&A.tagName.toLowerCase()!=="button"&&y.add(()=>A.setAttribute("role",Hc.role)),A.hasAttribute("aria-roledescription")||y.add(()=>A.setAttribute("aria-roledescription",Hc.roleDescription)),A.hasAttribute("aria-describedby")||y.add(()=>A.setAttribute("aria-describedby",l));for(const I of["aria-pressed","aria-grabbed"]){const x=String(C.isDragging);A.getAttribute(I)!==x&&y.add(()=>A.setAttribute(I,x))}const _=String(C.disabled);A.getAttribute("aria-disabled")!==_&&y.add(()=>A.setAttribute("aria-disabled",_))}}y.size>0&&wo.schedule(b)}),this.destroy=()=>{super.destroy(),d==null||d.remove(),f==null||f.remove(),S.forEach(j=>j())}}};function Hx(e,t){let n;const r=()=>{clearTimeout(n),n=setTimeout(e,t)};return r.cancel=()=>clearTimeout(n),r}var Vx=class extends Je{constructor(e,t){super(e,t),this.manager=e;const n=yo(()=>{var r;return Bt((r=this.manager.dragOperation.source)==null?void 0:r.element)});this.destroy=dt(()=>{var r;const{dragOperation:s}=this.manager,{cursor:o="grabbing",nonce:i}=(r=this.options)!=null?r:{};if(s.status.initialized){const a=n.value,l=a.createElement("style");return i&&l.setAttribute("nonce",i),l.textContent=`* { cursor: ${o} !important; }`,a.head.appendChild(l),()=>l.remove()}})}},Is="data-dnd-",ra=`${Is}dropping`,et="--dnd-",Nt=`${Is}dragging`,Io=`${Is}placeholder`,Wx=[Nt,Io,"popover","aria-pressed","aria-grabbing"],Ux=["view-transition-name"],qx=`
95
+ :root [${Nt}] {
96
+ position: fixed !important;
97
+ pointer-events: none !important;
98
+ touch-action: none;
99
+ z-index: calc(infinity);
100
+ will-change: translate;
101
+ top: var(${et}top, 0px) !important;
102
+ left: var(${et}left, 0px) !important;
103
+ right: unset !important;
104
+ bottom: unset !important;
105
+ width: var(${et}width, auto);
106
+ max-width: var(${et}width, auto);
107
+ height: var(${et}height, auto);
108
+ max-height: var(${et}height, auto);
109
+ transition: var(${et}transition) !important;
110
+ }
111
+
112
+ :root [${Io}] {
113
+ transition: none;
114
+ }
115
+
116
+ :root [${Io}='hidden'] {
117
+ visibility: hidden;
118
+ }
119
+
120
+ [${Nt}] * {
121
+ pointer-events: none !important;
122
+ }
123
+
124
+ [${Nt}]:not([${ra}]) {
125
+ translate: var(${et}translate) !important;
126
+ }
127
+
128
+ [${Nt}][style*='${et}scale'] {
129
+ scale: var(${et}scale) !important;
130
+ transform-origin: var(${et}transform-origin) !important;
131
+ }
132
+
133
+ @layer {
134
+ :where([${Nt}][popover]) {
135
+ overflow: visible;
136
+ background: unset;
137
+ border: unset;
138
+ margin: unset;
139
+ padding: unset;
140
+ color: inherit;
141
+
142
+ &:is(input, button) {
143
+ border: revert;
144
+ background: revert;
145
+ }
146
+ }
147
+ }
148
+ [${Nt}]::backdrop, [${Is}overlay]:not([${Nt}]) {
149
+ display: none;
150
+ visibility: hidden;
151
+ }
152
+ `.replace(/\n+/g," ").replace(/\s+/g," ").trim();function Zx(e,t="hidden"){return xe(()=>{const{element:n,manager:r}=e;if(!n||!r)return;const s=Yx(n,r.registry.droppables),o=[],i=B_(n),{remove:a}=i;return Gx(s,i,o),Kx(i,t),i.remove=()=>{o.forEach(l=>l()),a.call(i)},i})}function Yx(e,t){const n=new Map;for(const r of t)if(r.element&&(e===r.element||e.contains(r.element))){const s=`${Is}${ea("dom-id")}`;r.element.setAttribute(s,""),n.set(r,s)}return n}function Gx(e,t,n){for(const[r,s]of e){if(!r.element)continue;const o=`[${s}]`,i=t.matches(o)?t:t.querySelector(o);if(r.element.removeAttribute(s),!i)continue;const a=r.element;r.proxy=i,i.removeAttribute(s),Ki.set(a,i),n.push(()=>{Ki.delete(a),r.proxy=void 0})}}function Kx(e,t="hidden"){e.setAttribute("inert","true"),e.setAttribute("tab-index","-1"),e.setAttribute("aria-hidden","true"),e.setAttribute(Io,t)}function Vc(e,t){return e===t?!0:ar(e)===ar(t)}function Wc(e){const{target:t}=e;"newState"in e&&e.newState==="closed"&&mr(t)&&t.hasAttribute("popover")&&requestAnimationFrame(()=>Fr(t))}function Uc(e){return e.tagName==="TR"}var Eo=new Map,Cp,sa,fs,xl,oo,jp,Pp,ps=class extends(sa=Je,Cp=[fe],sa){constructor(t,n){super(t,n),Xe(this,oo),Xe(this,xl,We(fs,8,this)),We(fs,11,this),this.state={initial:{},current:{}},this.registerEffect(na(this,oo,Pp)),this.registerEffect(na(this,oo,jp))}destroy(){super.destroy();for(const[t,n]of Eo.entries())n.instances.has(this)&&(n.instances.delete(this),n.instances.size===0&&(n.cleanup(),Eo.delete(t)))}};fs=ks(sa);xl=new WeakMap;oo=new WeakSet;jp=function(){var e,t,n;const{state:r,manager:s,options:o}=this,{dragOperation:i}=s,{position:a,source:l,status:u}=i;if(u.idle){r.current={},r.initial={};return}if(!l)return;const{element:d,feedback:f}=l;if(!d||f==="none"||!u.initialized||u.initializing)return;const{initial:p}=r,v=(e=this.overlay)!=null?e:d,g=lr(v),m=lr(d),w=!Vc(d,v),S=new It(d,{frameTransform:w?m:null,ignoreTransforms:!w}),k={x:m.scaleX/g.scaleX,y:m.scaleY/g.scaleY};let{width:y,height:b,top:j,left:C}=S;w&&(y=y/k.x,b=b/k.y);let A,_;const I=new _x(v),{transition:x,translate:M,boxSizing:D,paddingBlockStart:L,paddingBlockEnd:N,paddingInlineStart:F,paddingInlineEnd:B,borderInlineStartWidth:K,borderInlineEndWidth:$,borderBlockStartWidth:U,borderBlockEndWidth:Z}=Ot(d),ne=f==="clone",Y=D==="content-box",se=Y?parseInt(F)+parseInt(B)+parseInt(K)+parseInt($):0,ve=Y?parseInt(L)+parseInt(N)+parseInt(U)+parseInt(Z):0,ie=f!=="move"&&!this.overlay?Zx(l,ne?"clone":"hidden"):null,Oe=xe(()=>us(s.dragOperation.activatorEvent));if(M!=="none"){const le=cs(M);le&&!p.translate&&(p.translate=le)}if(!p.transformOrigin){const le=xe(()=>a.current);p.transformOrigin={x:(le.x-C*g.scaleX-g.x)/(y*g.scaleX),y:(le.y-j*g.scaleY-g.y)/(b*g.scaleY)}}const{transformOrigin:Q}=p,V=j*g.scaleY+g.y,E=C*g.scaleX+g.x;if(!p.coordinates&&(p.coordinates={x:E,y:V},k.x!==1||k.y!==1)){const{scaleX:le,scaleY:_e}=m,{x:Le,y:Te}=Q;p.coordinates.x+=(y*le-y)*Le,p.coordinates.y+=(b*_e-b)*Te}p.dimensions||(p.dimensions={width:y,height:b}),p.frameTransform||(p.frameTransform=g);const T={x:p.coordinates.x-E,y:p.coordinates.y-V},R={width:(p.dimensions.width*p.frameTransform.scaleX-y*g.scaleX)*Q.x,height:(p.dimensions.height*p.frameTransform.scaleY-b*g.scaleY)*Q.y},W={x:T.x/g.scaleX+R.width,y:T.y/g.scaleY+R.height},q={left:C+W.x,top:j+W.y};v.setAttribute(Nt,"true");const X=xe(()=>i.transform),oe=(t=p.translate)!=null?t:{x:0,y:0},me=X.x*g.scaleX+oe.x,ke=X.y*g.scaleY+oe.y,we=`${me}px ${ke}px 0`,Me=x?`${x}, translate 0ms linear`:"";I.set({width:y-se,height:b-ve,top:q.top,left:q.left,translate:we,transition:Me,scale:w?`${k.x} ${k.y}`:"","transform-origin":`${Q.x*100}% ${Q.y*100}%`},et),ie&&(d.insertAdjacentElement("afterend",ie),o!=null&&o.rootElement&&(typeof o.rootElement=="function"?o.rootElement(l):o.rootElement).appendChild(d)),Ji(v)&&(v.hasAttribute("popover")||v.setAttribute("popover","manual"),Fr(v),v.addEventListener("beforetoggle",Wc));const De=new ResizeObserver(()=>{if(!ie)return;const le=new It(ie,{frameTransform:g,ignoreTransforms:!0}),_e=Q??{x:1,y:1},Le=(y-le.width)*_e.x+W.x,Te=(b-le.height)*_e.y+W.y;if(I.set({width:le.width-se,height:le.height-ve,top:j+Te,left:C+Le},et),A==null||A.takeRecords(),Uc(d)&&Uc(ie)){const He=Array.from(d.cells),J=Array.from(ie.cells);for(const[re,he]of He.entries()){const Ne=J[re];he.style.width=`${Ne.offsetWidth}px`}}i.shape=new It(v)}),Ie=new It(v);xe(()=>i.shape=Ie);const ye=Jt(v),Fe=le=>{this.manager.actions.stop({event:le})};Oe&&ye.addEventListener("resize",Fe),xe(()=>l.status)==="idle"&&requestAnimationFrame(()=>l.status="dragging"),ie&&(De.observe(ie),A=new MutationObserver(le=>{let _e=!1;for(const Le of le){if(Le.target!==d){_e=!0;continue}if(Le.type!=="attributes")continue;const Te=Le.attributeName;if(Te.startsWith("aria-")||Wx.includes(Te))continue;const He=d.getAttribute(Te);if(Te==="style"){if(Jr(d)&&Jr(ie)){const J=d.style;for(const re of Array.from(ie.style))J.getPropertyValue(re)===""&&ie.style.removeProperty(re);for(const re of Array.from(J)){if(Ux.includes(re)||re.startsWith(et))continue;const he=J.getPropertyValue(re);ie.style.setProperty(re,he)}}}else He!==null?ie.setAttribute(Te,He):ie.removeAttribute(Te)}_e&&ne&&(ie.innerHTML=d.innerHTML)}),A.observe(d,{attributes:!0,subtree:!0,childList:!0}),_=new MutationObserver(le=>{for(const _e of le)if(_e.addedNodes.length!==0)for(const Le of Array.from(_e.addedNodes)){if(Le.contains(d)&&d.nextElementSibling!==ie){d.insertAdjacentElement("afterend",ie),Fr(v);return}if(Le.contains(ie)&&ie.previousElementSibling!==d){ie.insertAdjacentElement("beforebegin",d),Fr(v);return}}}),_.observe(d.ownerDocument.body,{childList:!0,subtree:!0}));const gt=(n=s.dragOperation.source)==null?void 0:n.id,en=()=>{var le;if(!Oe||gt==null)return;const _e=s.registry.draggables.get(gt),Le=(le=_e==null?void 0:_e.handle)!=null?le:_e==null?void 0:_e.element;An(Le)&&Le.focus()},tn=()=>{A==null||A.disconnect(),_==null||_.disconnect(),De.disconnect(),ye.removeEventListener("resize",Fe),Ji(v)&&(v.removeEventListener("beforetoggle",Wc),v.removeAttribute("popover")),v.removeAttribute(Nt),I.reset(),l.status="idle";const le=r.current.translate!=null;ie&&(le||ie.parentElement!==v.parentElement)&&v.isConnected&&ie.replaceWith(v),ie==null||ie.remove()},Vt=ws(()=>{var le;const{transform:_e,status:Le}=i;if(!(!_e.x&&!_e.y&&!r.current.translate)&&Le.dragging){const Te=(le=p.translate)!=null?le:{x:0,y:0},He={x:_e.x/g.scaleX+Te.x,y:_e.y/g.scaleY+Te.y},J=r.current.translate,re=xe(()=>i.modifiers),he=xe(()=>{var vt;return(vt=i.shape)==null?void 0:vt.current}),Ne=Oe?"250ms cubic-bezier(0.25, 1, 0.5, 1)":"0ms linear";if(I.set({transition:`${x}, translate ${Ne}`,translate:`${He.x}px ${He.y}px 0`},et),A==null||A.takeRecords(),he&&he!==Ie&&J&&!re.length){const vt=tt.delta(He,J);i.shape=At.from(he.boundingRectangle).translate(vt.x*g.scaleX,vt.y*g.scaleY)}else i.shape=new It(v);r.current.translate=He}},function(){if(i.status.dropped){this.dispose(),l.status="dropping";let le=r.current.translate;const _e=le!=null;if(!le&&d!==v&&(le={x:0,y:0}),!le){tn();return}const Le=()=>{var Te,He;{Fr(v);const[,J]=(Te=ip(v,Ce=>"translate"in Ce))!=null?Te:[];J==null||J.pause();const re=ie??d,he={frameTransform:Vc(v,re)?null:void 0},Ne=new It(v,he),vt=(He=cs(Ot(v).translate))!=null?He:le,St=new It(re,he),Ms=At.delta(Ne,St,l.alignment),G={x:vt.x-Ms.x,y:vt.y-Ms.y},ce=Math.round(Ne.intrinsicHeight)!==Math.round(St.intrinsicHeight)?{minHeight:[`${Ne.intrinsicHeight}px`,`${St.intrinsicHeight}px`],maxHeight:[`${Ne.intrinsicHeight}px`,`${St.intrinsicHeight}px`]}:{},de=Math.round(Ne.intrinsicWidth)!==Math.round(St.intrinsicWidth)?{minWidth:[`${Ne.intrinsicWidth}px`,`${St.intrinsicWidth}px`],maxWidth:[`${Ne.intrinsicWidth}px`,`${St.intrinsicWidth}px`]}:{};I.set({transition:x},et),v.setAttribute(ra,""),A==null||A.takeRecords(),_p({element:v,keyframes:bl(ds(ds({},ce),de),{translate:[`${vt.x}px ${vt.y}px 0`,`${G.x}px ${G.y}px 0`]}),options:{duration:_e||v!==d?250:0,easing:"ease"}}).then(()=>{v.removeAttribute(ra),J==null||J.finish(),tn(),requestAnimationFrame(en)})}};s.renderer.rendering.then(Le)}});return()=>{tn(),Vt()}};Pp=function(){var e,t,n;const{status:r,source:s,target:o}=this.manager.dragOperation,{nonce:i}=(e=this.options)!=null?e:{};if(r.initializing){const a=Bt((t=s==null?void 0:s.element)!=null?t:null),l=Bt((n=o==null?void 0:o.element)!=null?n:null),u=new Set([a,l]);for(const d of u){let f=Eo.get(d);if(!f){const p=document.createElement("style");p.textContent=qx,i&&p.setAttribute("nonce",i),d.head.prepend(p);const v=new MutationObserver(g=>{for(const m of g)if(m.type==="childList"){const w=Array.from(m.removedNodes);w.length>0&&w.includes(p)&&d.head.prepend(p)}});v.observe(d.head,{childList:!0}),f={cleanup:()=>{v.disconnect(),p.remove()},instances:new Set},Eo.set(d,f)}f.instances.add(this)}}};Qt(fs,4,"overlay",Cp,ps,xl);br(fs,ps);ps.configure=qa(ps);var Xx=ps,Cr=!0,Jx=!1,Ap,Op,Mp,Dp,dn,wl,Sl;Dp=(Mp=[fe],_t.Forward),Op=(Ap=[fe],_t.Reverse);var hs=class{constructor(){Xe(this,wl,We(dn,8,this,Cr)),We(dn,11,this),Xe(this,Sl,We(dn,12,this,Cr)),We(dn,15,this)}isLocked(e){return e===_t.Idle?!1:e==null?this[_t.Forward]===Cr&&this[_t.Reverse]===Cr:this[e]===Cr}unlock(e){e!==_t.Idle&&(this[e]=Jx)}};dn=ks(null);wl=new WeakMap;Sl=new WeakMap;Qt(dn,4,Dp,Mp,hs,wl);Qt(dn,4,Op,Ap,hs,Sl);br(dn,hs);var Qx=[_t.Forward,_t.Reverse],qc=class{constructor(){this.x=new hs,this.y=new hs}isLocked(){return this.x.isLocked()&&this.y.isLocked()}},e0=class extends Je{constructor(e){super(e);const t=xs(new qc);let n=null;this.signal=t,dt(()=>{const{status:r}=e.dragOperation;if(!r.initialized){n=null,t.value=new qc;return}const{delta:s}=e.dragOperation.position;if(n){const o={x:Zc(s.x,n.x),y:Zc(s.y,n.y)},i=t.peek();Re(()=>{for(const a of vf)for(const l of Qx)o[a]===l&&i[a].unlock(l);t.value=i})}n=s})}get current(){return this.signal.peek()}};function Zc(e,t){return Math.sign(e-t)}var Tp,oa,gs,kl,an,ia,Es=class extends(oa=Uo,Tp=[fe],oa){constructor(e){super(e),Xe(this,kl,We(gs,8,this,!1)),We(gs,11,this),Xe(this,an),Xe(this,ia,()=>{if(!Ye(this,an))return;const{element:o,by:i}=Ye(this,an);i.y&&(o.scrollTop+=i.y),i.x&&(o.scrollLeft+=i.x)}),this.scroll=o=>{var i;if(this.disabled)return!1;const a=this.getScrollableElements();if(!a)return Pt(this,an,void 0),!1;const{position:l}=this.manager.dragOperation,u=l==null?void 0:l.current;if(u){const{by:d}=o??{},f=d?{x:Yc(d.x),y:Yc(d.y)}:void 0,p=f?void 0:this.scrollIntentTracker.current;if(p!=null&&p.isLocked())return!1;for(const v of a){const g=Q_(v,d);if(g.x||g.y){const{speed:m,direction:w}=dx(v,u,f);if(p)for(const S of vf)p[S].isLocked(w[S])&&(m[S]=0,w[S]=0);if(w.x||w.y){const{x:S,y:k}=d??w,y=S*m.x,b=k*m.y;if(y||b){const j=(i=Ye(this,an))==null?void 0:i.by;if(this.autoScrolling&&j&&(j.x&&!y||j.y&&!b))continue;return Pt(this,an,{element:v,by:{x:y,y:b}}),wo.schedule(Ye(this,ia)),!0}}}}}return Pt(this,an,void 0),!1};let t=null,n=null;const r=yo(()=>{const{position:o,source:i}=e.dragOperation;if(!o)return null;const a=dp(Bt(i==null?void 0:i.element),o.current);return a&&(t=a),a??t}),s=yo(()=>{const o=r.value,{documentElement:i}=Bt(o);if(!o||o===i){const{target:a}=e.dragOperation,l=a==null?void 0:a.element;if(l){const u=Qi(l,{excludeElement:!1});return n=u,u}}if(o){const a=Qi(o,{excludeElement:!1});return this.autoScrolling&&n&&a.size<(n==null?void 0:n.size)?n:(n=a,a)}return n=null,null},Yt);this.getScrollableElements=()=>s.value,this.scrollIntentTracker=new e0(e),this.destroy=e.monitor.addEventListener("dragmove",o=>{this.disabled||o.defaultPrevented||!us(e.dragOperation.activatorEvent)||!o.by||this.scroll({by:o.by})&&o.preventDefault()})}};gs=ks(oa);kl=new WeakMap;an=new WeakMap;ia=new WeakMap;Qt(gs,4,"autoScrolling",Tp,Es,kl);br(gs,Es);function Yc(e){return e>0?_t.Forward:e<0?_t.Reverse:_t.Idle}var t0=class{constructor(e){this.scheduler=e,this.pending=!1,this.tasks=new Set,this.resolvers=new Set,this.flush=()=>{const{tasks:t,resolvers:n}=this;this.pending=!1,this.tasks=new Set,this.resolvers=new Set;for(const r of t)r();for(const r of n)r()}}schedule(e){return this.tasks.add(e),this.pending||(this.pending=!0,this.scheduler(this.flush)),new Promise(t=>this.resolvers.add(t))}},n0=new t0(e=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(e):e()}),r0=10,Il=class extends Je{constructor(e,t){super(e);const n=e.registry.plugins.get(Es);if(!n)throw new Error("AutoScroller plugin depends on Scroller plugin");this.destroy=dt(()=>{if(this.disabled)return;const{position:r,status:s}=e.dragOperation;if(s.dragging)if(n.scroll()){n.autoScrolling=!0;const i=setInterval(()=>n0.schedule(n.scroll),r0);return()=>{clearInterval(i)}}else n.autoScrolling=!1})}},Gc={capture:!0,passive:!0},Hr,s0=class extends Uo{constructor(e){super(e),Xe(this,Hr),this.handleScroll=()=>{Ye(this,Hr)==null&&Pt(this,Hr,setTimeout(()=>{this.manager.collisionObserver.forceUpdate(!1),Pt(this,Hr,void 0)},50))};const{dragOperation:t}=this.manager;this.destroy=dt(()=>{var n,r,s;if(t.status.dragging){const i=(s=(r=(n=t.source)==null?void 0:n.element)==null?void 0:r.ownerDocument)!=null?s:document;return i.addEventListener("scroll",this.handleScroll,Gc),()=>{i.removeEventListener("scroll",this.handleScroll,Gc)}}})}};Hr=new WeakMap;var o0=class extends Je{constructor(e,t){super(e,t),this.manager=e,this.destroy=dt(()=>{var n;const{dragOperation:r}=this.manager,{nonce:s}=(n=this.options)!=null?n:{};if(r.status.initialized){const o=document.createElement("style");return s&&o.setAttribute("nonce",s),o.textContent="* { user-select: none !important; -webkit-user-select: none !important; }",document.head.appendChild(o),di(),document.addEventListener("selectionchange",di,{capture:!0}),()=>{document.removeEventListener("selectionchange",di,{capture:!0}),o.remove()}}})}};function di(){var e;(e=document.getSelection())==null||e.removeAllRanges()}var Vr=Object.freeze({offset:10,keyboardCodes:{start:["Space","Enter"],cancel:["Escape"],end:["Space","Enter","Tab"],up:["ArrowUp"],down:["ArrowDown"],left:["ArrowLeft"],right:["ArrowRight"]},shouldActivate(e){var t;const{event:n,source:r}=e,s=(t=r.handle)!=null?t:r.element;return n.target===s}}),Kn,Co=class extends ir{constructor(t,n){super(t),this.manager=t,this.options=n,Xe(this,Kn,[]),this.listeners=new fp,this.handleSourceKeyDown=(r,s,o)=>{if(this.disabled||r.defaultPrevented||!mr(r.target)||s.disabled)return;const{keyboardCodes:i=Vr.keyboardCodes,shouldActivate:a=Vr.shouldActivate}=o??{};i.start.includes(r.code)&&this.manager.dragOperation.status.idle&&a({event:r,source:s,manager:this.manager})&&this.handleStart(r,s,o)}}bind(t,n=this.options){return dt(()=>{var s;const o=(s=t.handle)!=null?s:t.element,i=a=>{us(a)&&this.handleSourceKeyDown(a,t,n)};if(o)return o.addEventListener("keydown",i),()=>{o.removeEventListener("keydown",i)}})}handleStart(t,n,r){const{element:s}=n;if(!s)throw new Error("Source draggable does not have an associated element");t.preventDefault(),t.stopImmediatePropagation(),bp(s);const{center:o}=new It(s);if(this.manager.actions.start({event:t,coordinates:{x:o.x,y:o.y},source:n}).signal.aborted)return this.cleanup();this.sideEffects();const a=Bt(s),l=[this.listeners.bind(a,[{type:"keydown",listener:u=>this.handleKeyDown(u,n,r),options:{capture:!0}}])];Ye(this,Kn).push(...l)}handleKeyDown(t,n,r){const{keyboardCodes:s=Vr.keyboardCodes}=r??{};if(Bn(t,[...s.end,...s.cancel])){t.preventDefault();const o=Bn(t,s.cancel);this.handleEnd(t,o);return}Bn(t,s.up)?this.handleMove("up",t):Bn(t,s.down)&&this.handleMove("down",t),Bn(t,s.left)?this.handleMove("left",t):Bn(t,s.right)&&this.handleMove("right",t)}handleEnd(t,n){this.manager.actions.stop({event:t,canceled:n}),this.cleanup()}handleMove(t,n){var r,s;const{shape:o}=this.manager.dragOperation,i=n.shiftKey?5:1;let a={x:0,y:0},l=(s=(r=this.options)==null?void 0:r.offset)!=null?s:Vr.offset;if(typeof l=="number"&&(l={x:l,y:l}),!!o){switch(t){case"up":a={x:0,y:-l.y*i};break;case"down":a={x:0,y:l.y*i};break;case"left":a={x:-l.x*i,y:0};break;case"right":a={x:l.x*i,y:0};break}(a.x||a.y)&&(n.preventDefault(),this.manager.actions.move({event:n,by:a}))}}sideEffects(){const t=this.manager.registry.plugins.get(Il);(t==null?void 0:t.disabled)===!1&&(t.disable(),Ye(this,Kn).push(()=>{t.enable()}))}cleanup(){Ye(this,Kn).forEach(t=>t()),Pt(this,Kn,[])}destroy(){this.cleanup(),this.listeners.clear()}};Kn=new WeakMap;Co.configure=qa(Co);Co.defaults=Vr;var i0=Co;function Bn(e,t){return t.includes(e.code)}var Rp=Object.freeze({activationConstraints(e,t){var n;const{pointerType:r,target:s}=e;if(!(r==="mouse"&&mr(s)&&(t.handle===s||(n=t.handle)!=null&&n.contains(s))))return r==="touch"?{delay:{value:250,tolerance:5}}:wx(s)&&!e.defaultPrevented?{delay:{value:200,tolerance:0}}:{delay:{value:200,tolerance:10},distance:{value:5}}}}),Xn,Jn,jo=class extends ir{constructor(t,n){super(t),this.manager=t,this.options=n,Xe(this,Xn,new Set),Xe(this,Jn),this.listeners=new fp,this.latest={event:void 0,coordinates:void 0},this.handleMove=()=>{const{event:r,coordinates:s}=this.latest;!r||!s||this.manager.actions.move({event:r,to:s})},this.handleCancel=this.handleCancel.bind(this),this.handlePointerUp=this.handlePointerUp.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this)}activationConstraints(t,n){var r;const{activationConstraints:s=Rp.activationConstraints}=(r=this.options)!=null?r:{};return typeof s=="function"?s(t,n):s}bind(t,n=this.options){return dt(()=>{var s;const o=new AbortController,{signal:i}=o,a=u=>{xx(u)&&this.handlePointerDown(u,t,n)};let l=[(s=t.handle)!=null?s:t.element];n!=null&&n.activatorElements&&(Array.isArray(n.activatorElements)?l=n.activatorElements:l=n.activatorElements(t));for(const u of l)u&&(c0(u.ownerDocument.defaultView),u.addEventListener("pointerdown",a,{signal:i}));return()=>o.abort()})}handlePointerDown(t,n,r={}){if(this.disabled||!t.isPrimary||t.button!==0||!mr(t.target)||n.disabled||a0(t)||!this.manager.dragOperation.status.idle)return;const{target:s}=t,o=An(s)&&s.draggable&&s.getAttribute("draggable")==="true",i=lr(n.element);this.initialCoordinates={x:t.clientX*i.scaleX+i.x,y:t.clientY*i.scaleY+i.y};const a=this.activationConstraints(t,n);if(t.sensor=this,!(a!=null&&a.delay)&&!(a!=null&&a.distance))this.handleStart(n,t);else{const{delay:f}=a;if(f){const p=setTimeout(()=>this.handleStart(n,t),f.value);Pt(this,Jn,()=>{clearTimeout(p),Pt(this,Jn,void 0)})}}const l=Bt(t.target),u=this.listeners.bind(l,[{type:"pointermove",listener:f=>this.handlePointerMove(f,n)},{type:"pointerup",listener:this.handlePointerUp,options:{capture:!0}},{type:"dragstart",listener:o?this.handleCancel:$s,options:{capture:!0}}]),d=()=>{var f;u(),(f=Ye(this,Jn))==null||f.call(this),this.initialCoordinates=void 0};Ye(this,Xn).add(d)}handlePointerMove(t,n){const r={x:t.clientX,y:t.clientY},s=lr(n.element);if(r.x=r.x*s.scaleX+s.x,r.y=r.y*s.scaleY+s.y,this.manager.dragOperation.status.dragging){t.preventDefault(),t.stopPropagation(),this.latest.event=t,this.latest.coordinates=r,wo.schedule(this.handleMove);return}if(!this.initialCoordinates)return;const o={x:r.x-this.initialCoordinates.x,y:r.y-this.initialCoordinates.y},i=this.activationConstraints(t,n),{distance:a,delay:l}=i??{};if(a){if(a.tolerance!=null&&li(o,a.tolerance))return this.handleCancel(t);if(li(o,a.value))return this.handleStart(n,t)}if(l&&li(o,l.tolerance))return this.handleCancel(t)}handlePointerUp(t){const{status:n}=this.manager.dragOperation;if(!n.idle){t.preventDefault(),t.stopPropagation();const r=!n.initialized;this.manager.actions.stop({event:t,canceled:r})}this.cleanup()}handleKeyDown(t){t.key==="Escape"&&(t.preventDefault(),this.handleCancel(t))}handleStart(t,n){var r;const{manager:s,initialCoordinates:o}=this;if((r=Ye(this,Jn))==null||r.call(this),!o||!s.dragOperation.status.idle||n.defaultPrevented)return;if(s.actions.start({coordinates:o,event:n,source:t}).signal.aborted)return this.cleanup();n.preventDefault();const a=Bt(n.target),l=a.body;l.setPointerCapture(n.pointerId);const u=this.listeners.bind(a,[{type:"touchmove",listener:$s,options:{passive:!1}},{type:"click",listener:$s},{type:"contextmenu",listener:$s},{type:"keydown",listener:this.handleKeyDown},{type:"lostpointercapture",listener:d=>{d.target===l&&this.handlePointerUp(d)}}]);Ye(this,Xn).add(u)}handleCancel(t){const{dragOperation:n}=this.manager;n.status.initialized&&this.manager.actions.stop({event:t,canceled:!0}),this.cleanup()}cleanup(){this.latest={event:void 0,coordinates:void 0},Ye(this,Xn).forEach(t=>t()),Ye(this,Xn).clear()}destroy(){this.cleanup(),this.listeners.clear()}};Xn=new WeakMap;Jn=new WeakMap;jo.configure=qa(jo);jo.defaults=Rp;var Lp=jo;function a0(e){return"sensor"in e}function $s(e){e.preventDefault()}function l0(){}var Kc=new WeakSet;function c0(e){!e||Kc.has(e)||(e.addEventListener("touchmove",l0,{capture:!1,passive:!1}),Kc.add(e))}var jn={modifiers:[],plugins:[Bx,Il,Vx,Xx,o0],sensors:[Lp,i0]},Np=class extends N_{constructor(e={}){const{plugins:t=jn.plugins,sensors:n=jn.sensors,modifiers:r=[]}=e;super(bl(ds({},e),{plugins:[s0,Es,...t],sensors:n,modifiers:r}))}},zp,$p,Fp,aa,Et,El,Cl,jl,_r=class extends(aa=$t,Fp=[fe],$p=[fe],zp=[fe],aa){constructor(e,t){var n=e,{element:r,effects:s=()=>[],handle:o,feedback:i="default"}=n,a=Ip(n,["element","effects","handle","feedback"]);super(ds({effects:()=>[...s(),()=>{var l,u;const{manager:d}=this;if(!d)return;const p=((u=(l=this.sensors)==null?void 0:l.map(Za))!=null?u:[...d.sensors]).map(v=>{const g=v instanceof ir?v:d.registry.register(v.plugin),m=v instanceof ir?void 0:v.options;return g.bind(this,m)});return function(){p.forEach(g=>g())}}]},a),t),Xe(this,El,We(Et,8,this)),We(Et,11,this),Xe(this,Cl,We(Et,12,this)),We(Et,15,this),Xe(this,jl,We(Et,16,this)),We(Et,19,this),this.element=r,this.handle=o,this.feedback=i}};Et=ks(aa);El=new WeakMap;Cl=new WeakMap;jl=new WeakMap;Qt(Et,4,"handle",Fp,_r,El);Qt(Et,4,"element",$p,_r,Cl);Qt(Et,4,"feedback",zp,_r,jl);br(Et,_r);var Bp,Hp,la,fn,Pl,fi,Vp,Wp,Qr,Al,Yo=class extends(la=Ft,Hp=[fe],Bp=[fe],la){constructor(e,t){var n=e,{element:r,effects:s=()=>[]}=n,o=Ip(n,["element","effects"]);const{collisionDetector:i=xp}=o,a=u=>{const{manager:d,element:f}=this;if(!f||u===null){this.shape=void 0;return}if(!d)return;const p=new It(f),v=xe(()=>this.shape);return p&&(v!=null&&v.equals(p))?v:(this.shape=p,p)},l=xs(!1);super(bl(ds({},o),{collisionDetector:i,effects:()=>[...s(),()=>{const{element:u,manager:d}=this;if(!d)return;const{dragOperation:f}=d,{source:p}=f;l.value=!!(p&&f.status.initialized&&u&&!this.disabled&&this.accepts(p))},()=>{const{element:u}=this;if(l.value&&u){const d=new J_(u,a);return()=>{d.disconnect(),this.shape=void 0}}},()=>{var u;if((u=this.manager)!=null&&u.dragOperation.status.initialized)return()=>{this.shape=void 0}}]}),t),Xe(this,Qr),Xe(this,Pl,We(fn,8,this)),We(fn,11,this),Xe(this,Al,We(fn,12,this)),We(fn,15,this),this.element=r,this.refreshShape=()=>a()}set element(e){Pt(this,Qr,e,Wp)}get element(){var e;return(e=this.proxy)!=null?e:Ye(this,Qr,Vp)}};fn=ks(la);Pl=new WeakMap;Qr=new WeakSet;Al=new WeakMap;fi=Qt(fn,20,"#element",Hp,Qr,Pl),Vp=fi.get,Wp=fi.set;Qt(fn,4,"proxy",Bp,Yo,Al);br(fn,Yo);function u0(e){return e!=null&&typeof e=="object"&&"current"in e}function hn(e){var t;if(e!=null)return u0(e)?(t=e.current)!=null?t:void 0:e}var d0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",xr=d0?h.useLayoutEffect:h.useEffect;function f0(){const e=h.useState(0)[1];return h.useCallback(()=>{e(t=>t+1)},[e])}function Ol(e,t){const n=h.useRef(new Map),r=f0();return xr(()=>{if(!e){n.current.clear();return}return dt(()=>{var s;let o=!1,i=!1;for(const a of n.current){const[l]=a,u=xe(()=>a[1]),d=e[l];u!==d&&(o=!0,n.current.set(l,d),i=(s=t==null?void 0:t(l,u,d))!=null?s:!1)}o&&(i?ys.flushSync(r):r())})},[e]),h.useMemo(()=>e&&new Proxy(e,{get(s,o){const i=s[o];return n.current.set(o,i),i}}),[e])}function p0(e,t){e()}function Hn(e){const t=h.useRef(e);return xr(()=>{t.current=e},[e]),t}function be(e,t,n=h.useEffect,r=Object.is){const s=h.useRef(e);n(()=>{const o=s.current;r(e,o)||(s.current=e,t(e,o))},[t,e])}function nr(e,t){const n=h.useRef(hn(e));xr(()=>{const r=hn(e);r!==n.current&&(n.current=r,t(r))})}var h0=Object.defineProperty,g0=Object.defineProperties,v0=Object.getOwnPropertyDescriptors,Po=Object.getOwnPropertySymbols,Up=Object.prototype.hasOwnProperty,qp=Object.prototype.propertyIsEnumerable,Xc=(e,t,n)=>t in e?h0(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Zp=(e,t)=>{for(var n in t||(t={}))Up.call(t,n)&&Xc(e,n,t[n]);if(Po)for(var n of Po(t))qp.call(t,n)&&Xc(e,n,t[n]);return e},Yp=(e,t)=>g0(e,v0(t)),m0=(e,t)=>{var n={};for(var r in e)Up.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Po)for(var r of Po(e))t.indexOf(r)<0&&qp.call(e,r)&&(n[r]=e[r]);return n},y0=new Np,Gp=h.createContext(y0),b0=h.memo(h.forwardRef(({children:e},t)=>{const[n,r]=h.useState(0),s=h.useRef(null),o=h.useRef(null),i=h.useMemo(()=>({renderer:{get rendering(){var a;return(a=s.current)!=null?a:Promise.resolve()}},trackRendering(a){s.current||(s.current=new Promise(l=>{o.current=l})),h.startTransition(()=>{a(),r(l=>l+1)})}}),[]);return xr(()=>{var a;(a=o.current)==null||a.call(o),s.current=null},[e,n]),h.useImperativeHandle(t,()=>i),null})),pi=[void 0,Yt];function Kp(e){var t=e,{children:n,onCollision:r,onBeforeDragStart:s,onDragStart:o,onDragMove:i,onDragOver:a,onDragEnd:l}=t,u=m0(t,["children","onCollision","onBeforeDragStart","onDragStart","onDragMove","onDragOver","onDragEnd"]),d;const f=h.useRef(null),[p,v]=h.useState((d=u.manager)!=null?d:null),{plugins:g,modifiers:m,sensors:w}=u,S=Hn(s),k=Hn(o),y=Hn(a),b=Hn(i),j=Hn(l),C=Hn(r);return h.useEffect(()=>{var A;if(!f.current)throw new Error("Renderer not found");const{renderer:_,trackRendering:I}=f.current,x=(A=u.manager)!=null?A:new Np(u);return x.renderer=_,x.monitor.addEventListener("beforedragstart",M=>{const D=S.current;D&&I(()=>D(M,x))}),x.monitor.addEventListener("dragstart",M=>{var D;return(D=k.current)==null?void 0:D.call(k,M,x)}),x.monitor.addEventListener("dragover",M=>{const D=y.current;D&&I(()=>D(M,x))}),x.monitor.addEventListener("dragmove",M=>{const D=b.current;D&&I(()=>D(M,x))}),x.monitor.addEventListener("dragend",M=>{const D=j.current;D&&I(()=>D(M,x))}),x.monitor.addEventListener("collision",M=>{var D;return(D=C.current)==null?void 0:D.call(C,M,x)}),h.startTransition(()=>v(x)),x.destroy},[u.manager]),be(g,()=>p&&(p.plugins=g??jn.plugins),...pi),be(w,()=>p&&(p.sensors=w??jn.sensors),...pi),be(m,()=>p&&(p.modifiers=m??jn.modifiers),...pi),c.jsxs(Gp.Provider,{value:p,children:[c.jsx(b0,{ref:f,children:n}),n]})}function Xp(){return h.useContext(Gp)}function Ml(e){var t;const n=(t=Xp())!=null?t:void 0,[r]=h.useState(()=>e(n));return r.manager!==n&&(r.manager=n),xr(r.register,[n,r]),r}function _0(e){const{disabled:t,data:n,element:r,handle:s,id:o,modifiers:i,sensors:a}=e,l=Ml(d=>new _r(Yp(Zp({},e),{register:!1,handle:hn(s),element:hn(r)}),d)),u=Ol(l,x0);return be(o,()=>l.id=o),nr(s,d=>l.handle=d),nr(r,d=>l.element=d),be(n,()=>n&&(l.data=n)),be(t,()=>l.disabled=t===!0),be(a,()=>l.sensors=a),be(i,()=>l.modifiers=i,void 0,Yt),be(e.feedback,()=>{var d;return l.feedback=(d=e.feedback)!=null?d:"default"}),be(e.alignment,()=>l.alignment=e.alignment),{draggable:u,get isDragging(){return u.isDragging},get isDropping(){return u.isDropping},get isDragSource(){return u.isDragSource},handleRef:h.useCallback(d=>{l.handle=d??void 0},[l]),ref:h.useCallback(d=>{var f,p;!d&&((f=l.element)!=null&&f.isConnected)&&!((p=l.manager)!=null&&p.dragOperation.status.idle)||(l.element=d??void 0)},[l])}}function x0(e,t,n){return!!(e==="isDragSource"&&!n&&t)}var w0=Object.create,Jp=Object.defineProperty,S0=Object.getOwnPropertyDescriptor,Qp=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Go=e=>{throw TypeError(e)},k0=(e,t,n)=>t in e?Jp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,I0=e=>{var t;return[,,,w0((t=e==null?void 0:e[Qp("metadata")])!=null?t:null)]},eh=["class","method","getter","setter","accessor","field","value","get","set"],th=e=>e!==void 0&&typeof e!="function"?Go("Function expected"):e,E0=(e,t,n,r,s)=>({kind:eh[e],name:t,metadata:r,addInitializer:o=>n._?Go("Already initialized"):s.push(th(o||null))}),C0=(e,t)=>k0(t,Qp("metadata"),e[3]),j0=(e,t,n,r)=>{for(var s=0,o=e[t>>1],i=o&&o.length;s<i;s++)o[s].call(n);return r},nh=(e,t,n,r,s,o)=>{for(var i,a,l,u,d=t&7,f=!1,p=!1,v=2,g=eh[d+5],m=e[v]||(e[v]=[]),w=(s=s.prototype,S0(s,n)),S=r.length-1;S>=0;S--)l=E0(d,n,a={},e[3],m),l.static=f,l.private=p,u=l.access={has:k=>n in k},u.get=k=>k[n],i=(0,r[S])(w[g],l),a._=1,th(i)&&(w[g]=i);return w&&Jp(s,n,w),s},rh=(e,t,n)=>t.has(e)||Go("Cannot "+n),P0=(e,t,n)=>(rh(e,t,"read from private field"),t.get(e)),A0=(e,t,n)=>t.has(e)?Go("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),O0=(e,t,n,r)=>(rh(e,t,"write to private field"),t.set(e,n),n),In=class ca{constructor(t,n){this.x=t,this.y=n}static delta(t,n){return new ca(t.x-n.x,t.y-n.y)}static distance(t,n){return Math.hypot(t.x-n.x,t.y-n.y)}static equals(t,n){return t.x===n.x&&t.y===n.y}static from({x:t,y:n}){return new ca(t,n)}},sh,oh,ua,io,Cs,Dl=class extends(ua=Tn,oh=[Ve],sh=[Ve],ua){constructor(e){const t=In.from(e);super(t,(n,r)=>In.equals(n,r)),j0(Cs,5,this),A0(this,io,0),this.velocity={x:0,y:0}}get delta(){return In.delta(this.current,this.initial)}get direction(){const{current:e,previous:t}=this;if(!t)return null;const n={x:e.x-t.x,y:e.y-t.y};return!n.x&&!n.y?null:Math.abs(n.x)>Math.abs(n.y)?n.x>0?"right":"left":n.y>0?"down":"up"}get current(){return super.current}set current(e){const{current:t}=this,n=In.from(e),r={x:n.x-t.x,y:n.y-t.y},s=Date.now(),o=s-P0(this,io),i=a=>Math.round(a/o*100);Re(()=>{O0(this,io,s),this.velocity={x:i(r.x),y:i(r.y)},super.current=n})}reset(e=this.defaultValue){super.reset(In.from(e)),this.velocity={x:0,y:0}}};Cs=I0(ua);io=new WeakMap;nh(Cs,2,"delta",oh,Dl);nh(Cs,2,"direction",sh,Dl);C0(Cs,Dl);var ih=(e=>(e.Horizontal="x",e.Vertical="y",e))(ih||{});Object.values(ih);var M0=({dragOperation:e,droppable:t})=>{const n=e.position.current;if(!n)return null;const{id:r}=t;if(!t.shape)return null;if(t.shape.containsPoint(n)){const s=In.distance(t.shape.center,n);return{id:r,value:1/s,type:Ht.PointerIntersection,priority:bt.High}}return null},D0=({dragOperation:e,droppable:t})=>{const{shape:n}=e;if(!t.shape||!(n!=null&&n.current))return null;const r=n.current.intersectionArea(t.shape);if(r){const{position:s}=e,o=In.distance(t.shape.center,s.current),a=r/(n.current.area+t.shape.area-r)/o;return{id:t.id,value:a,type:Ht.ShapeIntersection,priority:bt.Normal}}return null},T0=e=>{var t;return(t=M0(e))!=null?t:D0(e)};function ah(e){const{collisionDetector:t,data:n,disabled:r,element:s,id:o,accept:i,type:a}=e,l=Ml(d=>new Yo(Yp(Zp({},e),{register:!1,element:hn(s)}),d)),u=Ol(l);return be(o,()=>l.id=o),nr(s,d=>l.element=d),be(i,()=>l.accept=i,void 0,Yt),be(t,()=>l.collisionDetector=t??T0),be(n,()=>n&&(l.data=n)),be(r,()=>l.disabled=r===!0),be(a,()=>l.type=a),{droppable:u,get isDropTarget(){return u.isDropTarget},ref:h.useCallback(d=>{var f,p;!d&&((f=l.element)!=null&&f.isConnected)&&!((p=l.manager)!=null&&p.dragOperation.status.idle)||(l.element=d??void 0)},[l])}}var R0=Object.create,lh=Object.defineProperty,L0=Object.defineProperties,N0=Object.getOwnPropertyDescriptor,z0=Object.getOwnPropertyDescriptors,Ao=Object.getOwnPropertySymbols,ch=Object.prototype.hasOwnProperty,uh=Object.prototype.propertyIsEnumerable,$0=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),js=e=>{throw TypeError(e)},da=(e,t,n)=>t in e?lh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,F0=(e,t)=>{for(var n in t||(t={}))ch.call(t,n)&&da(e,n,t[n]);if(Ao)for(var n of Ao(t))uh.call(t,n)&&da(e,n,t[n]);return e},B0=(e,t)=>L0(e,z0(t)),H0=(e,t)=>{var n={};for(var r in e)ch.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ao)for(var r of Ao(e))t.indexOf(r)<0&&uh.call(e,r)&&(n[r]=e[r]);return n},V0=e=>{var t;return[,,,R0((t=void 0)!=null?t:null)]},dh=["class","method","getter","setter","accessor","field","value","get","set"],Wr=e=>e!==void 0&&typeof e!="function"?js("Function expected"):e,W0=(e,t,n,r,s)=>({kind:dh[e],name:t,metadata:r,addInitializer:o=>n._?js("Already initialized"):s.push(Wr(o||null))}),U0=(e,t)=>da(t,$0("metadata"),e[3]),Fs=(e,t,n,r)=>{for(var s=0,o=e[t>>1],i=o&&o.length;s<i;s++)t&1?o[s].call(n):r=o[s].call(n,r);return r},fh=(e,t,n,r,s,o)=>{for(var i,a,l,u,d,f=t&7,p=!1,v=!1,g=e.length+1,m=dh[f+5],w=e[g-1]=[],S=e[g]||(e[g]=[]),k=(s=s.prototype,N0({get[n](){return Ur(this,o)},set[n](b){return kn(this,o,b)}},n)),y=r.length-1;y>=0;y--)u=W0(f,n,l={},e[3],S),u.static=p,u.private=v,d=u.access={has:b=>n in b},d.get=b=>b[n],d.set=(b,j)=>b[n]=j,a=(0,r[y])({get:k.get,set:k.set},u),l._=1,a===void 0?Wr(a)&&(k[m]=a):typeof a!="object"||a===null?js("Object expected"):(Wr(i=a.get)&&(k.get=i),Wr(i=a.set)&&(k.set=i),Wr(i=a.init)&&w.unshift(i));return k&&lh(s,n,k),s},ph=(e,t,n)=>t.has(e)||js("Cannot "+n),Ur=(e,t,n)=>(ph(e,t,"read from private field"),t.get(e)),jr=(e,t,n)=>t.has(e)?js("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),kn=(e,t,n,r)=>(ph(e,t,"write to private field"),t.set(e,n),n);function En(e){return e instanceof Ll||e instanceof mh}var Bs=10,q0=class extends Je{constructor(e){super(e);const t=dt(()=>{const{dragOperation:r}=e;if(us(r.activatorEvent)&&En(r.source)&&r.status.initialized){const s=e.registry.plugins.get(Es);if(s)return s.disable(),()=>s.enable()}}),n=e.monitor.addEventListener("dragmove",(r,s)=>{queueMicrotask(()=>{if(this.disabled||r.defaultPrevented||!r.nativeEvent)return;const{dragOperation:o}=s;if(!us(r.nativeEvent)||!En(o.source)||!o.shape)return;const{actions:i,collisionObserver:a,registry:l}=s,{by:u}=r;if(!u)return;const d=Z0(u),{source:f,target:p}=o,{center:v}=o.shape.current,g=[],m=[];Re(()=>{for(const j of l.droppables){const{id:C}=j;if(!j.accepts(f)||C===(p==null?void 0:p.id)&&En(j)||!j.element)continue;let A=j.shape;const _=new It(j.element,{getBoundingClientRect:I=>ls(I,void 0,.2)});!_.height||!_.width||(d=="down"&&v.y+Bs<_.center.y||d=="up"&&v.y-Bs>_.center.y||d=="left"&&v.x-Bs>_.center.x||d=="right"&&v.x+Bs<_.center.x)&&(g.push(j),j.shape=_,m.push(()=>j.shape=A))}}),r.preventDefault(),a.disable();const w=a.computeCollisions(g,Ex);Re(()=>m.forEach(j=>j()));const[S]=w;if(!S)return;const{id:k}=S,{index:y,group:b}=f.sortable;i.setDropTarget(k).then(()=>{const{source:j,target:C,shape:A}=o;if(!j||!En(j)||!A)return;const{index:_,group:I,target:x}=j.sortable,M=y!==_||b!==I,D=M?x:C==null?void 0:C.element;if(!D)return;bp(D);const L=new It(D);if(!L)return;const N=At.delta(L,At.from(A.current.boundingRectangle),j.alignment);i.move({by:N}),M?i.setDropTarget(j.id).then(()=>a.enable()):a.enable()})})});this.destroy=()=>{n(),t()}}};function Z0(e){const{x:t,y:n}=e;if(t>0)return"right";if(t<0)return"left";if(n>0)return"down";if(n<0)return"up"}var Y0=Object.defineProperty,G0=Object.defineProperties,K0=Object.getOwnPropertyDescriptors,Jc=Object.getOwnPropertySymbols,X0=Object.prototype.hasOwnProperty,J0=Object.prototype.propertyIsEnumerable,Qc=(e,t,n)=>t in e?Y0(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,eu=(e,t)=>{for(var n in t||(t={}))X0.call(t,n)&&Qc(e,n,t[n]);if(Jc)for(var n of Jc(t))J0.call(t,n)&&Qc(e,n,t[n]);return e},tu=(e,t)=>G0(e,K0(t));function Q0(e,t,n){if(t===n)return e;const r=e.slice();return r.splice(n,0,r.splice(t,1)[0]),r}function e1(e,t,n){var r,s;const{source:o,target:i,canceled:a}=t.operation;if(!o||!i||a)return"preventDefault"in t&&t.preventDefault(),e;const l=(y,b)=>y===b||typeof y=="object"&&"id"in y&&y.id===b;if(Array.isArray(e)){const y=e.findIndex(j=>l(j,o.id)),b=e.findIndex(j=>l(j,i.id));if(y===-1||b===-1)return e;if(!a&&"index"in o&&typeof o.index=="number"){const j=o.index;if(j!==y)return n(e,y,j)}return n(e,y,b)}const u=Object.entries(e);let d=-1,f,p=-1,v;for(const[y,b]of u)if(d===-1&&(d=b.findIndex(j=>l(j,o.id)),d!==-1&&(f=y)),p===-1&&(p=b.findIndex(j=>l(j,i.id)),p!==-1&&(v=y)),d!==-1&&p!==-1)break;if(!o.manager)return e;const{dragOperation:g}=o.manager,m=(s=(r=g.shape)==null?void 0:r.current.center)!=null?s:g.position.current;if(v==null&&i.id in e){const y=i.shape&&m.y>i.shape.center.y?e[i.id].length:0;v=i.id,p=y}if(f==null||v==null||f===v&&d===p)return"preventDefault"in t&&t.preventDefault(),e;if(f===v)return tu(eu({},e),{[f]:n(e[f],d,p)});const S=i.shape&&Math.round(m.y)>Math.round(i.shape.center.y)?1:0,k=e[f][d];return tu(eu({},e),{[f]:[...e[f].slice(0,d),...e[f].slice(d+1)],[v]:[...e[v].slice(0,p+S),k,...e[v].slice(p+S)]})}function t1(e,t){return e1(e,t,Q0)}var nu="__default__",n1=class extends Je{constructor(e){super(e);const t=()=>{const r=new Map;for(const s of e.registry.droppables)if(s instanceof Ll){const{sortable:o}=s,{group:i}=o;let a=r.get(i);a||(a=new Set,r.set(i,a)),a.add(o)}for(const[s,o]of r)r.set(s,new Set(Hs(o)));return r},n=[e.monitor.addEventListener("dragover",(r,s)=>{if(this.disabled)return;const{dragOperation:o}=s,{source:i,target:a}=o;if(!En(i)||!En(a)||i.sortable===a.sortable)return;const l=t(),u=i.sortable.group===a.sortable.group,d=l.get(i.sortable.group),f=u?d:l.get(a.sortable.group);!d||!f||queueMicrotask(()=>{r.defaultPrevented||s.renderer.rendering.then(()=>{var p,v,g;const m=t();for(const[x,M]of l.entries()){const D=Array.from(M).entries();for(const[L,N]of D)if(N.index!==L||N.group!==x||!((p=m.get(x))!=null&&p.has(N)))return}const w=i.sortable.element,S=a.sortable.element;if(!S||!w||!u&&a.id===i.sortable.group)return;const k=Hs(d),y=u?k:Hs(f),b=(v=i.sortable.group)!=null?v:nu,j=(g=a.sortable.group)!=null?g:nu,C={[b]:k,[j]:y},A=t1(C,r);if(C===A)return;const _=A[j].indexOf(i.sortable),I=A[j].indexOf(a.sortable);s.collisionObserver.disable(),ru(w,_,S,I),Re(()=>{for(const[x,M]of A[b].entries())M.index=x;if(!u)for(const[x,M]of A[j].entries())M.group=a.sortable.group,M.index=x}),s.actions.setDropTarget(i.id).then(()=>s.collisionObserver.enable())})})}),e.monitor.addEventListener("dragend",(r,s)=>{if(!r.canceled)return;const{dragOperation:o}=s,{source:i}=o;En(i)&&(i.sortable.initialIndex===i.sortable.index&&i.sortable.initialGroup===i.sortable.group||queueMicrotask(()=>{const a=t(),l=a.get(i.sortable.initialGroup);l&&s.renderer.rendering.then(()=>{for(const[v,g]of a.entries()){const m=Array.from(g).entries();for(const[w,S]of m)if(S.index!==w||S.group!==v)return}const u=Hs(l),d=i.sortable.element,f=u[i.sortable.initialIndex],p=f==null?void 0:f.element;!f||!p||!d||(ru(d,f.index,p,i.index),Re(()=>{for(const[v,g]of a.entries()){const m=Array.from(g).values();for(const w of m)w.index=w.initialIndex,w.group=w.initialGroup}}))})}))})];this.destroy=()=>{for(const r of n)r()}}};function ru(e,t,n,r){const s=r<t?"afterend":"beforebegin";n.insertAdjacentElement(s,e)}function r1(e,t){return e.index-t.index}function Hs(e){return Array.from(e).sort(r1)}var s1=[q0,n1],hh={duration:250,easing:"cubic-bezier(0.25, 1, 0.5, 1)",idle:!1},Vs=new l_,gh,vh,pn,Tl,qr,Zr,Rl,Qn;vh=[fe],gh=[fe];var Ko=class{constructor(e,t){jr(this,Tl,Fs(pn,8,this)),Fs(pn,11,this),jr(this,qr),jr(this,Zr),jr(this,Rl,Fs(pn,12,this)),Fs(pn,15,this),jr(this,Qn),this.register=()=>(Re(()=>{var f,p;(f=this.manager)==null||f.registry.register(this.droppable),(p=this.manager)==null||p.registry.register(this.draggable)}),()=>this.unregister()),this.unregister=()=>{Re(()=>{var f,p;(f=this.manager)==null||f.registry.unregister(this.droppable),(p=this.manager)==null||p.registry.unregister(this.draggable)})},this.destroy=()=>{Re(()=>{this.droppable.destroy(),this.draggable.destroy()})};var n=e,{effects:r=()=>[],group:s,index:o,sensors:i,type:a,transition:l=hh,plugins:u=s1}=n,d=H0(n,["effects","group","index","sensors","type","transition","plugins"]);this.droppable=new Ll(d,t,this),this.draggable=new mh(B0(F0({},d),{effects:()=>[()=>{var f,p,v;const g=(f=this.manager)==null?void 0:f.dragOperation.status;g!=null&&g.initializing&&this.id===((v=(p=this.manager)==null?void 0:p.dragOperation.source)==null?void 0:v.id)&&Vs.clear(this.manager),g!=null&&g.dragging&&Vs.set(this.manager,this.id,xe(()=>({initialIndex:this.index,initialGroup:this.group})))},()=>{const{index:f,group:p,manager:v}=this,g=Ur(this,Zr),m=Ur(this,qr);(f!==g||p!==m)&&(kn(this,Zr,f),kn(this,qr,p),this.animate())},()=>{const{target:f}=this,{feedback:p,isDragSource:v}=this.draggable;p=="move"&&v&&(this.droppable.disabled=!f)},()=>{const{manager:f}=this;for(const p of u)f==null||f.registry.register(p)},...r()],type:a,sensors:i}),t,this),kn(this,Qn,d.element),this.manager=t,this.index=o,kn(this,Zr,o),this.group=s,kn(this,qr,s),this.type=a,this.transition=l}get initialIndex(){var e,t;return(t=(e=Vs.get(this.manager,this.id))==null?void 0:e.initialIndex)!=null?t:this.index}get initialGroup(){var e,t;return(t=(e=Vs.get(this.manager,this.id))==null?void 0:e.initialGroup)!=null?t:this.group}animate(){xe(()=>{const{manager:e,transition:t}=this,{shape:n}=this.droppable;if(!e)return;const{idle:r}=e.dragOperation.status;!n||!t||r&&!t.idle||e.renderer.rendering.then(()=>{const{element:s}=this;if(!s)return;const o=this.refreshShape();if(!o)return;const i={x:n.boundingRectangle.left-o.boundingRectangle.left,y:n.boundingRectangle.top-o.boundingRectangle.top},{translate:a}=Ot(s),l=Fc(s,a,!1),u=Fc(s,a);(i.x||i.y)&&_p({element:s,keyframes:{translate:[`${l.x+i.x}px ${l.y+i.y}px ${l.z}`,`${u.x}px ${u.y}px ${u.z}`]},options:t}).then(()=>{e.dragOperation.status.dragging||(this.droppable.shape=void 0)})})})}get manager(){return this.draggable.manager}set manager(e){Re(()=>{this.draggable.manager=e,this.droppable.manager=e})}set element(e){Re(()=>{const t=Ur(this,Qn),n=this.droppable.element,r=this.draggable.element;(!n||n===t)&&(this.droppable.element=e),(!r||r===t)&&(this.draggable.element=e),kn(this,Qn,e)})}get element(){var e,t;const n=Ur(this,Qn);if(n)return(t=(e=Ki.get(n))!=null?e:n)!=null?t:this.droppable.element}set target(e){this.droppable.element=e}get target(){return this.droppable.element}set source(e){this.draggable.element=e}get source(){return this.draggable.element}get disabled(){return this.draggable.disabled&&this.droppable.disabled}set feedback(e){this.draggable.feedback=e}set disabled(e){Re(()=>{this.droppable.disabled=e,this.draggable.disabled=e})}set data(e){Re(()=>{this.droppable.data=e,this.draggable.data=e})}set handle(e){this.draggable.handle=e}set id(e){Re(()=>{this.droppable.id=e,this.draggable.id=e})}get id(){return this.droppable.id}set sensors(e){this.draggable.sensors=e}set modifiers(e){this.draggable.modifiers=e}set collisionPriority(e){this.droppable.collisionPriority=e}set collisionDetector(e){this.droppable.collisionDetector=e??xp}set alignment(e){this.draggable.alignment=e}get alignment(){return this.draggable.alignment}set type(e){Re(()=>{this.droppable.type=e,this.draggable.type=e})}get type(){return this.draggable.type}set accept(e){this.droppable.accept=e}get accept(){return this.droppable.accept}get isDropTarget(){return this.droppable.isDropTarget}get isDragSource(){return this.draggable.isDragSource}get isDragging(){return this.draggable.isDragging}get isDropping(){return this.draggable.isDropping}get status(){return this.draggable.status}refreshShape(){return this.droppable.refreshShape()}accepts(e){return this.droppable.accepts(e)}};pn=V0();Tl=new WeakMap;qr=new WeakMap;Zr=new WeakMap;Rl=new WeakMap;Qn=new WeakMap;fh(pn,4,"index",vh,Ko,Tl);fh(pn,4,"group",gh,Ko,Rl);U0(pn,Ko);var mh=class extends _r{constructor(e,t,n){super(e,t),this.sortable=n}get index(){return this.sortable.index}},Ll=class extends Yo{constructor(e,t,n){super(e,t),this.sortable=n}},o1=Object.defineProperty,i1=Object.defineProperties,a1=Object.getOwnPropertyDescriptors,su=Object.getOwnPropertySymbols,l1=Object.prototype.hasOwnProperty,c1=Object.prototype.propertyIsEnumerable,ou=(e,t,n)=>t in e?o1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hi=(e,t)=>{for(var n in t||(t={}))l1.call(t,n)&&ou(e,n,t[n]);if(su)for(var n of su(t))c1.call(t,n)&&ou(e,n,t[n]);return e},u1=(e,t)=>i1(e,a1(t));function yh(e){const{accept:t,collisionDetector:n,collisionPriority:r,id:s,data:o,element:i,handle:a,index:l,group:u,disabled:d,feedback:f,modifiers:p,sensors:v,target:g,type:m}=e,w=hi(hi({},hh),e.transition),S=Ml(y=>new Ko(u1(hi({},e),{transition:w,register:!1,handle:hn(a),element:hn(i),target:hn(g),feedback:f}),y)),k=Ol(S,d1);return be(s,()=>S.id=s),xr(()=>{Re(()=>{S.group=u,S.index=l})},[S,u,l]),be(m,()=>S.type=m),be(t,()=>S.accept=t,void 0,Yt),be(o,()=>o&&(S.data=o)),be(l,()=>{var y;(y=S.manager)!=null&&y.dragOperation.status.idle&&(w!=null&&w.idle)&&S.refreshShape()},p0),nr(a,y=>S.handle=y),nr(i,y=>S.element=y),nr(g,y=>S.target=y),be(d,()=>S.disabled=d===!0),be(v,()=>S.sensors=v),be(n,()=>S.collisionDetector=n),be(r,()=>S.collisionPriority=r),be(f,()=>S.feedback=f??"default"),be(w,()=>S.transition=w,void 0,Yt),be(p,()=>S.modifiers=p,void 0,Yt),be(e.alignment,()=>S.alignment=e.alignment),{sortable:k,get isDragging(){return k.isDragging},get isDropping(){return k.isDropping},get isDragSource(){return k.isDragSource},get isDropTarget(){return k.isDropTarget},handleRef:h.useCallback(y=>{S.handle=y??void 0},[S]),ref:h.useCallback(y=>{var b,j;!y&&((b=S.element)!=null&&b.isConnected)&&!((j=S.manager)!=null&&j.dragOperation.status.idle)||(S.element=y??void 0)},[S]),sourceRef:h.useCallback(y=>{var b,j;!y&&((b=S.source)!=null&&b.isConnected)&&!((j=S.manager)!=null&&j.dragOperation.status.idle)||(S.source=y??void 0)},[S]),targetRef:h.useCallback(y=>{var b,j;!y&&((b=S.target)!=null&&b.isConnected)&&!((j=S.manager)!=null&&j.dragOperation.status.idle)||(S.target=y??void 0)},[S])}}function d1(e,t,n){return!!(e==="isDragSource"&&!n&&t)}function bh(e,t,n){var r=this,s=h.useRef(null),o=h.useRef(0),i=h.useRef(null),a=h.useRef([]),l=h.useRef(),u=h.useRef(),d=h.useRef(e),f=h.useRef(!0);h.useEffect(function(){d.current=e},[e]);var p=!t&&t!==0&&typeof window<"u";if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;var v=!!(n=n||{}).leading,g=!("trailing"in n)||!!n.trailing,m="maxWait"in n,w=m?Math.max(+n.maxWait||0,t):null;h.useEffect(function(){return f.current=!0,function(){f.current=!1}},[]);var S=h.useMemo(function(){var k=function(_){var I=a.current,x=l.current;return a.current=l.current=null,o.current=_,u.current=d.current.apply(x,I)},y=function(_,I){p&&cancelAnimationFrame(i.current),i.current=p?requestAnimationFrame(_):setTimeout(_,I)},b=function(_){if(!f.current)return!1;var I=_-s.current;return!s.current||I>=t||I<0||m&&_-o.current>=w},j=function(_){return i.current=null,g&&a.current?k(_):(a.current=l.current=null,u.current)},C=function _(){var I=Date.now();if(b(I))return j(I);if(f.current){var x=t-(I-s.current),M=m?Math.min(x,w-(I-o.current)):x;y(_,M)}},A=function(){var _=Date.now(),I=b(_);if(a.current=[].slice.call(arguments),l.current=r,s.current=_,I){if(!i.current&&f.current)return o.current=s.current,y(C,t),v?k(s.current):u.current;if(m)return y(C,t),k(s.current)}return i.current||y(C,t),u.current};return A.cancel=function(){i.current&&(p?cancelAnimationFrame(i.current):clearTimeout(i.current)),o.current=0,a.current=s.current=l.current=i.current=null},A.isPending=function(){return!!i.current},A.flush=function(){return i.current?j(Date.now()):u.current},A},[v,m,t,w,g,p]);return S}function f1(e,t){return e===t}function iu(e){return typeof e=="function"?function(){return e}:e}function Ek(e,t,n){var r,s,o=n&&n.equalityFn||f1,i=(r=h.useState(iu(e)),s=r[1],[r[0],h.useCallback(function(f){return s(iu(f))},[])]),a=i[0],l=i[1],u=bh(h.useCallback(function(f){return l(f)},[l]),t,n),d=h.useRef(e);return o(d.current,e)||(u(e),d.current=e),[a,u]}function Vn(e,t,n){let r=n.initialDeps??[],s,o=!0;function i(){var a,l,u;let d;n.key&&((a=n.debug)!=null&&a.call(n))&&(d=Date.now());const f=e();if(!(f.length!==r.length||f.some((g,m)=>r[m]!==g)))return s;r=f;let v;if(n.key&&((l=n.debug)!=null&&l.call(n))&&(v=Date.now()),s=t(...f),n.key&&((u=n.debug)!=null&&u.call(n))){const g=Math.round((Date.now()-d)*100)/100,m=Math.round((Date.now()-v)*100)/100,w=m/16,S=(k,y)=>{for(k=String(k);k.length<y;)k=" "+k;return k};console.info(`%c⏱ ${S(m,5)} /${S(g,5)} ms`,`
153
+ font-size: .6rem;
154
+ font-weight: bold;
155
+ color: hsl(${Math.max(0,Math.min(120-120*w,120))}deg 100% 31%);`,n==null?void 0:n.key)}return n!=null&&n.onChange&&!(o&&n.skipInitialOnChange)&&n.onChange(s),o=!1,s}return i.updateDeps=a=>{r=a},i}function au(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const p1=(e,t)=>Math.abs(e-t)<1.01,_h=(e,t,n)=>{let r;return function(...s){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,s),n)}},lu=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},h1=e=>e,xh=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let s=t;s<=n;s++)r.push(s);return r},wh=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const s=i=>{const{width:a,height:l}=i;t({width:Math.round(a),height:Math.round(l)})};if(s(lu(n)),!r.ResizeObserver)return()=>{};const o=new r.ResizeObserver(i=>{const a=()=>{const l=i[0];if(l!=null&&l.borderBoxSize){const u=l.borderBoxSize[0];if(u){s({width:u.inlineSize,height:u.blockSize});return}}s(lu(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return o.observe(n,{box:"border-box"}),()=>{o.unobserve(n)}},vs={passive:!0},g1=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=()=>{t({width:n.innerWidth,height:n.innerHeight})};return r(),n.addEventListener("resize",r,vs),()=>{n.removeEventListener("resize",r)}},Oo=typeof window>"u"?!0:"onscrollend"in window,Sh=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let s=0;const o=e.options.useScrollendEvent&&Oo?()=>{}:_h(r,()=>{t(s,!1)},e.options.isScrollingResetDelay),i=d=>()=>{const{horizontal:f,isRtl:p}=e.options;s=f?n.scrollLeft*(p&&-1||1):n.scrollTop,o(),t(s,d)},a=i(!0),l=i(!1);n.addEventListener("scroll",a,vs);const u=e.options.useScrollendEvent&&Oo;return u&&n.addEventListener("scrollend",l,vs),()=>{n.removeEventListener("scroll",a),u&&n.removeEventListener("scrollend",l)}},v1=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let s=0;const o=e.options.useScrollendEvent&&Oo?()=>{}:_h(r,()=>{t(s,!1)},e.options.isScrollingResetDelay),i=d=>()=>{s=n[e.options.horizontal?"scrollX":"scrollY"],o(),t(s,d)},a=i(!0),l=i(!1);n.addEventListener("scroll",a,vs);const u=e.options.useScrollendEvent&&Oo;return u&&n.addEventListener("scrollend",l,vs),()=>{n.removeEventListener("scroll",a),u&&n.removeEventListener("scrollend",l)}},m1=(e,t,n)=>{if(t!=null&&t.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},y1=(e,{adjustments:t=0,behavior:n},r)=>{var s,o;const i=e+t;(o=(s=r.scrollElement)==null?void 0:s.scrollTo)==null||o.call(s,{[r.options.horizontal?"left":"top"]:i,behavior:n})},kh=(e,{adjustments:t=0,behavior:n},r)=>{var s,o;const i=e+t;(o=(s=r.scrollElement)==null?void 0:s.scrollTo)==null||o.call(s,{[r.options.horizontal?"left":"top"]:i,behavior:n})};class b1{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var n,r,s;return((s=(r=(n=this.targetWindow)==null?void 0:n.performance)==null?void 0:r.now)==null?void 0:s.call(r))??Date.now()},this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(s=>{s.forEach(o=>{const i=()=>{const a=o.target,l=this.indexFromElement(a);if(!a.isConnected){this.observer.unobserve(a);return}this.shouldMeasureDuringScroll(l)&&this.resizeItem(l,this.options.measureElement(a,o,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(i):i()})}));return{disconnect:()=>{var s;(s=r())==null||s.disconnect(),n=null},observe:s=>{var o;return(o=r())==null?void 0:o.observe(s,{box:"border-box"})},unobserve:s=>{var o;return(o=r())==null?void 0:o.unobserve(s)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,s])=>{typeof s>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:h1,rangeExtractor:xh,onChange:()=>{},measureElement:m1,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var r,s;(s=(r=this.options).onChange)==null||s.call(r,this,n)},this.maybeNotify=Vn(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(s=>{this.observer.observe(s)}),this.unsubs.push(this.options.observeElementRect(this,s=>{this.scrollRect=s,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(s,o)=>{this.scrollAdjustments=0,this.scrollDirection=o?this.getScrollOffset()<s?"forward":"backward":null,this.scrollOffset=s,this.isScrolling=o,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,r)=>{const s=new Map,o=new Map;for(let i=r-1;i>=0;i--){const a=n[i];if(s.has(a.lane))continue;const l=o.get(a.lane);if(l==null||a.end>l.end?o.set(a.lane,a):a.end<l.end&&s.set(a.lane,!0),s.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((i,a)=>i.end===a.end?i.index-a.index:i.end-a.end)[0]:void 0},this.getMeasurementOptions=Vn(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(n,r,s,o,i,a)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:s,getItemKey:o,enabled:i,lanes:a}),{key:!1}),this.getMeasurements=Vn(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:s,getItemKey:o,enabled:i,lanes:a},l)=>{if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const p of this.laneAssignments.keys())p>=n&&this.laneAssignments.delete(p);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(p=>{this.itemSizeCache.set(p.key,p.size)}));const u=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1);const d=this.measurementsCache.slice(0,u),f=new Array(a).fill(void 0);for(let p=0;p<u;p++){const v=d[p];v&&(f[v.lane]=p)}for(let p=u;p<n;p++){const v=o(p),g=this.laneAssignments.get(p);let m,w;if(g!==void 0&&this.options.lanes>1){m=g;const b=f[m],j=b!==void 0?d[b]:void 0;w=j?j.end+this.options.gap:r+s}else{const b=this.options.lanes===1?d[p-1]:this.getFurthestMeasurement(d,p);w=b?b.end+this.options.gap:r+s,m=b?b.lane:p%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(p,m)}const S=l.get(v),k=typeof S=="number"?S:this.options.estimateSize(p),y=w+k;d[p]={index:p,start:w,size:k,end:y,key:v,lane:m},f[m]=p}return this.measurementsCache=d,d},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Vn(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,s,o)=>this.range=n.length>0&&r>0?_1({measurements:n,outerSize:r,scrollOffset:s,lanes:o}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Vn(()=>{let n=null,r=null;const s=this.calculateRange();return s&&(n=s.startIndex,r=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,s,o,i)=>o===null||i===null?[]:n({startIndex:o,endIndex:i,overscan:r,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,s=n.getAttribute(r);return s?parseInt(s,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=n=>{var r;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const s=this.scrollState.index??((r=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:r.index);if(s!==void 0&&this.range){const o=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),i=Math.max(0,s-o),a=Math.min(this.options.count-1,s+o);return n>=i&&n<=a}return!0},this.measureElement=n=>{if(!n){this.elementsCache.forEach((i,a)=>{i.isConnected||(this.observer.unobserve(i),this.elementsCache.delete(a))});return}const r=this.indexFromElement(n),s=this.options.getItemKey(r),o=this.elementsCache.get(s);o!==n&&(o&&this.observer.unobserve(o),this.observer.observe(n),this.elementsCache.set(s,n)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(r)&&this.resizeItem(r,this.options.measureElement(n,void 0,this))},this.resizeItem=(n,r)=>{var s;const o=this.measurementsCache[n];if(!o)return;const i=this.itemSizeCache.get(o.key)??o.size,a=r-i;a!==0&&(((s=this.scrollState)==null?void 0:s.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(o,a,this):o.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(o.index),this.itemSizeCache=new Map(this.itemSizeCache.set(o.key,r)),this.notify(!1))},this.getVirtualItems=Vn(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const s=[];for(let o=0,i=n.length;o<i;o++){const a=n[o],l=r[a];s.push(l)}return s},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return au(r[Ih(0,r.length-1,s=>au(r[s]).start,n)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(n,r,s=0)=>{if(!this.scrollElement)return 0;const o=this.getSize(),i=this.getScrollOffset();r==="auto"&&(r=n>=i+o?"end":"start"),r==="center"?n+=(s-o)/2:r==="end"&&(n-=o);const a=this.getMaxScrollOffset();return Math.max(Math.min(a,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const s=this.getSize(),o=this.getScrollOffset(),i=this.measurementsCache[n];if(!i)return;if(r==="auto")if(i.end>=o+s-this.options.scrollPaddingEnd)r="end";else if(i.start<=o+this.options.scrollPaddingStart)r="start";else return[o,r];if(r==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),r];const a=r==="end"?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,r,i.size),r]},this.scrollToOffset=(n,{align:r="start",behavior:s="auto"}={})=>{const o=this.getOffsetForAlignment(n,r),i=this.now();this.scrollState={index:null,align:r,behavior:s,startedAt:i,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollToIndex=(n,{align:r="auto",behavior:s="auto"}={})=>{n=Math.max(0,Math.min(n,this.options.count-1));const o=this.getOffsetForIndex(n,r);if(!o)return;const[i,a]=o,l=this.now();this.scrollState={index:n,align:a,behavior:s,startedAt:l,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollBy=(n,{behavior:r="auto"}={})=>{const s=this.getScrollOffset()+n,o=this.now();this.scrollState={index:null,align:"start",behavior:r,startedAt:o,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:r}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let s;if(r.length===0)s=this.options.paddingStart;else if(this.options.lanes===1)s=((n=r[r.length-1])==null?void 0:n.end)??0;else{const o=Array(this.options.lanes).fill(null);let i=r.length-1;for(;i>=0&&o.some(a=>a===null);){const a=r[i];o[a.lane]===null&&(o[a.lane]=a.end),i--}s=Math.max(...o.filter(a=>a!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:s})=>{this.options.scrollToFn(n,{behavior:s,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(t)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const r=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,s=r?r[0]:this.scrollState.lastTargetOffset,o=1,i=s!==this.scrollState.lastTargetOffset;if(!i&&p1(s,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=o){this.scrollState=null;return}}else this.scrollState.stableFrames=0,i&&(this.scrollState.lastTargetOffset=s,this.scrollState.behavior="auto",this._scrollToOffset(s,{adjustments:void 0,behavior:"auto"}));this.scheduleScrollReconcile()}}const Ih=(e,t,n,r)=>{for(;e<=t;){const s=(e+t)/2|0,o=n(s);if(o<r)e=s+1;else if(o>r)t=s-1;else return s}return e>0?e-1:0};function _1({measurements:e,outerSize:t,scrollOffset:n,lanes:r}){const s=e.length-1,o=l=>e[l].start;if(e.length<=r)return{startIndex:0,endIndex:s};let i=Ih(0,s,o,n),a=i;if(r===1)for(;a<s&&e[a].end<n+t;)a++;else if(r>1){const l=Array(r).fill(0);for(;a<s&&l.some(d=>d<n+t);){const d=e[a];l[d.lane]=d.end,a++}const u=Array(r).fill(n+t);for(;i>=0&&u.some(d=>d>=n);){const d=e[i];u[d.lane]=d.start,i--}i=Math.max(0,i-i%r),a=Math.min(s,a+(r-1-a%r))}return{startIndex:i,endIndex:a}}const cu=typeof document<"u"?h.useLayoutEffect:h.useEffect;function x1({useFlushSync:e=!0,...t}){const n=h.useReducer(()=>({}),{})[1],r={...t,onChange:(o,i)=>{var a;e&&i?ys.flushSync(n):n(),(a=t.onChange)==null||a.call(t,o,i)}},[s]=h.useState(()=>new b1(r));return s.setOptions(r),cu(()=>s._didMount(),[]),cu(()=>s._willUpdate()),s}function Eh(e){return x1({observeElementRect:wh,observeElementOffset:Sh,scrollToFn:kh,...e})}function Ws(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var gi={exports:{}},uu;function w1(){return uu||(uu=1,(function(e,t){(function(n){e.exports=n()})(function(){return(function n(r,s,o){function i(u,d){if(!s[u]){if(!r[u]){var f=typeof Ws=="function"&&Ws;if(!d&&f)return f(u,!0);if(a)return a(u,!0);throw new Error("Cannot find module '"+u+"'")}d=s[u]={exports:{}},r[u][0].call(d.exports,function(p){var v=r[u][1][p];return i(v||p)},d,d.exports,n,r,s,o)}return s[u].exports}for(var a=typeof Ws=="function"&&Ws,l=0;l<o.length;l++)i(o[l]);return i})({1:[function(n,r,s){(function(o,i,a,l,u,d,f,p,v){var g=n("crypto");function m(C,A){A=k(C,A);var _;return(_=A.algorithm!=="passthrough"?g.createHash(A.algorithm):new j).write===void 0&&(_.write=_.update,_.end=_.update),b(A,_).dispatch(C),_.update||_.end(""),_.digest?_.digest(A.encoding==="buffer"?void 0:A.encoding):(C=_.read(),A.encoding!=="buffer"?C.toString(A.encoding):C)}(s=r.exports=m).sha1=function(C){return m(C)},s.keys=function(C){return m(C,{excludeValues:!0,algorithm:"sha1",encoding:"hex"})},s.MD5=function(C){return m(C,{algorithm:"md5",encoding:"hex"})},s.keysMD5=function(C){return m(C,{algorithm:"md5",encoding:"hex",excludeValues:!0})};var w=g.getHashes?g.getHashes().slice():["sha1","md5"],S=(w.push("passthrough"),["buffer","hex","binary","base64"]);function k(C,A){var _={};if(_.algorithm=(A=A||{}).algorithm||"sha1",_.encoding=A.encoding||"hex",_.excludeValues=!!A.excludeValues,_.algorithm=_.algorithm.toLowerCase(),_.encoding=_.encoding.toLowerCase(),_.ignoreUnknown=A.ignoreUnknown===!0,_.respectType=A.respectType!==!1,_.respectFunctionNames=A.respectFunctionNames!==!1,_.respectFunctionProperties=A.respectFunctionProperties!==!1,_.unorderedArrays=A.unorderedArrays===!0,_.unorderedSets=A.unorderedSets!==!1,_.unorderedObjects=A.unorderedObjects!==!1,_.replacer=A.replacer||void 0,_.excludeKeys=A.excludeKeys||void 0,C===void 0)throw new Error("Object argument required.");for(var I=0;I<w.length;++I)w[I].toLowerCase()===_.algorithm.toLowerCase()&&(_.algorithm=w[I]);if(w.indexOf(_.algorithm)===-1)throw new Error('Algorithm "'+_.algorithm+'" not supported. supported values: '+w.join(", "));if(S.indexOf(_.encoding)===-1&&_.algorithm!=="passthrough")throw new Error('Encoding "'+_.encoding+'" not supported. supported values: '+S.join(", "));return _}function y(C){if(typeof C=="function")return/^function\s+\w*\s*\(\s*\)\s*{\s+\[native code\]\s+}$/i.exec(Function.prototype.toString.call(C))!=null}function b(C,A,_){_=_||[];function I(x){return A.update?A.update(x,"utf8"):A.write(x,"utf8")}return{dispatch:function(x){return this["_"+((x=C.replacer?C.replacer(x):x)===null?"null":typeof x)](x)},_object:function(x){var M,D=Object.prototype.toString.call(x),L=/\[object (.*)\]/i.exec(D);if(L=(L=L?L[1]:"unknown:["+D+"]").toLowerCase(),0<=(D=_.indexOf(x)))return this.dispatch("[CIRCULAR:"+D+"]");if(_.push(x),a!==void 0&&a.isBuffer&&a.isBuffer(x))return I("buffer:"),I(x);if(L==="object"||L==="function"||L==="asyncfunction")return D=Object.keys(x),C.unorderedObjects&&(D=D.sort()),C.respectType===!1||y(x)||D.splice(0,0,"prototype","__proto__","constructor"),C.excludeKeys&&(D=D.filter(function(N){return!C.excludeKeys(N)})),I("object:"+D.length+":"),M=this,D.forEach(function(N){M.dispatch(N),I(":"),C.excludeValues||M.dispatch(x[N]),I(",")});if(!this["_"+L]){if(C.ignoreUnknown)return I("["+L+"]");throw new Error('Unknown object type "'+L+'"')}this["_"+L](x)},_array:function(x,N){N=N!==void 0?N:C.unorderedArrays!==!1;var D=this;if(I("array:"+x.length+":"),!N||x.length<=1)return x.forEach(function(F){return D.dispatch(F)});var L=[],N=x.map(function(F){var B=new j,K=_.slice();return b(C,B,K).dispatch(F),L=L.concat(K.slice(_.length)),B.read().toString()});return _=_.concat(L),N.sort(),this._array(N,!1)},_date:function(x){return I("date:"+x.toJSON())},_symbol:function(x){return I("symbol:"+x.toString())},_error:function(x){return I("error:"+x.toString())},_boolean:function(x){return I("bool:"+x.toString())},_string:function(x){I("string:"+x.length+":"),I(x.toString())},_function:function(x){I("fn:"),y(x)?this.dispatch("[native]"):this.dispatch(x.toString()),C.respectFunctionNames!==!1&&this.dispatch("function-name:"+String(x.name)),C.respectFunctionProperties&&this._object(x)},_number:function(x){return I("number:"+x.toString())},_xml:function(x){return I("xml:"+x.toString())},_null:function(){return I("Null")},_undefined:function(){return I("Undefined")},_regexp:function(x){return I("regex:"+x.toString())},_uint8array:function(x){return I("uint8array:"),this.dispatch(Array.prototype.slice.call(x))},_uint8clampedarray:function(x){return I("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(x))},_int8array:function(x){return I("int8array:"),this.dispatch(Array.prototype.slice.call(x))},_uint16array:function(x){return I("uint16array:"),this.dispatch(Array.prototype.slice.call(x))},_int16array:function(x){return I("int16array:"),this.dispatch(Array.prototype.slice.call(x))},_uint32array:function(x){return I("uint32array:"),this.dispatch(Array.prototype.slice.call(x))},_int32array:function(x){return I("int32array:"),this.dispatch(Array.prototype.slice.call(x))},_float32array:function(x){return I("float32array:"),this.dispatch(Array.prototype.slice.call(x))},_float64array:function(x){return I("float64array:"),this.dispatch(Array.prototype.slice.call(x))},_arraybuffer:function(x){return I("arraybuffer:"),this.dispatch(new Uint8Array(x))},_url:function(x){return I("url:"+x.toString())},_map:function(x){return I("map:"),x=Array.from(x),this._array(x,C.unorderedSets!==!1)},_set:function(x){return I("set:"),x=Array.from(x),this._array(x,C.unorderedSets!==!1)},_file:function(x){return I("file:"),this.dispatch([x.name,x.size,x.type,x.lastModfied])},_blob:function(){if(C.ignoreUnknown)return I("[blob]");throw Error(`Hashing Blob objects is currently not supported
156
+ (see https://github.com/puleos/object-hash/issues/26)
157
+ Use "options.replacer" or "options.ignoreUnknown"
158
+ `)},_domwindow:function(){return I("domwindow")},_bigint:function(x){return I("bigint:"+x.toString())},_process:function(){return I("process")},_timer:function(){return I("timer")},_pipe:function(){return I("pipe")},_tcp:function(){return I("tcp")},_udp:function(){return I("udp")},_tty:function(){return I("tty")},_statwatcher:function(){return I("statwatcher")},_securecontext:function(){return I("securecontext")},_connection:function(){return I("connection")},_zlib:function(){return I("zlib")},_context:function(){return I("context")},_nodescript:function(){return I("nodescript")},_httpparser:function(){return I("httpparser")},_dataview:function(){return I("dataview")},_signal:function(){return I("signal")},_fsevent:function(){return I("fsevent")},_tlswrap:function(){return I("tlswrap")}}}function j(){return{buf:"",write:function(C){this.buf+=C},end:function(C){this.buf+=C},read:function(){return this.buf}}}s.writeToStream=function(C,A,_){return _===void 0&&(_=A,A={}),b(A=k(C,A),_).dispatch(C)}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/fake_9a5aa49d.js","/")},{buffer:3,crypto:5,lYpoI2:11}],2:[function(n,r,s){(function(o,i,a,l,u,d,f,p,v){(function(g){var m=typeof Uint8Array<"u"?Uint8Array:Array,w=43,S=47,k=48,y=97,b=65,j=45,C=95;function A(_){return _=_.charCodeAt(0),_===w||_===j?62:_===S||_===C?63:_<k?-1:_<k+10?_-k+26+26:_<b+26?_-b:_<y+26?_-y+26:void 0}g.toByteArray=function(_){var I,x;if(0<_.length%4)throw new Error("Invalid string. Length must be a multiple of 4");var M=_.length,M=_.charAt(M-2)==="="?2:_.charAt(M-1)==="="?1:0,D=new m(3*_.length/4-M),L=0<M?_.length-4:_.length,N=0;function F(B){D[N++]=B}for(I=0;I<L;I+=4,0)F((16711680&(x=A(_.charAt(I))<<18|A(_.charAt(I+1))<<12|A(_.charAt(I+2))<<6|A(_.charAt(I+3))))>>16),F((65280&x)>>8),F(255&x);return M==2?F(255&(x=A(_.charAt(I))<<2|A(_.charAt(I+1))>>4)):M==1&&(F((x=A(_.charAt(I))<<10|A(_.charAt(I+1))<<4|A(_.charAt(I+2))>>2)>>8&255),F(255&x)),D},g.fromByteArray=function(_){var I,x,M,D,L=_.length%3,N="";function F(B){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(B)}for(I=0,M=_.length-L;I<M;I+=3)x=(_[I]<<16)+(_[I+1]<<8)+_[I+2],N+=F((D=x)>>18&63)+F(D>>12&63)+F(D>>6&63)+F(63&D);switch(L){case 1:N=(N+=F((x=_[_.length-1])>>2))+F(x<<4&63)+"==";break;case 2:N=(N=(N+=F((x=(_[_.length-2]<<8)+_[_.length-1])>>10))+F(x>>4&63))+F(x<<2&63)+"="}return N}})(s===void 0?this.base64js={}:s)}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/base64-js/lib/b64.js","/node_modules/gulp-browserify/node_modules/base64-js/lib")},{buffer:3,lYpoI2:11}],3:[function(n,r,s){(function(o,i,w,l,u,d,f,p,v){var g=n("base64-js"),m=n("ieee754");function w(E,T,R){if(!(this instanceof w))return new w(E,T,R);var W,q,X,oe,me=typeof E;if(T==="base64"&&me=="string")for(E=(oe=E).trim?oe.trim():oe.replace(/^\s+|\s+$/g,"");E.length%4!=0;)E+="=";if(me=="number")W=$(E);else if(me=="string")W=w.byteLength(E,T);else{if(me!="object")throw new Error("First argument needs to be a number, array or string.");W=$(E.length)}if(w._useTypedArrays?q=w._augment(new Uint8Array(W)):((q=this).length=W,q._isBuffer=!0),w._useTypedArrays&&typeof E.byteLength=="number")q._set(E);else if(U(oe=E)||w.isBuffer(oe)||oe&&typeof oe=="object"&&typeof oe.length=="number")for(X=0;X<W;X++)w.isBuffer(E)?q[X]=E.readUInt8(X):q[X]=E[X];else if(me=="string")q.write(E,0,T);else if(me=="number"&&!w._useTypedArrays&&!R)for(X=0;X<W;X++)q[X]=0;return q}function S(E,T,R,W){return w._charsWritten=se((function(q){for(var X=[],oe=0;oe<q.length;oe++)X.push(255&q.charCodeAt(oe));return X})(T),E,R,W)}function k(E,T,R,W){return w._charsWritten=se((function(q){for(var X,oe,me=[],ke=0;ke<q.length;ke++)oe=q.charCodeAt(ke),X=oe>>8,oe=oe%256,me.push(oe),me.push(X);return me})(T),E,R,W)}function y(E,T,R){var W="";R=Math.min(E.length,R);for(var q=T;q<R;q++)W+=String.fromCharCode(E[q]);return W}function b(E,T,R,X){X||(V(typeof R=="boolean","missing or invalid endian"),V(T!=null,"missing offset"),V(T+1<E.length,"Trying to read beyond buffer length"));var q,X=E.length;if(!(X<=T))return R?(q=E[T],T+1<X&&(q|=E[T+1]<<8)):(q=E[T]<<8,T+1<X&&(q|=E[T+1])),q}function j(E,T,R,X){X||(V(typeof R=="boolean","missing or invalid endian"),V(T!=null,"missing offset"),V(T+3<E.length,"Trying to read beyond buffer length"));var q,X=E.length;if(!(X<=T))return R?(T+2<X&&(q=E[T+2]<<16),T+1<X&&(q|=E[T+1]<<8),q|=E[T],T+3<X&&(q+=E[T+3]<<24>>>0)):(T+1<X&&(q=E[T+1]<<16),T+2<X&&(q|=E[T+2]<<8),T+3<X&&(q|=E[T+3]),q+=E[T]<<24>>>0),q}function C(E,T,R,W){if(W||(V(typeof R=="boolean","missing or invalid endian"),V(T!=null,"missing offset"),V(T+1<E.length,"Trying to read beyond buffer length")),!(E.length<=T))return W=b(E,T,R,!0),32768&W?-1*(65535-W+1):W}function A(E,T,R,W){if(W||(V(typeof R=="boolean","missing or invalid endian"),V(T!=null,"missing offset"),V(T+3<E.length,"Trying to read beyond buffer length")),!(E.length<=T))return W=j(E,T,R,!0),2147483648&W?-1*(4294967295-W+1):W}function _(E,T,R,W){return W||(V(typeof R=="boolean","missing or invalid endian"),V(T+3<E.length,"Trying to read beyond buffer length")),m.read(E,T,R,23,4)}function I(E,T,R,W){return W||(V(typeof R=="boolean","missing or invalid endian"),V(T+7<E.length,"Trying to read beyond buffer length")),m.read(E,T,R,52,8)}function x(E,T,R,W,q){if(q||(V(T!=null,"missing value"),V(typeof W=="boolean","missing or invalid endian"),V(R!=null,"missing offset"),V(R+1<E.length,"trying to write beyond buffer length"),ie(T,65535)),q=E.length,!(q<=R))for(var X=0,oe=Math.min(q-R,2);X<oe;X++)E[R+X]=(T&255<<8*(W?X:1-X))>>>8*(W?X:1-X)}function M(E,T,R,W,q){if(q||(V(T!=null,"missing value"),V(typeof W=="boolean","missing or invalid endian"),V(R!=null,"missing offset"),V(R+3<E.length,"trying to write beyond buffer length"),ie(T,4294967295)),q=E.length,!(q<=R))for(var X=0,oe=Math.min(q-R,4);X<oe;X++)E[R+X]=T>>>8*(W?X:3-X)&255}function D(E,T,R,W,q){q||(V(T!=null,"missing value"),V(typeof W=="boolean","missing or invalid endian"),V(R!=null,"missing offset"),V(R+1<E.length,"Trying to write beyond buffer length"),Oe(T,32767,-32768)),E.length<=R||x(E,0<=T?T:65535+T+1,R,W,q)}function L(E,T,R,W,q){q||(V(T!=null,"missing value"),V(typeof W=="boolean","missing or invalid endian"),V(R!=null,"missing offset"),V(R+3<E.length,"Trying to write beyond buffer length"),Oe(T,2147483647,-2147483648)),E.length<=R||M(E,0<=T?T:4294967295+T+1,R,W,q)}function N(E,T,R,W,q){q||(V(T!=null,"missing value"),V(typeof W=="boolean","missing or invalid endian"),V(R!=null,"missing offset"),V(R+3<E.length,"Trying to write beyond buffer length"),Q(T,34028234663852886e22,-34028234663852886e22)),E.length<=R||m.write(E,T,R,W,23,4)}function F(E,T,R,W,q){q||(V(T!=null,"missing value"),V(typeof W=="boolean","missing or invalid endian"),V(R!=null,"missing offset"),V(R+7<E.length,"Trying to write beyond buffer length"),Q(T,17976931348623157e292,-17976931348623157e292)),E.length<=R||m.write(E,T,R,W,52,8)}s.Buffer=w,s.SlowBuffer=w,s.INSPECT_MAX_BYTES=50,w.poolSize=8192,w._useTypedArrays=(function(){try{var E=new ArrayBuffer(0),T=new Uint8Array(E);return T.foo=function(){return 42},T.foo()===42&&typeof T.subarray=="function"}catch{return!1}})(),w.isEncoding=function(E){switch(String(E).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},w.isBuffer=function(E){return!(E==null||!E._isBuffer)},w.byteLength=function(E,T){var R;switch(E+="",T||"utf8"){case"hex":R=E.length/2;break;case"utf8":case"utf-8":R=ne(E).length;break;case"ascii":case"binary":case"raw":R=E.length;break;case"base64":R=Y(E).length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":R=2*E.length;break;default:throw new Error("Unknown encoding")}return R},w.concat=function(E,T){if(V(U(E),`Usage: Buffer.concat(list, [totalLength])
159
+ list should be an Array.`),E.length===0)return new w(0);if(E.length===1)return E[0];if(typeof T!="number")for(q=T=0;q<E.length;q++)T+=E[q].length;for(var R=new w(T),W=0,q=0;q<E.length;q++){var X=E[q];X.copy(R,W),W+=X.length}return R},w.prototype.write=function(E,T,R,W){isFinite(T)?isFinite(R)||(W=R,R=void 0):(ke=W,W=T,T=R,R=ke),T=Number(T)||0;var q,X,oe,me,ke=this.length-T;switch((!R||ke<(R=Number(R)))&&(R=ke),W=String(W||"utf8").toLowerCase()){case"hex":q=(function(we,Me,De,Ie){De=Number(De)||0;var ye=we.length-De;(!Ie||ye<(Ie=Number(Ie)))&&(Ie=ye),V((ye=Me.length)%2==0,"Invalid hex string"),ye/2<Ie&&(Ie=ye/2);for(var Fe=0;Fe<Ie;Fe++){var gt=parseInt(Me.substr(2*Fe,2),16);V(!isNaN(gt),"Invalid hex string"),we[De+Fe]=gt}return w._charsWritten=2*Fe,Fe})(this,E,T,R);break;case"utf8":case"utf-8":X=this,oe=T,me=R,q=w._charsWritten=se(ne(E),X,oe,me);break;case"ascii":case"binary":q=S(this,E,T,R);break;case"base64":X=this,oe=T,me=R,q=w._charsWritten=se(Y(E),X,oe,me);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":q=k(this,E,T,R);break;default:throw new Error("Unknown encoding")}return q},w.prototype.toString=function(E,T,R){var W,q,X,oe,me=this;if(E=String(E||"utf8").toLowerCase(),T=Number(T)||0,(R=R!==void 0?Number(R):me.length)===T)return"";switch(E){case"hex":W=(function(ke,we,Me){var De=ke.length;(!we||we<0)&&(we=0),(!Me||Me<0||De<Me)&&(Me=De);for(var Ie="",ye=we;ye<Me;ye++)Ie+=Z(ke[ye]);return Ie})(me,T,R);break;case"utf8":case"utf-8":W=(function(ke,we,Me){var De="",Ie="";Me=Math.min(ke.length,Me);for(var ye=we;ye<Me;ye++)ke[ye]<=127?(De+=ve(Ie)+String.fromCharCode(ke[ye]),Ie=""):Ie+="%"+ke[ye].toString(16);return De+ve(Ie)})(me,T,R);break;case"ascii":case"binary":W=y(me,T,R);break;case"base64":q=me,oe=R,W=(X=T)===0&&oe===q.length?g.fromByteArray(q):g.fromByteArray(q.slice(X,oe));break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":W=(function(ke,we,Me){for(var De=ke.slice(we,Me),Ie="",ye=0;ye<De.length;ye+=2)Ie+=String.fromCharCode(De[ye]+256*De[ye+1]);return Ie})(me,T,R);break;default:throw new Error("Unknown encoding")}return W},w.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},w.prototype.copy=function(E,T,R,W){if(T=T||0,(W=W||W===0?W:this.length)!==(R=R||0)&&E.length!==0&&this.length!==0){V(R<=W,"sourceEnd < sourceStart"),V(0<=T&&T<E.length,"targetStart out of bounds"),V(0<=R&&R<this.length,"sourceStart out of bounds"),V(0<=W&&W<=this.length,"sourceEnd out of bounds"),W>this.length&&(W=this.length);var q=(W=E.length-T<W-R?E.length-T+R:W)-R;if(q<100||!w._useTypedArrays)for(var X=0;X<q;X++)E[X+T]=this[X+R];else E._set(this.subarray(R,R+q),T)}},w.prototype.slice=function(E,T){var R=this.length;if(E=K(E,R,0),T=K(T,R,R),w._useTypedArrays)return w._augment(this.subarray(E,T));for(var W=T-E,q=new w(W,void 0,!0),X=0;X<W;X++)q[X]=this[X+E];return q},w.prototype.get=function(E){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(E)},w.prototype.set=function(E,T){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(E,T)},w.prototype.readUInt8=function(E,T){if(T||(V(E!=null,"missing offset"),V(E<this.length,"Trying to read beyond buffer length")),!(E>=this.length))return this[E]},w.prototype.readUInt16LE=function(E,T){return b(this,E,!0,T)},w.prototype.readUInt16BE=function(E,T){return b(this,E,!1,T)},w.prototype.readUInt32LE=function(E,T){return j(this,E,!0,T)},w.prototype.readUInt32BE=function(E,T){return j(this,E,!1,T)},w.prototype.readInt8=function(E,T){if(T||(V(E!=null,"missing offset"),V(E<this.length,"Trying to read beyond buffer length")),!(E>=this.length))return 128&this[E]?-1*(255-this[E]+1):this[E]},w.prototype.readInt16LE=function(E,T){return C(this,E,!0,T)},w.prototype.readInt16BE=function(E,T){return C(this,E,!1,T)},w.prototype.readInt32LE=function(E,T){return A(this,E,!0,T)},w.prototype.readInt32BE=function(E,T){return A(this,E,!1,T)},w.prototype.readFloatLE=function(E,T){return _(this,E,!0,T)},w.prototype.readFloatBE=function(E,T){return _(this,E,!1,T)},w.prototype.readDoubleLE=function(E,T){return I(this,E,!0,T)},w.prototype.readDoubleBE=function(E,T){return I(this,E,!1,T)},w.prototype.writeUInt8=function(E,T,R){R||(V(E!=null,"missing value"),V(T!=null,"missing offset"),V(T<this.length,"trying to write beyond buffer length"),ie(E,255)),T>=this.length||(this[T]=E)},w.prototype.writeUInt16LE=function(E,T,R){x(this,E,T,!0,R)},w.prototype.writeUInt16BE=function(E,T,R){x(this,E,T,!1,R)},w.prototype.writeUInt32LE=function(E,T,R){M(this,E,T,!0,R)},w.prototype.writeUInt32BE=function(E,T,R){M(this,E,T,!1,R)},w.prototype.writeInt8=function(E,T,R){R||(V(E!=null,"missing value"),V(T!=null,"missing offset"),V(T<this.length,"Trying to write beyond buffer length"),Oe(E,127,-128)),T>=this.length||(0<=E?this.writeUInt8(E,T,R):this.writeUInt8(255+E+1,T,R))},w.prototype.writeInt16LE=function(E,T,R){D(this,E,T,!0,R)},w.prototype.writeInt16BE=function(E,T,R){D(this,E,T,!1,R)},w.prototype.writeInt32LE=function(E,T,R){L(this,E,T,!0,R)},w.prototype.writeInt32BE=function(E,T,R){L(this,E,T,!1,R)},w.prototype.writeFloatLE=function(E,T,R){N(this,E,T,!0,R)},w.prototype.writeFloatBE=function(E,T,R){N(this,E,T,!1,R)},w.prototype.writeDoubleLE=function(E,T,R){F(this,E,T,!0,R)},w.prototype.writeDoubleBE=function(E,T,R){F(this,E,T,!1,R)},w.prototype.fill=function(E,T,R){if(T=T||0,R=R||this.length,V(typeof(E=typeof(E=E||0)=="string"?E.charCodeAt(0):E)=="number"&&!isNaN(E),"value is not a number"),V(T<=R,"end < start"),R!==T&&this.length!==0){V(0<=T&&T<this.length,"start out of bounds"),V(0<=R&&R<=this.length,"end out of bounds");for(var W=T;W<R;W++)this[W]=E}},w.prototype.inspect=function(){for(var E=[],T=this.length,R=0;R<T;R++)if(E[R]=Z(this[R]),R===s.INSPECT_MAX_BYTES){E[R+1]="...";break}return"<Buffer "+E.join(" ")+">"},w.prototype.toArrayBuffer=function(){if(typeof Uint8Array>"u")throw new Error("Buffer.toArrayBuffer not supported in this browser");if(w._useTypedArrays)return new w(this).buffer;for(var E=new Uint8Array(this.length),T=0,R=E.length;T<R;T+=1)E[T]=this[T];return E.buffer};var B=w.prototype;function K(E,T,R){return typeof E!="number"?R:T<=(E=~~E)?T:0<=E||0<=(E+=T)?E:0}function $(E){return(E=~~Math.ceil(+E))<0?0:E}function U(E){return(Array.isArray||function(T){return Object.prototype.toString.call(T)==="[object Array]"})(E)}function Z(E){return E<16?"0"+E.toString(16):E.toString(16)}function ne(E){for(var T=[],R=0;R<E.length;R++){var W=E.charCodeAt(R);if(W<=127)T.push(E.charCodeAt(R));else for(var q=R,X=(55296<=W&&W<=57343&&R++,encodeURIComponent(E.slice(q,R+1)).substr(1).split("%")),oe=0;oe<X.length;oe++)T.push(parseInt(X[oe],16))}return T}function Y(E){return g.toByteArray(E)}function se(E,T,R,W){for(var q=0;q<W&&!(q+R>=T.length||q>=E.length);q++)T[q+R]=E[q];return q}function ve(E){try{return decodeURIComponent(E)}catch{return"�"}}function ie(E,T){V(typeof E=="number","cannot write a non-number as a number"),V(0<=E,"specified a negative value for writing an unsigned value"),V(E<=T,"value is larger than maximum value for type"),V(Math.floor(E)===E,"value has a fractional component")}function Oe(E,T,R){V(typeof E=="number","cannot write a non-number as a number"),V(E<=T,"value larger than maximum allowed value"),V(R<=E,"value smaller than minimum allowed value"),V(Math.floor(E)===E,"value has a fractional component")}function Q(E,T,R){V(typeof E=="number","cannot write a non-number as a number"),V(E<=T,"value larger than maximum allowed value"),V(R<=E,"value smaller than minimum allowed value")}function V(E,T){if(!E)throw new Error(T||"Failed assertion")}w._augment=function(E){return E._isBuffer=!0,E._get=E.get,E._set=E.set,E.get=B.get,E.set=B.set,E.write=B.write,E.toString=B.toString,E.toLocaleString=B.toString,E.toJSON=B.toJSON,E.copy=B.copy,E.slice=B.slice,E.readUInt8=B.readUInt8,E.readUInt16LE=B.readUInt16LE,E.readUInt16BE=B.readUInt16BE,E.readUInt32LE=B.readUInt32LE,E.readUInt32BE=B.readUInt32BE,E.readInt8=B.readInt8,E.readInt16LE=B.readInt16LE,E.readInt16BE=B.readInt16BE,E.readInt32LE=B.readInt32LE,E.readInt32BE=B.readInt32BE,E.readFloatLE=B.readFloatLE,E.readFloatBE=B.readFloatBE,E.readDoubleLE=B.readDoubleLE,E.readDoubleBE=B.readDoubleBE,E.writeUInt8=B.writeUInt8,E.writeUInt16LE=B.writeUInt16LE,E.writeUInt16BE=B.writeUInt16BE,E.writeUInt32LE=B.writeUInt32LE,E.writeUInt32BE=B.writeUInt32BE,E.writeInt8=B.writeInt8,E.writeInt16LE=B.writeInt16LE,E.writeInt16BE=B.writeInt16BE,E.writeInt32LE=B.writeInt32LE,E.writeInt32BE=B.writeInt32BE,E.writeFloatLE=B.writeFloatLE,E.writeFloatBE=B.writeFloatBE,E.writeDoubleLE=B.writeDoubleLE,E.writeDoubleBE=B.writeDoubleBE,E.fill=B.fill,E.inspect=B.inspect,E.toArrayBuffer=B.toArrayBuffer,E}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/buffer/index.js","/node_modules/gulp-browserify/node_modules/buffer")},{"base64-js":2,buffer:3,ieee754:10,lYpoI2:11}],4:[function(n,r,s){(function(o,i,g,l,u,d,f,p,v){var g=n("buffer").Buffer,m=4,w=new g(m);w.fill(0),r.exports={hash:function(S,k,y,b){for(var j=k((function(x,M){x.length%m!=0&&(D=x.length+(m-x.length%m),x=g.concat([x,w],D));for(var D,L=[],N=M?x.readInt32BE:x.readInt32LE,F=0;F<x.length;F+=m)L.push(N.call(x,F));return L})(S=g.isBuffer(S)?S:new g(S),b),8*S.length),k=b,C=new g(y),A=k?C.writeInt32BE:C.writeInt32LE,_=0;_<j.length;_++)A.call(C,j[_],4*_,!0);return C}}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/helpers.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:11}],5:[function(n,r,s){(function(o,i,g,l,u,d,f,p,v){var g=n("buffer").Buffer,m=n("./sha"),w=n("./sha256"),S=n("./rng"),k={sha1:m,sha256:w,md5:n("./md5")},y=64,b=new g(y);function j(x,M){var D=k[x=x||"sha1"],L=[];return D||C("algorithm:",x,"is not yet supported"),{update:function(N){return g.isBuffer(N)||(N=new g(N)),L.push(N),N.length,this},digest:function(N){var F=g.concat(L),F=M?(function(B,K,$){g.isBuffer(K)||(K=new g(K)),g.isBuffer($)||($=new g($)),K.length>y?K=B(K):K.length<y&&(K=g.concat([K,b],y));for(var U=new g(y),Z=new g(y),ne=0;ne<y;ne++)U[ne]=54^K[ne],Z[ne]=92^K[ne];return $=B(g.concat([U,$])),B(g.concat([Z,$]))})(D,M,F):D(F);return L=null,N?F.toString(N):F}}}function C(){var x=[].slice.call(arguments).join(" ");throw new Error([x,"we accept pull requests","http://github.com/dominictarr/crypto-browserify"].join(`
160
+ `))}b.fill(0),s.createHash=function(x){return j(x)},s.createHmac=j,s.randomBytes=function(x,M){if(!M||!M.call)return new g(S(x));try{M.call(this,void 0,new g(S(x)))}catch(D){M(D)}};var A,_=["createCredentials","createCipher","createCipheriv","createDecipher","createDecipheriv","createSign","createVerify","createDiffieHellman","pbkdf2"],I=function(x){s[x]=function(){C("sorry,",x,"is not implemented yet")}};for(A in _)I(_[A])}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/index.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./md5":6,"./rng":7,"./sha":8,"./sha256":9,buffer:3,lYpoI2:11}],6:[function(n,r,s){(function(o,i,a,l,u,d,f,p,v){var g=n("./helpers");function m(C,A){C[A>>5]|=128<<A%32,C[14+(A+64>>>9<<4)]=A;for(var _=1732584193,I=-271733879,x=-1732584194,M=271733878,D=0;D<C.length;D+=16){var L=_,N=I,F=x,B=M,_=S(_,I,x,M,C[D+0],7,-680876936),M=S(M,_,I,x,C[D+1],12,-389564586),x=S(x,M,_,I,C[D+2],17,606105819),I=S(I,x,M,_,C[D+3],22,-1044525330);_=S(_,I,x,M,C[D+4],7,-176418897),M=S(M,_,I,x,C[D+5],12,1200080426),x=S(x,M,_,I,C[D+6],17,-1473231341),I=S(I,x,M,_,C[D+7],22,-45705983),_=S(_,I,x,M,C[D+8],7,1770035416),M=S(M,_,I,x,C[D+9],12,-1958414417),x=S(x,M,_,I,C[D+10],17,-42063),I=S(I,x,M,_,C[D+11],22,-1990404162),_=S(_,I,x,M,C[D+12],7,1804603682),M=S(M,_,I,x,C[D+13],12,-40341101),x=S(x,M,_,I,C[D+14],17,-1502002290),_=k(_,I=S(I,x,M,_,C[D+15],22,1236535329),x,M,C[D+1],5,-165796510),M=k(M,_,I,x,C[D+6],9,-1069501632),x=k(x,M,_,I,C[D+11],14,643717713),I=k(I,x,M,_,C[D+0],20,-373897302),_=k(_,I,x,M,C[D+5],5,-701558691),M=k(M,_,I,x,C[D+10],9,38016083),x=k(x,M,_,I,C[D+15],14,-660478335),I=k(I,x,M,_,C[D+4],20,-405537848),_=k(_,I,x,M,C[D+9],5,568446438),M=k(M,_,I,x,C[D+14],9,-1019803690),x=k(x,M,_,I,C[D+3],14,-187363961),I=k(I,x,M,_,C[D+8],20,1163531501),_=k(_,I,x,M,C[D+13],5,-1444681467),M=k(M,_,I,x,C[D+2],9,-51403784),x=k(x,M,_,I,C[D+7],14,1735328473),_=y(_,I=k(I,x,M,_,C[D+12],20,-1926607734),x,M,C[D+5],4,-378558),M=y(M,_,I,x,C[D+8],11,-2022574463),x=y(x,M,_,I,C[D+11],16,1839030562),I=y(I,x,M,_,C[D+14],23,-35309556),_=y(_,I,x,M,C[D+1],4,-1530992060),M=y(M,_,I,x,C[D+4],11,1272893353),x=y(x,M,_,I,C[D+7],16,-155497632),I=y(I,x,M,_,C[D+10],23,-1094730640),_=y(_,I,x,M,C[D+13],4,681279174),M=y(M,_,I,x,C[D+0],11,-358537222),x=y(x,M,_,I,C[D+3],16,-722521979),I=y(I,x,M,_,C[D+6],23,76029189),_=y(_,I,x,M,C[D+9],4,-640364487),M=y(M,_,I,x,C[D+12],11,-421815835),x=y(x,M,_,I,C[D+15],16,530742520),_=b(_,I=y(I,x,M,_,C[D+2],23,-995338651),x,M,C[D+0],6,-198630844),M=b(M,_,I,x,C[D+7],10,1126891415),x=b(x,M,_,I,C[D+14],15,-1416354905),I=b(I,x,M,_,C[D+5],21,-57434055),_=b(_,I,x,M,C[D+12],6,1700485571),M=b(M,_,I,x,C[D+3],10,-1894986606),x=b(x,M,_,I,C[D+10],15,-1051523),I=b(I,x,M,_,C[D+1],21,-2054922799),_=b(_,I,x,M,C[D+8],6,1873313359),M=b(M,_,I,x,C[D+15],10,-30611744),x=b(x,M,_,I,C[D+6],15,-1560198380),I=b(I,x,M,_,C[D+13],21,1309151649),_=b(_,I,x,M,C[D+4],6,-145523070),M=b(M,_,I,x,C[D+11],10,-1120210379),x=b(x,M,_,I,C[D+2],15,718787259),I=b(I,x,M,_,C[D+9],21,-343485551),_=j(_,L),I=j(I,N),x=j(x,F),M=j(M,B)}return Array(_,I,x,M)}function w(C,A,_,I,x,M){return j((A=j(j(A,C),j(I,M)))<<x|A>>>32-x,_)}function S(C,A,_,I,x,M,D){return w(A&_|~A&I,C,A,x,M,D)}function k(C,A,_,I,x,M,D){return w(A&I|_&~I,C,A,x,M,D)}function y(C,A,_,I,x,M,D){return w(A^_^I,C,A,x,M,D)}function b(C,A,_,I,x,M,D){return w(_^(A|~I),C,A,x,M,D)}function j(C,A){var _=(65535&C)+(65535&A);return(C>>16)+(A>>16)+(_>>16)<<16|65535&_}r.exports=function(C){return g.hash(C,m,16)}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/md5.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],7:[function(n,r,s){(function(o,i,a,l,u,d,f,p,v){r.exports=function(g){for(var m,w=new Array(g),S=0;S<g;S++)(3&S)==0&&(m=4294967296*Math.random()),w[S]=m>>>((3&S)<<3)&255;return w}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/rng.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:11}],8:[function(n,r,s){(function(o,i,a,l,u,d,f,p,v){var g=n("./helpers");function m(k,y){k[y>>5]|=128<<24-y%32,k[15+(y+64>>9<<4)]=y;for(var b,j,C,A=Array(80),_=1732584193,I=-271733879,x=-1732584194,M=271733878,D=-1009589776,L=0;L<k.length;L+=16){for(var N=_,F=I,B=x,K=M,$=D,U=0;U<80;U++){A[U]=U<16?k[L+U]:S(A[U-3]^A[U-8]^A[U-14]^A[U-16],1);var Z=w(w(S(_,5),(Z=I,j=x,C=M,(b=U)<20?Z&j|~Z&C:!(b<40)&&b<60?Z&j|Z&C|j&C:Z^j^C)),w(w(D,A[U]),(b=U)<20?1518500249:b<40?1859775393:b<60?-1894007588:-899497514)),D=M,M=x,x=S(I,30),I=_,_=Z}_=w(_,N),I=w(I,F),x=w(x,B),M=w(M,K),D=w(D,$)}return Array(_,I,x,M,D)}function w(k,y){var b=(65535&k)+(65535&y);return(k>>16)+(y>>16)+(b>>16)<<16|65535&b}function S(k,y){return k<<y|k>>>32-y}r.exports=function(k){return g.hash(k,m,20,!0)}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],9:[function(n,r,s){(function(o,i,a,l,u,d,f,p,v){function g(y,b){var j=(65535&y)+(65535&b);return(y>>16)+(b>>16)+(j>>16)<<16|65535&j}function m(y,b){var j,C=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),A=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),_=new Array(64);y[b>>5]|=128<<24-b%32,y[15+(b+64>>9<<4)]=b;for(var I,x,M=0;M<y.length;M+=16){for(var D=A[0],L=A[1],N=A[2],F=A[3],B=A[4],K=A[5],$=A[6],U=A[7],Z=0;Z<64;Z++)_[Z]=Z<16?y[Z+M]:g(g(g((x=_[Z-2],S(x,17)^S(x,19)^k(x,10)),_[Z-7]),(x=_[Z-15],S(x,7)^S(x,18)^k(x,3))),_[Z-16]),j=g(g(g(g(U,S(x=B,6)^S(x,11)^S(x,25)),B&K^~B&$),C[Z]),_[Z]),I=g(S(I=D,2)^S(I,13)^S(I,22),D&L^D&N^L&N),U=$,$=K,K=B,B=g(F,j),F=N,N=L,L=D,D=g(j,I);A[0]=g(D,A[0]),A[1]=g(L,A[1]),A[2]=g(N,A[2]),A[3]=g(F,A[3]),A[4]=g(B,A[4]),A[5]=g(K,A[5]),A[6]=g($,A[6]),A[7]=g(U,A[7])}return A}var w=n("./helpers"),S=function(y,b){return y>>>b|y<<32-b},k=function(y,b){return y>>>b};r.exports=function(y){return w.hash(y,m,32,!0)}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha256.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],10:[function(n,r,s){(function(o,i,a,l,u,d,f,p,v){s.read=function(g,m,w,S,M){var y,b,j=8*M-S-1,C=(1<<j)-1,A=C>>1,_=-7,I=w?M-1:0,x=w?-1:1,M=g[m+I];for(I+=x,y=M&(1<<-_)-1,M>>=-_,_+=j;0<_;y=256*y+g[m+I],I+=x,_-=8);for(b=y&(1<<-_)-1,y>>=-_,_+=S;0<_;b=256*b+g[m+I],I+=x,_-=8);if(y===0)y=1-A;else{if(y===C)return b?NaN:1/0*(M?-1:1);b+=Math.pow(2,S),y-=A}return(M?-1:1)*b*Math.pow(2,y-S)},s.write=function(g,m,w,S,k,D){var b,j,C=8*D-k-1,A=(1<<C)-1,_=A>>1,I=k===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=S?0:D-1,M=S?1:-1,D=m<0||m===0&&1/m<0?1:0;for(m=Math.abs(m),isNaN(m)||m===1/0?(j=isNaN(m)?1:0,b=A):(b=Math.floor(Math.log(m)/Math.LN2),m*(S=Math.pow(2,-b))<1&&(b--,S*=2),2<=(m+=1<=b+_?I/S:I*Math.pow(2,1-_))*S&&(b++,S/=2),A<=b+_?(j=0,b=A):1<=b+_?(j=(m*S-1)*Math.pow(2,k),b+=_):(j=m*Math.pow(2,_-1)*Math.pow(2,k),b=0));8<=k;g[w+x]=255&j,x+=M,j/=256,k-=8);for(b=b<<k|j,C+=k;0<C;g[w+x]=255&b,x+=M,b/=256,C-=8);g[w+x-M]|=128*D}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/ieee754/index.js","/node_modules/gulp-browserify/node_modules/ieee754")},{buffer:3,lYpoI2:11}],11:[function(n,r,s){(function(o,i,a,l,u,d,f,p,v){var g,m,w;function S(){}(o=r.exports={}).nextTick=(m=typeof window<"u"&&window.setImmediate,w=typeof window<"u"&&window.postMessage&&window.addEventListener,m?function(k){return window.setImmediate(k)}:w?(g=[],window.addEventListener("message",function(k){var y=k.source;y!==window&&y!==null||k.data!=="process-tick"||(k.stopPropagation(),0<g.length&&g.shift()())},!0),function(k){g.push(k),window.postMessage("process-tick","*")}):function(k){setTimeout(k,0)}),o.title="browser",o.browser=!0,o.env={},o.argv=[],o.on=S,o.addListener=S,o.once=S,o.off=S,o.removeListener=S,o.removeAllListeners=S,o.emit=S,o.binding=function(k){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(k){throw new Error("process.chdir is not supported")}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/process/browser.js","/node_modules/gulp-browserify/node_modules/process")},{buffer:3,lYpoI2:11}]},{},[1])(1)})})(gi)),gi.exports}var S1=w1();const vi=Zu(S1);P();P();function Nl(e,t,n){const r=t.split("."),s=O({},e);let o=s;for(let i=0;i<r.length;i++){const[a,l]=r[i].replace("]","").split("["),u=i===r.length-1;if(l!==void 0){Array.isArray(o[a])||(o[a]=[]);const d=Number(l);if(u){o[a][d]=n;continue}o[a][d]===void 0&&(o[a][d]={}),o=o[a][d];continue}if(u){o[a]=n;continue}o[a]===void 0&&(o[a]={}),o=o[a]}return O(O({},e),s)}P();P();var k1={Button:"_Button_10byl_1","Button--medium":"_Button--medium_10byl_29","Button--large":"_Button--large_10byl_37","Button-icon":"_Button-icon_10byl_44","Button--primary":"_Button--primary_10byl_48","Button--secondary":"_Button--secondary_10byl_67","Button--flush":"_Button--flush_10byl_84","Button--disabled":"_Button--disabled_10byl_88","Button--fullWidth":"_Button--fullWidth_10byl_95","Button-spinner":"_Button-spinner_10byl_100"};P();var I1=/^(data-.*)$/,E1=e=>{let t={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&I1.test(n)&&(t[n]=e[n]);return t},mi=te("Button",k1),fa=e=>{var t=e,{children:n,href:r,onClick:s,variant:o="primary",type:i,disabled:a,tabIndex:l,newTab:u,fullWidth:d,icon:f,size:p="medium",loading:v=!1}=t,g=Kt(t,["children","href","onClick","variant","type","disabled","tabIndex","newTab","fullWidth","icon","size","loading"]);const[m,w]=h.useState(v);h.useEffect(()=>w(v),[v]);const S=r?"a":i?"button":"span",k=E1(g);return c.jsxs(S,z(O({className:mi({primary:o==="primary",secondary:o==="secondary",disabled:a,fullWidth:d,[p]:!0}),onClick:b=>{s&&(w(!0),Promise.resolve(s(b)).then(()=>{w(!1)}))},type:i,disabled:a||m,tabIndex:l,target:u?"_blank":void 0,rel:u?"noreferrer":void 0,href:r},k),{children:[f&&c.jsx("div",{className:mi("icon"),children:f}),n,m&&c.jsx("div",{className:mi("spinner"),children:c.jsx(Mn,{size:14})})]}))};P();P();var Ln={InputWrapper:"_InputWrapper_bsxfo_1","Input-label":"_Input-label_bsxfo_5","Input-labelIcon":"_Input-labelIcon_bsxfo_14","Input-disabledIcon":"_Input-disabledIcon_bsxfo_21","Input-input":"_Input-input_bsxfo_26",Input:"_Input_bsxfo_1","Input--readOnly":"_Input--readOnly_bsxfo_82","Input-radioGroupItems":"_Input-radioGroupItems_bsxfo_93","Input-radio":"_Input-radio_bsxfo_93","Input-radioInner":"_Input-radioInner_bsxfo_110","Input-radioInput":"_Input-radioInput_bsxfo_155"},ao=te("Input",Ln),Ch=({children:e,icon:t,label:n,el:r="label",readOnly:s,className:o})=>{const i=r;return c.jsxs(i,{className:o,children:[c.jsxs("div",{className:ao("label"),children:[t?c.jsx("div",{className:ao("labelIcon"),children:t}):c.jsx(c.Fragment,{}),n,s&&c.jsx("div",{className:ao("disabledIcon"),title:"Read-only",children:c.jsx(ky,{size:"12"})})]}),e]})},C1=({children:e,icon:t,label:n,el:r="label",readOnly:s})=>{const o=H(a=>a.overrides),i=h.useMemo(()=>o.fieldLabel||Ch,[o]);return n?c.jsx(i,{label:n,icon:t,className:ao({readOnly:s}),readOnly:s,el:r,children:e}):c.jsx(c.Fragment,{children:e})};P();P();P();P();var jh={ArrayField:"_ArrayField_1vaho_5","ArrayField--isDraggingFrom":"_ArrayField--isDraggingFrom_1vaho_13","ArrayField-addButton":"_ArrayField-addButton_1vaho_18","ArrayField--hasItems":"_ArrayField--hasItems_1vaho_33","ArrayField-inner":"_ArrayField-inner_1vaho_59",ArrayFieldItem:"_ArrayFieldItem_1vaho_67","ArrayFieldItem--isDragging":"_ArrayFieldItem--isDragging_1vaho_78","ArrayFieldItem--isExpanded":"_ArrayFieldItem--isExpanded_1vaho_82","ArrayFieldItem-summary":"_ArrayFieldItem-summary_1vaho_97","ArrayFieldItem--noFields":"_ArrayFieldItem--noFields_1vaho_122","ArrayField--addDisabled":"_ArrayField--addDisabled_1vaho_131","ArrayFieldItem-body":"_ArrayFieldItem-body_1vaho_170","ArrayFieldItem-fieldset":"_ArrayFieldItem-fieldset_1vaho_179","ArrayFieldItem-rhs":"_ArrayFieldItem-rhs_1vaho_187","ArrayFieldItem-actions":"_ArrayFieldItem-actions_1vaho_193"};P();P();function Gt(e,t){const n=h.useContext(e);if(!n)throw new Error("useContextStore must be used inside context");return Lo(n,Ke(t))}function j1(e){return({children:n,value:r})=>{const[s]=h.useState(()=>ur(()=>r));return c.jsx(e.Provider,{value:s,children:n})}}function P1(e){const t=h.createContext(ur(Ia(()=>e)));return{ctx:t,Provider:j1(t)}}var Ps=P1({}),zl=()=>h.useContext(Ps.ctx);function Xo(e){const t=h.useContext(Ps.ctx);if(!t)throw new Error("useContextStore must be used inside context");return Lo(t,Ke(e))}P();P();var A1={DragIcon:"_DragIcon_17p8x_1","DragIcon--disabled":"_DragIcon--disabled_17p8x_8"},O1=te("DragIcon",A1),Ph=({isDragDisabled:e})=>c.jsx("div",{className:O1({disabled:e}),children:c.jsx("svg",{viewBox:"0 0 20 20",width:"12",fill:"currentColor",children:c.jsx("path",{d:"M7 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 2zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 8zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 14zm6-8a2 2 0 1 0-.001-4.001A2 2 0 0 0 13 6zm0 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 8zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 14z"})})});P();P();var du={delay:{value:200,tolerance:10}},fu={delay:{value:200,tolerance:10},distance:{value:5}},Ah=({other:e=fu,mouse:t,touch:n=du}={touch:du,other:fu})=>{const[r]=h.useState(()=>[Lp.configure({activationConstraints(s,o){var i;const{pointerType:a,target:l}=s;return a==="mouse"&&mr(l)&&(o.handle===l||(i=o.handle)!=null&&i.contains(l))?t:a==="touch"?n:e}})]);return r};P();P();P();var er=(e,t,n,r,s)=>{},yi="increasing",M1=(e,t)=>{var n;const{dragOperation:r,droppable:s}=e,{shape:o}=s,{position:i}=r,a=(n=r.shape)==null?void 0:n.current;if(!a||!o)return null;const l=o.center,u=Math.sqrt(Math.pow(l.x-t.x,2)+Math.pow(l.y-t.y,2)),d=Math.sqrt(Math.pow(l.x-i.current.x,2)+Math.pow(l.y-i.current.y,2));return yi=d===u?yi:d<u?"decreasing":"increasing",er(a.center,l,s.id.toString()),yi==="decreasing"?{id:s.id,value:1,type:Ht.Collision}:null};P();var Oh=(e,t)=>e==="dynamic"?Math.abs(t.y)>Math.abs(t.x)?t.y===0?null:t.y>0?"down":"up":t.x===0?null:t.x>0?"right":"left":e==="x"?t.x===0?null:t.x>0?"right":"left":t.y===0?null:t.y>0?"down":"up";P();var D1=(e,t,n,r=0)=>{const s=e.boundingRectangle,o=t.center;if(n==="down"){const a=r*t.boundingRectangle.height;return s.bottom>=o.y+a}else if(n==="up"){const a=r*t.boundingRectangle.height;return s.top<o.y-a}else if(n==="left"){const a=r*t.boundingRectangle.width;return o.x-a>=s.left}const i=r*t.boundingRectangle.width;return s.right-i>=o.x};P();var pu=10,kt={current:{x:0,y:0},delta:{x:0,y:0},previous:{x:0,y:0},direction:null},T1=(e,t="dynamic")=>(kt.current=e,kt.delta={x:e.x-kt.previous.x,y:e.y-kt.previous.y},kt.direction=Oh(t,kt.delta)||kt.direction,(Math.abs(kt.delta.x)>pu||Math.abs(kt.delta.y)>pu)&&(kt.previous=tt.from(e)),kt);P();var R1=({dragOperation:e,droppable:t})=>{const n=e.position.current;if(!n)return null;const{id:r}=t;if(!t.shape)return null;if(t.shape.containsPoint(n)){const s=tt.distance(t.shape.center,n);return{id:r,value:1/s,type:Ht.PointerIntersection,priority:bt.High}}return null},L1=e=>{const{dragOperation:t,droppable:n}=e,{shape:r,position:s}=t;if(!n.shape)return null;const o=r?At.from(r.current.boundingRectangle).corners:void 0,a=At.from(n.shape.boundingRectangle).corners.reduce((l,u,d)=>{var f;return l+tt.distance(tt.from(u),(f=o==null?void 0:o[d])!=null?f:s.current)},0)/4;return{id:n.id,value:1/a,type:Ht.Collision,priority:bt.Normal}};P();var pa=ur(()=>({fallbackEnabled:!1})),bi="",Mh=(e,t=.05)=>(n=>{var r,s,o,i,a;const{dragOperation:l,droppable:u}=n,{position:d}=l,f=(r=l.shape)==null?void 0:r.current,{shape:p}=u;if(!f||!p)return null;const{center:v}=f,{fallbackEnabled:g}=pa.getState(),m=T1(d.current,e),w={direction:m.direction},{center:S}=p,k=D1(f,p,m.direction,t);if(((s=l.source)==null?void 0:s.id)===u.id){const j=M1(n,m.previous);if(er(v,S,u.id.toString()),j)return z(O({},j),{priority:bt.Highest,data:w})}const y=f.intersectionArea(p),b=y/p.area;if(y&&k){er(v,S,u.id.toString());const j={id:u.id,value:b,priority:bt.High,type:Ht.Collision},C=bi===u.id;return bi="",z(O({},j),{id:C?"flush":j.id,data:w})}if(g&&((o=l.source)==null?void 0:o.id)!==u.id){const j=p.boundingRectangle.right>f.boundingRectangle.left&&p.boundingRectangle.left<f.boundingRectangle.right,C=p.boundingRectangle.bottom>f.boundingRectangle.top&&p.boundingRectangle.top<f.boundingRectangle.bottom;if(e==="y"&&j||C){const A=L1(n);if(A){const _=Oh(e,{x:f.center.x-(((i=u.shape)==null?void 0:i.center.x)||0),y:f.center.y-(((a=u.shape)==null?void 0:a.center.y)||0)});return w.direction=_,y?(er(v,S,u.id.toString()),bi=u.id,z(O({},A),{priority:bt.Low,data:w})):(er(v,S,u.id.toString()),z(O({},A),{priority:bt.Lowest,data:w}))}}}return er(v,S,u.id.toString()),null}),N1=({children:e,onDragStart:t,onDragEnd:n,onMove:r})=>{const s=Ah({mouse:{distance:{value:5}}});return c.jsx(Kp,{sensors:s,onDragStart:o=>{var i,a;return t((a=(i=o.operation.source)==null?void 0:i.id.toString())!=null?a:"")},onDragOver:(o,i)=>{var a;o.preventDefault();const{operation:l}=o,{source:u,target:d}=l;if(!u||!d)return;let f=u.data.index,p=d.data.index;const v=(a=i.collisionObserver.collisions[0])==null?void 0:a.data;if(f!==p&&u.id!==d.id){const g=(v==null?void 0:v.direction)==="up"?"before":"after";p>=f&&(p=p-1),g==="after"&&(p=p+1),r({source:f,target:p})}},onDragEnd:()=>{setTimeout(()=>{n()},250)},children:e})},z1=({id:e,index:t,disabled:n,children:r,type:s="item"})=>{const{ref:o,isDragging:i,isDropping:a,handleRef:l}=yh({id:e,type:s,index:t,disabled:n,data:{index:t},collisionDetector:Mh("y")});return r({isDragging:i,isDropping:a,ref:o,handleRef:l})};P();var Mo=h.createContext({}),$l=()=>{const e=h.useContext(Mo);return z(O({},e),{readOnlyFields:e.readOnlyFields||{}})},$1=({children:e,name:t,subName:n,wildcardName:r=t,readOnlyFields:s})=>{const o=`${t}.${n}`,i=`${r}.${n}`,a=h.useMemo(()=>Object.keys(s).reduce((l,u)=>{if(u.indexOf(o)>-1||u.indexOf(i)>-1){const f=new RegExp(`^(${t}|${r}).`.replace(/\[/g,"\\[").replace(/\]/g,"\\]").replace(/\./g,"\\.").replace(/\*/g,"\\*")),p=u.replace(f,"");return z(O({},l),{[p]:s[u]})}return l},{}),[t,n,r,s]);return c.jsx(Mo.Provider,{value:{readOnlyFields:a,localName:n},children:e})};P();var As=(e,t)=>t.split(".").reduce((r,s)=>{if(!r)return;const[o,i]=s.replace("]","").split("["),a=r[o];return i&&a?a[parseInt(i)]:a},e);P();var F1=({field:e,id:t,index:n,name:r,subName:s,localName:o,onChange:i,forceReadOnly:a})=>{const l=typeof n<"u"?`${r}[${n}]`:r,u=r?`${l}.${s}`:s,d=typeof n<"u"?`${o}[${n}]`:o??s,f=typeof n<"u"?`${o}[*]`:o,p=`${d}.${s}`,v=`${f}.${s}`,{readOnlyFields:g}=$l(),m=a||(typeof g[u]<"u"?g[p]:g[v]),w=e.label||s;return c.jsx($1,{name:d,wildcardName:f,subName:s,readOnlyFields:g,children:c.jsx(Nh,{name:u,label:w,id:t,readOnly:m,field:z(O({},e),{label:w}),onChange:(S,k)=>{i(S,k,s)}})})},Dh=h.memo(F1),_i=te("ArrayField",jh),cn=te("ArrayFieldItem",jh),B1=({index:e,originalIndex:t,field:n,name:r})=>{const s=Xo(i=>{const a=`${[r]}[${e}]`;return As(i,a)});return h.useMemo(()=>s&&n.getItemSummary?n.getItemSummary(s,e):`Item #${t}`,[s,n,t,e])},H1=h.memo(B1),V1=({id:e,arrayId:t,index:n,dragIndex:r,originalIndex:s,field:o,onChange:i,onToggleExpand:a,readOnly:l,actions:u,name:d,localName:f})=>{const p=H(m=>{var w;return((w=m.state.ui.arrayState[t])==null?void 0:w.openId)===e}),v=H(m=>m.permissions.getPermissions({item:m.selectedItem}).edit),g=h.useMemo(()=>o.arrayFields?Object.values(o.arrayFields).some(m=>m.type!=="slot"&&m.visible!==!1):!1,[o.arrayFields]);return c.jsx(z1,{id:e,index:r,disabled:l,children:({isDragging:m,ref:w,handleRef:S})=>c.jsxs("div",{ref:w,className:cn({isExpanded:p&&g,isDragging:m,noFields:!g}),children:[c.jsxs("div",{ref:S,onClick:k=>{m||(k.preventDefault(),k.stopPropagation(),g&&a(e,p))},className:cn("summary"),children:[c.jsx(H1,{index:n,originalIndex:s,field:o,name:d}),c.jsxs("div",{className:cn("rhs"),children:[!l&&c.jsx("div",{className:cn("actions"),children:u}),c.jsx("div",{children:c.jsx(Ph,{})})]})]}),c.jsx("div",{className:cn("body"),children:p&&g&&c.jsx("fieldset",{className:cn("fieldset"),children:Object.keys(o.arrayFields).map(k=>{const y=o.arrayFields[k];return c.jsx(Dh,{id:`${e}_${k}`,name:d,index:n,subName:k,localName:f,field:y,onChange:i,forceReadOnly:!v},`${e}_${k}_${n}`)})})})]})})},W1=h.memo(V1),U1=({field:e,onChange:t,id:n,name:r=n,label:s,labelIcon:o,readOnly:i,Label:a=l=>c.jsx("div",O({},l))})=>{const l=H(L=>L.setUi),u=Ae(),d=zl(),{localName:f=r}=$l(),p=()=>{var L;return(L=As(d.getState(),r))!=null?L:[]},v=h.useCallback(()=>{var L;const{state:N}=u.getState(),F=N.ui.arrayState[n];if((L=F==null?void 0:F.items)!=null&&L.length)return F;const B=p();return{items:Array.from(B||[]).map((K,$)=>({_originalIndex:$,_currentIndex:$,_arrayId:`${n}-${$}`})),openId:""}},[u,n,p,r]),g=Xo(()=>p().length),m=h.useMemo(v,[v]),w=H(L=>{const N=L.state.ui.arrayState[n];return N??m}),S=Ae(),k=h.useCallback(L=>{const N=S.getState().state;return{arrayState:z(O({},N.ui.arrayState),{[n]:O(O({},v()),L)})}},[S]),y=h.useCallback(()=>v().items.reduce((L,N)=>N._originalIndex>L?N._originalIndex:L,-1),[]),b=h.useCallback(L=>{let N=y();const F=v(),B=Array.from(L||[]).map((K,$)=>{var U,Z,ne;const Y=F.items[$],se={_originalIndex:(U=Y==null?void 0:Y._originalIndex)!=null?U:N+1,_currentIndex:(Z=Y==null?void 0:Y._currentIndex)!=null?Z:$,_arrayId:((ne=F.items[$])==null?void 0:ne._arrayId)||`${n}-${N+1}`};return se._originalIndex>N&&(N=se._originalIndex),se});return z(O({},F),{items:B})},[]),[j,C]=h.useState(""),A=!!j,_=h.useRef([]);h.useEffect(()=>{_.current=p()},[]);const I=h.useCallback(L=>{if(e.type!=="array"||!e.arrayFields)return;const N=S.getState().config;return ho({value:L,fields:e.arrayFields,mappers:{slot:({value:F})=>F.map(K=>Ma(K,N,!0))},config:N})},[S,e]),x=h.useCallback(()=>{const L=v(),N=L.items.map((K,$)=>z(O({},K),{_currentIndex:$})),F=S.getState().state,B={arrayState:z(O({},F.ui.arrayState),{[n]:z(O({},L),{items:N})})};l(B,!1)},[]),M=h.useCallback(L=>{const N=b(L);l(k(N),!1),t(L)},[b,l,k,t]);if(h.useEffect(()=>{const L=b(p());l(k(L),!1)},[g]),e.type!=="array"||!e.arrayFields)return null;const D=e.max!==void 0&&(w==null?void 0:w.items.length)>=e.max||i;return c.jsx(a,{label:s||r,icon:o||c.jsx(zo,{size:16}),el:"div",readOnly:i,children:c.jsx(N1,{onDragStart:L=>{_.current=p(),C(L),x()},onDragEnd:()=>{C(""),t(_.current);const L=d.getState();d.setState(Nl(L,r,_.current)),x()},onMove:L=>{const N=v();if(N.items[L.source]._arrayId!==j)return;const F=yc(_.current,L.source,L.target),B=yc(N.items,L.source,L.target),K=S.getState().state,$={arrayState:z(O({},K.ui.arrayState),{[n]:z(O({},N),{items:B})})};l($,!1),_.current=F},children:c.jsxs("div",{className:_i({hasItems:g>0,addDisabled:D}),children:[w.items.length>0&&c.jsx("div",{className:_i("inner"),"data-dnd-container":!0,children:w.items.map((L,N)=>{const{_arrayId:F=`${n}-${N}`,_originalIndex:B=N,_currentIndex:K=N}=L;return c.jsx(W1,{index:K,dragIndex:N,originalIndex:B,arrayId:n,id:F,readOnly:i,field:e,name:r,localName:f,onChange:($,U,Z)=>{const ne=p(),Y=Array.from(ne||[])[N]||{};t(rb(ne,N,z(O({},Y),{[Z]:$})),U)},onToggleExpand:($,U)=>{l(k(U?{openId:""}:{openId:$}))},actions:c.jsxs(c.Fragment,{children:[c.jsx("div",{className:cn("action"),children:c.jsx(jt,{type:"button",disabled:!!D,onClick:$=>{$.stopPropagation();const Z=[...p()||[]],ne=I(Z[N]);Z.splice(N,0,ne),M(Z)},title:"Duplicate",children:c.jsx(xd,{size:16})})}),c.jsx("div",{className:cn("action"),children:c.jsx(jt,{type:"button",disabled:e.min!==void 0&&e.min>=w.items.length,onClick:$=>{$.stopPropagation();const Z=[...p()||[]];Z.splice(N,1),M(Z)},title:"Delete",children:c.jsx(Ed,{size:16})})})]})},F)})}),!D&&c.jsx("button",{type:"button",className:_i("addButton"),onClick:()=>{var L;if(A)return;const F=p()||[],B=typeof e.defaultItemProps=="function"?e.defaultItemProps(F.length):(L=e.defaultItemProps)!=null?L:{},K=Aa(I(B),e.arrayFields),$=[...F,K];M($)},children:c.jsx(Ay,{size:21})})]})})})};P();P();P();var Os=e=>Xo(t=>As(t,e));P();var q1=e=>H(t=>t.state.ui.field.focus===e),Th=(e,t)=>{const n=Os(e),r=q1(e),[s,o]=h.useState(n==null?void 0:n.toString()),i=h.useCallback(a=>{o(a),t(a)},[t]);return h.useEffect(()=>{r||o(n)},[r,n]),[s??"",i]},Z1=te("Input",Ln),hu=({field:e,onChange:t,readOnly:n,id:r,name:s=r,label:o,labelIcon:i,Label:a})=>{const[l,u]=Th(s,t);return c.jsx(a,{label:o||s,icon:i||c.jsxs(c.Fragment,{children:[e.type==="text"&&c.jsx($o,{size:16}),e.type==="number"&&c.jsx(hy,{size:16})]}),readOnly:n,children:c.jsx("input",{className:Z1("input"),autoComplete:"off",type:e.type,title:o||s,name:s,value:l,onChange:d=>{if(e.type==="number"){const f=Number(d.currentTarget.value);if(typeof e.min<"u"&&f<e.min||typeof e.max<"u"&&f>e.max)return;u(f)}else u(d.currentTarget.value)},readOnly:n,tabIndex:n?-1:void 0,id:r,min:e.type==="number"?e.min:void 0,max:e.type==="number"?e.max:void 0,placeholder:e.type==="text"||e.type==="number"?e.placeholder:void 0,step:e.type==="number"?e.step:void 0})})};P();P();P();var Rh={"ExternalInput-actions":"_ExternalInput-actions_91ls0_1","ExternalInput-button":"_ExternalInput-button_91ls0_5","ExternalInput--dataSelected":"_ExternalInput--dataSelected_91ls0_24","ExternalInput--readOnly":"_ExternalInput--readOnly_91ls0_31","ExternalInput-detachButton":"_ExternalInput-detachButton_91ls0_35",ExternalInput:"_ExternalInput_91ls0_1",ExternalInputModal:"_ExternalInputModal_91ls0_79","ExternalInputModal-grid":"_ExternalInputModal-grid_91ls0_89","ExternalInputModal--filtersToggled":"_ExternalInputModal--filtersToggled_91ls0_100","ExternalInputModal-filters":"_ExternalInputModal-filters_91ls0_105","ExternalInputModal-masthead":"_ExternalInputModal-masthead_91ls0_124","ExternalInputModal-tableWrapper":"_ExternalInputModal-tableWrapper_91ls0_133","ExternalInputModal-table":"_ExternalInputModal-table_91ls0_133","ExternalInputModal-thead":"_ExternalInputModal-thead_91ls0_149","ExternalInputModal-th":"_ExternalInputModal-th_91ls0_149","ExternalInputModal-td":"_ExternalInputModal-td_91ls0_164","ExternalInputModal-tr":"_ExternalInputModal-tr_91ls0_169","ExternalInputModal-tbody":"_ExternalInputModal-tbody_91ls0_176","ExternalInputModal--hasData":"_ExternalInputModal--hasData_91ls0_202","ExternalInputModal-loadingBanner":"_ExternalInputModal-loadingBanner_91ls0_206","ExternalInputModal--isLoading":"_ExternalInputModal--isLoading_91ls0_223","ExternalInputModal-searchForm":"_ExternalInputModal-searchForm_91ls0_227","ExternalInputModal-search":"_ExternalInputModal-search_91ls0_227","ExternalInputModal-searchIcon":"_ExternalInputModal-searchIcon_91ls0_264","ExternalInputModal-searchIconText":"_ExternalInputModal-searchIconText_91ls0_289","ExternalInputModal-searchInput":"_ExternalInputModal-searchInput_91ls0_299","ExternalInputModal-searchActions":"_ExternalInputModal-searchActions_91ls0_313","ExternalInputModal-searchActionIcon":"_ExternalInputModal-searchActionIcon_91ls0_326","ExternalInputModal-footerContainer":"_ExternalInputModal-footerContainer_91ls0_330","ExternalInputModal-footer":"_ExternalInputModal-footer_91ls0_330","ExternalInputModal-field":"_ExternalInputModal-field_91ls0_343"};P();P();var Y1={Modal:"_Modal_ikbaj_1","Modal--isOpen":"_Modal--isOpen_ikbaj_15","Modal-inner":"_Modal-inner_ikbaj_19"},gu=te("Modal",Y1),G1=({children:e,onClose:t,isOpen:n})=>{const[r,s]=h.useState(null);return h.useEffect(()=>{s(document.getElementById("puck-portal-root"))},[]),r?ys.createPortal(c.jsx("div",{className:gu({isOpen:n}),onClick:t,children:c.jsx("div",{className:gu("inner"),onClick:o=>o.stopPropagation(),children:e})}),r):c.jsx("div",{})};P();P();var K1={Heading:"_Heading_qxrry_1","Heading--xxxxl":"_Heading--xxxxl_qxrry_12","Heading--xxxl":"_Heading--xxxl_qxrry_18","Heading--xxl":"_Heading--xxl_qxrry_22","Heading--xl":"_Heading--xl_qxrry_26","Heading--l":"_Heading--l_qxrry_30","Heading--m":"_Heading--m_qxrry_34","Heading--s":"_Heading--s_qxrry_38","Heading--xs":"_Heading--xs_qxrry_42"},X1=te("Heading",K1),Fl=({children:e,rank:t,size:n="m"})=>{const r=t?`h${t}`:"span";return c.jsx(r,{className:X1({[n]:!0}),children:e})};P();var Us=te("ExternalInput",Rh),je=te("ExternalInputModal",Rh),xi={},J1=({field:e,onChange:t,value:n=null,name:r,id:s,readOnly:o})=>{var i;const{mapProp:a=D=>D,mapRow:l=D=>D,filterFields:u}=e||{},{enabled:d}=(i=e.cache)!=null?i:{enabled:!0},[f,p]=h.useState([]),[v,g]=h.useState(!1),[m,w]=h.useState(!0),S=!!u,[k,y]=h.useState(e.initialFilters||{}),[b,j]=h.useState(S),C=h.useMemo(()=>f.map(l),[f]),A=h.useMemo(()=>{const D=new Set;for(const L of C)for(const N of Object.keys(L))(typeof L[N]=="string"||typeof L[N]=="number"||h.isValidElement(L[N]))&&D.add(N);return Array.from(D)},[C]),[_,I]=h.useState(e.initialQuery||""),x=h.useCallback((D,L)=>Ee(null,null,function*(){w(!0);const N=`${s}-${D}-${JSON.stringify(L)}`;let F;d&&xi[N]?F=xi[N]:F=yield e.fetchList({query:D,filters:L}),F&&(p(F),w(!1),d&&(xi[N]=F))}),[s,e]),M=h.useCallback(D=>e.renderFooter?e.renderFooter(D):c.jsxs("span",{className:je("footer"),children:[D.items.length," result",D.items.length===1?"":"s"]}),[e.renderFooter]);return h.useEffect(()=>{x(_,k)},[]),c.jsxs("div",{className:Us({dataSelected:!!n,modalVisible:v,readOnly:o}),id:s,children:[c.jsxs("div",{className:Us("actions"),children:[c.jsx("button",{type:"button",onClick:()=>g(!0),className:Us("button"),disabled:o,children:n?e.getItemSummary?e.getItemSummary(n):"External item":c.jsxs(c.Fragment,{children:[c.jsx(Sd,{size:"16"}),c.jsx("span",{children:e.placeholder})]})}),n&&c.jsx("button",{type:"button",className:Us("detachButton"),onClick:()=>{t(null)},disabled:o,children:c.jsx(Sy,{size:16})})]}),c.jsx(G1,{onClose:()=>g(!1),isOpen:v,children:c.jsxs("form",{className:je({isLoading:m,loaded:!m,hasData:C.length>0,filtersToggled:b}),onSubmit:D=>{D.preventDefault(),D.stopPropagation(),x(_,k)},children:[c.jsx("div",{className:je("masthead"),children:e.showSearch?c.jsxs("div",{className:je("searchForm"),children:[c.jsxs("label",{className:je("search"),children:[c.jsx("span",{className:je("searchIconText"),children:"Search"}),c.jsx("div",{className:je("searchIcon"),children:c.jsx(Ty,{size:"18"})}),c.jsx("input",{className:je("searchInput"),name:"q",type:"search",placeholder:e.placeholder,onChange:D=>{I(D.currentTarget.value)},autoComplete:"off",value:_})]}),c.jsxs("div",{className:je("searchActions"),children:[c.jsx(fa,{type:"submit",loading:m,fullWidth:!0,children:"Search"}),S&&c.jsx("div",{className:je("searchActionIcon"),children:c.jsx(jt,{type:"button",title:"Toggle filters",onClick:D=>{D.preventDefault(),D.stopPropagation(),j(!b)},children:c.jsx(Ry,{size:20})})})]})]}):c.jsx(Fl,{rank:"2",size:"xs",children:e.placeholder||"Select data"})}),c.jsxs("div",{className:je("grid"),children:[S&&c.jsx("div",{className:je("filters"),children:S&&Object.keys(u).map(D=>{const L=u[D];return c.jsx("div",{className:je("field"),children:c.jsx(Ch,{label:L.label||D,children:c.jsx(fw,{field:L,id:`external_field_${D}_filter`,value:k[D],onChange:N=>{y(F=>{const B=z(O({},F),{[D]:N});return x(_,B),B})}})})},D)})}),c.jsxs("div",{className:je("tableWrapper"),children:[c.jsxs("table",{className:je("table"),children:[c.jsx("thead",{className:je("thead"),children:c.jsx("tr",{className:je("tr"),children:A.map(D=>c.jsx("th",{className:je("th"),style:{textAlign:"left"},children:D},D))})}),c.jsx("tbody",{className:je("tbody"),children:C.map((D,L)=>c.jsx("tr",{style:{whiteSpace:"nowrap"},className:je("tr"),onClick:()=>{t(a(f[L])),g(!1)},children:A.map(N=>c.jsx("td",{className:je("td"),children:D[N]},N))},L))})]}),c.jsx("div",{className:je("loadingBanner"),children:c.jsx(Mn,{size:24})})]})]}),c.jsx("div",{className:je("footerContainer"),children:c.jsx(M,{items:C})})]})})]})},Q1=({field:e,onChange:t,id:n,name:r=n,label:s,labelIcon:o,Label:i,readOnly:a})=>{var l,u,d;const f=Os(r),p=e,v=e;return h.useEffect(()=>{v.adaptor&&console.error("Warning: The `adaptor` API is deprecated. Please use updated APIs on the `external` field instead. This will be a breaking change in a future release.")},[]),e.type!=="external"?null:c.jsx(i,{label:s||r,icon:o||c.jsx(Sd,{size:16}),el:"div",children:c.jsx(J1,{name:r,field:z(O({},p),{placeholder:(l=v.adaptor)!=null&&l.name?`Select from ${v.adaptor.name}`:p.placeholder||"Select data",mapProp:((u=v.adaptor)==null?void 0:u.mapProp)||p.mapProp,mapRow:p.mapRow,fetchList:(d=v.adaptor)!=null&&d.fetchList?()=>Ee(null,null,function*(){return yield v.adaptor.fetchList(v.adaptorParams)}):p.fetchList}),onChange:t,value:f,id:n,readOnly:a})})};P();var qs=te("Input",Ln),ew=({field:e,onChange:t,readOnly:n,id:r,name:s=r,label:o,labelIcon:i,Label:a})=>{const l=Os(s);return e.type!=="radio"||!e.options?null:c.jsx(a,{icon:i||c.jsx(ly,{size:16}),label:o||s,readOnly:n,el:"div",children:c.jsx("div",{className:qs("radioGroupItems"),id:r,children:e.options.map(u=>{var d;return c.jsxs("label",{className:qs("radio"),children:[c.jsx("input",{type:"radio",className:qs("radioInput"),value:JSON.stringify({value:u.value}),name:s,onChange:f=>{t(JSON.parse(f.target.value).value)},disabled:n,checked:l===u.value}),c.jsx("div",{className:qs("radioInner"),children:u.label||((d=u.value)==null?void 0:d.toString())})]},u.label+u.value)})})})};P();var tw=te("Input",Ln),nw=({field:e,onChange:t,label:n,labelIcon:r,Label:s,id:o,name:i=o,readOnly:a})=>{const l=Os(i);return e.type!=="select"||!e.options?null:c.jsx(s,{label:n||i,icon:r||c.jsx(or,{size:16}),readOnly:a,children:c.jsx("select",{id:o,title:n||i,className:tw("input"),disabled:a,onChange:u=>{t(JSON.parse(u.target.value).value)},value:JSON.stringify({value:l}),children:e.options.map(u=>c.jsx("option",{label:u.label,value:JSON.stringify({value:u.value})},u.label+JSON.stringify(u.value)))})})};P();var rw=te("Input",Ln),sw=({field:e,onChange:t,readOnly:n,id:r,name:s=r,label:o,labelIcon:i,Label:a})=>{const[l,u]=Th(s,t);return c.jsx(a,{label:o||s,icon:i||c.jsx($o,{size:16}),readOnly:n,children:c.jsx("textarea",{id:r,className:rw("input"),autoComplete:"off",name:s,value:typeof l>"u"?"":l,onChange:d=>u(d.currentTarget.value),readOnly:n,tabIndex:n?-1:void 0,rows:5,placeholder:e.type==="textarea"?e.placeholder:void 0})})};P();P();var Bl=h.memo(e=>{var t;return c.jsx(Bd,z(O({},e),{editor:null,menu:c.jsx(Fd,{field:e.field,editor:null,editorState:null,readOnly:(t=e.readOnly)!=null?t:!1}),children:c.jsx("div",{className:"rich-text",dangerouslySetInnerHTML:{__html:e.content},contentEditable:!0})}))});Bl.displayName="EditorFallback";var ow=h.lazy(()=>gn(()=>import("./Editor-EPSED64A-5GXOZwWs.js"),__vite__mapDeps([10,9,4,2,3,1])).then(e=>({default:e.Editor}))),iw=({onChange:e,readOnly:t=!1,id:n,name:r=n,label:s,labelIcon:o,Label:i,field:a})=>{const l=Os(r),u={onChange:e,content:l,readOnly:t,field:a,id:n,name:r};return c.jsx(c.Fragment,{children:c.jsx(i,{label:s||r,icon:o||c.jsx($o,{size:16}),readOnly:t,el:"div",children:c.jsx(h.Suspense,{fallback:c.jsx(Bl,O({},u)),children:c.jsx(ow,O({},u))})})})};P();P();var aw={ObjectField:"_ObjectField_1ua3y_5","ObjectField-fieldset":"_ObjectField-fieldset_1ua3y_13"},vu=te("ObjectField",aw),lw=({field:e,onChange:t,id:n,name:r=n,label:s,labelIcon:o,Label:i,readOnly:a})=>{const{localName:l=r}=$l(),u=zl(),d=H(p=>p.permissions.getPermissions({item:p.selectedItem}).edit),f=()=>{var p;return(p=As(u.getState(),r))!=null?p:{}};return e.type!=="object"||!e.objectFields?null:c.jsx(i,{label:s||r,icon:o||c.jsx(dy,{size:16}),el:"div",readOnly:a,children:c.jsx("div",{className:vu(),children:c.jsx("fieldset",{className:vu("fieldset"),children:Object.keys(e.objectFields).map(p=>{const v=e.objectFields[p],g=`${l}.${p}`;return c.jsx(Dh,{id:`${n}_${p}`,name:r,subName:p,localName:l,field:v,forceReadOnly:!d,onChange:(m,w,S)=>{const k=f();k[S]!==m&&t(z(O({},k),{[S]:m}),w)}},g)})})})})};P();var Jo=()=>{if(typeof fo.useId<"u")return fo.useId();const[e]=h.useState(it());return e},cw=te("Input",Ln),uw=te("InputWrapper",Ln),Rt={array:U1,external:Q1,object:lw,select:nw,textarea:sw,radio:ew,text:hu,number:hu,richtext:iw};function Lh(e){var t;const n=H(C=>C.dispatch),r=H(C=>C.overrides),s=H(Ke(C=>{var A;return(A=C.selectedItem)==null?void 0:A.readOnly})),o=h.useContext(Mo),{id:i,Label:a=C1}=e,l=e.field,u=l.label,d=l.labelIcon,f=Jo(),p=i||f,v=h.useMemo(()=>{var C,A,_,I,x,M,D,L,N,F;return z(O({},r.fieldTypes),{custom:(C=r.fieldTypes)==null?void 0:C.custom,array:((A=r.fieldTypes)==null?void 0:A.array)||Rt.array,external:((_=r.fieldTypes)==null?void 0:_.external)||Rt.external,object:((I=r.fieldTypes)==null?void 0:I.object)||Rt.object,select:((x=r.fieldTypes)==null?void 0:x.select)||Rt.select,textarea:((M=r.fieldTypes)==null?void 0:M.textarea)||Rt.textarea,radio:((D=r.fieldTypes)==null?void 0:D.radio)||Rt.radio,text:((L=r.fieldTypes)==null?void 0:L.text)||Rt.text,number:((N=r.fieldTypes)==null?void 0:N.number)||Rt.number,richtext:((F=r.fieldTypes)==null?void 0:F.richtext)||Rt.richtext})},[r]),g=Xo(C=>{var A,_;if(l.type==="custom"||(A=r.fieldTypes)!=null&&A[l.type])return As(C,(_=e.name)!=null?_:p)}),m=h.useMemo(()=>z(O({},e),{field:l,label:u,labelIcon:d,Label:a,id:p,value:g}),[e,l,u,d,a,p,g]),w=h.useCallback(C=>{m.name&&(C.target.nodeName==="INPUT"||C.target.nodeName==="TEXTAREA")&&(C.stopPropagation(),n({type:"setUi",ui:{field:{focus:m.name}}}))},[m.name]),S=h.useCallback(C=>{"name"in C.target&&n({type:"setUi",ui:{field:{focus:null}}})},[]);let k=h.useMemo(()=>l.type!=="custom"&&l.type!=="slot"?Rt[l.type]:C=>null,[l.type]);const y=l.type==="custom"?l.key:void 0;let b=h.useMemo(()=>{if(l.type==="custom"&&!v[l.type])return l.render?l.render:null;if(l.type!=="slot")return v[l.type]},[l.type,y,v]);const{visible:j=!0}=e.field;if(!j||l.type==="slot")return null;if(!b)throw new Error(`Field type for ${l.type} did not exist.`);return c.jsx(Mo.Provider,{value:{readOnlyFields:o.readOnlyFields||s||{},localName:(t=o.localName)!=null?t:m.name},children:c.jsx("div",{className:uw(),onFocus:w,onBlur:S,onClick:C=>{C.stopPropagation()},children:c.jsx(b,z(O({},m),{children:c.jsx(k,O({},m))}))})})}function Nh(e){return c.jsx(Lh,O({},e))}function dw(e){var t=e,{value:n}=t,r=Kt(t,["value"]);const s=h.useMemo(()=>l=>c.jsx("div",z(O({},l),{className:cw({readOnly:r.readOnly})})),[r.readOnly]),o=zl(),i=h.useCallback(a=>{r.id&&(o.setState({[r.id]:a}),r.onChange(a))},[o,r.onChange,r.id]);return h.useEffect(()=>{r.id&&o.setState({[r.id]:n})},[r.id,n,o]),c.jsx(Lh,z(O({},r),{onChange:i,Label:s}))}function fw(e){const t=Jo();return e.field.type==="slot"?null:c.jsx(Ps.Provider,{value:{[t]:e.value},children:c.jsx(dw,z(O({},e),{id:t}))})}P();P();P();P();var pw={DraggableComponent:"_DraggableComponent_1vaqy_1","DraggableComponent-overlayWrapper":"_DraggableComponent-overlayWrapper_1vaqy_12","DraggableComponent-overlay":"_DraggableComponent-overlay_1vaqy_12","DraggableComponent-loadingOverlay":"_DraggableComponent-loadingOverlay_1vaqy_34","DraggableComponent--hover":"_DraggableComponent--hover_1vaqy_50","DraggableComponent--isSelected":"_DraggableComponent--isSelected_1vaqy_57","DraggableComponent-actionsOverlay":"_DraggableComponent-actionsOverlay_1vaqy_71","DraggableComponent-actions":"_DraggableComponent-actions_1vaqy_71"};P();function mu(e){let t={x:0,y:0},n=e;for(;n&&n!==document.documentElement;){const r=n.parentElement;r&&(t.x+=r.scrollLeft,t.y+=r.scrollTop),n=r}return t}P();var wr=h.createContext(null),nt=h.createContext(ur(()=>({zoneDepthIndex:{},nextZoneDepthIndex:{},areaDepthIndex:{},nextAreaDepthIndex:{},draggedItem:null,previewIndex:{},enabledIndex:{},hoveringComponent:null,registerRootVirtualizer:()=>{},unregisterRootVirtualizer:()=>{},scrollToComponent:()=>!1}))),hw=({children:e,store:t})=>c.jsx(nt.Provider,{value:t,children:e}),ms=({children:e,value:t})=>{const n=H(o=>o.dispatch),r=h.useCallback(o=>{n({type:"registerZone",zone:o})},[n]),s=h.useMemo(()=>O({registerZone:r},t),[t]);return c.jsx(c.Fragment,{children:s&&c.jsx(wr.Provider,{value:s,children:e})})};P();var zh=(e,t=[])=>{const n=Ae();return h.useCallback(()=>{let r=()=>{};const s=i=>{i?e(!1):(setTimeout(()=>{e(!0)},0),r&&r())},o=n.getState().state.ui.isDragging;return s(o),o&&(r=n.subscribe(i=>i.state.ui.isDragging,i=>{s(i)})),r},[n,...t])};P();function gw(e,t){typeof e=="function"?e(t):e&&typeof e=="object"&&"current"in e&&(e.current=t)}function ha(e,t){e.forEach(n=>{gw(n,t)})}var Wn=te("DraggableComponent",pw),vw=100,$h=8,mw=$h*6.5,yw=-44,yu=$h,bw=({label:e,children:t,parentAction:n})=>c.jsxs(pt,{children:[c.jsxs(pt.Group,{children:[n,e&&c.jsx(pt.Label,{label:e})]}),c.jsx(pt.Group,{children:t})]}),_w=({children:e})=>c.jsx(c.Fragment,{children:e}),xw=({children:e,depth:t,componentType:n,id:r,index:s,zoneCompound:o,isLoading:i=!1,isSelected:a=!1,debug:l,label:u,autoDragAxis:d,userDragAxis:f,inDroppableZone:p=!0,itemRef:v})=>{const g=H(G=>{var ce;return((ce=G.selectedItem)==null?void 0:ce.props.id)===r?G.zoomConfig.zoom:1}),m=H(G=>G._experimentalFullScreenCanvas),w=H(G=>G.overrides),S=H(G=>G.dispatch),k=H(G=>G.iframe),y=h.useRef(0),b=h.useContext(wr),[j,C]=h.useState({}),A=h.useCallback((G,ce)=>{var de;(de=b==null?void 0:b.registerLocalZone)==null||de.call(b,G,ce),C(Ce=>z(O({},Ce),{[G]:ce}))},[C]),_=h.useCallback(G=>{var ce;(ce=b==null?void 0:b.unregisterLocalZone)==null||ce.call(b,G),C(de=>{const Ce=O({},de);return delete Ce[G],Ce})},[C]),I=Object.values(j).filter(Boolean).length>0,x=H(Ke(G=>{var ce;return(ce=G.state.indexes.nodes[r])==null?void 0:ce.path})),M=H(Ke(G=>{const ce=xt({index:s,zone:o},G.state);return G.permissions.getPermissions({item:ce})})),D=h.useContext(nt),[L,N]=h.useState(f||d),F=h.useMemo(()=>Mh(L),[L]),{ref:B,isDragging:K,sortable:$}=yh({id:r,index:s,group:o,type:"component",data:{areaId:b==null?void 0:b.areaId,zone:o,index:s,componentType:n,containsActiveZone:I,depth:t,path:x||[],inDroppableZone:p},collisionPriority:t,collisionDetector:F,transition:{duration:200,easing:"cubic-bezier(0.2, 0, 0, 1)"},feedback:"clone"});h.useEffect(()=>{const G=D.getState().enabledIndex[o];$.droppable.disabled=!G,$.draggable.disabled=!M.drag;const ce=D.subscribe(de=>{$.droppable.disabled=!de.enabledIndex[o]});return Z.current&&!M.drag?(Z.current.setAttribute("data-puck-disabled",""),()=>{var de;(de=Z.current)==null||de.removeAttribute("data-puck-disabled"),ce()}):ce},[M.drag,o]);const[,U]=h.useState(0),Z=h.useRef(null),ne=h.useCallback(G=>{B(G),Z.current!==G&&(Z.current=G,U(ce=>ce+1),v&&ha([v],G))},[v,B]),[Y,se]=h.useState();h.useEffect(()=>{var G,ce,de;se(k.enabled?(G=Z.current)==null?void 0:G.ownerDocument.body:(de=(ce=Z.current)==null?void 0:ce.closest("[data-puck-preview]"))!=null?de:document.body)},[k.enabled]);const ve=h.useCallback(()=>{var G,ce;if(!Z.current)return;const de=Z.current,Ce=de.getBoundingClientRect(),rt=k.enabled?null:de.closest("[data-puck-preview]"),Tt=(()=>{let $n=de;for(;$n&&$n!==document.documentElement;){if(getComputedStyle($n).position==="fixed")return!0;$n=$n.parentElement}return!1})(),Wt=rt==null?void 0:rt.getBoundingClientRect(),kr=rt?mu(rt):{x:0,y:0},Ir=Tt?{x:0,y:0}:mu(de),nn=Tt?{x:0,y:0}:{x:Ir.x-kr.x-((G=Wt==null?void 0:Wt.left)!=null?G:0),y:Ir.y-kr.y-((ce=Wt==null?void 0:Wt.top)!=null?ce:0)};return{left:`${Ce.left+nn.x}px`,top:`${Ce.top+nn.y}px`,height:`${Ce.height}px`,width:`${Ce.width}px`,position:Tt?"fixed":void 0}},[k.enabled]),[ie,Oe]=h.useState(),Q=h.useRef(null),V=h.useRef(null),E=h.useCallback(()=>{Oe(ve()),v&&ha([v],Z.current)},[ve,v]),T=h.useCallback(()=>{V.current==null&&(V.current=requestAnimationFrame(()=>{V.current=null,E()}))},[E]);h.useEffect(()=>()=>{V.current!=null&&(cancelAnimationFrame(V.current),V.current=null)},[]),h.useEffect(()=>{if(Z.current){const G=new ResizeObserver(()=>{T()});return G.observe(Z.current),()=>{G.disconnect()}}},[T,v]);const R=H(G=>G.nodes.registerNode),W=H(G=>G.nodes.unregisterNode),q=h.useCallback(()=>{Vt(!1)},[]),X=h.useCallback(()=>{Vt(!0)},[]),oe=h.useRef({sync:()=>null,hideOverlay:()=>null,showOverlay:()=>null});h.useLayoutEffect(()=>{oe.current.sync=E,oe.current.hideOverlay=q,oe.current.showOverlay=X},[q,X,E]),h.useEffect(()=>(R(r,oe.current),()=>{W(r)}),[r,R,W]);const me=h.useMemo(()=>w.actionBar||bw,[w.actionBar]),ke=h.useMemo(()=>w.componentOverlay||_w,[w.componentOverlay]),we=h.useCallback(G=>{G.target.closest("[data-puck-overlay-portal]")||G.stopPropagation(),S(m?{type:"setUi",ui:{itemSelector:a?null:{index:s,zone:o}}}:{type:"setUi",ui:{itemSelector:{index:s,zone:o}}})},[s,o,r,a,m]),Me=Ae(),De=h.useCallback(()=>{const{nodes:G,zones:ce}=Me.getState().state.indexes,de=G[r],Ce=de!=null&&de.parentId?G[de==null?void 0:de.parentId]:null;if(!Ce||!de.parentId)return;const rt=`${Ce.parentId}:${Ce.zone}`,Tt=ce[rt].contentIds.indexOf(de.parentId);S({type:"setUi",ui:{itemSelector:{zone:rt,index:Tt}}})},[b,x]),Ie=h.useCallback(()=>{S({type:"duplicate",sourceIndex:s,sourceZone:o})},[s,o]),ye=h.useCallback(()=>{S({type:"remove",index:s,zone:o})},[s,o]),[Fe,gt]=h.useState(!1),en=Gt(nt,G=>G.hoveringComponent===r);h.useEffect(()=>{if(!Z.current)return;const G=Z.current,ce=Ce=>{const rt=!!D.getState().draggedItem;gt(rt?!!K:!0),Ce.stopPropagation()},de=Ce=>{Ce.stopPropagation(),gt(!1)};return G.setAttribute("data-puck-component",r),G.setAttribute("data-puck-dnd",r),G.style.position="relative",G.addEventListener("click",we),G.addEventListener("mouseover",ce),G.addEventListener("mouseout",de),()=>{G.removeAttribute("data-puck-component"),G.removeAttribute("data-puck-dnd"),G.removeEventListener("click",we),G.removeEventListener("mouseover",ce),G.removeEventListener("mouseout",de)}},[Z.current,we,I,o,r,K,p]);const[tn,Vt]=h.useState(!1),[le,_e]=h.useState(!0),[Le,Te]=h.useTransition();h.useEffect(()=>{Te(()=>{Fe||en||a?(T(),Vt(!0),J(!1)):Vt(!1)})},[Fe,en,a,k]);const[He,J]=h.useState(!1),re=zh(G=>{G?Te(()=>{E(),_e(!0)}):_e(!1)});h.useEffect(()=>{K&&J(!0)},[K]),h.useEffect(()=>{if(He)return re()},[He,re]),h.useEffect(()=>{if(!le||!(a||K))return;const G=Z.current;if(!G)return;const ce=G.ownerDocument,de=ce.defaultView;if(!de)return;y.current=0,T();const Ce=()=>T(),rt=()=>T();ce.addEventListener("scroll",Ce,!0),de.addEventListener("resize",rt);let Tt=0;const Wt=kr=>{if(kr-y.current>=vw){y.current=kr;const Ir=Z.current;if(Ir){const nn=Ir.getBoundingClientRect(),zn=Q.current;(!zn||Math.abs(nn.x-zn.x)>.5||Math.abs(nn.y-zn.y)>.5||Math.abs(nn.width-zn.width)>.5||Math.abs(nn.height-zn.height)>.5)&&(Q.current=nn,T())}}Tt=requestAnimationFrame(Wt)};return Tt=requestAnimationFrame(Wt),()=>{ce.removeEventListener("scroll",Ce,!0),de.removeEventListener("resize",rt),cancelAnimationFrame(Tt)}},[le,a,K,T]);const he=h.useCallback(G=>{if(G&&G.ownerDocument.defaultView){const de=G.getBoundingClientRect(),rt=de.x<0,Wt=de.y<0;rt&&(G.style.transformOrigin="left top",G.style.left="0px"),Wt&&(G.style.top="12px",rt||(G.style.transformOrigin="right top"))}},[g]);h.useEffect(()=>{if(f){N(f);return}if(Z.current){const G=window.getComputedStyle(Z.current);if(G.display==="inline"||G.display==="inline-block"){N("x");return}}N(d)},[Z,f,d]);const Ne=h.useMemo(()=>(b==null?void 0:b.areaId)&&(b==null?void 0:b.areaId)!=="root"&&c.jsx(pt.Action,{onClick:De,label:"Select parent",children:c.jsx(uy,{size:16})}),[b==null?void 0:b.areaId]),vt=h.useMemo(()=>z(O({},b),{areaId:r,zoneCompound:o,index:s,depth:t+1,registerLocalZone:A,unregisterLocalZone:_}),[b,r,o,s,t,A,_]),St=H(G=>{var ce;return((ce=G.currentRichText)==null?void 0:ce.inlineComponentId)===r?G.currentRichText:null}),Ms=M.duplicate||M.delete;return c.jsxs(ms,{value:vt,children:[le&&tn&&ys.createPortal(c.jsxs("div",{className:Wn({isSelected:a,isDragging:K,hover:Fe||en}),style:O({},ie),"data-puck-overlay":!0,children:[l,i&&c.jsx("div",{className:Wn("loadingOverlay"),children:c.jsx(Mn,{})}),c.jsx("div",{className:Wn("actionsOverlay"),style:{top:mw/g},children:c.jsx("div",{className:Wn("actions"),style:{transform:`scale(${1/g}`,top:yw/g,right:0,paddingLeft:yu,paddingRight:yu},ref:he,children:c.jsxs(me,{parentAction:Ne,label:u,children:[St&&c.jsxs(c.Fragment,{children:[c.jsx(Hb,{editor:St.editor,field:St.field,inline:!0,readOnly:!1}),Ms&&c.jsx(pt.Separator,{})]}),M.duplicate&&c.jsx(pt.Action,{onClick:Ie,label:"Duplicate",children:c.jsx(xd,{size:16})}),M.delete&&c.jsx(pt.Action,{onClick:ye,label:"Delete",children:c.jsx(Ed,{size:16})})]})})}),c.jsx("div",{className:Wn("overlayWrapper"),children:c.jsx(ke,{componentId:r,componentType:n,hover:Fe,isSelected:a,children:c.jsx("div",{className:Wn("overlay")})})})]}),Y||document.body),e(ne)]})};P();var ww={DropZone:"_DropZone_1i2sv_1","DropZone--hasChildren":"_DropZone--hasChildren_1i2sv_11","DropZone--isAreaSelected":"_DropZone--isAreaSelected_1i2sv_24","DropZone--hoveringOverArea":"_DropZone--hoveringOverArea_1i2sv_25","DropZone--isRootZone":"_DropZone--isRootZone_1i2sv_25","DropZone--isDestination":"_DropZone--isDestination_1i2sv_35","DropZone-item":"_DropZone-item_1i2sv_47","DropZone-hitbox":"_DropZone-hitbox_1i2sv_51","DropZone--isEnabled":"_DropZone--isEnabled_1i2sv_59","DropZone--isAnimating":"_DropZone--isAnimating_1i2sv_68"};P();P();var Fh={Drawer:"_Drawer_pl7z0_1","Drawer-draggable":"_Drawer-draggable_pl7z0_8","Drawer-draggableBg":"_Drawer-draggableBg_pl7z0_12","DrawerItem-draggable":"_DrawerItem-draggable_pl7z0_22","DrawerItem--disabled":"_DrawerItem--disabled_pl7z0_35",DrawerItem:"_DrawerItem_pl7z0_22","Drawer--isDraggingFrom":"_Drawer--isDraggingFrom_pl7z0_45","DrawerItem-name":"_DrawerItem-name_pl7z0_63"};P();P();P();function Sw(e,t){const n=setTimeout(e,t);return()=>clearTimeout(n)}function kw(e,t){const n=()=>performance.now();let r,s=0;return function(...o){const i=n(),a=this;i-s>=t?(e.apply(a,o),s=i):(r==null||r(),r=Sw(()=>{e.apply(a,o),s=n()},t-(i-s)))}}P();var Pn=()=>{if(typeof window>"u")return;let e=document.querySelector("#preview-frame");return(e==null?void 0:e.tagName)==="IFRAME"?e.contentDocument||document:(e==null?void 0:e.ownerDocument)||document};P();var Iw=class{constructor(e,t){this.scaleFactor=1,this.frameEl=null,this.frameRect=null;var n;this.target=e,this.original=t,this.frameEl=document.querySelector("iframe#preview-frame"),this.frameEl&&(this.frameRect=this.frameEl.getBoundingClientRect(),this.scaleFactor=this.frameRect.width/(((n=this.frameEl.contentWindow)==null?void 0:n.innerWidth)||1))}get x(){return this.original.x}get y(){return this.original.y}get global(){return document!==this.target.ownerDocument&&this.frameRect?{x:this.x*this.scaleFactor+this.frameRect.left,y:this.y*this.scaleFactor+this.frameRect.top}:this.original}get frame(){return document===this.target.ownerDocument&&this.frameRect?{x:(this.x-this.frameRect.left)/this.scaleFactor,y:(this.y-this.frameRect.top)/this.scaleFactor}:this.original}};P();var Ew=typeof PointerEvent<"u"?PointerEvent:Event,Bh=class extends Ew{constructor(e,t){super(e,t),this._originalTarget=null,this.originalTarget=t.originalTarget}set originalTarget(e){this._originalTarget=e}get originalTarget(){return this._originalTarget}},Cw=e=>e.sort((t,n)=>{const r=t.data,s=n.data;return r.depth>s.depth?1:s.depth>r.depth?-1:0}),jw=e=>{let t=e==null?void 0:e.id;if(!e)return null;if(e.type==="component"){const n=e.data;n.containsActiveZone?t=null:t=n.zone}else if(e.type==="void")return"void";return t},Zs=6,Pw=(e,t)=>{const n=[];let r=e.target.ownerDocument.elementsFromPoint(e.x,e.y);const s=r.find(i=>i.getAttribute("data-puck-preview")),o=r.find(i=>i.getAttribute("data-puck-drawer"));if(o&&(r=[o]),s){const i=Pn();i&&(r=i.elementsFromPoint(e.frame.x,e.frame.y))}if(r)for(let i=0;i<r.length;i++){const a=r[i],l=a.getAttribute("data-puck-dropzone"),u=a.getAttribute("data-puck-dnd"),d=a.hasAttribute("data-puck-dnd-void");if((l||u)&&!d){const f=a.getBoundingClientRect(),p={left:f.left+Zs,right:f.right-Zs,top:f.top+Zs,bottom:f.bottom-Zs};if(e.frame.x<p.left||e.frame.x>p.right||e.frame.y>p.bottom||e.frame.y<p.top)continue}if(l){const f=t.registry.droppables.get(l);f&&n.push(f)}if(u){const f=t.registry.droppables.get(u);f&&n.push(f)}}return n},Aw=(e,t)=>{var n;const r=Pw(e,t);if(r.length>0){const s=Cw(r),o=t.dragOperation.source,i=s.findIndex(g=>g.id===(o==null?void 0:o.id)),a=o==null?void 0:o.id;let l=[...s];a&&i>-1&&l.splice(i,1),l=l.filter(g=>{const m=g.data;if(a&&i>-1&&m.path.indexOf(a)>-1)return!1;if(g.type==="dropzone"){const w=g.data;if(!w.isDroppableTarget||w.areaId===a)return!1}else if(g.type==="component"&&!g.data.inDroppableZone)return!1;return!0}),l.reverse();const u=l[0];if(!u)return{zone:null,area:null};const d=u.data,f="containsActiveZone"in d,p=jw(u),v=f&&d.containsActiveZone?l[0].id:(n=l[0])==null?void 0:n.data.areaId;return{zone:p,area:v}}return{zone:Ge,area:ts}},Ow=({onChange:e},t)=>class extends Je{constructor(r,s){super(r),!(typeof window>"u")&&this.registerEffect(()=>{const i=kw(u=>{const d=u instanceof Bh&&u.originalTarget||u.target,f=new Iw(d,{x:u.clientX,y:u.clientY});document.elementsFromPoint(f.global.x,f.global.y).some(g=>g.id===t)&&e(Aw(f,r),r)},50),a=u=>{i(u)};return document.body.addEventListener("pointermove",a,{capture:!0}),()=>{document.body.removeEventListener("pointermove",a,{capture:!0})}})}};P();P();var Nn=(e,t)=>{const n=e.indexes.nodes[t];if(!n)return;const r=`${n.parentId}:${n.zone}`,s=e.indexes.zones[r].contentIds.indexOf(t);return{zone:r,index:s}},Mw=(e,t,n,r)=>Ee(null,null,function*(){const{getState:s}=r,o=it(e),i={type:"insert",componentType:e,destinationIndex:n,destinationZone:t,id:o},a=s().state,l=fd(a,i,s()),u=s().dispatch;u(z(O({},i),{recordHistory:!0}));const d={index:n,zone:t};u({type:"setUi",ui:{itemSelector:d}});const f=xt(d,l);if(!f)return;const p=s().resolveComponentData,v=yield p(f,"insert");if(!v.didChange)return;const g=Nn(s().state,o);g&&u({type:"replace",destinationZone:g.zone,destinationIndex:g.index,data:v.node})});P();var Dw=(e,t,n,r)=>Ee(null,null,function*(){var s,o,i,a;const l=r.getState().dispatch;l({type:"move",sourceIndex:t.index,sourceZone:(s=t.zone)!=null?s:Ge,destinationIndex:n.index,destinationZone:(o=n.zone)!=null?o:Ge,recordHistory:!1});const u=(i=r.getState().state.indexes.nodes[e])==null?void 0:i.data;if(!u)return;const d=r.getState().resolveComponentData,f=yield d(u,"move"),p=Nn(r.getState().state,u.props.id);p&&f.didChange&&l({type:"replace",data:f.node,destinationIndex:p.index,destinationZone:(a=p.zone)!=null?a:Ge})});P();function Tw(e){function t(n){return n?n.getAttribute("dir")||t(n.parentElement):"ltr"}return e?t(e):"ltr"}var Hh=h.createContext({dragListeners:{}});function Rw(e,t,n=[]){const{setDragListeners:r}=h.useContext(Hh);h.useEffect(()=>{r&&r(s=>z(O({},s),{[e]:[...s[e]||[],t]}))},n)}var Lw=100,Nw=e=>{const t=h.useRef(null);return h.useCallback(n=>{pa.setState({fallbackEnabled:!1});const r=it();t.current=r,setTimeout(()=>{t.current===r&&(pa.setState({fallbackEnabled:!0}),n.collisionObserver.forceUpdate(!0))},e)},[])},zw=({children:e,disableAutoScroll:t})=>{const n=H(y=>y.dispatch),r=H(y=>y.instanceId),s=Ae(),o=h.useRef(null),i=Nw(100),[a]=h.useState(()=>{const y=new Map;return ur(()=>({zoneDepthIndex:{},nextZoneDepthIndex:{},areaDepthIndex:{},nextAreaDepthIndex:{},draggedItem:null,previewIndex:{},enabledIndex:{},hoveringComponent:null,registerRootVirtualizer:(b,j)=>{y.set(b,j)},unregisterRootVirtualizer:b=>{y.delete(b)},scrollToComponent:b=>{const j=Array.from(y.values());if(j.length>0)for(const C of j){const A=C.resolveIndex(b);A<0||C.virtualizer.scrollToIndex(A,{behavior:"auto",align:"auto"})}else{const C=Pn(),A=C==null?void 0:C.querySelector(`[data-puck-component="${b}"]`);A==null||A.scrollIntoView({behavior:"smooth"})}}}))}),l=h.useCallback(y=>{const{zoneDepthIndex:b={},areaDepthIndex:j={}}=a.getState()||{},C=Object.keys(b).length>0,A=Object.keys(j).length>0;let _=!1,I=!1;return(y.zone&&!b[y.zone]||!y.zone&&C)&&(_=!0),(y.area&&!j[y.area]||!y.area&&A)&&(I=!0),{zoneChanged:_,areaChanged:I}},[a]),u=h.useCallback((y,b)=>{const{zoneChanged:j,areaChanged:C}=l(y);!j&&!C||(a.setState({zoneDepthIndex:y.zone?{[y.zone]:!0}:{},areaDepthIndex:y.area?{[y.area]:!0}:{}}),i(b),setTimeout(()=>{b.collisionObserver.forceUpdate(!0)},50),o.current=null)},[a]),d=bh(u,Lw),f=()=>{d.cancel(),o.current=null};h.useEffect(()=>{},[]);const[p]=h.useState(()=>[...t?jn.plugins.filter(y=>y!==Il):jn.plugins,Ow({onChange:(y,b)=>{const j=a.getState(),{zoneChanged:C,areaChanged:A}=l(y),_=b.dragOperation.status.dragging;if(A||C){let I={},x={};y.zone&&(I={[y.zone]:!0}),y.area&&(x={[y.area]:!0}),a.setState({nextZoneDepthIndex:I,nextAreaDepthIndex:x})}if(y.zone!=="void"&&(j!=null&&j.zoneDepthIndex.void)){u(y,b);return}if(A){if(_){const I=o.current;I&&I.area===y.area&&I.zone===y.zone||(f(),d(y,b),o.current=y)}else f(),u(y,b);return}C&&u(y,b),f()}},r)]),v=Ah(),[g,m]=h.useState({}),w=h.useRef(null),S=h.useRef(void 0),k=h.useMemo(()=>({mode:"edit",areaId:"root",depth:0}),[]);return c.jsx(Hh.Provider,{value:{dragListeners:g,setDragListeners:m},children:c.jsx(Kp,{plugins:p,sensors:v,onDragEnd:(y,b)=>{var j,C;const A=(j=Pn())==null?void 0:j.querySelector("[data-puck-entry]");A==null||A.removeAttribute("data-puck-dragging");const{source:_,target:I}=y.operation;if(!_){a.setState({draggedItem:null});return}const{zone:x,index:M}=_.data,{previewIndex:D={}}=a.getState()||{},L=((C=D[x])==null?void 0:C.props.id)===_.id?D[x]:null,N=()=>{var B,K;if(a.setState({draggedItem:null}),y.canceled||(I==null?void 0:I.type)==="void"){a.setState({previewIndex:{}}),(B=g.dragend)==null||B.forEach($=>{$(y,b)}),n({type:"setUi",ui:{itemSelector:null,isDragging:!1}});return}L&&(a.setState({previewIndex:{}}),L.type==="insert"?Mw(L.componentType,L.zone,L.index,s):S.current&&Dw(L.props.id,S.current,L,s)),n({type:"setUi",ui:{itemSelector:{index:M,zone:x},isDragging:!1},recordHistory:!1}),(K=g.dragend)==null||K.forEach($=>{$(y,b)})};let F;F=dt(()=>{_.status==="idle"&&(N(),F==null||F())})},onDragOver:(y,b)=>{var j,C,A,_;if(y.preventDefault(),!((j=a.getState())==null?void 0:j.draggedItem))return;f();const{source:x,target:M}=y.operation;if(!M||!x||M.type==="void")return;const[D]=x.id.split(":"),[L]=M.id.split(":"),N=x.data;let F=N.zone,B=N.index,K="",$=0;if(M.type==="component"){const Z=M.data;K=Z.zone,$=Z.index;const ne=(C=b.collisionObserver.collisions[0])==null?void 0:C.data,Y=Tw(M.element),se=(ne==null?void 0:ne.direction)==="up"||Y==="ltr"&&(ne==null?void 0:ne.direction)==="left"||Y==="rtl"&&(ne==null?void 0:ne.direction)==="right"?"before":"after";$>=B&&F===K&&($=$-1),se==="after"&&($=$+1)}else K=M.id.toString(),$=0;const U=((A=s.getState().state.indexes.nodes[M.id])==null?void 0:A.path)||[];if(!(L===D||U.find(Z=>{const[ne]=Z.split(":");return ne===D}))){if(w.current==="new")a.setState({previewIndex:{[K]:{componentType:N.componentType,type:"insert",index:$,zone:K,element:x.element,props:{id:x.id.toString()}}}});else{S.current||(S.current={zone:N.zone,index:N.index});const Z=xt(S.current,s.getState().state);Z&&a.setState({previewIndex:{[K]:{componentType:N.componentType,type:"move",index:$,zone:K,props:Z.props,element:x.element}}})}(_=g.dragover)==null||_.forEach(Z=>{Z(y,b)})}},onDragStart:(y,b)=>{var j;const{source:C}=y.operation;if(C&&C.type!=="void"){const A=C.data,_=xt({zone:A.zone,index:A.index},s.getState().state);_&&a.setState({previewIndex:{[A.zone]:{componentType:A.componentType,type:"move",index:A.index,zone:A.zone,props:_.props,element:C.element}}})}(j=g.dragstart)==null||j.forEach(A=>{A(y,b)})},onBeforeDragStart:y=>{var b,j,C,A;const _=((b=y.operation.source)==null?void 0:b.type)==="drawer";w.current=_?"new":"existing",S.current=void 0,a.setState({draggedItem:y.operation.source}),((j=s.getState().selectedItem)==null?void 0:j.props.id)!==((C=y.operation.source)==null?void 0:C.id)?n({type:"setUi",ui:{itemSelector:null,isDragging:!0},recordHistory:!1}):n({type:"setUi",ui:{isDragging:!0},recordHistory:!1});const I=(A=Pn())==null?void 0:A.querySelector("[data-puck-entry]");I==null||I.setAttribute("data-puck-dragging","true")},children:c.jsx(hw,{store:a,children:c.jsx(ms,{value:k,children:e})})})})},$w=({children:e,disableAutoScroll:t})=>H(r=>r.status)==="LOADING"?e:c.jsx(zw,{disableAutoScroll:t,children:e}),lo=te("Drawer",Fh),Un=te("DrawerItem",Fh),ga=({children:e,name:t,label:n,dragRef:r,isDragDisabled:s})=>{const o=h.useMemo(()=>e||(({children:i})=>c.jsx("div",{className:Un("default"),children:i})),[e]);return c.jsx("div",{className:Un({disabled:s}),ref:r,onMouseDown:i=>i.preventDefault(),"data-testid":r?`drawer-item:${t}`:"","data-puck-drawer-item":!0,children:c.jsx(o,{name:t,children:c.jsx("div",{className:Un("draggableWrapper"),children:c.jsxs("div",{className:Un("draggable"),children:[c.jsx("div",{className:Un("name"),children:n??t}),c.jsx("div",{className:Un("icon"),children:c.jsx(Ph,{})})]})})})})},Fw=({children:e,name:t,label:n,id:r,isDragDisabled:s})=>{const{ref:o}=_0({id:r,data:{componentType:t},disabled:s,type:"drawer"});return c.jsxs("div",{className:lo("draggable"),children:[c.jsx("div",{className:lo("draggableBg"),children:c.jsx(ga,{name:t,label:n,children:e})}),c.jsx("div",{className:lo("draggableFg"),children:c.jsx(ga,{name:t,label:n,dragRef:o,isDragDisabled:s,children:e})})]})},Bw=({name:e,children:t,id:n,label:r,index:s,isDragDisabled:o})=>{const i=n||e,[a,l]=h.useState(it(i));return typeof s<"u"&&console.error("Warning: The `index` prop on Drawer.Item is deprecated and no longer required."),Rw("dragend",()=>{l(it(i))},[i]),c.jsx("div",{children:c.jsx(Fw,{name:e,label:r,id:a,isDragDisabled:o,children:t})},a)},Hl=({children:e,droppableId:t,direction:n})=>{t&&console.error("Warning: The `droppableId` prop on Drawer is deprecated and no longer required."),n&&console.error("Warning: The `direction` prop on Drawer is deprecated and no longer required to achieve multi-directional dragging.");const r=Jo(),{ref:s}=ah({id:r,type:"void",collisionPriority:0});return c.jsx("div",{className:lo(),ref:s,"data-puck-dnd":r,"data-puck-drawer":!0,"data-puck-dnd-void":!0,children:e})};Hl.Item=Bw;P();var bu=(e,t)=>e.getState().state.indexes.zones[t].contentIds.length,Hw=({zoneCompound:e,userMinEmptyHeight:t,ref:n})=>{const r=Ae(),[s,o]=h.useState(0),[i,a]=h.useState(!1),{draggedItem:l,isZone:u}=Gt(nt,v=>{var g,m;return{draggedItem:((g=v.draggedItem)==null?void 0:g.data.zone)===e?v.draggedItem:null,isZone:((m=v.draggedItem)==null?void 0:m.data.zone)===e}}),d=h.useRef(0),f=zh(v=>{if(v){const g=bu(r,e);if(o(0),g||d.current===0){a(!1);return}const m=r.getState().selectedItem,w=r.getState().state.indexes.zones,S=r.getState().nodes;S.setOverlayVisible(m==null?void 0:m.props.id,!1),setTimeout(()=>{var k;const y=((k=w[e])==null?void 0:k.contentIds)||[];S.syncNodes(y),m&&setTimeout(()=>{S.syncNode(m.props.id),S.setOverlayVisible(m.props.id,!0)},200),a(!1)},100)}},[r,s,e]);h.useEffect(()=>{if(l&&n.current&&u){const v=n.current.getBoundingClientRect();return d.current=bu(r,e),o(v.height),a(!0),f()}},[n.current,l,f]);const p=isNaN(Number(t))?t:`${t}px`;return[s?`${s}px`:p,i]};P();P();function Vw(e,t){const n=Xp();return h.useCallback((...r)=>Ee(null,null,function*(){return yield n==null?void 0:n.renderer.rendering,e(...r)}),[...t,n])}var Ww=(e,t)=>{const n=h.useContext(nt),r=Gt(nt,d=>d.previewIndex[t]),s=H(d=>d.state.ui.isDragging),[o,i]=h.useState(e),[a,l]=h.useState(r),u=Vw((d,f,p,v,g)=>{p&&!g||(f?f.type==="insert"?i(sr(d.filter(m=>m!==f.props.id),f.index,f.props.id)):i(sr(d.filter(m=>m!==f.props.id),f.index,f.props.id)):i(g?d.filter(m=>m!==v):d),l(f))},[]);return h.useEffect(()=>{var d;const f=n.getState(),p=(d=f.draggedItem)==null?void 0:d.id,v=Object.keys(f.previewIndex||{}).length>0;u(e,r,s,p,v)},[e,r,s]),[o,a]};P();var Uw="dynamic",qw="x",_u="y",Zw=(e,t)=>{const n=H(i=>i.status),[r,s]=h.useState(t||_u),o=h.useCallback(()=>{if(e.current){const i=window.getComputedStyle(e.current);i.display==="grid"?s(Uw):i.display==="flex"&&i.flexDirection==="row"?s(qw):s(_u)}},[e.current]);return h.useEffect(()=>{const i=()=>{o()};return window.addEventListener("viewportchange",i),()=>{window.removeEventListener("viewportchange",i)}},[]),h.useEffect(o,[n,t]),[r,o]};P();var Yw=({componentId:e,zone:t})=>{const n=H(o=>o.config),r=H(o=>o.metadata),s=H(Ke(o=>{var i,a;const l=o.state.indexes;return((a=(i=l.zones[`${e}:${t}`])==null?void 0:i.contentIds)!=null?a:[]).map(d=>l.nodes[d].flatData)}));return c.jsx(Na,{content:s,zone:t,config:n,metadata:r})};P();function Gw(e,t,n,r,s){const o=h.useRef(null),i=h.useRef(t.props),a=h.useMemo(()=>Vd(n,r,s),[n,r,s]),l=h.useMemo(()=>{var d,f,p;const v={},g=t.type==="root"?e.root:(d=e.components)==null?void 0:d[t.type];let m=!1;for(const S in t.props){const k=(p=(f=g==null?void 0:g.fields)==null?void 0:f[S])==null?void 0:p.type;(!o.current||t.props[S]!==o.current[S])&&(v[S]=t.props[S],k==="slot"&&(m=!0))}v.id=t.props.id,o.current=t.props;const w=dr(z(O({},t),{props:v}),a,e,!1,m).props;return i.current=O(O({},i.current),w),i.current},[e,t,a]);return h.useMemo(()=>O(O({},t.props),l),[t.props,l])}P();P();P();var Vh=(e,t={})=>{if(!e)return;const{disableDrag:n=!1,disableDragOnFocus:r=!0}=t,s=a=>{a.stopPropagation()};e.addEventListener("mouseover",s,{capture:!0});const o=()=>{setTimeout(()=>{e.addEventListener("pointerdown",s,{capture:!0})},200)},i=()=>{e.removeEventListener("pointerdown",s,{capture:!0})};return n?e.addEventListener("pointerdown",s,{capture:!0}):r&&(e.addEventListener("focus",o,{capture:!0}),e.addEventListener("blur",i,{capture:!0})),e.setAttribute("data-puck-overlay-portal","true"),()=>{e.removeEventListener("mouseover",s,{capture:!0}),n?e.removeEventListener("pointerdown",s,{capture:!0}):r&&(e.removeEventListener("focus",o,{capture:!0}),e.removeEventListener("blur",i,{capture:!0})),e.removeAttribute("data-puck-overlay-portal")}};P();var Kw={InlineTextField:"_InlineTextField_104qp_1"},Xw=te("InlineTextField",Kw),Jw=({propPath:e,componentId:t,value:n,isReadOnly:r,opts:s={}})=>{var o;const i=h.useRef(null),a=Ae(),l=(o=s.disableLineBreaks)!=null?o:!1;h.useEffect(()=>{const v=a.getState(),g=v.state.indexes.nodes[t].data;if(!v.getComponentConfig(g.type))throw new Error(`InlineTextField Error: No config defined for ${g.type}`);if(i.current){n!==i.current.innerText&&i.current.replaceChildren(n);const w=Vh(i.current),S=k=>Ee(null,null,function*(){var y;const b=a.getState(),j=b.state.indexes.nodes[t],C=`${j.parentId}:${j.zone}`,A=(y=b.state.indexes.zones[C])==null?void 0:y.contentIds.indexOf(t);let _=k.target.innerText;l&&(_=_.replaceAll(/\n/gm,""));const I=Nl(j.data.props,e,_),x=yield b.resolveComponentData(z(O({},j.data),{props:I}),"replace");b.dispatch({type:"replace",data:x.node,destinationIndex:A,destinationZone:C})});return i.current.addEventListener("input",S),()=>{var k;(k=i.current)==null||k.removeEventListener("input",S),w==null||w()}}},[a,i.current,n,l]);const[u,d]=h.useState(!1),[f,p]=h.useState(!1);return c.jsx("span",{className:Xw(),ref:i,contentEditable:u||f?"plaintext-only":"false",onClick:v=>{v.preventDefault(),v.stopPropagation()},onClickCapture:v=>{v.preventDefault(),v.stopPropagation();const g=Nn(a.getState().state,t);a.getState().setUi({itemSelector:g})},onKeyDown:v=>{v.stopPropagation(),(l&&v.key==="Enter"||r)&&v.preventDefault()},onKeyUp:v=>{v.stopPropagation(),v.preventDefault()},onMouseOverCapture:()=>d(!0),onMouseOutCapture:()=>d(!1),onFocus:()=>p(!0),onBlur:()=>p(!1)})},wi=h.memo(Jw),Qw=()=>({text:({value:e,componentId:t,field:n,propPath:r,isReadOnly:s})=>n.contentEditable?c.jsx(wi,{propPath:r,componentId:t,value:e,opts:{disableLineBreaks:!0},isReadOnly:s}):e,textarea:({value:e,componentId:t,field:n,propPath:r,isReadOnly:s})=>n.contentEditable?c.jsx(wi,{propPath:r,componentId:t,value:e,isReadOnly:s}):e,custom:({value:e,componentId:t,field:n,propPath:r,isReadOnly:s})=>n.contentEditable&&typeof e=="string"?c.jsx(wi,{propPath:r,componentId:t,value:e,isReadOnly:s}):e});P();var eS=h.lazy(()=>gn(()=>import("./Editor-EPSED64A-5GXOZwWs.js"),__vite__mapDeps([10,9,4,2,3,1])).then(e=>({default:e.Editor}))),Wh=h.lazy(()=>gn(()=>import("./Render-CU35UAWV-C1VtWmg6.js"),__vite__mapDeps([8,9,4,2,3])).then(e=>({default:e.RichTextRender}))),Uh=h.memo(({value:e,componentId:t,propPath:n,field:r,id:s})=>{const o=h.useRef(null),i=Ae(),a=p=>{p.preventDefault(),p.stopPropagation()},l=p=>{p.preventDefault(),p.stopPropagation();const v=Nn(i.getState().state,t);i.getState().setUi({itemSelector:v})};h.useEffect(()=>{if(!o.current)return;const p=Vh(o.current,{disableDragOnFocus:!0});return()=>p==null?void 0:p()},[o.current]);const u=h.useCallback((p,v)=>Ee(null,null,function*(){var g;const m=i.getState(),w=m.state.indexes.nodes[t],S=`${w.parentId}:${w.zone}`,k=(g=m.state.indexes.zones[S])==null?void 0:g.contentIds.indexOf(t),y=Nl(w.data.props,n,p),b=yield m.resolveComponentData(z(O({},w.data),{props:y}),"replace");m.dispatch({type:"replace",data:b.node,destinationIndex:k,destinationZone:S,ui:v})}),[i,t,n]),d=h.useCallback(p=>{i.setState({currentRichText:{inlineComponentId:t,inline:!0,field:r,editor:p,id:s}})},[r,t]);if(!r.contentEditable)return c.jsx(h.Suspense,{fallback:c.jsx(Wd,{content:e}),children:c.jsx(Wh,{content:e,field:r})});const f={content:e,onChange:u,field:r,inline:!0,onFocus:d,id:s,name:n};return c.jsx("div",{ref:o,onClick:a,onClickCapture:l,children:c.jsx(h.Suspense,{fallback:c.jsx(Bl,O({},f)),children:c.jsx(eS,O({},f))})})});Uh.displayName="InlineEditorWrapper";var tS=()=>({richtext:({value:e,componentId:t,field:n,propPath:r,isReadOnly:s})=>{const{contentEditable:o=!0,tiptap:i}=n;if(o===!1||s)return c.jsx(Wh,{content:e,field:n});const a=`${t}_${n.type}_${r}`;return c.jsx(Uh,{value:e,componentId:t,propPath:r,field:n,id:a},a)}});P();P();function nS(e,t,n=[]){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;const r=new Set(n),s=Object.keys(e).filter(i=>!r.has(i)),o=Object.keys(t).filter(i=>!r.has(i));if(s.length!==o.length)return!1;for(let i=0;i<s.length;i++){const a=s[i];if(!Object.prototype.hasOwnProperty.call(t,a))return!1;const l=e[a],u=t[a];if(!Object.is(l,u))return!1}return!0}var rS=({Component:e,componentProps:t})=>c.jsx(e,O({},t)),xu=h.memo(rS,(e,t)=>{let n=!0;return"puck"in e.componentProps&&"puck"in t.componentProps&&(n=ss(e.componentProps.puck,t.componentProps.puck)),e.Component===t.Component&&nS(e.componentProps,t.componentProps,["puck"])&&n});P();var sS=5,qh=320,Zh=new Map,oS=e=>{var t;return(t=Zh.get(e))!=null?t:qh},iS=(e,t)=>{t<=0||Zh.set(e,t)},aS=({contentIds:e,zoneCompound:t,renderItem:n})=>{const r=H(y=>{var b,j;return(j=(b=y.selectedItem)==null?void 0:b.props.id)!=null?j:null}),s=Pn(),o=h.useContext(nt),i=Gt(nt,y=>{var b;const j=(b=y.draggedItem)==null?void 0:b.id;return j?String(j):null}),a=Gt(nt,y=>{var b,j;if((b=y.draggedItem)!=null&&b.id){const C=Object.keys((j=y.previewIndex)!=null?j:{})[0];return C==null?void 0:C.split(":")[0]}return null}),l=s==null?void 0:s.defaultView,u=h.useRef(new Map),d=Ae(),f=h.useCallback(y=>{var b,j,C,A;if(!y||y==="root")return-1;const _=e.indexOf(y);if(_>-1)return _;const I=(C=(j=(b=d.getState().state.indexes.nodes)==null?void 0:b[y])==null?void 0:j.path)!=null?C:[];for(let x=I.length-1;x>=0;x-=1){const M=(A=I[x])==null?void 0:A.split(":")[0];if(!M||M==="root")continue;const D=e.indexOf(M);if(D>-1)return D}return-1},[d,e]),p=h.useMemo(()=>{const y=new Set;return[r,i,a].forEach(b=>{const j=f(b);j>-1&&y.add(j)}),Array.from(y).sort((b,j)=>b-j)},[a,i,f,r]),v=h.useCallback(y=>{const b=xh(y);return p.forEach(j=>{b.includes(j)||b.push(j)}),b.sort((j,C)=>j-C),b},[p]),g=Eh({count:e.length,getItemKey:y=>e[y],estimateSize:y=>oS(e[y]),getScrollElement:()=>l??null,overscan:sS,observeElementRect:(y,b)=>l?g1(y,b):wh(y,b),observeElementOffset:(y,b)=>l?v1(y,b):Sh(y,b),scrollToFn:(y,b,j)=>l?y1(y,b,j):kh(y,b,j),rangeExtractor:v,initialOffset:()=>l?l.scrollY:0});h.useEffect(()=>(o.getState().registerRootVirtualizer(t,{resolveIndex:y=>f(y),virtualizer:g}),()=>{o.getState().unregisterRootVirtualizer(t)}),[f,g,t,o]);const m=h.useCallback(y=>{const b=u.current.get(y);if(b)return b;const j=C=>{if(!C)return;const A=Math.ceil(C.getBoundingClientRect().height)||qh;typeof A=="number"&&A>0&&iS(y,A)};return u.current.set(y,j),j},[]);h.useEffect(()=>{const y=new Set(e);Array.from(u.current.keys()).forEach(b=>{y.has(b)||u.current.delete(b)})},[e]);const w=g.getVirtualItems(),S=g.getTotalSize(),k=h.useMemo(()=>{const y=[];let b=0,j=-1;w.forEach(A=>{if(!A)return;const _=e[A.index],I=Math.max(A.start-b,0);I>0&&y.push(c.jsx("div",{style:{height:`${I}px`}},`gap:${j}:${A.index}`)),y.push(n({componentId:_,index:A.index,measureRef:m(_)})),b=A.end,j=A.index});const C=Math.max(S-b,0);return C>0&&y.push(c.jsx("div",{style:{height:`${C}px`}},`gap:${j}:end`)),y},[S,w,m]);return c.jsx(c.Fragment,{children:k})},lS=te("DropZone",ww),cS=({element:e,label:t,override:n})=>e?c.jsx("div",{dangerouslySetInnerHTML:{__html:e.outerHTML}}):c.jsx(ga,{name:t,children:n}),va=e=>c.jsx(Yh,O({},e)),uS=({zoneCompound:e,componentId:t,index:n,dragAxis:r,collisionAxis:s,inDroppableZone:o,itemRef:i})=>{var a,l;const u=H($=>$.metadata),d=h.useContext(wr),{depth:f=1}=d??{},p=h.useContext(nt),v=H(Ke($=>{var U;return(U=$.state.indexes.nodes[t])==null?void 0:U.flatData.props})),g=H($=>{var U;return(U=$.state.indexes.nodes[t])==null?void 0:U.data.type}),m=H(Ke($=>{var U;return(U=$.state.indexes.nodes[t])==null?void 0:U.data.readOnly})),w=Ae(),S=h.useMemo(()=>{if(v)return om({type:g,props:v});const $=p.getState().previewIndex[e];return t===($==null?void 0:$.props.id)?{type:$.componentType,props:$.props,previewType:$.type,element:$.element}:null},[w,t,e,g,v]),k=H($=>S!=null&&S.type?$.config.components[S.type]:null),y=h.useMemo(()=>({renderDropZone:va,isEditing:!0,dragRef:null,metadata:O(O({},u),k==null?void 0:k.metadata)}),[u,k==null?void 0:k.metadata]),b=H($=>$.overrides),j=H($=>{var U;return((U=$.componentState[t])==null?void 0:U.loadingCount)>0}),C=H($=>{var U;return((U=$.selectedItem)==null?void 0:U.props.id)===t||!1});let A=(l=(a=k==null?void 0:k.label)!=null?a:S==null?void 0:S.type.toString())!=null?l:"Component";const _=h.useMemo(()=>z(O(O({},k==null?void 0:k.defaultProps),S==null?void 0:S.props),{puck:y,editMode:!0}),[k==null?void 0:k.defaultProps,S==null?void 0:S.props,y]),I=h.useMemo(()=>{var $;return{type:($=S==null?void 0:S.type)!=null?$:g,props:_}},[S==null?void 0:S.type,g,_]),x=H($=>$.config),M=H($=>$.plugins),D=H($=>$.fieldTransforms),L=h.useMemo(()=>O(O(O(O(O({},Hd(va,$=>c.jsx(Yw,{componentId:t,zone:$.zone}))),Qw()),tS()),M.reduce(($,U)=>O(O({},$),U.fieldTransforms),{})),D),[M,D]),N=Gw(x,I,L,m,j);if(!S)return;const F=k?k.render:()=>c.jsxs("div",{style:{padding:48,textAlign:"center"},children:["No configuration for ",S.type]});let B=S.type;const K="previewType"in S?S.previewType==="insert":!1;return c.jsx(xw,{id:t,componentType:B,zoneCompound:e,depth:f+1,index:n,isLoading:j,isSelected:C,label:A,autoDragAxis:r,userDragAxis:s,inDroppableZone:o,itemRef:i,children:$=>{var U;return k!=null&&k.inline&&!K?c.jsx(xu,{Component:F,componentProps:z(O({},N),{puck:z(O({},N.puck),{dragRef:$})})}):c.jsx("div",{ref:$,children:K?c.jsx(cS,{label:A,override:(U=b.componentItem)!=null?U:b.drawerItem,element:"element"in S&&S.element?S.element:void 0}):c.jsx(xu,{Component:F,componentProps:N})})}})},wu=h.memo(uS),Yh=h.forwardRef(function({zone:t,allow:n,disallow:r,style:s,className:o,minEmptyHeight:i="128px",collisionAxis:a,as:l},u){const d=h.useContext(wr),f=Ae(),{areaId:p,depth:v=0,registerLocalZone:g,unregisterLocalZone:m}=d??{},w=H(Ke(Q=>{var V;return p?(V=Q.state.indexes.nodes[p])==null?void 0:V.path:null}));let S=Ge;p&&t!==Ge&&(S=`${p}:${t}`);const k=S===Ge||t===Ge||p==="root",y=Gt(nt,Q=>Q.nextAreaDepthIndex[p||""]),b=H(Ke(Q=>{var V;return(V=Q.state.indexes.zones[S])==null?void 0:V.contentIds})),j=H(Ke(Q=>{var V;return(V=Q.state.indexes.zones[S])==null?void 0:V.type}));h.useEffect(()=>{(!j||j==="dropzone")&&d!=null&&d.registerZone&&(d==null||d.registerZone(S))},[j,f]),h.useEffect(()=>{j==="dropzone"&&S!==Ge&&console.warn("DropZones have been deprecated in favor of slot fields and will be removed in a future version of Puck. Please see the migration guide: https://www.puckeditor.com/docs/guides/migrations/dropzones-to-slots")},[j]);const C=h.useMemo(()=>b||[],[b]),A=h.useRef(null),_=h.useCallback(Q=>{if(!Q)return!0;if(r){const V=n||[];if((r||[]).filter(T=>V.indexOf(T)===-1).indexOf(Q)!==-1)return!1}else if(n&&n.indexOf(Q)===-1)return!1;return!0},[n,r]),I=Gt(nt,Q=>{var V;const E=(V=Q.draggedItem)==null?void 0:V.data.componentType;return _(E)}),x=y||k,M=Gt(nt,Q=>{var V;let E=!0;return E=(V=Q.zoneDepthIndex[S])!=null?V:!1,E&&(E=I),E});h.useEffect(()=>(g&&g(S,I||M),()=>{m&&m(S)}),[I,M,S]);const[D,L]=Ww(C,S),N=M&&(L?D.length===1:D.length===0),F=h.useContext(nt);h.useEffect(()=>{const{enabledIndex:Q}=F.getState();F.setState({enabledIndex:z(O({},Q),{[S]:M})})},[M,F,S]);const B={id:S,collisionPriority:M?v:0,disabled:!N,collisionDetector:R1,type:"dropzone",data:{areaId:p,depth:v,isDroppableTarget:I,path:w||[]}},{ref:K}=ah(B),$=H(Q=>(Q==null?void 0:Q.selectedItem)&&p===(Q==null?void 0:Q.selectedItem.props.id)),[U]=Zw(A,a),[Z,ne]=Hw({zoneCompound:S,userMinEmptyHeight:i,ref:A}),Y=h.useCallback(Q=>{ha([A,K,u],Q)},[K]),se=H(Q=>Q._experimentalVirtualization),ve=l??"div",Oe=se&&((p??ts)===ts&&v===0);return c.jsx(ve,{className:`${lS({isRootZone:k,hoveringOverArea:x,isEnabled:M,isAreaSelected:$,hasChildren:C.length>0,isAnimating:ne})}${o?` ${o}`:""}`,ref:Y,"data-testid":`dropzone:${S}`,"data-puck-dropzone":S,style:z(O({},s),{"--min-empty-height":Z,backgroundColor:s==null?void 0:s.backgroundColor}),children:Oe?c.jsx(aS,{contentIds:D,zoneCompound:S,renderItem:Q=>c.jsx(wu,{zoneCompound:S,componentId:Q.componentId,dragAxis:U,index:Q.index,collisionAxis:a,inDroppableZone:I,itemRef:Q.measureRef},Q.componentId)}):D.map((Q,V)=>c.jsx(wu,{zoneCompound:S,componentId:Q,dragAxis:U,index:V,collisionAxis:a,inDroppableZone:I},Q))})}),dS=({config:e,item:t,metadata:n})=>{const r=e.components[t.type],s=Fo(e,t,a=>c.jsx(Na,z(O({},a),{config:e,metadata:n}))),o=h.useMemo(()=>({areaId:s.id,depth:1}),[s]),i=Bo(r.fields,s);return c.jsx(ms,{value:o,children:c.jsx(r.render,z(O(O({},s),i),{puck:z(O({},s.puck),{renderDropZone:ma,metadata:O(O({},n),r.metadata)})}))},s.id)},ma=e=>c.jsx(Gh,O({},e)),Gh=h.forwardRef(function({className:t,style:n,zone:r,as:s},o){const i=h.useContext(wr),{areaId:a="root"}=i||{},{config:l,data:u,metadata:d}=h.useContext(ba);let f=`${a}:${r}`,p=(u==null?void 0:u.content)||[];h.useEffect(()=>{p||i!=null&&i.registerZone&&(i==null||i.registerZone(f))},[p]);const v=s??"div";return!u||!l?null:(f!==Ge&&(p=dd(u,f).zones[f]),c.jsx(v,{className:t,style:n,ref:o,children:p.map(g=>l.components[g.type]?c.jsx(dS,{config:l,item:g,metadata:d},g.props.id):null)}))}),ya=e=>c.jsx(fS,O({},e)),fS=h.forwardRef(function(t,n){const r=h.useContext(wr);return(r==null?void 0:r.mode)==="edit"?c.jsx(c.Fragment,{children:c.jsx(Yh,z(O({},t),{ref:n}))}):c.jsx(c.Fragment,{children:c.jsx(Gh,z(O({},t),{ref:n}))})}),ba=fo.createContext({config:{components:{}},data:{root:{},content:[]},metadata:{}});function pS({config:e,data:t,metadata:n={}}){var r,s;const o=z(O({},t),{root:t.root||{},content:t.content||[]}),i="props"in o.root?o.root.props:o.root,a=(i==null?void 0:i.title)||"",l=z(O({},i),{puck:{renderDropZone:ya,isEditing:!1,dragRef:null,metadata:n},title:a,editMode:!1,id:"puck-root"}),u=Fo(e,{type:"root",props:l},p=>c.jsx(Ud,z(O({},p),{config:e,metadata:n}))),d=Bo((r=e.root)==null?void 0:r.fields,l),f=h.useMemo(()=>({mode:"render",depth:0}),[]);return(s=e.root)!=null&&s.render?c.jsx(ba.Provider,{value:{config:e,data:o,metadata:n},children:c.jsx(ms,{value:f,children:c.jsx(e.root.render,z(O(O({},u),d),{children:c.jsx(ma,{zone:Ai})}))})}):c.jsx(ba.Provider,{value:{config:e,data:o,metadata:n},children:c.jsx(ms,{value:f,children:c.jsx(ma,{zone:Ai})})})}P();P();P();function Kh(e,t,n="force"){return Ee(this,null,function*(){const r=yield t().resolveComponentData(e,n);if(!r.didChange)return;const s=Nn(t().state,r.node.props.id);if(!s){console.warn(`Warning: Could not find component with id "${e.props.id}" to resolve its data. Component may have been removed or the id is invalid.`);return}t().dispatch({type:"replace",data:_s(r.node),destinationIndex:s.index,destinationZone:s.zone})})}function hS(e,t,n){return Ee(this,null,function*(){const r=t().state.indexes.nodes[e];if(!r){console.warn(`Warning: Could not find component with id "${e}" to resolve its data. Component may have been removed or the id is invalid.`);return}yield Kh(r.data,t,n)})}P();function gS(e,t,n){return Ee(this,null,function*(){const r=xt(e,t().state);if(!r){console.warn(`Warning: Could not find component for selector "${JSON.stringify(e)}" to resolve its data. Component may have been removed or the selector is invalid.`);return}const s=_s(r);yield Kh(s,t,n)})}var Su=(e,t)=>{const n={back:e.history.back,forward:e.history.forward,setHistories:e.history.setHistories,setHistoryIndex:e.history.setHistoryIndex,hasPast:e.history.hasPast(),hasFuture:e.history.hasFuture(),histories:e.history.histories,index:e.history.index},r={appState:rs(e.state),config:e.config,dispatch:e.dispatch,getPermissions:e.permissions.getPermissions,refreshPermissions:e.permissions.refreshPermissions,resolveDataById:(s,o)=>hS(s,t,o),resolveDataBySelector:(s,o)=>gS(s,t,o),history:n,selectedItem:e.selectedItem||null,getItemBySelector:s=>xt(s,e.state),getItemById:s=>e.state.indexes.nodes[s].data,getSelectorForId:s=>Nn(e.state,s),getParentById:s=>{const i=e.state.indexes.nodes[s].parentId;if(i===null)return;const a=e.state.indexes.nodes[i];if(a)return a.data}};return r.__private={appState:e.state},r},Vl=h.createContext(null),ku=e=>({state:e.state,config:e.config,dispatch:e.dispatch,permissions:e.permissions,history:e.history,selectedItem:e.selectedItem}),vS=e=>{const[t]=h.useState(()=>ur(()=>Su(ku(e.getState()),e.getState)));return h.useEffect(()=>e.subscribe(n=>ku(n),n=>{t.setState(Su(n,e.getState))}),[]),t};function mS(){return function(t){const n=h.useContext(Vl);if(!n)throw new Error("usePuck must be used inside <Puck>.");return Lo(n,t??(s=>s))}}function Xh(){const e=h.useContext(Vl);if(!e)throw new Error("usePuckGet must be used inside <Puck>.");return e.getState}P();P();P();P();P();var yS={ComponentList:"_ComponentList_1rrlt_1","ComponentList--isExpanded":"_ComponentList--isExpanded_1rrlt_5","ComponentList-content":"_ComponentList-content_1rrlt_9","ComponentList-title":"_ComponentList-title_1rrlt_17","ComponentList-titleIcon":"_ComponentList-titleIcon_1rrlt_53"},Ys=te("ComponentList",yS),Jh=({name:e,label:t})=>{var n;const r=H(o=>o.overrides),s=H(o=>o.permissions.getPermissions({type:e}).insert);return h.useEffect(()=>{r.componentItem&&console.warn("The `componentItem` override has been deprecated and renamed to `drawerItem`")},[r]),c.jsx(Hl.Item,{label:t,name:e,isDragDisabled:!s,children:(n=r.componentItem)!=null?n:r.drawerItem})},tr=({children:e,title:t,id:n})=>{const r=H(a=>a.config),s=H(a=>a.setUi),o=H(a=>a.state.ui.componentList),{expanded:i=!0}=o[n]||{};return c.jsxs("div",{className:Ys({isExpanded:i}),children:[t&&c.jsxs("button",{type:"button",className:Ys("title"),onClick:()=>s({componentList:z(O({},o),{[n]:z(O({},o[n]),{expanded:!i})})}),title:i?`Collapse${t?` ${t}`:""}`:`Expand${t?` ${t}`:""}`,children:[c.jsx("div",{children:t}),c.jsx("div",{className:Ys("titleIcon"),children:i?c.jsx(_d,{size:12}):c.jsx(or,{size:12})})]}),c.jsx("div",{className:Ys("content"),children:c.jsx(Hl,{children:e||Object.keys(r.components).map(a=>{var l;return c.jsx(Jh,{label:(l=r.components[a].label)!=null?l:a,name:a},a)})})})]})};tr.Item=Jh;var bS=()=>{const[e,t]=h.useState(),n=H(s=>s.config),r=H(s=>s.state.ui.componentList);return h.useEffect(()=>{var s,o,i;if(Object.keys(r).length>0){const a=[];let l;l=Object.entries(r).map(([d,f])=>!f.components||(f.components.forEach(p=>{a.push(p)}),f.visible===!1)?null:c.jsx(tr,{id:d,title:f.title||d,children:f.components.map((p,v)=>{var g;const m=n.components[p]||{};return c.jsx(tr.Item,{label:(g=m.label)!=null?g:p,name:p,index:v},p)})},d));const u=Object.keys(n.components).filter(d=>a.indexOf(d)===-1);u.length>0&&!((s=r.other)!=null&&s.components)&&((o=r.other)==null?void 0:o.visible)!==!1&&l.push(c.jsx(tr,{id:"other",title:((i=r.other)==null?void 0:i.title)||"Other",children:u.map((d,f)=>{var p;const v=n.components[d]||{};return c.jsx(tr.Item,{name:d,label:(p=v.label)!=null?p:d,index:f},d)})},"other")),t(l)}},[n.categories,n.components,r]),e},Qh=()=>{const e=H(r=>r.overrides),t=bS(),n=h.useMemo(()=>(e.components&&console.warn("The `components` override has been deprecated and renamed to `drawer`"),e.components||e.drawer||"div"),[e]);return c.jsx(n,{children:t||c.jsx(tr,{id:"all"})})};P();var _S={BlocksPlugin:"_BlocksPlugin_1ey1i_1"},xS=te("BlocksPlugin",_S),eg=()=>({name:"blocks",label:"Blocks",render:()=>c.jsx("div",{className:xS(),children:c.jsx(Qh,{})}),icon:c.jsx(py,{})});P();P();P();P();var tg={LayerTree:"_LayerTree_7rx04_1","LayerTree-zoneTitle":"_LayerTree-zoneTitle_7rx04_11","LayerTree-helper":"_LayerTree-helper_7rx04_17",Layer:"_Layer_7rx04_1","Layer-inner":"_Layer-inner_7rx04_29","Layer--containsZone":"_Layer--containsZone_7rx04_35","Layer-clickable":"_Layer-clickable_7rx04_39","Layer--isSelected":"_Layer--isSelected_7rx04_61","Layer-chevron":"_Layer-chevron_7rx04_77","Layer--childIsSelected":"_Layer--childIsSelected_7rx04_78","Layer-zones":"_Layer-zones_7rx04_82","Layer-title":"_Layer-title_7rx04_96","Layer-name":"_Layer-name_7rx04_105","Layer-icon":"_Layer-icon_7rx04_111","Layer-zoneIcon":"_Layer-zoneIcon_7rx04_116"},cr=te("LayerTree",tg),rn=te("Layer",tg),ng=32,wS=8,SS=25,rg=new Map,kS=e=>Object.keys(e).reduce((t,n)=>{const[r]=n.split(":");return t[r]=[...t[r]||[],n],t},{}),IS=(e,t,n,r)=>{var s,o,i,a;if(r!==void 0)return r;const[l,u]=e.split(":");if(!u)return;const d=(s=t[l])==null?void 0:s.data.type,f=d&&d!==ts?n.components[d]:n.root;return(a=(i=(o=f==null?void 0:f.fields)==null?void 0:o[u])==null?void 0:i.label)!=null?a:u},ES=({config:e,itemId:t,index:n,nodes:r,zoneCompound:s,zones:o,zonesByParent:i})=>{var a,l,u;const d=r[t],f=((a=d==null?void 0:d.data.type)==null?void 0:a.toString())||"Component",p=(u=(l=e.components[f])==null?void 0:l.label)!=null?u:f;return{childZones:(i[t]||[]).map(g=>sg({config:e,nodes:r,zoneCompound:g,zones:o,zonesByParent:i})),componentType:f,index:n,itemId:t,label:p,zoneCompound:s}},sg=({config:e,label:t,nodes:n,zoneCompound:r,zones:s,zonesByParent:o=kS(s)})=>{var i,a;return{items:((a=(i=s[r])==null?void 0:i.contentIds)!=null?a:[]).map((u,d)=>ES({config:e,itemId:u,index:d,nodes:n,zoneCompound:r,zones:s,zonesByParent:o})),label:IS(r,n,e,t),zoneCompound:r}},CS=e=>{var t;return(t=rg.get(e))!=null?t:ng},jS=(e,t)=>{t<=0||rg.set(e,t)},PS=e=>{var t;let n=(t=e==null?void 0:e.parentElement)!=null?t:null;for(;n;){const{overflow:r,overflowY:s}=getComputedStyle(n);if([r,s].some(o=>/auto|scroll/.test(o)))return n;n=n.parentElement}return null},og=h.forwardRef(function({childIsSelected:t,dataIndex:n,depth:r,isSelected:s,node:o,selectedId:i,selectedPathIds:a},l){const u=H(m=>m.dispatch),d=h.useContext(nt),f=Gt(nt,m=>m.hoveringComponent===o.itemId),p=o.childZones.length>0,v=h.useCallback(m=>{u({type:"setUi",ui:{itemSelector:m}})},[u]),g=s||t;return c.jsxs("li",{ref:l,className:rn({childIsSelected:t,containsZone:p,isHovering:f,isSelected:s}),"data-index":n,"data-puck-layer-tree-id":o.itemId,children:[c.jsx("div",{className:rn("inner"),children:c.jsxs("button",{type:"button",className:rn("clickable"),onClick:()=>{if(s){v(null);return}v({index:o.index,zone:o.zoneCompound}),d.getState().scrollToComponent(o.itemId)},onMouseEnter:m=>{m.stopPropagation(),d.setState({hoveringComponent:o.itemId})},onMouseLeave:m=>{m.stopPropagation(),d.setState({hoveringComponent:null})},children:[p&&c.jsx("div",{className:rn("chevron"),title:s?"Collapse":"Expand",children:c.jsx(or,{size:"12"})}),c.jsxs("div",{className:rn("title"),children:[c.jsx("div",{className:rn("icon"),children:o.componentType==="Text"||o.componentType==="Heading"?c.jsx($o,{size:"16"}):c.jsx(wy,{size:"16"})}),c.jsx("div",{className:rn("name"),children:o.label})]})]})}),p&&g&&o.childZones.map(m=>c.jsx("div",{className:rn("zones"),children:c.jsx(ig,{depth:r+1,selectedId:i,selectedPathIds:a,tree:m})},m.zoneCompound))]})}),ig=({depth:e,selectedId:t,selectedPathIds:n,tree:r})=>{const s=e===0&&r.items.length>=SS;return c.jsxs(c.Fragment,{children:[r.label&&c.jsxs("div",{className:cr("zoneTitle"),children:[c.jsx("div",{className:cr("zoneIcon"),children:c.jsx(wd,{size:"16"})}),r.label]}),s?c.jsx(OS,{depth:e,selectedId:t,selectedPathIds:n,tree:r}):c.jsx(AS,{depth:e,selectedId:t,selectedPathIds:n,tree:r})]})},AS=({depth:e,selectedId:t,selectedPathIds:n,tree:r})=>c.jsxs("ul",{className:cr(),children:[r.items.length===0&&c.jsx("div",{className:cr("helper"),children:"No items"}),r.items.map(s=>c.jsx(og,{childIsSelected:n.has(s.itemId),depth:e,isSelected:t===s.itemId,node:s,selectedId:t,selectedPathIds:n},s.itemId))]}),OS=({depth:e,selectedId:t,selectedPathIds:n,tree:r})=>{const s=h.useRef(null),o=Eh({count:r.items.length,estimateSize:p=>CS(r.items[p].itemId),getItemKey:p=>r.items[p].itemId,getScrollElement:()=>PS(s.current),overscan:wS,measureElement:p=>{const v=Math.ceil(p.getBoundingClientRect().height),g=p.dataset.puckLayerTreeId;return g&&jS(g,v),v||ng}}),i=o.getVirtualItems(),a=o.getTotalSize(),l=[];let u=0,d=-1;i.forEach(p=>{const v=r.items[p.index],g=Math.max(p.start-u,0);g>0&&l.push(c.jsx("li",{"aria-hidden":"true",style:{height:`${g}px`}},`gap:${r.zoneCompound}:${d}:${p.index}`)),l.push(c.jsx(og,{childIsSelected:n.has(v.itemId),dataIndex:p.index,depth:e,isSelected:t===v.itemId,node:v,ref:o.measureElement,selectedId:t,selectedPathIds:n},v.itemId)),u=p.end,d=p.index});const f=Math.max(a-u,0);return f>0&&l.push(c.jsx("li",{"aria-hidden":"true",style:{height:`${f}px`}},`gap:${r.zoneCompound}:${d}:end`)),c.jsxs("ul",{className:cr(),ref:s,children:[r.items.length===0&&c.jsx("div",{className:cr("helper"),children:"No items"}),l]})},MS=({selectedId:e,selectedPathIds:t,trees:n})=>c.jsx(c.Fragment,{children:n.map(r=>c.jsx(ig,{depth:0,selectedId:e,selectedPathIds:t,tree:r},r.zoneCompound))});P();var DS=(e,t)=>Object.keys(e.indexes.zones).filter(n=>n.split(":")[0]===t),ag=()=>{const e=H(u=>u.overrides.outline),t=H(u=>u.config),n=H(u=>u.state.indexes.nodes),r=H(u=>u.state.indexes.zones),s=H(u=>{var d;return((d=u.selectedItem)==null?void 0:d.props.id)||null}),o=H(Ke(u=>DS(u.state,"root"))),i=h.useMemo(()=>{var u;const d=s?(u=n[s])==null?void 0:u.path:null;return new Set((d==null?void 0:d.map(f=>f.split(":")[0]).filter(Boolean))||[])},[n,s]),a=h.useMemo(()=>o.map(u=>sg({config:t,label:o.length===1?"":u.split(":")[1],nodes:n,zoneCompound:u,zones:r})),[t,n,o,r]),l=h.useMemo(()=>e||"div",[e]);return c.jsx(l,{children:c.jsx(MS,{selectedId:s,selectedPathIds:i,trees:a})})};P();var TS={OutlinePlugin:"_OutlinePlugin_q92j6_1"},RS=te("OutlinePlugin",TS),lg=()=>({name:"outline",label:"Outline",render:()=>c.jsx("div",{className:RS(),children:c.jsx(ag,{})}),icon:c.jsx(wd,{})});P();P();P();var LS={Breadcrumbs:"_Breadcrumbs_1c9yh_1","Breadcrumbs-breadcrumbLabel":"_Breadcrumbs-breadcrumbLabel_1c9yh_7","Breadcrumbs-breadcrumb":"_Breadcrumbs-breadcrumb_1c9yh_7"};P();var NS=e=>{const t=H(o=>{var i;return(i=o.selectedItem)==null?void 0:i.props.id}),n=H(o=>o.config),r=H(o=>{var i;return(i=o.state.indexes.nodes[t])==null?void 0:i.path}),s=Ae();return h.useMemo(()=>{const o=(r==null?void 0:r.map(i=>{var a,l,u,d;const[f]=i.split(":");if(f==="root")return{label:((a=n==null?void 0:n.root)==null?void 0:a.label)||"Page",selector:null};const p=s.getState().state.indexes.nodes[f],v=p.path[p.path.length-1],m=(((l=s.getState().state.indexes.zones[v])==null?void 0:l.contentIds)||[]).indexOf(f);return{label:p?(d=(u=n.components[p.data.type])==null?void 0:u.label)!=null?d:p.data.type:"Component",selector:p?{index:m,zone:p.path[p.path.length-1]}:null}}))||[];return e?o.slice(o.length-e):o},[r,e])},Si=te("Breadcrumbs",LS),cg=({children:e,numParents:t=1})=>{const n=H(s=>s.setUi),r=NS(t);return c.jsxs("div",{className:Si(),children:[r.map((s,o)=>c.jsxs("div",{className:Si("breadcrumb"),children:[c.jsx("button",{type:"button",className:Si("breadcrumbLabel"),onClick:()=>n({itemSelector:s.selector}),children:s.label}),c.jsx(ay,{size:16})]},o)),e]})};P();P();var zS={PuckFields:"_PuckFields_10bh7_1","PuckFields--isLoading":"_PuckFields--isLoading_10bh7_6","PuckFields-loadingOverlay":"_PuckFields-loadingOverlay_10bh7_10","PuckFields-loadingOverlayInner":"_PuckFields-loadingOverlayInner_10bh7_25","PuckFields-field":"_PuckFields-field_10bh7_32","PuckFields--wrapFields":"_PuckFields--wrapFields_10bh7_36"},co=te("PuckFields",zS),$S=({children:e})=>c.jsx(c.Fragment,{children:e}),FS=(e,t)=>(n,r)=>Ee(null,null,function*(){const{dispatch:s,state:o,selectedItem:i,resolveComponentData:a}=t.getState(),{data:l,ui:u}=o,{itemSelector:d}=u,f=l.root.props||l.root,p=i?i.props:f,v=z(O({},p),{[e]:n});if(i&&d){const g=yield a(z(O({},i),{props:v}),"replace"),m=Nn(t.getState().state,i.props.id);if(!m)return;s({type:"replace",destinationIndex:m.index,destinationZone:m.zone||Ge,data:g.node,ui:r});return}if(l.root.props){s({type:"replaceRoot",root:(yield a(z(O({},l.root),{props:v}),"replace")).node,ui:O(O({},u),r),recordHistory:!0});return}s({type:"setData",data:{root:v}})}),BS=({fieldName:e})=>{const t=H(u=>u.fields.fields[e]),n=H(u=>((u.selectedItem?u.selectedItem.readOnly:u.state.data.root.readOnly)||{})[e]),r=H(u=>t?u.selectedItem?`${u.selectedItem.props.id}_${t.type}_${e}`:`root_${t.type}_${e}`:null),s=H(Ke(u=>{const{selectedItem:d,permissions:f}=u;return d?f.getPermissions({item:d}):f.getPermissions({root:!0})})),o=Ae(),i=h.useCallback(FS(e,o),[e]),{visible:a=!0}=t??{},l=h.useContext(Ps.ctx);return h.useEffect(()=>o.subscribe(u=>{var d;return(d=u.getCurrentData().props)==null?void 0:d[e]},u=>{l.setState({[e]:u})}),[o,l]),!t||!r||!a||t.type==="slot"?null:c.jsx("div",{className:co("field"),children:c.jsx(Nh,{field:t,name:e,id:r,readOnly:!s.edit||n,onChange:i})},r)},HS=({fieldName:e})=>{const t=Ae(),n=h.useMemo(()=>{var r;const s=(r=t.getState().getCurrentData().props)==null?void 0:r[e];return{[e]:s}},[]);return c.jsx(Ps.Provider,{value:n,children:c.jsx(BS,{fieldName:e})})},VS=h.memo(HS),WS=({wrapFields:e=!0})=>{const t=H(d=>d.overrides),n=H(d=>{var f,p;const v=d.selectedItem?(f=d.componentState[d.selectedItem.props.id])==null?void 0:f.loadingCount:(p=d.componentState.root)==null?void 0:p.loadingCount;return(v??0)>0}),r=H(Ke(d=>d.state.ui.itemSelector)),s=H(d=>{var f;return(f=d.selectedItem)==null?void 0:f.props.id}),o=Ae();eb(o,s);const i=H(d=>d.fields.loading),a=H(Ke(d=>d.fields.id===s?Object.keys(d.fields.fields):[])),l=i||n,u=h.useMemo(()=>t.fields||$S,[t]);return c.jsxs("form",{className:co({wrapFields:e}),onSubmit:d=>{d.preventDefault()},children:[c.jsx(u,{isLoading:l,itemSelector:r,children:a.map(d=>c.jsx(VS,{fieldName:d},d))}),l&&c.jsx("div",{className:co("loadingOverlay"),children:c.jsx("div",{className:co("loadingOverlayInner"),children:c.jsx(Mn,{size:16})})})]})},Wl=h.memo(WS);P();var US={FieldsPlugin:"_FieldsPlugin_nd930_1","FieldsPlugin-header":"_FieldsPlugin-header_nd930_7"},Iu=te("FieldsPlugin",US),qS=()=>H(t=>{var n,r;const s=t.selectedItem;return s?(r=(n=t.config.components[s.type])==null?void 0:n.label)!=null?r:s.type:"Page"}),ug=({desktopSideBar:e="right"}={})=>({name:"fields",label:"Fields",render:()=>c.jsxs("div",{className:Iu(),children:[c.jsx("div",{className:Iu("header"),children:c.jsx(cg,{numParents:2,children:c.jsx(qS,{})})}),c.jsx(Wl,{})]}),icon:c.jsx(My,{}),mobileOnly:e==="right"});P();P();P();var _a='style, link[rel="stylesheet"]',ZS=e=>{const t=[];return e.querySelectorAll(_a).forEach(n=>{n.tagName==="STYLE"?n.innerHTML.trim()&&t.push(n):t.push(n)}),t},Eu=e=>Array.from(document.styleSheets).find(t=>t.ownerNode.href===e.href),YS=e=>{if(e)try{return Array.from(e.cssRules).map(t=>t.cssText).join("")}catch{console.warn("Access to stylesheet %s is denied. Ignoring…",e.href)}return""},Cu=(e,t)=>{const n=e.attributes;(n==null?void 0:n.length)>0&&Array.from(n).forEach(r=>{t.setAttribute(r.name,r.value)})},ju=e=>setTimeout(e,0),GS=({children:e,debug:t=!1,onStylesLoaded:n=()=>null})=>{const{document:r,window:s}=KS();return h.useEffect(()=>{if(!s||!r)return()=>{};let o=[];const i={},a=k=>o.findIndex(y=>y.original===k),l=(k,y=!1)=>Ee(null,null,function*(){let b;if(k.nodeName==="LINK"&&y){b=document.createElement("style"),b.type="text/css";let j=Eu(k);j||(yield new Promise(A=>{const _=()=>{A(),k.removeEventListener("load",_)};k.addEventListener("load",_)}),j=Eu(k));const C=YS(j);if(!C){t&&console.warn("Tried to load styles for link element, but couldn't find them. Skipping...");return}b.innerHTML=C,b.setAttribute("data-href",k.getAttribute("href"))}else b=k.cloneNode(!0);return b}),u=k=>Ee(null,null,function*(){const y=a(k);if(y>-1){t&&console.log("Tried to add an element that was already mirrored. Updating instead..."),o[y].mirror.innerText=k.innerText;return}const b=yield l(k);if(!b)return;const j=vi(b.outerHTML);if(i[j]){t&&console.log("iframe already contains element that is being mirrored. Skipping...");return}i[j]=!0,r.head.append(b),o.push({original:k,mirror:b}),t&&console.log(`Added style node ${k.outerHTML}`)}),d=k=>{var y,b;const j=a(k);if(j===-1){t&&console.log("Tried to remove an element that did not exist. Skipping...");return}const C=vi(k.outerHTML);(b=(y=o[j])==null?void 0:y.mirror)==null||b.remove(),delete i[C],t&&console.log(`Removed style node ${k.outerHTML}`)},f=new MutationObserver(k=>{k.forEach(y=>{y.type==="childList"&&(y.addedNodes.forEach(b=>{if(b.nodeType===Node.TEXT_NODE||b.nodeType===Node.ELEMENT_NODE){const j=b.nodeType===Node.TEXT_NODE?b.parentElement:b;j&&j.matches(_a)&&ju(()=>u(j))}}),y.removedNodes.forEach(b=>{if(b.nodeType===Node.TEXT_NODE||b.nodeType===Node.ELEMENT_NODE){const j=b.nodeType===Node.TEXT_NODE?b.parentElement:b;j&&j.matches(_a)&&ju(()=>d(j))}}))})}),p=s.parent.document,v=ZS(p),g=[];let m=0;const w=p.getElementsByTagName("html")[0];Cu(w,r.documentElement);const S=p.getElementsByTagName("body")[0];return Cu(S,r.body),Promise.all(v.map((k,y)=>Ee(null,null,function*(){if(k.nodeName==="LINK"){const j=k.href;if(g.indexOf(j)>-1)return;g.push(j)}const b=yield l(k);if(b)return o.push({original:k,mirror:b}),b}))).then(k=>{const y=k.filter(b=>typeof b<"u");y.forEach(b=>{b.onload=()=>{m=m+1,m>=y.length&&n()},b.onerror=()=>{console.warn("AutoFrame couldn't load a stylesheet"),m=m+1,m>=y.length&&n()}}),r.head.innerHTML="",r.head.append(...y),y.forEach(b=>{b.nodeName==="STYLE"&&(m=m+1)}),m>=y.length&&n(),f.observe(p.head,{childList:!0,subtree:!0}),y.forEach(b=>{const j=vi(b.outerHTML);i[j]=!0})}),()=>{f.disconnect()}},[]),c.jsx(c.Fragment,{children:e})},Ul=h.createContext({}),KS=()=>h.useContext(Ul);function dg(e){var t=e,{children:n,className:r,debug:s,id:o,onReady:i=()=>{},onNotReady:a=()=>{},frameRef:l}=t,u=Kt(t,["children","className","debug","id","onReady","onNotReady","frameRef"]);const[d,f]=h.useState(!1),[p,v]=h.useState({}),[g,m]=h.useState(),[w,S]=h.useState(!1);return h.useEffect(()=>{var k;if(l.current){const y=l.current.contentDocument,b=l.current.contentWindow;v({document:y||void 0,window:b||void 0}),m((k=l.current.contentDocument)==null?void 0:k.getElementById("frame-root")),y&&b&&w?i():a()}},[l,d,w]),c.jsx("iframe",z(O({},u),{className:r,id:o,srcDoc:'<!DOCTYPE html><html><head></head><body><div id="frame-root" data-puck-entry></div></body></html>',ref:l,onLoad:()=>{f(!0)},children:c.jsx(Ul.Provider,{value:p,children:d&&g&&c.jsx(GS,{debug:s,onStylesLoaded:()=>S(!0),children:ys.createPortal(n,g)})})}))}dg.displayName="AutoFrame";var XS=dg;P();var JS={PuckPreview:"_PuckPreview_z2rgu_1","PuckPreview-frame":"_PuckPreview-frame_z2rgu_6"},ki=te("PuckPreview",JS),QS=e=>{const t=H(n=>n.status);h.useEffect(()=>{if(e.current&&t==="READY"){const n=e.current,r=i=>{const a=new Bh("pointermove",z(O({},i),{bubbles:!0,cancelable:!1,clientX:i.clientX,clientY:i.clientY,originalTarget:i.target}));n.dispatchEvent(a)},s=()=>{var i;o(),(i=n.contentDocument)==null||i.addEventListener("pointermove",r,{capture:!0})},o=()=>{var i;(i=n.contentDocument)==null||i.removeEventListener("pointermove",r)};return s(),()=>{o()}}},[t])},fg=({id:e="puck-preview"})=>{const t=H(g=>g.dispatch),n=H(g=>g.state.data.root),r=H(g=>g.config),s=H(g=>g.setStatus),o=H(g=>g.iframe),i=H(g=>g.overrides),a=H(g=>g.metadata),l=H(g=>g.state.ui.previewMode==="edit"?null:g.state.data),u=h.useCallback(g=>{var m,w,S,k;const y=Fo(r,{type:"root",props:g},va),b=Bo((w=(m=r.root)==null?void 0:m.fields)!=null?w:{},g);return(S=r.root)!=null&&S.render?(k=r.root)==null?void 0:k.render(O(O({id:"puck-root"},y),b)):c.jsx(c.Fragment,{children:y.children})},[r]),d=h.useMemo(()=>i.iframe,[i]),f=n.props||n,p=h.useRef(null);QS(p);const v=l?c.jsx(pS,{data:l,config:r,metadata:a}):c.jsx(u,z(O({},f),{puck:{renderDropZone:ya,isEditing:!0,dragRef:null,metadata:a},editMode:!0,children:c.jsx(ya,{zone:Ge})}));return h.useEffect(()=>{o.enabled||s("READY")},[o.enabled]),c.jsx("div",{className:ki(),id:e,"data-puck-preview":!0,onClick:g=>{const m=g.target;!m.hasAttribute("data-puck-component")&&!m.hasAttribute("data-puck-dropzone")&&t({type:"setUi",ui:{itemSelector:null}})},children:o.enabled?c.jsx(XS,{id:"preview-frame",className:ki("frame"),"data-rfd-iframe":!0,onReady:()=>{s("READY")},onNotReady:()=>{s("MOUNTED")},frameRef:p,children:c.jsx(Ul.Consumer,{children:({document:g})=>d?c.jsx(d,{document:g,children:v}):v})}):c.jsx("div",{id:"preview-frame",className:ki("frame"),ref:p,"data-puck-entry":!0,children:v})})};P();P();var e2=({overrides:e,plugins:t})=>{const n=O({},e);return t==null||t.forEach(r=>{r.overrides&&Object.keys(r.overrides).forEach(s=>{var o;const i=s;if(!((o=r.overrides)!=null&&o[i]))return;if(i==="fieldTypes"){const u=r.overrides.fieldTypes;Object.keys(u).forEach(d=>{n.fieldTypes=n.fieldTypes||{};const f=n.fieldTypes[d],p=v=>u[d](z(O({},v),{children:f?f(v):v.children}));n.fieldTypes[d]=p});return}const a=n[i],l=u=>r.overrides[i](z(O({},u),{children:a?a(u):u.children}));n[i]=l})}),n},t2=({overrides:e,plugins:t})=>h.useMemo(()=>e2({overrides:e,plugins:t}),[t,e]);P();P();var ql={Puck:"_Puck_1dd16_19","Puck-portal":"_Puck-portal_1dd16_31",PuckLayout:"_PuckLayout_1dd16_36","PuckLayout-inner":"_PuckLayout-inner_1dd16_40","Puck--hidePlugins":"_Puck--hidePlugins_1dd16_72","PuckLayout--mounted":"_PuckLayout--mounted_1dd16_77","PuckLayout--mobilePanelHeightToggle":"_PuckLayout--mobilePanelHeightToggle_1dd16_81","PuckLayout--leftSideBarVisible":"_PuckLayout--leftSideBarVisible_1dd16_81","PuckLayout--isExpanded":"_PuckLayout--isExpanded_1dd16_87","PuckLayout--mobilePanelHeightMinContent":"_PuckLayout--mobilePanelHeightMinContent_1dd16_105","PuckLayout--rightSideBarVisible":"_PuckLayout--rightSideBarVisible_1dd16_132","PuckLayout-mounted":"_PuckLayout-mounted_1dd16_151","PuckLayout-nav":"_PuckLayout-nav_1dd16_192","PuckLayout-header":"_PuckLayout-header_1dd16_208",PuckPluginTab:"_PuckPluginTab_1dd16_222","PuckPluginTab--visible":"_PuckPluginTab--visible_1dd16_228","PuckPluginTab-body":"_PuckPluginTab-body_1dd16_233"};P();var n2="",r2=(e,t)=>{const[n,r]=h.useState();return h.useEffect(()=>{r(document.createElement("style"))},[]),h.useEffect(()=>{var s;if(!(!n||typeof window>"u")){if(n.innerHTML=e,t){const o=Pn();(s=o==null?void 0:o.head)==null||s.appendChild(n)}document.head.appendChild(n)}},[t,n]),n},s2=e=>r2(n2,e);P();var xa=({children:e})=>c.jsx(c.Fragment,{children:e});P();var o2=()=>{const e=Ae(),t=h.useCallback(()=>{const n=e.getState().dispatch;n({type:"setUi",ui:r=>({previewMode:r.previewMode==="edit"?"interactive":"edit"})})},[e]);zt({meta:!0,i:!0},t),zt({ctrl:!0,i:!0},t)};P();P();P();var i2={MenuBar:"_MenuBar_8pf8c_1","MenuBar--menuOpen":"_MenuBar--menuOpen_8pf8c_14","MenuBar-inner":"_MenuBar-inner_8pf8c_29","MenuBar-history":"_MenuBar-history_8pf8c_45"},Ii=te("MenuBar",i2);function a2({menuOpen:e=!1,renderHeaderActions:t,setMenuOpen:n}){const r=H(a=>a.history.back),s=H(a=>a.history.forward),o=H(a=>a.history.hasFuture()),i=H(a=>a.history.hasPast());return c.jsx("div",{className:Ii({menuOpen:e}),onClick:a=>{var l;const u=a.target;window.matchMedia("(min-width: 638px)").matches||u.tagName==="A"&&((l=u.getAttribute("href"))!=null&&l.startsWith("#"))&&n(!1)},children:c.jsxs("div",{className:Ii("inner"),children:[c.jsxs("div",{className:Ii("history"),children:[c.jsx(jt,{type:"button",title:"undo",disabled:!i,onClick:r,children:c.jsx(Hy,{size:21})}),c.jsx(jt,{type:"button",title:"redo",disabled:!o,onClick:s,children:c.jsx(Dy,{size:21})})]}),c.jsx(c.Fragment,{children:t&&t()})]})})}P();var l2={PuckHeader:"_PuckHeader_63pti_1","PuckHeader--hidePlugins":"_PuckHeader--hidePlugins_63pti_15","PuckHeader-inner":"_PuckHeader-inner_63pti_20","PuckHeader-toggle":"_PuckHeader-toggle_63pti_40","PuckHeader--rightSideBarVisible":"_PuckHeader--rightSideBarVisible_63pti_47","PuckHeader-rightSideBarToggle":"_PuckHeader-rightSideBarToggle_63pti_47","PuckHeader--leftSideBarVisible":"_PuckHeader--leftSideBarVisible_63pti_48","PuckHeader-leftSideBarToggle":"_PuckHeader-leftSideBarToggle_63pti_48","PuckHeader-title":"_PuckHeader-title_63pti_64","PuckHeader-path":"_PuckHeader-path_63pti_68","PuckHeader-tools":"_PuckHeader-tools_63pti_75","PuckHeader-menuButton":"_PuckHeader-menuButton_63pti_81","PuckHeader--menuOpen":"_PuckHeader--menuOpen_63pti_86"},qt=te("PuckHeader",l2),c2=({hidePlugins:e})=>{const{onPublish:t,renderHeader:n,renderHeaderActions:r,headerTitle:s,headerPath:o,iframe:i}=Qo(),a=H(y=>y.dispatch),l=Ae(),u=h.useMemo(()=>n?(console.warn("`renderHeader` is deprecated. Please use `overrides.header` and the `usePuck` hook instead"),b=>{var j=b,{actions:C}=j,A=Kt(j,["actions"]);const _=n,I=H(x=>x.state);return c.jsx(_,z(O({},A),{dispatch:a,state:I,children:C}))}):xa,[n]),d=h.useMemo(()=>r?(console.warn("`renderHeaderActions` is deprecated. Please use `overrides.headerActions` and the `usePuck` hook instead."),b=>{const j=r,C=H(A=>A.state);return c.jsx(j,z(O({},b),{dispatch:a,state:C}))}):xa,[r]),f=H(y=>y.overrides.header||u),p=H(y=>y.overrides.headerActions||d),[v,g]=h.useState(!1),m=H(y=>{var b,j;return(j=((b=y.state.indexes.nodes.root)==null?void 0:b.data).props.title)!=null?j:""}),w=H(y=>y.state.ui.leftSideBarVisible),S=H(y=>y.state.ui.rightSideBarVisible),k=h.useCallback(y=>{const b=window.matchMedia("(min-width: 638px)").matches,j=y==="left"?w:S,C=y==="left"?"rightSideBarVisible":"leftSideBarVisible";a({type:"setUi",ui:O({[`${y}SideBarVisible`]:!j},b?{}:{[C]:!1})})},[a,w,S]);return c.jsx(f,{actions:c.jsx(c.Fragment,{children:c.jsx(p,{children:c.jsx(fa,{onClick:()=>{const y=l.getState().state.data;t&&t(y)},icon:c.jsx(pc,{size:"14px"}),children:"Publish"})})}),children:c.jsx("header",{className:qt({leftSideBarVisible:w,rightSideBarVisible:S,hidePlugins:e}),children:c.jsxs("div",{className:qt("inner"),children:[c.jsxs("div",{className:qt("toggle"),children:[c.jsx("div",{className:qt("leftSideBarToggle"),children:c.jsx(jt,{type:"button",onClick:()=>{k("left")},title:"Toggle left sidebar",children:c.jsx(jy,{focusable:"false"})})}),c.jsx("div",{className:qt("rightSideBarToggle"),children:c.jsx(jt,{type:"button",onClick:()=>{k("right")},title:"Toggle right sidebar",children:c.jsx(Py,{focusable:"false"})})})]}),c.jsx("div",{className:qt("title"),children:c.jsxs(Fl,{rank:"2",size:"xs",children:[s||m||"Page",o&&c.jsxs(c.Fragment,{children:[" ",c.jsx("code",{className:qt("path"),children:o})]})]})}),c.jsxs("div",{className:qt("tools"),children:[c.jsx("div",{className:qt("menuButton"),children:c.jsx(jt,{type:"button",onClick:()=>g(!v),title:"Toggle menu bar",children:v?c.jsx(_d,{focusable:"false"}):c.jsx(or,{focusable:"false"})})}),c.jsx(a2,{dispatch:a,onPublish:t,menuOpen:v,renderHeaderActions:()=>c.jsx(p,{children:c.jsx(fa,{onClick:()=>{const y=l.getState().state.data;t&&t(y)},icon:c.jsx(pc,{size:"14px"}),children:"Publish"})}),setMenuOpen:g})]})]})})})},u2=h.memo(c2);P();P();var d2={SidebarSection:"_SidebarSection_5otpt_1","SidebarSection-title":"_SidebarSection-title_5otpt_12","SidebarSection--noBorderTop":"_SidebarSection--noBorderTop_5otpt_20","SidebarSection-content":"_SidebarSection-content_5otpt_24","SidebarSection-breadcrumbLabel":"_SidebarSection-breadcrumbLabel_5otpt_33","SidebarSection-breadcrumbs":"_SidebarSection-breadcrumbs_5otpt_62","SidebarSection-breadcrumb":"_SidebarSection-breadcrumb_5otpt_33","SidebarSection-heading":"_SidebarSection-heading_5otpt_74","SidebarSection-loadingOverlay":"_SidebarSection-loadingOverlay_5otpt_78"},qn=te("SidebarSection",d2),f2=({children:e,title:t,background:n,showBreadcrumbs:r,noBorderTop:s,isLoading:o})=>c.jsxs("div",{className:qn({noBorderTop:s}),style:{background:n},children:[c.jsx("div",{className:qn("title"),children:c.jsxs("div",{className:qn("breadcrumbs"),children:[r&&c.jsx(cg,{}),c.jsx("div",{className:qn("heading"),children:c.jsx(Fl,{rank:"2",size:"xs",children:t})})]})}),c.jsx("div",{className:qn("content"),children:e}),o&&c.jsx("div",{className:qn("loadingOverlay"),children:c.jsx(Mn,{size:32})})]});P();P();P();var pg={ViewportControls:"_ViewportControls_e3unb_1","ViewportControls--fullScreen":"_ViewportControls--fullScreen_e3unb_5","ViewportControls-toggleButton":"_ViewportControls-toggleButton_e3unb_14","ViewportControls--isExpanded":"_ViewportControls--isExpanded_e3unb_38","ViewportControls-actions":"_ViewportControls-actions_e3unb_42","ViewportControls-actionsInner":"_ViewportControls-actionsInner_e3unb_46","ViewportControls-divider":"_ViewportControls-divider_e3unb_75","ViewportControls-zoomSelect":"_ViewportControls-zoomSelect_e3unb_81","ViewportControls-zoom":"_ViewportControls-zoom_e3unb_81","ViewportButton-inner":"_ViewportButton-inner_e3unb_111","ViewportButton--isActive":"_ViewportButton--isActive_e3unb_119"},Pu={Smartphone:c.jsx(Ly,{size:16}),Tablet:c.jsx($y,{size:16}),Monitor:c.jsx(Id,{size:16}),FullWidth:c.jsx(fy,{size:16})},sn=te("ViewportControls",pg),Au=te("ViewportButton",pg),Ei=({children:e,title:t,onClick:n,isActive:r,disabled:s})=>c.jsx("span",{className:Au({isActive:r}),suppressHydrationWarning:!0,children:c.jsx(jt,{type:"button",title:t,disabled:s||r,onClick:n,suppressHydrationWarning:!0,children:c.jsx("span",{className:Au("inner"),children:e})})}),Ou=[{label:"25%",value:.25},{label:"50%",value:.5},{label:"75%",value:.75},{label:"100%",value:1},{label:"125%",value:1.25},{label:"150%",value:1.5},{label:"200%",value:2}],p2=({autoZoom:e,zoom:t,onViewportChange:n,onZoom:r,fullScreen:s})=>{var o,i;const a=H(m=>m.viewports),l=H(m=>m.state.ui.viewports),u=Ou.find(m=>m.value===e),d=h.useMemo(()=>[...Ou,...u?[]:[{value:e,label:`${(e*100).toFixed(0)}% (Auto)`}]].filter(m=>m.value<=e).sort((m,w)=>m.value>w.value?1:-1),[e]),[f,p]=h.useState(l.current.width);h.useEffect(()=>{p(l.current.width)},[l.current]);const[v,g]=h.useState(!1);return c.jsxs("div",{className:sn({isExpanded:v,fullScreen:s}),suppressHydrationWarning:!0,children:[c.jsx("div",{className:sn("actions"),children:c.jsxs("div",{className:sn("actionsInner"),children:[a.map((m,w)=>c.jsx(Ei,{title:m.label?`Switch to ${m.label} viewport`:"Switch viewport",onClick:()=>{p(m.width),n(m)},isActive:f===m.width,children:typeof m.icon=="string"?Pu[m.icon]||m.icon:m.icon||Pu.Smartphone},w)),c.jsx("div",{className:sn("divider")}),c.jsx(Ei,{title:"Zoom viewport out",disabled:t<=((o=d[0])==null?void 0:o.value),onClick:m=>{m.stopPropagation(),r(d[Math.max(d.findIndex(w=>w.value===t)-1,0)].value)},children:c.jsx(Uy,{size:16})}),c.jsx(Ei,{title:"Zoom viewport in",disabled:t>=((i=d[d.length-1])==null?void 0:i.value),onClick:m=>{m.stopPropagation(),r(d[Math.min(d.findIndex(w=>w.value===t)+1,d.length-1)].value)},children:c.jsx(Wy,{size:16})}),c.jsxs("div",{className:sn("zoom"),children:[c.jsx("div",{className:sn("divider")}),c.jsx("select",{className:sn("zoomSelect"),value:t.toString(),onClick:m=>{m.stopPropagation()},onChange:m=>{r(parseFloat(m.currentTarget.value))},children:d.map(m=>c.jsx("option",{value:m.value,label:m.label},m.label))})]})]})}),c.jsx("button",{className:sn("toggleButton"),title:"Toggle viewport menu",onClick:()=>g(m=>!m),children:v?c.jsx(Vy,{size:16}):c.jsx(Id,{size:16})})]})};P();var h2={PuckCanvas:"_PuckCanvas_t6s9b_1","PuckCanvas-controls":"_PuckCanvas-controls_t6s9b_17","PuckCanvas--fullScreen":"_PuckCanvas--fullScreen_t6s9b_22","PuckCanvas-inner":"_PuckCanvas-inner_t6s9b_33","PuckCanvas-root":"_PuckCanvas-root_t6s9b_42","PuckCanvas--ready":"_PuckCanvas--ready_t6s9b_67","PuckCanvas-loader":"_PuckCanvas-loader_t6s9b_72","PuckCanvas--showLoader":"_PuckCanvas--showLoader_t6s9b_82"};P();var hg=h.createContext(null),g2=({children:e})=>{const t=h.useRef(null),n=h.useMemo(()=>({frameRef:t}),[]);return c.jsx(hg.Provider,{value:n,children:e})},gg=()=>{const e=h.useContext(hg);if(e===null)throw new Error("useCanvasFrame must be used within a FrameProvider");return e},Pr=te("PuckCanvas",h2),Ci=150,v2=()=>{var e;const{frameRef:t}=gg(),n=Md(t),{viewports:r=os,ui:s}=Qo(),{dispatch:o,overrides:i,setUi:a,zoomConfig:l,setZoomConfig:u,status:d,iframe:f,_experimentalFullScreenCanvas:p}=H(Ke(M=>({dispatch:M.dispatch,overrides:M.overrides,setUi:M.setUi,zoomConfig:M.zoomConfig,setZoomConfig:M.setZoomConfig,status:M.status,iframe:M.iframe,_experimentalFullScreenCanvas:M._experimentalFullScreenCanvas}))),{leftSideBarVisible:v,rightSideBarVisible:g,leftSideBarWidth:m,rightSideBarWidth:w,viewports:S}=H(Ke(M=>({leftSideBarVisible:M.state.ui.leftSideBarVisible,rightSideBarVisible:M.state.ui.rightSideBarVisible,leftSideBarWidth:M.state.ui.leftSideBarWidth,rightSideBarWidth:M.state.ui.rightSideBarWidth,viewports:M.state.ui.viewports}))),[k,y]=h.useState(!1),b=h.useRef(!1),j=h.useMemo(()=>({children:D})=>c.jsx(c.Fragment,{children:D}),[]),C=h.useMemo(()=>i.preview||j,[i]),A=h.useCallback(()=>{if(t.current){const M=t.current,D=Od(M);return{width:D.contentBox.width,height:D.contentBox.height}}return{width:0,height:0}},[t]);h.useEffect(()=>{n()},[t,v,g,m,w,S]),h.useEffect(()=>{const{height:M}=A();S.current.height==="auto"&&u(z(O({},l),{rootHeight:M/l.zoom}))},[l.zoom,A,u]),h.useEffect(()=>{n()},[S.current.width,S]),h.useEffect(()=>{if(!t.current)return;const M=new ResizeObserver(()=>{b.current||n()});return M.observe(t.current),()=>{M.disconnect()}},[t.current]);const[_,I]=h.useState(!1);h.useEffect(()=>{setTimeout(()=>{I(!0)},500)},[]);const x=Ae();return h.useEffect(()=>{var M,D;if(typeof window>"u"||(M=s==null?void 0:s.viewports)!=null&&M.current)return;const L=window.innerWidth,N=(D=t.current)==null?void 0:D.getBoundingClientRect().width;if(!L||!N||r.length===0)return;const F=Object.values(r).find(U=>U.width==="100%"),B=!!F;let $=Object.entries(r).filter(([U,Z])=>Z.width!=="100%").map(([U,Z])=>({key:U,diff:Math.abs(L-(typeof Z.width=="string"?L:Z.width)),value:Z})).sort((U,Z)=>U.diff>Z.diff?1:-1)[0].value;if($.width<N&&B&&($=F),f.enabled){const U=x.getState(),Z={state:z(O({},U.state),{ui:z(O({},U.state.ui),{viewports:z(O({},U.state.ui.viewports),{current:z(O({},U.state.ui.viewports.current),{height:($==null?void 0:$.height)||"auto",width:$==null?void 0:$.width})})})})};let ne=U.history;U.history.histories.length===1&&(ne=z(O({},ne),{histories:[Z]})),x.setState(z(O({},Z),{history:ne}))}},[r,t.current,f,x,(e=s==null?void 0:s.viewports)==null?void 0:e.current]),c.jsxs("div",{className:Pr({ready:d==="READY"||!f.enabled||!f.waitForStyles,showLoader:_,fullScreen:p}),onClick:M=>{const D=M.target;!D.hasAttribute("data-puck-component")&&!D.hasAttribute("data-puck-dropzone")&&o({type:"setUi",ui:{itemSelector:null},recordHistory:!1})},children:[S.controlsVisible&&f.enabled&&c.jsx("div",{className:Pr("controls"),children:c.jsx(p2,{fullScreen:p,autoZoom:l.autoZoom,zoom:l.zoom,onViewportChange:M=>{y(!0),b.current=!0;const D=z(O({},M),{height:M.height||"auto",zoom:l.zoom}),L={viewports:z(O({},S),{current:D})};a(L),n({viewports:z(O({},S),{current:D})})},onZoom:M=>{y(!0),b.current=!0,u(z(O({},l),{zoom:M}))}})}),c.jsxs("div",{className:Pr("inner"),ref:t,children:[c.jsx("div",{className:Pr("root"),style:{width:f.enabled?S.current.width:"100%",height:l.rootHeight,transform:f.enabled?`scale(${l.zoom})`:void 0,transition:k?`width ${Ci}ms ease-out, height ${Ci}ms ease-out, transform ${Ci}ms ease-out`:"",overflow:f.enabled?void 0:"auto"},suppressHydrationWarning:!0,id:"puck-canvas-root",onTransitionEnd:()=>{y(!1),b.current=!1},children:c.jsx(C,{children:c.jsx(fg,{})})}),c.jsx("div",{className:Pr("loader"),children:c.jsx(Mn,{size:24})})]})]})};P();function Mu(e,t){const[n,r]=h.useState(null),s=h.useRef(null),o=H(a=>e==="left"?a.state.ui.leftSideBarWidth:a.state.ui.rightSideBarWidth);h.useEffect(()=>{if(typeof window<"u"&&!o)try{const a=localStorage.getItem("puck-sidebar-widths");if(a){const u=JSON.parse(a)[e];u&&t({type:"setUi",ui:{[e==="left"?"leftSideBarWidth":"rightSideBarWidth"]:u}})}}catch(a){console.error(`Failed to load ${e} sidebar width from localStorage`,a)}},[t,e,o]),h.useEffect(()=>{o!==void 0&&r(o)},[o]);const i=h.useCallback(a=>{t({type:"setUi",ui:{[e==="left"?"leftSideBarWidth":"rightSideBarWidth"]:a}});let l={};try{const u=localStorage.getItem("puck-sidebar-widths");l=u?JSON.parse(u):{}}catch(u){console.error(`Failed to save ${e} sidebar width to localStorage`,u)}finally{localStorage.setItem("puck-sidebar-widths",JSON.stringify(z(O({},l),{[e]:a})))}window.dispatchEvent(new CustomEvent("viewportchange",{bubbles:!0,cancelable:!1}))},[t,e]);return{width:n,setWidth:r,sidebarRef:s,handleResizeEnd:i}}P();P();P();var m2={ResizeHandle:"_ResizeHandle_144bf_2","ResizeHandle--left":"_ResizeHandle--left_144bf_16","ResizeHandle--right":"_ResizeHandle--right_144bf_20"},y2=te("ResizeHandle",m2),b2=({position:e,sidebarRef:t,onResize:n,onResizeEnd:r})=>{const{frameRef:s}=gg(),o=Md(s),i=h.useRef(null),a=h.useRef(!1),l=h.useRef(0),u=h.useRef(0),d=h.useCallback(v=>{if(!a.current)return;const g=v.clientX-l.current,m=e==="left"?u.current+g:u.current-g,w=Math.max(192,m);n(w),v.preventDefault()},[n,e]),f=h.useCallback(()=>{var v;if(!a.current)return;a.current=!1,document.body.style.cursor="",document.body.style.userSelect="";const g=document.getElementById("resize-overlay");g&&document.body.removeChild(g),document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",f);const m=((v=t.current)==null?void 0:v.getBoundingClientRect().width)||0;r(m),o()},[r]),p=h.useCallback(v=>{var g;a.current=!0,l.current=v.clientX,u.current=((g=t.current)==null?void 0:g.getBoundingClientRect().width)||0,document.body.style.cursor="col-resize",document.body.style.userSelect="none";const m=document.createElement("div");m.id="resize-overlay",m.setAttribute("data-resize-overlay",""),document.body.appendChild(m),document.addEventListener("mousemove",d),document.addEventListener("mouseup",f),v.preventDefault()},[e,d,f]);return c.jsx("div",{ref:i,className:y2({[e]:!0}),onMouseDown:p})};P();var _2={Sidebar:"_Sidebar_o396p_1","Sidebar--isVisible":"_Sidebar--isVisible_o396p_9","Sidebar--left":"_Sidebar--left_o396p_13","Sidebar--right":"_Sidebar--right_o396p_25","Sidebar-resizeHandle":"_Sidebar-resizeHandle_o396p_37"},Du=te("Sidebar",_2),Tu=({position:e,sidebarRef:t,isVisible:n,onResize:r,onResizeEnd:s,children:o})=>c.jsxs(c.Fragment,{children:[c.jsx("div",{ref:t,className:Du({[e]:!0,isVisible:n}),children:o}),c.jsx("div",{className:`${Du("resizeHandle")}`,children:c.jsx(b2,{position:e,sidebarRef:t,onResize:r,onResizeEnd:s})})]});P();var x2=e=>{let t=e;for(;t&&t!==document.body;){const n=window.getComputedStyle(t);if(n.display==="none"||n.visibility==="hidden"||n.opacity==="0"||t.getAttribute("aria-hidden")==="true"||t.hasAttribute("hidden"))return!1;t=t.parentElement}return!0},w2=e=>{var t;if(e!=null&&e.defaultPrevented)return!0;const n=((t=e==null?void 0:e.composedPath)==null?void 0:t.call(e)[0])||(e==null?void 0:e.target)||document.activeElement;if(n instanceof HTMLElement){const s=n.tagName.toLowerCase();if(s==="input"||s==="textarea"||s==="select"||n.isContentEditable)return!0;const o=n.getAttribute("role");if(o==="textbox"||o==="combobox"||o==="searchbox"||o==="listbox"||o==="grid")return!0}const r=document.querySelector('dialog[open], [aria-modal="true"], [role="dialog"], [role="alertdialog"]');return!!(r&&x2(r))},S2=()=>{const e=Ae(),t=h.useCallback(n=>{var r;if(w2(n))return!1;const{state:s,dispatch:o,permissions:i,selectedItem:a}=e.getState(),l=(r=s.ui)==null?void 0:r.itemSelector;return!(l!=null&&l.zone)||!a||!i.getPermissions({item:a}).delete||o({type:"remove",index:l.index,zone:l.zone}),!0},[e]);zt({delete:!0},t),zt({backspace:!0},t)};P();P();var vg={Nav:"_Nav_1tvxq_1","Nav-list":"_Nav-list_1tvxq_5","Nav-mobileActions":"_Nav-mobileActions_1tvxq_23","NavItem-link":"_NavItem-link_1tvxq_38",NavItem:"_NavItem_1tvxq_38","NavItem-linkIcon":"_NavItem-linkIcon_1tvxq_89","NavItem--active":"_NavItem--active_1tvxq_94","NavItem--mobileOnly":"_NavItem--mobileOnly_1tvxq_121","NavItem--desktopOnly":"_NavItem--desktopOnly_1tvxq_126"},ji=te("Nav",vg),Gs=te("NavItem",vg),k2=({label:e,icon:t,onClick:n,isActive:r,mobileOnly:s,desktopOnly:o})=>c.jsx("li",{className:Gs({active:r,mobileOnly:s,desktopOnly:o}),children:n&&c.jsxs("div",{className:Gs("link"),onClick:n,children:[t&&c.jsx("span",{className:Gs("linkIcon"),children:t}),c.jsx("span",{className:Gs("linkLabel"),children:e})]})}),I2=({items:e,mobileActions:t})=>c.jsxs("nav",{className:ji(),children:[c.jsx("ul",{className:ji("list"),children:Object.entries(e).map(([n,r])=>c.jsx(k2,O({},r),n))}),t&&c.jsx("div",{className:ji("mobileActions"),children:t})]}),Ru=te("Puck",ql),Ks=te("PuckLayout",ql),Lu=te("PuckPluginTab",ql),E2=()=>{const e=H(t=>{var n,r,s;return t.selectedItem?(r=(n=t.config.components[t.selectedItem.type])==null?void 0:n.label)!=null?r:t.selectedItem.type.toString():((s=t.config.root)==null?void 0:s.label)||"Page"});return c.jsx(f2,{noBorderTop:!0,showBreadcrumbs:!0,title:e,children:c.jsx(Wl,{})})},C2=({children:e,visible:t,mobileOnly:n})=>c.jsx("div",{className:Lu({visible:t,mobileOnly:n}),children:c.jsx("div",{className:Lu("body"),children:e})}),mg=({children:e})=>{const{iframe:t,dnd:n,initialHistory:r,plugins:s,height:o}=Qo(),i=h.useMemo(()=>O({enabled:!0,waitForStyles:!0},t),[t]);s2(i.enabled);const a=H($=>$.dispatch),l=H($=>$.state.ui.leftSideBarVisible),u=H($=>$.state.ui.rightSideBarVisible),d=H($=>$.instanceId),{width:f,setWidth:p,sidebarRef:v,handleResizeEnd:g}=Mu("left",a),{width:m,setWidth:w,sidebarRef:S,handleResizeEnd:k}=Mu("right",a);h.useEffect(()=>{window.matchMedia("(min-width: 638px)").matches||a({type:"setUi",ui:{leftSideBarVisible:!1,rightSideBarVisible:!1}});const $=()=>{window.matchMedia("(min-width: 638px)").matches||a({type:"setUi",ui:U=>O(O({},U),U.rightSideBarVisible?{leftSideBarVisible:!1}:{})})};return window.addEventListener("resize",$),()=>{window.removeEventListener("resize",$)}},[]);const y=H($=>$.overrides),b=h.useMemo(()=>y.puck||xa,[y]),[j,C]=h.useState(!1);h.useEffect(()=>{C(!0)},[]);const A=H($=>$.status==="READY");qy(),h.useEffect(()=>{if(A&&i.enabled){const $=Pn();if($)return Cd($)}},[A,i.enabled]),o2(),S2();const _={};f&&(_["--puck-user-left-side-bar-width"]=`${f}px`),m&&(_["--puck-user-right-side-bar-width"]=`${m}px`);const I=H($=>$.setUi),x=H($=>{var U;return(U=$.state.ui.plugin)==null?void 0:U.current}),M=Ae(),[D,L]=h.useState("toggle"),N=h.useMemo(()=>!!(s!=null&&s.find($=>$.name==="legacy-side-bar")),[s]),F=h.useMemo(()=>{const $={},U=[eg(),lg()],Z=Y=>Y.name==="legacy-side-bar"?-1:0,ne=[...U,...s??[]].sort((Y,se)=>Z(Y)-Z(se));return s!=null&&s.some(Y=>Y.name==="fields")||ne.push(ug()),ne==null||ne.forEach(Y=>{var se,ve;Y.name&&Y.render&&($[Y.name]&&delete $[Y.name],$[Y.name]={label:(se=Y.label)!=null?se:Y.name,icon:(ve=Y.icon)!=null?ve:c.jsx(Fy,{}),onClick:()=>{var ie;L((ie=Y.mobilePanelHeight)!=null?ie:"toggle"),Y.name===x?I(l?{leftSideBarVisible:!1}:{leftSideBarVisible:!0}):Y.name&&I({plugin:{current:Y.name},leftSideBarVisible:!0})},isActive:l&&x===Y.name,render:Y.render,mobileOnly:N||Y.mobileOnly,desktopOnly:Y.name==="legacy-side-bar"||Y.desktopOnly})}),$},[s,x,M,l]);h.useEffect(()=>{if(!x){const $=Object.keys(F);I({plugin:{current:$[0]}})}},[F,x]);const B=F.fields&&F.fields.mobileOnly===!1,K=H($=>{var U;return(U=$.state.ui.mobilePanelExpanded)!=null?U:!1});return c.jsxs("div",{className:`Puck ${Ru({hidePlugins:N})}`,id:d,style:{height:o},children:[c.jsx($w,{disableAutoScroll:n==null?void 0:n.disableAutoScroll,children:c.jsx(b,{children:e||c.jsx(g2,{children:c.jsx("div",{className:Ks({leftSideBarVisible:l,mounted:j,rightSideBarVisible:!B&&u,isExpanded:K,mobilePanelHeightToggle:D==="toggle",mobilePanelHeightMinContent:D==="min-content"}),style:{height:o},children:c.jsxs("div",{className:Ks("inner"),style:_,children:[c.jsx("div",{className:Ks("header"),children:c.jsx(u2,{hidePlugins:N})}),c.jsx("div",{className:Ks("nav"),children:c.jsx(I2,{items:F,mobileActions:l&&D==="toggle"&&c.jsx(jt,{type:"button",title:"maximize",onClick:()=>{I({mobilePanelExpanded:!K})},children:K?c.jsx(Ey,{size:21}):c.jsx(Iy,{size:21})})})}),c.jsx(Tu,{position:"left",sidebarRef:v,isVisible:l,onResize:p,onResizeEnd:g,children:Object.entries(F).map(([$,{mobileOnly:U,render:Z,label:ne}])=>c.jsx(C2,{visible:x===$,mobileOnly:U,children:c.jsx(Z,{})},$))}),c.jsx(v2,{}),!B&&c.jsx(Tu,{position:"right",sidebarRef:S,isVisible:u,onResize:w,onResizeEnd:k,children:c.jsx(E2,{})})]})})})})}),c.jsx("div",{id:"puck-portal-root",className:Ru("portal")})]})},yg=h.createContext({});function j2(e){return c.jsx(yg.Provider,{value:e,children:e.children})}var Qo=()=>h.useContext(yg);function P2({children:e}){const{config:t,data:n,ui:r,onChange:s,permissions:o={},plugins:i,overrides:a,viewports:l=os,iframe:u,initialHistory:d,metadata:f,onAction:p,fieldTransforms:v,_experimentalFullScreenCanvas:g,_experimentalVirtualization:m}=Qo(),w=h.useMemo(()=>O({enabled:!0,waitForStyles:!0},u),[u]),[S]=h.useState(()=>{var L,N,F;const B=O(O({},Mi.ui),r);let K={};Object.keys((n==null?void 0:n.root)||{}).length>0&&!((L=n==null?void 0:n.root)!=null&&L.props)&&console.warn("Warning: Defining props on `root` is deprecated. Please use `root.props`, or republish this page to migrate automatically.");const $=((N=n==null?void 0:n.root)==null?void 0:N.props)||(n==null?void 0:n.root)||{},U=O(O({},(F=t.root)==null?void 0:F.defaultProps),$),Z=Ma(_s(z(O({},n==null?void 0:n.root),{props:U})),t),ne=z(O({},Mi),{data:z(O({},n),{root:z(O({},n==null?void 0:n.root),{props:Z.props}),content:n.content||[]}),ui:z(O(O({},B),K),{componentList:t.categories?Object.entries(t.categories).reduce((Y,[se,ve])=>z(O({},Y),{[se]:{title:ve.title,components:ve.components,expanded:ve.defaultExpanded,visible:ve.visible}}),{}):{}})});return ht(ne,t)}),{appendData:k=!0}=d||{},[y]=h.useState([...(d==null?void 0:d.histories)||[],...k?[{state:S}]:[]].map(L=>{let N=O(O({},S),L.state);return L.state.indexes||(N=ht(N,t)),z(O({},L),{state:N})})),b=h.useMemo(()=>(d==null?void 0:d.index)!==void 0&&(d==null?void 0:d.index)>=0&&(d==null?void 0:d.index)<y.length?d==null?void 0:d.index:y.length-1,[]),j=y[b].state,C=t2({overrides:a,plugins:i}),A=h.useMemo(()=>{const N=(i||[]).reduce((F,B)=>O(O({},F),B.fieldTransforms),{});return O(O({},N),v)},[v,i]),_=Jo(),I=h.useCallback(L=>({instanceId:_,state:L,config:t,plugins:i||[],overrides:C,viewports:l,iframe:w,_experimentalFullScreenCanvas:!!g,_experimentalVirtualization:!!m,onAction:p,metadata:f,fieldTransforms:A}),[_,j,t,i,C,l,w,g,m,p,f,A]),[x]=h.useState(()=>jd(I(j)));h.useEffect(()=>{},[x]),h.useEffect(()=>{const L=x.getState().state;x.setState(O({},I(L)))},[I]),Gy(x,{histories:y,index:b,initialAppState:j});const M=h.useRef(null);h.useEffect(()=>x.subscribe(L=>L.state.data,L=>{if(s){if(ss(L,M.current))return;s(L),M.current=L}}),[s]),Jy(x,o);const D=vS(x);return h.useEffect(()=>{const{resolveAndCommitData:L}=x.getState();setTimeout(()=>{L()},0)},[]),c.jsx(Ra.Provider,{value:x,children:c.jsx(Vl.Provider,{value:D,children:e})})}function Sr(e){return c.jsx(j2,z(O({},e),{children:c.jsx(P2,z(O({},e),{children:c.jsx(mg,{children:e.children})}))}))}Sr.Components=Qh;Sr.Fields=Wl;Sr.Layout=mg;Sr.Outline=ag;Sr.Preview=fg;P();P();P();P();P();P();P();P();P();P();P();P();P();P();const A2="dev",bg="/",O2=`
161
+ html, body {
162
+ margin: 0 !important;
163
+ padding: 0 !important;
164
+ height: 100% !important;
165
+ min-height: 100% !important;
166
+ overflow: hidden !important;
167
+ }
168
+ #frame-root,
169
+ [data-puck-entry],
170
+ body > div:first-child {
171
+ height: 100% !important;
172
+ min-height: 100% !important;
173
+ overflow-y: auto !important;
174
+ overflow-x: hidden !important;
175
+ overscroll-behavior: contain !important;
176
+ -webkit-overflow-scrolling: touch !important;
177
+ }
178
+ /* Default theme — blocks CSS uses these variables but the editor doesn't define them.
179
+ In the real site, globals.css provides these. In Puck's iframe, we inject defaults. */
180
+ :root {
181
+ --bg-0: #ffffff;
182
+ --bg-100: #f8f9fa;
183
+ --bg-1: #ffffff;
184
+ --section-bg: var(--bg-100);
185
+ --text-100: #1a1a2e;
186
+ --text-200: #4a4a6a;
187
+ --text-300: #52525b;
188
+ --heading: #1a1a2e;
189
+ --body: #333355;
190
+ --body-secondary: #6b7280;
191
+ --caption: #64748b;
192
+ --brand: #24613b;
193
+ --brand-hover: #1b4d2e;
194
+ --brand-subtle: #d4edda;
195
+ --brand-fg: #ffffff;
196
+ --surface: #ffffff;
197
+ --surface-border: #e5e7eb;
198
+ --border: #e5e7eb;
199
+ --card-bg: #f8fafc;
200
+ --card-shadow: 0 1px 3px rgba(0,0,0,0.08);
201
+ --hero-bg: var(--bg-0);
202
+ --cta-bg: var(--bg-100);
203
+ --placeholder-img: #e2e8f0;
204
+ --footer-bg: #1a1a2e;
205
+ --footer-text: #cbd5e1;
206
+ --footer-heading: #f1f5f9;
207
+ --footer-link: #94a3b8;
208
+ --footer-link-hover: #e2e8f0;
209
+ --footer-border: #2d2d4a;
210
+ --font-body: system-ui, -apple-system, sans-serif;
211
+ --font-heading: system-ui, -apple-system, sans-serif;
212
+ --radius-btn: 6px;
213
+ --radius-card: 8px;
214
+ --radius-feature: 8px;
215
+ }
216
+ `;function M2(e){return e?Yg(e.replace(/\r\n?/g,`
217
+ `)).map(_g).join(""):""}function Do(e){return e.map(t=>{const n=t.children?t.children.type==="ordered-list"?`<ol>${Do(t.children.items)}</ol>`:`<ul>${Do(t.children.items)}</ul>`:"";return`<li>${uo(t.inline)}${n}</li>`}).join("")}function _g(e){switch(e.type){case"heading":{const t=Gg(e.level),n=`<h${t}>${uo(e.inline)}</h${t}>`;return e.trailing?`${n}<p>${uo(e.trailing)}</p>`:n}case"unordered-list":return`<ul>${Do(e.items)}</ul>`;case"ordered-list":return`<ol>${Do(e.items)}</ol>`;case"blockquote":return`<blockquote>${e.children.map(_g).join("")}</blockquote>`;case"code":return`<pre><code${e.language?` class="language-${xg(e.language)}"`:""}>${un(e.code)}</code></pre>`;case"rule":return"<hr>";default:return`<p>${uo(e.inline)}</p>`}}function un(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function xg(e){return un(e).replace(/"/g,"&quot;")}function uo(e){return e.map(t=>{switch(t.type){case"strong":return`<strong>${un(t.text)}</strong>`;case"em":return`<em>${un(t.text)}</em>`;case"strike":return`<s>${un(t.text)}</s>`;case"code":return`<code>${un(t.text)}</code>`;case"link":return`<a href="${xg(t.href)}">${un(t.text)}</a>`;case"break":return"<br>";default:return un(t.text.replace(/\n/g," "))}}).join("")}function wg(e){return e?T2(e).replace(/<h([1-6])[^>]*>(.*?)<\/h\1>/gi,(t,n,r)=>`${"#".repeat(Number(n))} ${Sg(r)}
218
+
219
+ `).replace(/<pre[^>]*>\s*<code[^>]*class="language-([^"]*)"[^>]*>(.*?)<\/code>\s*<\/pre>/gis,(t,n,r)=>"```"+n+`
220
+ `+wa(r)+"\n```\n\n").replace(/<pre[^>]*>\s*<code[^>]*>(.*?)<\/code>\s*<\/pre>/gis,(t,n)=>"```\n"+wa(n)+"\n```\n\n").replace(/<blockquote[^>]*>(.*?)<\/blockquote>/gis,(t,n)=>wg(n).split(`
221
+ `).map(s=>s?`> ${s}`:">").join(`
222
+ `)+`
223
+
224
+ `).replace(/<hr\s*\/?>/gi,`---
225
+
226
+ `).replace(/<p[^>]*>(.*?)<\/p>/gis,(t,n)=>`${Eg(n)}
227
+
228
+ `).replace(/<br\s*\/?>/gi,`\\
229
+ `).replace(/\n{3,}/g,`
230
+
231
+ `).trim():""}function Sg(e){return Eg(e).replace(/<[^>]+>/g,"")}function kg(e,t,n){const r=new RegExp(`<${n}\\b[^>]*>|</${n}>`,"gi");r.lastIndex=t;let s=1,o;for(;(o=r.exec(e))!==null;)if(o[0][1]==="/"){if(s-=1,s===0)return{contentEnd:o.index,after:r.lastIndex}}else s+=1;return{contentEnd:e.length,after:e.length}}function D2(e){const t=[],n=/<li\b[^>]*>|<\/li>/gi;let r=0,s=-1,o;for(;(o=n.exec(e))!==null;)o[0][1]!=="/"?(r===0&&(s=n.lastIndex),r+=1):(r-=1,r===0&&s>=0&&(t.push(e.slice(s,o.index)),s=-1));return s>=0&&t.push(e.slice(s)),t}function Ig(e,t,n){const r=" ".repeat(n);return D2(e).map((s,o)=>{let i=s,a="";const l=/<(ul|ol)\b[^>]*>/i.exec(s);if(l){const d=l[1].toLowerCase(),f=kg(s,l.index+l[0].length,d);a=`
232
+ `+Ig(s.slice(l.index+l[0].length,f.contentEnd),d==="ol",n+1),i=s.slice(0,l.index)+s.slice(f.after)}const u=t?`${o+1}. `:"- ";return r+u+Sg(i).trim()+a}).join(`
233
+ `)}function T2(e){let t="",n=0;for(;n<e.length;){const r=/<(ul|ol)\b[^>]*>/i.exec(e.slice(n));if(!r){t+=e.slice(n);break}const s=n+r.index;t+=e.slice(n,s);const o=r[1].toLowerCase(),i=s+r[0].length,a=kg(e,i,o);t+=Ig(e.slice(i,a.contentEnd),o==="ol",0)+`
234
+
235
+ `,n=a.after}return t}function wa(e){return e.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")}function Eg(e){return e.replace(/<code[^>]*>(.*?)<\/code>/gi,(t,n)=>"`"+wa(n)+"`").replace(/<s[^>]*>(.*?)<\/s>/gi,"~~$1~~").replace(/<del[^>]*>(.*?)<\/del>/gi,"~~$1~~").replace(/<strong[^>]*>(.*?)<\/strong>/gi,"**$1**").replace(/<b[^>]*>(.*?)<\/b>/gi,"**$1**").replace(/<em[^>]*>(.*?)<\/em>/gi,"*$1*").replace(/<i[^>]*>(.*?)<\/i>/gi,"*$1*").replace(/<a[^>]*href="([^"]*)"[^>]*>(.*?)<\/a>/gi,"[$2]($1)")}function Nu(e,t){var n;return e.kind==="number"?{type:"number",label:e.label}:e.kind==="enum"?{type:"select",label:e.label,options:e.options??[]}:e.kind==="headingLevel"?{type:"select",label:e.label,options:["h1","h2","h3","h4","h5","h6"]}:e.kind==="richtext"?{type:"richtext",label:e.label,contentEditable:!1}:e.kind==="image"?((n=t==null?void 0:t.mapImageField)==null?void 0:n.call(t,e))??{type:"text",label:e.label}:e.multiline===!0?{type:"textarea",label:e.label}:{type:"text",label:e.label}}function R2(e,t,n){var i,a,l,u;const r=Zg(e),s={},o=new Set;for(const[d,f]of Object.entries(r.fields)){const v=(t==null?void 0:t.fields[d])??f;s[d]=Nu(v,n),v.kind==="richtext"&&o.add(d)}for(const[d,f]of Object.entries(r.listFields)){const p={};for(const[v,g]of Object.entries(f.itemFields)){const m=(a=(i=t==null?void 0:t.listFields)==null?void 0:i[d])==null?void 0:a.itemFields[v];p[v]=Nu(m??g,n)}s[d]={type:"array",label:((u=(l=t==null?void 0:t.listFields)==null?void 0:l[d])==null?void 0:u.label)??f.label??d,arrayFields:p,getItemSummary:(v,g)=>{const m=typeof v.title=="string"?v.title.trim():"";return m.length>0?m:`Item ${g+1}`}}}return{fields:s,richtextKeys:o}}const Cg=new Map;function L2(e,t){t.size>0&&Cg.set(e,t)}function jg(e,t,n){const r=Cg.get(e);if(!r)return t;const s={...t};for(const o of r)typeof s[o]=="string"&&(s[o]=n(s[o]));return s}function N2(e,t){return jg(e,t,wg)}function Pg(e){const t=e.blocks.map(n=>({type:n.type,props:{id:n.id,...jg(n.type,n.props,M2),_blockId:n.id}}));return{root:{},content:t}}function To(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}function Cn(e){if(typeof e!="string")return;const t=e.trim();return t.length>0?t:void 0}function Ag(e){const t="Block",n=Cn(e);return n&&n.replace(/[^A-Za-z0-9_-]+/g,"")||t}function z2(e){const t=Math.random().toString(36).slice(2,8);return`b_${e.toLowerCase()}_${Date.now().toString(36)}_${t}`}function $2(e,t){const{id:n,_blockId:r,...s}=e;return N2(t,s)}function Ro(e){return e==null?String(e):typeof e!="object"?JSON.stringify(e):Array.isArray(e)?`[${e.map(Ro).join(",")}]`:`{${Object.entries(e).sort(([n],[r])=>n.localeCompare(r)).map(([n,r])=>`${JSON.stringify(n)}:${Ro(r)}`).join(",")}}`}function zu(e){return e.content.map(t=>{const n=To(t),r=To(n.props),s=Cn(r.id)??Cn(r._blockId),o=Ag(n.type);return s?{id:s,type:o,props:$2(r,o)}:null}).filter(t=>!!t)}function $u(e){let t=!1;const n=e.content.map(r=>{const s=To(r),o=r&&typeof r=="object"?r:{},i=Ag(s.type),a=To(s.props),l=Cn(a.id)??Cn(a._blockId);if(l&&Cn(a.id)&&Cn(a._blockId))return r;t=!0;const u=l??z2(i),d={...a,id:u,_blockId:u};return{...o,type:i,props:d}});return t?{...e,content:n}:e}function F2(e,t,n){const r=zu(t),s=zu(n),o=new Map(r.map(p=>[p.id,p])),i=new Map(s.map(p=>[p.id,p])),a=new Set;for(const[p,v]of o){const g=i.get(p);g&&g.type!==v.type&&a.add(p)}const l=[];for(const p of r)(!i.has(p.id)||a.has(p.id))&&l.push({op:"remove_block",pageSlug:e,blockId:p.id});for(let p=0;p<s.length;p+=1){const v=s[p];if(o.has(v.id)&&!a.has(v.id))continue;const g=p>0?s[p-1]:void 0,m={id:v.id,type:v.type,props:v.props};g!=null&&g.id?l.push({op:"add_block",pageSlug:e,afterBlockId:g.id,block:m}):l.push({op:"add_block",pageSlug:e,block:m})}for(const p of s){if(a.has(p.id))continue;const v=o.get(p.id);v&&Ro(v.props)!==Ro(p.props)&&l.push({op:"update_props",pageSlug:e,blockId:p.id,patch:p.props})}const u=r.filter(p=>i.has(p.id)&&!a.has(p.id)).map(p=>p.id),d=s.filter(p=>o.has(p.id)&&!a.has(p.id)).map(p=>p.id),f=[...u];for(let p=0;p<d.length;p+=1){const v=d[p],g=f.indexOf(v);if(g<0||g===p)continue;const m=p>0?d[p-1]:void 0;m?l.push({op:"move_block",pageSlug:e,blockId:v,afterBlockId:m}):l.push({op:"move_block",pageSlug:e,blockId:v}),f.splice(g,1),f.splice(p,0,v)}return l}function B2(e){if(typeof structuredClone=="function")try{return structuredClone(e)}catch{}return JSON.parse(JSON.stringify(e))}function H2(e){return e?e.replace(/\[(\d+)\]/g,".$1").split(".").map(n=>n.trim()).filter(Boolean).map(n=>/^\d+$/.test(n)?Number(n):n):[]}function V2(e,t,n){const r=H2(t);if(r.length===0)return!1;let s=e;for(let a=0;a<r.length-1;a+=1){const l=r[a],u=r[a+1];if(typeof l=="number"){if(!Array.isArray(s))return!1;const p=s;(p[l]===void 0||p[l]===null||typeof p[l]!="object")&&(p[l]=typeof u=="number"?[]:{}),s=p[l];continue}if(!s||typeof s!="object")return!1;const d=s,f=d[l];(f==null||typeof f!="object")&&(d[l]=typeof u=="number"?[]:{}),s=d[l]}const o=r[r.length-1];if(typeof o=="number"){if(!Array.isArray(s))return!1;const a=s;return Object.is(a[o],n)?!1:(a[o]=n,!0)}if(!s||typeof s!="object")return!1;const i=s;return Object.is(i[o],n)?!1:(i[o]=n,!0)}function W2(e,t){return e.content.findIndex(n=>{const r=n.props;if(!r||typeof r!="object")return!1;const s=r;return s.id===t||s._blockId===t})}function U2(e,t,n){const r=W2(e,t);if(r<0)return e;const s=e.content[r];if(!s.props||typeof s.props!="object")return e;const o=B2(s.props);let i=!1;for(const[l,u]of Object.entries(n)){if(!l)continue;V2(o,l,u)&&(i=!0)}if(!i)return e;const a=[...e.content];return a[r]={...s,props:o},{...e,content:a}}let Sa=null;function q2(e){Sa=e}function Dt(){if(!Sa)throw new Error("Puck host API is not configured");return Sa}function Z2(e){return e?/^(https?:\/\/|data:|blob:)/i.test(e)?e:e.startsWith("/")?`${Dt().siteOrigin}${e}`:e:""}function Y2({value:e,readOnly:t,onChoose:n,onClear:r}){const s=e.trim().length>0,o=s?Z2(e):"";return c.jsxs("div",{className:"puck-poc-image-field",children:[c.jsx("div",{className:"puck-poc-image-field__preview",children:s?c.jsxs(c.Fragment,{children:[c.jsx("img",{src:o,alt:""}),c.jsx("span",{children:e})]}):c.jsx("span",{className:"puck-poc-image-field__placeholder",children:"No image selected"})}),c.jsxs("div",{className:"puck-poc-image-field__actions",children:[c.jsx("button",{type:"button",onClick:n,disabled:t,children:s?"Replace image":"Choose image"}),s?c.jsx("button",{type:"button",onClick:r,disabled:t,children:"Remove"}):null]})]})}function G2(e,t){const n=Jg();return{components:Object.fromEntries(e.blocks.map(s=>{const{fields:o,richtextKeys:i}=R2(s,n[s.type],{mapImageField:a=>({type:"custom",label:a.label,render:({value:l,onChange:u,readOnly:d})=>c.jsx(Y2,{value:typeof l=="string"?l:"",readOnly:!!d,onChoose:()=>{d||t==null||t({currentUrl:typeof l=="string"?l:void 0,onSelect:f=>u(f)})},onClear:()=>{d||u("")}})})});return L2(s.type,i),[s.type,{fields:o,defaultProps:s.defaultProps,permissions:{drag:!0,delete:!0,duplicate:!0,edit:!0,insert:!0},render:a=>{const l=typeof a._blockId=="string"&&a._blockId.trim().length>0?a._blockId:`puck-${s.type}`,{_blockId:u,id:d,...f}=a;return Kg(s.type)?c.jsx(Xg,{block:{id:l,type:s.type,props:f}}):c.jsxs("section",{style:{padding:"16px",border:"1px dashed #9ca3af",borderRadius:8},children:[c.jsx("strong",{children:s.type}),c.jsx("p",{style:{margin:"8px 0 0",fontSize:13},children:"No renderer is registered for this block in the editor runtime."})]})}}]}))}}const Og=h.createContext(null);function K2({value:e,children:t}){return c.jsx(Og.Provider,{value:e,children:t})}function X2(){return h.useContext(Og)}function es(e){if(typeof e!="string")return;const t=e.trim();return t.length>0?t:void 0}function Fu(e){if(!e||typeof e!="object")return;const t=e;return es(t.id)??es(t._blockId)}function Bu(e){var l,u;if(!((l=e==null?void 0:e.appState)!=null&&l.ui)||!((u=e.appState)!=null&&u.data))return;const t=e.selectedItem,n={activeBlockId:Fu(t==null?void 0:t.props),activeBlockType:es(t==null?void 0:t.type)},r=e.appState.ui.itemSelector,s=(()=>{var p;if(!r)return;const d=r.zone?(p=e.appState.data.zones)==null?void 0:p[r.zone]:e.appState.data.content,f=d==null?void 0:d[r.index];if(f)return{activeBlockId:Fu(f.props),activeBlockType:es(f.type)}})(),o=n.activeBlockId??(s==null?void 0:s.activeBlockId),i=n.activeBlockType??(s==null?void 0:s.activeBlockType),a=es(e.appState.ui.field.focus);if(!(!o&&!i&&!a))return{activeBlockId:o,activeBlockType:i,activeEditablePath:a}}const J2=mS();function Q2(){const e=X2();return e?c.jsx(ek,{...e}):null}function ek({session:e,siteId:t,isBusy:n,error:r,chatEntries:s,streamStatus:o,streamingText:i,streamSteps:a,streamingChanges:l,undoInFlightEntryId:u,onSendPrompt:d,onCancelPrompt:f,onClickSuggestion:p,onUndo:v,onSelectionChange:g}){const m=Dt(),w=m.useMediaInput(),S=m.ChatComposerCore,[k,y]=h.useState(""),[b,j]=h.useState([]),C=h.useRef(null),A=h.useRef(!0),_=h.useRef(!1),I=Xh(),x=J2(Y=>JSON.stringify(Bu(Y)??null)),M=h.useMemo(()=>{try{return JSON.parse(x)??void 0}catch{return}},[x]),D=h.useMemo(()=>Array.isArray(s)?s.filter(Y=>!!(Y&&typeof Y=="object")):[],[s]),[L,N]=h.useState([]);h.useEffect(()=>{if(typeof window>"u")return;const Y=`editor-chat-log-v1:${e}:${t}`;let se=null;const ve=()=>{try{const Q=window.localStorage.getItem(Y);if(Q===se)return;if(se=Q,!Q){N([]);return}const V=JSON.parse(Q);if(!Array.isArray(V)){N([]);return}N(V.filter(E=>!!(E&&typeof E=="object")))}catch{N([])}},ie=Q=>{Q.key&&Q.key!==Y||ve()};ve(),window.addEventListener("storage",ie);const Oe=window.setInterval(ve,700);return()=>{window.removeEventListener("storage",ie),window.clearInterval(Oe)}},[e,t]);const F=D.length>0?D:L,B=F.some(Y=>Y.role==="user"),K=F.length>0||!!i||!!o,$=h.useMemo(()=>a.filter(Y=>Y.done),[a]),U=h.useCallback(()=>{const Y=C.current;Y&&(Y.scrollTop=Y.scrollHeight)},[]),Z=h.useCallback(()=>{const Y=C.current;if(!Y)return;const se=Y.scrollHeight-Y.scrollTop-Y.clientHeight;A.current=se<64},[]),ne=h.useCallback(Y=>{const se=(Y??k).trim();if(!se)return;const ve=Bu(I());g(ve),y(""),j([]),A.current=!0,U(),d(se)},[k,I,g,d,U]);return h.useEffect(()=>{g(M)},[M==null?void 0:M.activeBlockId,M==null?void 0:M.activeBlockType,M==null?void 0:M.activeEditablePath,g]),h.useEffect(()=>{if(!K||!!_.current&&!A.current)return;const se=window.requestAnimationFrame(()=>{U(),_.current=!0});return()=>{window.cancelAnimationFrame(se)}},[K,F.length,i,o,a.length,l.length,U]),c.jsxs("div",{className:"puck-poc-chat puck-poc-chat--plugin",children:[c.jsx("div",{className:"puck-poc-chat__header",children:c.jsx("h1",{children:"AI Page Builder"})}),c.jsxs("div",{className:"puck-poc-chat__surface",children:[c.jsxs("div",{ref:C,className:"puck-poc-chat__thread-core",onScroll:Z,children:[F.length===0&&!i&&!o?c.jsx("article",{className:"chat-thread-empty",children:"Start chatting to see responses here."}):null,F.map(Y=>{const se=typeof Y.text=="string"&&Y.text.trim().length>0?Y.text:"…",ve=Y.role==="user"?"user":"assistant",ie=Array.isArray(Y.suggestions)?Y.suggestions.filter(Oe=>typeof Oe=="string"&&Oe.trim().length>0):[];return c.jsxs("article",{className:`puck-poc-msg puck-poc-msg--${ve}`,children:[c.jsx("div",{className:"puck-poc-msg__main",children:(()=>{if(Y.role!=="assistant")return se;try{return m.renderFinalMarkdown(se)}catch{return se}})()}),ie.length>0?c.jsx("div",{className:"msg-suggestions",children:ie.map((Oe,Q)=>c.jsx("button",{type:"button",className:"msg-suggestion",onClick:()=>void p(Oe),disabled:n,children:Oe},`${Y.id}-${Q}`))}):null,Y.canUndo||Y.wasUndone?c.jsx("div",{className:"msg-undo-row",children:c.jsx("button",{type:"button",className:"msg-undo-btn",onClick:()=>void v(Y.id),disabled:!Y.canUndo||n||u!==null,children:Y.wasUndone?"Undone":"Undo"})}):null]},Y.id)}),i?c.jsxs("article",{className:"puck-poc-msg puck-poc-msg--assistant",children:[$.length>0?c.jsx("ul",{className:"stream-steps stream-steps-in-bubble",children:$.map((Y,se)=>c.jsx("li",{className:"stream-step is-done",children:Y.label},se))}):null,c.jsx("div",{className:"puck-poc-msg__main",children:m.renderSimpleMarkdown(i)}),l.length>0?c.jsxs("ul",{className:"msg-list",children:[l.slice(0,8).map((Y,se)=>c.jsx("li",{children:Y},se)),l.length>8?c.jsxs("li",{className:"msg-list-overflow",children:["and ",l.length-8," more…"]}):null]}):null]}):o?c.jsxs("article",{className:"puck-poc-msg puck-poc-msg--assistant",children:[$.length>0?c.jsx("ul",{className:"stream-steps stream-steps-in-bubble",children:$.map((Y,se)=>c.jsx("li",{className:"stream-step is-done",children:Y.label},se))}):null,c.jsx("div",{className:"puck-poc-msg__main",children:o})]}):null]}),c.jsx(S,{message:k,isLoading:n,hasUserEntry:B,onMessageChange:y,onSubmit:ne,onTranscribeAudio:w.transcribeAudio,onUploadAttachment:w.uploadAttachment,attachments:b,onAttachmentsChange:j,onCancel:f,onAutoHeightChange:()=>{},className:"composer puck-poc-chat__composer-core"})]}),r?c.jsx("p",{className:"puck-poc-chat__error",children:r}):null]})}function tk({dispatchRef:e}){const t=Xh();return h.useEffect(()=>(e.current=n=>t().dispatch(n),()=>{e.current=null}),[e,t]),null}function nk({document:e,children:t}){return h.useEffect(()=>{if(!e)return;const n=()=>{const s=e.documentElement,o=e.body,i=e.getElementById("frame-root")??e.querySelector("[data-puck-entry]");s.style.setProperty("margin","0","important"),s.style.setProperty("padding","0","important"),s.style.setProperty("height","100%","important"),s.style.setProperty("min-height","100%","important"),s.style.setProperty("overflow","hidden","important"),o&&(o.style.setProperty("margin","0","important"),o.style.setProperty("padding","0","important"),o.style.setProperty("height","100%","important"),o.style.setProperty("min-height","100%","important"),o.style.setProperty("overflow","hidden","important")),i&&(i.style.setProperty("height","100%","important"),i.style.setProperty("min-height","100%","important"),i.style.setProperty("overflow-y","auto","important"),i.style.setProperty("overflow-x","hidden","important"),i.style.setProperty("overscroll-behavior","contain","important"),i.style.setProperty("-webkit-overflow-scrolling","touch","important"))};n();const r=new MutationObserver(()=>n());return r.observe(e.documentElement,{childList:!0,subtree:!0}),()=>r.disconnect()},[e]),c.jsxs(c.Fragment,{children:[c.jsx("style",{children:O2}),t]})}function rk(){const e=Dt();if(typeof window>"u")return e.LEGACY_AVOCADO_SITE_ID;const t=e.sanitizeSiteId(new URLSearchParams(window.location.search).get("siteId")??"");return t||e.sanitizeSiteId(e.resolveEditorSiteId())||e.LEGACY_AVOCADO_SITE_ID}async function ei(e,t){const n=await fetch(e,t);if(!n.ok){const r=await n.text().catch(()=>"");throw new Error(`${n.status} ${n.statusText}${r?`: ${r}`:""}`)}return await n.json()}async function sk(e){const t=Dt(),n=await ei(`${t.siteOrigin}/api/editor/pages?siteId=${encodeURIComponent(e)}`);return Array.isArray(n.pages)?n.pages:[]}async function ok(e,t,n){const r=Dt();await fetch(`${r.orchestrator}/draft/bootstrap`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({session:e,siteId:t,overwrite:!1,...n.length>0?{pages:n}:{}})}).catch(()=>{})}function ik(){const e=Dt();return ei(`${e.siteOrigin}/api/editor/blocks`)}async function Mg(e,t){const n=Dt(),r=await ei(`${n.orchestrator}/draft/slugs?session=${encodeURIComponent(e)}&siteId=${encodeURIComponent(t)}`);return Array.isArray(r.slugs)&&r.slugs.length>0?r.slugs:["/"]}function Dg(e,t,n){const r=Dt();return ei(`${r.orchestrator}/draft/pages?session=${encodeURIComponent(e)}&siteId=${encodeURIComponent(t)}&slug=${encodeURIComponent(n)}`)}async function ak(e,t,n){const r=Dt();if(n.length===0)return!0;const s=await fetch(`${r.orchestrator}/ops`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({session:e,siteId:t,ops:n})}),o=await s.json().catch(()=>({}));return s.ok&&(o==null?void 0:o.status)==="applied"}async function lk(){const e=Dt(),t=[`${e.orchestrator}/status/planner`];e.orchestrator.includes("localhost")&&t.push(`${e.orchestrator.replace("localhost","127.0.0.1")}/status/planner`);for(const n of t)try{const r=await fetch(n);if(!r.ok)continue;const s=await r.json();return s.features?s.features:null}catch{}return null}function ck({session:e,siteId:t,slug:n,setSlug:r}){const[s,o]=h.useState(null),[i,a]=h.useState(null),[l,u]=h.useState(0),[d,f]=h.useState([bg]),[p,v]=h.useState(!1),[g,m]=h.useState(!1),[w,S]=h.useState(null),k=h.useRef(0),y=h.useCallback(async()=>{let _=[];try{_=await sk(t)}catch{}await ok(e,t,_)},[e,t]),b=h.useRef(n);b.current=n;const j=h.useCallback(async()=>{const[_,I]=await Promise.all([ik(),Mg(e,t)]);o(_),f(I),I.includes(b.current)||r(I[0])},[e,t,r]),C=h.useCallback(async _=>{const I=++k.current,x=await Dg(e,t,_);I===k.current&&(a(Pg(x)),u(M=>M+1))},[e,t]),A=h.useRef(!1);return h.useEffect(()=>{let _=!1;return(async()=>{S(null),m(!0);try{if(await y(),_||(await j(),_))return;await C(b.current),A.current=!0}catch(x){if(_)return;S(x instanceof Error?x.message:"Failed to load Puck prototype")}finally{_||m(!1)}})(),()=>{_=!0}},[y,j,C]),h.useEffect(()=>{A.current&&(S(null),C(n).catch(()=>{}))},[C,n]),{manifest:s,puckData:i,setPuckData:a,remotePuckVersion:l,availableSlugs:d,setAvailableSlugs:f,isLoadingSlugs:p,setIsLoadingSlugs:v,isBusy:g,error:w}}function uk(){const[e,t]=h.useState({});return h.useEffect(()=>{let n=!0;return(async()=>{const s=await lk();!n||!s||t(o=>o.googleDrive===s.googleDrive&&o.unsplash===s.unsplash&&o.imageGenerate===s.imageGenerate&&o.imageGenerateChat===s.imageGenerateChat?o:s)})(),()=>{n=!1}},[]),e}function dk({session:e,siteId:t,slugRef:n,setSlug:r,setAvailableSlugs:s,puckDispatchRef:o,setPuckData:i,onRemoteData:a}){const l=h.useCallback(async f=>{const p=await Dg(e,t,f),v=Pg(p);o.current&&o.current({type:"setData",data:v}),i(v),a==null||a(v)},[e,t,o,i,a]),u=h.useCallback((f,p)=>{if(f==="liveDraft"){const g=typeof p.blockId=="string"?p.blockId:"",m=p.fields;if(!g||!m||typeof m!="object"||Array.isArray(m))return;i(w=>{if(!w)return w;const S=U2(w,g,m);return S!==w&&o.current&&o.current({type:"setData",data:S}),S});return}if(f!=="draftUpdated")return;const v=typeof p.navigateTo=="string"&&p.navigateTo.length>0?p.navigateTo:n.current;v!==n.current&&(r(v),s(g=>g.includes(v)?g:[...g,v])),Mg(e,t).then(s).catch(()=>{}),l(v).catch(()=>{})},[e,t,i,o,n,r,s,l]),d=h.useCallback((f,p,v,g)=>{l(n.current).catch(()=>{})},[n,l]);return{postToSite:u,postPatchToSite:d,syncDraftPage:l}}const fk=600;function pk({host:e}){var He;q2(e);const t=Dt(),[n]=h.useState(A2),[r]=h.useState(()=>rk()),[s,o]=h.useState(bg),[i]=h.useState(()=>t.resolveDefaultModelKey()),[a]=h.useState(()=>t.resolveDefaultProvider()),[l]=h.useState(!0),[u,d]=h.useState(void 0),[f,p]=h.useState(void 0),[v,g]=h.useState(void 0),[m,w]=h.useState(null),S=h.useRef(null),k=h.useRef(void 0),y=h.useRef(void 0),b=h.useRef(void 0),j=h.useRef(s);j.current=s;const C=h.useRef(null),A=h.useRef(null),_=h.useRef(null),I=h.useRef(null),x=h.useRef(!1),M=t.agentModeEnabled??!1,D=h.useMemo(()=>{const re=t.loadSiteListFromStorage(r).find(Ne=>Ne.id===r),he=r===t.LEGACY_AVOCADO_SITE_ID?t.LEGACY_AVOCADO_SITE_NAME:t.siteNameFromId(r)||(re==null?void 0:re.name)||"Site";return re?{...re,name:he}:{id:r,name:he,purpose:"",hosting:"",vercelProjectId:"",vercelTeamId:"",vercelProductionUrl:"",vercelDeployHookUrl:"",tone:"",constraints:[]}},[r,t]);h.useEffect(()=>{typeof document>"u"||(document.body.classList.remove("panel-resizing"),document.body.style.userSelect="")},[]),h.useEffect(()=>{t.setGlobalSlug(s)},[s,t]);const L=h.useCallback(J=>{w(J)},[]),{manifest:N,puckData:F,setPuckData:B,remotePuckVersion:K,availableSlugs:$,setAvailableSlugs:U,isLoadingSlugs:Z,setIsLoadingSlugs:ne,isBusy:Y,error:se}=ck({session:n,siteId:r,slug:s,setSlug:o}),ve=uk(),ie=h.useCallback(J=>{C.current=J,A.current=J},[]),{postToSite:Oe,postPatchToSite:Q,syncDraftPage:V}=dk({session:n,siteId:r,slugRef:j,setSlug:o,setAvailableSlugs:U,puckDispatchRef:S,setPuckData:B,onRemoteData:ie}),E=h.useMemo(()=>N?G2(N,L):null,[N,L]),T=h.useCallback(J=>{if(!N)return null;const re=N.blocks.find(he=>he.type===J);return!(re!=null&&re.defaultProps)||typeof re.defaultProps!="object"?null:re.defaultProps},[N]),R=t.useChatEngine({session:n,siteId:r,activeSiteConfig:D,slug:s,setSlug:o,modelKey:i,provider:a,useStreaming:l,activeBlockIdRef:k,activeBlockTypeRef:y,activeEditablePathRef:b,setActiveBlockId:d,setActiveBlockType:p,setActiveEditablePath:g,postToSite:Oe,postPatchToSite:Q,setAvailableSlugs:U,setIsLoadingSlugs:ne,routeOptions:$,componentManifest:N,allowStructuralEdits:!0,getBlockDefaultProps:T,agentModeEnabled:M}),W=t.usePublish(n,r,R.isLoading),q=h.useCallback(J=>{const re=J==null?void 0:J.activeBlockId,he=J==null?void 0:J.activeBlockType,Ne=J==null?void 0:J.activeEditablePath;k.current!==re&&(k.current=re,d(re)),y.current!==he&&(y.current=he,p(he)),b.current!==Ne&&(b.current=Ne,g(Ne)),t.setGlobalSelection(J)},[t]),X=h.useCallback(async J=>{await R.submitChat(J)},[R]),oe=h.useCallback(()=>{R.cancelChat()},[R]),me=h.useCallback(async J=>{await R.submitChat(J)},[R]),ke=h.useCallback(async J=>{await R.applyUndoHistory(J)},[R]),we=h.useCallback(async()=>{if(x.current)return;const J=_.current;if(!J)return;const re=A.current;if(_.current=null,!re){A.current=J;return}const he=F2(j.current,re,J);if(he.length===0){A.current=J;return}x.current=!0;try{await ak(n,r,he)?A.current=J:V(j.current).catch(()=>{})}catch{V(j.current).catch(()=>{})}finally{x.current=!1,_.current&&we()}},[n,r,V]),Me=h.useCallback(J=>{_.current=J,!(typeof window>"u")&&(I.current!==null&&window.clearTimeout(I.current),I.current=window.setTimeout(()=>{I.current=null,we()},fk))},[we]),De=h.useCallback(J=>{!A.current&&F&&(A.current=F);const re=$u(J);C.current=re,B(re),Me(re)},[F,Me,B]),Ie=h.useCallback(async J=>{!A.current&&F&&(A.current=F);const re=$u(J);C.current=re,B(re),_.current=re,typeof window<"u"&&I.current!==null&&(window.clearTimeout(I.current),I.current=null),await we(),await W.publishSite()},[we,F,B,W]),ye=h.useCallback(async J=>{typeof window<"u"&&I.current!==null&&(window.clearTimeout(I.current),I.current=null),await we(),J==="undo"?await R.applyGlobalUndo():await R.applyGlobalRedo()},[we,R]);h.useEffect(()=>{C.current=F??null},[F]),h.useEffect(()=>{C.current&&(A.current=C.current)},[K,s]),h.useEffect(()=>()=>{typeof window<"u"&&I.current!==null&&(window.clearTimeout(I.current),I.current=null)},[]);const Fe=Y||R.isLoading||Z,gt=h.useMemo(()=>({iframe:nk,headerActions:({children:J})=>{var re;return c.jsxs(c.Fragment,{children:[c.jsx(tk,{dispatchRef:S}),c.jsxs("a",{href:"/sites",className:"puck-poc-header-btn puck-poc-header-back",title:"Back to sites","aria-label":"Back to sites",children:[c.jsx(bv,{size:16}),c.jsx("span",{children:"Sites"})]}),c.jsx("label",{className:"puck-poc-header-page-select",title:"Select page",children:c.jsx("select",{value:s,onChange:he=>o(he.target.value),disabled:Fe,children:$.map(he=>c.jsx("option",{value:he,children:t.slugLabel(he)},he))})}),c.jsx("button",{type:"button",className:"puck-poc-header-btn",disabled:!R.canUndoServer||Fe,onClick:()=>void ye("undo"),title:"Undo (Ctrl+Z)","aria-label":"Undo",children:c.jsx(Qg,{size:16})}),c.jsx("button",{type:"button",className:"puck-poc-header-btn",disabled:!R.canRedoServer||Fe,onClick:()=>void ye("redo"),title:"Redo (Ctrl+Y)","aria-label":"Redo",children:c.jsx(ev,{size:16})}),(re=W.publishStatus)!=null&&re.inspectUrl?c.jsx("a",{className:"puck-publish-link",href:W.publishStatus.inspectUrl,target:"_blank",rel:"noreferrer",children:"View deploy"}):null,J]})}}),[$,Fe,s,W.publishStatus,R.canUndoServer,R.canRedoServer,ye]),en=h.useMemo(()=>({name:"ai-site-editor-chat",label:"AI",icon:c.jsx(xv,{size:24}),render:()=>c.jsx(Q2,{})}),[]),[tn,Vt]=h.useState(!1),le=h.useCallback(async J=>{Vt(!0);try{typeof window<"u"&&I.current!==null&&(window.clearTimeout(I.current),I.current=null),await we(),await t.restoreToVersion(n,r,j.current,J)&&await V(j.current)}finally{Vt(!1)}},[we,t,n,r,V]),_e=h.useMemo(()=>({name:"ai-site-editor-history",label:"History",icon:c.jsx(Sv,{size:24}),render:()=>c.jsx(t.VersionHistoryPanel,{session:n,siteId:r,slug:s,visible:!0,onRestore:le,isRestoring:tn})}),[t,n,r,s,le,tn]),Le=h.useMemo(()=>[en,_e,eg(),lg(),ug({desktopSideBar:"right"})],[en,_e]),Te=h.useMemo(()=>({session:n,siteId:r,isBusy:Y||R.isLoading,error:se,chatEntries:R.chatLog,streamStatus:R.streamStatus,streamingText:R.streamingText,streamSteps:R.streamSteps,streamingChanges:R.streamingChanges,undoInFlightEntryId:R.undoInFlightEntryId,onSendPrompt:X,onCancelPrompt:oe,onClickSuggestion:me,onUndo:ke,onSelectionChange:q}),[n,r,Y,se,R.chatLog,R.isLoading,R.streamStatus,R.streamingText,R.streamSteps,R.streamingChanges,R.undoInFlightEntryId,X,oe,me,ke,q]);return!E||!F?c.jsx("div",{className:"puck-poc-loading",children:"Loading…"}):c.jsxs(c.Fragment,{children:[c.jsx(K2,{value:Te,children:c.jsx("div",{className:"puck-poc-root",children:c.jsx(Sr,{config:E,data:F,onChange:De,onPublish:Ie,iframe:{enabled:!1},viewports:[{width:390,height:844,icon:"Smartphone",label:"Mobile"},{width:768,height:960,icon:"Tablet",label:"Tablet"},{width:"100%",height:900,icon:"Monitor",label:"Full width"}],overrides:gt,plugins:Le},`${s}-${K}`)})}),c.jsx(t.ImagePickerModal,{open:!!m,features:{...ve,googleDrive:!!(ve.googleDrive||(He=D==null?void 0:D.gdriveFolderId)!=null&&He.trim())},currentUrl:m==null?void 0:m.currentUrl,gdriveFolderId:D==null?void 0:D.gdriveFolderId,cmsMedia:D==null?void 0:D.cmsMedia,siteOrigin:t.siteOrigin,onClose:()=>w(null),onSelect:J=>{m==null||m.onSelect(J),w(null)}})]})}const hk={LEGACY_AVOCADO_SITE_ID:gv,LEGACY_AVOCADO_SITE_NAME:hv,loadSiteListFromStorage:pv,resolveDefaultModelKey:fv,resolveDefaultProvider:dv,siteNameFromId:uv,siteOrigin:Yl,slugLabel:cv,resolveEditorSiteId:lv,sanitizeSiteId:av,orchestrator:Zl,usePublish:(e,t,n)=>{const r=Ut(s=>s.pushAssistantFromResult);return mv(e,t,n,r,Yl)},useChatEngine:e=>{const t=vv(e),n=Ut(l=>l.chatLog),r=Ut(l=>l.isLoading),s=Ut(l=>l.streamStatus),o=Ut(l=>l.streamingText),i=Ut(l=>l.streamSteps),a=Ut(l=>l.streamingChanges);return{...t,chatLog:n,isLoading:r,streamStatus:s,streamingText:o,streamSteps:i,streamingChanges:a}},VersionHistoryPanel:iv,restoreToVersion:async(e,t,n,r)=>{try{return(await(await fetch(`${Zl}/history/restore`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({session:e,siteId:t,slug:n,targetVersion:r})})).json()).status==="applied"}catch{return!1}},ImagePickerModal:ov,ChatComposerCore:sv,useMediaInput:rv,renderFinalMarkdown:nv,renderSimpleMarkdown:tv,setGlobalSelection:e=>{const t=Ut.getState();t.setActiveBlock(e==null?void 0:e.activeBlockId,e==null?void 0:e.activeBlockType),t.setActiveEditablePath(e==null?void 0:e.activeEditablePath)},setGlobalSlug:e=>{Ut.getState().setSlug(e)},agentModeEnabled:!1};function gk(){return c.jsx(pk,{host:hk})}const jk=Object.freeze(Object.defineProperty({__proto__:null,PuckPrototypeRoute:gk},Symbol.toStringTag,{value:"Module"}));export{Ta as A,Bd as E,oy as H,Hb as L,jk as P,La as S,z as _,H as a,O as b,Fd as c,ze as d,fb as e,pb as f,te as g,hb as h,P as i,zo as j,Ek as o,id as s,Ae as u};