etudes 14.7.0 → 16.0.0
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.
- package/build/etudes.js +5 -5
- package/build/etudes.umd.cjs +2 -2
- package/package.json +1 -1
package/build/etudes.js
CHANGED
|
@@ -925,7 +925,7 @@ const hr = /* @__PURE__ */ Oe(({
|
|
|
925
925
|
K,
|
|
926
926
|
{
|
|
927
927
|
"aria-selected": Q,
|
|
928
|
-
className: se({
|
|
928
|
+
className: se({ active: Q }),
|
|
929
929
|
index: z,
|
|
930
930
|
isSelected: C(z),
|
|
931
931
|
item: H,
|
|
@@ -939,7 +939,7 @@ const hr = /* @__PURE__ */ Oe(({
|
|
|
939
939
|
he,
|
|
940
940
|
{
|
|
941
941
|
"aria-selected": Q,
|
|
942
|
-
className: se({
|
|
942
|
+
className: se({ active: Q }),
|
|
943
943
|
element: J.item ?? /* @__PURE__ */ x.jsx(kt, {}),
|
|
944
944
|
role: A,
|
|
945
945
|
selectionMode: P,
|
|
@@ -7388,9 +7388,9 @@ const Zc = Oe(({
|
|
|
7388
7388
|
}), lr = ({ children: e, ...r }) => /* @__PURE__ */ x.jsx("div", { ...r, children: e }), ur = ({ children: e, ...r }) => /* @__PURE__ */ x.jsx("div", { ...r, children: e });
|
|
7389
7389
|
function Qc({ isOn: e = !1 }) {
|
|
7390
7390
|
return {
|
|
7391
|
-
root: se({
|
|
7392
|
-
knob: se({
|
|
7393
|
-
track: se({
|
|
7391
|
+
root: se({ active: e }),
|
|
7392
|
+
knob: se({ active: e }),
|
|
7393
|
+
track: se({ active: e })
|
|
7394
7394
|
};
|
|
7395
7395
|
}
|
|
7396
7396
|
function el({ isOn: e = !1, isInverted: r = !1, knobSize: s = Me.zero, orientation: a = "horizontal" }) {
|
package/build/etudes.umd.cjs
CHANGED
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
<%s {...props} />
|
|
20
20
|
React keys must be passed directly to JSX without using spread:
|
|
21
21
|
let props = %s;
|
|
22
|
-
<%s key={someKey} {...props} />`,ie,xe,J,xe),H[xe+ie]=!0)}if(xe=null,oe!==void 0&&(s(oe),xe=""+oe),h(Y)&&(s(Y.key),xe=""+Y.key),"key"in Y){oe={};for(var ze in Y)ze!=="key"&&(oe[ze]=Y[ze])}else oe=Y;return xe&&g(oe,typeof C=="function"?C.displayName||C.name||"Unknown":C),S(C,xe,ve,fe,l(),oe,Ee,Se)}function P(C){typeof C=="object"&&C!==null&&C.$$typeof===j&&C._store&&(C._store.validated=1)}var O=N,j=Symbol.for("react.transitional.element"),L=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),$=Symbol.for("react.profiler"),Q=Symbol.for("react.consumer"),B=Symbol.for("react.context"),G=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),F=Symbol.for("react.lazy"),W=Symbol.for("react.activity"),Z=Symbol.for("react.client.reference"),re=O.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=Object.prototype.hasOwnProperty,U=Array.isArray,D=console.createTask?console.createTask:function(){return null};O={"react-stack-bottom-frame":function(C){return C()}};var z,te={},ee=O["react-stack-bottom-frame"].bind(O,u)(),ce=D(a(u)),H={};ht.Fragment=x,ht.jsx=function(C,Y,oe,ie,fe){var ve=1e4>re.recentlyCreatedOwnerStacks++;return k(C,Y,oe,!1,ie,fe,ve?Error("react-stack-top-frame"):ee,ve?D(a(C)):ce)},ht.jsxs=function(C,Y,oe,ie,fe){var ve=1e4>re.recentlyCreatedOwnerStacks++;return k(C,Y,oe,!0,ie,fe,ve?Error("react-stack-top-frame"):ee,ve?D(a(C)):ce)}}()),ht}var Ar;function Ai(){return Ar||(Ar=1,process.env.NODE_ENV==="production"?zt.exports=Ri():zt.exports=ji()),zt.exports}var b=Ai();function Mr(e){var r,s,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var l=e.length;for(r=0;r<l;r++)e[r]&&(s=Mr(e[r]))&&(a&&(a+=" "),a+=s)}else for(s in e)e[s]&&(a&&(a+=" "),a+=s);return a}function ae(){for(var e,r,s=0,a="",l=arguments.length;s<l;s++)(e=arguments[s])&&(r=Mr(e))&&(a&&(a+=" "),a+=r);return a}var Rn,zr;function Mi(){return zr||(zr=1,Rn=function e(r,s){if(r===s)return!0;if(r&&s&&typeof r=="object"&&typeof s=="object"){if(r.constructor!==s.constructor)return!1;var a,l,u;if(Array.isArray(r)){if(a=r.length,a!=s.length)return!1;for(l=a;l--!==0;)if(!e(r[l],s[l]))return!1;return!0}if(r.constructor===RegExp)return r.source===s.source&&r.flags===s.flags;if(r.valueOf!==Object.prototype.valueOf)return r.valueOf()===s.valueOf();if(r.toString!==Object.prototype.toString)return r.toString()===s.toString();if(u=Object.keys(r),a=u.length,a!==Object.keys(s).length)return!1;for(l=a;l--!==0;)if(!Object.prototype.hasOwnProperty.call(s,u[l]))return!1;for(l=a;l--!==0;){var h=u[l];if(!(h==="_owner"&&r.$$typeof)&&!e(r[h],s[h]))return!1}return!0}return r!==r&&s!==s}),Rn}var zi=Mi();const Ve=Ir(zi);var pe;(e=>{e.zero=r();function r(x=0,R=0){if(typeof x=="number")return{x,y:R};if(!O(x))throw Error("Invalid parameters passed to constructor");return x instanceof Array?{x:x[0],y:x[1]}:{x:x.x,y:x.y}}e.make=r;function s(x,R={}){return r({x:typeof R.x=="number"?R.x:x.x,y:typeof R.y=="number"?R.y:x.y})}e.clone=s;function a(x,R){return r({x:x.x+R.x,y:x.y+R.y})}e.add=a;function l(x,R){return r({x:x.x-R.x,y:x.y-R.y})}e.subtract=l;function u(x,R){return r({x:x.x*R.x,y:x.y*R.y})}e.multiply=u;function h(x,R){return r({x:x.x/R.x,y:x.y/R.y})}e.divide=h;function g(x){return r({x:x.y,y:x.x})}e.invert=g;function m(x,R){return!(x.x!==R.x||x.y!==R.y)}e.isEqual=m;function S(x){return`Point(x=${x.x}, y=${x.y})`}e.toString=S;function k(x){return Object.freeze({x:x.x,y:x.y})}e.toJSON=k;function P(x){return[x.x,x.y]}e.toArray=P;function O(x){return x instanceof Array?!(x.length!==2||typeof x[0]!="number"||typeof x[1]!="number"):typeof x=="object"?!(typeof x.x!="number"||typeof x.y!="number"):!1}e.isValidDescriptor=O;function j(x){return typeof x=="object"&&typeof x.x=="number"&&typeof x.y=="number"}e.isPoint=j;function L(x){return x.x===0&&x.y===0}e.isZero=L})(pe||(pe={}));function Li(e,r){try{const s=pe.isValidDescriptor(e)&&pe.make(e),a=pe.isValidDescriptor(r)&&pe.make(r);if(s&&!a){const l=r instanceof Array?r:[r],u=l.length;for(let h=0;h<u;h++){const g=ge.from(l[h]);if(!g)continue;const m=s.x>=g.left&&s.x<=g.right,S=s.y>=g.top&&s.y<=g.bottom;if(m&&S)return!0}return!1}else if(!s&&a){const l=e instanceof Array?e:[e],u=l.length;for(let h=0;h<u;h++){const g=ge.from(l[h]);if(!g)continue;const m=a.x>=g.left&&a.x<=g.right,S=a.y>=g.top&&a.y<=g.bottom;if(m&&S)return!0}return!1}else{if(s&&a)return pe.isEqual(s,a);{const l=[...e instanceof Array?e:[e],...r instanceof Array?r:[r]],u=ge.intersecting.apply(null,l);return u?u.width*u.height!==0:!1}}}catch(s){return console.error(s),!1}}var Pe;(e=>{e.zero=r();function r(x=0,R=0){if(typeof x=="number")return{width:x,height:R};if(!O(x))throw Error("Invalid parameters passed to constructor");return x instanceof Array?{width:x[0],height:x[1]}:{width:x.width,height:x.height}}e.make=r;function s(x,R={}){return r({width:typeof R.width=="number"?R.width:x.width,height:typeof R.height=="number"?R.height:x.height})}e.clone=s;function a(x,R){return r({width:x.width+R.width,height:x.height+R.height})}e.add=a;function l(x,R){return r({width:x.width-R.width,height:x.height-R.height})}e.subtract=l;function u(x,R){return r({width:x.width*R.width,height:x.height*R.height})}e.multiply=u;function h(x,R){return r({width:x.width/R.width,height:x.height/R.height})}e.divide=h;function g(x){return r({width:x.height,height:x.width})}e.invert=g;function m(x,R){return!(x.width!==R.width||x.height!==R.height)}e.isEqual=m;function S(x){return`Size(width=${x.width}, height=${x.height})`}e.toString=S;function k(x){return Object.freeze({width:x.width,height:x.height})}e.toJSON=k;function P(x){return[x.width,x.height]}e.toArray=P;function O(x){return x instanceof Array?!(x.length!==2||typeof x[0]!="number"||typeof x[1]!="number"):typeof x=="object"?!(typeof x.width!="number"||typeof x.height!="number"):!1}e.isValidDescriptor=O;function j(x){return typeof x=="object"&&typeof x.width=="number"&&typeof x.height=="number"}e.isSize=j;function L(x){return x.width===0&&x.height===0}e.isZero=L})(Pe||(Pe={}));var ge;(e=>{e.zero=r();function r(T=0,I=0,E=0,F=0){if(typeof T=="number"&&typeof I=="number"){const W=T,Z=I;return{top:Z,right:W+E,bottom:Z+F,left:W,width:E,height:F}}else if(pe.isPoint(T)&&Pe.isSize(I)){const W=T,Z=I;return{top:W.y,right:W.x+Z.width,bottom:W.y+Z.height,left:W.x,width:Z.width,height:Z.height}}else{const W=T;if(!Q(W))throw Error("Invalid parameters passed to constructor");return{top:W.y,right:W.x+W.width,bottom:W.y+W.height,left:W.x,width:W.width,height:W.height}}}e.make=r;function s(T){return pe.make({x:(T.right-T.left)/2+T.left,y:(T.bottom-T.top)/2+T.top})}e.center=s;function a(T){return Pe.make({width:T.width,height:T.height})}e.size=a;function l(T,I={}){try{if(T==null)return;if(B(T))return T;if(pt(T))return l(document.documentElement||document.body.parentNode||document.body,I);const E=T instanceof Array?T:[T],F=E.length,W=I.reference||window,Z=u(),re=pt(W)?Z:l(I.reference);if(!Z||!re)return;let q;for(let U=0;U<F;U++){const D=E[U],z=D.getBoundingClientRect(),te=r({x:z.left+Z.left-(pt(W)?0:re.left),y:z.top+Z.top-(pt(W)?0:re.top),width:I.overflow?D.scrollWidth:D instanceof HTMLElement?D.offsetWidth:z.width,height:I.overflow?D.scrollHeight:D instanceof HTMLElement?D.offsetHeight:z.height});q=q?O(q,te):te}return q}catch(E){console.error(E);return}}e.from=l;function u(){const T=Math.max(document.documentElement.clientWidth,window.innerWidth||0),I=Math.max(document.documentElement.clientHeight,window.innerHeight||0),E=window.pageXOffset!==void 0?window.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft,F=window.pageYOffset!==void 0?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop;return r({x:E,y:F,width:T,height:I})}e.fromViewport=u;function h(T,I={}){if(T)return pt(T)?l(Array.from(document.body.children)):l(Array.from(T.children),{overflow:I.overflow,reference:I.reference||T})}e.fromChildrenOf=h;function g(T,I,E={}){if(!I)return;const F=Array.from(I.children);return T<=0?r():T>=F.length?l(F,{reference:E.reference,overflow:!1}):(F.splice(T),l(F,{reference:E.reference||I,overflow:!1}))}e.fromChildrenBefore=g;function m(T,I,E={}){if(!I)return;const F=Array.from(I.children);return T<0?l(F,{reference:E.reference,overflow:!1}):T>=F.length-1?r():(F.splice(0,F.length-T-1),l(F,{reference:E.reference||I,overflow:!1}))}e.fromChildrenAfter=m;function S(T,I,E={}){if(!I)return;const F=I.children[T];return l(F,{overflow:E.overflow,reference:E.reference||I})}e.fromChildAt=S;function k(...T){try{const I=T.length,E={};let F,W;for(let Z=0;Z<I;Z++){if(F||(F=l(T[Z])),Z===0&&Z+1===I)W=u();else if(Z+1<I)W=l(T[Z+1]);else break;!F||!W||(E.width=Math.max(0,Math.min(F.right,W.right)-Math.max(F.left,W.left)),E.height=Math.max(0,Math.min(F.bottom,W.bottom)-Math.max(F.top,W.top)),E.y=Math.max(F.top,W.top),E.x=Math.max(F.left,W.left),E.width*E.height===0&&(E.width=0,E.height=0,E.y=NaN,E.x=NaN),F=r(E))}return r(E)}catch(I){console.error(I);return}}e.intersecting=k;function P(T,I={}){return r({x:typeof I.x=="number"?I.x:T.left,y:typeof I.y=="number"?I.y:T.top,width:typeof I.width=="number"?I.width:T.width,height:typeof I.height=="number"?I.height:T.height})}e.clone=P;function O(T,I){return r({x:Math.min(T.left,I.left),y:Math.min(T.top,I.top),width:Math.max(T.right,I.right)-Math.min(T.left,I.left),height:Math.max(T.bottom,I.bottom)-Math.min(T.top,I.top)})}e.concat=O;function j(T){return r({x:T.left,y:T.top,width:T.height,height:T.width})}e.invert=j;function L(T,I){return!(T.top!==I.top||T.right!==I.right||T.bottom!==I.bottom||T.left!==I.left||T.width!==I.width||T.height!==I.height)}e.isEqual=L;function x(T,I){return Li(I,T)}e.contains=x;function R(T){return`Rect(top=${T.top}, right=${T.right}, bottom=${T.bottom}, left=${T.left}, width=${T.width}, height=${T.height})`}e.toString=R;function $(T){return Object.freeze({top:T.top,right:T.right,bottom:T.bottom,left:T.left,width:T.width,height:T.height})}e.toJSON=$;function Q(T){return!(typeof T.x!="number"||typeof T.y!="number"||typeof T.width!="number"||typeof T.height!="number")}e.isValidDescriptor=Q;function B(T){return typeof T=="object"&&typeof T.top=="number"&&typeof T.right=="number"&&typeof T.bottom=="number"&&typeof T.left=="number"&&typeof T.width=="number"&&typeof T.height=="number"}e.isRect=B;function G(T){return T.top===0&&T.right===0&&T.bottom===0&&T.left===0&&T.width===0&&T.height===0}e.isZero=G})(ge||(ge={}));function pt(e){return e===window}function Ne(e){const r=N.useRef(e);return N.useEffect(()=>{r.current=e},[e]),r}function Lt(e,{onResize:r}){const s=Ne(r);N.useLayoutEffect(()=>{const a=e.current;if(!a)return;const l=new ResizeObserver(()=>{s.current?.(a)});return l.observe(a),()=>{l.disconnect()}},[e.current])}function jn(e){const[r,s]=N.useState(ge.zero);return Lt(e,{onResize:a=>{const l=ge.from(a);l&&s(l)}}),ge.size(r)}function gt({in:e,children:r,render:s}){if(e==null)return b.jsx(b.Fragment,{});if(!(e instanceof Array))throw TypeError(`Provided list <${e}> is not an array`);return b.jsx(b.Fragment,{children:e.map((a,l)=>b.jsx(N.Fragment,{children:s?.(a,l)??(typeof r=="function"?r(a,l):r)},`item-${l}`))})}process.env.NODE_ENV!=="production"&&(gt.displayName="Each");function Ft(e,r={},...s){const{className:a,style:l,...u}=r,{className:h,style:g,...m}=e.props;return N.cloneElement(e,{className:`${h??""} ${a??""}`.split(" ").filter(Boolean).join(" ")||void 0,style:{...g??{},...l??{}},...m,...u},...s)}function me({children:e,element:r,...s}){return Ft(r,s,...e?Array.isArray(e)?e:[e]:[])}process.env.NODE_ENV!=="production"&&(me.displayName="Styled");function Oe(e,r={}){const s=Object.keys(r),a=Object.values(r),l={};return N.Children.forEach(e,u=>{if(!N.isValidElement(u)){console.error("[etudes::asComponentDict] Invalid child detected");return}const h=a.indexOf(u.type);if(h<0){console.error(`[etudes::asComponentDict] Unsupported child, only the following children are allowed: ${a.map(m=>m.displayName??m.name).join(", ")}`);return}const g=s[h];if(l[g]){console.error(`[etudes::asComponentDict] Only one ${a[h]} can be provided as a child`);return}l[g]=u}),l}function Fi(e){return e}function le(...e){return e.reduce((r,s)=>({...r,...s||{}}),{})}const Dt=N.forwardRef(({className:e,children:r,style:s,isSelectionTogglable:a=!1,itemLength:l,itemPadding:u=0,items:h=[],layout:g="list",numSegments:m=1,orientation:S="vertical",selection:k,selectionMode:P="none",onActivateAt:O,onDeselectAt:j,onCustomEvent:L,onSelectAt:x,onSelectionChange:R,ItemComponent:$,...Q},B)=>{const G=Vi(k??[],h),T=Bi({itemLength:l,itemPadding:u,layout:g,numSegments:m,orientation:S}),I=U=>G.indexOf(U)>=0,E=U=>{I(U)?W(U):F(U)},F=U=>{if(I(U))return;let D;switch(P){case"multiple":{D=ee=>Lr([...ee.filter(ce=>ce!==U),U]);break}case"single":{D=ee=>[U];break}default:return}const z=G,te=D(G);re(z,te)},W=U=>{if(!I(U))return;const D=ee=>ee.filter(ce=>ce!==U),z=G,te=D(G);re(z,te)},Z=U=>{O?.(U),P!=="none"&&(a?E(U):F(U))},re=(U,D)=>{if(Ve(U,D))return;const z=U?.filter(ee=>D.indexOf(ee)===-1)??[],te=D.filter(ee=>U?.indexOf(ee)===-1);z.forEach(ee=>j?.(ee)),te.forEach(ee=>x?.(ee)),R?.(D)};N.useEffect(()=>{const U=G;let D;switch(P){case"multiple":D=G;break;case"single":D=G.slice(-1);break;default:D=[];break}re(U,D)},[P]);const q=Oe(r,{item:st});return b.jsx("div",{...Q,ref:B,"aria-multiselectable":P==="multiple",className:ae(e),role:g==="grid"?"grid":P==="none"?"list":"listbox",style:le(s,T.root),children:b.jsx(gt,{in:h,children:(U,D)=>{const z=g==="grid"?"gridcell":P==="none"?"listitem":"option",te=I(D),ee=le(T.item,{pointerEvents:a!==!0&&I(D)?"none":"auto",...D>=h.length-1?{}:{...g==="list"?{...S==="vertical"?{marginBottom:`${u}px`}:{marginRight:`${u}px`}}:{}}});return $?b.jsx($,{"aria-selected":te,className:ae({selected:te}),index:D,isSelected:I(D),item:U,orientation:S,role:z,style:ee,onClick:()=>Z(D),onCustomEvent:(ce,H)=>L?.(D,ce,H)}):b.jsx(me,{"aria-selected":te,className:ae({selected:te}),element:q.item??b.jsx(st,{}),role:z,selectionMode:P,style:ee,onActivateAt:O,onClick:()=>Z(D),children:`${U}`})}})})}),st=({children:e,selectionMode:r,onActivateAt:s,...a})=>s||r==="single"||r==="multiple"?b.jsx("button",{...a,children:e}):b.jsx("div",{...a,children:e});function Di(e,r){return!!(isNaN(e)||e>=r.length||e<0)}function Vi(e,r){return Lr(e).filter(s=>!Di(s,r))}function Lr(e){return e.sort((r,s)=>r-s)}function Bi({itemLength:e=NaN,itemPadding:r=0,layout:s="collection",numSegments:a=1,orientation:l="vertical"}){return{root:{counterReset:"item-counter",listStyle:"none",...s==="list"?{alignItems:"flex-start",display:"flex",flex:"0 0 auto",flexDirection:l==="horizontal"?"row":"column",justifyContent:"flex-start"}:{display:"grid",gap:`${r}px`,...l==="vertical"?{gridAutoRows:isNaN(e)?void 0:`${e}px`,gridTemplateColumns:`repeat(${a}, 1fr)`,gridAutoFlow:"row"}:{gridAutoColumns:isNaN(e)?void 0:`${e}px`,gridTemplateRows:`repeat(${a}, 1fr)`,gridAutoFlow:"column"}}},item:{counterIncrement:"item-counter",flex:"0 0 auto",...s==="list"?{...l==="vertical"?{width:"100%",height:isNaN(e)?void 0:`${e}px`}:{width:isNaN(e)?void 0:`${e}px`,height:"100%"}}:{}}}}process.env.NODE_ENV!=="production"&&(Dt.displayName="Collection",st.displayName="CollectionItem");const Fr=N.forwardRef(({children:e,style:r,autoCollapseSections:s=!1,expandedSectionIndices:a,orientation:l="vertical",sectionPadding:u=0,sections:h,selection:g,selectionMode:m="single",onActivateAt:S,onCollapseSectionAt:k,onDeselectAt:P,onExpandedSectionsChange:O,onExpandSectionAt:j,onHeaderCustomEvent:L,onItemCustomEvent:x,onSelectAt:R,onSelectionChange:$,HeaderComponent:Q,ItemComponent:B,...G},T)=>{const I=Xi(g??{},h),E=Yi(a??[],h),F=Ui({orientation:l}),W=h.map(()=>N.useRef(null)),Z=W.map(H=>jn(H)),re=(H,C)=>(I[C]?.indexOf(H)??-1)>=0,q=H=>E.indexOf(H)>=0,U=H=>{let C;q(H)?C=Y=>Y.filter(oe=>oe!==H):s?C=Y=>[H]:C=Y=>[...Y.filter(oe=>oe!==H),H],te(E,C(E))},D=(H,C)=>{if(re(H,C))return;let Y;switch(m){case"multiple":Y=ie=>({...ie,[C]:Ht([...(ie[C]??[]).filter(fe=>fe!==H),H])});break;case"single":Y=ie=>({[C]:[H]});break;default:return}const oe=Y(I);ee(I,oe)},z=(H,C)=>{if(!re(H,C))return;const oe=(ie=>({...ie,[C]:(ie[C]??[]).filter(fe=>fe!==H)}))(I);ee(I,oe)},te=(H,C)=>{if(Ve(H,C))return;const Y=H?.filter(ie=>C.indexOf(ie)===-1)??[],oe=C.filter(ie=>H?.indexOf(ie)===-1);Y.forEach(ie=>k?.(ie)),oe.forEach(ie=>j?.(ie)),O?.(C)},ee=(H,C)=>{if(Ve(H,C))return;const Y=h.length;let oe=[],ie=[];for(let fe=0;fe<Y;fe++){const ve=H?.[fe]??[],Ee=C[fe]??[],Se=ve.filter(J=>Ee.indexOf(J)===-1),xe=Ee.filter(J=>ve?.indexOf(J)===-1);oe=[...oe,...Se.map(J=>[J,fe])],ie=[...ie,...xe.map(J=>[J,fe])]}oe.forEach(fe=>P?.(fe[0],fe[1])),ie.forEach(fe=>R?.(fe[0],fe[1])),$?.(C)},ce=Oe(e,{collapseIcon:Mn,expandIcon:An,header:Vt,item:Bt,section:zn});return b.jsx("div",{...G,ref:T,style:le(r,F.root),children:b.jsx(gt,{in:h,children:(H,C)=>{const{collectionPadding:Y=0,items:oe=[],itemLength:ie=50,itemPadding:fe=0,isSelectionTogglable:ve,layout:Ee="list",maxVisible:Se=-1,numSegments:xe=1}=H,J=Ee==="list"?oe.length:Math.ceil(oe.length/xe),ze=Se<0?J:Math.min(J,Se),_e=ie*ze+fe*(ze-1),ke=!q(C),De=Z[C];return b.jsxs(me,{element:ce.section??b.jsx(zn,{}),style:le(F.section,l==="vertical"?{marginTop:C===0?"0px":`${u}px`,...De.height>0?{height:ke?`${De.height}px`:`${_e+De.height+Y}px`}:{visibility:"hidden"}}:{marginLeft:C===0?"0px":`${u}px`,...De.width>0?{width:ke?`${De.width}px`:`${_e+De.width+Y}px`}:{visibility:"hidden"}}),children:[b.jsx("div",{ref:W[C],style:le(F.headerContainer),children:Q?b.jsx(Q,{"aria-expanded":!ke,className:ae({collapsed:ke,expanded:!ke}),index:C,isCollapsed:ke,role:"button",section:H,style:le(F.header),onClick:()=>U(C),onCustomEvent:(Ae,He)=>L?.(C,Ae,He)}):b.jsxs(me,{"aria-expanded":!ke,className:ae({collapsed:ke,expanded:!ke}),element:ce.header??b.jsx(Vt,{}),role:"button",style:le(F.header),onClick:()=>U(C),children:[b.jsx("span",{dangerouslySetInnerHTML:{__html:H.label}}),ce.expandIcon&&b.jsx(me,{className:ae({collapsed:ke,expanded:!ke}),element:ke?ce.collapseIcon??ce.expandIcon:ce.expandIcon,style:le(ke?F.collapseIcon:F.expandIcon)})]})}),b.jsx("div",{role:"region",style:le({pointerEvents:ke?"none":"auto"},l==="vertical"?{width:"100%",height:`${_e}px`,marginTop:`${Y}px`,overflowY:Se<0||Se>=J?"hidden":"scroll"}:{marginLeft:`${Y}px`,overflowX:Se<0||Se>=J?"hidden":"scroll",width:`${_e}px`,height:"100%"}),children:b.jsx(Dt,{className:ae({collapsed:ke,expanded:!ke}),isSelectionTogglable:ve,ItemComponent:B,itemLength:ie,itemPadding:fe,items:oe,layout:Ee,numSegments:xe,orientation:l,selection:I[C]??[],selectionMode:m,style:le(l==="vertical"?{width:"100%"}:{height:"100%"}),onActivateAt:Ae=>S?.(Ae,C),onCustomEvent:(Ae,He,Ye)=>x?.(Ae,C,He,Ye),onDeselectAt:Ae=>z(Ae,C),onSelectAt:Ae=>D(Ae,C),children:!B&&(ce.item??b.jsx(Bt,{}))})})]})}})})}),Vt=({children:e,...r})=>b.jsx("button",{...r,children:e}),An=({children:e,...r})=>b.jsx("figure",{...r,children:e}),Mn=({children:e,...r})=>b.jsx("figure",{...r,children:e}),zn=({children:e,...r})=>b.jsx("div",{...r,children:e}),Bt=st;function Dr(e,r){return e>=r.length||e<0}function Hi(e,r,s){if(Dr(r,s))return!0;const a=s[r].items??[];return e>=a.length||e<0}function Yi(e,r){return Ht(e).filter(s=>!Dr(s,r))}function Xi(e,r){const s={};for(const a in r){if(!Object.hasOwn(r,a))continue;const l=Ht([...e[a]??[]]);s[Number(a)]=Ht(l).filter(u=>!Hi(u,Number(a),r))}return s}function Ht(e){return e.sort((r,s)=>r-s)}function Ui({orientation:e="vertical"}){return{root:{alignItems:"center",boxSizing:"border-box",display:"flex",flex:"0 0 auto",justifyContent:"flex-start",padding:"0",...e==="vertical"?{flexDirection:"column",height:"auto"}:{flexDirection:"row",width:"auto"}},collapseIcon:{pointerEvents:"none",zIndex:1},expandIcon:{pointerEvents:"none",zIndex:1},section:{alignItems:"flex-start",display:"flex",flex:"0 0 auto",justifyContent:"flex-start",margin:"0",overflow:"hidden",padding:"0",...e==="vertical"?{flexDirection:"column",width:"100%"}:{flexDirection:"row",height:"100%"}},headerContainer:{flexShrink:"0",...e==="vertical"?{width:"100%"}:{height:"100%"}},header:{cursor:"pointer",margin:"0",...e==="vertical"?{width:"100%"}:{height:"100%"}}}}process.env.NODE_ENV!=="production"&&(Fr.displayName="Accordion",Vt.displayName="AccordionHeader",An.displayName="AccordionExpandIcon",Mn.displayName="AccordionCollapseIcon",Bt.displayName="AccordionItem");function Yt({count:e=1,children:r,render:s}){return b.jsx(b.Fragment,{children:[...Array(e)].map((a,l)=>b.jsx(N.Fragment,{children:s?.(l)??(typeof r=="function"?r(l):r)},`element-${l}`))})}process.env.NODE_ENV!=="production"&&(Yt.displayName="Repeat");function Gi(e){return e}const Ln=N.forwardRef(({children:e,className:r,isActive:s=!1,isTailHidden:a=!1,isSplit:l=!1,numberOfBars:u=3,...h},g)=>{const m=Oe(e,{bar:mt}),S={root:ae({active:s}),bar:ae({active:s})},k=Ki({isSplit:l,isActive:s,isTailHidden:a});return b.jsx("div",{...h,ref:g,className:ae(r,S.root),children:b.jsx(Yt,{count:l?2:1,children:P=>b.jsx("div",{"aria-hidden":!0,style:le(k.section,k[`section${P}`]),children:b.jsx(Yt,{count:u,children:O=>b.jsx(me,{"aria-hidden":!0,className:ae(S.bar),element:m.bar??b.jsx(mt,{}),style:(()=>{switch(u){case 2:return le(k.bar,k[`bar${P}${O===0?0:2}`]);case 3:default:return le(k.bar,k[`bar${P}${O}`])}})()})})})})})}),mt=({...e})=>b.jsx("span",{...e});function Ki({isActive:e=!1,isSplit:r=!1,isTailHidden:s=!1}){return{section:{height:"100%",position:"absolute",width:r?"50%":"100%"},section0:{left:"0",top:"0"},section1:{right:"0",top:"0"},bar:{margin:"0",padding:"0",position:"absolute",width:"100%"},bar00:{left:"0",top:e?"50%":"0",transform:e?"translate(0, -50%) rotate(45deg)":"translate(0, 0) rotate(0deg)",transformOrigin:r?"right center":"center"},bar01:{left:"0",top:"50%",transform:e?"translate(0, -50%) scale(0)":"translate(0, -50%) scale(1)",transformOrigin:r?"right center":"center"},bar02:{left:"0",top:e?"50%":"100%",transform:e?"translate(0, -50%) rotate(-45deg)":"translate(0, -100%) rotate(0deg)",transformOrigin:r?"right center":"center",width:e||r?"100%":`${s?"50%":"100%"}`},bar10:{left:"0",top:e?"50%":"0",transform:e?"translate(0, -50%) rotate(-45deg)":"translate(0, 0) rotate(0deg)",transformOrigin:"left center"},bar11:{left:"0",top:"50%",transform:e?"translate(0, -50%) scale(0)":"translate(0, -50%) scale(1)",transformOrigin:"left center"},bar12:{left:"0",top:e?"50%":"100%",transform:e?"translate(0, -50%) rotate(45deg)":"translate(0, -100%) rotate(0deg)",transformOrigin:"left center",width:s&&!e?"0":"100%"}}}process.env.NODE_ENV!=="production"&&(Ln.displayName="Burger",mt.displayName="BurgerBar");const Vr=N.forwardRef(({children:e,className:r,style:s,isActive:a=!1,isTailHidden:l=!1,isSplit:u=!1,numberOfBars:h=3,onActivate:g,onDeactivate:m,onToggle:S,...k},P)=>{const O=()=>{const x=!a;S?.(x),x?g?.():m?.()},j={root:ae({active:a})},L=Wi();return b.jsx("button",{...k,ref:P,"aria-expanded":a,className:ae(r,j.root),style:le(s,L.root),onClick:O,children:b.jsx(Ln,{isActive:a,isSplit:u,isTailHidden:l,numberOfBars:h,children:e})})}),Br=mt;function Wi(){return{root:{background:"transparent",border:"none",display:"block",outline:"none"}}}process.env.NODE_ENV!=="production"&&(Vr.displayName="BurgerButton",Br.displayName="BurgerButtonBar");function Hr(e){switch(!0){case Ji(e):{const{action:r,children:s,isNav:a,className:l,isDisabled:u,label:h,...g}=e;return b.jsx(In.NavLink,{...g,"aria-disabled":u,"aria-label":h,className:ae(l,{disabled:u}),to:r,children:s??h})}case Zi(e):{const{action:r,children:s,className:a,isDisabled:l,label:u,...h}=e;return b.jsx(In.Link,{...h,"aria-disabled":l,"aria-label":u,className:ae(a,{disabled:l}),to:r,children:s??u})}case Qi(e):{const{action:r,children:s,className:a,isDisabled:l,label:u,opensInNewTab:h,...g}=e;return b.jsx("a",{...g,"aria-disabled":l,"aria-label":u,className:ae(a,{disabled:l}),href:r,rel:h?"noopener,noreferrer":void 0,target:h?"_blank":void 0,children:s??u})}case $i(e):{const{action:r,children:s,className:a,isDisabled:l,label:u,type:h="button",...g}=e;return b.jsx("button",{...g,"aria-disabled":l,"aria-label":u,className:a,disabled:l,type:h,onClick:()=>r(),children:s??u})}default:return console.error("[etudes::Button] Unknown button type"),b.jsx(b.Fragment,{})}}function Ji(e){return!(typeof e.action!="string"||!e.action.startsWith("/")||!("isNav"in e)||!e.isNav)}function Zi(e){return!(typeof e.action!="string"||!e.action.startsWith("/")||"isNav"in e&&e.isNav)}function Qi(e){return!(typeof e.action!="string"||e.action.startsWith("/"))}function $i(e){return typeof e.action=="function"}process.env.NODE_ENV!=="production"&&(Hr.displayName="Button");function Yr(e,{isEnabled:r=!0,updatesCursor:s=!0,onDragStart:a,onDragMove:l,onDragEnd:u}){const h=N.useRef(void 0),g=N.useRef(void 0),m=Ne(a),S=Ne(l),k=Ne(u),P=N.useCallback(L=>{if(!h.current)return;const x=pe.make(L.clientX,L.clientY),R=pe.subtract(x,g.current??h.current);g.current=x,S.current?.(R,x,h.current)},[]),O=N.useCallback(L=>{const x=e.current;if(!x||!h.current)return;const R=pe.make(L.clientX,L.clientY),$=pe.subtract(g.current??h.current,R);k.current?.(R,$,h.current),h.current=void 0,g.current=void 0,x.removeEventListener("mousemove",P),x.removeEventListener("mouseup",O,{capture:!0}),x.removeEventListener("mouseleave",O),s&&(x.style.cursor="grab")},[s,P]),j=N.useCallback(L=>{const x=e.current;if(!x)return;L.preventDefault();const R=pe.make(L.clientX,L.clientY);h.current=R,g.current=R,x.addEventListener("mousemove",P),x.addEventListener("mouseup",O,{capture:!0}),x.addEventListener("mouseleave",O),s&&(x.style.cursor="grabbing"),m.current?.(R)},[s,P,O]);N.useLayoutEffect(()=>{const L=e.current;if(!L||!r||!s)return;const x=L.style.cursor;return L.style.cursor="grab",()=>{L.style.cursor=x}},[r,s]),N.useLayoutEffect(()=>{const L=e.current;if(!(!L||!r))return L.addEventListener("mousedown",j),()=>{L.removeEventListener("mousedown",j),L.removeEventListener("mousemove",P),L.removeEventListener("mouseup",O,{capture:!0}),L.removeEventListener("mouseleave",O)}},[r,P,O,j])}function Xr(e,{autoStarts:r=!0,shouldInvokeInitially:s=!1,onInterval:a}){const l=N.useRef(void 0),u=Ne(a),h=N.useCallback(()=>{clearInterval(l.current),l.current=void 0},[]),g=N.useCallback(()=>{h(),!(e<0)&&(s&&u.current(),l.current=setInterval(()=>{u.current()},e))},[e,s,h]);return N.useEffect(()=>(r&&e>0&&g(),h),[r,e,g,h]),{start:g,stop:h}}const Ur=N.forwardRef(({autoAdvanceInterval:e=0,index:r=0,isDragEnabled:s=!0,items:a=[],orientation:l="horizontal",tracksItemExposure:u=!1,onAutoAdvancePause:h,onAutoAdvanceResume:g,onIndexChange:m,ItemComponent:S,...k},P)=>{const O=N.useRef(void 0),j=N.useRef(null),L=N.useRef(void 0),x=N.useRef(void 0),R=N.useRef(void 0),$=1e3,[Q,B]=N.useState(Fn(j,l)),[G,T]=N.useState(!1),I=ts({scrollSnapEnabled:!G,orientation:l}),E=e>0,F=N.useCallback(z=>{m?.(z)},[m]),W=N.useCallback(z=>{L.current=pe.make(z.clientX,z.clientY),T(!0)},[]),Z=N.useCallback(z=>{const te=L.current,ee=x.current;if(!te||!ee)return;const ce=5,H=pe.subtract(te,ee);(Math.abs(H.x)>ce||Math.abs(H.y)>ce)&&z.stopPropagation(),L.current=void 0,x.current=void 0},[]),re=N.useCallback(z=>{x.current=pe.make(z.clientX,z.clientY),G&&T(!1)},[G]),q=N.useCallback(()=>{qi(j,r,l),clearTimeout(R.current),R.current=setTimeout(()=>{clearTimeout(R.current),R.current=void 0},$)},[j.current,r,l,$]),U=N.useCallback(()=>{const z=(r+a.length+1)%a.length;F(z)},[G,r,a.length,F]),D=N.useCallback(({x:z,y:te})=>{const ee=j.current;switch(l){case"horizontal":requestAnimationFrame(()=>{ee&&(ee.scrollLeft-=z*1.5)});break;case"vertical":requestAnimationFrame(()=>{ee&&(ee.scrollTop-=te*1.5)});break;default:console.error(`[etudes::Carousel] Unsupported orientation: ${l}`)}},[l,j.current]);return N.useEffect(()=>{const z=j.current;if(!z)return;const te=O.current===void 0,ee=O.current===r,ce=H=>{if(u&&B(Fn(j,l)),R.current!==void 0)return;const C=Math.round(l==="horizontal"?z.scrollLeft/z.clientWidth:z.scrollTop/z.clientHeight),Y=Math.max(0,Math.min(a.length-1,C));Y!==r&&(O.current=Y,F(Y))};return z.addEventListener("scroll",ce),u&&B(Fn(j,l)),ee||(O.current=r,te||(F(r),q())),()=>{z.removeEventListener("scroll",ce)}},[r,l,u]),N.useEffect(()=>{E&&(G?h?.():g?.())},[G,E]),Yr(j,{isEnabled:s&&a.length>1,onDragMove:D}),Xr(G||!E?-1:e,{onInterval:U}),b.jsx("div",{...k,ref:P,role:"region",onClick:z=>Z(z),onPointerCancel:z=>re(z),onPointerDown:z=>W(z),onPointerLeave:z=>re(z),onPointerUp:z=>re(z),children:b.jsx("div",{ref:j,style:le(I.viewport),children:b.jsx(gt,{in:a,children:({style:z,...te},ee)=>b.jsx("div",{style:le(I.itemContainer),children:b.jsx(S,{"aria-hidden":ee!==r,exposure:u?Q?.[ee]:void 0,style:le(z,I.item),...te})})})})})});function qi(e,r,s){const a=e?.current;if(!a)return;const l=s==="horizontal"?0:a.clientHeight*r,u=s==="horizontal"?a.clientWidth*r:0;a.scrollTop===l&&a.scrollLeft===u||a.scrollTo({top:l,left:u,behavior:"smooth"})}function Fn(e,r){const s=e?.current;if(!s)return;const a=[];for(let l=0;l<s.children.length;l++)a.push(es(l,e,r));return a}function es(e,r,s){const a=r?.current,l=a?.children[e];if(!l)return 0;const u=ge.intersecting(l,a);if(!u)return 0;switch(s){case"horizontal":return Math.max(0,Math.min(1,Math.round((u.width/a.clientWidth+Number.EPSILON)*1e3)/1e3));case"vertical":return Math.max(0,Math.min(1,Math.round((u.height/a.clientHeight+Number.EPSILON)*1e3)/1e3));default:return console.error(`[etudes::Carousel] Unsupported orientation: ${s}`),NaN}}function ts({scrollSnapEnabled:e=!1,orientation:r="horizontal"}){return{viewport:{alignItems:"center",display:"flex",height:"100%",userSelect:e?"auto":"none",justifyContent:"flex-start",scrollBehavior:e?"smooth":"auto",scrollSnapStop:e?"always":"unset",WebkitOverflowScrolling:"touch",width:"100%",...r==="horizontal"?{flexDirection:"row",overflowX:"scroll",overflowY:"hidden",scrollSnapType:e?"x mandatory":"none"}:{flexDirection:"column",overflowX:"hidden",overflowY:"scroll",scrollSnapType:e?"y mandatory":"none"}},itemContainer:{height:"100%",overflow:"hidden",scrollSnapAlign:"center",width:"100%",flex:"0 0 auto"},item:{height:"100%",width:"100%"}}}process.env.NODE_ENV!=="production"&&(Ur.displayName="Carousel");function Gr(e){const r=N.useRef(void 0);return N.useEffect(()=>{r.current=e},[e]),r.current}const Dn=N.forwardRef(({className:e,emptyValue:r="",isDisabled:s=!1,isRequired:a=!1,placeholder:l,value:u,formatter:h,onFocus:g,onUnfocus:m,onChange:S,...k},P)=>{const O=N.useCallback(j=>{const L=(h?.(j)??j)||r;S?.(L)},[S,h]);return b.jsx("input",{...k,ref:P,"aria-disabled":s,"aria-placeholder":l,"aria-required":a,className:ae(e,{disabled:s}),disabled:s,placeholder:l,required:a,type:"text",value:u||r,onBlur:({target:j})=>m?.(j.value),onChange:({target:j})=>O(j.value),onFocus:({target:j})=>g?.(j.value)})});process.env.NODE_ENV!=="production"&&(Dn.displayName="TextField");const Kr=N.forwardRef(({children:e,style:r,allowsInput:s=!0,max:a=NaN,min:l=NaN,quantity:u=0,onChange:h,...g},m)=>{const S=()=>{h?.(x(u-1))},k=()=>{h?.(x(u+1))},P=I=>{$(I)},O=I=>{const E=L(I);E!==u?h?.(E):$(j(E))},j=I=>I.toLocaleString(),L=I=>{const E=parseInt(I,10);return E.toString()!==I.replace(/^0+/,"")?u:x(E)},x=I=>{let E=I;return isNaN(l)||(E=Math.max(l,E)),isNaN(a)||(E=Math.min(a,E)),E},[R,$]=N.useState(j(u)),Q=Gr(u),B=!isNaN(a)&&u+1>a,G=!isNaN(l)&&u-1<l;N.useEffect(()=>{if(Q===void 0||Q===u)return;const I=x(u);$(j(I))},[u,l,a]);const T=Oe(e,{textField:Xt,addButton:Ut,subscribeButton:Gt});return b.jsxs("div",{...g,ref:m,style:le(r,Kt.root),children:[b.jsx(me,{className:ae({disabled:G}),element:T.subscribeButton??b.jsx(Gt,{}),style:le(Kt.subtract),onClick:()=>S()}),b.jsx(me,{element:T.textField??b.jsx(Xt,{}),isDisabled:!s,style:le(Kt.textField),value:R,onChange:P,onUnfocus:O}),b.jsx(me,{className:ae({disabled:B}),element:T.addButton??b.jsx(Ut,{}),style:le(Kt.add),onClick:()=>k()})]})}),Xt=({...e})=>b.jsx(Dn,{...e}),Ut=({children:e,...r})=>b.jsx("button",{...r,children:e}),Gt=({children:e,...r})=>b.jsx("button",{...r,children:e}),Kt={root:{alignItems:"stretch",display:"flex",flexDirection:"row",justifyContent:"stretch"},subtract:{flex:"0 0 auto"},add:{flex:"0 0 auto"},textField:{width:"100%"}};process.env.NODE_ENV!=="production"&&(Kr.displayName="Counter",Ut.displayName="CounterAddButton",Gt.displayName="CounterSubtractButton",Xt.displayName="CounterTextField");function Wr(){const[e,r]=N.useState(Pe.zero);return N.useLayoutEffect(()=>{const s=()=>{const a=ge.size(ge.fromViewport());r(a)};return window.addEventListener("resize",s),s(),()=>{window.removeEventListener("resize",s)}},[]),e}function Be(e){const[r,s]=N.useState(ge.zero),a=Wr();return Lt(e,{onResize:l=>{const u=ge.from(l);u&&s(u)}}),N.useLayoutEffect(()=>{const l=e.current,u=ge.from(l);u&&s(u)},[Pe.toString(a)]),r}function Jr({src:e,srcSet:r,sizes:s},{onLoadStart:a,onLoadComplete:l,onLoadError:u}={}){const h=N.useRef(void 0),g=Ne(a),m=Ne(l),S=Ne(u);N.useLayoutEffect(()=>{const k=O=>{const j=O.currentTarget;m.current?.(j)},P=O=>{const j=O.currentTarget;S.current?.(j)};return h.current=new Image,e&&(h.current.src=e),r&&(h.current.srcset=r),s&&(h.current.sizes=s),g.current?.(h.current),h.current.addEventListener("load",k),h.current.addEventListener("error",P),()=>{h.current?.removeEventListener("load",k),h.current?.removeEventListener("error",P),h.current=void 0}},[e,r,s])}function Vn({src:e,srcSet:r,sizes:s},{preservesSizeBetweenLoads:a=!0,onLoadStart:l,onLoadComplete:u,onLoadError:h}={}){const[g,m]=N.useState(),S=Ne(l),k=Ne(u),P=Ne(h),O=N.useCallback(x=>{a||m(void 0),S.current?.(x)},[a]),j=N.useCallback(x=>{m(ns(x)),k.current?.(x)},[]),L=N.useCallback(x=>{a||m(void 0),P.current?.(x)},[a]);return Jr({src:e,srcSet:r,sizes:s},{onLoadStart:O,onLoadComplete:j,onLoadError:L}),g}function ns(e){if(e&&typeof e.width=="number"&&typeof e.height=="number")return Pe.make(e.width,e.height)}const Bn=N.forwardRef(({alt:e,loadingMode:r="preload",sizes:s,src:a,srcSet:l,onLoadStart:u,onLoadComplete:h,onLoadError:g,onSizeChange:m,...S},k)=>{const P=l?.map(({pixelDensity:L,src:x,width:R})=>{if(s&&R===void 0){console.error("[etudes::Image] `width` must be specified if `sizes` is specified");return}if(R!==void 0&&L!==void 0){console.error("[etudes::Image] Only one of `width` or `pixelDensity` can be specified");return}let $=x;if(R!==void 0){const Q=Math.floor(R);if(!isFinite(Q)||String(Q)!==String(R)||Q<=0){console.error("[etudes::Image] The specified width must be a positive integer greater than 0");return}$+=` ${Q}w`}else if(L!==void 0){if(!isFinite(L)||L<=0){console.error("[etudes::Image] The specified pixel density must be a positive floating number than 0");return}$+=` ${L}x`}return $}).filter(Boolean).join(", "),O=s?.map(({mediaCondition:L,width:x},R)=>{const $=R===s.length-1;let Q=x;if($&&L){console.error("[etudes::Image] The last item in `sizes` must not have a `mediaCondition` specified");return}return L&&(Q=`${L} ${Q}`),Q}).filter(Boolean).join(", "),j=Vn({src:a,srcSet:P,sizes:O},{onLoadStart:u,onLoadComplete:h,onLoadError:g});return N.useEffect(()=>{m?.(j)},[j?.width,j?.height]),b.jsx("img",{...S,ref:k,alt:e,loading:r==="lazy"?"lazy":"eager",sizes:O,src:a,srcSet:P})});process.env.NODE_ENV!=="production"&&(Bn.displayName="Image");const Zr=N.forwardRef(({children:e,style:r,alt:s,aspectRatio:a=NaN,loadingMode:l,sizes:u,src:h,srcSet:g,onLoadStart:m,onLoadComplete:S,onLoadError:k,...P},O)=>{const j=E=>{$(E?E.width/E.height:NaN)},L=N.useRef(null),x=O??L,[R,$]=N.useState(NaN),Q=isNaN(a)?R:a,B=Be(x),G=B.width/B.height,T=Pe.make(G>1?Math.max(B.width,B.height*Q):Math.max(B.width,Math.max(B.height,B.width/Q)*Q),G>1?Math.max(B.height,Math.max(B.width,B.height*Q)/Q):Math.max(B.height,B.width/Q)),I=Oe(e,{content:Hn,viewport:Yn});return b.jsxs("div",{...P,ref:x,style:le(r,Xn.root),children:[b.jsx(Bn,{alt:s,sizes:u,src:h,srcSet:g,style:le(Xn.viewport,{height:`${T.height}px`,maxWidth:"unset",width:`${T.width}px`}),onLoadComplete:S,onLoadError:k,onLoadStart:m,onSizeChange:E=>j(E)}),I.viewport&&b.jsx(me,{element:I.viewport,style:le(Xn.viewport,{height:`${T.height}px`,pointerEvents:"none",width:`${T.width}px`})}),I.content]})}),Hn=({children:e,...r})=>b.jsx("div",{...r,children:e}),Yn=({children:e,...r})=>b.jsx("div",{...r,children:e}),Xn={root:{overflow:"hidden"},viewport:{fontSize:"0",left:"50%",position:"absolute",top:"50%",transform:"translate(-50%, -50%)"}};process.env.NODE_ENV!=="production"&&(Zr.displayName="CoverImage",Hn.displayName="CoverImageContent",Yn.displayName="CoverImageViewport");function Qr(e,{onLoadStart:r,onLoadComplete:s,onLoadError:a}={}){const l=Ne(r),u=Ne(s),h=Ne(a);N.useLayoutEffect(()=>{if(!e)return;const g=document.createElement("video"),m=()=>u.current?.(g),S=()=>h.current?.(g);return g.addEventListener("loadedmetadata",m),g.addEventListener("error",S),g.src=e,l.current?.(g),()=>{g.removeEventListener("loadedmetadata",m),g.removeEventListener("error",S),g.src=""}},[e])}function $r(e,{preservesSizeBetweenLoads:r=!0,onLoadStart:s,onLoadComplete:a,onLoadError:l}={}){const[u,h]=N.useState(),g=Ne(s),m=Ne(a),S=Ne(l),k=N.useCallback(j=>{r||h(void 0),g.current?.(j)},[r]),P=N.useCallback(j=>{h(rs(j)),m.current?.(j)},[]),O=N.useCallback(j=>{r||h(void 0),S.current?.(j)},[r]);return Qr(e,{onLoadStart:k,onLoadComplete:P,onLoadError:O}),u}function rs(e){if(e&&typeof e.videoWidth=="number"&&typeof e.videoHeight=="number")return Pe.make(e.videoWidth,e.videoHeight)}const Un=N.forwardRef(({autoLoop:e=!0,autoPlay:r=!0,hasControls:s=!1,isMuted:a=!0,playsInline:l=!0,posterSrc:u,src:h,onCanPlay:g,onEnd:m,onFullscreenChange:S,onLoadMetadata:k,onLoadMetadataComplete:P,onLoadMetadataError:O,onPause:j,onPlay:L,onSizeChange:x,onTimeUpdate:R,...$},Q)=>{const B=N.useRef(null),G=Q??B,T=$r(h,{onLoadStart:k,onLoadComplete:P,onLoadError:O});N.useEffect(()=>{if(!G.current)return;if(h.toLowerCase().endsWith(".m3u8")){const D=!!G.current.canPlayType("application/x-mpegURL"),z=typeof window<"u"&&typeof window.Hls<"u"?window.Hls:void 0;if(!D&&z?.isSupported()){const te=new z;te.loadSource(h),te.attachMedia(G.current)}}const U=D=>{const z=document.fullScreen||document.mozFullScreen||document.webkitIsFullScreen;z!==void 0&&S?.(z)};return G.current.muted=a,G.current.load(),G.current.addEventListener("webkitfullscreenchange",U),G.current.addEventListener("mozfullscreenchange",U),G.current.addEventListener("fullscreenchange",U),()=>{q(),G.current?.removeEventListener("webkitfullscreenchange",U),G.current?.removeEventListener("mozfullscreenchange",U),G.current?.removeEventListener("fullscreenchange",U)}},[h]),N.useEffect(()=>{x?.(T)},[T]);const I=U=>{const D=U.currentTarget;r&&D.paused&&re(),g?.()},E=U=>{L?.()},F=U=>{j?.()},W=U=>{m?.()},Z=U=>{const D=U.currentTarget;R?.(D.currentTime,D.duration)},re=()=>{G.current&&G.current.play()},q=()=>{G.current&&G.current.pause()};return b.jsx("video",{...$,ref:G,autoPlay:r,controls:s,loop:e,muted:a,playsInline:l,poster:u,onCanPlay:I,onEnded:W,onPause:F,onPlay:E,onTimeUpdate:Z,children:b.jsx("source",{src:h})})});process.env.NODE_ENV!=="production"&&(Un.displayName="Video");const qr=N.forwardRef(({className:e,children:r,style:s,aspectRatio:a=NaN,autoLoop:l,autoPlay:u,hasControls:h,isMuted:g,playsInline:m,posterSrc:S,src:k,onCanPlay:P,onEnd:O,onFullscreenChange:j,onLoadMetadata:L,onLoadMetadataComplete:x,onLoadMetadataError:R,onPause:$,onPlay:Q,onSizeChange:B,...G},T)=>{const I=z=>{Z(z?z.width/z.height:NaN),B?.(z)},E=T??N.useRef(null),F=Be(E),[W,Z]=N.useState(NaN),re=isNaN(a)?W:a,q=F.width/F.height,U=Pe.make(q>1?Math.max(F.width,F.height*re):Math.max(F.width,Math.max(F.height,F.width/re)*re),q>1?Math.max(F.height,Math.max(F.width,F.height*re)/re):Math.max(F.height,F.width/re)),D=Oe(r,{content:Gn,viewport:Kn});return b.jsxs("div",{...G,ref:E,className:e,style:le(s,Wn.root),children:[b.jsx(Un,{autoLoop:l,autoPlay:u,hasControls:h,isMuted:g,playsInline:m,posterSrc:S,src:k,style:le(Wn.viewport,{width:`${U.width}px`,height:`${U.height}px`,maxWidth:"unset"}),onCanPlay:P,onEnd:O,onFullscreenChange:j,onLoadMetadata:L,onLoadMetadataComplete:x,onLoadMetadataError:R,onPause:$,onPlay:Q,onSizeChange:z=>I(z)}),D.viewport&&b.jsx(me,{element:D.viewport,style:le(Wn.viewport,{height:`${U.height}px`,pointerEvents:"none",width:`${U.width}px`})}),D.content]})}),Gn=({children:e,...r})=>b.jsx("div",{...r,children:e}),Kn=({children:e,...r})=>b.jsx("div",{...r,children:e}),Wn={root:{overflow:"hidden"},viewport:{fontSize:"0",left:"50%",position:"absolute",top:"50%",transform:"translate(-50%, -50%)"}};process.env.NODE_ENV!=="production"&&(qr.displayName="CoverVideo",Gn.displayName="CoverVideoContent",Kn.displayName="CoverVideoViewport");const eo=N.forwardRef(({children:e,style:r,angle:s=0,knobLength:a=30,knobThickness:l=10,radius:u=50,trackGap:h=0,trackThickness:g=2,...m},S)=>{const k=u*2,P=Math.max(0,Math.min(360,a)),O=Oe(e,{track:Wt,knob:Jt}),j=is({angle:s,diameter:k});return b.jsxs("div",{...m,ref:S,style:le(r,j.root),children:[b.jsx("div",{style:j.trackContainer,children:b.jsx("svg",{height:k,style:j.svgContainer,viewBox:`0 0 ${k} ${k}`,width:k,children:b.jsx(me,{cx:u,cy:u,element:O.track??b.jsx(Wt,{}),fill:"none",r:u-g/2,strokeDasharray:h,strokeWidth:g})})}),b.jsx("div",{style:le(j.knobContainer),children:b.jsx("svg",{style:j.svgContainer,viewBox:`0 0 ${k} ${k}`,xmlns:"http://www.w3.org/2000/svg",children:b.jsx(me,{d:os(u,u,u-l/2-(g-l)/2,-P/2,P/2),element:O.knob??b.jsx(Jt,{}),fill:"none",strokeWidth:l})})})]})}),Wt=({...e})=>b.jsx("circle",{...e}),Jt=({...e})=>b.jsx("path",{...e});function to(e,r,s,a){const l=(a-90)*Math.PI/180;return{x:e+s*Math.cos(l),y:r+s*Math.sin(l)}}function os(e,r,s,a,l){const u=to(e,r,s,l),h=to(e,r,s,a),g=l-a<=180?"0":"1";return["M",u.x,u.y,"A",s,s,0,g,0,h.x,h.y].join(" ")}function is({diameter:e=0,angle:r=0}){return{root:{height:`${e}px`,width:`${e}px`},knobContainer:{backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundSize:"100%",height:"100%",left:"0",position:"absolute",top:"0",transformOrigin:"center",width:"100%",transform:`rotate(${(r+360)%360}deg)`},trackContainer:{height:"100%",left:"0",position:"absolute",top:"0",transformOrigin:"center",width:"100%"},svgContainer:{overflow:"visible",position:"absolute",right:"0",top:"0"}}}process.env.NODE_ENV!=="production"&&(eo.displayName="Dial",Wt.displayName="DialTrack",Jt.displayName="DialKnob");const no=N.forwardRef(({children:e,className:r,style:s,collapsesOnSelect:a=!0,collectionPadding:l=0,isCollapsed:u,isInverted:h=!1,label:g,layout:m="list",isSelectionTogglable:S=!1,itemLength:k,itemPadding:P=0,items:O=[],maxVisibleItems:j=-1,numSegments:L=1,orientation:x="vertical",selection:R=[],selectionMode:$="single",onActivateAt:Q,onCollapse:B,onDeselectAt:G,onExpand:T,onSelectAt:I,onSelectionChange:E,onToggleCustomEvent:F,ItemComponent:W,ToggleComponent:Z,...re},q)=>{const U=N.useRef(null),D=Be(U),z=O.length,te=ls(O,j,L,m),ee=k??(x==="vertical"?D.height:D.width),ce=ee*te+P*(te-1),H=as(R,O),[C,Y]=N.useState(u??!0),oe=us({isCollapsed:C,collectionPadding:l,isInverted:h,maxVisibleItems:j,menuLength:ce,numItems:z,orientation:x}),ie=Oe(e,{collapseIcon:Jn,collection:Zt,expandIcon:Zn,item:Qt,toggle:$t}),fe=()=>{C&&(Y(!1),T?.())},ve=()=>{C||(Y(!0),B?.())},Ee=()=>{C?fe():ve()},Se=xe=>{I?.(xe),$==="single"&&a&&ve()};return N.useEffect(()=>{u!==void 0&&Y(u)},[u]),N.useEffect(()=>{const xe=J=>{if(C||!(J.target instanceof Node))return;let ze=!0,_e=J.target;for(;_e;){if(_e===U.current){ze=!1;break}if(!_e.parentNode)break;_e=_e.parentNode}ze&&ve()};return window.addEventListener("click",xe),()=>{window.removeEventListener("click",xe)}},[C]),b.jsx("div",{...re,ref:q,className:ae(r,{collapsed:C,expanded:!C}),style:le(s,oe.root),children:b.jsxs("div",{ref:U,style:le(oe.body),children:[Z?b.jsx(Z,{"aria-expanded":!C,"aria-haspopup":"listbox",className:ae({collapsed:C,expanded:!C}),style:le(oe.toggle),onClick:Ee,onCustomEvent:(xe,J)=>F?.(xe,J)}):b.jsxs(me,{"aria-expanded":!C,"aria-haspopup":"listbox",className:ae({collapsed:C,expanded:!C}),element:ie.toggle??b.jsx($t,{}),style:le(oe.toggle),onClick:Ee,children:[b.jsx("span",{dangerouslySetInnerHTML:{__html:g?.(H)??(H.length>0?H.map(xe=>O[xe]).join(", "):"")}}),ie.expandIcon&&b.jsx(me,{className:ae({collapsed:C,expanded:!C}),element:C?ie.collapseIcon??ie.expandIcon:ie.expandIcon,style:le(C?oe.collapseIcon:oe.expandIcon)})]}),b.jsx(me,{element:ie.collection??b.jsx(Zt,{}),isSelectionTogglable:S,ItemComponent:W,itemLength:ee,itemPadding:P,items:O,layout:m,numSegments:L,orientation:x,selection:H,selectionMode:$,style:le(oe.collection),onActivateAt:Q,onDeselectAt:G,onSelectAt:Se,onSelectionChange:E,children:!W&&(ie.item??b.jsx(Qt,{}))})]})})}),Zt=Dt,Qt=st,$t=({children:e,...r})=>b.jsx("button",{...r,children:e}),Jn=({children:e,...r})=>b.jsx("figure",{...r,"aria-hidden":!0,children:e}),Zn=({children:e,...r})=>b.jsx("figure",{...r,"aria-hidden":!0,children:e});function ss(e,r){return!!(isNaN(e)||e>=r.length||e<0)}function as(e,r){return cs(e).filter(s=>!ss(s,r))}function cs(e){return e.sort((r,s)=>r-s)}function ls(e,r,s,a){const l=e.length;switch(a){case"grid":{const u=s<1?l:Math.ceil(l/s);return r<0?u:Math.min(u,r)}default:return r<0?l:Math.min(l,r)}}function us({isCollapsed:e=!0,isInverted:r=!1,collectionPadding:s=0,maxVisibleItems:a=0,menuLength:l=NaN,numItems:u=0,orientation:h="vertical"}){return{root:{alignItems:"center",display:"flex",justifyContent:"flex-start",overflow:"visible",...h==="vertical"?{flexDirection:r?"column-reverse":"column"}:{flexDirection:r?"row-reverse":"row"}},body:{height:"100%",position:"relative",width:"100%"},toggle:{height:"100%",left:"0",margin:"0",position:"absolute",top:"0",width:"100%",zIndex:"1"},collection:{position:"absolute",...h==="vertical"?{width:"100%",height:e?"0px":`${l}px`,overflowY:a!==-1&&a<u?"scroll":"hidden",...r?{marginBottom:`${s}px`,bottom:"100%"}:{top:"100%",marginTop:`${s}px`}}:{width:e?"0px":`${l}px`,height:"100%",overflowX:a!==-1&&a<u?"scroll":"hidden",...r?{marginRight:`${s}px`,right:"100%"}:{left:"100%",marginLeft:`${s}px`}}},expandIcon:{pointerEvents:"none",zIndex:1},collapseIcon:{pointerEvents:"none",zIndex:1}}}process.env.NODE_ENV!=="production"&&(no.displayName="Dropdown",Zt.displayName="DropdownCollection",Jn.displayName="DropdownCollapseIcon",Zn.displayName="DropdownExpandIcon",Qt.displayName="DropdownItem",$t.displayName="DropdownToggle");const ro=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",fs=ro+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",ds="["+ro+"]["+fs+"]*",hs=new RegExp("^"+ds+"$");function oo(e,r){const s=[];let a=r.exec(e);for(;a;){const l=[];l.startIndex=r.lastIndex-a[0].length;const u=a.length;for(let h=0;h<u;h++)l.push(a[h]);s.push(l),a=r.exec(e)}return s}const Qn=function(e){const r=hs.exec(e);return!(r===null||typeof r>"u")};function ps(e){return typeof e<"u"}const gs={allowBooleanAttributes:!1,unpairedTags:[]};function ms(e,r){r=Object.assign({},gs,r);const s=[];let a=!1,l=!1;e[0]==="\uFEFF"&&(e=e.substr(1));for(let u=0;u<e.length;u++)if(e[u]==="<"&&e[u+1]==="?"){if(u+=2,u=so(e,u),u.err)return u}else if(e[u]==="<"){let h=u;if(u++,e[u]==="!"){u=ao(e,u);continue}else{let g=!1;e[u]==="/"&&(g=!0,u++);let m="";for(;u<e.length&&e[u]!==">"&&e[u]!==" "&&e[u]!==" "&&e[u]!==`
|
|
22
|
+
<%s key={someKey} {...props} />`,ie,xe,J,xe),H[xe+ie]=!0)}if(xe=null,oe!==void 0&&(s(oe),xe=""+oe),h(Y)&&(s(Y.key),xe=""+Y.key),"key"in Y){oe={};for(var ze in Y)ze!=="key"&&(oe[ze]=Y[ze])}else oe=Y;return xe&&g(oe,typeof C=="function"?C.displayName||C.name||"Unknown":C),S(C,xe,ve,fe,l(),oe,Ee,Se)}function P(C){typeof C=="object"&&C!==null&&C.$$typeof===j&&C._store&&(C._store.validated=1)}var O=N,j=Symbol.for("react.transitional.element"),L=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),$=Symbol.for("react.profiler"),Q=Symbol.for("react.consumer"),B=Symbol.for("react.context"),G=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),F=Symbol.for("react.lazy"),W=Symbol.for("react.activity"),Z=Symbol.for("react.client.reference"),re=O.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=Object.prototype.hasOwnProperty,U=Array.isArray,D=console.createTask?console.createTask:function(){return null};O={"react-stack-bottom-frame":function(C){return C()}};var z,te={},ee=O["react-stack-bottom-frame"].bind(O,u)(),ce=D(a(u)),H={};ht.Fragment=x,ht.jsx=function(C,Y,oe,ie,fe){var ve=1e4>re.recentlyCreatedOwnerStacks++;return k(C,Y,oe,!1,ie,fe,ve?Error("react-stack-top-frame"):ee,ve?D(a(C)):ce)},ht.jsxs=function(C,Y,oe,ie,fe){var ve=1e4>re.recentlyCreatedOwnerStacks++;return k(C,Y,oe,!0,ie,fe,ve?Error("react-stack-top-frame"):ee,ve?D(a(C)):ce)}}()),ht}var Ar;function Ai(){return Ar||(Ar=1,process.env.NODE_ENV==="production"?zt.exports=Ri():zt.exports=ji()),zt.exports}var b=Ai();function Mr(e){var r,s,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var l=e.length;for(r=0;r<l;r++)e[r]&&(s=Mr(e[r]))&&(a&&(a+=" "),a+=s)}else for(s in e)e[s]&&(a&&(a+=" "),a+=s);return a}function ae(){for(var e,r,s=0,a="",l=arguments.length;s<l;s++)(e=arguments[s])&&(r=Mr(e))&&(a&&(a+=" "),a+=r);return a}var Rn,zr;function Mi(){return zr||(zr=1,Rn=function e(r,s){if(r===s)return!0;if(r&&s&&typeof r=="object"&&typeof s=="object"){if(r.constructor!==s.constructor)return!1;var a,l,u;if(Array.isArray(r)){if(a=r.length,a!=s.length)return!1;for(l=a;l--!==0;)if(!e(r[l],s[l]))return!1;return!0}if(r.constructor===RegExp)return r.source===s.source&&r.flags===s.flags;if(r.valueOf!==Object.prototype.valueOf)return r.valueOf()===s.valueOf();if(r.toString!==Object.prototype.toString)return r.toString()===s.toString();if(u=Object.keys(r),a=u.length,a!==Object.keys(s).length)return!1;for(l=a;l--!==0;)if(!Object.prototype.hasOwnProperty.call(s,u[l]))return!1;for(l=a;l--!==0;){var h=u[l];if(!(h==="_owner"&&r.$$typeof)&&!e(r[h],s[h]))return!1}return!0}return r!==r&&s!==s}),Rn}var zi=Mi();const Ve=Ir(zi);var pe;(e=>{e.zero=r();function r(x=0,R=0){if(typeof x=="number")return{x,y:R};if(!O(x))throw Error("Invalid parameters passed to constructor");return x instanceof Array?{x:x[0],y:x[1]}:{x:x.x,y:x.y}}e.make=r;function s(x,R={}){return r({x:typeof R.x=="number"?R.x:x.x,y:typeof R.y=="number"?R.y:x.y})}e.clone=s;function a(x,R){return r({x:x.x+R.x,y:x.y+R.y})}e.add=a;function l(x,R){return r({x:x.x-R.x,y:x.y-R.y})}e.subtract=l;function u(x,R){return r({x:x.x*R.x,y:x.y*R.y})}e.multiply=u;function h(x,R){return r({x:x.x/R.x,y:x.y/R.y})}e.divide=h;function g(x){return r({x:x.y,y:x.x})}e.invert=g;function m(x,R){return!(x.x!==R.x||x.y!==R.y)}e.isEqual=m;function S(x){return`Point(x=${x.x}, y=${x.y})`}e.toString=S;function k(x){return Object.freeze({x:x.x,y:x.y})}e.toJSON=k;function P(x){return[x.x,x.y]}e.toArray=P;function O(x){return x instanceof Array?!(x.length!==2||typeof x[0]!="number"||typeof x[1]!="number"):typeof x=="object"?!(typeof x.x!="number"||typeof x.y!="number"):!1}e.isValidDescriptor=O;function j(x){return typeof x=="object"&&typeof x.x=="number"&&typeof x.y=="number"}e.isPoint=j;function L(x){return x.x===0&&x.y===0}e.isZero=L})(pe||(pe={}));function Li(e,r){try{const s=pe.isValidDescriptor(e)&&pe.make(e),a=pe.isValidDescriptor(r)&&pe.make(r);if(s&&!a){const l=r instanceof Array?r:[r],u=l.length;for(let h=0;h<u;h++){const g=ge.from(l[h]);if(!g)continue;const m=s.x>=g.left&&s.x<=g.right,S=s.y>=g.top&&s.y<=g.bottom;if(m&&S)return!0}return!1}else if(!s&&a){const l=e instanceof Array?e:[e],u=l.length;for(let h=0;h<u;h++){const g=ge.from(l[h]);if(!g)continue;const m=a.x>=g.left&&a.x<=g.right,S=a.y>=g.top&&a.y<=g.bottom;if(m&&S)return!0}return!1}else{if(s&&a)return pe.isEqual(s,a);{const l=[...e instanceof Array?e:[e],...r instanceof Array?r:[r]],u=ge.intersecting.apply(null,l);return u?u.width*u.height!==0:!1}}}catch(s){return console.error(s),!1}}var Pe;(e=>{e.zero=r();function r(x=0,R=0){if(typeof x=="number")return{width:x,height:R};if(!O(x))throw Error("Invalid parameters passed to constructor");return x instanceof Array?{width:x[0],height:x[1]}:{width:x.width,height:x.height}}e.make=r;function s(x,R={}){return r({width:typeof R.width=="number"?R.width:x.width,height:typeof R.height=="number"?R.height:x.height})}e.clone=s;function a(x,R){return r({width:x.width+R.width,height:x.height+R.height})}e.add=a;function l(x,R){return r({width:x.width-R.width,height:x.height-R.height})}e.subtract=l;function u(x,R){return r({width:x.width*R.width,height:x.height*R.height})}e.multiply=u;function h(x,R){return r({width:x.width/R.width,height:x.height/R.height})}e.divide=h;function g(x){return r({width:x.height,height:x.width})}e.invert=g;function m(x,R){return!(x.width!==R.width||x.height!==R.height)}e.isEqual=m;function S(x){return`Size(width=${x.width}, height=${x.height})`}e.toString=S;function k(x){return Object.freeze({width:x.width,height:x.height})}e.toJSON=k;function P(x){return[x.width,x.height]}e.toArray=P;function O(x){return x instanceof Array?!(x.length!==2||typeof x[0]!="number"||typeof x[1]!="number"):typeof x=="object"?!(typeof x.width!="number"||typeof x.height!="number"):!1}e.isValidDescriptor=O;function j(x){return typeof x=="object"&&typeof x.width=="number"&&typeof x.height=="number"}e.isSize=j;function L(x){return x.width===0&&x.height===0}e.isZero=L})(Pe||(Pe={}));var ge;(e=>{e.zero=r();function r(T=0,I=0,E=0,F=0){if(typeof T=="number"&&typeof I=="number"){const W=T,Z=I;return{top:Z,right:W+E,bottom:Z+F,left:W,width:E,height:F}}else if(pe.isPoint(T)&&Pe.isSize(I)){const W=T,Z=I;return{top:W.y,right:W.x+Z.width,bottom:W.y+Z.height,left:W.x,width:Z.width,height:Z.height}}else{const W=T;if(!Q(W))throw Error("Invalid parameters passed to constructor");return{top:W.y,right:W.x+W.width,bottom:W.y+W.height,left:W.x,width:W.width,height:W.height}}}e.make=r;function s(T){return pe.make({x:(T.right-T.left)/2+T.left,y:(T.bottom-T.top)/2+T.top})}e.center=s;function a(T){return Pe.make({width:T.width,height:T.height})}e.size=a;function l(T,I={}){try{if(T==null)return;if(B(T))return T;if(pt(T))return l(document.documentElement||document.body.parentNode||document.body,I);const E=T instanceof Array?T:[T],F=E.length,W=I.reference||window,Z=u(),re=pt(W)?Z:l(I.reference);if(!Z||!re)return;let q;for(let U=0;U<F;U++){const D=E[U],z=D.getBoundingClientRect(),te=r({x:z.left+Z.left-(pt(W)?0:re.left),y:z.top+Z.top-(pt(W)?0:re.top),width:I.overflow?D.scrollWidth:D instanceof HTMLElement?D.offsetWidth:z.width,height:I.overflow?D.scrollHeight:D instanceof HTMLElement?D.offsetHeight:z.height});q=q?O(q,te):te}return q}catch(E){console.error(E);return}}e.from=l;function u(){const T=Math.max(document.documentElement.clientWidth,window.innerWidth||0),I=Math.max(document.documentElement.clientHeight,window.innerHeight||0),E=window.pageXOffset!==void 0?window.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft,F=window.pageYOffset!==void 0?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop;return r({x:E,y:F,width:T,height:I})}e.fromViewport=u;function h(T,I={}){if(T)return pt(T)?l(Array.from(document.body.children)):l(Array.from(T.children),{overflow:I.overflow,reference:I.reference||T})}e.fromChildrenOf=h;function g(T,I,E={}){if(!I)return;const F=Array.from(I.children);return T<=0?r():T>=F.length?l(F,{reference:E.reference,overflow:!1}):(F.splice(T),l(F,{reference:E.reference||I,overflow:!1}))}e.fromChildrenBefore=g;function m(T,I,E={}){if(!I)return;const F=Array.from(I.children);return T<0?l(F,{reference:E.reference,overflow:!1}):T>=F.length-1?r():(F.splice(0,F.length-T-1),l(F,{reference:E.reference||I,overflow:!1}))}e.fromChildrenAfter=m;function S(T,I,E={}){if(!I)return;const F=I.children[T];return l(F,{overflow:E.overflow,reference:E.reference||I})}e.fromChildAt=S;function k(...T){try{const I=T.length,E={};let F,W;for(let Z=0;Z<I;Z++){if(F||(F=l(T[Z])),Z===0&&Z+1===I)W=u();else if(Z+1<I)W=l(T[Z+1]);else break;!F||!W||(E.width=Math.max(0,Math.min(F.right,W.right)-Math.max(F.left,W.left)),E.height=Math.max(0,Math.min(F.bottom,W.bottom)-Math.max(F.top,W.top)),E.y=Math.max(F.top,W.top),E.x=Math.max(F.left,W.left),E.width*E.height===0&&(E.width=0,E.height=0,E.y=NaN,E.x=NaN),F=r(E))}return r(E)}catch(I){console.error(I);return}}e.intersecting=k;function P(T,I={}){return r({x:typeof I.x=="number"?I.x:T.left,y:typeof I.y=="number"?I.y:T.top,width:typeof I.width=="number"?I.width:T.width,height:typeof I.height=="number"?I.height:T.height})}e.clone=P;function O(T,I){return r({x:Math.min(T.left,I.left),y:Math.min(T.top,I.top),width:Math.max(T.right,I.right)-Math.min(T.left,I.left),height:Math.max(T.bottom,I.bottom)-Math.min(T.top,I.top)})}e.concat=O;function j(T){return r({x:T.left,y:T.top,width:T.height,height:T.width})}e.invert=j;function L(T,I){return!(T.top!==I.top||T.right!==I.right||T.bottom!==I.bottom||T.left!==I.left||T.width!==I.width||T.height!==I.height)}e.isEqual=L;function x(T,I){return Li(I,T)}e.contains=x;function R(T){return`Rect(top=${T.top}, right=${T.right}, bottom=${T.bottom}, left=${T.left}, width=${T.width}, height=${T.height})`}e.toString=R;function $(T){return Object.freeze({top:T.top,right:T.right,bottom:T.bottom,left:T.left,width:T.width,height:T.height})}e.toJSON=$;function Q(T){return!(typeof T.x!="number"||typeof T.y!="number"||typeof T.width!="number"||typeof T.height!="number")}e.isValidDescriptor=Q;function B(T){return typeof T=="object"&&typeof T.top=="number"&&typeof T.right=="number"&&typeof T.bottom=="number"&&typeof T.left=="number"&&typeof T.width=="number"&&typeof T.height=="number"}e.isRect=B;function G(T){return T.top===0&&T.right===0&&T.bottom===0&&T.left===0&&T.width===0&&T.height===0}e.isZero=G})(ge||(ge={}));function pt(e){return e===window}function Ne(e){const r=N.useRef(e);return N.useEffect(()=>{r.current=e},[e]),r}function Lt(e,{onResize:r}){const s=Ne(r);N.useLayoutEffect(()=>{const a=e.current;if(!a)return;const l=new ResizeObserver(()=>{s.current?.(a)});return l.observe(a),()=>{l.disconnect()}},[e.current])}function jn(e){const[r,s]=N.useState(ge.zero);return Lt(e,{onResize:a=>{const l=ge.from(a);l&&s(l)}}),ge.size(r)}function gt({in:e,children:r,render:s}){if(e==null)return b.jsx(b.Fragment,{});if(!(e instanceof Array))throw TypeError(`Provided list <${e}> is not an array`);return b.jsx(b.Fragment,{children:e.map((a,l)=>b.jsx(N.Fragment,{children:s?.(a,l)??(typeof r=="function"?r(a,l):r)},`item-${l}`))})}process.env.NODE_ENV!=="production"&&(gt.displayName="Each");function Ft(e,r={},...s){const{className:a,style:l,...u}=r,{className:h,style:g,...m}=e.props;return N.cloneElement(e,{className:`${h??""} ${a??""}`.split(" ").filter(Boolean).join(" ")||void 0,style:{...g??{},...l??{}},...m,...u},...s)}function me({children:e,element:r,...s}){return Ft(r,s,...e?Array.isArray(e)?e:[e]:[])}process.env.NODE_ENV!=="production"&&(me.displayName="Styled");function Oe(e,r={}){const s=Object.keys(r),a=Object.values(r),l={};return N.Children.forEach(e,u=>{if(!N.isValidElement(u)){console.error("[etudes::asComponentDict] Invalid child detected");return}const h=a.indexOf(u.type);if(h<0){console.error(`[etudes::asComponentDict] Unsupported child, only the following children are allowed: ${a.map(m=>m.displayName??m.name).join(", ")}`);return}const g=s[h];if(l[g]){console.error(`[etudes::asComponentDict] Only one ${a[h]} can be provided as a child`);return}l[g]=u}),l}function Fi(e){return e}function le(...e){return e.reduce((r,s)=>({...r,...s||{}}),{})}const Dt=N.forwardRef(({className:e,children:r,style:s,isSelectionTogglable:a=!1,itemLength:l,itemPadding:u=0,items:h=[],layout:g="list",numSegments:m=1,orientation:S="vertical",selection:k,selectionMode:P="none",onActivateAt:O,onDeselectAt:j,onCustomEvent:L,onSelectAt:x,onSelectionChange:R,ItemComponent:$,...Q},B)=>{const G=Vi(k??[],h),T=Bi({itemLength:l,itemPadding:u,layout:g,numSegments:m,orientation:S}),I=U=>G.indexOf(U)>=0,E=U=>{I(U)?W(U):F(U)},F=U=>{if(I(U))return;let D;switch(P){case"multiple":{D=ee=>Lr([...ee.filter(ce=>ce!==U),U]);break}case"single":{D=ee=>[U];break}default:return}const z=G,te=D(G);re(z,te)},W=U=>{if(!I(U))return;const D=ee=>ee.filter(ce=>ce!==U),z=G,te=D(G);re(z,te)},Z=U=>{O?.(U),P!=="none"&&(a?E(U):F(U))},re=(U,D)=>{if(Ve(U,D))return;const z=U?.filter(ee=>D.indexOf(ee)===-1)??[],te=D.filter(ee=>U?.indexOf(ee)===-1);z.forEach(ee=>j?.(ee)),te.forEach(ee=>x?.(ee)),R?.(D)};N.useEffect(()=>{const U=G;let D;switch(P){case"multiple":D=G;break;case"single":D=G.slice(-1);break;default:D=[];break}re(U,D)},[P]);const q=Oe(r,{item:st});return b.jsx("div",{...Q,ref:B,"aria-multiselectable":P==="multiple",className:ae(e),role:g==="grid"?"grid":P==="none"?"list":"listbox",style:le(s,T.root),children:b.jsx(gt,{in:h,children:(U,D)=>{const z=g==="grid"?"gridcell":P==="none"?"listitem":"option",te=I(D),ee=le(T.item,{pointerEvents:a!==!0&&I(D)?"none":"auto",...D>=h.length-1?{}:{...g==="list"?{...S==="vertical"?{marginBottom:`${u}px`}:{marginRight:`${u}px`}}:{}}});return $?b.jsx($,{"aria-selected":te,className:ae({active:te}),index:D,isSelected:I(D),item:U,orientation:S,role:z,style:ee,onClick:()=>Z(D),onCustomEvent:(ce,H)=>L?.(D,ce,H)}):b.jsx(me,{"aria-selected":te,className:ae({active:te}),element:q.item??b.jsx(st,{}),role:z,selectionMode:P,style:ee,onActivateAt:O,onClick:()=>Z(D),children:`${U}`})}})})}),st=({children:e,selectionMode:r,onActivateAt:s,...a})=>s||r==="single"||r==="multiple"?b.jsx("button",{...a,children:e}):b.jsx("div",{...a,children:e});function Di(e,r){return!!(isNaN(e)||e>=r.length||e<0)}function Vi(e,r){return Lr(e).filter(s=>!Di(s,r))}function Lr(e){return e.sort((r,s)=>r-s)}function Bi({itemLength:e=NaN,itemPadding:r=0,layout:s="collection",numSegments:a=1,orientation:l="vertical"}){return{root:{counterReset:"item-counter",listStyle:"none",...s==="list"?{alignItems:"flex-start",display:"flex",flex:"0 0 auto",flexDirection:l==="horizontal"?"row":"column",justifyContent:"flex-start"}:{display:"grid",gap:`${r}px`,...l==="vertical"?{gridAutoRows:isNaN(e)?void 0:`${e}px`,gridTemplateColumns:`repeat(${a}, 1fr)`,gridAutoFlow:"row"}:{gridAutoColumns:isNaN(e)?void 0:`${e}px`,gridTemplateRows:`repeat(${a}, 1fr)`,gridAutoFlow:"column"}}},item:{counterIncrement:"item-counter",flex:"0 0 auto",...s==="list"?{...l==="vertical"?{width:"100%",height:isNaN(e)?void 0:`${e}px`}:{width:isNaN(e)?void 0:`${e}px`,height:"100%"}}:{}}}}process.env.NODE_ENV!=="production"&&(Dt.displayName="Collection",st.displayName="CollectionItem");const Fr=N.forwardRef(({children:e,style:r,autoCollapseSections:s=!1,expandedSectionIndices:a,orientation:l="vertical",sectionPadding:u=0,sections:h,selection:g,selectionMode:m="single",onActivateAt:S,onCollapseSectionAt:k,onDeselectAt:P,onExpandedSectionsChange:O,onExpandSectionAt:j,onHeaderCustomEvent:L,onItemCustomEvent:x,onSelectAt:R,onSelectionChange:$,HeaderComponent:Q,ItemComponent:B,...G},T)=>{const I=Xi(g??{},h),E=Yi(a??[],h),F=Ui({orientation:l}),W=h.map(()=>N.useRef(null)),Z=W.map(H=>jn(H)),re=(H,C)=>(I[C]?.indexOf(H)??-1)>=0,q=H=>E.indexOf(H)>=0,U=H=>{let C;q(H)?C=Y=>Y.filter(oe=>oe!==H):s?C=Y=>[H]:C=Y=>[...Y.filter(oe=>oe!==H),H],te(E,C(E))},D=(H,C)=>{if(re(H,C))return;let Y;switch(m){case"multiple":Y=ie=>({...ie,[C]:Ht([...(ie[C]??[]).filter(fe=>fe!==H),H])});break;case"single":Y=ie=>({[C]:[H]});break;default:return}const oe=Y(I);ee(I,oe)},z=(H,C)=>{if(!re(H,C))return;const oe=(ie=>({...ie,[C]:(ie[C]??[]).filter(fe=>fe!==H)}))(I);ee(I,oe)},te=(H,C)=>{if(Ve(H,C))return;const Y=H?.filter(ie=>C.indexOf(ie)===-1)??[],oe=C.filter(ie=>H?.indexOf(ie)===-1);Y.forEach(ie=>k?.(ie)),oe.forEach(ie=>j?.(ie)),O?.(C)},ee=(H,C)=>{if(Ve(H,C))return;const Y=h.length;let oe=[],ie=[];for(let fe=0;fe<Y;fe++){const ve=H?.[fe]??[],Ee=C[fe]??[],Se=ve.filter(J=>Ee.indexOf(J)===-1),xe=Ee.filter(J=>ve?.indexOf(J)===-1);oe=[...oe,...Se.map(J=>[J,fe])],ie=[...ie,...xe.map(J=>[J,fe])]}oe.forEach(fe=>P?.(fe[0],fe[1])),ie.forEach(fe=>R?.(fe[0],fe[1])),$?.(C)},ce=Oe(e,{collapseIcon:Mn,expandIcon:An,header:Vt,item:Bt,section:zn});return b.jsx("div",{...G,ref:T,style:le(r,F.root),children:b.jsx(gt,{in:h,children:(H,C)=>{const{collectionPadding:Y=0,items:oe=[],itemLength:ie=50,itemPadding:fe=0,isSelectionTogglable:ve,layout:Ee="list",maxVisible:Se=-1,numSegments:xe=1}=H,J=Ee==="list"?oe.length:Math.ceil(oe.length/xe),ze=Se<0?J:Math.min(J,Se),_e=ie*ze+fe*(ze-1),ke=!q(C),De=Z[C];return b.jsxs(me,{element:ce.section??b.jsx(zn,{}),style:le(F.section,l==="vertical"?{marginTop:C===0?"0px":`${u}px`,...De.height>0?{height:ke?`${De.height}px`:`${_e+De.height+Y}px`}:{visibility:"hidden"}}:{marginLeft:C===0?"0px":`${u}px`,...De.width>0?{width:ke?`${De.width}px`:`${_e+De.width+Y}px`}:{visibility:"hidden"}}),children:[b.jsx("div",{ref:W[C],style:le(F.headerContainer),children:Q?b.jsx(Q,{"aria-expanded":!ke,className:ae({collapsed:ke,expanded:!ke}),index:C,isCollapsed:ke,role:"button",section:H,style:le(F.header),onClick:()=>U(C),onCustomEvent:(Ae,He)=>L?.(C,Ae,He)}):b.jsxs(me,{"aria-expanded":!ke,className:ae({collapsed:ke,expanded:!ke}),element:ce.header??b.jsx(Vt,{}),role:"button",style:le(F.header),onClick:()=>U(C),children:[b.jsx("span",{dangerouslySetInnerHTML:{__html:H.label}}),ce.expandIcon&&b.jsx(me,{className:ae({collapsed:ke,expanded:!ke}),element:ke?ce.collapseIcon??ce.expandIcon:ce.expandIcon,style:le(ke?F.collapseIcon:F.expandIcon)})]})}),b.jsx("div",{role:"region",style:le({pointerEvents:ke?"none":"auto"},l==="vertical"?{width:"100%",height:`${_e}px`,marginTop:`${Y}px`,overflowY:Se<0||Se>=J?"hidden":"scroll"}:{marginLeft:`${Y}px`,overflowX:Se<0||Se>=J?"hidden":"scroll",width:`${_e}px`,height:"100%"}),children:b.jsx(Dt,{className:ae({collapsed:ke,expanded:!ke}),isSelectionTogglable:ve,ItemComponent:B,itemLength:ie,itemPadding:fe,items:oe,layout:Ee,numSegments:xe,orientation:l,selection:I[C]??[],selectionMode:m,style:le(l==="vertical"?{width:"100%"}:{height:"100%"}),onActivateAt:Ae=>S?.(Ae,C),onCustomEvent:(Ae,He,Ye)=>x?.(Ae,C,He,Ye),onDeselectAt:Ae=>z(Ae,C),onSelectAt:Ae=>D(Ae,C),children:!B&&(ce.item??b.jsx(Bt,{}))})})]})}})})}),Vt=({children:e,...r})=>b.jsx("button",{...r,children:e}),An=({children:e,...r})=>b.jsx("figure",{...r,children:e}),Mn=({children:e,...r})=>b.jsx("figure",{...r,children:e}),zn=({children:e,...r})=>b.jsx("div",{...r,children:e}),Bt=st;function Dr(e,r){return e>=r.length||e<0}function Hi(e,r,s){if(Dr(r,s))return!0;const a=s[r].items??[];return e>=a.length||e<0}function Yi(e,r){return Ht(e).filter(s=>!Dr(s,r))}function Xi(e,r){const s={};for(const a in r){if(!Object.hasOwn(r,a))continue;const l=Ht([...e[a]??[]]);s[Number(a)]=Ht(l).filter(u=>!Hi(u,Number(a),r))}return s}function Ht(e){return e.sort((r,s)=>r-s)}function Ui({orientation:e="vertical"}){return{root:{alignItems:"center",boxSizing:"border-box",display:"flex",flex:"0 0 auto",justifyContent:"flex-start",padding:"0",...e==="vertical"?{flexDirection:"column",height:"auto"}:{flexDirection:"row",width:"auto"}},collapseIcon:{pointerEvents:"none",zIndex:1},expandIcon:{pointerEvents:"none",zIndex:1},section:{alignItems:"flex-start",display:"flex",flex:"0 0 auto",justifyContent:"flex-start",margin:"0",overflow:"hidden",padding:"0",...e==="vertical"?{flexDirection:"column",width:"100%"}:{flexDirection:"row",height:"100%"}},headerContainer:{flexShrink:"0",...e==="vertical"?{width:"100%"}:{height:"100%"}},header:{cursor:"pointer",margin:"0",...e==="vertical"?{width:"100%"}:{height:"100%"}}}}process.env.NODE_ENV!=="production"&&(Fr.displayName="Accordion",Vt.displayName="AccordionHeader",An.displayName="AccordionExpandIcon",Mn.displayName="AccordionCollapseIcon",Bt.displayName="AccordionItem");function Yt({count:e=1,children:r,render:s}){return b.jsx(b.Fragment,{children:[...Array(e)].map((a,l)=>b.jsx(N.Fragment,{children:s?.(l)??(typeof r=="function"?r(l):r)},`element-${l}`))})}process.env.NODE_ENV!=="production"&&(Yt.displayName="Repeat");function Gi(e){return e}const Ln=N.forwardRef(({children:e,className:r,isActive:s=!1,isTailHidden:a=!1,isSplit:l=!1,numberOfBars:u=3,...h},g)=>{const m=Oe(e,{bar:mt}),S={root:ae({active:s}),bar:ae({active:s})},k=Ki({isSplit:l,isActive:s,isTailHidden:a});return b.jsx("div",{...h,ref:g,className:ae(r,S.root),children:b.jsx(Yt,{count:l?2:1,children:P=>b.jsx("div",{"aria-hidden":!0,style:le(k.section,k[`section${P}`]),children:b.jsx(Yt,{count:u,children:O=>b.jsx(me,{"aria-hidden":!0,className:ae(S.bar),element:m.bar??b.jsx(mt,{}),style:(()=>{switch(u){case 2:return le(k.bar,k[`bar${P}${O===0?0:2}`]);case 3:default:return le(k.bar,k[`bar${P}${O}`])}})()})})})})})}),mt=({...e})=>b.jsx("span",{...e});function Ki({isActive:e=!1,isSplit:r=!1,isTailHidden:s=!1}){return{section:{height:"100%",position:"absolute",width:r?"50%":"100%"},section0:{left:"0",top:"0"},section1:{right:"0",top:"0"},bar:{margin:"0",padding:"0",position:"absolute",width:"100%"},bar00:{left:"0",top:e?"50%":"0",transform:e?"translate(0, -50%) rotate(45deg)":"translate(0, 0) rotate(0deg)",transformOrigin:r?"right center":"center"},bar01:{left:"0",top:"50%",transform:e?"translate(0, -50%) scale(0)":"translate(0, -50%) scale(1)",transformOrigin:r?"right center":"center"},bar02:{left:"0",top:e?"50%":"100%",transform:e?"translate(0, -50%) rotate(-45deg)":"translate(0, -100%) rotate(0deg)",transformOrigin:r?"right center":"center",width:e||r?"100%":`${s?"50%":"100%"}`},bar10:{left:"0",top:e?"50%":"0",transform:e?"translate(0, -50%) rotate(-45deg)":"translate(0, 0) rotate(0deg)",transformOrigin:"left center"},bar11:{left:"0",top:"50%",transform:e?"translate(0, -50%) scale(0)":"translate(0, -50%) scale(1)",transformOrigin:"left center"},bar12:{left:"0",top:e?"50%":"100%",transform:e?"translate(0, -50%) rotate(45deg)":"translate(0, -100%) rotate(0deg)",transformOrigin:"left center",width:s&&!e?"0":"100%"}}}process.env.NODE_ENV!=="production"&&(Ln.displayName="Burger",mt.displayName="BurgerBar");const Vr=N.forwardRef(({children:e,className:r,style:s,isActive:a=!1,isTailHidden:l=!1,isSplit:u=!1,numberOfBars:h=3,onActivate:g,onDeactivate:m,onToggle:S,...k},P)=>{const O=()=>{const x=!a;S?.(x),x?g?.():m?.()},j={root:ae({active:a})},L=Wi();return b.jsx("button",{...k,ref:P,"aria-expanded":a,className:ae(r,j.root),style:le(s,L.root),onClick:O,children:b.jsx(Ln,{isActive:a,isSplit:u,isTailHidden:l,numberOfBars:h,children:e})})}),Br=mt;function Wi(){return{root:{background:"transparent",border:"none",display:"block",outline:"none"}}}process.env.NODE_ENV!=="production"&&(Vr.displayName="BurgerButton",Br.displayName="BurgerButtonBar");function Hr(e){switch(!0){case Ji(e):{const{action:r,children:s,isNav:a,className:l,isDisabled:u,label:h,...g}=e;return b.jsx(In.NavLink,{...g,"aria-disabled":u,"aria-label":h,className:ae(l,{disabled:u}),to:r,children:s??h})}case Zi(e):{const{action:r,children:s,className:a,isDisabled:l,label:u,...h}=e;return b.jsx(In.Link,{...h,"aria-disabled":l,"aria-label":u,className:ae(a,{disabled:l}),to:r,children:s??u})}case Qi(e):{const{action:r,children:s,className:a,isDisabled:l,label:u,opensInNewTab:h,...g}=e;return b.jsx("a",{...g,"aria-disabled":l,"aria-label":u,className:ae(a,{disabled:l}),href:r,rel:h?"noopener,noreferrer":void 0,target:h?"_blank":void 0,children:s??u})}case $i(e):{const{action:r,children:s,className:a,isDisabled:l,label:u,type:h="button",...g}=e;return b.jsx("button",{...g,"aria-disabled":l,"aria-label":u,className:a,disabled:l,type:h,onClick:()=>r(),children:s??u})}default:return console.error("[etudes::Button] Unknown button type"),b.jsx(b.Fragment,{})}}function Ji(e){return!(typeof e.action!="string"||!e.action.startsWith("/")||!("isNav"in e)||!e.isNav)}function Zi(e){return!(typeof e.action!="string"||!e.action.startsWith("/")||"isNav"in e&&e.isNav)}function Qi(e){return!(typeof e.action!="string"||e.action.startsWith("/"))}function $i(e){return typeof e.action=="function"}process.env.NODE_ENV!=="production"&&(Hr.displayName="Button");function Yr(e,{isEnabled:r=!0,updatesCursor:s=!0,onDragStart:a,onDragMove:l,onDragEnd:u}){const h=N.useRef(void 0),g=N.useRef(void 0),m=Ne(a),S=Ne(l),k=Ne(u),P=N.useCallback(L=>{if(!h.current)return;const x=pe.make(L.clientX,L.clientY),R=pe.subtract(x,g.current??h.current);g.current=x,S.current?.(R,x,h.current)},[]),O=N.useCallback(L=>{const x=e.current;if(!x||!h.current)return;const R=pe.make(L.clientX,L.clientY),$=pe.subtract(g.current??h.current,R);k.current?.(R,$,h.current),h.current=void 0,g.current=void 0,x.removeEventListener("mousemove",P),x.removeEventListener("mouseup",O,{capture:!0}),x.removeEventListener("mouseleave",O),s&&(x.style.cursor="grab")},[s,P]),j=N.useCallback(L=>{const x=e.current;if(!x)return;L.preventDefault();const R=pe.make(L.clientX,L.clientY);h.current=R,g.current=R,x.addEventListener("mousemove",P),x.addEventListener("mouseup",O,{capture:!0}),x.addEventListener("mouseleave",O),s&&(x.style.cursor="grabbing"),m.current?.(R)},[s,P,O]);N.useLayoutEffect(()=>{const L=e.current;if(!L||!r||!s)return;const x=L.style.cursor;return L.style.cursor="grab",()=>{L.style.cursor=x}},[r,s]),N.useLayoutEffect(()=>{const L=e.current;if(!(!L||!r))return L.addEventListener("mousedown",j),()=>{L.removeEventListener("mousedown",j),L.removeEventListener("mousemove",P),L.removeEventListener("mouseup",O,{capture:!0}),L.removeEventListener("mouseleave",O)}},[r,P,O,j])}function Xr(e,{autoStarts:r=!0,shouldInvokeInitially:s=!1,onInterval:a}){const l=N.useRef(void 0),u=Ne(a),h=N.useCallback(()=>{clearInterval(l.current),l.current=void 0},[]),g=N.useCallback(()=>{h(),!(e<0)&&(s&&u.current(),l.current=setInterval(()=>{u.current()},e))},[e,s,h]);return N.useEffect(()=>(r&&e>0&&g(),h),[r,e,g,h]),{start:g,stop:h}}const Ur=N.forwardRef(({autoAdvanceInterval:e=0,index:r=0,isDragEnabled:s=!0,items:a=[],orientation:l="horizontal",tracksItemExposure:u=!1,onAutoAdvancePause:h,onAutoAdvanceResume:g,onIndexChange:m,ItemComponent:S,...k},P)=>{const O=N.useRef(void 0),j=N.useRef(null),L=N.useRef(void 0),x=N.useRef(void 0),R=N.useRef(void 0),$=1e3,[Q,B]=N.useState(Fn(j,l)),[G,T]=N.useState(!1),I=ts({scrollSnapEnabled:!G,orientation:l}),E=e>0,F=N.useCallback(z=>{m?.(z)},[m]),W=N.useCallback(z=>{L.current=pe.make(z.clientX,z.clientY),T(!0)},[]),Z=N.useCallback(z=>{const te=L.current,ee=x.current;if(!te||!ee)return;const ce=5,H=pe.subtract(te,ee);(Math.abs(H.x)>ce||Math.abs(H.y)>ce)&&z.stopPropagation(),L.current=void 0,x.current=void 0},[]),re=N.useCallback(z=>{x.current=pe.make(z.clientX,z.clientY),G&&T(!1)},[G]),q=N.useCallback(()=>{qi(j,r,l),clearTimeout(R.current),R.current=setTimeout(()=>{clearTimeout(R.current),R.current=void 0},$)},[j.current,r,l,$]),U=N.useCallback(()=>{const z=(r+a.length+1)%a.length;F(z)},[G,r,a.length,F]),D=N.useCallback(({x:z,y:te})=>{const ee=j.current;switch(l){case"horizontal":requestAnimationFrame(()=>{ee&&(ee.scrollLeft-=z*1.5)});break;case"vertical":requestAnimationFrame(()=>{ee&&(ee.scrollTop-=te*1.5)});break;default:console.error(`[etudes::Carousel] Unsupported orientation: ${l}`)}},[l,j.current]);return N.useEffect(()=>{const z=j.current;if(!z)return;const te=O.current===void 0,ee=O.current===r,ce=H=>{if(u&&B(Fn(j,l)),R.current!==void 0)return;const C=Math.round(l==="horizontal"?z.scrollLeft/z.clientWidth:z.scrollTop/z.clientHeight),Y=Math.max(0,Math.min(a.length-1,C));Y!==r&&(O.current=Y,F(Y))};return z.addEventListener("scroll",ce),u&&B(Fn(j,l)),ee||(O.current=r,te||(F(r),q())),()=>{z.removeEventListener("scroll",ce)}},[r,l,u]),N.useEffect(()=>{E&&(G?h?.():g?.())},[G,E]),Yr(j,{isEnabled:s&&a.length>1,onDragMove:D}),Xr(G||!E?-1:e,{onInterval:U}),b.jsx("div",{...k,ref:P,role:"region",onClick:z=>Z(z),onPointerCancel:z=>re(z),onPointerDown:z=>W(z),onPointerLeave:z=>re(z),onPointerUp:z=>re(z),children:b.jsx("div",{ref:j,style:le(I.viewport),children:b.jsx(gt,{in:a,children:({style:z,...te},ee)=>b.jsx("div",{style:le(I.itemContainer),children:b.jsx(S,{"aria-hidden":ee!==r,exposure:u?Q?.[ee]:void 0,style:le(z,I.item),...te})})})})})});function qi(e,r,s){const a=e?.current;if(!a)return;const l=s==="horizontal"?0:a.clientHeight*r,u=s==="horizontal"?a.clientWidth*r:0;a.scrollTop===l&&a.scrollLeft===u||a.scrollTo({top:l,left:u,behavior:"smooth"})}function Fn(e,r){const s=e?.current;if(!s)return;const a=[];for(let l=0;l<s.children.length;l++)a.push(es(l,e,r));return a}function es(e,r,s){const a=r?.current,l=a?.children[e];if(!l)return 0;const u=ge.intersecting(l,a);if(!u)return 0;switch(s){case"horizontal":return Math.max(0,Math.min(1,Math.round((u.width/a.clientWidth+Number.EPSILON)*1e3)/1e3));case"vertical":return Math.max(0,Math.min(1,Math.round((u.height/a.clientHeight+Number.EPSILON)*1e3)/1e3));default:return console.error(`[etudes::Carousel] Unsupported orientation: ${s}`),NaN}}function ts({scrollSnapEnabled:e=!1,orientation:r="horizontal"}){return{viewport:{alignItems:"center",display:"flex",height:"100%",userSelect:e?"auto":"none",justifyContent:"flex-start",scrollBehavior:e?"smooth":"auto",scrollSnapStop:e?"always":"unset",WebkitOverflowScrolling:"touch",width:"100%",...r==="horizontal"?{flexDirection:"row",overflowX:"scroll",overflowY:"hidden",scrollSnapType:e?"x mandatory":"none"}:{flexDirection:"column",overflowX:"hidden",overflowY:"scroll",scrollSnapType:e?"y mandatory":"none"}},itemContainer:{height:"100%",overflow:"hidden",scrollSnapAlign:"center",width:"100%",flex:"0 0 auto"},item:{height:"100%",width:"100%"}}}process.env.NODE_ENV!=="production"&&(Ur.displayName="Carousel");function Gr(e){const r=N.useRef(void 0);return N.useEffect(()=>{r.current=e},[e]),r.current}const Dn=N.forwardRef(({className:e,emptyValue:r="",isDisabled:s=!1,isRequired:a=!1,placeholder:l,value:u,formatter:h,onFocus:g,onUnfocus:m,onChange:S,...k},P)=>{const O=N.useCallback(j=>{const L=(h?.(j)??j)||r;S?.(L)},[S,h]);return b.jsx("input",{...k,ref:P,"aria-disabled":s,"aria-placeholder":l,"aria-required":a,className:ae(e,{disabled:s}),disabled:s,placeholder:l,required:a,type:"text",value:u||r,onBlur:({target:j})=>m?.(j.value),onChange:({target:j})=>O(j.value),onFocus:({target:j})=>g?.(j.value)})});process.env.NODE_ENV!=="production"&&(Dn.displayName="TextField");const Kr=N.forwardRef(({children:e,style:r,allowsInput:s=!0,max:a=NaN,min:l=NaN,quantity:u=0,onChange:h,...g},m)=>{const S=()=>{h?.(x(u-1))},k=()=>{h?.(x(u+1))},P=I=>{$(I)},O=I=>{const E=L(I);E!==u?h?.(E):$(j(E))},j=I=>I.toLocaleString(),L=I=>{const E=parseInt(I,10);return E.toString()!==I.replace(/^0+/,"")?u:x(E)},x=I=>{let E=I;return isNaN(l)||(E=Math.max(l,E)),isNaN(a)||(E=Math.min(a,E)),E},[R,$]=N.useState(j(u)),Q=Gr(u),B=!isNaN(a)&&u+1>a,G=!isNaN(l)&&u-1<l;N.useEffect(()=>{if(Q===void 0||Q===u)return;const I=x(u);$(j(I))},[u,l,a]);const T=Oe(e,{textField:Xt,addButton:Ut,subscribeButton:Gt});return b.jsxs("div",{...g,ref:m,style:le(r,Kt.root),children:[b.jsx(me,{className:ae({disabled:G}),element:T.subscribeButton??b.jsx(Gt,{}),style:le(Kt.subtract),onClick:()=>S()}),b.jsx(me,{element:T.textField??b.jsx(Xt,{}),isDisabled:!s,style:le(Kt.textField),value:R,onChange:P,onUnfocus:O}),b.jsx(me,{className:ae({disabled:B}),element:T.addButton??b.jsx(Ut,{}),style:le(Kt.add),onClick:()=>k()})]})}),Xt=({...e})=>b.jsx(Dn,{...e}),Ut=({children:e,...r})=>b.jsx("button",{...r,children:e}),Gt=({children:e,...r})=>b.jsx("button",{...r,children:e}),Kt={root:{alignItems:"stretch",display:"flex",flexDirection:"row",justifyContent:"stretch"},subtract:{flex:"0 0 auto"},add:{flex:"0 0 auto"},textField:{width:"100%"}};process.env.NODE_ENV!=="production"&&(Kr.displayName="Counter",Ut.displayName="CounterAddButton",Gt.displayName="CounterSubtractButton",Xt.displayName="CounterTextField");function Wr(){const[e,r]=N.useState(Pe.zero);return N.useLayoutEffect(()=>{const s=()=>{const a=ge.size(ge.fromViewport());r(a)};return window.addEventListener("resize",s),s(),()=>{window.removeEventListener("resize",s)}},[]),e}function Be(e){const[r,s]=N.useState(ge.zero),a=Wr();return Lt(e,{onResize:l=>{const u=ge.from(l);u&&s(u)}}),N.useLayoutEffect(()=>{const l=e.current,u=ge.from(l);u&&s(u)},[Pe.toString(a)]),r}function Jr({src:e,srcSet:r,sizes:s},{onLoadStart:a,onLoadComplete:l,onLoadError:u}={}){const h=N.useRef(void 0),g=Ne(a),m=Ne(l),S=Ne(u);N.useLayoutEffect(()=>{const k=O=>{const j=O.currentTarget;m.current?.(j)},P=O=>{const j=O.currentTarget;S.current?.(j)};return h.current=new Image,e&&(h.current.src=e),r&&(h.current.srcset=r),s&&(h.current.sizes=s),g.current?.(h.current),h.current.addEventListener("load",k),h.current.addEventListener("error",P),()=>{h.current?.removeEventListener("load",k),h.current?.removeEventListener("error",P),h.current=void 0}},[e,r,s])}function Vn({src:e,srcSet:r,sizes:s},{preservesSizeBetweenLoads:a=!0,onLoadStart:l,onLoadComplete:u,onLoadError:h}={}){const[g,m]=N.useState(),S=Ne(l),k=Ne(u),P=Ne(h),O=N.useCallback(x=>{a||m(void 0),S.current?.(x)},[a]),j=N.useCallback(x=>{m(ns(x)),k.current?.(x)},[]),L=N.useCallback(x=>{a||m(void 0),P.current?.(x)},[a]);return Jr({src:e,srcSet:r,sizes:s},{onLoadStart:O,onLoadComplete:j,onLoadError:L}),g}function ns(e){if(e&&typeof e.width=="number"&&typeof e.height=="number")return Pe.make(e.width,e.height)}const Bn=N.forwardRef(({alt:e,loadingMode:r="preload",sizes:s,src:a,srcSet:l,onLoadStart:u,onLoadComplete:h,onLoadError:g,onSizeChange:m,...S},k)=>{const P=l?.map(({pixelDensity:L,src:x,width:R})=>{if(s&&R===void 0){console.error("[etudes::Image] `width` must be specified if `sizes` is specified");return}if(R!==void 0&&L!==void 0){console.error("[etudes::Image] Only one of `width` or `pixelDensity` can be specified");return}let $=x;if(R!==void 0){const Q=Math.floor(R);if(!isFinite(Q)||String(Q)!==String(R)||Q<=0){console.error("[etudes::Image] The specified width must be a positive integer greater than 0");return}$+=` ${Q}w`}else if(L!==void 0){if(!isFinite(L)||L<=0){console.error("[etudes::Image] The specified pixel density must be a positive floating number than 0");return}$+=` ${L}x`}return $}).filter(Boolean).join(", "),O=s?.map(({mediaCondition:L,width:x},R)=>{const $=R===s.length-1;let Q=x;if($&&L){console.error("[etudes::Image] The last item in `sizes` must not have a `mediaCondition` specified");return}return L&&(Q=`${L} ${Q}`),Q}).filter(Boolean).join(", "),j=Vn({src:a,srcSet:P,sizes:O},{onLoadStart:u,onLoadComplete:h,onLoadError:g});return N.useEffect(()=>{m?.(j)},[j?.width,j?.height]),b.jsx("img",{...S,ref:k,alt:e,loading:r==="lazy"?"lazy":"eager",sizes:O,src:a,srcSet:P})});process.env.NODE_ENV!=="production"&&(Bn.displayName="Image");const Zr=N.forwardRef(({children:e,style:r,alt:s,aspectRatio:a=NaN,loadingMode:l,sizes:u,src:h,srcSet:g,onLoadStart:m,onLoadComplete:S,onLoadError:k,...P},O)=>{const j=E=>{$(E?E.width/E.height:NaN)},L=N.useRef(null),x=O??L,[R,$]=N.useState(NaN),Q=isNaN(a)?R:a,B=Be(x),G=B.width/B.height,T=Pe.make(G>1?Math.max(B.width,B.height*Q):Math.max(B.width,Math.max(B.height,B.width/Q)*Q),G>1?Math.max(B.height,Math.max(B.width,B.height*Q)/Q):Math.max(B.height,B.width/Q)),I=Oe(e,{content:Hn,viewport:Yn});return b.jsxs("div",{...P,ref:x,style:le(r,Xn.root),children:[b.jsx(Bn,{alt:s,sizes:u,src:h,srcSet:g,style:le(Xn.viewport,{height:`${T.height}px`,maxWidth:"unset",width:`${T.width}px`}),onLoadComplete:S,onLoadError:k,onLoadStart:m,onSizeChange:E=>j(E)}),I.viewport&&b.jsx(me,{element:I.viewport,style:le(Xn.viewport,{height:`${T.height}px`,pointerEvents:"none",width:`${T.width}px`})}),I.content]})}),Hn=({children:e,...r})=>b.jsx("div",{...r,children:e}),Yn=({children:e,...r})=>b.jsx("div",{...r,children:e}),Xn={root:{overflow:"hidden"},viewport:{fontSize:"0",left:"50%",position:"absolute",top:"50%",transform:"translate(-50%, -50%)"}};process.env.NODE_ENV!=="production"&&(Zr.displayName="CoverImage",Hn.displayName="CoverImageContent",Yn.displayName="CoverImageViewport");function Qr(e,{onLoadStart:r,onLoadComplete:s,onLoadError:a}={}){const l=Ne(r),u=Ne(s),h=Ne(a);N.useLayoutEffect(()=>{if(!e)return;const g=document.createElement("video"),m=()=>u.current?.(g),S=()=>h.current?.(g);return g.addEventListener("loadedmetadata",m),g.addEventListener("error",S),g.src=e,l.current?.(g),()=>{g.removeEventListener("loadedmetadata",m),g.removeEventListener("error",S),g.src=""}},[e])}function $r(e,{preservesSizeBetweenLoads:r=!0,onLoadStart:s,onLoadComplete:a,onLoadError:l}={}){const[u,h]=N.useState(),g=Ne(s),m=Ne(a),S=Ne(l),k=N.useCallback(j=>{r||h(void 0),g.current?.(j)},[r]),P=N.useCallback(j=>{h(rs(j)),m.current?.(j)},[]),O=N.useCallback(j=>{r||h(void 0),S.current?.(j)},[r]);return Qr(e,{onLoadStart:k,onLoadComplete:P,onLoadError:O}),u}function rs(e){if(e&&typeof e.videoWidth=="number"&&typeof e.videoHeight=="number")return Pe.make(e.videoWidth,e.videoHeight)}const Un=N.forwardRef(({autoLoop:e=!0,autoPlay:r=!0,hasControls:s=!1,isMuted:a=!0,playsInline:l=!0,posterSrc:u,src:h,onCanPlay:g,onEnd:m,onFullscreenChange:S,onLoadMetadata:k,onLoadMetadataComplete:P,onLoadMetadataError:O,onPause:j,onPlay:L,onSizeChange:x,onTimeUpdate:R,...$},Q)=>{const B=N.useRef(null),G=Q??B,T=$r(h,{onLoadStart:k,onLoadComplete:P,onLoadError:O});N.useEffect(()=>{if(!G.current)return;if(h.toLowerCase().endsWith(".m3u8")){const D=!!G.current.canPlayType("application/x-mpegURL"),z=typeof window<"u"&&typeof window.Hls<"u"?window.Hls:void 0;if(!D&&z?.isSupported()){const te=new z;te.loadSource(h),te.attachMedia(G.current)}}const U=D=>{const z=document.fullScreen||document.mozFullScreen||document.webkitIsFullScreen;z!==void 0&&S?.(z)};return G.current.muted=a,G.current.load(),G.current.addEventListener("webkitfullscreenchange",U),G.current.addEventListener("mozfullscreenchange",U),G.current.addEventListener("fullscreenchange",U),()=>{q(),G.current?.removeEventListener("webkitfullscreenchange",U),G.current?.removeEventListener("mozfullscreenchange",U),G.current?.removeEventListener("fullscreenchange",U)}},[h]),N.useEffect(()=>{x?.(T)},[T]);const I=U=>{const D=U.currentTarget;r&&D.paused&&re(),g?.()},E=U=>{L?.()},F=U=>{j?.()},W=U=>{m?.()},Z=U=>{const D=U.currentTarget;R?.(D.currentTime,D.duration)},re=()=>{G.current&&G.current.play()},q=()=>{G.current&&G.current.pause()};return b.jsx("video",{...$,ref:G,autoPlay:r,controls:s,loop:e,muted:a,playsInline:l,poster:u,onCanPlay:I,onEnded:W,onPause:F,onPlay:E,onTimeUpdate:Z,children:b.jsx("source",{src:h})})});process.env.NODE_ENV!=="production"&&(Un.displayName="Video");const qr=N.forwardRef(({className:e,children:r,style:s,aspectRatio:a=NaN,autoLoop:l,autoPlay:u,hasControls:h,isMuted:g,playsInline:m,posterSrc:S,src:k,onCanPlay:P,onEnd:O,onFullscreenChange:j,onLoadMetadata:L,onLoadMetadataComplete:x,onLoadMetadataError:R,onPause:$,onPlay:Q,onSizeChange:B,...G},T)=>{const I=z=>{Z(z?z.width/z.height:NaN),B?.(z)},E=T??N.useRef(null),F=Be(E),[W,Z]=N.useState(NaN),re=isNaN(a)?W:a,q=F.width/F.height,U=Pe.make(q>1?Math.max(F.width,F.height*re):Math.max(F.width,Math.max(F.height,F.width/re)*re),q>1?Math.max(F.height,Math.max(F.width,F.height*re)/re):Math.max(F.height,F.width/re)),D=Oe(r,{content:Gn,viewport:Kn});return b.jsxs("div",{...G,ref:E,className:e,style:le(s,Wn.root),children:[b.jsx(Un,{autoLoop:l,autoPlay:u,hasControls:h,isMuted:g,playsInline:m,posterSrc:S,src:k,style:le(Wn.viewport,{width:`${U.width}px`,height:`${U.height}px`,maxWidth:"unset"}),onCanPlay:P,onEnd:O,onFullscreenChange:j,onLoadMetadata:L,onLoadMetadataComplete:x,onLoadMetadataError:R,onPause:$,onPlay:Q,onSizeChange:z=>I(z)}),D.viewport&&b.jsx(me,{element:D.viewport,style:le(Wn.viewport,{height:`${U.height}px`,pointerEvents:"none",width:`${U.width}px`})}),D.content]})}),Gn=({children:e,...r})=>b.jsx("div",{...r,children:e}),Kn=({children:e,...r})=>b.jsx("div",{...r,children:e}),Wn={root:{overflow:"hidden"},viewport:{fontSize:"0",left:"50%",position:"absolute",top:"50%",transform:"translate(-50%, -50%)"}};process.env.NODE_ENV!=="production"&&(qr.displayName="CoverVideo",Gn.displayName="CoverVideoContent",Kn.displayName="CoverVideoViewport");const eo=N.forwardRef(({children:e,style:r,angle:s=0,knobLength:a=30,knobThickness:l=10,radius:u=50,trackGap:h=0,trackThickness:g=2,...m},S)=>{const k=u*2,P=Math.max(0,Math.min(360,a)),O=Oe(e,{track:Wt,knob:Jt}),j=is({angle:s,diameter:k});return b.jsxs("div",{...m,ref:S,style:le(r,j.root),children:[b.jsx("div",{style:j.trackContainer,children:b.jsx("svg",{height:k,style:j.svgContainer,viewBox:`0 0 ${k} ${k}`,width:k,children:b.jsx(me,{cx:u,cy:u,element:O.track??b.jsx(Wt,{}),fill:"none",r:u-g/2,strokeDasharray:h,strokeWidth:g})})}),b.jsx("div",{style:le(j.knobContainer),children:b.jsx("svg",{style:j.svgContainer,viewBox:`0 0 ${k} ${k}`,xmlns:"http://www.w3.org/2000/svg",children:b.jsx(me,{d:os(u,u,u-l/2-(g-l)/2,-P/2,P/2),element:O.knob??b.jsx(Jt,{}),fill:"none",strokeWidth:l})})})]})}),Wt=({...e})=>b.jsx("circle",{...e}),Jt=({...e})=>b.jsx("path",{...e});function to(e,r,s,a){const l=(a-90)*Math.PI/180;return{x:e+s*Math.cos(l),y:r+s*Math.sin(l)}}function os(e,r,s,a,l){const u=to(e,r,s,l),h=to(e,r,s,a),g=l-a<=180?"0":"1";return["M",u.x,u.y,"A",s,s,0,g,0,h.x,h.y].join(" ")}function is({diameter:e=0,angle:r=0}){return{root:{height:`${e}px`,width:`${e}px`},knobContainer:{backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundSize:"100%",height:"100%",left:"0",position:"absolute",top:"0",transformOrigin:"center",width:"100%",transform:`rotate(${(r+360)%360}deg)`},trackContainer:{height:"100%",left:"0",position:"absolute",top:"0",transformOrigin:"center",width:"100%"},svgContainer:{overflow:"visible",position:"absolute",right:"0",top:"0"}}}process.env.NODE_ENV!=="production"&&(eo.displayName="Dial",Wt.displayName="DialTrack",Jt.displayName="DialKnob");const no=N.forwardRef(({children:e,className:r,style:s,collapsesOnSelect:a=!0,collectionPadding:l=0,isCollapsed:u,isInverted:h=!1,label:g,layout:m="list",isSelectionTogglable:S=!1,itemLength:k,itemPadding:P=0,items:O=[],maxVisibleItems:j=-1,numSegments:L=1,orientation:x="vertical",selection:R=[],selectionMode:$="single",onActivateAt:Q,onCollapse:B,onDeselectAt:G,onExpand:T,onSelectAt:I,onSelectionChange:E,onToggleCustomEvent:F,ItemComponent:W,ToggleComponent:Z,...re},q)=>{const U=N.useRef(null),D=Be(U),z=O.length,te=ls(O,j,L,m),ee=k??(x==="vertical"?D.height:D.width),ce=ee*te+P*(te-1),H=as(R,O),[C,Y]=N.useState(u??!0),oe=us({isCollapsed:C,collectionPadding:l,isInverted:h,maxVisibleItems:j,menuLength:ce,numItems:z,orientation:x}),ie=Oe(e,{collapseIcon:Jn,collection:Zt,expandIcon:Zn,item:Qt,toggle:$t}),fe=()=>{C&&(Y(!1),T?.())},ve=()=>{C||(Y(!0),B?.())},Ee=()=>{C?fe():ve()},Se=xe=>{I?.(xe),$==="single"&&a&&ve()};return N.useEffect(()=>{u!==void 0&&Y(u)},[u]),N.useEffect(()=>{const xe=J=>{if(C||!(J.target instanceof Node))return;let ze=!0,_e=J.target;for(;_e;){if(_e===U.current){ze=!1;break}if(!_e.parentNode)break;_e=_e.parentNode}ze&&ve()};return window.addEventListener("click",xe),()=>{window.removeEventListener("click",xe)}},[C]),b.jsx("div",{...re,ref:q,className:ae(r,{collapsed:C,expanded:!C}),style:le(s,oe.root),children:b.jsxs("div",{ref:U,style:le(oe.body),children:[Z?b.jsx(Z,{"aria-expanded":!C,"aria-haspopup":"listbox",className:ae({collapsed:C,expanded:!C}),style:le(oe.toggle),onClick:Ee,onCustomEvent:(xe,J)=>F?.(xe,J)}):b.jsxs(me,{"aria-expanded":!C,"aria-haspopup":"listbox",className:ae({collapsed:C,expanded:!C}),element:ie.toggle??b.jsx($t,{}),style:le(oe.toggle),onClick:Ee,children:[b.jsx("span",{dangerouslySetInnerHTML:{__html:g?.(H)??(H.length>0?H.map(xe=>O[xe]).join(", "):"")}}),ie.expandIcon&&b.jsx(me,{className:ae({collapsed:C,expanded:!C}),element:C?ie.collapseIcon??ie.expandIcon:ie.expandIcon,style:le(C?oe.collapseIcon:oe.expandIcon)})]}),b.jsx(me,{element:ie.collection??b.jsx(Zt,{}),isSelectionTogglable:S,ItemComponent:W,itemLength:ee,itemPadding:P,items:O,layout:m,numSegments:L,orientation:x,selection:H,selectionMode:$,style:le(oe.collection),onActivateAt:Q,onDeselectAt:G,onSelectAt:Se,onSelectionChange:E,children:!W&&(ie.item??b.jsx(Qt,{}))})]})})}),Zt=Dt,Qt=st,$t=({children:e,...r})=>b.jsx("button",{...r,children:e}),Jn=({children:e,...r})=>b.jsx("figure",{...r,"aria-hidden":!0,children:e}),Zn=({children:e,...r})=>b.jsx("figure",{...r,"aria-hidden":!0,children:e});function ss(e,r){return!!(isNaN(e)||e>=r.length||e<0)}function as(e,r){return cs(e).filter(s=>!ss(s,r))}function cs(e){return e.sort((r,s)=>r-s)}function ls(e,r,s,a){const l=e.length;switch(a){case"grid":{const u=s<1?l:Math.ceil(l/s);return r<0?u:Math.min(u,r)}default:return r<0?l:Math.min(l,r)}}function us({isCollapsed:e=!0,isInverted:r=!1,collectionPadding:s=0,maxVisibleItems:a=0,menuLength:l=NaN,numItems:u=0,orientation:h="vertical"}){return{root:{alignItems:"center",display:"flex",justifyContent:"flex-start",overflow:"visible",...h==="vertical"?{flexDirection:r?"column-reverse":"column"}:{flexDirection:r?"row-reverse":"row"}},body:{height:"100%",position:"relative",width:"100%"},toggle:{height:"100%",left:"0",margin:"0",position:"absolute",top:"0",width:"100%",zIndex:"1"},collection:{position:"absolute",...h==="vertical"?{width:"100%",height:e?"0px":`${l}px`,overflowY:a!==-1&&a<u?"scroll":"hidden",...r?{marginBottom:`${s}px`,bottom:"100%"}:{top:"100%",marginTop:`${s}px`}}:{width:e?"0px":`${l}px`,height:"100%",overflowX:a!==-1&&a<u?"scroll":"hidden",...r?{marginRight:`${s}px`,right:"100%"}:{left:"100%",marginLeft:`${s}px`}}},expandIcon:{pointerEvents:"none",zIndex:1},collapseIcon:{pointerEvents:"none",zIndex:1}}}process.env.NODE_ENV!=="production"&&(no.displayName="Dropdown",Zt.displayName="DropdownCollection",Jn.displayName="DropdownCollapseIcon",Zn.displayName="DropdownExpandIcon",Qt.displayName="DropdownItem",$t.displayName="DropdownToggle");const ro=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",fs=ro+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",ds="["+ro+"]["+fs+"]*",hs=new RegExp("^"+ds+"$");function oo(e,r){const s=[];let a=r.exec(e);for(;a;){const l=[];l.startIndex=r.lastIndex-a[0].length;const u=a.length;for(let h=0;h<u;h++)l.push(a[h]);s.push(l),a=r.exec(e)}return s}const Qn=function(e){const r=hs.exec(e);return!(r===null||typeof r>"u")};function ps(e){return typeof e<"u"}const gs={allowBooleanAttributes:!1,unpairedTags:[]};function ms(e,r){r=Object.assign({},gs,r);const s=[];let a=!1,l=!1;e[0]==="\uFEFF"&&(e=e.substr(1));for(let u=0;u<e.length;u++)if(e[u]==="<"&&e[u+1]==="?"){if(u+=2,u=so(e,u),u.err)return u}else if(e[u]==="<"){let h=u;if(u++,e[u]==="!"){u=ao(e,u);continue}else{let g=!1;e[u]==="/"&&(g=!0,u++);let m="";for(;u<e.length&&e[u]!==">"&&e[u]!==" "&&e[u]!==" "&&e[u]!==`
|
|
23
23
|
`&&e[u]!=="\r";u++)m+=e[u];if(m=m.trim(),m[m.length-1]==="/"&&(m=m.substring(0,m.length-1),u--),!Ss(m)){let P;return m.trim().length===0?P="Invalid space after '<'.":P="Tag '"+m+"' is an invalid name.",Ce("InvalidTag",P,Ie(e,u))}const S=bs(e,u);if(S===!1)return Ce("InvalidAttr","Attributes for '"+m+"' have open quote.",Ie(e,u));let k=S.value;if(u=S.index,k[k.length-1]==="/"){const P=u-k.length;k=k.substring(0,k.length-1);const O=co(k,r);if(O===!0)a=!0;else return Ce(O.err.code,O.err.msg,Ie(e,P+O.err.line))}else if(g)if(S.tagClosed){if(k.trim().length>0)return Ce("InvalidTag","Closing tag '"+m+"' can't have attributes or invalid starting.",Ie(e,h));if(s.length===0)return Ce("InvalidTag","Closing tag '"+m+"' has not been opened.",Ie(e,h));{const P=s.pop();if(m!==P.tagName){let O=Ie(e,P.tagStartPos);return Ce("InvalidTag","Expected closing tag '"+P.tagName+"' (opened in line "+O.line+", col "+O.col+") instead of closing tag '"+m+"'.",Ie(e,h))}s.length==0&&(l=!0)}}else return Ce("InvalidTag","Closing tag '"+m+"' doesn't have proper closing.",Ie(e,u));else{const P=co(k,r);if(P!==!0)return Ce(P.err.code,P.err.msg,Ie(e,u-k.length+P.err.line));if(l===!0)return Ce("InvalidXml","Multiple possible root nodes found.",Ie(e,u));r.unpairedTags.indexOf(m)!==-1||s.push({tagName:m,tagStartPos:h}),a=!0}for(u++;u<e.length;u++)if(e[u]==="<")if(e[u+1]==="!"){u++,u=ao(e,u);continue}else if(e[u+1]==="?"){if(u=so(e,++u),u.err)return u}else break;else if(e[u]==="&"){const P=Es(e,u);if(P==-1)return Ce("InvalidChar","char '&' is not expected.",Ie(e,u));u=P}else if(l===!0&&!io(e[u]))return Ce("InvalidXml","Extra text at the end",Ie(e,u));e[u]==="<"&&u--}}else{if(io(e[u]))continue;return Ce("InvalidChar","char '"+e[u]+"' is not expected.",Ie(e,u))}if(a){if(s.length==1)return Ce("InvalidTag","Unclosed tag '"+s[0].tagName+"'.",Ie(e,s[0].tagStartPos));if(s.length>0)return Ce("InvalidXml","Invalid '"+JSON.stringify(s.map(u=>u.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return Ce("InvalidXml","Start tag expected.",1);return!0}function io(e){return e===" "||e===" "||e===`
|
|
24
24
|
`||e==="\r"}function so(e,r){const s=r;for(;r<e.length;r++)if(e[r]=="?"||e[r]==" "){const a=e.substr(s,r-s);if(r>5&&a==="xml")return Ce("InvalidXml","XML declaration allowed only at the start of the document.",Ie(e,r));if(e[r]=="?"&&e[r+1]==">"){r++;break}else continue}return r}function ao(e,r){if(e.length>r+5&&e[r+1]==="-"&&e[r+2]==="-"){for(r+=3;r<e.length;r++)if(e[r]==="-"&&e[r+1]==="-"&&e[r+2]===">"){r+=2;break}}else if(e.length>r+8&&e[r+1]==="D"&&e[r+2]==="O"&&e[r+3]==="C"&&e[r+4]==="T"&&e[r+5]==="Y"&&e[r+6]==="P"&&e[r+7]==="E"){let s=1;for(r+=8;r<e.length;r++)if(e[r]==="<")s++;else if(e[r]===">"&&(s--,s===0))break}else if(e.length>r+9&&e[r+1]==="["&&e[r+2]==="C"&&e[r+3]==="D"&&e[r+4]==="A"&&e[r+5]==="T"&&e[r+6]==="A"&&e[r+7]==="["){for(r+=8;r<e.length;r++)if(e[r]==="]"&&e[r+1]==="]"&&e[r+2]===">"){r+=2;break}}return r}const vs='"',ys="'";function bs(e,r){let s="",a="",l=!1;for(;r<e.length;r++){if(e[r]===vs||e[r]===ys)a===""?a=e[r]:a!==e[r]||(a="");else if(e[r]===">"&&a===""){l=!0;break}s+=e[r]}return a!==""?!1:{value:s,index:r,tagClosed:l}}const xs=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function co(e,r){const s=oo(e,xs),a={};for(let l=0;l<s.length;l++){if(s[l][1].length===0)return Ce("InvalidAttr","Attribute '"+s[l][2]+"' has no space in starting.",vt(s[l]));if(s[l][3]!==void 0&&s[l][4]===void 0)return Ce("InvalidAttr","Attribute '"+s[l][2]+"' is without value.",vt(s[l]));if(s[l][3]===void 0&&!r.allowBooleanAttributes)return Ce("InvalidAttr","boolean attribute '"+s[l][2]+"' is not allowed.",vt(s[l]));const u=s[l][2];if(!Ns(u))return Ce("InvalidAttr","Attribute '"+u+"' is an invalid name.",vt(s[l]));if(!a.hasOwnProperty(u))a[u]=1;else return Ce("InvalidAttr","Attribute '"+u+"' is repeated.",vt(s[l]))}return!0}function ws(e,r){let s=/\d/;for(e[r]==="x"&&(r++,s=/[\da-fA-F]/);r<e.length;r++){if(e[r]===";")return r;if(!e[r].match(s))break}return-1}function Es(e,r){if(r++,e[r]===";")return-1;if(e[r]==="#")return r++,ws(e,r);let s=0;for(;r<e.length;r++,s++)if(!(e[r].match(/\w/)&&s<20)){if(e[r]===";")break;return-1}return r}function Ce(e,r,s){return{err:{code:e,msg:r,line:s.line||s,col:s.col}}}function Ns(e){return Qn(e)}function Ss(e){return Qn(e)}function Ie(e,r){const s=e.substring(0,r).split(/\r?\n/);return{line:s.length,col:s[s.length-1].length+1}}function vt(e){return e.startIndex+e[1].length}const Ts={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(e,r){return r},attributeValueProcessor:function(e,r){return r},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,r,s){return e},captureMetaData:!1},Cs=function(e){return Object.assign({},Ts,e)};let qt;typeof Symbol!="function"?qt="@@xmlMetadata":qt=Symbol("XML Node Metadata");class et{constructor(r){this.tagname=r,this.child=[],this[":@"]={}}add(r,s){r==="__proto__"&&(r="#__proto__"),this.child.push({[r]:s})}addChild(r,s){r.tagname==="__proto__"&&(r.tagname="#__proto__"),r[":@"]&&Object.keys(r[":@"]).length>0?this.child.push({[r.tagname]:r.child,":@":r[":@"]}):this.child.push({[r.tagname]:r.child}),s!==void 0&&(this.child[this.child.length-1][qt]={startIndex:s})}static getMetaDataSymbol(){return qt}}function ks(e,r){const s={};if(e[r+3]==="O"&&e[r+4]==="C"&&e[r+5]==="T"&&e[r+6]==="Y"&&e[r+7]==="P"&&e[r+8]==="E"){r=r+9;let a=1,l=!1,u=!1;for(;r<e.length;r++)if(e[r]==="<"&&!u){if(l&&tt(e,"!ENTITY",r)){r+=7;let h,g;[h,g,r]=_s(e,r+1),g.indexOf("&")===-1&&(s[h]={regx:RegExp(`&${h};`,"g"),val:g})}else if(l&&tt(e,"!ELEMENT",r)){r+=8;const{index:h}=Os(e,r+1);r=h}else if(l&&tt(e,"!ATTLIST",r))r+=8;else if(l&&tt(e,"!NOTATION",r)){r+=9;const{index:h}=Ps(e,r+1);r=h}else if(tt(e,"!--",r))u=!0;else throw new Error("Invalid DOCTYPE");a++}else if(e[r]===">"){if(u?e[r-1]==="-"&&e[r-2]==="-"&&(u=!1,a--):a--,a===0)break}else e[r]==="["&&(l=!0);if(a!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:s,i:r}}const Ke=(e,r)=>{for(;r<e.length&&/\s/.test(e[r]);)r++;return r};function _s(e,r){r=Ke(e,r);let s="";for(;r<e.length&&!/\s/.test(e[r])&&e[r]!=='"'&&e[r]!=="'";)s+=e[r],r++;if($n(s),r=Ke(e,r),e.substring(r,r+6).toUpperCase()==="SYSTEM")throw new Error("External entities are not supported");if(e[r]==="%")throw new Error("Parameter entities are not supported");let a="";return[r,a]=en(e,r,"entity"),r--,[s,a,r]}function Ps(e,r){r=Ke(e,r);let s="";for(;r<e.length&&!/\s/.test(e[r]);)s+=e[r],r++;$n(s),r=Ke(e,r);const a=e.substring(r,r+6).toUpperCase();if(a!=="SYSTEM"&&a!=="PUBLIC")throw new Error(`Expected SYSTEM or PUBLIC, found "${a}"`);r+=a.length,r=Ke(e,r);let l=null,u=null;if(a==="PUBLIC")[r,l]=en(e,r,"publicIdentifier"),r=Ke(e,r),(e[r]==='"'||e[r]==="'")&&([r,u]=en(e,r,"systemIdentifier"));else if(a==="SYSTEM"&&([r,u]=en(e,r,"systemIdentifier"),!u))throw new Error("Missing mandatory system identifier for SYSTEM notation");return{notationName:s,publicIdentifier:l,systemIdentifier:u,index:--r}}function en(e,r,s){let a="";const l=e[r];if(l!=='"'&&l!=="'")throw new Error(`Expected quoted string, found "${l}"`);for(r++;r<e.length&&e[r]!==l;)a+=e[r],r++;if(e[r]!==l)throw new Error(`Unterminated ${s} value`);return r++,[r,a]}function Os(e,r){r=Ke(e,r);let s="";for(;r<e.length&&!/\s/.test(e[r]);)s+=e[r],r++;if(!$n(s))throw new Error(`Invalid element name: "${s}"`);r=Ke(e,r);let a="";if(e[r]==="E"&&tt(e,"MPTY",r))r+=6;else if(e[r]==="A"&&tt(e,"NY",r))r+=4;else if(e[r]==="("){for(r++;r<e.length&&e[r]!==")";)a+=e[r],r++;if(e[r]!==")")throw new Error("Unterminated content model")}else throw new Error(`Invalid Element Expression, found "${e[r]}"`);return{elementName:s,contentModel:a.trim(),index:r}}function tt(e,r,s){for(let a=0;a<r.length;a++)if(r[a]!==e[s+a+1])return!1;return!0}function $n(e){if(Qn(e))return e;throw new Error(`Invalid entity name ${e}`)}const Is=/^[-+]?0x[a-fA-F0-9]+$/,Rs=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,js={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};function As(e,r={}){if(r=Object.assign({},js,r),!e||typeof e!="string")return e;let s=e.trim();if(r.skipLike!==void 0&&r.skipLike.test(s))return e;if(e==="0")return 0;if(r.hex&&Is.test(s))return Fs(s,16);if(s.search(/.+[eE].+/)!==-1)return zs(e,s,r);{const a=Rs.exec(s);if(a){const l=a[1]||"",u=a[2];let h=Ls(a[3]);const g=l?e[u.length+1]===".":e[u.length]===".";if(!r.leadingZeros&&(u.length>1||u.length===1&&!g))return e;{const m=Number(s),S=String(m);if(m===0||m===-0)return m;if(S.search(/[eE]/)!==-1)return r.eNotation?m:e;if(s.indexOf(".")!==-1)return S==="0"||S===h||S===`${l}${h}`?m:e;let k=u?h:s;return u?k===S||l+k===S?m:e:k===S||k===l+S?m:e}}else return e}}const Ms=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function zs(e,r,s){if(!s.eNotation)return e;const a=r.match(Ms);if(a){let l=a[1]||"";const u=a[3].indexOf("e")===-1?"E":"e",h=a[2],g=l?e[h.length+1]===u:e[h.length]===u;return h.length>1&&g?e:h.length===1&&(a[3].startsWith(`.${u}`)||a[3][0]===u)?Number(r):s.leadingZeros&&!g?(r=(a[1]||"")+a[3],Number(r)):e}else return e}function Ls(e){return e&&e.indexOf(".")!==-1&&(e=e.replace(/0+$/,""),e==="."?e="0":e[0]==="."?e="0"+e:e[e.length-1]==="."&&(e=e.substring(0,e.length-1))),e}function Fs(e,r){if(parseInt)return parseInt(e,r);if(Number.parseInt)return Number.parseInt(e,r);if(window&&window.parseInt)return window.parseInt(e,r);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}function lo(e){return typeof e=="function"?e:Array.isArray(e)?r=>{for(const s of e)if(typeof s=="string"&&r===s||s instanceof RegExp&&s.test(r))return!0}:()=>!1}class Ds{constructor(r){this.options=r,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(s,a)=>String.fromCodePoint(Number.parseInt(a,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(s,a)=>String.fromCodePoint(Number.parseInt(a,16))}},this.addExternalEntities=Vs,this.parseXml=Us,this.parseTextData=Bs,this.resolveNameSpace=Hs,this.buildAttributesMap=Xs,this.isItStopNode=Js,this.replaceEntitiesValue=Ks,this.readStopNodeData=Qs,this.saveTextToParentTag=Ws,this.addChild=Gs,this.ignoreAttributesFn=lo(this.options.ignoreAttributes)}}function Vs(e){const r=Object.keys(e);for(let s=0;s<r.length;s++){const a=r[s];this.lastEntities[a]={regex:new RegExp("&"+a+";","g"),val:e[a]}}}function Bs(e,r,s,a,l,u,h){if(e!==void 0&&(this.options.trimValues&&!a&&(e=e.trim()),e.length>0)){h||(e=this.replaceEntitiesValue(e));const g=this.options.tagValueProcessor(r,e,s,l,u);return g==null?e:typeof g!=typeof e||g!==e?g:this.options.trimValues?er(e,this.options.parseTagValue,this.options.numberParseOptions):e.trim()===e?er(e,this.options.parseTagValue,this.options.numberParseOptions):e}}function Hs(e){if(this.options.removeNSPrefix){const r=e.split(":"),s=e.charAt(0)==="/"?"/":"";if(r[0]==="xmlns")return"";r.length===2&&(e=s+r[1])}return e}const Ys=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function Xs(e,r,s){if(this.options.ignoreAttributes!==!0&&typeof e=="string"){const a=oo(e,Ys),l=a.length,u={};for(let h=0;h<l;h++){const g=this.resolveNameSpace(a[h][1]);if(this.ignoreAttributesFn(g,r))continue;let m=a[h][4],S=this.options.attributeNamePrefix+g;if(g.length)if(this.options.transformAttributeName&&(S=this.options.transformAttributeName(S)),S==="__proto__"&&(S="#__proto__"),m!==void 0){this.options.trimValues&&(m=m.trim()),m=this.replaceEntitiesValue(m);const k=this.options.attributeValueProcessor(g,m,r);k==null?u[S]=m:typeof k!=typeof m||k!==m?u[S]=k:u[S]=er(m,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(u[S]=!0)}if(!Object.keys(u).length)return;if(this.options.attributesGroupName){const h={};return h[this.options.attributesGroupName]=u,h}return u}}const Us=function(e){e=e.replace(/\r\n?/g,`
|
|
25
25
|
`);const r=new et("!xml");let s=r,a="",l="";for(let u=0;u<e.length;u++)if(e[u]==="<")if(e[u+1]==="/"){const g=nt(e,">",u,"Closing Tag is not closed.");let m=e.substring(u+2,g).trim();if(this.options.removeNSPrefix){const P=m.indexOf(":");P!==-1&&(m=m.substr(P+1))}this.options.transformTagName&&(m=this.options.transformTagName(m)),s&&(a=this.saveTextToParentTag(a,s,l));const S=l.substring(l.lastIndexOf(".")+1);if(m&&this.options.unpairedTags.indexOf(m)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${m}>`);let k=0;S&&this.options.unpairedTags.indexOf(S)!==-1?(k=l.lastIndexOf(".",l.lastIndexOf(".")-1),this.tagsNodeStack.pop()):k=l.lastIndexOf("."),l=l.substring(0,k),s=this.tagsNodeStack.pop(),a="",u=g}else if(e[u+1]==="?"){let g=qn(e,u,!1,"?>");if(!g)throw new Error("Pi Tag is not closed.");if(a=this.saveTextToParentTag(a,s,l),!(this.options.ignoreDeclaration&&g.tagName==="?xml"||this.options.ignorePiTags)){const m=new et(g.tagName);m.add(this.options.textNodeName,""),g.tagName!==g.tagExp&&g.attrExpPresent&&(m[":@"]=this.buildAttributesMap(g.tagExp,l,g.tagName)),this.addChild(s,m,l,u)}u=g.closeIndex+1}else if(e.substr(u+1,3)==="!--"){const g=nt(e,"-->",u+4,"Comment is not closed.");if(this.options.commentPropName){const m=e.substring(u+4,g-2);a=this.saveTextToParentTag(a,s,l),s.add(this.options.commentPropName,[{[this.options.textNodeName]:m}])}u=g}else if(e.substr(u+1,2)==="!D"){const g=ks(e,u);this.docTypeEntities=g.entities,u=g.i}else if(e.substr(u+1,2)==="!["){const g=nt(e,"]]>",u,"CDATA is not closed.")-2,m=e.substring(u+9,g);a=this.saveTextToParentTag(a,s,l);let S=this.parseTextData(m,s.tagname,l,!0,!1,!0,!0);S==null&&(S=""),this.options.cdataPropName?s.add(this.options.cdataPropName,[{[this.options.textNodeName]:m}]):s.add(this.options.textNodeName,S),u=g+2}else{let g=qn(e,u,this.options.removeNSPrefix),m=g.tagName;const S=g.rawTagName;let k=g.tagExp,P=g.attrExpPresent,O=g.closeIndex;this.options.transformTagName&&(m=this.options.transformTagName(m)),s&&a&&s.tagname!=="!xml"&&(a=this.saveTextToParentTag(a,s,l,!1));const j=s;j&&this.options.unpairedTags.indexOf(j.tagname)!==-1&&(s=this.tagsNodeStack.pop(),l=l.substring(0,l.lastIndexOf("."))),m!==r.tagname&&(l+=l?"."+m:m);const L=u;if(this.isItStopNode(this.options.stopNodes,l,m)){let x="";if(k.length>0&&k.lastIndexOf("/")===k.length-1)m[m.length-1]==="/"?(m=m.substr(0,m.length-1),l=l.substr(0,l.length-1),k=m):k=k.substr(0,k.length-1),u=g.closeIndex;else if(this.options.unpairedTags.indexOf(m)!==-1)u=g.closeIndex;else{const $=this.readStopNodeData(e,S,O+1);if(!$)throw new Error(`Unexpected end of ${S}`);u=$.i,x=$.tagContent}const R=new et(m);m!==k&&P&&(R[":@"]=this.buildAttributesMap(k,l,m)),x&&(x=this.parseTextData(x,m,l,!0,P,!0,!0)),l=l.substr(0,l.lastIndexOf(".")),R.add(this.options.textNodeName,x),this.addChild(s,R,l,L)}else{if(k.length>0&&k.lastIndexOf("/")===k.length-1){m[m.length-1]==="/"?(m=m.substr(0,m.length-1),l=l.substr(0,l.length-1),k=m):k=k.substr(0,k.length-1),this.options.transformTagName&&(m=this.options.transformTagName(m));const x=new et(m);m!==k&&P&&(x[":@"]=this.buildAttributesMap(k,l,m)),this.addChild(s,x,l,L),l=l.substr(0,l.lastIndexOf("."))}else{const x=new et(m);this.tagsNodeStack.push(s),m!==k&&P&&(x[":@"]=this.buildAttributesMap(k,l,m)),this.addChild(s,x,l,L),s=x}a="",u=O}}else a+=e[u];return r.child};function Gs(e,r,s,a){this.options.captureMetaData||(a=void 0);const l=this.options.updateTag(r.tagname,s,r[":@"]);l===!1||(typeof l=="string"&&(r.tagname=l),e.addChild(r,a))}const Ks=function(e){if(this.options.processEntities){for(let r in this.docTypeEntities){const s=this.docTypeEntities[r];e=e.replace(s.regx,s.val)}for(let r in this.lastEntities){const s=this.lastEntities[r];e=e.replace(s.regex,s.val)}if(this.options.htmlEntities)for(let r in this.htmlEntities){const s=this.htmlEntities[r];e=e.replace(s.regex,s.val)}e=e.replace(this.ampEntity.regex,this.ampEntity.val)}return e};function Ws(e,r,s,a){return e&&(a===void 0&&(a=r.child.length===0),e=this.parseTextData(e,r.tagname,s,!1,r[":@"]?Object.keys(r[":@"]).length!==0:!1,a),e!==void 0&&e!==""&&r.add(this.options.textNodeName,e),e=""),e}function Js(e,r,s){const a="*."+s;for(const l in e){const u=e[l];if(a===u||r===u)return!0}return!1}function Zs(e,r,s=">"){let a,l="";for(let u=r;u<e.length;u++){let h=e[u];if(a)h===a&&(a="");else if(h==='"'||h==="'")a=h;else if(h===s[0])if(s[1]){if(e[u+1]===s[1])return{data:l,index:u}}else return{data:l,index:u};else h===" "&&(h=" ");l+=h}}function nt(e,r,s,a){const l=e.indexOf(r,s);if(l===-1)throw new Error(a);return l+r.length-1}function qn(e,r,s,a=">"){const l=Zs(e,r+1,a);if(!l)return;let u=l.data;const h=l.index,g=u.search(/\s/);let m=u,S=!0;g!==-1&&(m=u.substring(0,g),u=u.substring(g+1).trimStart());const k=m;if(s){const P=m.indexOf(":");P!==-1&&(m=m.substr(P+1),S=m!==l.data.substr(P+1))}return{tagName:m,tagExp:u,closeIndex:h,attrExpPresent:S,rawTagName:k}}function Qs(e,r,s){const a=s;let l=1;for(;s<e.length;s++)if(e[s]==="<")if(e[s+1]==="/"){const u=nt(e,">",s,`${r} is not closed`);if(e.substring(s+2,u).trim()===r&&(l--,l===0))return{tagContent:e.substring(a,s),i:u};s=u}else if(e[s+1]==="?")s=nt(e,"?>",s+1,"StopNode is not closed.");else if(e.substr(s+1,3)==="!--")s=nt(e,"-->",s+3,"StopNode is not closed.");else if(e.substr(s+1,2)==="![")s=nt(e,"]]>",s,"StopNode is not closed.")-2;else{const u=qn(e,s,">");u&&((u&&u.tagName)===r&&u.tagExp[u.tagExp.length-1]!=="/"&&l++,s=u.closeIndex)}}function er(e,r,s){if(r&&typeof e=="string"){const a=e.trim();return a==="true"?!0:a==="false"?!1:As(e,s)}else return ps(e)?e:""}const tr=et.getMetaDataSymbol();function $s(e,r){return uo(e,r)}function uo(e,r,s){let a;const l={};for(let u=0;u<e.length;u++){const h=e[u],g=qs(h);let m="";if(s===void 0?m=g:m=s+"."+g,g===r.textNodeName)a===void 0?a=h[g]:a+=""+h[g];else{if(g===void 0)continue;if(h[g]){let S=uo(h[g],r,m);const k=ta(S,r);h[tr]!==void 0&&(S[tr]=h[tr]),h[":@"]?ea(S,h[":@"],m,r):Object.keys(S).length===1&&S[r.textNodeName]!==void 0&&!r.alwaysCreateTextNode?S=S[r.textNodeName]:Object.keys(S).length===0&&(r.alwaysCreateTextNode?S[r.textNodeName]="":S=""),l[g]!==void 0&&l.hasOwnProperty(g)?(Array.isArray(l[g])||(l[g]=[l[g]]),l[g].push(S)):r.isArray(g,m,k)?l[g]=[S]:l[g]=S}}}return typeof a=="string"?a.length>0&&(l[r.textNodeName]=a):a!==void 0&&(l[r.textNodeName]=a),l}function qs(e){const r=Object.keys(e);for(let s=0;s<r.length;s++){const a=r[s];if(a!==":@")return a}}function ea(e,r,s,a){if(r){const l=Object.keys(r),u=l.length;for(let h=0;h<u;h++){const g=l[h];a.isArray(g,s+"."+g,!0,!0)?e[g]=[r[g]]:e[g]=r[g]}}}function ta(e,r){const{textNodeName:s}=r,a=Object.keys(e).length;return!!(a===0||a===1&&(e[s]||typeof e[s]=="boolean"||e[s]===0))}class na{constructor(r){this.externalEntities={},this.options=Cs(r)}parse(r,s){if(typeof r!="string")if(r.toString)r=r.toString();else throw new Error("XML data is accepted in String or Bytes[] form.");if(s){s===!0&&(s={});const u=ms(r,s);if(u!==!0)throw Error(`${u.err.msg}:${u.err.line}:${u.err.col}`)}const a=new Ds(this.options);a.addExternalEntities(this.externalEntities);const l=a.parseXml(r);return this.options.preserveOrder||l===void 0?l:$s(l,this.options)}addEntity(r,s){if(s.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(r.indexOf("&")!==-1||r.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '
'");if(s==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[r]=s}static getMetaDataSymbol(){return et.getMetaDataSymbol()}}const ra=`
|
|
26
26
|
`;function oa(e,r){let s="";return r.format&&r.indentBy.length>0&&(s=ra),fo(e,r,"",s)}function fo(e,r,s,a){let l="",u=!1;for(let h=0;h<e.length;h++){const g=e[h],m=ia(g);if(m===void 0)continue;let S="";if(s.length===0?S=m:S=`${s}.${m}`,m===r.textNodeName){let L=g[m];sa(S,r)||(L=r.tagValueProcessor(m,L),L=po(L,r)),u&&(l+=a),l+=L,u=!1;continue}else if(m===r.cdataPropName){u&&(l+=a),l+=`<![CDATA[${g[m][0][r.textNodeName]}]]>`,u=!1;continue}else if(m===r.commentPropName){l+=a+`<!--${g[m][0][r.textNodeName]}-->`,u=!0;continue}else if(m[0]==="?"){const L=ho(g[":@"],r),x=m==="?xml"?"":a;let R=g[m][0][r.textNodeName];R=R.length!==0?" "+R:"",l+=x+`<${m}${R}${L}?>`,u=!0;continue}let k=a;k!==""&&(k+=r.indentBy);const P=ho(g[":@"],r),O=a+`<${m}${P}`,j=fo(g[m],r,S,k);r.unpairedTags.indexOf(m)!==-1?r.suppressUnpairedNode?l+=O+">":l+=O+"/>":(!j||j.length===0)&&r.suppressEmptyNode?l+=O+"/>":j&&j.endsWith(">")?l+=O+`>${j}${a}</${m}>`:(l+=O+">",j&&a!==""&&(j.includes("/>")||j.includes("</"))?l+=a+r.indentBy+j+a:l+=j,l+=`</${m}>`),u=!0}return l}function ia(e){const r=Object.keys(e);for(let s=0;s<r.length;s++){const a=r[s];if(e.hasOwnProperty(a)&&a!==":@")return a}}function ho(e,r){let s="";if(e&&!r.ignoreAttributes)for(let a in e){if(!e.hasOwnProperty(a))continue;let l=r.attributeValueProcessor(a,e[a]);l=po(l,r),l===!0&&r.suppressBooleanAttributes?s+=` ${a.substr(r.attributeNamePrefix.length)}`:s+=` ${a.substr(r.attributeNamePrefix.length)}="${l}"`}return s}function sa(e,r){e=e.substr(0,e.length-r.textNodeName.length-1);let s=e.substr(e.lastIndexOf(".")+1);for(let a in r.stopNodes)if(r.stopNodes[a]===e||r.stopNodes[a]==="*."+s)return!0;return!1}function po(e,r){if(e&&e.length>0&&r.processEntities)for(let s=0;s<r.entities.length;s++){const a=r.entities[s];e=e.replace(a.regex,a.val)}return e}const aa={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(e,r){return r},attributeValueProcessor:function(e,r){return r},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&"},{regex:new RegExp(">","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function We(e){this.options=Object.assign({},aa,e),this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=lo(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=ua),this.processTextOrObjNode=ca,this.options.format?(this.indentate=la,this.tagEndChar=`>
|
|
27
27
|
`,this.newLine=`
|
|
28
|
-
`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}We.prototype.build=function(e){return this.options.preserveOrder?oa(e,this.options):(Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e={[this.options.arrayNodeName]:e}),this.j2x(e,0,[]).val)},We.prototype.j2x=function(e,r,s){let a="",l="";const u=s.join(".");for(let h in e)if(Object.prototype.hasOwnProperty.call(e,h))if(typeof e[h]>"u")this.isAttribute(h)&&(l+="");else if(e[h]===null)this.isAttribute(h)||h===this.options.cdataPropName?l+="":h[0]==="?"?l+=this.indentate(r)+"<"+h+"?"+this.tagEndChar:l+=this.indentate(r)+"<"+h+"/"+this.tagEndChar;else if(e[h]instanceof Date)l+=this.buildTextValNode(e[h],h,"",r);else if(typeof e[h]!="object"){const g=this.isAttribute(h);if(g&&!this.ignoreAttributesFn(g,u))a+=this.buildAttrPairStr(g,""+e[h]);else if(!g)if(h===this.options.textNodeName){let m=this.options.tagValueProcessor(h,""+e[h]);l+=this.replaceEntitiesValue(m)}else l+=this.buildTextValNode(e[h],h,"",r)}else if(Array.isArray(e[h])){const g=e[h].length;let m="",S="";for(let k=0;k<g;k++){const P=e[h][k];if(!(typeof P>"u"))if(P===null)h[0]==="?"?l+=this.indentate(r)+"<"+h+"?"+this.tagEndChar:l+=this.indentate(r)+"<"+h+"/"+this.tagEndChar;else if(typeof P=="object")if(this.options.oneListGroup){const O=this.j2x(P,r+1,s.concat(h));m+=O.val,this.options.attributesGroupName&&P.hasOwnProperty(this.options.attributesGroupName)&&(S+=O.attrStr)}else m+=this.processTextOrObjNode(P,h,r,s);else if(this.options.oneListGroup){let O=this.options.tagValueProcessor(h,P);O=this.replaceEntitiesValue(O),m+=O}else m+=this.buildTextValNode(P,h,"",r)}this.options.oneListGroup&&(m=this.buildObjectNode(m,h,S,r)),l+=m}else if(this.options.attributesGroupName&&h===this.options.attributesGroupName){const g=Object.keys(e[h]),m=g.length;for(let S=0;S<m;S++)a+=this.buildAttrPairStr(g[S],""+e[h][g[S]])}else l+=this.processTextOrObjNode(e[h],h,r,s);return{attrStr:a,val:l}},We.prototype.buildAttrPairStr=function(e,r){return r=this.options.attributeValueProcessor(e,""+r),r=this.replaceEntitiesValue(r),this.options.suppressBooleanAttributes&&r==="true"?" "+e:" "+e+'="'+r+'"'};function ca(e,r,s,a){const l=this.j2x(e,s+1,a.concat(r));return e[this.options.textNodeName]!==void 0&&Object.keys(e).length===1?this.buildTextValNode(e[this.options.textNodeName],r,l.attrStr,s):this.buildObjectNode(l.val,r,l.attrStr,s)}We.prototype.buildObjectNode=function(e,r,s,a){if(e==="")return r[0]==="?"?this.indentate(a)+"<"+r+s+"?"+this.tagEndChar:this.indentate(a)+"<"+r+s+this.closeTag(r)+this.tagEndChar;{let l="</"+r+this.tagEndChar,u="";return r[0]==="?"&&(u="?",l=""),(s||s==="")&&e.indexOf("<")===-1?this.indentate(a)+"<"+r+s+u+">"+e+l:this.options.commentPropName!==!1&&r===this.options.commentPropName&&u.length===0?this.indentate(a)+`<!--${e}-->`+this.newLine:this.indentate(a)+"<"+r+s+u+this.tagEndChar+e+this.indentate(a)+l}},We.prototype.closeTag=function(e){let r="";return this.options.unpairedTags.indexOf(e)!==-1?this.options.suppressUnpairedNode||(r="/"):this.options.suppressEmptyNode?r="/":r=`></${e}`,r},We.prototype.buildTextValNode=function(e,r,s,a){if(this.options.cdataPropName!==!1&&r===this.options.cdataPropName)return this.indentate(a)+`<![CDATA[${e}]]>`+this.newLine;if(this.options.commentPropName!==!1&&r===this.options.commentPropName)return this.indentate(a)+`<!--${e}-->`+this.newLine;if(r[0]==="?")return this.indentate(a)+"<"+r+s+"?"+this.tagEndChar;{let l=this.options.tagValueProcessor(r,e);return l=this.replaceEntitiesValue(l),l===""?this.indentate(a)+"<"+r+s+this.closeTag(r)+this.tagEndChar:this.indentate(a)+"<"+r+s+">"+l+"</"+r+this.tagEndChar}},We.prototype.replaceEntitiesValue=function(e){if(e&&e.length>0&&this.options.processEntities)for(let r=0;r<this.options.entities.length;r++){const s=this.options.entities[r];e=e.replace(s.regex,s.val)}return e};function la(e){return this.options.indentBy.repeat(e)}function ua(e){return e.startsWith(this.options.attributeNamePrefix)&&e!==this.options.textNodeName?e.substr(this.attrPrefixLen):!1}const go=N.forwardRef(({fillMode:e="preserve",svg:r,shouldStripClasses:s=!0,shouldStripIds:a=!0,shouldStripPositions:l=!0,shouldStripStyles:u=!0,...h},g)=>{const m="@_",S=["id"].map(L=>`${m}${L}`),k=["class"].map(L=>`${m}${L}`),P=["fill","stroke","style"].map(L=>`${m}${L}`),O=["x","y"].map(L=>`${m}${L}`),j=()=>{const L=new na({attributeNamePrefix:m,ignoreAttributes:!1,ignoreDeclaration:!0,ignorePiTags:!0,removeNSPrefix:!0,trimValues:!0,updateTag:($,Q,B)=>{if(u&&$.toLowerCase()==="style")return!1;const G=Object.keys(B);for(const T of G)$.toLowerCase()==="svg"&&(l&&O.includes(T.toLowerCase())&&delete B[T],e!=="preserve"&&(T.toLowerCase()===`${m}width`&&delete B[T],T.toLowerCase()===`${m}height`&&delete B[T])),a&&S.includes(T.toLowerCase())&&delete B[T],s&&k.includes(T.toLowerCase())&&delete B[T],u&&P.includes(T.toLowerCase())&&delete B[T];if($.toLowerCase()==="svg")switch(e){case"fill":B[`${m}width`]="100%",B[`${m}height`]="100%";break;case"width":B[`${m}width`]="100%",B[`${m}height`]="auto";break;case"height":B[`${m}width`]="auto",B[`${m}height`]="100%";break}return $}}),x=new We({attributeNamePrefix:m,format:!0,ignoreAttributes:!1}),R=L.parse(r);return x.build(R)};return b.jsx("figure",{...h,ref:g,dangerouslySetInnerHTML:{__html:j()},role:"img"})});process.env.NODE_ENV!=="production"&&(go.displayName="FlatSVG");const mo="base-",vo=N.forwardRef(({alignSections:e=!1,children:r,className:s,horizontalSpacing:a=0,isReversed:l=!1,orientation:u="vertical",sections:h=3,verticalSpacing:g=0,...m},S)=>{const k=N.useRef(null),[P,O]=N.useState(NaN),[j,L]=N.useState(NaN),[x,R]=N.useState(NaN),[$,Q]=N.useState(NaN),B=()=>ge.from(k.current)?.width??0,G=()=>ge.from(k.current)?.height??0,T=()=>{const W=k.current;if(!W)return;const Z=W.children,re=h;if(re<=0){console.error("[etudes::MasonryGrid] You must specify a minimum of 1 section(s) (a.k.a. row(s) for horizontal orientation, column(s) for vertical orientation) for a MasonryGrid instance");return}if(u==="vertical"){const q=[...new Array(re)].map(()=>0);for(const z of Array.from(Z)){if(!(z instanceof HTMLElement))continue;const te=bo(z,h),[ee,ce]=yo(q,te);z.role="gridcell",z.style.position="absolute",z.style.width=`calc(${100/re*te}% - ${a*(re-1)/re*te}px + ${a*(te-1)}px)`,z.style.height="",z.style.left=`calc(${100/re*ee}% - ${a*(re-1)/re*ee}px + ${a*ee}px)`,z.style.top=`${ce+(ce===0?0:g)}px`;for(let H=0;H<te;H++)q[ee+H]=ce+(ce===0?0:g)+(ge.from(z)?.height??0);if(e&&ee+te===re){const H=yt(q);for(let C=0;C<re;C++)q[C]=H}}const U=B(),D=yt(q,re);if(O(U),L(D),isNaN(D)||(W.style.height=`${D}px`),l)for(const z of Array.from(Z))z instanceof HTMLElement&&(z.style.left=`calc(${U}px - ${z.style.left} - ${z.getBoundingClientRect().width}px)`)}else{const q=[...new Array(re)].map(()=>0);for(const z of Array.from(Z)){if(!(z instanceof HTMLElement))continue;const te=bo(z,h),[ee,ce]=yo(q,te);z.style.position="absolute",z.style.width="",z.style.height=`calc(${100/re*te}% - ${g*(re-1)/re*te}px + ${g*(te-1)}px)`,z.style.top=`calc(${100/re*ee}% - ${g*(re-1)/re*ee}px + ${g*ee}px)`,z.style.left=`${ce+(ce===0?0:a)}px`;for(let H=0;H<te;H++)q[ee+H]=ce+(ce===0?0:a)+(ge.from(z)?.width??0);if(e&&ee+te===re){const H=yt(q);for(let C=0;C<re;C++)q[C]=H}}const U=G(),D=yt(q,re);if(L(U),O(D),isNaN(D)||(W.style.width=`${D}px`),l)for(const z of Array.from(Z))z instanceof HTMLElement&&(z.style.top=`calc(${U}px - ${z.style.top} - ${z.getBoundingClientRect().height}px)`)}},I=N.useCallback(W=>{const Z=ge.size(ge.from(W)??ge.zero),re=B(),q=G();(P!==re||j!==q||Z.width!==x||Z.height!==$)&&(T(),R(Z.width),Q(Z.height))},[e,a,l,h,g,u]);Lt(k,{onResize:I}),N.useEffect(()=>{const W=ha(k.current?.innerHTML);if(W.length===0)return T();const Z=W.length;for(let re=0;re<Z;re++){const q=W[re],U=new Image;U.src=q,U.onload=()=>T()}},[r]);const E=fa({orientation:u}),F=da({orientation:u,minHeight:j,minWidth:P});return b.jsx("div",{...m,ref:S,className:ae(s,E.root),role:"grid",children:b.jsx("div",{ref:k,style:F.body,children:r})})});function fa({orientation:e="horizontal"}){return{root:ae(e)}}function da({orientation:e="horizontal",minHeight:r=NaN,minWidth:s=NaN}){return{body:{height:e==="horizontal"?"100%":"auto",minHeight:e==="vertical"&&!isNaN(r)?`${r}px`:"",minWidth:e==="horizontal"&&!isNaN(s)?`${s}px`:"",padding:"0",width:e==="horizontal"?"auto":"100%"}}}function yo(e,r){const s=e.length;let a=NaN,l=1/0;for(let u=0;u<s;u++){const h=e[u],g=h<l,m=u+r<=s;let S=!0;for(let k=1;k<r;k++)e[u+k]>h&&(S=!1);g&&m&&S&&(a=u,l=h)}return isNaN(a)?[0,yt(e,r)]:[a,l]}function yt(e,r){let s=e;return r!=null&&!isNaN(r)&&(s=s.slice(0,Math.max(1,Math.min(r,e.length)))),s.reduce((a,l,u)=>l>a?l:a,0)}function bo(e,r){const s=e.classList;for(const a of Array.from(s))if(a.startsWith(mo)){const l=parseFloat(a.replace(mo,""));if(!isNaN(l))return Math.min(Math.max(l,1),r)}return 1}function ha(e){if(!e)return[];const r=/<img.*?src=(["'])(.*?)\1/g,s=/<img.*?src=(["'])(.*?)\1/,a=r.exec(e)??[],l=[];for(const u of a){const h=s.exec(u)?.[2];h&&l.push(h)}return l}process.env.NODE_ENV!=="production"&&(vo.displayName="MasonryGrid");const xo=N.forwardRef(({index:e=0,isDisabled:r=!1,options:s,onChange:a,...l},u)=>{const h=s.length-1,g=s[e],m=typeof g=="string"?g:g?.label,S=()=>{if(r)return;const k=e<h?e+1:0,P=s[k],O=typeof P=="string"?P:P?.value;a?.(O,k)};return b.jsx("button",{...l,ref:u,"aria-disabled":r,"aria-label":m,disabled:r,onClick:S,children:m})});process.env.NODE_ENV!=="production"&&(xo.displayName="OptionButton");var tn={exports:{}},pa=tn.exports,wo;function ga(){return wo||(wo=1,function(e,r){(function(s,a){e.exports=a()})(pa,function(){function s(n,t){var o=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);t&&(i=i.filter(function(c){return Object.getOwnPropertyDescriptor(n,c).enumerable})),o.push.apply(o,i)}return o}function a(n){for(var t=1;t<arguments.length;t++){var o=arguments[t]!=null?arguments[t]:{};t%2?s(Object(o),!0).forEach(function(i){m(n,i,o[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):s(Object(o)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(o,i))})}return n}function l(n){return l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l(n)}function u(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function h(n,t){for(var o=0;o<t.length;o++){var i=t[o];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,x(i.key),i)}}function g(n,t,o){return t&&h(n.prototype,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function m(n,t,o){return(t=x(t))in n?Object.defineProperty(n,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[t]=o,n}function S(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),t&&P(n,t)}function k(n){return k=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},k(n)}function P(n,t){return P=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,i){return o.__proto__=i,o},P(n,t)}function O(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function j(n){var t=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var o,i=k(n);if(t){var c=k(this).constructor;o=Reflect.construct(i,arguments,c)}else o=i.apply(this,arguments);return function(f,d){if(d&&(typeof d=="object"||typeof d=="function"))return d;if(d!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return O(f)}(this,o)}}function L(){return L=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(n,t,o){var i=function(f,d){for(;!Object.prototype.hasOwnProperty.call(f,d)&&(f=k(f))!==null;);return f}(n,t);if(i){var c=Object.getOwnPropertyDescriptor(i,t);return c.get?c.get.call(arguments.length<3?n:o):c.value}},L.apply(this,arguments)}function x(n){var t=function(o,i){if(typeof o!="object"||o===null)return o;var c=o[Symbol.toPrimitive];if(c!==void 0){var f=c.call(o,i);if(typeof f!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(o)}(n,"string");return typeof t=="symbol"?t:t+""}var R=function(n){return!(!n||!n.Window)&&n instanceof n.Window},$=void 0,Q=void 0;function B(n){$=n;var t=n.document.createTextNode("");t.ownerDocument!==n.document&&typeof n.wrap=="function"&&n.wrap(t)===t&&(n=n.wrap(n)),Q=n}function G(n){return R(n)?n:(n.ownerDocument||n).defaultView||Q.window}typeof window<"u"&&window&&B(window);var T=function(n){return!!n&&l(n)==="object"},I=function(n){return typeof n=="function"},E={window:function(n){return n===Q||R(n)},docFrag:function(n){return T(n)&&n.nodeType===11},object:T,func:I,number:function(n){return typeof n=="number"},bool:function(n){return typeof n=="boolean"},string:function(n){return typeof n=="string"},element:function(n){if(!n||l(n)!=="object")return!1;var t=G(n)||Q;return/object|function/.test(typeof Element>"u"?"undefined":l(Element))?n instanceof Element||n instanceof t.Element:n.nodeType===1&&typeof n.nodeName=="string"},plainObject:function(n){return T(n)&&!!n.constructor&&/function Object\b/.test(n.constructor.toString())},array:function(n){return T(n)&&n.length!==void 0&&I(n.splice)}};function F(n){var t=n.interaction;if(t.prepared.name==="drag"){var o=t.prepared.axis;o==="x"?(t.coords.cur.page.y=t.coords.start.page.y,t.coords.cur.client.y=t.coords.start.client.y,t.coords.velocity.client.y=0,t.coords.velocity.page.y=0):o==="y"&&(t.coords.cur.page.x=t.coords.start.page.x,t.coords.cur.client.x=t.coords.start.client.x,t.coords.velocity.client.x=0,t.coords.velocity.page.x=0)}}function W(n){var t=n.iEvent,o=n.interaction;if(o.prepared.name==="drag"){var i=o.prepared.axis;if(i==="x"||i==="y"){var c=i==="x"?"y":"x";t.page[c]=o.coords.start.page[c],t.client[c]=o.coords.start.client[c],t.delta[c]=0}}}var Z={id:"actions/drag",install:function(n){var t=n.actions,o=n.Interactable,i=n.defaults;o.prototype.draggable=Z.draggable,t.map.drag=Z,t.methodDict.drag="draggable",i.actions.drag=Z.defaults},listeners:{"interactions:before-action-move":F,"interactions:action-resume":F,"interactions:action-move":W,"auto-start:check":function(n){var t=n.interaction,o=n.interactable,i=n.buttons,c=o.options.drag;if(c&&c.enabled&&(!t.pointerIsDown||!/mouse|pointer/.test(t.pointerType)||(i&o.options.drag.mouseButtons)!=0))return n.action={name:"drag",axis:c.lockAxis==="start"?c.startAxis:c.lockAxis},!1}},draggable:function(n){return E.object(n)?(this.options.drag.enabled=n.enabled!==!1,this.setPerAction("drag",n),this.setOnEvents("drag",n),/^(xy|x|y|start)$/.test(n.lockAxis)&&(this.options.drag.lockAxis=n.lockAxis),/^(xy|x|y)$/.test(n.startAxis)&&(this.options.drag.startAxis=n.startAxis),this):E.bool(n)?(this.options.drag.enabled=n,this):this.options.drag},beforeMove:F,move:W,defaults:{startAxis:"xy",lockAxis:"xy"},getCursor:function(){return"move"},filterEventType:function(n){return n.search("drag")===0}},re=Z,q={init:function(n){var t=n;q.document=t.document,q.DocumentFragment=t.DocumentFragment||U,q.SVGElement=t.SVGElement||U,q.SVGSVGElement=t.SVGSVGElement||U,q.SVGElementInstance=t.SVGElementInstance||U,q.Element=t.Element||U,q.HTMLElement=t.HTMLElement||q.Element,q.Event=t.Event,q.Touch=t.Touch||U,q.PointerEvent=t.PointerEvent||t.MSPointerEvent},document:null,DocumentFragment:null,SVGElement:null,SVGSVGElement:null,SVGElementInstance:null,Element:null,HTMLElement:null,Event:null,Touch:null,PointerEvent:null};function U(){}var D=q,z={init:function(n){var t=D.Element,o=n.navigator||{};z.supportsTouch="ontouchstart"in n||E.func(n.DocumentTouch)&&D.document instanceof n.DocumentTouch,z.supportsPointerEvent=o.pointerEnabled!==!1&&!!D.PointerEvent,z.isIOS=/iP(hone|od|ad)/.test(o.platform),z.isIOS7=/iP(hone|od|ad)/.test(o.platform)&&/OS 7[^\d]/.test(o.appVersion),z.isIe9=/MSIE 9/.test(o.userAgent),z.isOperaMobile=o.appName==="Opera"&&z.supportsTouch&&/Presto/.test(o.userAgent),z.prefixedMatchesSelector="matches"in t.prototype?"matches":"webkitMatchesSelector"in t.prototype?"webkitMatchesSelector":"mozMatchesSelector"in t.prototype?"mozMatchesSelector":"oMatchesSelector"in t.prototype?"oMatchesSelector":"msMatchesSelector",z.pEventTypes=z.supportsPointerEvent?D.PointerEvent===n.MSPointerEvent?{up:"MSPointerUp",down:"MSPointerDown",over:"mouseover",out:"mouseout",move:"MSPointerMove",cancel:"MSPointerCancel"}:{up:"pointerup",down:"pointerdown",over:"pointerover",out:"pointerout",move:"pointermove",cancel:"pointercancel"}:null,z.wheelEvent=D.document&&"onmousewheel"in D.document?"mousewheel":"wheel"},supportsTouch:null,supportsPointerEvent:null,isIOS7:null,isIOS:null,isIe9:null,isOperaMobile:null,prefixedMatchesSelector:null,pEventTypes:null,wheelEvent:null},te=z;function ee(n,t){if(n.contains)return n.contains(t);for(;t;){if(t===n)return!0;t=t.parentNode}return!1}function ce(n,t){for(;E.element(n);){if(C(n,t))return n;n=H(n)}return null}function H(n){var t=n.parentNode;if(E.docFrag(t)){for(;(t=t.host)&&E.docFrag(t););return t}return t}function C(n,t){return Q!==$&&(t=t.replace(/\/deep\//g," ")),n[te.prefixedMatchesSelector](t)}var Y=function(n){return n.parentNode||n.host};function oe(n,t){for(var o,i=[],c=n;(o=Y(c))&&c!==t&&o!==c.ownerDocument;)i.unshift(c),c=o;return i}function ie(n,t,o){for(;E.element(n);){if(C(n,t))return!0;if((n=H(n))===o)return C(n,t)}return!1}function fe(n){return n.correspondingUseElement||n}function ve(n){var t=n instanceof D.SVGElement?n.getBoundingClientRect():n.getClientRects()[0];return t&&{left:t.left,right:t.right,top:t.top,bottom:t.bottom,width:t.width||t.right-t.left,height:t.height||t.bottom-t.top}}function Ee(n){var t,o=ve(n);if(!te.isIOS7&&o){var i={x:(t=(t=G(n))||Q).scrollX||t.document.documentElement.scrollLeft,y:t.scrollY||t.document.documentElement.scrollTop};o.left+=i.x,o.right+=i.x,o.top+=i.y,o.bottom+=i.y}return o}function Se(n){for(var t=[];n;)t.push(n),n=H(n);return t}function xe(n){return!!E.string(n)&&(D.document.querySelector(n),!0)}function J(n,t){for(var o in t)n[o]=t[o];return n}function ze(n,t,o){return n==="parent"?H(o):n==="self"?t.getRect(o):ce(o,n)}function _e(n,t,o,i){var c=n;return E.string(c)?c=ze(c,t,o):E.func(c)&&(c=c.apply(void 0,i)),E.element(c)&&(c=Ee(c)),c}function ke(n){return n&&{x:"x"in n?n.x:n.left,y:"y"in n?n.y:n.top}}function De(n){return!n||"x"in n&&"y"in n||((n=J({},n)).x=n.left||0,n.y=n.top||0,n.width=n.width||(n.right||0)-n.x,n.height=n.height||(n.bottom||0)-n.y),n}function Ae(n,t,o){n.left&&(t.left+=o.x),n.right&&(t.right+=o.x),n.top&&(t.top+=o.y),n.bottom&&(t.bottom+=o.y),t.width=t.right-t.left,t.height=t.bottom-t.top}function He(n,t,o){var i=o&&n.options[o];return ke(_e(i&&i.origin||n.options.origin,n,t,[n&&t]))||{x:0,y:0}}function Ye(n,t){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(v){return!0},i=arguments.length>3?arguments[3]:void 0;if(i=i||{},E.string(n)&&n.search(" ")!==-1&&(n=Ho(n)),E.array(n))return n.forEach(function(v){return Ye(v,t,o,i)}),i;if(E.object(n)&&(t=n,n=""),E.func(t)&&o(n))i[n]=i[n]||[],i[n].push(t);else if(E.array(t))for(var c=0,f=t;c<f.length;c++){var d=f[c];Ye(n,d,o,i)}else if(E.object(t))for(var p in t)Ye(Ho(p).map(function(v){return"".concat(n).concat(v)}),t[p],o,i);return i}function Ho(n){return n.trim().split(/ +/)}var Ct=function(n,t){return Math.sqrt(n*n+t*t)},tc=["webkit","moz"];function yn(n,t){n.__set||(n.__set={});var o=function(c){if(tc.some(function(f){return c.indexOf(f)===0}))return 1;typeof n[c]!="function"&&c!=="__set"&&Object.defineProperty(n,c,{get:function(){return c in n.__set?n.__set[c]:n.__set[c]=t[c]},set:function(f){n.__set[c]=f},configurable:!0})};for(var i in t)o(i);return n}function bn(n,t){n.page=n.page||{},n.page.x=t.page.x,n.page.y=t.page.y,n.client=n.client||{},n.client.x=t.client.x,n.client.y=t.client.y,n.timeStamp=t.timeStamp}function Yo(n){n.page.x=0,n.page.y=0,n.client.x=0,n.client.y=0}function Xo(n){return n instanceof D.Event||n instanceof D.Touch}function xn(n,t,o){return n=n||"page",(o=o||{}).x=t[n+"X"],o.y=t[n+"Y"],o}function Uo(n,t){return t=t||{x:0,y:0},te.isOperaMobile&&Xo(n)?(xn("screen",n,t),t.x+=window.scrollX,t.y+=window.scrollY):xn("page",n,t),t}function kt(n){return E.number(n.pointerId)?n.pointerId:n.identifier}function nc(n,t,o){var i=t.length>1?Go(t):t[0];Uo(i,n.page),function(c,f){f=f||{},te.isOperaMobile&&Xo(c)?xn("screen",c,f):xn("client",c,f)}(i,n.client),n.timeStamp=o}function lr(n){var t=[];return E.array(n)?(t[0]=n[0],t[1]=n[1]):n.type==="touchend"?n.touches.length===1?(t[0]=n.touches[0],t[1]=n.changedTouches[0]):n.touches.length===0&&(t[0]=n.changedTouches[0],t[1]=n.changedTouches[1]):(t[0]=n.touches[0],t[1]=n.touches[1]),t}function Go(n){for(var t={pageX:0,pageY:0,clientX:0,clientY:0,screenX:0,screenY:0},o=0;o<n.length;o++){var i=n[o];for(var c in t)t[c]+=i[c]}for(var f in t)t[f]/=n.length;return t}function ur(n){if(!n.length)return null;var t=lr(n),o=Math.min(t[0].pageX,t[1].pageX),i=Math.min(t[0].pageY,t[1].pageY),c=Math.max(t[0].pageX,t[1].pageX),f=Math.max(t[0].pageY,t[1].pageY);return{x:o,y:i,left:o,top:i,right:c,bottom:f,width:c-o,height:f-i}}function fr(n,t){var o=t+"X",i=t+"Y",c=lr(n),f=c[0][o]-c[1][o],d=c[0][i]-c[1][i];return Ct(f,d)}function dr(n,t){var o=t+"X",i=t+"Y",c=lr(n),f=c[1][o]-c[0][o],d=c[1][i]-c[0][i];return 180*Math.atan2(d,f)/Math.PI}function Ko(n){return E.string(n.pointerType)?n.pointerType:E.number(n.pointerType)?[void 0,void 0,"touch","pen","mouse"][n.pointerType]:/touch/.test(n.type||"")||n instanceof D.Touch?"touch":"mouse"}function Wo(n){var t=E.func(n.composedPath)?n.composedPath():n.path;return[fe(t?t[0]:n.target),fe(n.currentTarget)]}var wn=function(){function n(t){u(this,n),this.immediatePropagationStopped=!1,this.propagationStopped=!1,this._interaction=t}return g(n,[{key:"preventDefault",value:function(){}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}}]),n}();Object.defineProperty(wn.prototype,"interaction",{get:function(){return this._interaction._proxy},set:function(){}});var Jo=function(n,t){for(var o=0;o<t.length;o++){var i=t[o];n.push(i)}return n},Zo=function(n){return Jo([],n)},_t=function(n,t){for(var o=0;o<n.length;o++)if(t(n[o],o,n))return o;return-1},Pt=function(n,t){return n[_t(n,t)]},ut=function(n){S(o,n);var t=j(o);function o(i,c,f){var d;u(this,o),(d=t.call(this,c._interaction)).dropzone=void 0,d.dragEvent=void 0,d.relatedTarget=void 0,d.draggable=void 0,d.propagationStopped=!1,d.immediatePropagationStopped=!1;var p=f==="dragleave"?i.prev:i.cur,v=p.element,w=p.dropzone;return d.type=f,d.target=v,d.currentTarget=v,d.dropzone=w,d.dragEvent=c,d.relatedTarget=c.target,d.draggable=c.interactable,d.timeStamp=c.timeStamp,d}return g(o,[{key:"reject",value:function(){var i=this,c=this._interaction.dropState;if(this.type==="dropactivate"||this.dropzone&&c.cur.dropzone===this.dropzone&&c.cur.element===this.target)if(c.prev.dropzone=this.dropzone,c.prev.element=this.target,c.rejected=!0,c.events.enter=null,this.stopImmediatePropagation(),this.type==="dropactivate"){var f=c.activeDrops,d=_t(f,function(v){var w=v.dropzone,y=v.element;return w===i.dropzone&&y===i.target});c.activeDrops.splice(d,1);var p=new o(c,this.dragEvent,"dropdeactivate");p.dropzone=this.dropzone,p.target=this.target,this.dropzone.fire(p)}else this.dropzone.fire(new o(c,this.dragEvent,"dragleave"))}},{key:"preventDefault",value:function(){}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}}]),o}(wn);function Qo(n,t){for(var o=0,i=n.slice();o<i.length;o++){var c=i[o],f=c.dropzone,d=c.element;t.dropzone=f,t.target=d,f.fire(t),t.propagationStopped=t.immediatePropagationStopped=!1}}function hr(n,t){for(var o=function(f,d){for(var p=[],v=0,w=f.interactables.list;v<w.length;v++){var y=w[v];if(y.options.drop.enabled){var _=y.options.drop.accept;if(!(E.element(_)&&_!==d||E.string(_)&&!C(d,_)||E.func(_)&&!_({dropzone:y,draggableElement:d})))for(var A=0,X=y.getAllElements();A<X.length;A++){var V=X[A];V!==d&&p.push({dropzone:y,element:V,rect:y.getRect(V)})}}}return p}(n,t),i=0;i<o.length;i++){var c=o[i];c.rect=c.dropzone.getRect(c.element)}return o}function $o(n,t,o){for(var i=n.dropState,c=n.interactable,f=n.element,d=[],p=0,v=i.activeDrops;p<v.length;p++){var w=v[p],y=w.dropzone,_=w.element,A=w.rect,X=y.dropCheck(t,o,c,f,_,A);d.push(X?_:null)}var V=function(K){for(var se,ne,ue,ye=[],we=0;we<K.length;we++){var de=K[we],be=K[se];if(de&&we!==se)if(be){var je=Y(de),Te=Y(be);if(je!==de.ownerDocument)if(Te!==de.ownerDocument)if(je!==Te){ye=ye.length?ye:oe(be);var Me=void 0;if(be instanceof D.HTMLElement&&de instanceof D.SVGElement&&!(de instanceof D.SVGSVGElement)){if(de===Te)continue;Me=de.ownerSVGElement}else Me=de;for(var Le=oe(Me,be.ownerDocument),Ge=0;Le[Ge]&&Le[Ge]===ye[Ge];)Ge++;var On=[Le[Ge-1],Le[Ge],ye[Ge]];if(On[0])for(var Mt=On[0].lastChild;Mt;){if(Mt===On[1]){se=we,ye=Le;break}if(Mt===On[2])break;Mt=Mt.previousSibling}}else ue=be,(parseInt(G(ne=de).getComputedStyle(ne).zIndex,10)||0)>=(parseInt(G(ue).getComputedStyle(ue).zIndex,10)||0)&&(se=we);else se=we}else se=we}return se}(d);return i.activeDrops[V]||null}function pr(n,t,o){var i=n.dropState,c={enter:null,leave:null,activate:null,deactivate:null,move:null,drop:null};return o.type==="dragstart"&&(c.activate=new ut(i,o,"dropactivate"),c.activate.target=null,c.activate.dropzone=null),o.type==="dragend"&&(c.deactivate=new ut(i,o,"dropdeactivate"),c.deactivate.target=null,c.deactivate.dropzone=null),i.rejected||(i.cur.element!==i.prev.element&&(i.prev.dropzone&&(c.leave=new ut(i,o,"dragleave"),o.dragLeave=c.leave.target=i.prev.element,o.prevDropzone=c.leave.dropzone=i.prev.dropzone),i.cur.dropzone&&(c.enter=new ut(i,o,"dragenter"),o.dragEnter=i.cur.element,o.dropzone=i.cur.dropzone)),o.type==="dragend"&&i.cur.dropzone&&(c.drop=new ut(i,o,"drop"),o.dropzone=i.cur.dropzone,o.relatedTarget=i.cur.element),o.type==="dragmove"&&i.cur.dropzone&&(c.move=new ut(i,o,"dropmove"),o.dropzone=i.cur.dropzone)),c}function gr(n,t){var o=n.dropState,i=o.activeDrops,c=o.cur,f=o.prev;t.leave&&f.dropzone.fire(t.leave),t.enter&&c.dropzone.fire(t.enter),t.move&&c.dropzone.fire(t.move),t.drop&&c.dropzone.fire(t.drop),t.deactivate&&Qo(i,t.deactivate),o.prev.dropzone=c.dropzone,o.prev.element=c.element}function qo(n,t){var o=n.interaction,i=n.iEvent,c=n.event;if(i.type==="dragmove"||i.type==="dragend"){var f=o.dropState;t.dynamicDrop&&(f.activeDrops=hr(t,o.element));var d=i,p=$o(o,d,c);f.rejected=f.rejected&&!!p&&p.dropzone===f.cur.dropzone&&p.element===f.cur.element,f.cur.dropzone=p&&p.dropzone,f.cur.element=p&&p.element,f.events=pr(o,0,d)}}var ei={id:"actions/drop",install:function(n){var t=n.actions,o=n.interactStatic,i=n.Interactable,c=n.defaults;n.usePlugin(re),i.prototype.dropzone=function(f){return function(d,p){if(E.object(p)){if(d.options.drop.enabled=p.enabled!==!1,p.listeners){var v=Ye(p.listeners),w=Object.keys(v).reduce(function(_,A){return _[/^(enter|leave)/.test(A)?"drag".concat(A):/^(activate|deactivate|move)/.test(A)?"drop".concat(A):A]=v[A],_},{}),y=d.options.drop.listeners;y&&d.off(y),d.on(w),d.options.drop.listeners=w}return E.func(p.ondrop)&&d.on("drop",p.ondrop),E.func(p.ondropactivate)&&d.on("dropactivate",p.ondropactivate),E.func(p.ondropdeactivate)&&d.on("dropdeactivate",p.ondropdeactivate),E.func(p.ondragenter)&&d.on("dragenter",p.ondragenter),E.func(p.ondragleave)&&d.on("dragleave",p.ondragleave),E.func(p.ondropmove)&&d.on("dropmove",p.ondropmove),/^(pointer|center)$/.test(p.overlap)?d.options.drop.overlap=p.overlap:E.number(p.overlap)&&(d.options.drop.overlap=Math.max(Math.min(1,p.overlap),0)),"accept"in p&&(d.options.drop.accept=p.accept),"checker"in p&&(d.options.drop.checker=p.checker),d}return E.bool(p)?(d.options.drop.enabled=p,d):d.options.drop}(this,f)},i.prototype.dropCheck=function(f,d,p,v,w,y){return function(_,A,X,V,K,se,ne){var ue=!1;if(!(ne=ne||_.getRect(se)))return!!_.options.drop.checker&&_.options.drop.checker(A,X,ue,_,se,V,K);var ye=_.options.drop.overlap;if(ye==="pointer"){var we=He(V,K,"drag"),de=Uo(A);de.x+=we.x,de.y+=we.y;var be=de.x>ne.left&&de.x<ne.right,je=de.y>ne.top&&de.y<ne.bottom;ue=be&&je}var Te=V.getRect(K);if(Te&&ye==="center"){var Me=Te.left+Te.width/2,Le=Te.top+Te.height/2;ue=Me>=ne.left&&Me<=ne.right&&Le>=ne.top&&Le<=ne.bottom}return Te&&E.number(ye)&&(ue=Math.max(0,Math.min(ne.right,Te.right)-Math.max(ne.left,Te.left))*Math.max(0,Math.min(ne.bottom,Te.bottom)-Math.max(ne.top,Te.top))/(Te.width*Te.height)>=ye),_.options.drop.checker&&(ue=_.options.drop.checker(A,X,ue,_,se,V,K)),ue}(this,f,d,p,v,w,y)},o.dynamicDrop=function(f){return E.bool(f)?(n.dynamicDrop=f,o):n.dynamicDrop},J(t.phaselessTypes,{dragenter:!0,dragleave:!0,dropactivate:!0,dropdeactivate:!0,dropmove:!0,drop:!0}),t.methodDict.drop="dropzone",n.dynamicDrop=!1,c.actions.drop=ei.defaults},listeners:{"interactions:before-action-start":function(n){var t=n.interaction;t.prepared.name==="drag"&&(t.dropState={cur:{dropzone:null,element:null},prev:{dropzone:null,element:null},rejected:null,events:null,activeDrops:[]})},"interactions:after-action-start":function(n,t){var o=n.interaction,i=n.iEvent;if(o.prepared.name==="drag"){var c=o.dropState;c.activeDrops=[],c.events={},c.activeDrops=hr(t,o.element),c.events=pr(o,0,i),c.events.activate&&(Qo(c.activeDrops,c.events.activate),t.fire("actions/drop:start",{interaction:o,dragEvent:i}))}},"interactions:action-move":qo,"interactions:after-action-move":function(n,t){var o=n.interaction,i=n.iEvent;if(o.prepared.name==="drag"){var c=o.dropState;gr(o,c.events),t.fire("actions/drop:move",{interaction:o,dragEvent:i}),c.events={}}},"interactions:action-end":function(n,t){if(n.interaction.prepared.name==="drag"){var o=n.interaction,i=n.iEvent;qo(n,t),gr(o,o.dropState.events),t.fire("actions/drop:end",{interaction:o,dragEvent:i})}},"interactions:stop":function(n){var t=n.interaction;if(t.prepared.name==="drag"){var o=t.dropState;o&&(o.activeDrops=null,o.events=null,o.cur.dropzone=null,o.cur.element=null,o.prev.dropzone=null,o.prev.element=null,o.rejected=!1)}}},getActiveDrops:hr,getDrop:$o,getDropEvents:pr,fireDropEvents:gr,filterEventType:function(n){return n.search("drag")===0||n.search("drop")===0},defaults:{enabled:!1,accept:null,overlap:"pointer"}},rc=ei;function mr(n){var t=n.interaction,o=n.iEvent,i=n.phase;if(t.prepared.name==="gesture"){var c=t.pointers.map(function(w){return w.pointer}),f=i==="start",d=i==="end",p=t.interactable.options.deltaSource;if(o.touches=[c[0],c[1]],f)o.distance=fr(c,p),o.box=ur(c),o.scale=1,o.ds=0,o.angle=dr(c,p),o.da=0,t.gesture.startDistance=o.distance,t.gesture.startAngle=o.angle;else if(d||t.pointers.length<2){var v=t.prevEvent;o.distance=v.distance,o.box=v.box,o.scale=v.scale,o.ds=0,o.angle=v.angle,o.da=0}else o.distance=fr(c,p),o.box=ur(c),o.scale=o.distance/t.gesture.startDistance,o.angle=dr(c,p),o.ds=o.scale-t.gesture.scale,o.da=o.angle-t.gesture.angle;t.gesture.distance=o.distance,t.gesture.angle=o.angle,E.number(o.scale)&&o.scale!==1/0&&!isNaN(o.scale)&&(t.gesture.scale=o.scale)}}var vr={id:"actions/gesture",before:["actions/drag","actions/resize"],install:function(n){var t=n.actions,o=n.Interactable,i=n.defaults;o.prototype.gesturable=function(c){return E.object(c)?(this.options.gesture.enabled=c.enabled!==!1,this.setPerAction("gesture",c),this.setOnEvents("gesture",c),this):E.bool(c)?(this.options.gesture.enabled=c,this):this.options.gesture},t.map.gesture=vr,t.methodDict.gesture="gesturable",i.actions.gesture=vr.defaults},listeners:{"interactions:action-start":mr,"interactions:action-move":mr,"interactions:action-end":mr,"interactions:new":function(n){n.interaction.gesture={angle:0,distance:0,scale:1,startAngle:0,startDistance:0}},"auto-start:check":function(n){if(!(n.interaction.pointers.length<2)){var t=n.interactable.options.gesture;if(t&&t.enabled)return n.action={name:"gesture"},!1}}},defaults:{},getCursor:function(){return""},filterEventType:function(n){return n.search("gesture")===0}},oc=vr;function ic(n,t,o,i,c,f,d){if(!t)return!1;if(t===!0){var p=E.number(f.width)?f.width:f.right-f.left,v=E.number(f.height)?f.height:f.bottom-f.top;if(d=Math.min(d,Math.abs((n==="left"||n==="right"?p:v)/2)),p<0&&(n==="left"?n="right":n==="right"&&(n="left")),v<0&&(n==="top"?n="bottom":n==="bottom"&&(n="top")),n==="left"){var w=p>=0?f.left:f.right;return o.x<w+d}if(n==="top"){var y=v>=0?f.top:f.bottom;return o.y<y+d}if(n==="right")return o.x>(p>=0?f.right:f.left)-d;if(n==="bottom")return o.y>(v>=0?f.bottom:f.top)-d}return!!E.element(i)&&(E.element(t)?t===i:ie(i,t,c))}function ti(n){var t=n.iEvent,o=n.interaction;if(o.prepared.name==="resize"&&o.resizeAxes){var i=t;o.interactable.options.resize.square?(o.resizeAxes==="y"?i.delta.x=i.delta.y:i.delta.y=i.delta.x,i.axes="xy"):(i.axes=o.resizeAxes,o.resizeAxes==="x"?i.delta.y=0:o.resizeAxes==="y"&&(i.delta.x=0))}}var Xe,ot,Ue={id:"actions/resize",before:["actions/drag"],install:function(n){var t=n.actions,o=n.browser,i=n.Interactable,c=n.defaults;Ue.cursors=function(f){return f.isIe9?{x:"e-resize",y:"s-resize",xy:"se-resize",top:"n-resize",left:"w-resize",bottom:"s-resize",right:"e-resize",topleft:"se-resize",bottomright:"se-resize",topright:"ne-resize",bottomleft:"ne-resize"}:{x:"ew-resize",y:"ns-resize",xy:"nwse-resize",top:"ns-resize",left:"ew-resize",bottom:"ns-resize",right:"ew-resize",topleft:"nwse-resize",bottomright:"nwse-resize",topright:"nesw-resize",bottomleft:"nesw-resize"}}(o),Ue.defaultMargin=o.supportsTouch||o.supportsPointerEvent?20:10,i.prototype.resizable=function(f){return function(d,p,v){return E.object(p)?(d.options.resize.enabled=p.enabled!==!1,d.setPerAction("resize",p),d.setOnEvents("resize",p),E.string(p.axis)&&/^x$|^y$|^xy$/.test(p.axis)?d.options.resize.axis=p.axis:p.axis===null&&(d.options.resize.axis=v.defaults.actions.resize.axis),E.bool(p.preserveAspectRatio)?d.options.resize.preserveAspectRatio=p.preserveAspectRatio:E.bool(p.square)&&(d.options.resize.square=p.square),d):E.bool(p)?(d.options.resize.enabled=p,d):d.options.resize}(this,f,n)},t.map.resize=Ue,t.methodDict.resize="resizable",c.actions.resize=Ue.defaults},listeners:{"interactions:new":function(n){n.interaction.resizeAxes="xy"},"interactions:action-start":function(n){(function(t){var o=t.iEvent,i=t.interaction;if(i.prepared.name==="resize"&&i.prepared.edges){var c=o,f=i.rect;i._rects={start:J({},f),corrected:J({},f),previous:J({},f),delta:{left:0,right:0,width:0,top:0,bottom:0,height:0}},c.edges=i.prepared.edges,c.rect=i._rects.corrected,c.deltaRect=i._rects.delta}})(n),ti(n)},"interactions:action-move":function(n){(function(t){var o=t.iEvent,i=t.interaction;if(i.prepared.name==="resize"&&i.prepared.edges){var c=o,f=i.interactable.options.resize.invert,d=f==="reposition"||f==="negate",p=i.rect,v=i._rects,w=v.start,y=v.corrected,_=v.delta,A=v.previous;if(J(A,y),d){if(J(y,p),f==="reposition"){if(y.top>y.bottom){var X=y.top;y.top=y.bottom,y.bottom=X}if(y.left>y.right){var V=y.left;y.left=y.right,y.right=V}}}else y.top=Math.min(p.top,w.bottom),y.bottom=Math.max(p.bottom,w.top),y.left=Math.min(p.left,w.right),y.right=Math.max(p.right,w.left);for(var K in y.width=y.right-y.left,y.height=y.bottom-y.top,y)_[K]=y[K]-A[K];c.edges=i.prepared.edges,c.rect=y,c.deltaRect=_}})(n),ti(n)},"interactions:action-end":function(n){var t=n.iEvent,o=n.interaction;if(o.prepared.name==="resize"&&o.prepared.edges){var i=t;i.edges=o.prepared.edges,i.rect=o._rects.corrected,i.deltaRect=o._rects.delta}},"auto-start:check":function(n){var t=n.interaction,o=n.interactable,i=n.element,c=n.rect,f=n.buttons;if(c){var d=J({},t.coords.cur.page),p=o.options.resize;if(p&&p.enabled&&(!t.pointerIsDown||!/mouse|pointer/.test(t.pointerType)||(f&p.mouseButtons)!=0)){if(E.object(p.edges)){var v={left:!1,right:!1,top:!1,bottom:!1};for(var w in v)v[w]=ic(w,p.edges[w],d,t._latestPointer.eventTarget,i,c,p.margin||Ue.defaultMargin);v.left=v.left&&!v.right,v.top=v.top&&!v.bottom,(v.left||v.right||v.top||v.bottom)&&(n.action={name:"resize",edges:v})}else{var y=p.axis!=="y"&&d.x>c.right-Ue.defaultMargin,_=p.axis!=="x"&&d.y>c.bottom-Ue.defaultMargin;(y||_)&&(n.action={name:"resize",axes:(y?"x":"")+(_?"y":"")})}return!n.action&&void 0}}}},defaults:{square:!1,preserveAspectRatio:!1,axis:"xy",margin:NaN,edges:null,invert:"none"},cursors:null,getCursor:function(n){var t=n.edges,o=n.axis,i=n.name,c=Ue.cursors,f=null;if(o)f=c[i+o];else if(t){for(var d="",p=0,v=["top","bottom","left","right"];p<v.length;p++){var w=v[p];t[w]&&(d+=w)}f=c[d]}return f},filterEventType:function(n){return n.search("resize")===0},defaultMargin:null},sc=Ue,ac={id:"actions",install:function(n){n.usePlugin(oc),n.usePlugin(sc),n.usePlugin(re),n.usePlugin(rc)}},ni=0,Ze={request:function(n){return Xe(n)},cancel:function(n){return ot(n)},init:function(n){if(Xe=n.requestAnimationFrame,ot=n.cancelAnimationFrame,!Xe)for(var t=["ms","moz","webkit","o"],o=0;o<t.length;o++){var i=t[o];Xe=n["".concat(i,"RequestAnimationFrame")],ot=n["".concat(i,"CancelAnimationFrame")]||n["".concat(i,"CancelRequestAnimationFrame")]}Xe=Xe&&Xe.bind(n),ot=ot&&ot.bind(n),Xe||(Xe=function(c){var f=Date.now(),d=Math.max(0,16-(f-ni)),p=n.setTimeout(function(){c(f+d)},d);return ni=f+d,p},ot=function(c){return clearTimeout(c)})}},he={defaults:{enabled:!1,margin:60,container:null,speed:300},now:Date.now,interaction:null,i:0,x:0,y:0,isScrolling:!1,prevTime:0,margin:0,speed:0,start:function(n){he.isScrolling=!0,Ze.cancel(he.i),n.autoScroll=he,he.interaction=n,he.prevTime=he.now(),he.i=Ze.request(he.scroll)},stop:function(){he.isScrolling=!1,he.interaction&&(he.interaction.autoScroll=null),Ze.cancel(he.i)},scroll:function(){var n=he.interaction,t=n.interactable,o=n.element,i=n.prepared.name,c=t.options[i].autoScroll,f=ri(c.container,t,o),d=he.now(),p=(d-he.prevTime)/1e3,v=c.speed*p;if(v>=1){var w={x:he.x*v,y:he.y*v};if(w.x||w.y){var y=oi(f);E.window(f)?f.scrollBy(w.x,w.y):f&&(f.scrollLeft+=w.x,f.scrollTop+=w.y);var _=oi(f),A={x:_.x-y.x,y:_.y-y.y};(A.x||A.y)&&t.fire({type:"autoscroll",target:o,interactable:t,delta:A,interaction:n,container:f})}he.prevTime=d}he.isScrolling&&(Ze.cancel(he.i),he.i=Ze.request(he.scroll))},check:function(n,t){var o;return(o=n.options[t].autoScroll)==null?void 0:o.enabled},onInteractionMove:function(n){var t=n.interaction,o=n.pointer;if(t.interacting()&&he.check(t.interactable,t.prepared.name))if(t.simulation)he.x=he.y=0;else{var i,c,f,d,p=t.interactable,v=t.element,w=t.prepared.name,y=p.options[w].autoScroll,_=ri(y.container,p,v);if(E.window(_))d=o.clientX<he.margin,i=o.clientY<he.margin,c=o.clientX>_.innerWidth-he.margin,f=o.clientY>_.innerHeight-he.margin;else{var A=ve(_);d=o.clientX<A.left+he.margin,i=o.clientY<A.top+he.margin,c=o.clientX>A.right-he.margin,f=o.clientY>A.bottom-he.margin}he.x=c?1:d?-1:0,he.y=f?1:i?-1:0,he.isScrolling||(he.margin=y.margin,he.speed=y.speed,he.start(t))}}};function ri(n,t,o){return(E.string(n)?ze(n,t,o):n)||G(o)}function oi(n){return E.window(n)&&(n=window.document.body),{x:n.scrollLeft,y:n.scrollTop}}var cc={id:"auto-scroll",install:function(n){var t=n.defaults,o=n.actions;n.autoScroll=he,he.now=function(){return n.now()},o.phaselessTypes.autoscroll=!0,t.perAction.autoScroll=he.defaults},listeners:{"interactions:new":function(n){n.interaction.autoScroll=null},"interactions:destroy":function(n){n.interaction.autoScroll=null,he.stop(),he.interaction&&(he.interaction=null)},"interactions:stop":he.stop,"interactions:action-move":function(n){return he.onInteractionMove(n)}}},lc=cc;function Ot(n,t){var o=!1;return function(){return o||(Q.console.warn(t),o=!0),n.apply(this,arguments)}}function yr(n,t){return n.name=t.name,n.axis=t.axis,n.edges=t.edges,n}function uc(n){return E.bool(n)?(this.options.styleCursor=n,this):n===null?(delete this.options.styleCursor,this):this.options.styleCursor}function fc(n){return E.func(n)?(this.options.actionChecker=n,this):n===null?(delete this.options.actionChecker,this):this.options.actionChecker}var dc={id:"auto-start/interactableMethods",install:function(n){var t=n.Interactable;t.prototype.getAction=function(o,i,c,f){var d=function(p,v,w,y,_){var A=p.getRect(y),X=v.buttons||{0:1,1:4,3:8,4:16}[v.button],V={action:null,interactable:p,interaction:w,element:y,rect:A,buttons:X};return _.fire("auto-start:check",V),V.action}(this,i,c,f,n);return this.options.actionChecker?this.options.actionChecker(o,i,d,this,f,c):d},t.prototype.ignoreFrom=Ot(function(o){return this._backCompatOption("ignoreFrom",o)},"Interactable.ignoreFrom() has been deprecated. Use Interactble.draggable({ignoreFrom: newValue})."),t.prototype.allowFrom=Ot(function(o){return this._backCompatOption("allowFrom",o)},"Interactable.allowFrom() has been deprecated. Use Interactble.draggable({allowFrom: newValue})."),t.prototype.actionChecker=fc,t.prototype.styleCursor=uc}};function ii(n,t,o,i,c){return t.testIgnoreAllow(t.options[n.name],o,i)&&t.options[n.name].enabled&&En(t,o,n,c)?n:null}function hc(n,t,o,i,c,f,d){for(var p=0,v=i.length;p<v;p++){var w=i[p],y=c[p],_=w.getAction(t,o,n,y);if(_){var A=ii(_,w,y,f,d);if(A)return{action:A,interactable:w,element:y}}}return{action:null,interactable:null,element:null}}function si(n,t,o,i,c){var f=[],d=[],p=i;function v(y){f.push(y),d.push(p)}for(;E.element(p);){f=[],d=[],c.interactables.forEachMatch(p,v);var w=hc(n,t,o,f,d,i,c);if(w.action&&!w.interactable.options[w.action.name].manualStart)return w;p=H(p)}return{action:null,interactable:null,element:null}}function ai(n,t,o){var i=t.action,c=t.interactable,f=t.element;i=i||{name:null},n.interactable=c,n.element=f,yr(n.prepared,i),n.rect=c&&i.name?c.getRect(f):null,li(n,o),o.fire("autoStart:prepared",{interaction:n})}function En(n,t,o,i){var c=n.options,f=c[o.name].max,d=c[o.name].maxPerElement,p=i.autoStart.maxInteractions,v=0,w=0,y=0;if(!(f&&d&&p))return!1;for(var _=0,A=i.interactions.list;_<A.length;_++){var X=A[_],V=X.prepared.name;if(X.interacting()&&(++v>=p||X.interactable===n&&((w+=V===o.name?1:0)>=f||X.element===t&&(y++,V===o.name&&y>=d))))return!1}return p>0}function ci(n,t){return E.number(n)?(t.autoStart.maxInteractions=n,this):t.autoStart.maxInteractions}function br(n,t,o){var i=o.autoStart.cursorElement;i&&i!==n&&(i.style.cursor=""),n.ownerDocument.documentElement.style.cursor=t,n.style.cursor=t,o.autoStart.cursorElement=t?n:null}function li(n,t){var o=n.interactable,i=n.element,c=n.prepared;if(n.pointerType==="mouse"&&o&&o.options.styleCursor){var f="";if(c.name){var d=o.options[c.name].cursorChecker;f=E.func(d)?d(c,o,i,n._interacting):t.actions.map[c.name].getCursor(c)}br(n.element,f||"",t)}else t.autoStart.cursorElement&&br(t.autoStart.cursorElement,"",t)}var pc={id:"auto-start/base",before:["actions"],install:function(n){var t=n.interactStatic,o=n.defaults;n.usePlugin(dc),o.base.actionChecker=null,o.base.styleCursor=!0,J(o.perAction,{manualStart:!1,max:1/0,maxPerElement:1,allowFrom:null,ignoreFrom:null,mouseButtons:1}),t.maxInteractions=function(i){return ci(i,n)},n.autoStart={maxInteractions:1/0,withinInteractionLimit:En,cursorElement:null}},listeners:{"interactions:down":function(n,t){var o=n.interaction,i=n.pointer,c=n.event,f=n.eventTarget;o.interacting()||ai(o,si(o,i,c,f,t),t)},"interactions:move":function(n,t){(function(o,i){var c=o.interaction,f=o.pointer,d=o.event,p=o.eventTarget;c.pointerType!=="mouse"||c.pointerIsDown||c.interacting()||ai(c,si(c,f,d,p,i),i)})(n,t),function(o,i){var c=o.interaction;if(c.pointerIsDown&&!c.interacting()&&c.pointerWasMoved&&c.prepared.name){i.fire("autoStart:before-start",o);var f=c.interactable,d=c.prepared.name;d&&f&&(f.options[d].manualStart||!En(f,c.element,c.prepared,i)?c.stop():(c.start(c.prepared,f,c.element),li(c,i)))}}(n,t)},"interactions:stop":function(n,t){var o=n.interaction,i=o.interactable;i&&i.options.styleCursor&&br(o.element,"",t)}},maxInteractions:ci,withinInteractionLimit:En,validateAction:ii},xr=pc,gc={id:"auto-start/dragAxis",listeners:{"autoStart:before-start":function(n,t){var o=n.interaction,i=n.eventTarget,c=n.dx,f=n.dy;if(o.prepared.name==="drag"){var d=Math.abs(c),p=Math.abs(f),v=o.interactable.options.drag,w=v.startAxis,y=d>p?"x":d<p?"y":"xy";if(o.prepared.axis=v.lockAxis==="start"?y[0]:v.lockAxis,y!=="xy"&&w!=="xy"&&w!==y){o.prepared.name=null;for(var _=i,A=function(V){if(V!==o.interactable){var K=o.interactable.options.drag;if(!K.manualStart&&V.testIgnoreAllow(K,_,i)){var se=V.getAction(o.downPointer,o.downEvent,o,_);if(se&&se.name==="drag"&&function(ne,ue){if(!ue)return!1;var ye=ue.options.drag.startAxis;return ne==="xy"||ye==="xy"||ye===ne}(y,V)&&xr.validateAction(se,V,_,i,t))return V}}};E.element(_);){var X=t.interactables.forEachMatch(_,A);if(X){o.prepared.name="drag",o.interactable=X,o.element=_;break}_=H(_)}}}}}};function wr(n){var t=n.prepared&&n.prepared.name;if(!t)return null;var o=n.interactable.options;return o[t].hold||o[t].delay}var mc={id:"auto-start/hold",install:function(n){var t=n.defaults;n.usePlugin(xr),t.perAction.hold=0,t.perAction.delay=0},listeners:{"interactions:new":function(n){n.interaction.autoStartHoldTimer=null},"autoStart:prepared":function(n){var t=n.interaction,o=wr(t);o>0&&(t.autoStartHoldTimer=setTimeout(function(){t.start(t.prepared,t.interactable,t.element)},o))},"interactions:move":function(n){var t=n.interaction,o=n.duplicate;t.autoStartHoldTimer&&t.pointerWasMoved&&!o&&(clearTimeout(t.autoStartHoldTimer),t.autoStartHoldTimer=null)},"autoStart:before-start":function(n){var t=n.interaction;wr(t)>0&&(t.prepared.name=null)}},getHoldDuration:wr},vc=mc,yc={id:"auto-start",install:function(n){n.usePlugin(xr),n.usePlugin(vc),n.usePlugin(gc)}},bc=function(n){return/^(always|never|auto)$/.test(n)?(this.options.preventDefault=n,this):E.bool(n)?(this.options.preventDefault=n?"always":"never",this):this.options.preventDefault};function xc(n){var t=n.interaction,o=n.event;t.interactable&&t.interactable.checkAndPreventDefault(o)}var ui={id:"core/interactablePreventDefault",install:function(n){var t=n.Interactable;t.prototype.preventDefault=bc,t.prototype.checkAndPreventDefault=function(o){return function(i,c,f){var d=i.options.preventDefault;if(d!=="never")if(d!=="always"){if(c.events.supportsPassive&&/^touch(start|move)$/.test(f.type)){var p=G(f.target).document,v=c.getDocOptions(p);if(!v||!v.events||v.events.passive!==!1)return}/^(mouse|pointer|touch)*(down|start)/i.test(f.type)||E.element(f.target)&&C(f.target,"input,select,textarea,[contenteditable=true],[contenteditable=true] *")||f.preventDefault()}else f.preventDefault()}(this,n,o)},n.interactions.docEvents.push({type:"dragstart",listener:function(o){for(var i=0,c=n.interactions.list;i<c.length;i++){var f=c[i];if(f.element&&(f.element===o.target||ee(f.element,o.target)))return void f.interactable.checkAndPreventDefault(o)}}})},listeners:["down","move","up","cancel"].reduce(function(n,t){return n["interactions:".concat(t)]=xc,n},{})};function Nn(n,t){if(t.phaselessTypes[n])return!0;for(var o in t.map)if(n.indexOf(o)===0&&n.substr(o.length)in t.phases)return!0;return!1}function ft(n){var t={};for(var o in n){var i=n[o];E.plainObject(i)?t[o]=ft(i):E.array(i)?t[o]=Zo(i):t[o]=i}return t}var Er=function(){function n(t){u(this,n),this.states=[],this.startOffset={left:0,right:0,top:0,bottom:0},this.startDelta=void 0,this.result=void 0,this.endResult=void 0,this.startEdges=void 0,this.edges=void 0,this.interaction=void 0,this.interaction=t,this.result=Sn(),this.edges={left:!1,right:!1,top:!1,bottom:!1}}return g(n,[{key:"start",value:function(t,o){var i,c,f=t.phase,d=this.interaction,p=function(w){var y=w.interactable.options[w.prepared.name],_=y.modifiers;return _&&_.length?_:["snap","snapSize","snapEdges","restrict","restrictEdges","restrictSize"].map(function(A){var X=y[A];return X&&X.enabled&&{options:X,methods:X._methods}}).filter(function(A){return!!A})}(d);this.prepareStates(p),this.startEdges=J({},d.edges),this.edges=J({},this.startEdges),this.startOffset=(i=d.rect,c=o,i?{left:c.x-i.left,top:c.y-i.top,right:i.right-c.x,bottom:i.bottom-c.y}:{left:0,top:0,right:0,bottom:0}),this.startDelta={x:0,y:0};var v=this.fillArg({phase:f,pageCoords:o,preEnd:!1});return this.result=Sn(),this.startAll(v),this.result=this.setAll(v)}},{key:"fillArg",value:function(t){var o=this.interaction;return t.interaction=o,t.interactable=o.interactable,t.element=o.element,t.rect||(t.rect=o.rect),t.edges||(t.edges=this.startEdges),t.startOffset=this.startOffset,t}},{key:"startAll",value:function(t){for(var o=0,i=this.states;o<i.length;o++){var c=i[o];c.methods.start&&(t.state=c,c.methods.start(t))}}},{key:"setAll",value:function(t){var o=t.phase,i=t.preEnd,c=t.skipModifiers,f=t.rect,d=t.edges;t.coords=J({},t.pageCoords),t.rect=J({},f),t.edges=J({},d);for(var p=c?this.states.slice(c):this.states,v=Sn(t.coords,t.rect),w=0;w<p.length;w++){var y,_=p[w],A=_.options,X=J({},t.coords),V=null;(y=_.methods)!=null&&y.set&&this.shouldDo(A,i,o)&&(t.state=_,V=_.methods.set(t),Ae(t.edges,t.rect,{x:t.coords.x-X.x,y:t.coords.y-X.y})),v.eventProps.push(V)}J(this.edges,t.edges),v.delta.x=t.coords.x-t.pageCoords.x,v.delta.y=t.coords.y-t.pageCoords.y,v.rectDelta.left=t.rect.left-f.left,v.rectDelta.right=t.rect.right-f.right,v.rectDelta.top=t.rect.top-f.top,v.rectDelta.bottom=t.rect.bottom-f.bottom;var K=this.result.coords,se=this.result.rect;if(K&&se){var ne=v.rect.left!==se.left||v.rect.right!==se.right||v.rect.top!==se.top||v.rect.bottom!==se.bottom;v.changed=ne||K.x!==v.coords.x||K.y!==v.coords.y}return v}},{key:"applyToInteraction",value:function(t){var o=this.interaction,i=t.phase,c=o.coords.cur,f=o.coords.start,d=this.result,p=this.startDelta,v=d.delta;i==="start"&&J(this.startDelta,d.delta);for(var w=0,y=[[f,p],[c,v]];w<y.length;w++){var _=y[w],A=_[0],X=_[1];A.page.x+=X.x,A.page.y+=X.y,A.client.x+=X.x,A.client.y+=X.y}var V=this.result.rectDelta,K=t.rect||o.rect;K.left+=V.left,K.right+=V.right,K.top+=V.top,K.bottom+=V.bottom,K.width=K.right-K.left,K.height=K.bottom-K.top}},{key:"setAndApply",value:function(t){var o=this.interaction,i=t.phase,c=t.preEnd,f=t.skipModifiers,d=this.setAll(this.fillArg({preEnd:c,phase:i,pageCoords:t.modifiedCoords||o.coords.cur.page}));if(this.result=d,!d.changed&&(!f||f<this.states.length)&&o.interacting())return!1;if(t.modifiedCoords){var p=o.coords.cur.page,v={x:t.modifiedCoords.x-p.x,y:t.modifiedCoords.y-p.y};d.coords.x+=v.x,d.coords.y+=v.y,d.delta.x+=v.x,d.delta.y+=v.y}this.applyToInteraction(t)}},{key:"beforeEnd",value:function(t){var o=t.interaction,i=t.event,c=this.states;if(c&&c.length){for(var f=!1,d=0;d<c.length;d++){var p=c[d];t.state=p;var v=p.options,w=p.methods,y=w.beforeEnd&&w.beforeEnd(t);if(y)return this.endResult=y,!1;f=f||!f&&this.shouldDo(v,!0,t.phase,!0)}f&&o.move({event:i,preEnd:!0})}}},{key:"stop",value:function(t){var o=t.interaction;if(this.states&&this.states.length){var i=J({states:this.states,interactable:o.interactable,element:o.element,rect:null},t);this.fillArg(i);for(var c=0,f=this.states;c<f.length;c++){var d=f[c];i.state=d,d.methods.stop&&d.methods.stop(i)}this.states=null,this.endResult=null}}},{key:"prepareStates",value:function(t){this.states=[];for(var o=0;o<t.length;o++){var i=t[o],c=i.options,f=i.methods,d=i.name;this.states.push({options:c,methods:f,index:o,name:d})}return this.states}},{key:"restoreInteractionCoords",value:function(t){var o=t.interaction,i=o.coords,c=o.rect,f=o.modification;if(f.result){for(var d=f.startDelta,p=f.result,v=p.delta,w=p.rectDelta,y=0,_=[[i.start,d],[i.cur,v]];y<_.length;y++){var A=_[y],X=A[0],V=A[1];X.page.x-=V.x,X.page.y-=V.y,X.client.x-=V.x,X.client.y-=V.y}c.left-=w.left,c.right-=w.right,c.top-=w.top,c.bottom-=w.bottom}}},{key:"shouldDo",value:function(t,o,i,c){return!(!t||t.enabled===!1||c&&!t.endOnly||t.endOnly&&!o||i==="start"&&!t.setStart)}},{key:"copyFrom",value:function(t){this.startOffset=t.startOffset,this.startDelta=t.startDelta,this.startEdges=t.startEdges,this.edges=t.edges,this.states=t.states.map(function(o){return ft(o)}),this.result=Sn(J({},t.result.coords),J({},t.result.rect))}},{key:"destroy",value:function(){for(var t in this)this[t]=null}}]),n}();function Sn(n,t){return{rect:t,coords:n,delta:{x:0,y:0},rectDelta:{left:0,right:0,top:0,bottom:0},eventProps:[],changed:!0}}function Qe(n,t){var o=n.defaults,i={start:n.start,set:n.set,beforeEnd:n.beforeEnd,stop:n.stop},c=function(f){var d=f||{};for(var p in d.enabled=d.enabled!==!1,o)p in d||(d[p]=o[p]);var v={options:d,methods:i,name:t,enable:function(){return d.enabled=!0,v},disable:function(){return d.enabled=!1,v}};return v};return t&&typeof t=="string"&&(c._defaults=o,c._methods=i),c}function It(n){var t=n.iEvent,o=n.interaction.modification.result;o&&(t.modifiers=o.eventProps)}var wc={id:"modifiers/base",before:["actions"],install:function(n){n.defaults.perAction.modifiers=[]},listeners:{"interactions:new":function(n){var t=n.interaction;t.modification=new Er(t)},"interactions:before-action-start":function(n){var t=n.interaction,o=n.interaction.modification;o.start(n,t.coords.start.page),t.edges=o.edges,o.applyToInteraction(n)},"interactions:before-action-move":function(n){var t=n.interaction,o=t.modification,i=o.setAndApply(n);return t.edges=o.edges,i},"interactions:before-action-end":function(n){var t=n.interaction,o=t.modification,i=o.beforeEnd(n);return t.edges=o.startEdges,i},"interactions:action-start":It,"interactions:action-move":It,"interactions:action-end":It,"interactions:after-action-start":function(n){return n.interaction.modification.restoreInteractionCoords(n)},"interactions:after-action-move":function(n){return n.interaction.modification.restoreInteractionCoords(n)},"interactions:stop":function(n){return n.interaction.modification.stop(n)}}},fi=wc,di={base:{preventDefault:"auto",deltaSource:"page"},perAction:{enabled:!1,origin:{x:0,y:0}},actions:{}},Nr=function(n){S(o,n);var t=j(o);function o(i,c,f,d,p,v,w){var y;u(this,o),(y=t.call(this,i)).relatedTarget=null,y.screenX=void 0,y.screenY=void 0,y.button=void 0,y.buttons=void 0,y.ctrlKey=void 0,y.shiftKey=void 0,y.altKey=void 0,y.metaKey=void 0,y.page=void 0,y.client=void 0,y.delta=void 0,y.rect=void 0,y.x0=void 0,y.y0=void 0,y.t0=void 0,y.dt=void 0,y.duration=void 0,y.clientX0=void 0,y.clientY0=void 0,y.velocity=void 0,y.speed=void 0,y.swipe=void 0,y.axes=void 0,y.preEnd=void 0,p=p||i.element;var _=i.interactable,A=(_&&_.options||di).deltaSource,X=He(_,p,f),V=d==="start",K=d==="end",se=V?O(y):i.prevEvent,ne=V?i.coords.start:K?{page:se.page,client:se.client,timeStamp:i.coords.cur.timeStamp}:i.coords.cur;return y.page=J({},ne.page),y.client=J({},ne.client),y.rect=J({},i.rect),y.timeStamp=ne.timeStamp,K||(y.page.x-=X.x,y.page.y-=X.y,y.client.x-=X.x,y.client.y-=X.y),y.ctrlKey=c.ctrlKey,y.altKey=c.altKey,y.shiftKey=c.shiftKey,y.metaKey=c.metaKey,y.button=c.button,y.buttons=c.buttons,y.target=p,y.currentTarget=p,y.preEnd=v,y.type=w||f+(d||""),y.interactable=_,y.t0=V?i.pointers[i.pointers.length-1].downTime:se.t0,y.x0=i.coords.start.page.x-X.x,y.y0=i.coords.start.page.y-X.y,y.clientX0=i.coords.start.client.x-X.x,y.clientY0=i.coords.start.client.y-X.y,y.delta=V||K?{x:0,y:0}:{x:y[A].x-se[A].x,y:y[A].y-se[A].y},y.dt=i.coords.delta.timeStamp,y.duration=y.timeStamp-y.t0,y.velocity=J({},i.coords.velocity[A]),y.speed=Ct(y.velocity.x,y.velocity.y),y.swipe=K||d==="inertiastart"?y.getSwipe():null,y}return g(o,[{key:"getSwipe",value:function(){var i=this._interaction;if(i.prevEvent.speed<600||this.timeStamp-i.prevEvent.timeStamp>150)return null;var c=180*Math.atan2(i.prevEvent.velocityY,i.prevEvent.velocityX)/Math.PI;c<0&&(c+=360);var f=112.5<=c&&c<247.5,d=202.5<=c&&c<337.5;return{up:d,down:!d&&22.5<=c&&c<157.5,left:f,right:!f&&(292.5<=c||c<67.5),angle:c,speed:i.prevEvent.speed,velocity:{x:i.prevEvent.velocityX,y:i.prevEvent.velocityY}}}},{key:"preventDefault",value:function(){}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}}]),o}(wn);Object.defineProperties(Nr.prototype,{pageX:{get:function(){return this.page.x},set:function(n){this.page.x=n}},pageY:{get:function(){return this.page.y},set:function(n){this.page.y=n}},clientX:{get:function(){return this.client.x},set:function(n){this.client.x=n}},clientY:{get:function(){return this.client.y},set:function(n){this.client.y=n}},dx:{get:function(){return this.delta.x},set:function(n){this.delta.x=n}},dy:{get:function(){return this.delta.y},set:function(n){this.delta.y=n}},velocityX:{get:function(){return this.velocity.x},set:function(n){this.velocity.x=n}},velocityY:{get:function(){return this.velocity.y},set:function(n){this.velocity.y=n}}});var Ec=g(function n(t,o,i,c,f){u(this,n),this.id=void 0,this.pointer=void 0,this.event=void 0,this.downTime=void 0,this.downTarget=void 0,this.id=t,this.pointer=o,this.event=i,this.downTime=c,this.downTarget=f}),Nc=function(n){return n.interactable="",n.element="",n.prepared="",n.pointerIsDown="",n.pointerWasMoved="",n._proxy="",n}({}),hi=function(n){return n.start="",n.move="",n.end="",n.stop="",n.interacting="",n}({}),Sc=0,Tc=function(){function n(t){var o=this,i=t.pointerType,c=t.scopeFire;u(this,n),this.interactable=null,this.element=null,this.rect=null,this._rects=void 0,this.edges=null,this._scopeFire=void 0,this.prepared={name:null,axis:null,edges:null},this.pointerType=void 0,this.pointers=[],this.downEvent=null,this.downPointer={},this._latestPointer={pointer:null,event:null,eventTarget:null},this.prevEvent=null,this.pointerIsDown=!1,this.pointerWasMoved=!1,this._interacting=!1,this._ending=!1,this._stopped=!0,this._proxy=void 0,this.simulation=null,this.doMove=Ot(function(y){this.move(y)},"The interaction.doMove() method has been renamed to interaction.move()"),this.coords={start:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},prev:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},cur:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},delta:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},velocity:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0}},this._id=Sc++,this._scopeFire=c,this.pointerType=i;var f=this;this._proxy={};var d=function(y){Object.defineProperty(o._proxy,y,{get:function(){return f[y]}})};for(var p in Nc)d(p);var v=function(y){Object.defineProperty(o._proxy,y,{value:function(){return f[y].apply(f,arguments)}})};for(var w in hi)v(w);this._scopeFire("interactions:new",{interaction:this})}return g(n,[{key:"pointerMoveTolerance",get:function(){return 1}},{key:"pointerDown",value:function(t,o,i){var c=this.updatePointer(t,o,i,!0),f=this.pointers[c];this._scopeFire("interactions:down",{pointer:t,event:o,eventTarget:i,pointerIndex:c,pointerInfo:f,type:"down",interaction:this})}},{key:"start",value:function(t,o,i){return!(this.interacting()||!this.pointerIsDown||this.pointers.length<(t.name==="gesture"?2:1)||!o.options[t.name].enabled)&&(yr(this.prepared,t),this.interactable=o,this.element=i,this.rect=o.getRect(i),this.edges=this.prepared.edges?J({},this.prepared.edges):{left:!0,right:!0,top:!0,bottom:!0},this._stopped=!1,this._interacting=this._doPhase({interaction:this,event:this.downEvent,phase:"start"})&&!this._stopped,this._interacting)}},{key:"pointerMove",value:function(t,o,i){this.simulation||this.modification&&this.modification.endResult||this.updatePointer(t,o,i,!1);var c,f,d=this.coords.cur.page.x===this.coords.prev.page.x&&this.coords.cur.page.y===this.coords.prev.page.y&&this.coords.cur.client.x===this.coords.prev.client.x&&this.coords.cur.client.y===this.coords.prev.client.y;this.pointerIsDown&&!this.pointerWasMoved&&(c=this.coords.cur.client.x-this.coords.start.client.x,f=this.coords.cur.client.y-this.coords.start.client.y,this.pointerWasMoved=Ct(c,f)>this.pointerMoveTolerance);var p,v,w,y=this.getPointerIndex(t),_={pointer:t,pointerIndex:y,pointerInfo:this.pointers[y],event:o,type:"move",eventTarget:i,dx:c,dy:f,duplicate:d,interaction:this};d||(p=this.coords.velocity,v=this.coords.delta,w=Math.max(v.timeStamp/1e3,.001),p.page.x=v.page.x/w,p.page.y=v.page.y/w,p.client.x=v.client.x/w,p.client.y=v.client.y/w,p.timeStamp=w),this._scopeFire("interactions:move",_),d||this.simulation||(this.interacting()&&(_.type=null,this.move(_)),this.pointerWasMoved&&bn(this.coords.prev,this.coords.cur))}},{key:"move",value:function(t){t&&t.event||Yo(this.coords.delta),(t=J({pointer:this._latestPointer.pointer,event:this._latestPointer.event,eventTarget:this._latestPointer.eventTarget,interaction:this},t||{})).phase="move",this._doPhase(t)}},{key:"pointerUp",value:function(t,o,i,c){var f=this.getPointerIndex(t);f===-1&&(f=this.updatePointer(t,o,i,!1));var d=/cancel$/i.test(o.type)?"cancel":"up";this._scopeFire("interactions:".concat(d),{pointer:t,pointerIndex:f,pointerInfo:this.pointers[f],event:o,eventTarget:i,type:d,curEventTarget:c,interaction:this}),this.simulation||this.end(o),this.removePointer(t,o)}},{key:"documentBlur",value:function(t){this.end(t),this._scopeFire("interactions:blur",{event:t,type:"blur",interaction:this})}},{key:"end",value:function(t){var o;this._ending=!0,t=t||this._latestPointer.event,this.interacting()&&(o=this._doPhase({event:t,interaction:this,phase:"end"})),this._ending=!1,o===!0&&this.stop()}},{key:"currentAction",value:function(){return this._interacting?this.prepared.name:null}},{key:"interacting",value:function(){return this._interacting}},{key:"stop",value:function(){this._scopeFire("interactions:stop",{interaction:this}),this.interactable=this.element=null,this._interacting=!1,this._stopped=!0,this.prepared.name=this.prevEvent=null}},{key:"getPointerIndex",value:function(t){var o=kt(t);return this.pointerType==="mouse"||this.pointerType==="pen"?this.pointers.length-1:_t(this.pointers,function(i){return i.id===o})}},{key:"getPointerInfo",value:function(t){return this.pointers[this.getPointerIndex(t)]}},{key:"updatePointer",value:function(t,o,i,c){var f,d,p,v=kt(t),w=this.getPointerIndex(t),y=this.pointers[w];return c=c!==!1&&(c||/(down|start)$/i.test(o.type)),y?y.pointer=t:(y=new Ec(v,t,o,null,null),w=this.pointers.length,this.pointers.push(y)),nc(this.coords.cur,this.pointers.map(function(_){return _.pointer}),this._now()),f=this.coords.delta,d=this.coords.prev,p=this.coords.cur,f.page.x=p.page.x-d.page.x,f.page.y=p.page.y-d.page.y,f.client.x=p.client.x-d.client.x,f.client.y=p.client.y-d.client.y,f.timeStamp=p.timeStamp-d.timeStamp,c&&(this.pointerIsDown=!0,y.downTime=this.coords.cur.timeStamp,y.downTarget=i,yn(this.downPointer,t),this.interacting()||(bn(this.coords.start,this.coords.cur),bn(this.coords.prev,this.coords.cur),this.downEvent=o,this.pointerWasMoved=!1)),this._updateLatestPointer(t,o,i),this._scopeFire("interactions:update-pointer",{pointer:t,event:o,eventTarget:i,down:c,pointerInfo:y,pointerIndex:w,interaction:this}),w}},{key:"removePointer",value:function(t,o){var i=this.getPointerIndex(t);if(i!==-1){var c=this.pointers[i];this._scopeFire("interactions:remove-pointer",{pointer:t,event:o,eventTarget:null,pointerIndex:i,pointerInfo:c,interaction:this}),this.pointers.splice(i,1),this.pointerIsDown=!1}}},{key:"_updateLatestPointer",value:function(t,o,i){this._latestPointer.pointer=t,this._latestPointer.event=o,this._latestPointer.eventTarget=i}},{key:"destroy",value:function(){this._latestPointer.pointer=null,this._latestPointer.event=null,this._latestPointer.eventTarget=null}},{key:"_createPreparedEvent",value:function(t,o,i,c){return new Nr(this,t,this.prepared.name,o,this.element,i,c)}},{key:"_fireEvent",value:function(t){var o;(o=this.interactable)==null||o.fire(t),(!this.prevEvent||t.timeStamp>=this.prevEvent.timeStamp)&&(this.prevEvent=t)}},{key:"_doPhase",value:function(t){var o=t.event,i=t.phase,c=t.preEnd,f=t.type,d=this.rect;if(d&&i==="move"&&(Ae(this.edges,d,this.coords.delta[this.interactable.options.deltaSource]),d.width=d.right-d.left,d.height=d.bottom-d.top),this._scopeFire("interactions:before-action-".concat(i),t)===!1)return!1;var p=t.iEvent=this._createPreparedEvent(o,i,c,f);return this._scopeFire("interactions:action-".concat(i),t),i==="start"&&(this.prevEvent=p),this._fireEvent(p),this._scopeFire("interactions:after-action-".concat(i),t),!0}},{key:"_now",value:function(){return Date.now()}}]),n}();function pi(n){gi(n.interaction)}function gi(n){if(!function(o){return!(!o.offset.pending.x&&!o.offset.pending.y)}(n))return!1;var t=n.offset.pending;return Sr(n.coords.cur,t),Sr(n.coords.delta,t),Ae(n.edges,n.rect,t),t.x=0,t.y=0,!0}function Cc(n){var t=n.x,o=n.y;this.offset.pending.x+=t,this.offset.pending.y+=o,this.offset.total.x+=t,this.offset.total.y+=o}function Sr(n,t){var o=n.page,i=n.client,c=t.x,f=t.y;o.x+=c,o.y+=f,i.x+=c,i.y+=f}hi.offsetBy="";var kc={id:"offset",before:["modifiers","pointer-events","actions","inertia"],install:function(n){n.Interaction.prototype.offsetBy=Cc},listeners:{"interactions:new":function(n){n.interaction.offset={total:{x:0,y:0},pending:{x:0,y:0}}},"interactions:update-pointer":function(n){return function(t){t.pointerIsDown&&(Sr(t.coords.cur,t.offset.total),t.offset.pending.x=0,t.offset.pending.y=0)}(n.interaction)},"interactions:before-action-start":pi,"interactions:before-action-move":pi,"interactions:before-action-end":function(n){var t=n.interaction;if(gi(t))return t.move({offset:!0}),t.end(),!1},"interactions:stop":function(n){var t=n.interaction;t.offset.total.x=0,t.offset.total.y=0,t.offset.pending.x=0,t.offset.pending.y=0}}},mi=kc,_c=function(){function n(t){u(this,n),this.active=!1,this.isModified=!1,this.smoothEnd=!1,this.allowResume=!1,this.modification=void 0,this.modifierCount=0,this.modifierArg=void 0,this.startCoords=void 0,this.t0=0,this.v0=0,this.te=0,this.targetOffset=void 0,this.modifiedOffset=void 0,this.currentOffset=void 0,this.lambda_v0=0,this.one_ve_v0=0,this.timeout=void 0,this.interaction=void 0,this.interaction=t}return g(n,[{key:"start",value:function(t){var o=this.interaction,i=Tn(o);if(!i||!i.enabled)return!1;var c=o.coords.velocity.client,f=Ct(c.x,c.y),d=this.modification||(this.modification=new Er(o));if(d.copyFrom(o.modification),this.t0=o._now(),this.allowResume=i.allowResume,this.v0=f,this.currentOffset={x:0,y:0},this.startCoords=o.coords.cur.page,this.modifierArg=d.fillArg({pageCoords:this.startCoords,preEnd:!0,phase:"inertiastart"}),this.t0-o.coords.cur.timeStamp<50&&f>i.minSpeed&&f>i.endSpeed)this.startInertia();else{if(d.result=d.setAll(this.modifierArg),!d.result.changed)return!1;this.startSmoothEnd()}return o.modification.result.rect=null,o.offsetBy(this.targetOffset),o._doPhase({interaction:o,event:t,phase:"inertiastart"}),o.offsetBy({x:-this.targetOffset.x,y:-this.targetOffset.y}),o.modification.result.rect=null,this.active=!0,o.simulation=this,!0}},{key:"startInertia",value:function(){var t=this,o=this.interaction.coords.velocity.client,i=Tn(this.interaction),c=i.resistance,f=-Math.log(i.endSpeed/this.v0)/c;this.targetOffset={x:(o.x-f)/c,y:(o.y-f)/c},this.te=f,this.lambda_v0=c/this.v0,this.one_ve_v0=1-i.endSpeed/this.v0;var d=this.modification,p=this.modifierArg;p.pageCoords={x:this.startCoords.x+this.targetOffset.x,y:this.startCoords.y+this.targetOffset.y},d.result=d.setAll(p),d.result.changed&&(this.isModified=!0,this.modifiedOffset={x:this.targetOffset.x+d.result.delta.x,y:this.targetOffset.y+d.result.delta.y}),this.onNextFrame(function(){return t.inertiaTick()})}},{key:"startSmoothEnd",value:function(){var t=this;this.smoothEnd=!0,this.isModified=!0,this.targetOffset={x:this.modification.result.delta.x,y:this.modification.result.delta.y},this.onNextFrame(function(){return t.smoothEndTick()})}},{key:"onNextFrame",value:function(t){var o=this;this.timeout=Ze.request(function(){o.active&&t()})}},{key:"inertiaTick",value:function(){var t,o,i,c,f,d,p,v=this,w=this.interaction,y=Tn(w).resistance,_=(w._now()-this.t0)/1e3;if(_<this.te){var A,X=1-(Math.exp(-y*_)-this.lambda_v0)/this.one_ve_v0;this.isModified?(t=0,o=0,i=this.targetOffset.x,c=this.targetOffset.y,f=this.modifiedOffset.x,d=this.modifiedOffset.y,A={x:vi(p=X,t,i,f),y:vi(p,o,c,d)}):A={x:this.targetOffset.x*X,y:this.targetOffset.y*X};var V={x:A.x-this.currentOffset.x,y:A.y-this.currentOffset.y};this.currentOffset.x+=V.x,this.currentOffset.y+=V.y,w.offsetBy(V),w.move(),this.onNextFrame(function(){return v.inertiaTick()})}else w.offsetBy({x:this.modifiedOffset.x-this.currentOffset.x,y:this.modifiedOffset.y-this.currentOffset.y}),this.end()}},{key:"smoothEndTick",value:function(){var t=this,o=this.interaction,i=o._now()-this.t0,c=Tn(o).smoothEndDuration;if(i<c){var f={x:yi(i,0,this.targetOffset.x,c),y:yi(i,0,this.targetOffset.y,c)},d={x:f.x-this.currentOffset.x,y:f.y-this.currentOffset.y};this.currentOffset.x+=d.x,this.currentOffset.y+=d.y,o.offsetBy(d),o.move({skipModifiers:this.modifierCount}),this.onNextFrame(function(){return t.smoothEndTick()})}else o.offsetBy({x:this.targetOffset.x-this.currentOffset.x,y:this.targetOffset.y-this.currentOffset.y}),this.end()}},{key:"resume",value:function(t){var o=t.pointer,i=t.event,c=t.eventTarget,f=this.interaction;f.offsetBy({x:-this.currentOffset.x,y:-this.currentOffset.y}),f.updatePointer(o,i,c,!0),f._doPhase({interaction:f,event:i,phase:"resume"}),bn(f.coords.prev,f.coords.cur),this.stop()}},{key:"end",value:function(){this.interaction.move(),this.interaction.end(),this.stop()}},{key:"stop",value:function(){this.active=this.smoothEnd=!1,this.interaction.simulation=null,Ze.cancel(this.timeout)}}]),n}();function Tn(n){var t=n.interactable,o=n.prepared;return t&&t.options&&o.name&&t.options[o.name].inertia}var Pc={id:"inertia",before:["modifiers","actions"],install:function(n){var t=n.defaults;n.usePlugin(mi),n.usePlugin(fi),n.actions.phases.inertiastart=!0,n.actions.phases.resume=!0,t.perAction.inertia={enabled:!1,resistance:10,minSpeed:100,endSpeed:10,allowResume:!0,smoothEndDuration:300}},listeners:{"interactions:new":function(n){var t=n.interaction;t.inertia=new _c(t)},"interactions:before-action-end":function(n){var t=n.interaction,o=n.event;return(!t._interacting||t.simulation||!t.inertia.start(o))&&null},"interactions:down":function(n){var t=n.interaction,o=n.eventTarget,i=t.inertia;if(i.active)for(var c=o;E.element(c);){if(c===t.element){i.resume(n);break}c=H(c)}},"interactions:stop":function(n){var t=n.interaction.inertia;t.active&&t.stop()},"interactions:before-action-resume":function(n){var t=n.interaction.modification;t.stop(n),t.start(n,n.interaction.coords.cur.page),t.applyToInteraction(n)},"interactions:before-action-inertiastart":function(n){return n.interaction.modification.setAndApply(n)},"interactions:action-resume":It,"interactions:action-inertiastart":It,"interactions:after-action-inertiastart":function(n){return n.interaction.modification.restoreInteractionCoords(n)},"interactions:after-action-resume":function(n){return n.interaction.modification.restoreInteractionCoords(n)}}};function vi(n,t,o,i){var c=1-n;return c*c*t+2*c*n*o+n*n*i}function yi(n,t,o,i){return-o*(n/=i)*(n-2)+t}var Oc=Pc;function bi(n,t){for(var o=0;o<t.length;o++){var i=t[o];if(n.immediatePropagationStopped)break;i(n)}}var xi=function(){function n(t){u(this,n),this.options=void 0,this.types={},this.propagationStopped=!1,this.immediatePropagationStopped=!1,this.global=void 0,this.options=J({},t||{})}return g(n,[{key:"fire",value:function(t){var o,i=this.global;(o=this.types[t.type])&&bi(t,o),!t.propagationStopped&&i&&(o=i[t.type])&&bi(t,o)}},{key:"on",value:function(t,o){var i=Ye(t,o);for(t in i)this.types[t]=Jo(this.types[t]||[],i[t])}},{key:"off",value:function(t,o){var i=Ye(t,o);for(t in i){var c=this.types[t];if(c&&c.length)for(var f=0,d=i[t];f<d.length;f++){var p=d[f],v=c.indexOf(p);v!==-1&&c.splice(v,1)}}}},{key:"getRect",value:function(t){return null}}]),n}(),Ic=function(){function n(t){u(this,n),this.currentTarget=void 0,this.originalEvent=void 0,this.type=void 0,this.originalEvent=t,yn(this,t)}return g(n,[{key:"preventOriginalDefault",value:function(){this.originalEvent.preventDefault()}},{key:"stopPropagation",value:function(){this.originalEvent.stopPropagation()}},{key:"stopImmediatePropagation",value:function(){this.originalEvent.stopImmediatePropagation()}}]),n}();function Rt(n){return E.object(n)?{capture:!!n.capture,passive:!!n.passive}:{capture:!!n,passive:!1}}function Cn(n,t){return n===t||(typeof n=="boolean"?!!t.capture===n&&!t.passive:!!n.capture==!!t.capture&&!!n.passive==!!t.passive)}var Rc={id:"events",install:function(n){var t,o=[],i={},c=[],f={add:d,remove:p,addDelegate:function(y,_,A,X,V){var K=Rt(V);if(!i[A]){i[A]=[];for(var se=0;se<c.length;se++){var ne=c[se];d(ne,A,v),d(ne,A,w,!0)}}var ue=i[A],ye=Pt(ue,function(we){return we.selector===y&&we.context===_});ye||(ye={selector:y,context:_,listeners:[]},ue.push(ye)),ye.listeners.push({func:X,options:K})},removeDelegate:function(y,_,A,X,V){var K,se=Rt(V),ne=i[A],ue=!1;if(ne)for(K=ne.length-1;K>=0;K--){var ye=ne[K];if(ye.selector===y&&ye.context===_){for(var we=ye.listeners,de=we.length-1;de>=0;de--){var be=we[de];if(be.func===X&&Cn(be.options,se)){we.splice(de,1),we.length||(ne.splice(K,1),p(_,A,v),p(_,A,w,!0)),ue=!0;break}}if(ue)break}}},delegateListener:v,delegateUseCapture:w,delegatedEvents:i,documents:c,targets:o,supportsOptions:!1,supportsPassive:!1};function d(y,_,A,X){if(y.addEventListener){var V=Rt(X),K=Pt(o,function(se){return se.eventTarget===y});K||(K={eventTarget:y,events:{}},o.push(K)),K.events[_]||(K.events[_]=[]),Pt(K.events[_],function(se){return se.func===A&&Cn(se.options,V)})||(y.addEventListener(_,A,f.supportsOptions?V:V.capture),K.events[_].push({func:A,options:V}))}}function p(y,_,A,X){if(y.addEventListener&&y.removeEventListener){var V=_t(o,function(je){return je.eventTarget===y}),K=o[V];if(K&&K.events)if(_!=="all"){var se=!1,ne=K.events[_];if(ne){if(A==="all"){for(var ue=ne.length-1;ue>=0;ue--){var ye=ne[ue];p(y,_,ye.func,ye.options)}return}for(var we=Rt(X),de=0;de<ne.length;de++){var be=ne[de];if(be.func===A&&Cn(be.options,we)){y.removeEventListener(_,A,f.supportsOptions?we:we.capture),ne.splice(de,1),ne.length===0&&(delete K.events[_],se=!0);break}}}se&&!Object.keys(K.events).length&&o.splice(V,1)}else for(_ in K.events)K.events.hasOwnProperty(_)&&p(y,_,"all")}}function v(y,_){for(var A=Rt(_),X=new Ic(y),V=i[y.type],K=Wo(y)[0],se=K;E.element(se);){for(var ne=0;ne<V.length;ne++){var ue=V[ne],ye=ue.selector,we=ue.context;if(C(se,ye)&&ee(we,K)&&ee(we,se)){var de=ue.listeners;X.currentTarget=se;for(var be=0;be<de.length;be++){var je=de[be];Cn(je.options,A)&&je.func(X)}}}se=H(se)}}function w(y){return v(y,!0)}return(t=n.document)==null||t.createElement("div").addEventListener("test",null,{get capture(){return f.supportsOptions=!0},get passive(){return f.supportsPassive=!0}}),n.events=f,f}},Tr={methodOrder:["simulationResume","mouseOrPen","hasPointer","idle"],search:function(n){for(var t=0,o=Tr.methodOrder;t<o.length;t++){var i=o[t],c=Tr[i](n);if(c)return c}return null},simulationResume:function(n){var t=n.pointerType,o=n.eventType,i=n.eventTarget,c=n.scope;if(!/down|start/i.test(o))return null;for(var f=0,d=c.interactions.list;f<d.length;f++){var p=d[f],v=i;if(p.simulation&&p.simulation.allowResume&&p.pointerType===t)for(;v;){if(v===p.element)return p;v=H(v)}}return null},mouseOrPen:function(n){var t,o=n.pointerId,i=n.pointerType,c=n.eventType,f=n.scope;if(i!=="mouse"&&i!=="pen")return null;for(var d=0,p=f.interactions.list;d<p.length;d++){var v=p[d];if(v.pointerType===i){if(v.simulation&&!wi(v,o))continue;if(v.interacting())return v;t||(t=v)}}if(t)return t;for(var w=0,y=f.interactions.list;w<y.length;w++){var _=y[w];if(!(_.pointerType!==i||/down/i.test(c)&&_.simulation))return _}return null},hasPointer:function(n){for(var t=n.pointerId,o=0,i=n.scope.interactions.list;o<i.length;o++){var c=i[o];if(wi(c,t))return c}return null},idle:function(n){for(var t=n.pointerType,o=0,i=n.scope.interactions.list;o<i.length;o++){var c=i[o];if(c.pointers.length===1){var f=c.interactable;if(f&&(!f.options.gesture||!f.options.gesture.enabled))continue}else if(c.pointers.length>=2)continue;if(!c.interacting()&&t===c.pointerType)return c}return null}};function wi(n,t){return n.pointers.some(function(o){return o.id===t})}var jc=Tr,Cr=["pointerDown","pointerMove","pointerUp","updatePointer","removePointer","windowBlur"];function Ei(n,t){return function(o){var i=t.interactions.list,c=Ko(o),f=Wo(o),d=f[0],p=f[1],v=[];if(/^touch/.test(o.type)){t.prevTouchTime=t.now();for(var w=0,y=o.changedTouches;w<y.length;w++){var _=y[w],A={pointer:_,pointerId:kt(_),pointerType:c,eventType:o.type,eventTarget:d,curEventTarget:p,scope:t},X=Ni(A);v.push([A.pointer,A.eventTarget,A.curEventTarget,X])}}else{var V=!1;if(!te.supportsPointerEvent&&/mouse/.test(o.type)){for(var K=0;K<i.length&&!V;K++)V=i[K].pointerType!=="mouse"&&i[K].pointerIsDown;V=V||t.now()-t.prevTouchTime<500||o.timeStamp===0}if(!V){var se={pointer:o,pointerId:kt(o),pointerType:c,eventType:o.type,curEventTarget:p,eventTarget:d,scope:t},ne=Ni(se);v.push([se.pointer,se.eventTarget,se.curEventTarget,ne])}}for(var ue=0;ue<v.length;ue++){var ye=v[ue],we=ye[0],de=ye[1],be=ye[2];ye[3][n](we,o,de,be)}}}function Ni(n){var t=n.pointerType,o=n.scope,i={interaction:jc.search(n),searchDetails:n};return o.fire("interactions:find",i),i.interaction||o.interactions.new({pointerType:t})}function kr(n,t){var o=n.doc,i=n.scope,c=n.options,f=i.interactions.docEvents,d=i.events,p=d[t];for(var v in i.browser.isIOS&&!c.events&&(c.events={passive:!1}),d.delegatedEvents)p(o,v,d.delegateListener),p(o,v,d.delegateUseCapture,!0);for(var w=c&&c.events,y=0;y<f.length;y++){var _=f[y];p(o,_.type,_.listener,w)}}var Ac={id:"core/interactions",install:function(n){for(var t={},o=0;o<Cr.length;o++){var i=Cr[o];t[i]=Ei(i,n)}var c,f=te.pEventTypes;function d(){for(var p=0,v=n.interactions.list;p<v.length;p++){var w=v[p];if(w.pointerIsDown&&w.pointerType==="touch"&&!w._interacting)for(var y=function(){var X=A[_];n.documents.some(function(V){return ee(V.doc,X.downTarget)})||w.removePointer(X.pointer,X.event)},_=0,A=w.pointers;_<A.length;_++)y()}}(c=D.PointerEvent?[{type:f.down,listener:d},{type:f.down,listener:t.pointerDown},{type:f.move,listener:t.pointerMove},{type:f.up,listener:t.pointerUp},{type:f.cancel,listener:t.pointerUp}]:[{type:"mousedown",listener:t.pointerDown},{type:"mousemove",listener:t.pointerMove},{type:"mouseup",listener:t.pointerUp},{type:"touchstart",listener:d},{type:"touchstart",listener:t.pointerDown},{type:"touchmove",listener:t.pointerMove},{type:"touchend",listener:t.pointerUp},{type:"touchcancel",listener:t.pointerUp}]).push({type:"blur",listener:function(p){for(var v=0,w=n.interactions.list;v<w.length;v++)w[v].documentBlur(p)}}),n.prevTouchTime=0,n.Interaction=function(p){S(w,p);var v=j(w);function w(){return u(this,w),v.apply(this,arguments)}return g(w,[{key:"pointerMoveTolerance",get:function(){return n.interactions.pointerMoveTolerance},set:function(y){n.interactions.pointerMoveTolerance=y}},{key:"_now",value:function(){return n.now()}}]),w}(Tc),n.interactions={list:[],new:function(p){p.scopeFire=function(w,y){return n.fire(w,y)};var v=new n.Interaction(p);return n.interactions.list.push(v),v},listeners:t,docEvents:c,pointerMoveTolerance:1},n.usePlugin(ui)},listeners:{"scope:add-document":function(n){return kr(n,"add")},"scope:remove-document":function(n){return kr(n,"remove")},"interactable:unset":function(n,t){for(var o=n.interactable,i=t.interactions.list.length-1;i>=0;i--){var c=t.interactions.list[i];c.interactable===o&&(c.stop(),t.fire("interactions:destroy",{interaction:c}),c.destroy(),t.interactions.list.length>2&&t.interactions.list.splice(i,1))}}},onDocSignal:kr,doOnInteractions:Ei,methodNames:Cr},Mc=Ac,$e=function(n){return n[n.On=0]="On",n[n.Off=1]="Off",n}($e||{}),zc=function(){function n(t,o,i,c){u(this,n),this.target=void 0,this.options=void 0,this._actions=void 0,this.events=new xi,this._context=void 0,this._win=void 0,this._doc=void 0,this._scopeEvents=void 0,this._actions=o.actions,this.target=t,this._context=o.context||i,this._win=G(xe(t)?this._context:t),this._doc=this._win.document,this._scopeEvents=c,this.set(o)}return g(n,[{key:"_defaults",get:function(){return{base:{},perAction:{},actions:{}}}},{key:"setOnEvents",value:function(t,o){return E.func(o.onstart)&&this.on("".concat(t,"start"),o.onstart),E.func(o.onmove)&&this.on("".concat(t,"move"),o.onmove),E.func(o.onend)&&this.on("".concat(t,"end"),o.onend),E.func(o.oninertiastart)&&this.on("".concat(t,"inertiastart"),o.oninertiastart),this}},{key:"updatePerActionListeners",value:function(t,o,i){var c,f=this,d=(c=this._actions.map[t])==null?void 0:c.filterEventType,p=function(v){return(d==null||d(v))&&Nn(v,f._actions)};(E.array(o)||E.object(o))&&this._onOff($e.Off,t,o,void 0,p),(E.array(i)||E.object(i))&&this._onOff($e.On,t,i,void 0,p)}},{key:"setPerAction",value:function(t,o){var i=this._defaults;for(var c in o){var f=c,d=this.options[t],p=o[f];f==="listeners"&&this.updatePerActionListeners(t,d.listeners,p),E.array(p)?d[f]=Zo(p):E.plainObject(p)?(d[f]=J(d[f]||{},ft(p)),E.object(i.perAction[f])&&"enabled"in i.perAction[f]&&(d[f].enabled=p.enabled!==!1)):E.bool(p)&&E.object(i.perAction[f])?d[f].enabled=p:d[f]=p}}},{key:"getRect",value:function(t){return t=t||(E.element(this.target)?this.target:null),E.string(this.target)&&(t=t||this._context.querySelector(this.target)),Ee(t)}},{key:"rectChecker",value:function(t){var o=this;return E.func(t)?(this.getRect=function(i){var c=J({},t.apply(o,i));return"width"in c||(c.width=c.right-c.left,c.height=c.bottom-c.top),c},this):t===null?(delete this.getRect,this):this.getRect}},{key:"_backCompatOption",value:function(t,o){if(xe(o)||E.object(o)){for(var i in this.options[t]=o,this._actions.map)this.options[i][t]=o;return this}return this.options[t]}},{key:"origin",value:function(t){return this._backCompatOption("origin",t)}},{key:"deltaSource",value:function(t){return t==="page"||t==="client"?(this.options.deltaSource=t,this):this.options.deltaSource}},{key:"getAllElements",value:function(){var t=this.target;return E.string(t)?Array.from(this._context.querySelectorAll(t)):E.func(t)&&t.getAllElements?t.getAllElements():E.element(t)?[t]:[]}},{key:"context",value:function(){return this._context}},{key:"inContext",value:function(t){return this._context===t.ownerDocument||ee(this._context,t)}},{key:"testIgnoreAllow",value:function(t,o,i){return!this.testIgnore(t.ignoreFrom,o,i)&&this.testAllow(t.allowFrom,o,i)}},{key:"testAllow",value:function(t,o,i){return!t||!!E.element(i)&&(E.string(t)?ie(i,t,o):!!E.element(t)&&ee(t,i))}},{key:"testIgnore",value:function(t,o,i){return!(!t||!E.element(i))&&(E.string(t)?ie(i,t,o):!!E.element(t)&&ee(t,i))}},{key:"fire",value:function(t){return this.events.fire(t),this}},{key:"_onOff",value:function(t,o,i,c,f){E.object(o)&&!E.array(o)&&(c=i,i=null);var d=Ye(o,i,f);for(var p in d){p==="wheel"&&(p=te.wheelEvent);for(var v=0,w=d[p];v<w.length;v++){var y=w[v];Nn(p,this._actions)?this.events[t===$e.On?"on":"off"](p,y):E.string(this.target)?this._scopeEvents[t===$e.On?"addDelegate":"removeDelegate"](this.target,this._context,p,y,c):this._scopeEvents[t===$e.On?"add":"remove"](this.target,p,y,c)}}return this}},{key:"on",value:function(t,o,i){return this._onOff($e.On,t,o,i)}},{key:"off",value:function(t,o,i){return this._onOff($e.Off,t,o,i)}},{key:"set",value:function(t){var o=this._defaults;for(var i in E.object(t)||(t={}),this.options=ft(o.base),this._actions.methodDict){var c=i,f=this._actions.methodDict[c];this.options[c]={},this.setPerAction(c,J(J({},o.perAction),o.actions[c])),this[f](t[c])}for(var d in t)d!=="getRect"?E.func(this[d])&&this[d](t[d]):this.rectChecker(t.getRect);return this}},{key:"unset",value:function(){if(E.string(this.target))for(var t in this._scopeEvents.delegatedEvents)for(var o=this._scopeEvents.delegatedEvents[t],i=o.length-1;i>=0;i--){var c=o[i],f=c.selector,d=c.context,p=c.listeners;f===this.target&&d===this._context&&o.splice(i,1);for(var v=p.length-1;v>=0;v--)this._scopeEvents.removeDelegate(this.target,this._context,t,p[v][0],p[v][1])}else this._scopeEvents.remove(this.target,"all")}}]),n}(),Lc=function(){function n(t){var o=this;u(this,n),this.list=[],this.selectorMap={},this.scope=void 0,this.scope=t,t.addListeners({"interactable:unset":function(i){var c=i.interactable,f=c.target,d=E.string(f)?o.selectorMap[f]:f[o.scope.id],p=_t(d,function(v){return v===c});d.splice(p,1)}})}return g(n,[{key:"new",value:function(t,o){o=J(o||{},{actions:this.scope.actions});var i=new this.scope.Interactable(t,o,this.scope.document,this.scope.events);return this.scope.addDocument(i._doc),this.list.push(i),E.string(t)?(this.selectorMap[t]||(this.selectorMap[t]=[]),this.selectorMap[t].push(i)):(i.target[this.scope.id]||Object.defineProperty(t,this.scope.id,{value:[],configurable:!0}),t[this.scope.id].push(i)),this.scope.fire("interactable:new",{target:t,options:o,interactable:i,win:this.scope._win}),i}},{key:"getExisting",value:function(t,o){var i=o&&o.context||this.scope.document,c=E.string(t),f=c?this.selectorMap[t]:t[this.scope.id];if(f)return Pt(f,function(d){return d._context===i&&(c||d.inContext(t))})}},{key:"forEachMatch",value:function(t,o){for(var i=0,c=this.list;i<c.length;i++){var f=c[i],d=void 0;if((E.string(f.target)?E.element(t)&&C(t,f.target):t===f.target)&&f.inContext(t)&&(d=o(f)),d!==void 0)return d}}}]),n}(),Fc=function(){function n(){var t=this;u(this,n),this.id="__interact_scope_".concat(Math.floor(100*Math.random())),this.isInitialized=!1,this.listenerMaps=[],this.browser=te,this.defaults=ft(di),this.Eventable=xi,this.actions={map:{},phases:{start:!0,move:!0,end:!0},methodDict:{},phaselessTypes:{}},this.interactStatic=function(i){var c=function f(d,p){var v=i.interactables.getExisting(d,p);return v||((v=i.interactables.new(d,p)).events.global=f.globalEvents),v};return c.getPointerAverage=Go,c.getTouchBBox=ur,c.getTouchDistance=fr,c.getTouchAngle=dr,c.getElementRect=Ee,c.getElementClientRect=ve,c.matchesSelector=C,c.closest=ce,c.globalEvents={},c.version="1.10.27",c.scope=i,c.use=function(f,d){return this.scope.usePlugin(f,d),this},c.isSet=function(f,d){return!!this.scope.interactables.get(f,d&&d.context)},c.on=Ot(function(f,d,p){if(E.string(f)&&f.search(" ")!==-1&&(f=f.trim().split(/ +/)),E.array(f)){for(var v=0,w=f;v<w.length;v++){var y=w[v];this.on(y,d,p)}return this}if(E.object(f)){for(var _ in f)this.on(_,f[_],d);return this}return Nn(f,this.scope.actions)?this.globalEvents[f]?this.globalEvents[f].push(d):this.globalEvents[f]=[d]:this.scope.events.add(this.scope.document,f,d,{options:p}),this},"The interact.on() method is being deprecated"),c.off=Ot(function(f,d,p){if(E.string(f)&&f.search(" ")!==-1&&(f=f.trim().split(/ +/)),E.array(f)){for(var v=0,w=f;v<w.length;v++){var y=w[v];this.off(y,d,p)}return this}if(E.object(f)){for(var _ in f)this.off(_,f[_],d);return this}var A;return Nn(f,this.scope.actions)?f in this.globalEvents&&(A=this.globalEvents[f].indexOf(d))!==-1&&this.globalEvents[f].splice(A,1):this.scope.events.remove(this.scope.document,f,d,p),this},"The interact.off() method is being deprecated"),c.debug=function(){return this.scope},c.supportsTouch=function(){return te.supportsTouch},c.supportsPointerEvent=function(){return te.supportsPointerEvent},c.stop=function(){for(var f=0,d=this.scope.interactions.list;f<d.length;f++)d[f].stop();return this},c.pointerMoveTolerance=function(f){return E.number(f)?(this.scope.interactions.pointerMoveTolerance=f,this):this.scope.interactions.pointerMoveTolerance},c.addDocument=function(f,d){this.scope.addDocument(f,d)},c.removeDocument=function(f){this.scope.removeDocument(f)},c}(this),this.InteractEvent=Nr,this.Interactable=void 0,this.interactables=new Lc(this),this._win=void 0,this.document=void 0,this.window=void 0,this.documents=[],this._plugins={list:[],map:{}},this.onWindowUnload=function(i){return t.removeDocument(i.target)};var o=this;this.Interactable=function(i){S(f,i);var c=j(f);function f(){return u(this,f),c.apply(this,arguments)}return g(f,[{key:"_defaults",get:function(){return o.defaults}},{key:"set",value:function(d){return L(k(f.prototype),"set",this).call(this,d),o.fire("interactable:set",{options:d,interactable:this}),this}},{key:"unset",value:function(){L(k(f.prototype),"unset",this).call(this);var d=o.interactables.list.indexOf(this);d<0||(o.interactables.list.splice(d,1),o.fire("interactable:unset",{interactable:this}))}}]),f}(zc)}return g(n,[{key:"addListeners",value:function(t,o){this.listenerMaps.push({id:o,map:t})}},{key:"fire",value:function(t,o){for(var i=0,c=this.listenerMaps;i<c.length;i++){var f=c[i].map[t];if(f&&f(o,this,t)===!1)return!1}}},{key:"init",value:function(t){return this.isInitialized?this:function(o,i){return o.isInitialized=!0,E.window(i)&&B(i),D.init(i),te.init(i),Ze.init(i),o.window=i,o.document=i.document,o.usePlugin(Mc),o.usePlugin(Rc),o}(this,t)}},{key:"pluginIsInstalled",value:function(t){var o=t.id;return o?!!this._plugins.map[o]:this._plugins.list.indexOf(t)!==-1}},{key:"usePlugin",value:function(t,o){if(!this.isInitialized)return this;if(this.pluginIsInstalled(t))return this;if(t.id&&(this._plugins.map[t.id]=t),this._plugins.list.push(t),t.install&&t.install(this,o),t.listeners&&t.before){for(var i=0,c=this.listenerMaps.length,f=t.before.reduce(function(p,v){return p[v]=!0,p[Si(v)]=!0,p},{});i<c;i++){var d=this.listenerMaps[i].id;if(d&&(f[d]||f[Si(d)]))break}this.listenerMaps.splice(i,0,{id:t.id,map:t.listeners})}else t.listeners&&this.listenerMaps.push({id:t.id,map:t.listeners});return this}},{key:"addDocument",value:function(t,o){if(this.getDocIndex(t)!==-1)return!1;var i=G(t);o=o?J({},o):{},this.documents.push({doc:t,options:o}),this.events.documents.push(t),t!==this.document&&this.events.add(i,"unload",this.onWindowUnload),this.fire("scope:add-document",{doc:t,window:i,scope:this,options:o})}},{key:"removeDocument",value:function(t){var o=this.getDocIndex(t),i=G(t),c=this.documents[o].options;this.events.remove(i,"unload",this.onWindowUnload),this.documents.splice(o,1),this.events.documents.splice(o,1),this.fire("scope:remove-document",{doc:t,window:i,scope:this,options:c})}},{key:"getDocIndex",value:function(t){for(var o=0;o<this.documents.length;o++)if(this.documents[o].doc===t)return o;return-1}},{key:"getDocOptions",value:function(t){var o=this.getDocIndex(t);return o===-1?null:this.documents[o].options}},{key:"now",value:function(){return(this.window.Date||Date).now()}}]),n}();function Si(n){return n&&n.replace(/\/.*$/,"")}var Ti=new Fc,Re=Ti.interactStatic,Dc=typeof globalThis<"u"?globalThis:window;Ti.init(Dc);var Vc=Object.freeze({__proto__:null,edgeTarget:function(){},elements:function(){},grid:function(n){var t=[["x","y"],["left","top"],["right","bottom"],["width","height"]].filter(function(i){var c=i[0],f=i[1];return c in n||f in n}),o=function(i,c){for(var f=n.range,d=n.limits,p=d===void 0?{left:-1/0,right:1/0,top:-1/0,bottom:1/0}:d,v=n.offset,w=v===void 0?{x:0,y:0}:v,y={range:f,grid:n,x:null,y:null},_=0;_<t.length;_++){var A=t[_],X=A[0],V=A[1],K=Math.round((i-w.x)/n[X]),se=Math.round((c-w.y)/n[V]);y[X]=Math.max(p.left,Math.min(p.right,K*n[X]+w.x)),y[V]=Math.max(p.top,Math.min(p.bottom,se*n[V]+w.y))}return y};return o.grid=n,o.coordFields=t,o}}),Bc={id:"snappers",install:function(n){var t=n.interactStatic;t.snappers=J(t.snappers||{},Vc),t.createSnapGrid=t.snappers.grid}},Hc=Bc,Yc={start:function(n){var t=n.state,o=n.rect,i=n.edges,c=n.pageCoords,f=t.options,d=f.ratio,p=f.enabled,v=t.options,w=v.equalDelta,y=v.modifiers;d==="preserve"&&(d=o.width/o.height),t.startCoords=J({},c),t.startRect=J({},o),t.ratio=d,t.equalDelta=w;var _=t.linkedEdges={top:i.top||i.left&&!i.bottom,left:i.left||i.top&&!i.right,bottom:i.bottom||i.right&&!i.top,right:i.right||i.bottom&&!i.left};if(t.xIsPrimaryAxis=!(!i.left&&!i.right),t.equalDelta){var A=(_.left?1:-1)*(_.top?1:-1);t.edgeSign={x:A,y:A}}else t.edgeSign={x:_.left?-1:1,y:_.top?-1:1};if(p!==!1&&J(i,_),y!=null&&y.length){var X=new Er(n.interaction);X.copyFrom(n.interaction.modification),X.prepareStates(y),t.subModification=X,X.startAll(a({},n))}},set:function(n){var t=n.state,o=n.rect,i=n.coords,c=t.linkedEdges,f=J({},i),d=t.equalDelta?Xc:Uc;if(J(n.edges,c),d(t,t.xIsPrimaryAxis,i,o),!t.subModification)return null;var p=J({},o);Ae(c,p,{x:i.x-f.x,y:i.y-f.y});var v=t.subModification.setAll(a(a({},n),{},{rect:p,edges:c,pageCoords:i,prevCoords:i,prevRect:p})),w=v.delta;return v.changed&&(d(t,Math.abs(w.x)>Math.abs(w.y),v.coords,v.rect),J(i,v.coords)),v.eventProps},defaults:{ratio:"preserve",equalDelta:!1,modifiers:[],enabled:!1}};function Xc(n,t,o){var i=n.startCoords,c=n.edgeSign;t?o.y=i.y+(o.x-i.x)*c.y:o.x=i.x+(o.y-i.y)*c.x}function Uc(n,t,o,i){var c=n.startRect,f=n.startCoords,d=n.ratio,p=n.edgeSign;if(t){var v=i.width/d;o.y=f.y+(v-c.height)*p.y}else{var w=i.height*d;o.x=f.x+(w-c.width)*p.x}}var Gc=Qe(Yc,"aspectRatio"),Ci=function(){};Ci._defaults={};var kn=Ci;function it(n,t,o){return E.func(n)?_e(n,t.interactable,t.element,[o.x,o.y,t]):_e(n,t.interactable,t.element)}var _n={start:function(n){var t=n.rect,o=n.startOffset,i=n.state,c=n.interaction,f=n.pageCoords,d=i.options,p=d.elementRect,v=J({left:0,top:0,right:0,bottom:0},d.offset||{});if(t&&p){var w=it(d.restriction,c,f);if(w){var y=w.right-w.left-t.width,_=w.bottom-w.top-t.height;y<0&&(v.left+=y,v.right+=y),_<0&&(v.top+=_,v.bottom+=_)}v.left+=o.left-t.width*p.left,v.top+=o.top-t.height*p.top,v.right+=o.right-t.width*(1-p.right),v.bottom+=o.bottom-t.height*(1-p.bottom)}i.offset=v},set:function(n){var t=n.coords,o=n.interaction,i=n.state,c=i.options,f=i.offset,d=it(c.restriction,o,t);if(d){var p=function(v){return!v||"left"in v&&"top"in v||((v=J({},v)).left=v.x||0,v.top=v.y||0,v.right=v.right||v.left+v.width,v.bottom=v.bottom||v.top+v.height),v}(d);t.x=Math.max(Math.min(p.right-f.right,t.x),p.left+f.left),t.y=Math.max(Math.min(p.bottom-f.bottom,t.y),p.top+f.top)}},defaults:{restriction:null,elementRect:null,offset:null,endOnly:!1,enabled:!1}},Kc=Qe(_n,"restrict"),ki={top:1/0,left:1/0,bottom:-1/0,right:-1/0},_i={top:-1/0,left:-1/0,bottom:1/0,right:1/0};function Pi(n,t){for(var o=0,i=["top","left","bottom","right"];o<i.length;o++){var c=i[o];c in n||(n[c]=t[c])}return n}var jt={noInner:ki,noOuter:_i,start:function(n){var t,o=n.interaction,i=n.startOffset,c=n.state,f=c.options;f&&(t=ke(it(f.offset,o,o.coords.start.page))),t=t||{x:0,y:0},c.offset={top:t.y+i.top,left:t.x+i.left,bottom:t.y-i.bottom,right:t.x-i.right}},set:function(n){var t=n.coords,o=n.edges,i=n.interaction,c=n.state,f=c.offset,d=c.options;if(o){var p=J({},t),v=it(d.inner,i,p)||{},w=it(d.outer,i,p)||{};Pi(v,ki),Pi(w,_i),o.top?t.y=Math.min(Math.max(w.top+f.top,p.y),v.top+f.top):o.bottom&&(t.y=Math.max(Math.min(w.bottom+f.bottom,p.y),v.bottom+f.bottom)),o.left?t.x=Math.min(Math.max(w.left+f.left,p.x),v.left+f.left):o.right&&(t.x=Math.max(Math.min(w.right+f.right,p.x),v.right+f.right))}},defaults:{inner:null,outer:null,offset:null,endOnly:!1,enabled:!1}},Wc=Qe(jt,"restrictEdges"),Jc=J({get elementRect(){return{top:0,left:0,bottom:1,right:1}},set elementRect(n){}},_n.defaults),Zc=Qe({start:_n.start,set:_n.set,defaults:Jc},"restrictRect"),Qc={width:-1/0,height:-1/0},$c={width:1/0,height:1/0},qc=Qe({start:function(n){return jt.start(n)},set:function(n){var t=n.interaction,o=n.state,i=n.rect,c=n.edges,f=o.options;if(c){var d=De(it(f.min,t,n.coords))||Qc,p=De(it(f.max,t,n.coords))||$c;o.options={endOnly:f.endOnly,inner:J({},jt.noInner),outer:J({},jt.noOuter)},c.top?(o.options.inner.top=i.bottom-d.height,o.options.outer.top=i.bottom-p.height):c.bottom&&(o.options.inner.bottom=i.top+d.height,o.options.outer.bottom=i.top+p.height),c.left?(o.options.inner.left=i.right-d.width,o.options.outer.left=i.right-p.width):c.right&&(o.options.inner.right=i.left+d.width,o.options.outer.right=i.left+p.width),jt.set(n),o.options=f}},defaults:{min:null,max:null,endOnly:!1,enabled:!1}},"restrictSize"),_r={start:function(n){var t,o=n.interaction,i=n.interactable,c=n.element,f=n.rect,d=n.state,p=n.startOffset,v=d.options,w=v.offsetWithOrigin?function(A){var X=A.interaction.element,V=ke(_e(A.state.options.origin,null,null,[X])),K=V||He(A.interactable,X,A.interaction.prepared.name);return K}(n):{x:0,y:0};if(v.offset==="startCoords")t={x:o.coords.start.page.x,y:o.coords.start.page.y};else{var y=_e(v.offset,i,c,[o]);(t=ke(y)||{x:0,y:0}).x+=w.x,t.y+=w.y}var _=v.relativePoints;d.offsets=f&&_&&_.length?_.map(function(A,X){return{index:X,relativePoint:A,x:p.left-f.width*A.x+t.x,y:p.top-f.height*A.y+t.y}}):[{index:0,relativePoint:null,x:t.x,y:t.y}]},set:function(n){var t=n.interaction,o=n.coords,i=n.state,c=i.options,f=i.offsets,d=He(t.interactable,t.element,t.prepared.name),p=J({},o),v=[];c.offsetWithOrigin||(p.x-=d.x,p.y-=d.y);for(var w=0,y=f;w<y.length;w++)for(var _=y[w],A=p.x-_.x,X=p.y-_.y,V=0,K=c.targets.length;V<K;V++){var se=c.targets[V],ne=void 0;(ne=E.func(se)?se(A,X,t._proxy,_,V):se)&&v.push({x:(E.number(ne.x)?ne.x:A)+_.x,y:(E.number(ne.y)?ne.y:X)+_.y,range:E.number(ne.range)?ne.range:c.range,source:se,index:V,offset:_})}for(var ue={target:null,inRange:!1,distance:0,range:0,delta:{x:0,y:0}},ye=0;ye<v.length;ye++){var we=v[ye],de=we.range,be=we.x-p.x,je=we.y-p.y,Te=Ct(be,je),Me=Te<=de;de===1/0&&ue.inRange&&ue.range!==1/0&&(Me=!1),ue.target&&!(Me?ue.inRange&&de!==1/0?Te/de<ue.distance/ue.range:de===1/0&&ue.range!==1/0||Te<ue.distance:!ue.inRange&&Te<ue.distance)||(ue.target=we,ue.distance=Te,ue.range=de,ue.inRange=Me,ue.delta.x=be,ue.delta.y=je)}return ue.inRange&&(o.x=ue.target.x,o.y=ue.target.y),i.closest=ue,ue},defaults:{range:1/0,targets:null,offset:null,offsetWithOrigin:!0,origin:null,relativePoints:null,endOnly:!1,enabled:!1}},el=Qe(_r,"snap"),Pn={start:function(n){var t=n.state,o=n.edges,i=t.options;if(!o)return null;n.state={options:{targets:null,relativePoints:[{x:o.left?0:1,y:o.top?0:1}],offset:i.offset||"self",origin:{x:0,y:0},range:i.range}},t.targetFields=t.targetFields||[["width","height"],["x","y"]],_r.start(n),t.offsets=n.state.offsets,n.state=t},set:function(n){var t=n.interaction,o=n.state,i=n.coords,c=o.options,f=o.offsets,d={x:i.x-f[0].x,y:i.y-f[0].y};o.options=J({},c),o.options.targets=[];for(var p=0,v=c.targets||[];p<v.length;p++){var w=v[p],y=void 0;if(y=E.func(w)?w(d.x,d.y,t):w){for(var _=0,A=o.targetFields;_<A.length;_++){var X=A[_],V=X[0],K=X[1];if(V in y||K in y){y.x=y[V],y.y=y[K];break}}o.options.targets.push(y)}}var se=_r.set(n);return o.options=c,se},defaults:{range:1/0,targets:null,offset:null,endOnly:!1,enabled:!1}},tl=Qe(Pn,"snapSize"),Pr={aspectRatio:Gc,restrictEdges:Wc,restrict:Kc,restrictRect:Zc,restrictSize:qc,snapEdges:Qe({start:function(n){var t=n.edges;return t?(n.state.targetFields=n.state.targetFields||[[t.left?"left":"right",t.top?"top":"bottom"]],Pn.start(n)):null},set:Pn.set,defaults:J(ft(Pn.defaults),{targets:void 0,range:void 0,offset:{x:0,y:0}})},"snapEdges"),snap:el,snapSize:tl,spring:kn,avoid:kn,transform:kn,rubberband:kn},nl={id:"modifiers",install:function(n){var t=n.interactStatic;for(var o in n.usePlugin(fi),n.usePlugin(Hc),t.modifiers=Pr,Pr){var i=Pr[o],c=i._defaults,f=i._methods;c._methods=f,n.defaults.perAction[o]=c}}},rl=nl,Oi=function(n){S(o,n);var t=j(o);function o(i,c,f,d,p,v){var w;if(u(this,o),yn(O(w=t.call(this,p)),f),f!==c&&yn(O(w),c),w.timeStamp=v,w.originalEvent=f,w.type=i,w.pointerId=kt(c),w.pointerType=Ko(c),w.target=d,w.currentTarget=null,i==="tap"){var y=p.getPointerIndex(c);w.dt=w.timeStamp-p.pointers[y].downTime;var _=w.timeStamp-p.tapTime;w.double=!!p.prevTap&&p.prevTap.type!=="doubletap"&&p.prevTap.target===w.target&&_<500}else i==="doubletap"&&(w.dt=c.timeStamp-p.tapTime,w.double=!0);return w}return g(o,[{key:"_subtractOrigin",value:function(i){var c=i.x,f=i.y;return this.pageX-=c,this.pageY-=f,this.clientX-=c,this.clientY-=f,this}},{key:"_addOrigin",value:function(i){var c=i.x,f=i.y;return this.pageX+=c,this.pageY+=f,this.clientX+=c,this.clientY+=f,this}},{key:"preventDefault",value:function(){this.originalEvent.preventDefault()}}]),o}(wn),At={id:"pointer-events/base",before:["inertia","modifiers","auto-start","actions"],install:function(n){n.pointerEvents=At,n.defaults.actions.pointerEvents=At.defaults,J(n.actions.phaselessTypes,At.types)},listeners:{"interactions:new":function(n){var t=n.interaction;t.prevTap=null,t.tapTime=0},"interactions:update-pointer":function(n){var t=n.down,o=n.pointerInfo;!t&&o.hold||(o.hold={duration:1/0,timeout:null})},"interactions:move":function(n,t){var o=n.interaction,i=n.pointer,c=n.event,f=n.eventTarget;n.duplicate||o.pointerIsDown&&!o.pointerWasMoved||(o.pointerIsDown&&Or(n),qe({interaction:o,pointer:i,event:c,eventTarget:f,type:"move"},t))},"interactions:down":function(n,t){(function(o,i){for(var c=o.interaction,f=o.pointer,d=o.event,p=o.eventTarget,v=o.pointerIndex,w=c.pointers[v].hold,y=Se(p),_={interaction:c,pointer:f,event:d,eventTarget:p,type:"hold",targets:[],path:y,node:null},A=0;A<y.length;A++){var X=y[A];_.node=X,i.fire("pointerEvents:collect-targets",_)}if(_.targets.length){for(var V=1/0,K=0,se=_.targets;K<se.length;K++){var ne=se[K].eventable.options.holdDuration;ne<V&&(V=ne)}w.duration=V,w.timeout=setTimeout(function(){qe({interaction:c,eventTarget:p,pointer:f,event:d,type:"hold"},i)},V)}})(n,t),qe(n,t)},"interactions:up":function(n,t){Or(n),qe(n,t),function(o,i){var c=o.interaction,f=o.pointer,d=o.event,p=o.eventTarget;c.pointerWasMoved||qe({interaction:c,eventTarget:p,pointer:f,event:d,type:"tap"},i)}(n,t)},"interactions:cancel":function(n,t){Or(n),qe(n,t)}},PointerEvent:Oi,fire:qe,collectEventTargets:Ii,defaults:{holdDuration:600,ignoreFrom:null,allowFrom:null,origin:{x:0,y:0}},types:{down:!0,move:!0,up:!0,cancel:!0,tap:!0,doubletap:!0,hold:!0}};function qe(n,t){var o=n.interaction,i=n.pointer,c=n.event,f=n.eventTarget,d=n.type,p=n.targets,v=p===void 0?Ii(n,t):p,w=new Oi(d,i,c,f,o,t.now());t.fire("pointerEvents:new",{pointerEvent:w});for(var y={interaction:o,pointer:i,event:c,eventTarget:f,targets:v,type:d,pointerEvent:w},_=0;_<v.length;_++){var A=v[_];for(var X in A.props||{})w[X]=A.props[X];var V=He(A.eventable,A.node);if(w._subtractOrigin(V),w.eventable=A.eventable,w.currentTarget=A.node,A.eventable.fire(w),w._addOrigin(V),w.immediatePropagationStopped||w.propagationStopped&&_+1<v.length&&v[_+1].node!==w.currentTarget)break}if(t.fire("pointerEvents:fired",y),d==="tap"){var K=w.double?qe({interaction:o,pointer:i,event:c,eventTarget:f,type:"doubletap"},t):w;o.prevTap=K,o.tapTime=K.timeStamp}return w}function Ii(n,t){var o=n.interaction,i=n.pointer,c=n.event,f=n.eventTarget,d=n.type,p=o.getPointerIndex(i),v=o.pointers[p];if(d==="tap"&&(o.pointerWasMoved||!v||v.downTarget!==f))return[];for(var w=Se(f),y={interaction:o,pointer:i,event:c,eventTarget:f,type:d,path:w,targets:[],node:null},_=0;_<w.length;_++){var A=w[_];y.node=A,t.fire("pointerEvents:collect-targets",y)}return d==="hold"&&(y.targets=y.targets.filter(function(X){var V,K;return X.eventable.options.holdDuration===((V=o.pointers[p])==null||(K=V.hold)==null?void 0:K.duration)})),y.targets}function Or(n){var t=n.interaction,o=n.pointerIndex,i=t.pointers[o].hold;i&&i.timeout&&(clearTimeout(i.timeout),i.timeout=null)}var ol=Object.freeze({__proto__:null,default:At});function il(n){var t=n.interaction;t.holdIntervalHandle&&(clearInterval(t.holdIntervalHandle),t.holdIntervalHandle=null)}var sl={id:"pointer-events/holdRepeat",install:function(n){n.usePlugin(At);var t=n.pointerEvents;t.defaults.holdRepeatInterval=0,t.types.holdrepeat=n.actions.phaselessTypes.holdrepeat=!0},listeners:["move","up","cancel","endall"].reduce(function(n,t){return n["pointerEvents:".concat(t)]=il,n},{"pointerEvents:new":function(n){var t=n.pointerEvent;t.type==="hold"&&(t.count=(t.count||0)+1)},"pointerEvents:fired":function(n,t){var o=n.interaction,i=n.pointerEvent,c=n.eventTarget,f=n.targets;if(i.type==="hold"&&f.length){var d=f[0].eventable.options.holdRepeatInterval;d<=0||(o.holdIntervalHandle=setTimeout(function(){t.pointerEvents.fire({interaction:o,eventTarget:c,type:"hold",pointer:i,event:i},t)},d))}}})},al=sl,cl={id:"pointer-events/interactableTargets",install:function(n){var t=n.Interactable;t.prototype.pointerEvents=function(i){return J(this.events.options,i),this};var o=t.prototype._backCompatOption;t.prototype._backCompatOption=function(i,c){var f=o.call(this,i,c);return f===this&&(this.events.options[i]=c),f}},listeners:{"pointerEvents:collect-targets":function(n,t){var o=n.targets,i=n.node,c=n.type,f=n.eventTarget;t.interactables.forEachMatch(i,function(d){var p=d.events,v=p.options;p.types[c]&&p.types[c].length&&d.testIgnoreAllow(v,i,f)&&o.push({node:i,eventable:p,props:{interactable:d}})})},"interactable:new":function(n){var t=n.interactable;t.events.getRect=function(o){return t.getRect(o)}},"interactable:set":function(n,t){var o=n.interactable,i=n.options;J(o.events.options,t.pointerEvents.defaults),J(o.events.options,i.pointerEvents||{})}}},ll=cl,ul={id:"pointer-events",install:function(n){n.usePlugin(ol),n.usePlugin(al),n.usePlugin(ll)}},fl=ul,dl={id:"reflow",install:function(n){var t=n.Interactable;n.actions.phases.reflow=!0,t.prototype.reflow=function(o){return function(i,c,f){for(var d=i.getAllElements(),p=f.window.Promise,v=p?[]:null,w=function(){var _=d[y],A=i.getRect(_);if(!A)return 1;var X,V=Pt(f.interactions.list,function(ne){return ne.interacting()&&ne.interactable===i&&ne.element===_&&ne.prepared.name===c.name});if(V)V.move(),v&&(X=V._reflowPromise||new p(function(ne){V._reflowResolve=ne}));else{var K=De(A),se=function(ne){return{coords:ne,get page(){return this.coords.page},get client(){return this.coords.client},get timeStamp(){return this.coords.timeStamp},get pageX(){return this.coords.page.x},get pageY(){return this.coords.page.y},get clientX(){return this.coords.client.x},get clientY(){return this.coords.client.y},get pointerId(){return this.coords.pointerId},get target(){return this.coords.target},get type(){return this.coords.type},get pointerType(){return this.coords.pointerType},get buttons(){return this.coords.buttons},preventDefault:function(){}}}({page:{x:K.x,y:K.y},client:{x:K.x,y:K.y},timeStamp:f.now()});X=function(ne,ue,ye,we,de){var be=ne.interactions.new({pointerType:"reflow"}),je={interaction:be,event:de,pointer:de,eventTarget:ye,phase:"reflow"};be.interactable=ue,be.element=ye,be.prevEvent=de,be.updatePointer(de,de,ye,!0),Yo(be.coords.delta),yr(be.prepared,we),be._doPhase(je);var Te=ne.window,Me=Te.Promise,Le=Me?new Me(function(Ge){be._reflowResolve=Ge}):void 0;return be._reflowPromise=Le,be.start(we,ue,ye),be._interacting?(be.move(je),be.end(de)):(be.stop(),be._reflowResolve()),be.removePointer(de,de),Le}(f,i,_,c,se)}v&&v.push(X)},y=0;y<d.length&&!w();y++);return v&&p.all(v).then(function(){return i})}(this,o,n)}},listeners:{"interactions:stop":function(n,t){var o=n.interaction;o.pointerType==="reflow"&&(o._reflowResolve&&o._reflowResolve(),function(i,c){i.splice(i.indexOf(c),1)}(t.interactions.list,o))}}},hl=dl;if(Re.use(ui),Re.use(mi),Re.use(fl),Re.use(Oc),Re.use(rl),Re.use(yc),Re.use(ac),Re.use(lc),Re.use(hl),Re.default=Re,l(e)==="object"&&e)try{e.exports=Re}catch{}return Re.default=Re,Re})}(tn)),tn.exports}var ma=ga();const va=Ir(ma);function Fe(e){return e==null?"":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):typeof e=="function"?e.toString():e instanceof Date?e.toISOString():e instanceof RegExp?e.toString():e instanceof Map?JSON.stringify(Array.from(e.entries())):e instanceof Set?JSON.stringify(Array.from(e.values())):e instanceof WeakMap||e instanceof WeakSet?"":e instanceof ArrayBuffer?e.toString():Array.isArray(e)?JSON.stringify(e.map(Fe)):typeof e=="object"?JSON.stringify(Object.entries(e).sort(([r],[s])=>r.localeCompare(s))):""}function Eo(e,{isEnabled:r=!0,onDragStart:s,onDragMove:a,onDragEnd:l,...u}){const h=Ne(s),g=Ne(a),m=Ne(l);N.useLayoutEffect(()=>{if(!r)return;const S=e.current;if(!S)return;const k=va(S).draggable({inertia:!0,...u,onstart:({client:P})=>{const O=pe.make(P);h.current?.(O)},onmove:({client:P,clientX0:O,clientY0:j,dx:L,dy:x})=>{const R=pe.make(O,j),$=pe.make(P),Q=pe.make(L,x);g.current?.(Q,$,R)},onend:({client:P,clientX0:O,clientY0:j})=>{const L=pe.make(O,j),x=pe.make(P);m.current?.(x,L)}});return()=>{k.unset(),m.current?.(pe.zero,pe.zero)}},[r,Fe(u)])}function at(e,{initialValue:r,transform:s,onDragStart:a,onDragMove:l,onDragEnd:u,...h}){const g=N.useRef(r),[m,S]=N.useState(!1),[k,P]=N.useState(!1),[O,j]=N.useState(r),L=Ne(a),x=Ne(l),R=Ne(u),$=Ne(s);return Eo(e,{onDragStart:T=>{S(!0),P(!1),L.current?.(T)},onDragMove:(T,I,E)=>{const F=$.current(g.current,T.x,T.y);No(g,F)&&j(F),S(!0),P(!1),x.current?.(T,I,E)},onDragEnd:(T,I)=>{S(!1),P(!0),R.current?.(T,I)},...h}),N.useEffect(()=>{No(g,O)},[O]),{isDragging:m,isReleasing:k,value:O,setValue:j}}function No(e,r){return Ve(e.current,r)?!1:(e.current=r,!0)}const nr=N.forwardRef(({angle:e=0,speed:r=1,src:s,zeroAnchor:a=0,onAngleChange:l,onPositionChange:u,onDragStart:h,onDragEnd:g,onLoadImageStart:m,onLoadImageComplete:S,onLoadImageError:k,onImageSizeChange:P,...O},j)=>{const L=N.useCallback((F,W,Z)=>F-W*r,[r]),x=N.useRef(null),R=Be(x),$=Vn({src:s},{onLoadStart:m,onLoadComplete:S,onLoadError:k}),[Q,B]=N.useState(e),{isDragging:G,value:T,setValue:I}=at(x,{initialValue:0,transform:L,onDragStart:h,onDragEnd:g});N.useEffect(()=>{if(G||!$)return;const F=ba(e,$,ge.size(R),a);F!==T&&I(F),e!==Q&&B(e)},[e,$,R.width,R.height,a]),N.useEffect(()=>{if(!G||!$)return;const F=xa(T,$,ge.size(R),a);Q!==F&&B(F)},[T,$,R.width,R.height,a]),N.useEffect(()=>{l?.(Q,G),u?.(Q/360,G)},[Q]),N.useEffect(()=>{P?.($)},[$?.width,$?.height]);const E=ya({src:s,displacement:T});return b.jsx("div",{...O,ref:j,"aria-valuenow":Q,role:"slider",children:b.jsx("div",{ref:x,style:E.body})})});function ya({src:e="",displacement:r=NaN}){return{body:{backgroundImage:`url(${e})`,backgroundPositionX:`${-r}px`,backgroundRepeat:"repeat",backgroundSize:"auto 100%",height:"100%",touchAction:"none",width:"100%"}}}function So(e,r){const{width:s,height:a}=e,{height:l}=r;if(a<=0)return Pe.zero;const h=l/a*s;return Pe.make(h,l)}function ba(e,r,s,a){const{width:l}=So(r,s),{width:u}=s,h=u*a;return e/360*l-h}function xa(e,r,s,a){const{width:l}=So(r,s),{width:u}=s,h=u*a;let g=(e+h)%l/l*360;for(;g<0;)g+=360;return g}process.env.NODE_ENV!=="production"&&(nr.displayName="Panorama");const To=N.forwardRef(({className:e,style:r,angle:s=0,autoDimension:a="width",children:l,fov:u,speed:h=1,src:g,viewportSize:m,zeroAnchor:S=0,onAngleChange:k,onDragEnd:P,onDragStart:O,onLoadImageComplete:j,onLoadImageError:L,onLoadImageStart:x,onImageSizeChange:R,onPositionChange:$,...Q},B)=>{const G=N.useRef(null),T=Be(G),[I,E]=N.useState(),[F,W]=N.useState(!1),re=N.useCallback(()=>{if(!I)return 0;const{width:C,height:Y}=I;return Y===0?0:C/Y},[I?.width,I?.height])(),U=N.useCallback(()=>{const C=Math.min(360,Math.max(0,u??(m?m.width/(m.height*re)*360:0)));return T.width*(C/360)},[m?.width,m?.height,re,T.width,u])(),z=N.useCallback(()=>T.width<=0?S:((T.width-U)*.5+S*U)/T.width,[T.width,U,S])(),te=N.useCallback(()=>{W(!0),O?.()},[O]),ee=N.useCallback(()=>{W(!1),P?.()},[P]),ce=Oe(l,{track:bt,reticle:rn,indicator:nn}),H=wa({autoDimension:a,panoramaRect:T,aspectRatio:re,reticleWidth:U});return b.jsxs("div",{...Q,ref:B,className:ae(e,{dragging:F}),style:le(r,H.root),children:[b.jsx(nr,{ref:G,angle:s,speed:h,src:g,style:H.panorama,zeroAnchor:z,onAngleChange:k,onDragEnd:ee,onDragStart:te,onImageSizeChange:E,onLoadImageComplete:j,onLoadImageError:L,onLoadImageStart:x,onPositionChange:$}),b.jsx("div",{style:H.body,children:b.jsxs("div",{style:H.controls,children:[b.jsx(me,{className:ae({dragging:F}),element:ce.track??b.jsx(bt,{}),style:H.track}),b.jsx(me,{className:ae({dragging:F}),element:ce.reticle??b.jsx(rn,{}),style:H.reticle}),b.jsx(me,{className:ae({dragging:F}),element:ce.track??b.jsx(bt,{}),style:H.track})]})}),b.jsx(me,{className:ae({dragging:F}),element:ce.indicator??b.jsx(nn,{}),style:H.indicator})]})}),nn=({...e})=>b.jsx("div",{...e}),rn=({...e})=>b.jsx("div",{...e}),bt=({...e})=>b.jsx("div",{...e});function wa({autoDimension:e="width",panoramaRect:r=ge.zero,aspectRatio:s=0,reticleWidth:a=0}){return{root:{...e==="width"?{width:`${r.height*s}px`}:{height:`${r.width/s}px`}},body:{height:"100%",left:"0",overflow:"hidden",pointerEvents:"none",position:"absolute",top:"0",width:"100%"},panorama:{height:"100%",width:"100%"},controls:{alignItems:"center",display:"flex",height:"100%",justifyContent:"flex-start",left:"0",overflow:"visible",position:"absolute",top:"0",width:"100%"},track:{flex:"1 0 auto"},reticle:{width:`${a}px`},indicator:{width:`${a}px`}}}process.env.NODE_ENV!=="production"&&(To.displayName="PanoramaSlider",nn.displayName="PanoramaSliderIndicator",rn.displayName="PanoramaSliderReticle",bt.displayName="PanoramaSliderTrack");const Co=N.forwardRef(({children:e,className:r,decimalPlaces:s=2,isClipped:a=!1,knobHeight:l=28,knobPadding:u=0,knobWidth:h=40,max:g,min:m,orientation:S="vertical",range:k,steps:P=-1,onChange:O,...j},L)=>{const x=N.useRef(null),R=Be(x),$=N.useRef(null),Q=N.useRef(null),[B,G]=N.useState(k??[m,g]),T=_a(m,g,P),[I,E]=B.map(oe=>rt(oe,m,g,S,R,h,l,a)),F=E-I,W=Oe(e,{gutter:on,highlight:sn,knob:wt,knobContainer:an,label:xt}),Z=N.useCallback((oe,ie,fe)=>{const ve=S==="horizontal"?ie:fe,Ee=rt(m,m,g,S,R,h,l,a),Se=rt(B[1],m,g,S,R,h,l,a),xe=rt(oe,m,g,S,R,h,l,a)+ve;return ko(Math.max(Ee,Math.min(Se,xe)),m,g,S,R,h,l,a)},[h,l,a,m,g,S,B[1],ge.toString(R)]),re=N.useCallback((oe,ie,fe)=>{const ve=S==="horizontal"?ie:fe,Ee=rt(B[0],m,g,S,R,h,l,a),Se=rt(g,m,g,S,R,h,l,a),xe=rt(oe,m,g,S,R,h,l,a)+ve;return ko(Math.max(Ee,Math.min(Se,xe)),m,g,S,R,h,l,a)},[h,l,a,m,g,S,B[0],ge.toString(R)]),{isDragging:q,isReleasing:U,value:D,setValue:z}=at($,{initialValue:k?.[0]??m,transform:Z}),{isDragging:te,isReleasing:ee,value:ce,setValue:H}=at(Q,{initialValue:k?.[1]??g,transform:re}),C=Ea({isDraggingEndKnob:te,isDraggingStartKnob:q,isReleasingEndKnob:ee,isReleasingStartKnob:U}),Y=Na({orientation:S,highlightLength:F,start:I,knobPadding:u,knobWidth:h,knobHeight:l});return N.useEffect(()=>{G([D,ce])},[D,ce]),N.useEffect(()=>{O?.(B)},[B[0],B[1]]),N.useEffect(()=>{q||te||ee||Ve(k,B)||(G(k??[m,g]),z(k?.[0]??m),H(k?.[1]??g))},[k?.[0],k?.[1],q,te,ee]),N.useEffect(()=>{T&&z(_o(D,T))},[U,Fe(T)]),N.useEffect(()=>{!T||!ee||H(_o(ce,T))},[ee,Fe(T)]),b.jsx("div",{...j,ref:L,"aria-valuemax":g,"aria-valuemin":m,className:ae(r,S),role:"slider",children:b.jsxs("div",{ref:x,style:Y.body,children:[b.jsx(me,{element:W.gutter??b.jsx(on,{}),style:le(Y.gutter)}),b.jsx(me,{element:W.highlight??b.jsx(sn,{}),style:le(Y.highlight)}),b.jsx(me,{ref:$,className:C.startKnobContainer,disabled:Ve([D,ce],[m,m]),element:W.knobContainer??b.jsx(an,{}),style:le(Y.knobContainer,{pointerEvents:Ve([D,ce],[m,m])?"none":"auto"},S==="horizontal"?{left:`${I}px`,top:`${R.height*.5}px`}:{left:`${R.width*.5}px`,top:`${I}px`}),children:b.jsxs(me,{className:C.startKnob,element:W.knob??b.jsx(wt,{}),style:le(Y.knob),children:[b.jsx("div",{style:Y.knobHitBox}),W.label&&b.jsx(me,{className:C.startLabel,element:W.label??b.jsx(xt,{}),style:le(Y.label),children:Number(D.toFixed(s)).toLocaleString()})]})}),b.jsx(me,{ref:Q,className:C.endKnobContainer,disabled:Ve([D,ce],[g,g]),element:W.knobContainer??b.jsx(an,{}),style:le(Y.knobContainer,{pointerEvents:Ve([D,ce],[g,g])?"none":"auto"},S==="horizontal"?{left:`${E}px`,top:`${R.height*.5}px`}:{left:`${R.width*.5}px`,top:`${E}px`}),children:b.jsxs(me,{className:C.endKnob,element:W.knob??b.jsx(wt,{}),style:le(Y.knob),children:[b.jsx("div",{style:Y.knobHitBox}),W.label&&b.jsx(me,{className:C.endLabel,element:W.label??b.jsx(xt,{}),style:le(Y.label),children:Number(ce.toFixed(s)).toLocaleString()})]})})]})})}),on=({...e})=>b.jsx("div",{...e}),xt=({...e})=>b.jsx("div",{...e}),sn=({...e})=>b.jsx("div",{...e}),wt=({...e})=>b.jsx("div",{...e}),an=({...e})=>b.jsx("button",{...e});function Ea({isDraggingStartKnob:e=!1,isReleasingStartKnob:r=!1,isDraggingEndKnob:s=!1,isReleasingEndKnob:a=!1}){return{startKnobContainer:ae({dragging:e,releasing:r}),startKnob:ae({dragging:e,releasing:r}),startLabel:ae({dragging:e,releasing:r}),endKnobContainer:ae({dragging:s,releasing:a}),endKnob:ae({dragging:s,releasing:a}),endLabel:ae({dragging:s,releasing:a})}}function Na({orientation:e="horizontal",knobWidth:r=0,knobHeight:s=0,highlightLength:a=0,start:l=0,knobPadding:u=0}){return{body:{height:"100%",width:"100%"},gutter:{display:"block",top:"0",left:"0",position:"absolute",width:"100%",height:"100%"},highlight:{left:"0",position:"absolute",top:"0",...e==="horizontal"?{height:"100%",width:`${a}px`,transform:`translate(${l}px, 0)`}:{height:`${a}px`,width:"100%",transform:`translate(0, ${l}px)`}},knobContainer:{background:"none",border:"none",outline:"none",position:"absolute",transform:"translate(-50%, -50%)",zIndex:"1"},knob:{height:`${s}px`,touchAction:"none",width:`${r}px`},knobHitBox:{background:"none",height:`calc(100% + ${u*2}px)`,left:`-${u}px`,padding:`${u}px`,position:"absolute",top:`-${u}px`,width:`calc(100% + ${u*2}px)`},label:{pointerEvents:"none",position:"relative",userSelect:"none"}}}function Sa(e,r,s){return(e-r)/(s-r)}function Ta(e,r,s,a,l,u){switch(r){case"horizontal":{const h=u?s.width-a:s.width;return(e-(u?a*.5:0))/h}case"vertical":{const h=u?s.height-l:s.height;return(e-(u?l*.5:0))/h}default:return console.error(`[etudes::RangeSlider] Invalid orientation: ${r}`),NaN}}function Ca(e,r,s){return e*(s-r)+r}function ko(e,r,s,a,l,u,h,g){const m=Ta(e,a,l,u,h,g);return Ca(m,r,s)}function ka(e,r,s,a,l,u){switch(r){case"horizontal":{const h=u?s.width-a:s.width;return e*h+(u?a*.5:0)}case"vertical":{const h=u?s.height-l:s.height;return e*h+(u?l*.5:0)}default:return console.error(`[etudes::RangeSlider] Invalid orientation: ${r}`),NaN}}function rt(e,r,s,a,l,u,h,g){const m=Sa(e,r,s);return ka(m,a,l,u,h,g)}function _o(e,r){const s=r.length;let a=0,l=1/0;for(let u=0;u<s;u++){const h=r[u],g=Math.abs(e-h);g<l&&(l=g,a=u)}return r[a]}function _a(e,r,s){if(!(s<0))return[e,...[...Array(s)].map((a,l)=>e+(l+1)*(r-e)/(1+s)),r]}process.env.NODE_ENV!=="production"&&(Co.displayName="RangeSlider",on.displayName="RangeSliderGutter",xt.displayName="RangeSliderLabel",sn.displayName="RangeSliderHighlight",wt.displayName="RangeSliderKnob");const Po=N.forwardRef(({children:e,id:r,isRequired:s=!1,name:a,options:l,placeholder:u,value:h="",onChange:g,...m},S)=>{const k=Oe(e,{expandIcon:rr,option:Et,toggle:cn});return b.jsxs("div",{...m,ref:S,style:or.root,children:[b.jsxs(me,{"aria-required":s?"true":void 0,element:k.toggle??b.jsx(cn,{}),name:a,required:s,style:or.select,value:h,onChange:P=>g?.(P.target.value),children:[u!==void 0&&b.jsx(me,{disabled:!0,hidden:!0,element:k.option??b.jsx(Et,{}),value:"",children:u}),l.map((P,O)=>b.jsx(me,{element:k.option??b.jsx(Et,{}),value:P,children:P},`${O}-${P}`))]}),k.expandIcon&&b.jsx(me,{element:k.expandIcon,style:or.expandIcon})]})}),rr=({children:e,style:r,...s})=>b.jsx("figure",{...s,"aria-hidden":!0,style:le(r,{pointerEvents:"none"}),children:e}),cn=({children:e,...r})=>b.jsx("select",{...r,children:e}),Et=({...e})=>b.jsx("option",{...e}),or={root:{alignItems:"center",display:"flex",flexDirection:"row",justifyContent:"flex-end",position:"relative"},select:{appearance:"none",boxSizing:"border-box",height:"100%",left:0,position:"absolute",top:0,width:"100%"},expandIcon:{pointerEvents:"none",zIndex:1}};process.env.NODE_ENV!=="production"&&(Po.displayName="Select",rr.displayName="SelectExpandIcon",Et.displayName="SelectOption",cn.displayName="SelectToggle");const Oo=N.forwardRef(({children:e,className:r,isDeselectable:s=!1,isDisabled:a=!1,isSelected:l=!1,label:u,onDeselect:h,onSelect:g,onToggle:m,...S},k)=>{const P=()=>{if(!a)if(l){if(!s)return;m?.(l),h?.()}else m?.(l),g?.()};return b.jsx("button",{...S,ref:k,"aria-disabled":a,"aria-label":u,"aria-selected":l,className:ae(r,{active:l,disabled:a||l&&!s}),disabled:a||l&&!s,onClick:P,children:e??u})});process.env.NODE_ENV!=="production"&&(Oo.displayName="SelectableButton");const Io=N.forwardRef(({children:e,className:r,isClipped:s=!1,isInverted:a=!1,isTrackInteractive:l=!0,knobHeight:u=30,knobPadding:h=0,knobWidth:g=30,onlyDispatchesOnDragEnd:m=!1,orientation:S="vertical",position:k=0,trackPadding:P=0,labelProvider:O,onDragEnd:j,onDragStart:L,onChange:x,...R},$)=>{const Q=N.useRef(null),B=N.useRef(null),G=N.useCallback((te,ee,ce)=>{const H=ge.from(Q.current)??ge.zero,C=a?1-te:te;switch(S){case"horizontal":{const Y=s?H.width-g:H.width,oe=C*Y+ee,ie=Math.max(0,Math.min(1,oe/Y));return a?1-ie:ie}case"vertical":{const Y=s?H.height-u:H.height,oe=C*Y+ce,ie=Math.max(0,Math.min(1,oe/Y));return a?1-ie:ie}default:return console.error(`[etudes::Slider] Invalid orientation: ${S}`),NaN}},[Q.current,s,a,g,u,S]),T=N.useCallback(te=>{if(!l)return;const ee=ge.from(Q.current)??ge.zero,ce=ge.fromViewport();switch(S){case"horizontal":{const H=(te.clientX+ce.left-ee.left)/ee.width,C=a?1-H:H;W(C);break}case"vertical":{const H=(te.clientY+ce.top-ee.top)/ee.height,C=a?1-H:H;W(C);break}default:console.error(`[etudes::Slider] Invalid orientation: ${S}`)}},[Q.current,a,l,S]),{isDragging:I,isReleasing:E,value:F,setValue:W}=at(B,{initialValue:k,transform:G,onDragStart:L,onDragEnd:j}),Z=a?1-F:F,U=Pa({orientation:S,isAtEnd:a?F===0:F===1,isAtStart:a?F===1:F===0,isDragging:I,isReleasing:E}),D=Oa({orientation:S,isClipped:s,naturalPosition:Z,knobPadding:h,knobHeight:u,knobWidth:g,isTrackInteractive:l});N.useEffect(()=>{I||k===F||W(k)},[k]),N.useEffect(()=>{I&&m||x?.(F,I)},[F]),N.useEffect(()=>{I||!m||x?.(F,!0)},[I]);const z=Oe(e,{knob:ln,knobContainer:un,label:fn,track:Nt});return b.jsx("div",{...R,ref:$,"aria-orientation":S,"aria-valuenow":F,className:ae(r,U.root),role:"slider",children:b.jsxs("div",{ref:Q,style:D.body,children:[b.jsx(me,{element:z.track??b.jsx(Nt,{}),style:le(D.track,S==="vertical"?{height:`calc(${Z*100}% - ${P<=0?0:u*.5}px - ${P}px)`,top:"0"}:{left:"0",width:`calc(${Z*100}% - ${P<=0?0:g*.5}px - ${P}px)`}),onClick:T,children:b.jsx("div",{style:D.trackHitBox})}),b.jsx(me,{element:z.track??b.jsx(Nt,{}),style:le(D.track,S==="vertical"?{bottom:"0",height:`calc(${(1-Z)*100}% - ${P<=0?0:u*.5}px - ${P}px)`}:{right:"0",width:`calc(${(1-Z)*100}% - ${P<=0?0:g*.5}px - ${P}px)`}),onClick:T,children:b.jsx("div",{style:D.trackHitBox})}),b.jsx(me,{ref:B,className:ae(U.knobContainer),element:z.knobContainer??b.jsx(un,{}),style:D.knobContainer,children:b.jsxs(me,{className:ae(U.knob),element:z.knob??b.jsx(ln,{}),style:le(D.knob),children:[b.jsx("div",{style:D.knobHitBox}),O&&b.jsx(me,{className:ae(U.label),element:z.label??b.jsx(fn,{}),style:le(D.label),children:O(F)})]})})]})})}),Nt=({...e})=>b.jsx("div",{...e}),ln=({...e})=>b.jsx("div",{...e}),un=({...e})=>b.jsx("button",{...e}),fn=({...e})=>b.jsx("div",{...e});function Pa({orientation:e="vertical",isAtEnd:r=!1,isAtStart:s=!1,isDragging:a=!1,isReleasing:l=!1}){return{root:ae(e,{"at-end":r,"at-start":s,dragging:a,releasing:l}),track:ae(e,{"at-end":r,"at-start":s,dragging:a,releasing:l}),knob:ae(e,{"at-end":r,"at-start":s,dragging:a,releasing:l}),knobContainer:ae(e,{"at-end":r,"at-start":s,dragging:a,releasing:l}),label:ae(e,{"at-end":r,"at-start":s,dragging:a,releasing:l})}}function Oa({orientation:e="vertical",isClipped:r=!1,naturalPosition:s=0,knobPadding:a=0,knobHeight:l=0,knobWidth:u=0,isTrackInteractive:h=!0}){return{body:{height:"100%",width:"100%"},knobContainer:{background:"none",border:"none",outline:"none",position:"absolute",transform:"translate(-50%, -50%)",zIndex:"1",...e==="vertical"?{left:"50%",top:r?`calc(${s*100}% + ${l*.5-s*l}px)`:`${s*100}%`}:{left:r?`calc(${s*100}% + ${u*.5-s*u}px)`:`${s*100}%`,top:"50%"}},knob:{height:`${l}px`,touchAction:"none",width:`${u}px`},knobHitBox:{background:"none",height:`calc(100% + ${a*2}px)`,left:`-${a}px`,padding:`${a}px`,position:"absolute",top:`-${a}px`,width:`calc(100% + ${a*2}px)`},label:{pointerEvents:"none",userSelect:"none"},track:{cursor:h?"pointer":"auto",pointerEvents:h?"auto":"none",position:"absolute",...e==="vertical"?{left:"0",margin:"0 auto",right:"0",width:"100%"}:{bottom:"0",height:"100%",margin:"auto 0",top:"0"}},trackHitBox:{height:"100%",minHeight:"20px",minWidth:"20px",position:"absolute",transform:e==="horizontal"?"translate(0, -50%)":"translate(-50%, 0)",width:"100%"}}}process.env.NODE_ENV!=="production"&&(Io.displayName="Slider",Nt.displayName="SliderTrack",ln.displayName="SliderKnob",un.displayName="SliderKnobContainer",fn.displayName="SliderLabel");const Ro=N.forwardRef(({children:e,className:r,index:s=0,isClipped:a=!1,isInverted:l=!1,isTrackInteractive:u=!0,knobHeight:h=30,knobPadding:g=0,knobWidth:m=30,labelProvider:S,onlyDispatchesOnDragEnd:k=!1,orientation:P="vertical",steps:O=jo(10),trackPadding:j=0,onDragEnd:L,onDragStart:x,onIndexChange:R,onPositionChange:$,...Q},B)=>{const G=N.useRef(null),T=N.useRef(null),I=Be(G),[E,F]=N.useState(s),W=N.useCallback((Y,oe,ie)=>{const fe=l?Je(Y):Y;switch(P){case"horizontal":{const ve=a?I.width-m:I.width,Ee=fe*ve+oe,Se=gn(Ee/ve);return l?Je(Se):Se}case"vertical":{const ve=a?I.height-h:I.height,Ee=fe*ve+ie,Se=gn(Ee/ve);return l?Je(Se):Se}default:return console.error(`[etudes::StepSlider] Invalid orientation: ${P}`),NaN}},[I.width,I.height,a,l,m,h,P]),{isDragging:Z,isReleasing:re,value:q,setValue:U}=at(T,{initialValue:ct(s,O),transform:W,onDragStart:x,onDragEnd:L}),D=N.useCallback(Y=>{if(!u)return;const oe=ge.fromViewport();switch(P){case"horizontal":{const ie=(Y.clientX+oe.left-I.left)/I.width,fe=l?Je(ie):ie,ve=Tt(fe,O);if(ve===E){const Ee=fe>q?ve+1:ve-1;F(gn(Ee,O.length-1))}else F(ve);break}case"vertical":{const ie=(Y.clientY+oe.top-I.top)/I.height,fe=l?Je(ie):ie,ve=Tt(fe,O);if(ve===E){const Ee=fe>q?ve+1:ve-1,Se=ct(Ee,O);U(Se),F(gn(Ee,O.length-1))}else{const Ee=ct(ve,O);U(Ee),F(ve)}break}default:console.error(`[etudes::StepSlider] Invalid orientation: ${P}`)}},[I.width,I.left,I.top,I.height,E,q,l,u,P,Fe(O)]),z=l?Je(q):q,ce=Ia({orientation:P,isAtEnd:l?q===0:q===1,isAtStart:l?q===1:q===0,isDragging:Z,isReleasing:re}),H=Ra({orientation:P,naturalPosition:z,isClipped:a,knobPadding:g,knobHeight:h,knobWidth:m,isTrackInteractive:u}),C=Oe(e,{knob:dn,knobContainer:hn,label:pn,track:St});return N.useEffect(()=>{Z||(U(ct(s,O)),F(s))},[s,Z,Fe(O)]),N.useEffect(()=>{if(Z){if(k)return;F(Tt(q,O))}else{const Y=Tt(q,O),oe=ct(Y,O);U(oe),F(Y)}},[q,Z,k,Fe(O)]),N.useEffect(()=>{$?.(q,Z)},[q,Z]),N.useEffect(()=>{R?.(E,Z)},[E,Z]),b.jsx("div",{...Q,ref:B,"aria-valuenow":E,className:ae(r,ce.root),role:"slider",children:b.jsxs("div",{ref:G,style:H.body,children:[b.jsx(me,{className:ae(l?"end":"start",ce.track),element:C.track??b.jsx(St,{}),style:le(H.track,P==="vertical"?{height:`calc(${z*100}% - ${j<=0?0:h*.5}px - ${j}px)`,top:"0"}:{left:"0",width:`calc(${z*100}% - ${j<=0?0:m*.5}px - ${j}px)`}),onClick:D,children:b.jsx("div",{style:H.trackHitBox})}),b.jsx(me,{className:ae(l?"start":"end",ce.track),element:C.track??b.jsx(St,{}),style:le(H.track,P==="vertical"?{bottom:"0",height:`calc(${Je(z)*100}% - ${j<=0?0:h*.5}px - ${j}px)`}:{right:"0",width:`calc(${Je(z)*100}% - ${j<=0?0:m*.5}px - ${j}px)`}),onClick:D,children:b.jsx("div",{style:H.trackHitBox})}),b.jsx(me,{ref:T,className:ae(ce.knobContainer),element:C.knobContainer??b.jsx(hn,{}),style:le(H.knobContainer),children:b.jsxs(me,{className:ae(ce.knob),element:C.knob??b.jsx(dn,{}),style:le(H.knob),children:[b.jsx("div",{style:H.knobHitBox}),O&&S&&b.jsx(me,{className:ae(ce.label),element:C.label??b.jsx(pn,{}),style:le(H.label),children:S(q,Tt(q,O))})]})})]})})}),dn=({...e})=>b.jsx("div",{...e}),hn=({...e})=>b.jsx("button",{...e}),pn=({...e})=>b.jsx("div",{...e}),St=({...e})=>b.jsx("div",{...e});function jo(e){if(e<=1)return console.error("[etudes::StepSlider] `length` value must be greater than or equal to 2"),[];if(Math.round(e)!==e)return console.error("[etudes::StepSlider] `length` value must be an integer"),[];const r=1/(e-1);return Array(e).fill(null).map((s,a)=>r*a)}function Tt(e,r){let s=-1,a=NaN;for(let l=0,u=r.length;l<u;l++){const h=ct(l,r);if(isNaN(h))continue;const g=Math.abs(e-h);(isNaN(a)||g<a)&&(a=g,s=l)}return s}function ct(e,r){return e>=r.length?NaN:r[e]}function Ia({orientation:e="vertical",isAtEnd:r=!1,isAtStart:s=!1,isDragging:a=!1,isReleasing:l=!1}){return{root:ae(e,{"at-end":r,"at-start":s,dragging:a,releasing:l}),track:ae(e,{"at-end":r,"at-start":s,dragging:a,releasing:l}),knob:ae(e,{"at-end":r,"at-start":s,dragging:a,releasing:l}),knobContainer:ae(e,{"at-end":r,"at-start":s,dragging:a,releasing:l}),label:ae(e,{"at-end":r,"at-start":s,dragging:a,releasing:l})}}function Ra({orientation:e="vertical",naturalPosition:r=0,isClipped:s=!1,knobPadding:a=0,knobHeight:l=0,knobWidth:u=0,isTrackInteractive:h=!1}){return{body:{height:"100%",width:"100%"},knobContainer:{background:"none",border:"none",outline:"none",position:"absolute",transform:"translate3d(-50%, -50%, 0)",zIndex:"1",...e==="vertical"?{left:"50%",top:s?`calc(${r*100}% + ${l*.5-r*l}px)`:`${r*100}%`}:{left:s?`calc(${r*100}% + ${u*.5-r*u}px)`:`${r*100}%`,top:"50%"}},knob:{height:`${l}px`,touchAction:"none",width:`${u}px`},knobHitBox:{background:"none",height:`calc(100% + ${a*2}px)`,left:`-${a}px`,padding:`${a}px`,position:"absolute",top:`-${a}px`,width:`calc(100% + ${a*2}px)`},label:{pointerEvents:"none",userSelect:"none"},track:{cursor:h?"pointer":"auto",pointerEvents:h?"auto":"none",position:"absolute",...e==="vertical"?{left:"0",margin:"0 auto",right:"0",width:"100%"}:{bottom:"0",height:"100%",margin:"auto 0",top:"0"}},trackHitBox:{height:"100%",minHeight:"20px",minWidth:"20px",position:"absolute",transform:e==="horizontal"?"translate3d(0, -50%, 0)":"translate3d(-50%, 0, 0)",width:"100%"}}}function Je(e){return 1-e}function gn(e,r=1,s=0){return Math.max(s,Math.min(r,e))}process.env.NODE_ENV!=="production"&&(Ro.displayName="StepSlider",St.displayName="StepSliderTrack",dn.displayName="StepSliderKnob",hn.displayName="StepSliderKnobContainer",pn.displayName="StepSliderLabel");const Ao=N.forwardRef(({children:e,isEnabled:r=!0,threshold:s=.5,onSwipeDown:a,onSwipeLeft:l,onSwipeRight:u,onSwipeUp:h,...g},m)=>{const[S,k]=N.useState(void 0),[P,O]=N.useState(void 0),[j,L]=N.useState(NaN),x=(B,G)=>{if(isNaN(B)||isNaN(G))return Q();k(pe.make(B,G))},R=(B,G)=>{const T=S;if(T===void 0)return;const I=T.x!==B||T.y!==G,E=!isNaN(j);I&&(E||L(Date.now()),O(pe.make(B,G)))},$=()=>{const B=j,G=S,T=P;if(isNaN(B)||G===void 0||T===void 0)return;const I=Date.now()-B,E=T.x-G.x,F=T.y-G.y,W=E/I,Z=F/I;r&&(Math.abs(W)>=s&&Math.abs(W)>Math.abs(Z)?W>0?u?.():l?.():Math.abs(Z)>=s&&Math.abs(Z)>Math.abs(W)&&(Z>0?a?.():h?.())),Q()},Q=()=>{k(void 0),O(void 0),L(NaN)};return b.jsx("div",{...g,ref:m,onMouseDown:B=>x(B.clientX,B.clientY),onMouseLeave:()=>Q(),onMouseMove:B=>R(B.clientX,B.clientY),onMouseUp:()=>$(),onTouchEnd:()=>$(),onTouchMove:B=>R(B.targetTouches[0].clientX,B.targetTouches[0].clientY),onTouchStart:B=>x(B.targetTouches[0].clientX,B.targetTouches[0].clientY),children:e})});process.env.NODE_ENV!=="production"&&(Ao.displayName="SwipeRegion");const Mo=N.forwardRef(({onChange:e,...r},s)=>b.jsx("textarea",{...r,ref:s,onChange:a=>e(a.target.value)}));process.env.NODE_ENV!=="production"&&(Mo.displayName="TextArea");const zo=N.forwardRef(({className:e,children:r,isInverted:s=!1,isOn:a=!1,orientation:l="horizontal",style:u,onChange:h,...g},m)=>{const S=N.useRef(null),k=jn(S),P=Oe(r,{knob:vn,track:mn}),O=ja({isOn:a}),j=Aa({isOn:a,isInverted:s,orientation:l,knobSize:k});return b.jsxs("label",{...g,ref:m,className:ae(e,O.root),style:le(u,j.root),children:[b.jsx("input",{checked:a,style:j.input,type:"checkbox",onChange:L=>h?.(L.target.checked)}),b.jsx(me,{className:O.track,element:P.track??b.jsx(mn,{}),style:j.track,children:b.jsx("div",{style:{position:"relative",width:"100%",height:"100%"},children:b.jsx(me,{ref:S,className:O.knob,element:P.knob??b.jsx(vn,{}),style:j.knob})})})]})}),mn=({children:e,...r})=>b.jsx("div",{...r,children:e}),vn=({children:e,...r})=>b.jsx("div",{...r,children:e});function ja({isOn:e=!1}){return{root:ae({on:e}),knob:ae({on:e}),track:ae({on:e})}}function Aa({isOn:e=!1,isInverted:r=!1,knobSize:s=Pe.zero,orientation:a="horizontal"}){return{root:{alignItems:"center",display:"flex",justifyContent:"start",position:"relative",...a==="horizontal"?{flexDirection:"row"}:{flexDirection:"column"}},input:{position:"absolute",top:0,left:0,opacity:0,width:0,height:0},knob:{position:"absolute",...a==="horizontal"?{...s.height>0?{top:`calc((100% - ${s.height}px) / 2)`}:{visibility:"hidden"},...s.width>0?{...r?{left:e?"0":`calc(100% - ${s.width}px)`}:{left:e?`calc(100% - ${s.width}px)`:"0"}}:{visibility:"hidden"}}:{...s.width>0?{left:`calc((100% - ${s.width}px) / 2)`}:{visibility:"hidden"},...s.height>0?{...r?{top:e?"0":`calc(100% - ${s.height}px)`}:{top:e?`calc(100% - ${s.height}px)`:"0"}}:{visibility:"hidden"}}},track:{position:"relative"}}}process.env.NODE_ENV!=="production"&&(zo.displayName="Toggle",vn.displayName="ToggleKnob",mn.displayName="ToggleTrack");const ir=N.forwardRef(({children:e,...r},s)=>(Array.isArray(e)&&console.error(`[etudes::ExtractChild] Only one child is expected, but found ${e.length}. Only the first child is extracted while the rest are discarded.`),N.Children.map(e,(a,l)=>{if(!(l>0))return N.isValidElement(a)?Ft(a,{...r,ref:s}):a})));process.env.NODE_ENV!=="production"&&(ir.displayName="ExtractChild");function Lo({children:e,className:r,style:s,alignment:a,arrowHeight:l=6,arrowWidth:u=12,gap:h=4,hint:g,maxWidth:m=200,threshold:S=100}){const k=N.useRef(null),P=N.useRef(void 0),O=Be(k),j=N.useCallback(()=>{const R=document.createElement("span");R.className=ae(r),R.innerHTML=g,R.role="tooltip";const $=a??(k.current?za(k.current,S):"tl"),Q=Ma(R),B=Da({alignment:$,arrowSize:Pe.make(u,l),gap:h,maxDialogWidth:m,fullDialogWidth:Q.width,targetWidth:O.width}),G=le(s,B.dialog);Object.keys(G).forEach(I=>R.style[I]=G[I]);const T=document.createElement("span");return Object.keys(B.arrow).forEach(I=>T.style[I]=B.arrow[I]),R.appendChild(T),R},[r,a,g,m,Fe(s),O.width,S,l,u,h]),L=N.useCallback(()=>{P.current&&(P.current.style.opacity="1",P.current.ariaHidden="false")},[]),x=N.useCallback(()=>{P.current&&(P.current.style.opacity="0",P.current.ariaHidden="true")},[]);return N.useEffect(()=>{const R=j();return k.current?.appendChild(R),P.current=R,()=>{k.current?.removeChild(R),P.current=void 0}},[j]),b.jsx(ir,{ref:k,onMouseEnter:L,onMouseLeave:x,children:e})}function Ma(e){const r=e.cloneNode(!1);r.innerHTML=e.innerHTML,r.style.visibility="hidden",r.style.whiteSpace="pre",document.body.appendChild(r);const s=r.getBoundingClientRect();return document.body.removeChild(r),Pe.make(s.width,s.height)}function za(e,r){const s=ge.fromViewport(),a=ge.intersecting(e);if(a){const l=a.left-s.left<r,u=s.right-a.right<r,h=a.top-s.top<r,g=s.bottom-a.bottom<r;if(l&&h)return"br";if(l&&g)return"tr";if(u&&h)return"bl";if(u&&g)return"tl";if(l)return"cr";if(u)return"cl";if(g)return"tc"}return"tc"}function La({alignment:e,arrowSize:r,fullDialogWidth:s,gap:a,maxDialogWidth:l,targetWidth:u}){const h=Math.min(s,l),g=u>h;switch(e){case"tl":return{bottom:`calc(100% + ${r.height}px + ${a}px)`,right:g?"":"0",left:g?"50%":"",transform:`translate(${h>u?"0":"-50%"}, 0)`};case"tc":return{bottom:`calc(100% + ${r.height}px + ${a}px)`,left:"50%",transform:"translateX(-50%)"};case"tr":return{bottom:`calc(100% + ${r.height}px + ${a}px)`,left:g?"50%":"0",transform:`translate(${h>u?"0":"-50%"}, 0)`};case"cl":return{top:"50%",right:`calc(100% + ${r.height+a}px)`,transform:"translate(0, -50%)"};case"cr":return{top:"50%",left:`calc(100% + ${r.height+a}px)`,transform:"translate(0, -50%)"};case"bl":return{left:g?"50%":"",right:g?"":"0",top:`calc(100% + ${r.height}px + ${a}px)`,transform:`translate(${h>u?"0":"-50%"}, 0)`};case"bc":return{left:"50%",top:`calc(100% + ${r.height}px + ${a}px)`,transform:"translateX(-50%)"};case"br":return{left:g?"50%":"0",top:`calc(100% + ${r.height}px + ${a}px)`,transform:`translate(${h>u?"0":"-50%"}, 0)`};default:return console.error(`[etudes::WithTooltip] Invalid alignment: ${e}`),{}}}function Fa({alignment:e,arrowSize:r,fullDialogWidth:s,maxDialogWidth:a,targetWidth:l}){const u=Math.min(s,a),h=l>u;switch(e){case"tl":return{bottom:0,clipPath:"polygon(50% 100%,100% 0,0 0)",height:`${r.height}px`,left:h?"50%":"",right:h?"":`${l-r.width/2-l/2}px`,transform:`translate(${h?"-50%":"0"}, 100%)`,width:`${r.width}px`};case"tc":return{bottom:0,clipPath:"polygon(50% 100%,100% 0,0 0)",height:`${r.height}px`,left:"50%",transform:"translate(-50%, 100%)",width:`${r.width}px`};case"tr":return{bottom:0,clipPath:"polygon(50% 100%,100% 0,0 0)",height:`${r.height}px`,left:h?"50%":`${l-r.width/2-l/2}px`,transform:`translate(${h?"-50%":"0"}, 100%)`,width:`${r.width}px`};case"cl":return{clipPath:"polygon(0 0,100% 50%,0 100%)",height:`${r.width}px`,right:"0",top:"50%",transform:"translate(100%, -50%)",width:`${r.height}px`};case"cr":return{clipPath:"polygon(100% 0,0 50%,100% 100%)",height:`${r.width}px`,left:"0",top:"50%",transform:"translate(-100%, -50%)",width:`${r.height}px`};case"bl":return{clipPath:"polygon(50% 0,100% 100%,0 100%)",height:`${r.height}px`,left:h?"50%":"",right:h?"":`${l-r.width/2-l/2}px`,top:"0",transform:`translate(${h?"-50%":"0"}, -100%)`,width:`${r.width}px`};case"bc":return{clipPath:"polygon(50% 0,100% 100%,0 100%)",height:`${r.height}px`,left:"50%",top:"0",transform:"translate(-50%, -100%)",width:`${r.width}px`};case"br":return{clipPath:"polygon(50% 0,100% 100%,0 100%)",height:`${r.height}px`,left:h?"50%":`${l-r.width/2-l/2}px`,top:"0",transform:`translate(${h?"-50%":"0"}, -100%)`,width:`${r.width}px`};default:return console.error(`[etudes::WithTooltip] Invalid alignment: ${e}`),{}}}function Da({alignment:e,arrowSize:r,fullDialogWidth:s,gap:a,maxDialogWidth:l,targetWidth:u}){return{dialog:{boxSizing:"border-box",height:"auto",margin:"0",opacity:"0",pointerEvents:"none",position:"absolute",userSelect:"none",whiteSpace:s>l?"normal":"pre",width:s>l?`${l}px`:"",...La({alignment:e,arrowSize:r,fullDialogWidth:s,gap:a,maxDialogWidth:l,targetWidth:u})},arrow:{background:"inherit",position:"absolute",...Fa({alignment:e,arrowSize:r,fullDialogWidth:s,maxDialogWidth:l,targetWidth:u})}}}process.env.NODE_ENV!=="production"&&(Lo.displayName="WithTooltip");function Va(e,r){const s=Ne(r);N.useLayoutEffect(()=>{const a=l=>{if(!(l.target instanceof Node))return;let u=!0,h=l.target;const m=[].concat(e).map(S=>S.current);for(;h;){if(m.find(S=>S===h)){u=!1;break}if(!h.parentNode)break;h=h.parentNode}u&&s.current()};return window.addEventListener("click",a,!0),()=>{window.removeEventListener("click",a,!0)}},[])}function Ba(e){const[r,s]=N.useState(!1),a=N.useCallback(h=>{h.preventDefault(),h.stopPropagation(),s(!0)},[]),l=N.useCallback(h=>{h.preventDefault(),h.stopPropagation(),s(!1)},[]),u=N.useCallback(h=>{h.preventDefault(),h.stopPropagation(),s(!1);const g=h.dataTransfer.files;if(g&&g.length>0){const m=g[0];new FormData().append("file",m),e(m)}},[]);return{isDropping:r,onDragOver:a,onDragLeave:l,onDrop:u}}function Ha(e,r){const s=Ne(r);N.useEffect(()=>{const a=l=>{l.key===e&&s.current?.()};return window.addEventListener("keydown",a),()=>{window.removeEventListener("keydown",a)}},[e])}function Ya(){const[e,r]=N.useState(!1);return N.useEffect(()=>(r(!0),()=>{r(!1)}),[]),e}function Xa({onChange:e}){const r=Ne(e),s=N.useRef(void 0),a=N.useRef(!1);N.useLayoutEffect(()=>{const l=()=>{const h=Ua();h&&(r.current(h,s.current),s.current=h)},u=()=>{a.current||typeof requestAnimationFrame=="function"&&(a.current=!0,requestAnimationFrame(()=>{l(),a.current=!1}))};return window.addEventListener("scroll",u,{passive:!0}),window.addEventListener("resize",u),window.addEventListener("orientationchange",u),u(),()=>{window.removeEventListener("scroll",u),window.removeEventListener("resize",u),window.removeEventListener("orientationchange",u)}},[])}function Ua(){const e=ge.fromViewport(),r=ge.clone(e,{x:0,y:0}),s=ge.from(window,{overflow:!0});if(!s)return;const a=ge.clone(r,{x:s.width-e.width,y:s.height-e.height}),l=pe.make(e.left/a.left,e.top/a.top);return{minPos:pe.make(r.left,r.top),maxPos:pe.make(a.left,a.top),pos:pe.make(e.left,e.top),step:l}}function Ga(e,r,{mapSearchParamToState:s,mapStateToSearchParam:a,shouldPopulateDefaultState:l=!1}={}){const u=N.useCallback((O,j)=>s?s(O):O||j,[s]),h=N.useCallback(O=>a?a(O):!l&&O===r?void 0:`${O}`,[r,l,a]),[g,m]=In.useSearchParams(),S=u(g.get(e)??void 0,r),[k,P]=N.useState(S);return N.useEffect(()=>{const O=g.get(e),j=h(k);j!==O&&(j?g.set(e,j):g.delete(e),m(g))},[k,h]),[k,P]}function Ka(e,{autoStarts:r=!0,onTimeout:s}){const a=N.useRef(void 0),l=Ne(s),u=N.useCallback(()=>{a.current!==void 0&&(clearTimeout(a.current),a.current=void 0)},[]),h=N.useCallback(()=>{u(),!(e<0)&&(a.current=setTimeout(()=>{u(),l.current()},e))},[e,u]);return N.useEffect(()=>(r&&e>=0&&h(),u),[r,e,h,u]),{start:h,stop:u}}function Fo({children:e,if:r}){switch(typeof r){case"function":return r()?b.jsx(b.Fragment,{children:e}):b.jsx(b.Fragment,{});default:return r?b.jsx(b.Fragment,{children:e}):b.jsx(b.Fragment,{})}}process.env.NODE_ENV!=="production"&&(Fo.displayName="Conditional");function Do({children:e,...r}){return b.jsx(b.Fragment,{children:N.Children.map(e,s=>N.isValidElement(s)?Ft(s,{...r}):s)})}process.env.NODE_ENV!=="production"&&(Do.displayName="ExtractChildren");function Wa({children:e,condition:r}){const s=N.Children.toArray(e);if(s.length===0)return console.error("[etudes::Switch] `Switch` must have at least one child"),b.jsx(b.Fragment,{});if(!Ja(s))return console.error("[etudes::Switch] `Switch` children must be of `Case` type or `Default` type"),b.jsx(b.Fragment,{});const a=s.filter(u=>u.type===sr);if(a.length>1)return console.error("[etudes::Switch] `Switch` can only have maximum one `Default` child"),b.jsx(b.Fragment,{});const l=a[0];for(const u of s)if(typeof r=="function"){if(r(u.props.value))return u}else if(r===u.props.value)return u;if(l)return l}function Vo({children:e}){return e}function sr({children:e}){return e}function Ja(e){return e.every(r=>N.isValidElement(r)&&(r.type===Vo||r.type===sr))}M.ColorScheme=void 0,(e=>{function r(s){return s==="light"?"dark":"light"}e.toggled=r})(M.ColorScheme||(M.ColorScheme={}));function Za({children:e}){const r=()=>{const l=localStorage.getItem("color-scheme");return l||(window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light")},[s,a]=N.useState(r());return N.useEffect(()=>{localStorage.setItem("color-scheme",s),document.documentElement.classList.toggle("dark",s==="dark")},[s]),b.jsx(lt.Provider,{value:{colorScheme:s,setColorScheme:a},children:e})}const lt=N.createContext(void 0);function Qa(){const e=N.useContext(lt);return e?e.colorScheme:(console.error("useColorScheme must be used within a ColorSchemeProvider"),"light")}function $a(){const e=N.useContext(lt);return e?e.setColorScheme:(console.error("useSetColorScheme must be used within a ColorSchemeProvider"),()=>{})}function qa(){const e=N.useContext(lt);return e?N.useCallback(()=>{e.setColorScheme(r=>M.ColorScheme.toggled(r))},[]):(console.error("useToggleColorScheme must be used within a ColorSchemeProvider"),()=>{})}process.env.NODE_ENV!=="production"&&(lt.displayName="ColorSchemeContext");const ar=N.createContext(void 0);function Bo({children:e}){const r=N.useRef(!1),[s,a]=N.useState({minPos:pe.zero,maxPos:pe.zero,pos:pe.zero,step:pe.zero});return N.useEffect(()=>{const l=()=>{const h=ge.fromViewport(),g=ge.clone(h,{x:0,y:0}),m=ge.from(window,{overflow:!0});if(!m)return;const S=ge.clone(g,{x:m.width-h.width,y:m.height-h.height}),k=pe.make(h.left/S.left,h.top/S.top);a({minPos:pe.make(g.left,g.top),maxPos:pe.make(S.left,S.top),pos:pe.make(h.left,h.top),step:k})},u=()=>{r.current||typeof requestAnimationFrame=="function"&&(r.current=!0,requestAnimationFrame(()=>{l(),r.current=!1}))};return window.addEventListener("scroll",u,{passive:!0}),window.addEventListener("resize",u),window.addEventListener("orientationchange",u),u(),()=>{window.removeEventListener("scroll",u),window.removeEventListener("resize",u),window.removeEventListener("orientationchange",u)}},[]),b.jsx(ar.Provider,{value:s,children:e})}function ec(e){const r=N.useContext(ar);if(!r)return console.error("Cannot fetch the current scroll position context, is the corresponding provider instated?"),{pos:pe.zero,step:pe.zero};if(!e)return{pos:r.pos,step:r.step};const s=e.current,a=ge.fromViewport(),l=ge.from(s);if(!a||!l)return{pos:pe.zero,step:pe.zero};const u=a.right-l.left,h=a.bottom-l.top,g=u/l.width,m=h/l.height;return{pos:pe.make(u,h),step:pe.make(g,m)}}process.env.NODE_ENV!=="production"&&(Bo.displayName="ScrollPositionProvider");function cr(e){return e==null?"":Array.isArray(e)?JSON.stringify(e.map(cr)):typeof e=="object"?JSON.stringify(Object.entries(e).sort(([r],[s])=>r.localeCompare(s)).map(([r,s])=>[r,cr(s)])):Fe(e)}M.Accordion=Fr,M.AccordionCollapseIcon=Mn,M.AccordionExpandIcon=An,M.AccordionHeader=Vt,M.AccordionItem=Bt,M.AccordionSection=zn,M.Burger=Ln,M.BurgerBar=mt,M.BurgerButton=Vr,M.BurgerButtonBar=Br,M.Button=Hr,M.Carousel=Ur,M.Case=Vo,M.Collection=Dt,M.CollectionItem=st,M.ColorSchemeContext=lt,M.ColorSchemeProvider=Za,M.Conditional=Fo,M.Counter=Kr,M.CounterAddButton=Ut,M.CounterSubtractButton=Gt,M.CounterTextField=Xt,M.CoverImage=Zr,M.CoverImageContent=Hn,M.CoverImageViewport=Yn,M.CoverVideo=qr,M.CoverVideoContent=Gn,M.CoverVideoViewport=Kn,M.Default=sr,M.Dial=eo,M.DialKnob=Jt,M.DialTrack=Wt,M.Dropdown=no,M.DropdownCollapseIcon=Jn,M.DropdownCollection=Zt,M.DropdownExpandIcon=Zn,M.DropdownItem=Qt,M.DropdownToggle=$t,M.Each=gt,M.ExtractChild=ir,M.ExtractChildren=Do,M.FlatSVG=go,M.Image=Bn,M.MasonryGrid=vo,M.OptionButton=xo,M.Panorama=nr,M.PanoramaSlider=To,M.PanoramaSliderIndicator=nn,M.PanoramaSliderReticle=rn,M.PanoramaSliderTrack=bt,M.RangeSlider=Co,M.RangeSliderGutter=on,M.RangeSliderHighlight=sn,M.RangeSliderKnob=wt,M.RangeSliderKnobContainer=an,M.RangeSliderLabel=xt,M.Repeat=Yt,M.ScrollPositionContext=ar,M.ScrollPositionProvider=Bo,M.Select=Po,M.SelectExpandIcon=rr,M.SelectOption=Et,M.SelectToggle=cn,M.SelectableButton=Oo,M.Slider=Io,M.SliderKnob=ln,M.SliderKnobContainer=un,M.SliderLabel=fn,M.SliderTrack=Nt,M.StepSlider=Ro,M.StepSliderKnob=dn,M.StepSliderKnobContainer=hn,M.StepSliderLabel=pn,M.StepSliderTrack=St,M.SwipeRegion=Ao,M.Switch=Wa,M.TextArea=Mo,M.TextField=Dn,M.Toggle=zo,M.ToggleKnob=vn,M.ToggleTrack=mn,M.Video=Un,M.WithTooltip=Lo,M.asClassNameDict=Gi,M.asComponentDict=Oe,M.asStyleDict=Fi,M.cloneStyledElement=Ft,M.createKey=Fe,M.createKeyDeep=cr,M.generateSteps=jo,M.styles=le,M.useClickOutside=Va,M.useColorScheme=Qa,M.useDrag=Yr,M.useDropzone=Ba,M.useImageLoader=Jr,M.useImageSize=Vn,M.useInertiaDrag=Eo,M.useInertiaDragValue=at,M.useInterval=Xr,M.useKeyboardShortcut=Ha,M.useLatest=Ne,M.useMounted=Ya,M.usePosition=Xa,M.usePrevious=Gr,M.useRect=Be,M.useScrollPosition=ec,M.useSearchState=Ga,M.useSetColorScheme=$a,M.useSize=jn,M.useSizeObserver=Lt,M.useTimeout=Ka,M.useToggleColorScheme=qa,M.useVideoMetadataLoader=Qr,M.useVideoSize=$r,M.useViewportSize=Wr,Object.defineProperty(M,Symbol.toStringTag,{value:"Module"})});
|
|
28
|
+
`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}We.prototype.build=function(e){return this.options.preserveOrder?oa(e,this.options):(Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e={[this.options.arrayNodeName]:e}),this.j2x(e,0,[]).val)},We.prototype.j2x=function(e,r,s){let a="",l="";const u=s.join(".");for(let h in e)if(Object.prototype.hasOwnProperty.call(e,h))if(typeof e[h]>"u")this.isAttribute(h)&&(l+="");else if(e[h]===null)this.isAttribute(h)||h===this.options.cdataPropName?l+="":h[0]==="?"?l+=this.indentate(r)+"<"+h+"?"+this.tagEndChar:l+=this.indentate(r)+"<"+h+"/"+this.tagEndChar;else if(e[h]instanceof Date)l+=this.buildTextValNode(e[h],h,"",r);else if(typeof e[h]!="object"){const g=this.isAttribute(h);if(g&&!this.ignoreAttributesFn(g,u))a+=this.buildAttrPairStr(g,""+e[h]);else if(!g)if(h===this.options.textNodeName){let m=this.options.tagValueProcessor(h,""+e[h]);l+=this.replaceEntitiesValue(m)}else l+=this.buildTextValNode(e[h],h,"",r)}else if(Array.isArray(e[h])){const g=e[h].length;let m="",S="";for(let k=0;k<g;k++){const P=e[h][k];if(!(typeof P>"u"))if(P===null)h[0]==="?"?l+=this.indentate(r)+"<"+h+"?"+this.tagEndChar:l+=this.indentate(r)+"<"+h+"/"+this.tagEndChar;else if(typeof P=="object")if(this.options.oneListGroup){const O=this.j2x(P,r+1,s.concat(h));m+=O.val,this.options.attributesGroupName&&P.hasOwnProperty(this.options.attributesGroupName)&&(S+=O.attrStr)}else m+=this.processTextOrObjNode(P,h,r,s);else if(this.options.oneListGroup){let O=this.options.tagValueProcessor(h,P);O=this.replaceEntitiesValue(O),m+=O}else m+=this.buildTextValNode(P,h,"",r)}this.options.oneListGroup&&(m=this.buildObjectNode(m,h,S,r)),l+=m}else if(this.options.attributesGroupName&&h===this.options.attributesGroupName){const g=Object.keys(e[h]),m=g.length;for(let S=0;S<m;S++)a+=this.buildAttrPairStr(g[S],""+e[h][g[S]])}else l+=this.processTextOrObjNode(e[h],h,r,s);return{attrStr:a,val:l}},We.prototype.buildAttrPairStr=function(e,r){return r=this.options.attributeValueProcessor(e,""+r),r=this.replaceEntitiesValue(r),this.options.suppressBooleanAttributes&&r==="true"?" "+e:" "+e+'="'+r+'"'};function ca(e,r,s,a){const l=this.j2x(e,s+1,a.concat(r));return e[this.options.textNodeName]!==void 0&&Object.keys(e).length===1?this.buildTextValNode(e[this.options.textNodeName],r,l.attrStr,s):this.buildObjectNode(l.val,r,l.attrStr,s)}We.prototype.buildObjectNode=function(e,r,s,a){if(e==="")return r[0]==="?"?this.indentate(a)+"<"+r+s+"?"+this.tagEndChar:this.indentate(a)+"<"+r+s+this.closeTag(r)+this.tagEndChar;{let l="</"+r+this.tagEndChar,u="";return r[0]==="?"&&(u="?",l=""),(s||s==="")&&e.indexOf("<")===-1?this.indentate(a)+"<"+r+s+u+">"+e+l:this.options.commentPropName!==!1&&r===this.options.commentPropName&&u.length===0?this.indentate(a)+`<!--${e}-->`+this.newLine:this.indentate(a)+"<"+r+s+u+this.tagEndChar+e+this.indentate(a)+l}},We.prototype.closeTag=function(e){let r="";return this.options.unpairedTags.indexOf(e)!==-1?this.options.suppressUnpairedNode||(r="/"):this.options.suppressEmptyNode?r="/":r=`></${e}`,r},We.prototype.buildTextValNode=function(e,r,s,a){if(this.options.cdataPropName!==!1&&r===this.options.cdataPropName)return this.indentate(a)+`<![CDATA[${e}]]>`+this.newLine;if(this.options.commentPropName!==!1&&r===this.options.commentPropName)return this.indentate(a)+`<!--${e}-->`+this.newLine;if(r[0]==="?")return this.indentate(a)+"<"+r+s+"?"+this.tagEndChar;{let l=this.options.tagValueProcessor(r,e);return l=this.replaceEntitiesValue(l),l===""?this.indentate(a)+"<"+r+s+this.closeTag(r)+this.tagEndChar:this.indentate(a)+"<"+r+s+">"+l+"</"+r+this.tagEndChar}},We.prototype.replaceEntitiesValue=function(e){if(e&&e.length>0&&this.options.processEntities)for(let r=0;r<this.options.entities.length;r++){const s=this.options.entities[r];e=e.replace(s.regex,s.val)}return e};function la(e){return this.options.indentBy.repeat(e)}function ua(e){return e.startsWith(this.options.attributeNamePrefix)&&e!==this.options.textNodeName?e.substr(this.attrPrefixLen):!1}const go=N.forwardRef(({fillMode:e="preserve",svg:r,shouldStripClasses:s=!0,shouldStripIds:a=!0,shouldStripPositions:l=!0,shouldStripStyles:u=!0,...h},g)=>{const m="@_",S=["id"].map(L=>`${m}${L}`),k=["class"].map(L=>`${m}${L}`),P=["fill","stroke","style"].map(L=>`${m}${L}`),O=["x","y"].map(L=>`${m}${L}`),j=()=>{const L=new na({attributeNamePrefix:m,ignoreAttributes:!1,ignoreDeclaration:!0,ignorePiTags:!0,removeNSPrefix:!0,trimValues:!0,updateTag:($,Q,B)=>{if(u&&$.toLowerCase()==="style")return!1;const G=Object.keys(B);for(const T of G)$.toLowerCase()==="svg"&&(l&&O.includes(T.toLowerCase())&&delete B[T],e!=="preserve"&&(T.toLowerCase()===`${m}width`&&delete B[T],T.toLowerCase()===`${m}height`&&delete B[T])),a&&S.includes(T.toLowerCase())&&delete B[T],s&&k.includes(T.toLowerCase())&&delete B[T],u&&P.includes(T.toLowerCase())&&delete B[T];if($.toLowerCase()==="svg")switch(e){case"fill":B[`${m}width`]="100%",B[`${m}height`]="100%";break;case"width":B[`${m}width`]="100%",B[`${m}height`]="auto";break;case"height":B[`${m}width`]="auto",B[`${m}height`]="100%";break}return $}}),x=new We({attributeNamePrefix:m,format:!0,ignoreAttributes:!1}),R=L.parse(r);return x.build(R)};return b.jsx("figure",{...h,ref:g,dangerouslySetInnerHTML:{__html:j()},role:"img"})});process.env.NODE_ENV!=="production"&&(go.displayName="FlatSVG");const mo="base-",vo=N.forwardRef(({alignSections:e=!1,children:r,className:s,horizontalSpacing:a=0,isReversed:l=!1,orientation:u="vertical",sections:h=3,verticalSpacing:g=0,...m},S)=>{const k=N.useRef(null),[P,O]=N.useState(NaN),[j,L]=N.useState(NaN),[x,R]=N.useState(NaN),[$,Q]=N.useState(NaN),B=()=>ge.from(k.current)?.width??0,G=()=>ge.from(k.current)?.height??0,T=()=>{const W=k.current;if(!W)return;const Z=W.children,re=h;if(re<=0){console.error("[etudes::MasonryGrid] You must specify a minimum of 1 section(s) (a.k.a. row(s) for horizontal orientation, column(s) for vertical orientation) for a MasonryGrid instance");return}if(u==="vertical"){const q=[...new Array(re)].map(()=>0);for(const z of Array.from(Z)){if(!(z instanceof HTMLElement))continue;const te=bo(z,h),[ee,ce]=yo(q,te);z.role="gridcell",z.style.position="absolute",z.style.width=`calc(${100/re*te}% - ${a*(re-1)/re*te}px + ${a*(te-1)}px)`,z.style.height="",z.style.left=`calc(${100/re*ee}% - ${a*(re-1)/re*ee}px + ${a*ee}px)`,z.style.top=`${ce+(ce===0?0:g)}px`;for(let H=0;H<te;H++)q[ee+H]=ce+(ce===0?0:g)+(ge.from(z)?.height??0);if(e&&ee+te===re){const H=yt(q);for(let C=0;C<re;C++)q[C]=H}}const U=B(),D=yt(q,re);if(O(U),L(D),isNaN(D)||(W.style.height=`${D}px`),l)for(const z of Array.from(Z))z instanceof HTMLElement&&(z.style.left=`calc(${U}px - ${z.style.left} - ${z.getBoundingClientRect().width}px)`)}else{const q=[...new Array(re)].map(()=>0);for(const z of Array.from(Z)){if(!(z instanceof HTMLElement))continue;const te=bo(z,h),[ee,ce]=yo(q,te);z.style.position="absolute",z.style.width="",z.style.height=`calc(${100/re*te}% - ${g*(re-1)/re*te}px + ${g*(te-1)}px)`,z.style.top=`calc(${100/re*ee}% - ${g*(re-1)/re*ee}px + ${g*ee}px)`,z.style.left=`${ce+(ce===0?0:a)}px`;for(let H=0;H<te;H++)q[ee+H]=ce+(ce===0?0:a)+(ge.from(z)?.width??0);if(e&&ee+te===re){const H=yt(q);for(let C=0;C<re;C++)q[C]=H}}const U=G(),D=yt(q,re);if(L(U),O(D),isNaN(D)||(W.style.width=`${D}px`),l)for(const z of Array.from(Z))z instanceof HTMLElement&&(z.style.top=`calc(${U}px - ${z.style.top} - ${z.getBoundingClientRect().height}px)`)}},I=N.useCallback(W=>{const Z=ge.size(ge.from(W)??ge.zero),re=B(),q=G();(P!==re||j!==q||Z.width!==x||Z.height!==$)&&(T(),R(Z.width),Q(Z.height))},[e,a,l,h,g,u]);Lt(k,{onResize:I}),N.useEffect(()=>{const W=ha(k.current?.innerHTML);if(W.length===0)return T();const Z=W.length;for(let re=0;re<Z;re++){const q=W[re],U=new Image;U.src=q,U.onload=()=>T()}},[r]);const E=fa({orientation:u}),F=da({orientation:u,minHeight:j,minWidth:P});return b.jsx("div",{...m,ref:S,className:ae(s,E.root),role:"grid",children:b.jsx("div",{ref:k,style:F.body,children:r})})});function fa({orientation:e="horizontal"}){return{root:ae(e)}}function da({orientation:e="horizontal",minHeight:r=NaN,minWidth:s=NaN}){return{body:{height:e==="horizontal"?"100%":"auto",minHeight:e==="vertical"&&!isNaN(r)?`${r}px`:"",minWidth:e==="horizontal"&&!isNaN(s)?`${s}px`:"",padding:"0",width:e==="horizontal"?"auto":"100%"}}}function yo(e,r){const s=e.length;let a=NaN,l=1/0;for(let u=0;u<s;u++){const h=e[u],g=h<l,m=u+r<=s;let S=!0;for(let k=1;k<r;k++)e[u+k]>h&&(S=!1);g&&m&&S&&(a=u,l=h)}return isNaN(a)?[0,yt(e,r)]:[a,l]}function yt(e,r){let s=e;return r!=null&&!isNaN(r)&&(s=s.slice(0,Math.max(1,Math.min(r,e.length)))),s.reduce((a,l,u)=>l>a?l:a,0)}function bo(e,r){const s=e.classList;for(const a of Array.from(s))if(a.startsWith(mo)){const l=parseFloat(a.replace(mo,""));if(!isNaN(l))return Math.min(Math.max(l,1),r)}return 1}function ha(e){if(!e)return[];const r=/<img.*?src=(["'])(.*?)\1/g,s=/<img.*?src=(["'])(.*?)\1/,a=r.exec(e)??[],l=[];for(const u of a){const h=s.exec(u)?.[2];h&&l.push(h)}return l}process.env.NODE_ENV!=="production"&&(vo.displayName="MasonryGrid");const xo=N.forwardRef(({index:e=0,isDisabled:r=!1,options:s,onChange:a,...l},u)=>{const h=s.length-1,g=s[e],m=typeof g=="string"?g:g?.label,S=()=>{if(r)return;const k=e<h?e+1:0,P=s[k],O=typeof P=="string"?P:P?.value;a?.(O,k)};return b.jsx("button",{...l,ref:u,"aria-disabled":r,"aria-label":m,disabled:r,onClick:S,children:m})});process.env.NODE_ENV!=="production"&&(xo.displayName="OptionButton");var tn={exports:{}},pa=tn.exports,wo;function ga(){return wo||(wo=1,function(e,r){(function(s,a){e.exports=a()})(pa,function(){function s(n,t){var o=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);t&&(i=i.filter(function(c){return Object.getOwnPropertyDescriptor(n,c).enumerable})),o.push.apply(o,i)}return o}function a(n){for(var t=1;t<arguments.length;t++){var o=arguments[t]!=null?arguments[t]:{};t%2?s(Object(o),!0).forEach(function(i){m(n,i,o[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):s(Object(o)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(o,i))})}return n}function l(n){return l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l(n)}function u(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function h(n,t){for(var o=0;o<t.length;o++){var i=t[o];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,x(i.key),i)}}function g(n,t,o){return t&&h(n.prototype,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function m(n,t,o){return(t=x(t))in n?Object.defineProperty(n,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[t]=o,n}function S(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),t&&P(n,t)}function k(n){return k=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},k(n)}function P(n,t){return P=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,i){return o.__proto__=i,o},P(n,t)}function O(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function j(n){var t=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var o,i=k(n);if(t){var c=k(this).constructor;o=Reflect.construct(i,arguments,c)}else o=i.apply(this,arguments);return function(f,d){if(d&&(typeof d=="object"||typeof d=="function"))return d;if(d!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return O(f)}(this,o)}}function L(){return L=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(n,t,o){var i=function(f,d){for(;!Object.prototype.hasOwnProperty.call(f,d)&&(f=k(f))!==null;);return f}(n,t);if(i){var c=Object.getOwnPropertyDescriptor(i,t);return c.get?c.get.call(arguments.length<3?n:o):c.value}},L.apply(this,arguments)}function x(n){var t=function(o,i){if(typeof o!="object"||o===null)return o;var c=o[Symbol.toPrimitive];if(c!==void 0){var f=c.call(o,i);if(typeof f!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(o)}(n,"string");return typeof t=="symbol"?t:t+""}var R=function(n){return!(!n||!n.Window)&&n instanceof n.Window},$=void 0,Q=void 0;function B(n){$=n;var t=n.document.createTextNode("");t.ownerDocument!==n.document&&typeof n.wrap=="function"&&n.wrap(t)===t&&(n=n.wrap(n)),Q=n}function G(n){return R(n)?n:(n.ownerDocument||n).defaultView||Q.window}typeof window<"u"&&window&&B(window);var T=function(n){return!!n&&l(n)==="object"},I=function(n){return typeof n=="function"},E={window:function(n){return n===Q||R(n)},docFrag:function(n){return T(n)&&n.nodeType===11},object:T,func:I,number:function(n){return typeof n=="number"},bool:function(n){return typeof n=="boolean"},string:function(n){return typeof n=="string"},element:function(n){if(!n||l(n)!=="object")return!1;var t=G(n)||Q;return/object|function/.test(typeof Element>"u"?"undefined":l(Element))?n instanceof Element||n instanceof t.Element:n.nodeType===1&&typeof n.nodeName=="string"},plainObject:function(n){return T(n)&&!!n.constructor&&/function Object\b/.test(n.constructor.toString())},array:function(n){return T(n)&&n.length!==void 0&&I(n.splice)}};function F(n){var t=n.interaction;if(t.prepared.name==="drag"){var o=t.prepared.axis;o==="x"?(t.coords.cur.page.y=t.coords.start.page.y,t.coords.cur.client.y=t.coords.start.client.y,t.coords.velocity.client.y=0,t.coords.velocity.page.y=0):o==="y"&&(t.coords.cur.page.x=t.coords.start.page.x,t.coords.cur.client.x=t.coords.start.client.x,t.coords.velocity.client.x=0,t.coords.velocity.page.x=0)}}function W(n){var t=n.iEvent,o=n.interaction;if(o.prepared.name==="drag"){var i=o.prepared.axis;if(i==="x"||i==="y"){var c=i==="x"?"y":"x";t.page[c]=o.coords.start.page[c],t.client[c]=o.coords.start.client[c],t.delta[c]=0}}}var Z={id:"actions/drag",install:function(n){var t=n.actions,o=n.Interactable,i=n.defaults;o.prototype.draggable=Z.draggable,t.map.drag=Z,t.methodDict.drag="draggable",i.actions.drag=Z.defaults},listeners:{"interactions:before-action-move":F,"interactions:action-resume":F,"interactions:action-move":W,"auto-start:check":function(n){var t=n.interaction,o=n.interactable,i=n.buttons,c=o.options.drag;if(c&&c.enabled&&(!t.pointerIsDown||!/mouse|pointer/.test(t.pointerType)||(i&o.options.drag.mouseButtons)!=0))return n.action={name:"drag",axis:c.lockAxis==="start"?c.startAxis:c.lockAxis},!1}},draggable:function(n){return E.object(n)?(this.options.drag.enabled=n.enabled!==!1,this.setPerAction("drag",n),this.setOnEvents("drag",n),/^(xy|x|y|start)$/.test(n.lockAxis)&&(this.options.drag.lockAxis=n.lockAxis),/^(xy|x|y)$/.test(n.startAxis)&&(this.options.drag.startAxis=n.startAxis),this):E.bool(n)?(this.options.drag.enabled=n,this):this.options.drag},beforeMove:F,move:W,defaults:{startAxis:"xy",lockAxis:"xy"},getCursor:function(){return"move"},filterEventType:function(n){return n.search("drag")===0}},re=Z,q={init:function(n){var t=n;q.document=t.document,q.DocumentFragment=t.DocumentFragment||U,q.SVGElement=t.SVGElement||U,q.SVGSVGElement=t.SVGSVGElement||U,q.SVGElementInstance=t.SVGElementInstance||U,q.Element=t.Element||U,q.HTMLElement=t.HTMLElement||q.Element,q.Event=t.Event,q.Touch=t.Touch||U,q.PointerEvent=t.PointerEvent||t.MSPointerEvent},document:null,DocumentFragment:null,SVGElement:null,SVGSVGElement:null,SVGElementInstance:null,Element:null,HTMLElement:null,Event:null,Touch:null,PointerEvent:null};function U(){}var D=q,z={init:function(n){var t=D.Element,o=n.navigator||{};z.supportsTouch="ontouchstart"in n||E.func(n.DocumentTouch)&&D.document instanceof n.DocumentTouch,z.supportsPointerEvent=o.pointerEnabled!==!1&&!!D.PointerEvent,z.isIOS=/iP(hone|od|ad)/.test(o.platform),z.isIOS7=/iP(hone|od|ad)/.test(o.platform)&&/OS 7[^\d]/.test(o.appVersion),z.isIe9=/MSIE 9/.test(o.userAgent),z.isOperaMobile=o.appName==="Opera"&&z.supportsTouch&&/Presto/.test(o.userAgent),z.prefixedMatchesSelector="matches"in t.prototype?"matches":"webkitMatchesSelector"in t.prototype?"webkitMatchesSelector":"mozMatchesSelector"in t.prototype?"mozMatchesSelector":"oMatchesSelector"in t.prototype?"oMatchesSelector":"msMatchesSelector",z.pEventTypes=z.supportsPointerEvent?D.PointerEvent===n.MSPointerEvent?{up:"MSPointerUp",down:"MSPointerDown",over:"mouseover",out:"mouseout",move:"MSPointerMove",cancel:"MSPointerCancel"}:{up:"pointerup",down:"pointerdown",over:"pointerover",out:"pointerout",move:"pointermove",cancel:"pointercancel"}:null,z.wheelEvent=D.document&&"onmousewheel"in D.document?"mousewheel":"wheel"},supportsTouch:null,supportsPointerEvent:null,isIOS7:null,isIOS:null,isIe9:null,isOperaMobile:null,prefixedMatchesSelector:null,pEventTypes:null,wheelEvent:null},te=z;function ee(n,t){if(n.contains)return n.contains(t);for(;t;){if(t===n)return!0;t=t.parentNode}return!1}function ce(n,t){for(;E.element(n);){if(C(n,t))return n;n=H(n)}return null}function H(n){var t=n.parentNode;if(E.docFrag(t)){for(;(t=t.host)&&E.docFrag(t););return t}return t}function C(n,t){return Q!==$&&(t=t.replace(/\/deep\//g," ")),n[te.prefixedMatchesSelector](t)}var Y=function(n){return n.parentNode||n.host};function oe(n,t){for(var o,i=[],c=n;(o=Y(c))&&c!==t&&o!==c.ownerDocument;)i.unshift(c),c=o;return i}function ie(n,t,o){for(;E.element(n);){if(C(n,t))return!0;if((n=H(n))===o)return C(n,t)}return!1}function fe(n){return n.correspondingUseElement||n}function ve(n){var t=n instanceof D.SVGElement?n.getBoundingClientRect():n.getClientRects()[0];return t&&{left:t.left,right:t.right,top:t.top,bottom:t.bottom,width:t.width||t.right-t.left,height:t.height||t.bottom-t.top}}function Ee(n){var t,o=ve(n);if(!te.isIOS7&&o){var i={x:(t=(t=G(n))||Q).scrollX||t.document.documentElement.scrollLeft,y:t.scrollY||t.document.documentElement.scrollTop};o.left+=i.x,o.right+=i.x,o.top+=i.y,o.bottom+=i.y}return o}function Se(n){for(var t=[];n;)t.push(n),n=H(n);return t}function xe(n){return!!E.string(n)&&(D.document.querySelector(n),!0)}function J(n,t){for(var o in t)n[o]=t[o];return n}function ze(n,t,o){return n==="parent"?H(o):n==="self"?t.getRect(o):ce(o,n)}function _e(n,t,o,i){var c=n;return E.string(c)?c=ze(c,t,o):E.func(c)&&(c=c.apply(void 0,i)),E.element(c)&&(c=Ee(c)),c}function ke(n){return n&&{x:"x"in n?n.x:n.left,y:"y"in n?n.y:n.top}}function De(n){return!n||"x"in n&&"y"in n||((n=J({},n)).x=n.left||0,n.y=n.top||0,n.width=n.width||(n.right||0)-n.x,n.height=n.height||(n.bottom||0)-n.y),n}function Ae(n,t,o){n.left&&(t.left+=o.x),n.right&&(t.right+=o.x),n.top&&(t.top+=o.y),n.bottom&&(t.bottom+=o.y),t.width=t.right-t.left,t.height=t.bottom-t.top}function He(n,t,o){var i=o&&n.options[o];return ke(_e(i&&i.origin||n.options.origin,n,t,[n&&t]))||{x:0,y:0}}function Ye(n,t){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(v){return!0},i=arguments.length>3?arguments[3]:void 0;if(i=i||{},E.string(n)&&n.search(" ")!==-1&&(n=Ho(n)),E.array(n))return n.forEach(function(v){return Ye(v,t,o,i)}),i;if(E.object(n)&&(t=n,n=""),E.func(t)&&o(n))i[n]=i[n]||[],i[n].push(t);else if(E.array(t))for(var c=0,f=t;c<f.length;c++){var d=f[c];Ye(n,d,o,i)}else if(E.object(t))for(var p in t)Ye(Ho(p).map(function(v){return"".concat(n).concat(v)}),t[p],o,i);return i}function Ho(n){return n.trim().split(/ +/)}var Ct=function(n,t){return Math.sqrt(n*n+t*t)},tc=["webkit","moz"];function yn(n,t){n.__set||(n.__set={});var o=function(c){if(tc.some(function(f){return c.indexOf(f)===0}))return 1;typeof n[c]!="function"&&c!=="__set"&&Object.defineProperty(n,c,{get:function(){return c in n.__set?n.__set[c]:n.__set[c]=t[c]},set:function(f){n.__set[c]=f},configurable:!0})};for(var i in t)o(i);return n}function bn(n,t){n.page=n.page||{},n.page.x=t.page.x,n.page.y=t.page.y,n.client=n.client||{},n.client.x=t.client.x,n.client.y=t.client.y,n.timeStamp=t.timeStamp}function Yo(n){n.page.x=0,n.page.y=0,n.client.x=0,n.client.y=0}function Xo(n){return n instanceof D.Event||n instanceof D.Touch}function xn(n,t,o){return n=n||"page",(o=o||{}).x=t[n+"X"],o.y=t[n+"Y"],o}function Uo(n,t){return t=t||{x:0,y:0},te.isOperaMobile&&Xo(n)?(xn("screen",n,t),t.x+=window.scrollX,t.y+=window.scrollY):xn("page",n,t),t}function kt(n){return E.number(n.pointerId)?n.pointerId:n.identifier}function nc(n,t,o){var i=t.length>1?Go(t):t[0];Uo(i,n.page),function(c,f){f=f||{},te.isOperaMobile&&Xo(c)?xn("screen",c,f):xn("client",c,f)}(i,n.client),n.timeStamp=o}function lr(n){var t=[];return E.array(n)?(t[0]=n[0],t[1]=n[1]):n.type==="touchend"?n.touches.length===1?(t[0]=n.touches[0],t[1]=n.changedTouches[0]):n.touches.length===0&&(t[0]=n.changedTouches[0],t[1]=n.changedTouches[1]):(t[0]=n.touches[0],t[1]=n.touches[1]),t}function Go(n){for(var t={pageX:0,pageY:0,clientX:0,clientY:0,screenX:0,screenY:0},o=0;o<n.length;o++){var i=n[o];for(var c in t)t[c]+=i[c]}for(var f in t)t[f]/=n.length;return t}function ur(n){if(!n.length)return null;var t=lr(n),o=Math.min(t[0].pageX,t[1].pageX),i=Math.min(t[0].pageY,t[1].pageY),c=Math.max(t[0].pageX,t[1].pageX),f=Math.max(t[0].pageY,t[1].pageY);return{x:o,y:i,left:o,top:i,right:c,bottom:f,width:c-o,height:f-i}}function fr(n,t){var o=t+"X",i=t+"Y",c=lr(n),f=c[0][o]-c[1][o],d=c[0][i]-c[1][i];return Ct(f,d)}function dr(n,t){var o=t+"X",i=t+"Y",c=lr(n),f=c[1][o]-c[0][o],d=c[1][i]-c[0][i];return 180*Math.atan2(d,f)/Math.PI}function Ko(n){return E.string(n.pointerType)?n.pointerType:E.number(n.pointerType)?[void 0,void 0,"touch","pen","mouse"][n.pointerType]:/touch/.test(n.type||"")||n instanceof D.Touch?"touch":"mouse"}function Wo(n){var t=E.func(n.composedPath)?n.composedPath():n.path;return[fe(t?t[0]:n.target),fe(n.currentTarget)]}var wn=function(){function n(t){u(this,n),this.immediatePropagationStopped=!1,this.propagationStopped=!1,this._interaction=t}return g(n,[{key:"preventDefault",value:function(){}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}}]),n}();Object.defineProperty(wn.prototype,"interaction",{get:function(){return this._interaction._proxy},set:function(){}});var Jo=function(n,t){for(var o=0;o<t.length;o++){var i=t[o];n.push(i)}return n},Zo=function(n){return Jo([],n)},_t=function(n,t){for(var o=0;o<n.length;o++)if(t(n[o],o,n))return o;return-1},Pt=function(n,t){return n[_t(n,t)]},ut=function(n){S(o,n);var t=j(o);function o(i,c,f){var d;u(this,o),(d=t.call(this,c._interaction)).dropzone=void 0,d.dragEvent=void 0,d.relatedTarget=void 0,d.draggable=void 0,d.propagationStopped=!1,d.immediatePropagationStopped=!1;var p=f==="dragleave"?i.prev:i.cur,v=p.element,w=p.dropzone;return d.type=f,d.target=v,d.currentTarget=v,d.dropzone=w,d.dragEvent=c,d.relatedTarget=c.target,d.draggable=c.interactable,d.timeStamp=c.timeStamp,d}return g(o,[{key:"reject",value:function(){var i=this,c=this._interaction.dropState;if(this.type==="dropactivate"||this.dropzone&&c.cur.dropzone===this.dropzone&&c.cur.element===this.target)if(c.prev.dropzone=this.dropzone,c.prev.element=this.target,c.rejected=!0,c.events.enter=null,this.stopImmediatePropagation(),this.type==="dropactivate"){var f=c.activeDrops,d=_t(f,function(v){var w=v.dropzone,y=v.element;return w===i.dropzone&&y===i.target});c.activeDrops.splice(d,1);var p=new o(c,this.dragEvent,"dropdeactivate");p.dropzone=this.dropzone,p.target=this.target,this.dropzone.fire(p)}else this.dropzone.fire(new o(c,this.dragEvent,"dragleave"))}},{key:"preventDefault",value:function(){}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}}]),o}(wn);function Qo(n,t){for(var o=0,i=n.slice();o<i.length;o++){var c=i[o],f=c.dropzone,d=c.element;t.dropzone=f,t.target=d,f.fire(t),t.propagationStopped=t.immediatePropagationStopped=!1}}function hr(n,t){for(var o=function(f,d){for(var p=[],v=0,w=f.interactables.list;v<w.length;v++){var y=w[v];if(y.options.drop.enabled){var _=y.options.drop.accept;if(!(E.element(_)&&_!==d||E.string(_)&&!C(d,_)||E.func(_)&&!_({dropzone:y,draggableElement:d})))for(var A=0,X=y.getAllElements();A<X.length;A++){var V=X[A];V!==d&&p.push({dropzone:y,element:V,rect:y.getRect(V)})}}}return p}(n,t),i=0;i<o.length;i++){var c=o[i];c.rect=c.dropzone.getRect(c.element)}return o}function $o(n,t,o){for(var i=n.dropState,c=n.interactable,f=n.element,d=[],p=0,v=i.activeDrops;p<v.length;p++){var w=v[p],y=w.dropzone,_=w.element,A=w.rect,X=y.dropCheck(t,o,c,f,_,A);d.push(X?_:null)}var V=function(K){for(var se,ne,ue,ye=[],we=0;we<K.length;we++){var de=K[we],be=K[se];if(de&&we!==se)if(be){var je=Y(de),Te=Y(be);if(je!==de.ownerDocument)if(Te!==de.ownerDocument)if(je!==Te){ye=ye.length?ye:oe(be);var Me=void 0;if(be instanceof D.HTMLElement&&de instanceof D.SVGElement&&!(de instanceof D.SVGSVGElement)){if(de===Te)continue;Me=de.ownerSVGElement}else Me=de;for(var Le=oe(Me,be.ownerDocument),Ge=0;Le[Ge]&&Le[Ge]===ye[Ge];)Ge++;var On=[Le[Ge-1],Le[Ge],ye[Ge]];if(On[0])for(var Mt=On[0].lastChild;Mt;){if(Mt===On[1]){se=we,ye=Le;break}if(Mt===On[2])break;Mt=Mt.previousSibling}}else ue=be,(parseInt(G(ne=de).getComputedStyle(ne).zIndex,10)||0)>=(parseInt(G(ue).getComputedStyle(ue).zIndex,10)||0)&&(se=we);else se=we}else se=we}return se}(d);return i.activeDrops[V]||null}function pr(n,t,o){var i=n.dropState,c={enter:null,leave:null,activate:null,deactivate:null,move:null,drop:null};return o.type==="dragstart"&&(c.activate=new ut(i,o,"dropactivate"),c.activate.target=null,c.activate.dropzone=null),o.type==="dragend"&&(c.deactivate=new ut(i,o,"dropdeactivate"),c.deactivate.target=null,c.deactivate.dropzone=null),i.rejected||(i.cur.element!==i.prev.element&&(i.prev.dropzone&&(c.leave=new ut(i,o,"dragleave"),o.dragLeave=c.leave.target=i.prev.element,o.prevDropzone=c.leave.dropzone=i.prev.dropzone),i.cur.dropzone&&(c.enter=new ut(i,o,"dragenter"),o.dragEnter=i.cur.element,o.dropzone=i.cur.dropzone)),o.type==="dragend"&&i.cur.dropzone&&(c.drop=new ut(i,o,"drop"),o.dropzone=i.cur.dropzone,o.relatedTarget=i.cur.element),o.type==="dragmove"&&i.cur.dropzone&&(c.move=new ut(i,o,"dropmove"),o.dropzone=i.cur.dropzone)),c}function gr(n,t){var o=n.dropState,i=o.activeDrops,c=o.cur,f=o.prev;t.leave&&f.dropzone.fire(t.leave),t.enter&&c.dropzone.fire(t.enter),t.move&&c.dropzone.fire(t.move),t.drop&&c.dropzone.fire(t.drop),t.deactivate&&Qo(i,t.deactivate),o.prev.dropzone=c.dropzone,o.prev.element=c.element}function qo(n,t){var o=n.interaction,i=n.iEvent,c=n.event;if(i.type==="dragmove"||i.type==="dragend"){var f=o.dropState;t.dynamicDrop&&(f.activeDrops=hr(t,o.element));var d=i,p=$o(o,d,c);f.rejected=f.rejected&&!!p&&p.dropzone===f.cur.dropzone&&p.element===f.cur.element,f.cur.dropzone=p&&p.dropzone,f.cur.element=p&&p.element,f.events=pr(o,0,d)}}var ei={id:"actions/drop",install:function(n){var t=n.actions,o=n.interactStatic,i=n.Interactable,c=n.defaults;n.usePlugin(re),i.prototype.dropzone=function(f){return function(d,p){if(E.object(p)){if(d.options.drop.enabled=p.enabled!==!1,p.listeners){var v=Ye(p.listeners),w=Object.keys(v).reduce(function(_,A){return _[/^(enter|leave)/.test(A)?"drag".concat(A):/^(activate|deactivate|move)/.test(A)?"drop".concat(A):A]=v[A],_},{}),y=d.options.drop.listeners;y&&d.off(y),d.on(w),d.options.drop.listeners=w}return E.func(p.ondrop)&&d.on("drop",p.ondrop),E.func(p.ondropactivate)&&d.on("dropactivate",p.ondropactivate),E.func(p.ondropdeactivate)&&d.on("dropdeactivate",p.ondropdeactivate),E.func(p.ondragenter)&&d.on("dragenter",p.ondragenter),E.func(p.ondragleave)&&d.on("dragleave",p.ondragleave),E.func(p.ondropmove)&&d.on("dropmove",p.ondropmove),/^(pointer|center)$/.test(p.overlap)?d.options.drop.overlap=p.overlap:E.number(p.overlap)&&(d.options.drop.overlap=Math.max(Math.min(1,p.overlap),0)),"accept"in p&&(d.options.drop.accept=p.accept),"checker"in p&&(d.options.drop.checker=p.checker),d}return E.bool(p)?(d.options.drop.enabled=p,d):d.options.drop}(this,f)},i.prototype.dropCheck=function(f,d,p,v,w,y){return function(_,A,X,V,K,se,ne){var ue=!1;if(!(ne=ne||_.getRect(se)))return!!_.options.drop.checker&&_.options.drop.checker(A,X,ue,_,se,V,K);var ye=_.options.drop.overlap;if(ye==="pointer"){var we=He(V,K,"drag"),de=Uo(A);de.x+=we.x,de.y+=we.y;var be=de.x>ne.left&&de.x<ne.right,je=de.y>ne.top&&de.y<ne.bottom;ue=be&&je}var Te=V.getRect(K);if(Te&&ye==="center"){var Me=Te.left+Te.width/2,Le=Te.top+Te.height/2;ue=Me>=ne.left&&Me<=ne.right&&Le>=ne.top&&Le<=ne.bottom}return Te&&E.number(ye)&&(ue=Math.max(0,Math.min(ne.right,Te.right)-Math.max(ne.left,Te.left))*Math.max(0,Math.min(ne.bottom,Te.bottom)-Math.max(ne.top,Te.top))/(Te.width*Te.height)>=ye),_.options.drop.checker&&(ue=_.options.drop.checker(A,X,ue,_,se,V,K)),ue}(this,f,d,p,v,w,y)},o.dynamicDrop=function(f){return E.bool(f)?(n.dynamicDrop=f,o):n.dynamicDrop},J(t.phaselessTypes,{dragenter:!0,dragleave:!0,dropactivate:!0,dropdeactivate:!0,dropmove:!0,drop:!0}),t.methodDict.drop="dropzone",n.dynamicDrop=!1,c.actions.drop=ei.defaults},listeners:{"interactions:before-action-start":function(n){var t=n.interaction;t.prepared.name==="drag"&&(t.dropState={cur:{dropzone:null,element:null},prev:{dropzone:null,element:null},rejected:null,events:null,activeDrops:[]})},"interactions:after-action-start":function(n,t){var o=n.interaction,i=n.iEvent;if(o.prepared.name==="drag"){var c=o.dropState;c.activeDrops=[],c.events={},c.activeDrops=hr(t,o.element),c.events=pr(o,0,i),c.events.activate&&(Qo(c.activeDrops,c.events.activate),t.fire("actions/drop:start",{interaction:o,dragEvent:i}))}},"interactions:action-move":qo,"interactions:after-action-move":function(n,t){var o=n.interaction,i=n.iEvent;if(o.prepared.name==="drag"){var c=o.dropState;gr(o,c.events),t.fire("actions/drop:move",{interaction:o,dragEvent:i}),c.events={}}},"interactions:action-end":function(n,t){if(n.interaction.prepared.name==="drag"){var o=n.interaction,i=n.iEvent;qo(n,t),gr(o,o.dropState.events),t.fire("actions/drop:end",{interaction:o,dragEvent:i})}},"interactions:stop":function(n){var t=n.interaction;if(t.prepared.name==="drag"){var o=t.dropState;o&&(o.activeDrops=null,o.events=null,o.cur.dropzone=null,o.cur.element=null,o.prev.dropzone=null,o.prev.element=null,o.rejected=!1)}}},getActiveDrops:hr,getDrop:$o,getDropEvents:pr,fireDropEvents:gr,filterEventType:function(n){return n.search("drag")===0||n.search("drop")===0},defaults:{enabled:!1,accept:null,overlap:"pointer"}},rc=ei;function mr(n){var t=n.interaction,o=n.iEvent,i=n.phase;if(t.prepared.name==="gesture"){var c=t.pointers.map(function(w){return w.pointer}),f=i==="start",d=i==="end",p=t.interactable.options.deltaSource;if(o.touches=[c[0],c[1]],f)o.distance=fr(c,p),o.box=ur(c),o.scale=1,o.ds=0,o.angle=dr(c,p),o.da=0,t.gesture.startDistance=o.distance,t.gesture.startAngle=o.angle;else if(d||t.pointers.length<2){var v=t.prevEvent;o.distance=v.distance,o.box=v.box,o.scale=v.scale,o.ds=0,o.angle=v.angle,o.da=0}else o.distance=fr(c,p),o.box=ur(c),o.scale=o.distance/t.gesture.startDistance,o.angle=dr(c,p),o.ds=o.scale-t.gesture.scale,o.da=o.angle-t.gesture.angle;t.gesture.distance=o.distance,t.gesture.angle=o.angle,E.number(o.scale)&&o.scale!==1/0&&!isNaN(o.scale)&&(t.gesture.scale=o.scale)}}var vr={id:"actions/gesture",before:["actions/drag","actions/resize"],install:function(n){var t=n.actions,o=n.Interactable,i=n.defaults;o.prototype.gesturable=function(c){return E.object(c)?(this.options.gesture.enabled=c.enabled!==!1,this.setPerAction("gesture",c),this.setOnEvents("gesture",c),this):E.bool(c)?(this.options.gesture.enabled=c,this):this.options.gesture},t.map.gesture=vr,t.methodDict.gesture="gesturable",i.actions.gesture=vr.defaults},listeners:{"interactions:action-start":mr,"interactions:action-move":mr,"interactions:action-end":mr,"interactions:new":function(n){n.interaction.gesture={angle:0,distance:0,scale:1,startAngle:0,startDistance:0}},"auto-start:check":function(n){if(!(n.interaction.pointers.length<2)){var t=n.interactable.options.gesture;if(t&&t.enabled)return n.action={name:"gesture"},!1}}},defaults:{},getCursor:function(){return""},filterEventType:function(n){return n.search("gesture")===0}},oc=vr;function ic(n,t,o,i,c,f,d){if(!t)return!1;if(t===!0){var p=E.number(f.width)?f.width:f.right-f.left,v=E.number(f.height)?f.height:f.bottom-f.top;if(d=Math.min(d,Math.abs((n==="left"||n==="right"?p:v)/2)),p<0&&(n==="left"?n="right":n==="right"&&(n="left")),v<0&&(n==="top"?n="bottom":n==="bottom"&&(n="top")),n==="left"){var w=p>=0?f.left:f.right;return o.x<w+d}if(n==="top"){var y=v>=0?f.top:f.bottom;return o.y<y+d}if(n==="right")return o.x>(p>=0?f.right:f.left)-d;if(n==="bottom")return o.y>(v>=0?f.bottom:f.top)-d}return!!E.element(i)&&(E.element(t)?t===i:ie(i,t,c))}function ti(n){var t=n.iEvent,o=n.interaction;if(o.prepared.name==="resize"&&o.resizeAxes){var i=t;o.interactable.options.resize.square?(o.resizeAxes==="y"?i.delta.x=i.delta.y:i.delta.y=i.delta.x,i.axes="xy"):(i.axes=o.resizeAxes,o.resizeAxes==="x"?i.delta.y=0:o.resizeAxes==="y"&&(i.delta.x=0))}}var Xe,ot,Ue={id:"actions/resize",before:["actions/drag"],install:function(n){var t=n.actions,o=n.browser,i=n.Interactable,c=n.defaults;Ue.cursors=function(f){return f.isIe9?{x:"e-resize",y:"s-resize",xy:"se-resize",top:"n-resize",left:"w-resize",bottom:"s-resize",right:"e-resize",topleft:"se-resize",bottomright:"se-resize",topright:"ne-resize",bottomleft:"ne-resize"}:{x:"ew-resize",y:"ns-resize",xy:"nwse-resize",top:"ns-resize",left:"ew-resize",bottom:"ns-resize",right:"ew-resize",topleft:"nwse-resize",bottomright:"nwse-resize",topright:"nesw-resize",bottomleft:"nesw-resize"}}(o),Ue.defaultMargin=o.supportsTouch||o.supportsPointerEvent?20:10,i.prototype.resizable=function(f){return function(d,p,v){return E.object(p)?(d.options.resize.enabled=p.enabled!==!1,d.setPerAction("resize",p),d.setOnEvents("resize",p),E.string(p.axis)&&/^x$|^y$|^xy$/.test(p.axis)?d.options.resize.axis=p.axis:p.axis===null&&(d.options.resize.axis=v.defaults.actions.resize.axis),E.bool(p.preserveAspectRatio)?d.options.resize.preserveAspectRatio=p.preserveAspectRatio:E.bool(p.square)&&(d.options.resize.square=p.square),d):E.bool(p)?(d.options.resize.enabled=p,d):d.options.resize}(this,f,n)},t.map.resize=Ue,t.methodDict.resize="resizable",c.actions.resize=Ue.defaults},listeners:{"interactions:new":function(n){n.interaction.resizeAxes="xy"},"interactions:action-start":function(n){(function(t){var o=t.iEvent,i=t.interaction;if(i.prepared.name==="resize"&&i.prepared.edges){var c=o,f=i.rect;i._rects={start:J({},f),corrected:J({},f),previous:J({},f),delta:{left:0,right:0,width:0,top:0,bottom:0,height:0}},c.edges=i.prepared.edges,c.rect=i._rects.corrected,c.deltaRect=i._rects.delta}})(n),ti(n)},"interactions:action-move":function(n){(function(t){var o=t.iEvent,i=t.interaction;if(i.prepared.name==="resize"&&i.prepared.edges){var c=o,f=i.interactable.options.resize.invert,d=f==="reposition"||f==="negate",p=i.rect,v=i._rects,w=v.start,y=v.corrected,_=v.delta,A=v.previous;if(J(A,y),d){if(J(y,p),f==="reposition"){if(y.top>y.bottom){var X=y.top;y.top=y.bottom,y.bottom=X}if(y.left>y.right){var V=y.left;y.left=y.right,y.right=V}}}else y.top=Math.min(p.top,w.bottom),y.bottom=Math.max(p.bottom,w.top),y.left=Math.min(p.left,w.right),y.right=Math.max(p.right,w.left);for(var K in y.width=y.right-y.left,y.height=y.bottom-y.top,y)_[K]=y[K]-A[K];c.edges=i.prepared.edges,c.rect=y,c.deltaRect=_}})(n),ti(n)},"interactions:action-end":function(n){var t=n.iEvent,o=n.interaction;if(o.prepared.name==="resize"&&o.prepared.edges){var i=t;i.edges=o.prepared.edges,i.rect=o._rects.corrected,i.deltaRect=o._rects.delta}},"auto-start:check":function(n){var t=n.interaction,o=n.interactable,i=n.element,c=n.rect,f=n.buttons;if(c){var d=J({},t.coords.cur.page),p=o.options.resize;if(p&&p.enabled&&(!t.pointerIsDown||!/mouse|pointer/.test(t.pointerType)||(f&p.mouseButtons)!=0)){if(E.object(p.edges)){var v={left:!1,right:!1,top:!1,bottom:!1};for(var w in v)v[w]=ic(w,p.edges[w],d,t._latestPointer.eventTarget,i,c,p.margin||Ue.defaultMargin);v.left=v.left&&!v.right,v.top=v.top&&!v.bottom,(v.left||v.right||v.top||v.bottom)&&(n.action={name:"resize",edges:v})}else{var y=p.axis!=="y"&&d.x>c.right-Ue.defaultMargin,_=p.axis!=="x"&&d.y>c.bottom-Ue.defaultMargin;(y||_)&&(n.action={name:"resize",axes:(y?"x":"")+(_?"y":"")})}return!n.action&&void 0}}}},defaults:{square:!1,preserveAspectRatio:!1,axis:"xy",margin:NaN,edges:null,invert:"none"},cursors:null,getCursor:function(n){var t=n.edges,o=n.axis,i=n.name,c=Ue.cursors,f=null;if(o)f=c[i+o];else if(t){for(var d="",p=0,v=["top","bottom","left","right"];p<v.length;p++){var w=v[p];t[w]&&(d+=w)}f=c[d]}return f},filterEventType:function(n){return n.search("resize")===0},defaultMargin:null},sc=Ue,ac={id:"actions",install:function(n){n.usePlugin(oc),n.usePlugin(sc),n.usePlugin(re),n.usePlugin(rc)}},ni=0,Ze={request:function(n){return Xe(n)},cancel:function(n){return ot(n)},init:function(n){if(Xe=n.requestAnimationFrame,ot=n.cancelAnimationFrame,!Xe)for(var t=["ms","moz","webkit","o"],o=0;o<t.length;o++){var i=t[o];Xe=n["".concat(i,"RequestAnimationFrame")],ot=n["".concat(i,"CancelAnimationFrame")]||n["".concat(i,"CancelRequestAnimationFrame")]}Xe=Xe&&Xe.bind(n),ot=ot&&ot.bind(n),Xe||(Xe=function(c){var f=Date.now(),d=Math.max(0,16-(f-ni)),p=n.setTimeout(function(){c(f+d)},d);return ni=f+d,p},ot=function(c){return clearTimeout(c)})}},he={defaults:{enabled:!1,margin:60,container:null,speed:300},now:Date.now,interaction:null,i:0,x:0,y:0,isScrolling:!1,prevTime:0,margin:0,speed:0,start:function(n){he.isScrolling=!0,Ze.cancel(he.i),n.autoScroll=he,he.interaction=n,he.prevTime=he.now(),he.i=Ze.request(he.scroll)},stop:function(){he.isScrolling=!1,he.interaction&&(he.interaction.autoScroll=null),Ze.cancel(he.i)},scroll:function(){var n=he.interaction,t=n.interactable,o=n.element,i=n.prepared.name,c=t.options[i].autoScroll,f=ri(c.container,t,o),d=he.now(),p=(d-he.prevTime)/1e3,v=c.speed*p;if(v>=1){var w={x:he.x*v,y:he.y*v};if(w.x||w.y){var y=oi(f);E.window(f)?f.scrollBy(w.x,w.y):f&&(f.scrollLeft+=w.x,f.scrollTop+=w.y);var _=oi(f),A={x:_.x-y.x,y:_.y-y.y};(A.x||A.y)&&t.fire({type:"autoscroll",target:o,interactable:t,delta:A,interaction:n,container:f})}he.prevTime=d}he.isScrolling&&(Ze.cancel(he.i),he.i=Ze.request(he.scroll))},check:function(n,t){var o;return(o=n.options[t].autoScroll)==null?void 0:o.enabled},onInteractionMove:function(n){var t=n.interaction,o=n.pointer;if(t.interacting()&&he.check(t.interactable,t.prepared.name))if(t.simulation)he.x=he.y=0;else{var i,c,f,d,p=t.interactable,v=t.element,w=t.prepared.name,y=p.options[w].autoScroll,_=ri(y.container,p,v);if(E.window(_))d=o.clientX<he.margin,i=o.clientY<he.margin,c=o.clientX>_.innerWidth-he.margin,f=o.clientY>_.innerHeight-he.margin;else{var A=ve(_);d=o.clientX<A.left+he.margin,i=o.clientY<A.top+he.margin,c=o.clientX>A.right-he.margin,f=o.clientY>A.bottom-he.margin}he.x=c?1:d?-1:0,he.y=f?1:i?-1:0,he.isScrolling||(he.margin=y.margin,he.speed=y.speed,he.start(t))}}};function ri(n,t,o){return(E.string(n)?ze(n,t,o):n)||G(o)}function oi(n){return E.window(n)&&(n=window.document.body),{x:n.scrollLeft,y:n.scrollTop}}var cc={id:"auto-scroll",install:function(n){var t=n.defaults,o=n.actions;n.autoScroll=he,he.now=function(){return n.now()},o.phaselessTypes.autoscroll=!0,t.perAction.autoScroll=he.defaults},listeners:{"interactions:new":function(n){n.interaction.autoScroll=null},"interactions:destroy":function(n){n.interaction.autoScroll=null,he.stop(),he.interaction&&(he.interaction=null)},"interactions:stop":he.stop,"interactions:action-move":function(n){return he.onInteractionMove(n)}}},lc=cc;function Ot(n,t){var o=!1;return function(){return o||(Q.console.warn(t),o=!0),n.apply(this,arguments)}}function yr(n,t){return n.name=t.name,n.axis=t.axis,n.edges=t.edges,n}function uc(n){return E.bool(n)?(this.options.styleCursor=n,this):n===null?(delete this.options.styleCursor,this):this.options.styleCursor}function fc(n){return E.func(n)?(this.options.actionChecker=n,this):n===null?(delete this.options.actionChecker,this):this.options.actionChecker}var dc={id:"auto-start/interactableMethods",install:function(n){var t=n.Interactable;t.prototype.getAction=function(o,i,c,f){var d=function(p,v,w,y,_){var A=p.getRect(y),X=v.buttons||{0:1,1:4,3:8,4:16}[v.button],V={action:null,interactable:p,interaction:w,element:y,rect:A,buttons:X};return _.fire("auto-start:check",V),V.action}(this,i,c,f,n);return this.options.actionChecker?this.options.actionChecker(o,i,d,this,f,c):d},t.prototype.ignoreFrom=Ot(function(o){return this._backCompatOption("ignoreFrom",o)},"Interactable.ignoreFrom() has been deprecated. Use Interactble.draggable({ignoreFrom: newValue})."),t.prototype.allowFrom=Ot(function(o){return this._backCompatOption("allowFrom",o)},"Interactable.allowFrom() has been deprecated. Use Interactble.draggable({allowFrom: newValue})."),t.prototype.actionChecker=fc,t.prototype.styleCursor=uc}};function ii(n,t,o,i,c){return t.testIgnoreAllow(t.options[n.name],o,i)&&t.options[n.name].enabled&&En(t,o,n,c)?n:null}function hc(n,t,o,i,c,f,d){for(var p=0,v=i.length;p<v;p++){var w=i[p],y=c[p],_=w.getAction(t,o,n,y);if(_){var A=ii(_,w,y,f,d);if(A)return{action:A,interactable:w,element:y}}}return{action:null,interactable:null,element:null}}function si(n,t,o,i,c){var f=[],d=[],p=i;function v(y){f.push(y),d.push(p)}for(;E.element(p);){f=[],d=[],c.interactables.forEachMatch(p,v);var w=hc(n,t,o,f,d,i,c);if(w.action&&!w.interactable.options[w.action.name].manualStart)return w;p=H(p)}return{action:null,interactable:null,element:null}}function ai(n,t,o){var i=t.action,c=t.interactable,f=t.element;i=i||{name:null},n.interactable=c,n.element=f,yr(n.prepared,i),n.rect=c&&i.name?c.getRect(f):null,li(n,o),o.fire("autoStart:prepared",{interaction:n})}function En(n,t,o,i){var c=n.options,f=c[o.name].max,d=c[o.name].maxPerElement,p=i.autoStart.maxInteractions,v=0,w=0,y=0;if(!(f&&d&&p))return!1;for(var _=0,A=i.interactions.list;_<A.length;_++){var X=A[_],V=X.prepared.name;if(X.interacting()&&(++v>=p||X.interactable===n&&((w+=V===o.name?1:0)>=f||X.element===t&&(y++,V===o.name&&y>=d))))return!1}return p>0}function ci(n,t){return E.number(n)?(t.autoStart.maxInteractions=n,this):t.autoStart.maxInteractions}function br(n,t,o){var i=o.autoStart.cursorElement;i&&i!==n&&(i.style.cursor=""),n.ownerDocument.documentElement.style.cursor=t,n.style.cursor=t,o.autoStart.cursorElement=t?n:null}function li(n,t){var o=n.interactable,i=n.element,c=n.prepared;if(n.pointerType==="mouse"&&o&&o.options.styleCursor){var f="";if(c.name){var d=o.options[c.name].cursorChecker;f=E.func(d)?d(c,o,i,n._interacting):t.actions.map[c.name].getCursor(c)}br(n.element,f||"",t)}else t.autoStart.cursorElement&&br(t.autoStart.cursorElement,"",t)}var pc={id:"auto-start/base",before:["actions"],install:function(n){var t=n.interactStatic,o=n.defaults;n.usePlugin(dc),o.base.actionChecker=null,o.base.styleCursor=!0,J(o.perAction,{manualStart:!1,max:1/0,maxPerElement:1,allowFrom:null,ignoreFrom:null,mouseButtons:1}),t.maxInteractions=function(i){return ci(i,n)},n.autoStart={maxInteractions:1/0,withinInteractionLimit:En,cursorElement:null}},listeners:{"interactions:down":function(n,t){var o=n.interaction,i=n.pointer,c=n.event,f=n.eventTarget;o.interacting()||ai(o,si(o,i,c,f,t),t)},"interactions:move":function(n,t){(function(o,i){var c=o.interaction,f=o.pointer,d=o.event,p=o.eventTarget;c.pointerType!=="mouse"||c.pointerIsDown||c.interacting()||ai(c,si(c,f,d,p,i),i)})(n,t),function(o,i){var c=o.interaction;if(c.pointerIsDown&&!c.interacting()&&c.pointerWasMoved&&c.prepared.name){i.fire("autoStart:before-start",o);var f=c.interactable,d=c.prepared.name;d&&f&&(f.options[d].manualStart||!En(f,c.element,c.prepared,i)?c.stop():(c.start(c.prepared,f,c.element),li(c,i)))}}(n,t)},"interactions:stop":function(n,t){var o=n.interaction,i=o.interactable;i&&i.options.styleCursor&&br(o.element,"",t)}},maxInteractions:ci,withinInteractionLimit:En,validateAction:ii},xr=pc,gc={id:"auto-start/dragAxis",listeners:{"autoStart:before-start":function(n,t){var o=n.interaction,i=n.eventTarget,c=n.dx,f=n.dy;if(o.prepared.name==="drag"){var d=Math.abs(c),p=Math.abs(f),v=o.interactable.options.drag,w=v.startAxis,y=d>p?"x":d<p?"y":"xy";if(o.prepared.axis=v.lockAxis==="start"?y[0]:v.lockAxis,y!=="xy"&&w!=="xy"&&w!==y){o.prepared.name=null;for(var _=i,A=function(V){if(V!==o.interactable){var K=o.interactable.options.drag;if(!K.manualStart&&V.testIgnoreAllow(K,_,i)){var se=V.getAction(o.downPointer,o.downEvent,o,_);if(se&&se.name==="drag"&&function(ne,ue){if(!ue)return!1;var ye=ue.options.drag.startAxis;return ne==="xy"||ye==="xy"||ye===ne}(y,V)&&xr.validateAction(se,V,_,i,t))return V}}};E.element(_);){var X=t.interactables.forEachMatch(_,A);if(X){o.prepared.name="drag",o.interactable=X,o.element=_;break}_=H(_)}}}}}};function wr(n){var t=n.prepared&&n.prepared.name;if(!t)return null;var o=n.interactable.options;return o[t].hold||o[t].delay}var mc={id:"auto-start/hold",install:function(n){var t=n.defaults;n.usePlugin(xr),t.perAction.hold=0,t.perAction.delay=0},listeners:{"interactions:new":function(n){n.interaction.autoStartHoldTimer=null},"autoStart:prepared":function(n){var t=n.interaction,o=wr(t);o>0&&(t.autoStartHoldTimer=setTimeout(function(){t.start(t.prepared,t.interactable,t.element)},o))},"interactions:move":function(n){var t=n.interaction,o=n.duplicate;t.autoStartHoldTimer&&t.pointerWasMoved&&!o&&(clearTimeout(t.autoStartHoldTimer),t.autoStartHoldTimer=null)},"autoStart:before-start":function(n){var t=n.interaction;wr(t)>0&&(t.prepared.name=null)}},getHoldDuration:wr},vc=mc,yc={id:"auto-start",install:function(n){n.usePlugin(xr),n.usePlugin(vc),n.usePlugin(gc)}},bc=function(n){return/^(always|never|auto)$/.test(n)?(this.options.preventDefault=n,this):E.bool(n)?(this.options.preventDefault=n?"always":"never",this):this.options.preventDefault};function xc(n){var t=n.interaction,o=n.event;t.interactable&&t.interactable.checkAndPreventDefault(o)}var ui={id:"core/interactablePreventDefault",install:function(n){var t=n.Interactable;t.prototype.preventDefault=bc,t.prototype.checkAndPreventDefault=function(o){return function(i,c,f){var d=i.options.preventDefault;if(d!=="never")if(d!=="always"){if(c.events.supportsPassive&&/^touch(start|move)$/.test(f.type)){var p=G(f.target).document,v=c.getDocOptions(p);if(!v||!v.events||v.events.passive!==!1)return}/^(mouse|pointer|touch)*(down|start)/i.test(f.type)||E.element(f.target)&&C(f.target,"input,select,textarea,[contenteditable=true],[contenteditable=true] *")||f.preventDefault()}else f.preventDefault()}(this,n,o)},n.interactions.docEvents.push({type:"dragstart",listener:function(o){for(var i=0,c=n.interactions.list;i<c.length;i++){var f=c[i];if(f.element&&(f.element===o.target||ee(f.element,o.target)))return void f.interactable.checkAndPreventDefault(o)}}})},listeners:["down","move","up","cancel"].reduce(function(n,t){return n["interactions:".concat(t)]=xc,n},{})};function Nn(n,t){if(t.phaselessTypes[n])return!0;for(var o in t.map)if(n.indexOf(o)===0&&n.substr(o.length)in t.phases)return!0;return!1}function ft(n){var t={};for(var o in n){var i=n[o];E.plainObject(i)?t[o]=ft(i):E.array(i)?t[o]=Zo(i):t[o]=i}return t}var Er=function(){function n(t){u(this,n),this.states=[],this.startOffset={left:0,right:0,top:0,bottom:0},this.startDelta=void 0,this.result=void 0,this.endResult=void 0,this.startEdges=void 0,this.edges=void 0,this.interaction=void 0,this.interaction=t,this.result=Sn(),this.edges={left:!1,right:!1,top:!1,bottom:!1}}return g(n,[{key:"start",value:function(t,o){var i,c,f=t.phase,d=this.interaction,p=function(w){var y=w.interactable.options[w.prepared.name],_=y.modifiers;return _&&_.length?_:["snap","snapSize","snapEdges","restrict","restrictEdges","restrictSize"].map(function(A){var X=y[A];return X&&X.enabled&&{options:X,methods:X._methods}}).filter(function(A){return!!A})}(d);this.prepareStates(p),this.startEdges=J({},d.edges),this.edges=J({},this.startEdges),this.startOffset=(i=d.rect,c=o,i?{left:c.x-i.left,top:c.y-i.top,right:i.right-c.x,bottom:i.bottom-c.y}:{left:0,top:0,right:0,bottom:0}),this.startDelta={x:0,y:0};var v=this.fillArg({phase:f,pageCoords:o,preEnd:!1});return this.result=Sn(),this.startAll(v),this.result=this.setAll(v)}},{key:"fillArg",value:function(t){var o=this.interaction;return t.interaction=o,t.interactable=o.interactable,t.element=o.element,t.rect||(t.rect=o.rect),t.edges||(t.edges=this.startEdges),t.startOffset=this.startOffset,t}},{key:"startAll",value:function(t){for(var o=0,i=this.states;o<i.length;o++){var c=i[o];c.methods.start&&(t.state=c,c.methods.start(t))}}},{key:"setAll",value:function(t){var o=t.phase,i=t.preEnd,c=t.skipModifiers,f=t.rect,d=t.edges;t.coords=J({},t.pageCoords),t.rect=J({},f),t.edges=J({},d);for(var p=c?this.states.slice(c):this.states,v=Sn(t.coords,t.rect),w=0;w<p.length;w++){var y,_=p[w],A=_.options,X=J({},t.coords),V=null;(y=_.methods)!=null&&y.set&&this.shouldDo(A,i,o)&&(t.state=_,V=_.methods.set(t),Ae(t.edges,t.rect,{x:t.coords.x-X.x,y:t.coords.y-X.y})),v.eventProps.push(V)}J(this.edges,t.edges),v.delta.x=t.coords.x-t.pageCoords.x,v.delta.y=t.coords.y-t.pageCoords.y,v.rectDelta.left=t.rect.left-f.left,v.rectDelta.right=t.rect.right-f.right,v.rectDelta.top=t.rect.top-f.top,v.rectDelta.bottom=t.rect.bottom-f.bottom;var K=this.result.coords,se=this.result.rect;if(K&&se){var ne=v.rect.left!==se.left||v.rect.right!==se.right||v.rect.top!==se.top||v.rect.bottom!==se.bottom;v.changed=ne||K.x!==v.coords.x||K.y!==v.coords.y}return v}},{key:"applyToInteraction",value:function(t){var o=this.interaction,i=t.phase,c=o.coords.cur,f=o.coords.start,d=this.result,p=this.startDelta,v=d.delta;i==="start"&&J(this.startDelta,d.delta);for(var w=0,y=[[f,p],[c,v]];w<y.length;w++){var _=y[w],A=_[0],X=_[1];A.page.x+=X.x,A.page.y+=X.y,A.client.x+=X.x,A.client.y+=X.y}var V=this.result.rectDelta,K=t.rect||o.rect;K.left+=V.left,K.right+=V.right,K.top+=V.top,K.bottom+=V.bottom,K.width=K.right-K.left,K.height=K.bottom-K.top}},{key:"setAndApply",value:function(t){var o=this.interaction,i=t.phase,c=t.preEnd,f=t.skipModifiers,d=this.setAll(this.fillArg({preEnd:c,phase:i,pageCoords:t.modifiedCoords||o.coords.cur.page}));if(this.result=d,!d.changed&&(!f||f<this.states.length)&&o.interacting())return!1;if(t.modifiedCoords){var p=o.coords.cur.page,v={x:t.modifiedCoords.x-p.x,y:t.modifiedCoords.y-p.y};d.coords.x+=v.x,d.coords.y+=v.y,d.delta.x+=v.x,d.delta.y+=v.y}this.applyToInteraction(t)}},{key:"beforeEnd",value:function(t){var o=t.interaction,i=t.event,c=this.states;if(c&&c.length){for(var f=!1,d=0;d<c.length;d++){var p=c[d];t.state=p;var v=p.options,w=p.methods,y=w.beforeEnd&&w.beforeEnd(t);if(y)return this.endResult=y,!1;f=f||!f&&this.shouldDo(v,!0,t.phase,!0)}f&&o.move({event:i,preEnd:!0})}}},{key:"stop",value:function(t){var o=t.interaction;if(this.states&&this.states.length){var i=J({states:this.states,interactable:o.interactable,element:o.element,rect:null},t);this.fillArg(i);for(var c=0,f=this.states;c<f.length;c++){var d=f[c];i.state=d,d.methods.stop&&d.methods.stop(i)}this.states=null,this.endResult=null}}},{key:"prepareStates",value:function(t){this.states=[];for(var o=0;o<t.length;o++){var i=t[o],c=i.options,f=i.methods,d=i.name;this.states.push({options:c,methods:f,index:o,name:d})}return this.states}},{key:"restoreInteractionCoords",value:function(t){var o=t.interaction,i=o.coords,c=o.rect,f=o.modification;if(f.result){for(var d=f.startDelta,p=f.result,v=p.delta,w=p.rectDelta,y=0,_=[[i.start,d],[i.cur,v]];y<_.length;y++){var A=_[y],X=A[0],V=A[1];X.page.x-=V.x,X.page.y-=V.y,X.client.x-=V.x,X.client.y-=V.y}c.left-=w.left,c.right-=w.right,c.top-=w.top,c.bottom-=w.bottom}}},{key:"shouldDo",value:function(t,o,i,c){return!(!t||t.enabled===!1||c&&!t.endOnly||t.endOnly&&!o||i==="start"&&!t.setStart)}},{key:"copyFrom",value:function(t){this.startOffset=t.startOffset,this.startDelta=t.startDelta,this.startEdges=t.startEdges,this.edges=t.edges,this.states=t.states.map(function(o){return ft(o)}),this.result=Sn(J({},t.result.coords),J({},t.result.rect))}},{key:"destroy",value:function(){for(var t in this)this[t]=null}}]),n}();function Sn(n,t){return{rect:t,coords:n,delta:{x:0,y:0},rectDelta:{left:0,right:0,top:0,bottom:0},eventProps:[],changed:!0}}function Qe(n,t){var o=n.defaults,i={start:n.start,set:n.set,beforeEnd:n.beforeEnd,stop:n.stop},c=function(f){var d=f||{};for(var p in d.enabled=d.enabled!==!1,o)p in d||(d[p]=o[p]);var v={options:d,methods:i,name:t,enable:function(){return d.enabled=!0,v},disable:function(){return d.enabled=!1,v}};return v};return t&&typeof t=="string"&&(c._defaults=o,c._methods=i),c}function It(n){var t=n.iEvent,o=n.interaction.modification.result;o&&(t.modifiers=o.eventProps)}var wc={id:"modifiers/base",before:["actions"],install:function(n){n.defaults.perAction.modifiers=[]},listeners:{"interactions:new":function(n){var t=n.interaction;t.modification=new Er(t)},"interactions:before-action-start":function(n){var t=n.interaction,o=n.interaction.modification;o.start(n,t.coords.start.page),t.edges=o.edges,o.applyToInteraction(n)},"interactions:before-action-move":function(n){var t=n.interaction,o=t.modification,i=o.setAndApply(n);return t.edges=o.edges,i},"interactions:before-action-end":function(n){var t=n.interaction,o=t.modification,i=o.beforeEnd(n);return t.edges=o.startEdges,i},"interactions:action-start":It,"interactions:action-move":It,"interactions:action-end":It,"interactions:after-action-start":function(n){return n.interaction.modification.restoreInteractionCoords(n)},"interactions:after-action-move":function(n){return n.interaction.modification.restoreInteractionCoords(n)},"interactions:stop":function(n){return n.interaction.modification.stop(n)}}},fi=wc,di={base:{preventDefault:"auto",deltaSource:"page"},perAction:{enabled:!1,origin:{x:0,y:0}},actions:{}},Nr=function(n){S(o,n);var t=j(o);function o(i,c,f,d,p,v,w){var y;u(this,o),(y=t.call(this,i)).relatedTarget=null,y.screenX=void 0,y.screenY=void 0,y.button=void 0,y.buttons=void 0,y.ctrlKey=void 0,y.shiftKey=void 0,y.altKey=void 0,y.metaKey=void 0,y.page=void 0,y.client=void 0,y.delta=void 0,y.rect=void 0,y.x0=void 0,y.y0=void 0,y.t0=void 0,y.dt=void 0,y.duration=void 0,y.clientX0=void 0,y.clientY0=void 0,y.velocity=void 0,y.speed=void 0,y.swipe=void 0,y.axes=void 0,y.preEnd=void 0,p=p||i.element;var _=i.interactable,A=(_&&_.options||di).deltaSource,X=He(_,p,f),V=d==="start",K=d==="end",se=V?O(y):i.prevEvent,ne=V?i.coords.start:K?{page:se.page,client:se.client,timeStamp:i.coords.cur.timeStamp}:i.coords.cur;return y.page=J({},ne.page),y.client=J({},ne.client),y.rect=J({},i.rect),y.timeStamp=ne.timeStamp,K||(y.page.x-=X.x,y.page.y-=X.y,y.client.x-=X.x,y.client.y-=X.y),y.ctrlKey=c.ctrlKey,y.altKey=c.altKey,y.shiftKey=c.shiftKey,y.metaKey=c.metaKey,y.button=c.button,y.buttons=c.buttons,y.target=p,y.currentTarget=p,y.preEnd=v,y.type=w||f+(d||""),y.interactable=_,y.t0=V?i.pointers[i.pointers.length-1].downTime:se.t0,y.x0=i.coords.start.page.x-X.x,y.y0=i.coords.start.page.y-X.y,y.clientX0=i.coords.start.client.x-X.x,y.clientY0=i.coords.start.client.y-X.y,y.delta=V||K?{x:0,y:0}:{x:y[A].x-se[A].x,y:y[A].y-se[A].y},y.dt=i.coords.delta.timeStamp,y.duration=y.timeStamp-y.t0,y.velocity=J({},i.coords.velocity[A]),y.speed=Ct(y.velocity.x,y.velocity.y),y.swipe=K||d==="inertiastart"?y.getSwipe():null,y}return g(o,[{key:"getSwipe",value:function(){var i=this._interaction;if(i.prevEvent.speed<600||this.timeStamp-i.prevEvent.timeStamp>150)return null;var c=180*Math.atan2(i.prevEvent.velocityY,i.prevEvent.velocityX)/Math.PI;c<0&&(c+=360);var f=112.5<=c&&c<247.5,d=202.5<=c&&c<337.5;return{up:d,down:!d&&22.5<=c&&c<157.5,left:f,right:!f&&(292.5<=c||c<67.5),angle:c,speed:i.prevEvent.speed,velocity:{x:i.prevEvent.velocityX,y:i.prevEvent.velocityY}}}},{key:"preventDefault",value:function(){}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}}]),o}(wn);Object.defineProperties(Nr.prototype,{pageX:{get:function(){return this.page.x},set:function(n){this.page.x=n}},pageY:{get:function(){return this.page.y},set:function(n){this.page.y=n}},clientX:{get:function(){return this.client.x},set:function(n){this.client.x=n}},clientY:{get:function(){return this.client.y},set:function(n){this.client.y=n}},dx:{get:function(){return this.delta.x},set:function(n){this.delta.x=n}},dy:{get:function(){return this.delta.y},set:function(n){this.delta.y=n}},velocityX:{get:function(){return this.velocity.x},set:function(n){this.velocity.x=n}},velocityY:{get:function(){return this.velocity.y},set:function(n){this.velocity.y=n}}});var Ec=g(function n(t,o,i,c,f){u(this,n),this.id=void 0,this.pointer=void 0,this.event=void 0,this.downTime=void 0,this.downTarget=void 0,this.id=t,this.pointer=o,this.event=i,this.downTime=c,this.downTarget=f}),Nc=function(n){return n.interactable="",n.element="",n.prepared="",n.pointerIsDown="",n.pointerWasMoved="",n._proxy="",n}({}),hi=function(n){return n.start="",n.move="",n.end="",n.stop="",n.interacting="",n}({}),Sc=0,Tc=function(){function n(t){var o=this,i=t.pointerType,c=t.scopeFire;u(this,n),this.interactable=null,this.element=null,this.rect=null,this._rects=void 0,this.edges=null,this._scopeFire=void 0,this.prepared={name:null,axis:null,edges:null},this.pointerType=void 0,this.pointers=[],this.downEvent=null,this.downPointer={},this._latestPointer={pointer:null,event:null,eventTarget:null},this.prevEvent=null,this.pointerIsDown=!1,this.pointerWasMoved=!1,this._interacting=!1,this._ending=!1,this._stopped=!0,this._proxy=void 0,this.simulation=null,this.doMove=Ot(function(y){this.move(y)},"The interaction.doMove() method has been renamed to interaction.move()"),this.coords={start:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},prev:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},cur:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},delta:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},velocity:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0}},this._id=Sc++,this._scopeFire=c,this.pointerType=i;var f=this;this._proxy={};var d=function(y){Object.defineProperty(o._proxy,y,{get:function(){return f[y]}})};for(var p in Nc)d(p);var v=function(y){Object.defineProperty(o._proxy,y,{value:function(){return f[y].apply(f,arguments)}})};for(var w in hi)v(w);this._scopeFire("interactions:new",{interaction:this})}return g(n,[{key:"pointerMoveTolerance",get:function(){return 1}},{key:"pointerDown",value:function(t,o,i){var c=this.updatePointer(t,o,i,!0),f=this.pointers[c];this._scopeFire("interactions:down",{pointer:t,event:o,eventTarget:i,pointerIndex:c,pointerInfo:f,type:"down",interaction:this})}},{key:"start",value:function(t,o,i){return!(this.interacting()||!this.pointerIsDown||this.pointers.length<(t.name==="gesture"?2:1)||!o.options[t.name].enabled)&&(yr(this.prepared,t),this.interactable=o,this.element=i,this.rect=o.getRect(i),this.edges=this.prepared.edges?J({},this.prepared.edges):{left:!0,right:!0,top:!0,bottom:!0},this._stopped=!1,this._interacting=this._doPhase({interaction:this,event:this.downEvent,phase:"start"})&&!this._stopped,this._interacting)}},{key:"pointerMove",value:function(t,o,i){this.simulation||this.modification&&this.modification.endResult||this.updatePointer(t,o,i,!1);var c,f,d=this.coords.cur.page.x===this.coords.prev.page.x&&this.coords.cur.page.y===this.coords.prev.page.y&&this.coords.cur.client.x===this.coords.prev.client.x&&this.coords.cur.client.y===this.coords.prev.client.y;this.pointerIsDown&&!this.pointerWasMoved&&(c=this.coords.cur.client.x-this.coords.start.client.x,f=this.coords.cur.client.y-this.coords.start.client.y,this.pointerWasMoved=Ct(c,f)>this.pointerMoveTolerance);var p,v,w,y=this.getPointerIndex(t),_={pointer:t,pointerIndex:y,pointerInfo:this.pointers[y],event:o,type:"move",eventTarget:i,dx:c,dy:f,duplicate:d,interaction:this};d||(p=this.coords.velocity,v=this.coords.delta,w=Math.max(v.timeStamp/1e3,.001),p.page.x=v.page.x/w,p.page.y=v.page.y/w,p.client.x=v.client.x/w,p.client.y=v.client.y/w,p.timeStamp=w),this._scopeFire("interactions:move",_),d||this.simulation||(this.interacting()&&(_.type=null,this.move(_)),this.pointerWasMoved&&bn(this.coords.prev,this.coords.cur))}},{key:"move",value:function(t){t&&t.event||Yo(this.coords.delta),(t=J({pointer:this._latestPointer.pointer,event:this._latestPointer.event,eventTarget:this._latestPointer.eventTarget,interaction:this},t||{})).phase="move",this._doPhase(t)}},{key:"pointerUp",value:function(t,o,i,c){var f=this.getPointerIndex(t);f===-1&&(f=this.updatePointer(t,o,i,!1));var d=/cancel$/i.test(o.type)?"cancel":"up";this._scopeFire("interactions:".concat(d),{pointer:t,pointerIndex:f,pointerInfo:this.pointers[f],event:o,eventTarget:i,type:d,curEventTarget:c,interaction:this}),this.simulation||this.end(o),this.removePointer(t,o)}},{key:"documentBlur",value:function(t){this.end(t),this._scopeFire("interactions:blur",{event:t,type:"blur",interaction:this})}},{key:"end",value:function(t){var o;this._ending=!0,t=t||this._latestPointer.event,this.interacting()&&(o=this._doPhase({event:t,interaction:this,phase:"end"})),this._ending=!1,o===!0&&this.stop()}},{key:"currentAction",value:function(){return this._interacting?this.prepared.name:null}},{key:"interacting",value:function(){return this._interacting}},{key:"stop",value:function(){this._scopeFire("interactions:stop",{interaction:this}),this.interactable=this.element=null,this._interacting=!1,this._stopped=!0,this.prepared.name=this.prevEvent=null}},{key:"getPointerIndex",value:function(t){var o=kt(t);return this.pointerType==="mouse"||this.pointerType==="pen"?this.pointers.length-1:_t(this.pointers,function(i){return i.id===o})}},{key:"getPointerInfo",value:function(t){return this.pointers[this.getPointerIndex(t)]}},{key:"updatePointer",value:function(t,o,i,c){var f,d,p,v=kt(t),w=this.getPointerIndex(t),y=this.pointers[w];return c=c!==!1&&(c||/(down|start)$/i.test(o.type)),y?y.pointer=t:(y=new Ec(v,t,o,null,null),w=this.pointers.length,this.pointers.push(y)),nc(this.coords.cur,this.pointers.map(function(_){return _.pointer}),this._now()),f=this.coords.delta,d=this.coords.prev,p=this.coords.cur,f.page.x=p.page.x-d.page.x,f.page.y=p.page.y-d.page.y,f.client.x=p.client.x-d.client.x,f.client.y=p.client.y-d.client.y,f.timeStamp=p.timeStamp-d.timeStamp,c&&(this.pointerIsDown=!0,y.downTime=this.coords.cur.timeStamp,y.downTarget=i,yn(this.downPointer,t),this.interacting()||(bn(this.coords.start,this.coords.cur),bn(this.coords.prev,this.coords.cur),this.downEvent=o,this.pointerWasMoved=!1)),this._updateLatestPointer(t,o,i),this._scopeFire("interactions:update-pointer",{pointer:t,event:o,eventTarget:i,down:c,pointerInfo:y,pointerIndex:w,interaction:this}),w}},{key:"removePointer",value:function(t,o){var i=this.getPointerIndex(t);if(i!==-1){var c=this.pointers[i];this._scopeFire("interactions:remove-pointer",{pointer:t,event:o,eventTarget:null,pointerIndex:i,pointerInfo:c,interaction:this}),this.pointers.splice(i,1),this.pointerIsDown=!1}}},{key:"_updateLatestPointer",value:function(t,o,i){this._latestPointer.pointer=t,this._latestPointer.event=o,this._latestPointer.eventTarget=i}},{key:"destroy",value:function(){this._latestPointer.pointer=null,this._latestPointer.event=null,this._latestPointer.eventTarget=null}},{key:"_createPreparedEvent",value:function(t,o,i,c){return new Nr(this,t,this.prepared.name,o,this.element,i,c)}},{key:"_fireEvent",value:function(t){var o;(o=this.interactable)==null||o.fire(t),(!this.prevEvent||t.timeStamp>=this.prevEvent.timeStamp)&&(this.prevEvent=t)}},{key:"_doPhase",value:function(t){var o=t.event,i=t.phase,c=t.preEnd,f=t.type,d=this.rect;if(d&&i==="move"&&(Ae(this.edges,d,this.coords.delta[this.interactable.options.deltaSource]),d.width=d.right-d.left,d.height=d.bottom-d.top),this._scopeFire("interactions:before-action-".concat(i),t)===!1)return!1;var p=t.iEvent=this._createPreparedEvent(o,i,c,f);return this._scopeFire("interactions:action-".concat(i),t),i==="start"&&(this.prevEvent=p),this._fireEvent(p),this._scopeFire("interactions:after-action-".concat(i),t),!0}},{key:"_now",value:function(){return Date.now()}}]),n}();function pi(n){gi(n.interaction)}function gi(n){if(!function(o){return!(!o.offset.pending.x&&!o.offset.pending.y)}(n))return!1;var t=n.offset.pending;return Sr(n.coords.cur,t),Sr(n.coords.delta,t),Ae(n.edges,n.rect,t),t.x=0,t.y=0,!0}function Cc(n){var t=n.x,o=n.y;this.offset.pending.x+=t,this.offset.pending.y+=o,this.offset.total.x+=t,this.offset.total.y+=o}function Sr(n,t){var o=n.page,i=n.client,c=t.x,f=t.y;o.x+=c,o.y+=f,i.x+=c,i.y+=f}hi.offsetBy="";var kc={id:"offset",before:["modifiers","pointer-events","actions","inertia"],install:function(n){n.Interaction.prototype.offsetBy=Cc},listeners:{"interactions:new":function(n){n.interaction.offset={total:{x:0,y:0},pending:{x:0,y:0}}},"interactions:update-pointer":function(n){return function(t){t.pointerIsDown&&(Sr(t.coords.cur,t.offset.total),t.offset.pending.x=0,t.offset.pending.y=0)}(n.interaction)},"interactions:before-action-start":pi,"interactions:before-action-move":pi,"interactions:before-action-end":function(n){var t=n.interaction;if(gi(t))return t.move({offset:!0}),t.end(),!1},"interactions:stop":function(n){var t=n.interaction;t.offset.total.x=0,t.offset.total.y=0,t.offset.pending.x=0,t.offset.pending.y=0}}},mi=kc,_c=function(){function n(t){u(this,n),this.active=!1,this.isModified=!1,this.smoothEnd=!1,this.allowResume=!1,this.modification=void 0,this.modifierCount=0,this.modifierArg=void 0,this.startCoords=void 0,this.t0=0,this.v0=0,this.te=0,this.targetOffset=void 0,this.modifiedOffset=void 0,this.currentOffset=void 0,this.lambda_v0=0,this.one_ve_v0=0,this.timeout=void 0,this.interaction=void 0,this.interaction=t}return g(n,[{key:"start",value:function(t){var o=this.interaction,i=Tn(o);if(!i||!i.enabled)return!1;var c=o.coords.velocity.client,f=Ct(c.x,c.y),d=this.modification||(this.modification=new Er(o));if(d.copyFrom(o.modification),this.t0=o._now(),this.allowResume=i.allowResume,this.v0=f,this.currentOffset={x:0,y:0},this.startCoords=o.coords.cur.page,this.modifierArg=d.fillArg({pageCoords:this.startCoords,preEnd:!0,phase:"inertiastart"}),this.t0-o.coords.cur.timeStamp<50&&f>i.minSpeed&&f>i.endSpeed)this.startInertia();else{if(d.result=d.setAll(this.modifierArg),!d.result.changed)return!1;this.startSmoothEnd()}return o.modification.result.rect=null,o.offsetBy(this.targetOffset),o._doPhase({interaction:o,event:t,phase:"inertiastart"}),o.offsetBy({x:-this.targetOffset.x,y:-this.targetOffset.y}),o.modification.result.rect=null,this.active=!0,o.simulation=this,!0}},{key:"startInertia",value:function(){var t=this,o=this.interaction.coords.velocity.client,i=Tn(this.interaction),c=i.resistance,f=-Math.log(i.endSpeed/this.v0)/c;this.targetOffset={x:(o.x-f)/c,y:(o.y-f)/c},this.te=f,this.lambda_v0=c/this.v0,this.one_ve_v0=1-i.endSpeed/this.v0;var d=this.modification,p=this.modifierArg;p.pageCoords={x:this.startCoords.x+this.targetOffset.x,y:this.startCoords.y+this.targetOffset.y},d.result=d.setAll(p),d.result.changed&&(this.isModified=!0,this.modifiedOffset={x:this.targetOffset.x+d.result.delta.x,y:this.targetOffset.y+d.result.delta.y}),this.onNextFrame(function(){return t.inertiaTick()})}},{key:"startSmoothEnd",value:function(){var t=this;this.smoothEnd=!0,this.isModified=!0,this.targetOffset={x:this.modification.result.delta.x,y:this.modification.result.delta.y},this.onNextFrame(function(){return t.smoothEndTick()})}},{key:"onNextFrame",value:function(t){var o=this;this.timeout=Ze.request(function(){o.active&&t()})}},{key:"inertiaTick",value:function(){var t,o,i,c,f,d,p,v=this,w=this.interaction,y=Tn(w).resistance,_=(w._now()-this.t0)/1e3;if(_<this.te){var A,X=1-(Math.exp(-y*_)-this.lambda_v0)/this.one_ve_v0;this.isModified?(t=0,o=0,i=this.targetOffset.x,c=this.targetOffset.y,f=this.modifiedOffset.x,d=this.modifiedOffset.y,A={x:vi(p=X,t,i,f),y:vi(p,o,c,d)}):A={x:this.targetOffset.x*X,y:this.targetOffset.y*X};var V={x:A.x-this.currentOffset.x,y:A.y-this.currentOffset.y};this.currentOffset.x+=V.x,this.currentOffset.y+=V.y,w.offsetBy(V),w.move(),this.onNextFrame(function(){return v.inertiaTick()})}else w.offsetBy({x:this.modifiedOffset.x-this.currentOffset.x,y:this.modifiedOffset.y-this.currentOffset.y}),this.end()}},{key:"smoothEndTick",value:function(){var t=this,o=this.interaction,i=o._now()-this.t0,c=Tn(o).smoothEndDuration;if(i<c){var f={x:yi(i,0,this.targetOffset.x,c),y:yi(i,0,this.targetOffset.y,c)},d={x:f.x-this.currentOffset.x,y:f.y-this.currentOffset.y};this.currentOffset.x+=d.x,this.currentOffset.y+=d.y,o.offsetBy(d),o.move({skipModifiers:this.modifierCount}),this.onNextFrame(function(){return t.smoothEndTick()})}else o.offsetBy({x:this.targetOffset.x-this.currentOffset.x,y:this.targetOffset.y-this.currentOffset.y}),this.end()}},{key:"resume",value:function(t){var o=t.pointer,i=t.event,c=t.eventTarget,f=this.interaction;f.offsetBy({x:-this.currentOffset.x,y:-this.currentOffset.y}),f.updatePointer(o,i,c,!0),f._doPhase({interaction:f,event:i,phase:"resume"}),bn(f.coords.prev,f.coords.cur),this.stop()}},{key:"end",value:function(){this.interaction.move(),this.interaction.end(),this.stop()}},{key:"stop",value:function(){this.active=this.smoothEnd=!1,this.interaction.simulation=null,Ze.cancel(this.timeout)}}]),n}();function Tn(n){var t=n.interactable,o=n.prepared;return t&&t.options&&o.name&&t.options[o.name].inertia}var Pc={id:"inertia",before:["modifiers","actions"],install:function(n){var t=n.defaults;n.usePlugin(mi),n.usePlugin(fi),n.actions.phases.inertiastart=!0,n.actions.phases.resume=!0,t.perAction.inertia={enabled:!1,resistance:10,minSpeed:100,endSpeed:10,allowResume:!0,smoothEndDuration:300}},listeners:{"interactions:new":function(n){var t=n.interaction;t.inertia=new _c(t)},"interactions:before-action-end":function(n){var t=n.interaction,o=n.event;return(!t._interacting||t.simulation||!t.inertia.start(o))&&null},"interactions:down":function(n){var t=n.interaction,o=n.eventTarget,i=t.inertia;if(i.active)for(var c=o;E.element(c);){if(c===t.element){i.resume(n);break}c=H(c)}},"interactions:stop":function(n){var t=n.interaction.inertia;t.active&&t.stop()},"interactions:before-action-resume":function(n){var t=n.interaction.modification;t.stop(n),t.start(n,n.interaction.coords.cur.page),t.applyToInteraction(n)},"interactions:before-action-inertiastart":function(n){return n.interaction.modification.setAndApply(n)},"interactions:action-resume":It,"interactions:action-inertiastart":It,"interactions:after-action-inertiastart":function(n){return n.interaction.modification.restoreInteractionCoords(n)},"interactions:after-action-resume":function(n){return n.interaction.modification.restoreInteractionCoords(n)}}};function vi(n,t,o,i){var c=1-n;return c*c*t+2*c*n*o+n*n*i}function yi(n,t,o,i){return-o*(n/=i)*(n-2)+t}var Oc=Pc;function bi(n,t){for(var o=0;o<t.length;o++){var i=t[o];if(n.immediatePropagationStopped)break;i(n)}}var xi=function(){function n(t){u(this,n),this.options=void 0,this.types={},this.propagationStopped=!1,this.immediatePropagationStopped=!1,this.global=void 0,this.options=J({},t||{})}return g(n,[{key:"fire",value:function(t){var o,i=this.global;(o=this.types[t.type])&&bi(t,o),!t.propagationStopped&&i&&(o=i[t.type])&&bi(t,o)}},{key:"on",value:function(t,o){var i=Ye(t,o);for(t in i)this.types[t]=Jo(this.types[t]||[],i[t])}},{key:"off",value:function(t,o){var i=Ye(t,o);for(t in i){var c=this.types[t];if(c&&c.length)for(var f=0,d=i[t];f<d.length;f++){var p=d[f],v=c.indexOf(p);v!==-1&&c.splice(v,1)}}}},{key:"getRect",value:function(t){return null}}]),n}(),Ic=function(){function n(t){u(this,n),this.currentTarget=void 0,this.originalEvent=void 0,this.type=void 0,this.originalEvent=t,yn(this,t)}return g(n,[{key:"preventOriginalDefault",value:function(){this.originalEvent.preventDefault()}},{key:"stopPropagation",value:function(){this.originalEvent.stopPropagation()}},{key:"stopImmediatePropagation",value:function(){this.originalEvent.stopImmediatePropagation()}}]),n}();function Rt(n){return E.object(n)?{capture:!!n.capture,passive:!!n.passive}:{capture:!!n,passive:!1}}function Cn(n,t){return n===t||(typeof n=="boolean"?!!t.capture===n&&!t.passive:!!n.capture==!!t.capture&&!!n.passive==!!t.passive)}var Rc={id:"events",install:function(n){var t,o=[],i={},c=[],f={add:d,remove:p,addDelegate:function(y,_,A,X,V){var K=Rt(V);if(!i[A]){i[A]=[];for(var se=0;se<c.length;se++){var ne=c[se];d(ne,A,v),d(ne,A,w,!0)}}var ue=i[A],ye=Pt(ue,function(we){return we.selector===y&&we.context===_});ye||(ye={selector:y,context:_,listeners:[]},ue.push(ye)),ye.listeners.push({func:X,options:K})},removeDelegate:function(y,_,A,X,V){var K,se=Rt(V),ne=i[A],ue=!1;if(ne)for(K=ne.length-1;K>=0;K--){var ye=ne[K];if(ye.selector===y&&ye.context===_){for(var we=ye.listeners,de=we.length-1;de>=0;de--){var be=we[de];if(be.func===X&&Cn(be.options,se)){we.splice(de,1),we.length||(ne.splice(K,1),p(_,A,v),p(_,A,w,!0)),ue=!0;break}}if(ue)break}}},delegateListener:v,delegateUseCapture:w,delegatedEvents:i,documents:c,targets:o,supportsOptions:!1,supportsPassive:!1};function d(y,_,A,X){if(y.addEventListener){var V=Rt(X),K=Pt(o,function(se){return se.eventTarget===y});K||(K={eventTarget:y,events:{}},o.push(K)),K.events[_]||(K.events[_]=[]),Pt(K.events[_],function(se){return se.func===A&&Cn(se.options,V)})||(y.addEventListener(_,A,f.supportsOptions?V:V.capture),K.events[_].push({func:A,options:V}))}}function p(y,_,A,X){if(y.addEventListener&&y.removeEventListener){var V=_t(o,function(je){return je.eventTarget===y}),K=o[V];if(K&&K.events)if(_!=="all"){var se=!1,ne=K.events[_];if(ne){if(A==="all"){for(var ue=ne.length-1;ue>=0;ue--){var ye=ne[ue];p(y,_,ye.func,ye.options)}return}for(var we=Rt(X),de=0;de<ne.length;de++){var be=ne[de];if(be.func===A&&Cn(be.options,we)){y.removeEventListener(_,A,f.supportsOptions?we:we.capture),ne.splice(de,1),ne.length===0&&(delete K.events[_],se=!0);break}}}se&&!Object.keys(K.events).length&&o.splice(V,1)}else for(_ in K.events)K.events.hasOwnProperty(_)&&p(y,_,"all")}}function v(y,_){for(var A=Rt(_),X=new Ic(y),V=i[y.type],K=Wo(y)[0],se=K;E.element(se);){for(var ne=0;ne<V.length;ne++){var ue=V[ne],ye=ue.selector,we=ue.context;if(C(se,ye)&&ee(we,K)&&ee(we,se)){var de=ue.listeners;X.currentTarget=se;for(var be=0;be<de.length;be++){var je=de[be];Cn(je.options,A)&&je.func(X)}}}se=H(se)}}function w(y){return v(y,!0)}return(t=n.document)==null||t.createElement("div").addEventListener("test",null,{get capture(){return f.supportsOptions=!0},get passive(){return f.supportsPassive=!0}}),n.events=f,f}},Tr={methodOrder:["simulationResume","mouseOrPen","hasPointer","idle"],search:function(n){for(var t=0,o=Tr.methodOrder;t<o.length;t++){var i=o[t],c=Tr[i](n);if(c)return c}return null},simulationResume:function(n){var t=n.pointerType,o=n.eventType,i=n.eventTarget,c=n.scope;if(!/down|start/i.test(o))return null;for(var f=0,d=c.interactions.list;f<d.length;f++){var p=d[f],v=i;if(p.simulation&&p.simulation.allowResume&&p.pointerType===t)for(;v;){if(v===p.element)return p;v=H(v)}}return null},mouseOrPen:function(n){var t,o=n.pointerId,i=n.pointerType,c=n.eventType,f=n.scope;if(i!=="mouse"&&i!=="pen")return null;for(var d=0,p=f.interactions.list;d<p.length;d++){var v=p[d];if(v.pointerType===i){if(v.simulation&&!wi(v,o))continue;if(v.interacting())return v;t||(t=v)}}if(t)return t;for(var w=0,y=f.interactions.list;w<y.length;w++){var _=y[w];if(!(_.pointerType!==i||/down/i.test(c)&&_.simulation))return _}return null},hasPointer:function(n){for(var t=n.pointerId,o=0,i=n.scope.interactions.list;o<i.length;o++){var c=i[o];if(wi(c,t))return c}return null},idle:function(n){for(var t=n.pointerType,o=0,i=n.scope.interactions.list;o<i.length;o++){var c=i[o];if(c.pointers.length===1){var f=c.interactable;if(f&&(!f.options.gesture||!f.options.gesture.enabled))continue}else if(c.pointers.length>=2)continue;if(!c.interacting()&&t===c.pointerType)return c}return null}};function wi(n,t){return n.pointers.some(function(o){return o.id===t})}var jc=Tr,Cr=["pointerDown","pointerMove","pointerUp","updatePointer","removePointer","windowBlur"];function Ei(n,t){return function(o){var i=t.interactions.list,c=Ko(o),f=Wo(o),d=f[0],p=f[1],v=[];if(/^touch/.test(o.type)){t.prevTouchTime=t.now();for(var w=0,y=o.changedTouches;w<y.length;w++){var _=y[w],A={pointer:_,pointerId:kt(_),pointerType:c,eventType:o.type,eventTarget:d,curEventTarget:p,scope:t},X=Ni(A);v.push([A.pointer,A.eventTarget,A.curEventTarget,X])}}else{var V=!1;if(!te.supportsPointerEvent&&/mouse/.test(o.type)){for(var K=0;K<i.length&&!V;K++)V=i[K].pointerType!=="mouse"&&i[K].pointerIsDown;V=V||t.now()-t.prevTouchTime<500||o.timeStamp===0}if(!V){var se={pointer:o,pointerId:kt(o),pointerType:c,eventType:o.type,curEventTarget:p,eventTarget:d,scope:t},ne=Ni(se);v.push([se.pointer,se.eventTarget,se.curEventTarget,ne])}}for(var ue=0;ue<v.length;ue++){var ye=v[ue],we=ye[0],de=ye[1],be=ye[2];ye[3][n](we,o,de,be)}}}function Ni(n){var t=n.pointerType,o=n.scope,i={interaction:jc.search(n),searchDetails:n};return o.fire("interactions:find",i),i.interaction||o.interactions.new({pointerType:t})}function kr(n,t){var o=n.doc,i=n.scope,c=n.options,f=i.interactions.docEvents,d=i.events,p=d[t];for(var v in i.browser.isIOS&&!c.events&&(c.events={passive:!1}),d.delegatedEvents)p(o,v,d.delegateListener),p(o,v,d.delegateUseCapture,!0);for(var w=c&&c.events,y=0;y<f.length;y++){var _=f[y];p(o,_.type,_.listener,w)}}var Ac={id:"core/interactions",install:function(n){for(var t={},o=0;o<Cr.length;o++){var i=Cr[o];t[i]=Ei(i,n)}var c,f=te.pEventTypes;function d(){for(var p=0,v=n.interactions.list;p<v.length;p++){var w=v[p];if(w.pointerIsDown&&w.pointerType==="touch"&&!w._interacting)for(var y=function(){var X=A[_];n.documents.some(function(V){return ee(V.doc,X.downTarget)})||w.removePointer(X.pointer,X.event)},_=0,A=w.pointers;_<A.length;_++)y()}}(c=D.PointerEvent?[{type:f.down,listener:d},{type:f.down,listener:t.pointerDown},{type:f.move,listener:t.pointerMove},{type:f.up,listener:t.pointerUp},{type:f.cancel,listener:t.pointerUp}]:[{type:"mousedown",listener:t.pointerDown},{type:"mousemove",listener:t.pointerMove},{type:"mouseup",listener:t.pointerUp},{type:"touchstart",listener:d},{type:"touchstart",listener:t.pointerDown},{type:"touchmove",listener:t.pointerMove},{type:"touchend",listener:t.pointerUp},{type:"touchcancel",listener:t.pointerUp}]).push({type:"blur",listener:function(p){for(var v=0,w=n.interactions.list;v<w.length;v++)w[v].documentBlur(p)}}),n.prevTouchTime=0,n.Interaction=function(p){S(w,p);var v=j(w);function w(){return u(this,w),v.apply(this,arguments)}return g(w,[{key:"pointerMoveTolerance",get:function(){return n.interactions.pointerMoveTolerance},set:function(y){n.interactions.pointerMoveTolerance=y}},{key:"_now",value:function(){return n.now()}}]),w}(Tc),n.interactions={list:[],new:function(p){p.scopeFire=function(w,y){return n.fire(w,y)};var v=new n.Interaction(p);return n.interactions.list.push(v),v},listeners:t,docEvents:c,pointerMoveTolerance:1},n.usePlugin(ui)},listeners:{"scope:add-document":function(n){return kr(n,"add")},"scope:remove-document":function(n){return kr(n,"remove")},"interactable:unset":function(n,t){for(var o=n.interactable,i=t.interactions.list.length-1;i>=0;i--){var c=t.interactions.list[i];c.interactable===o&&(c.stop(),t.fire("interactions:destroy",{interaction:c}),c.destroy(),t.interactions.list.length>2&&t.interactions.list.splice(i,1))}}},onDocSignal:kr,doOnInteractions:Ei,methodNames:Cr},Mc=Ac,$e=function(n){return n[n.On=0]="On",n[n.Off=1]="Off",n}($e||{}),zc=function(){function n(t,o,i,c){u(this,n),this.target=void 0,this.options=void 0,this._actions=void 0,this.events=new xi,this._context=void 0,this._win=void 0,this._doc=void 0,this._scopeEvents=void 0,this._actions=o.actions,this.target=t,this._context=o.context||i,this._win=G(xe(t)?this._context:t),this._doc=this._win.document,this._scopeEvents=c,this.set(o)}return g(n,[{key:"_defaults",get:function(){return{base:{},perAction:{},actions:{}}}},{key:"setOnEvents",value:function(t,o){return E.func(o.onstart)&&this.on("".concat(t,"start"),o.onstart),E.func(o.onmove)&&this.on("".concat(t,"move"),o.onmove),E.func(o.onend)&&this.on("".concat(t,"end"),o.onend),E.func(o.oninertiastart)&&this.on("".concat(t,"inertiastart"),o.oninertiastart),this}},{key:"updatePerActionListeners",value:function(t,o,i){var c,f=this,d=(c=this._actions.map[t])==null?void 0:c.filterEventType,p=function(v){return(d==null||d(v))&&Nn(v,f._actions)};(E.array(o)||E.object(o))&&this._onOff($e.Off,t,o,void 0,p),(E.array(i)||E.object(i))&&this._onOff($e.On,t,i,void 0,p)}},{key:"setPerAction",value:function(t,o){var i=this._defaults;for(var c in o){var f=c,d=this.options[t],p=o[f];f==="listeners"&&this.updatePerActionListeners(t,d.listeners,p),E.array(p)?d[f]=Zo(p):E.plainObject(p)?(d[f]=J(d[f]||{},ft(p)),E.object(i.perAction[f])&&"enabled"in i.perAction[f]&&(d[f].enabled=p.enabled!==!1)):E.bool(p)&&E.object(i.perAction[f])?d[f].enabled=p:d[f]=p}}},{key:"getRect",value:function(t){return t=t||(E.element(this.target)?this.target:null),E.string(this.target)&&(t=t||this._context.querySelector(this.target)),Ee(t)}},{key:"rectChecker",value:function(t){var o=this;return E.func(t)?(this.getRect=function(i){var c=J({},t.apply(o,i));return"width"in c||(c.width=c.right-c.left,c.height=c.bottom-c.top),c},this):t===null?(delete this.getRect,this):this.getRect}},{key:"_backCompatOption",value:function(t,o){if(xe(o)||E.object(o)){for(var i in this.options[t]=o,this._actions.map)this.options[i][t]=o;return this}return this.options[t]}},{key:"origin",value:function(t){return this._backCompatOption("origin",t)}},{key:"deltaSource",value:function(t){return t==="page"||t==="client"?(this.options.deltaSource=t,this):this.options.deltaSource}},{key:"getAllElements",value:function(){var t=this.target;return E.string(t)?Array.from(this._context.querySelectorAll(t)):E.func(t)&&t.getAllElements?t.getAllElements():E.element(t)?[t]:[]}},{key:"context",value:function(){return this._context}},{key:"inContext",value:function(t){return this._context===t.ownerDocument||ee(this._context,t)}},{key:"testIgnoreAllow",value:function(t,o,i){return!this.testIgnore(t.ignoreFrom,o,i)&&this.testAllow(t.allowFrom,o,i)}},{key:"testAllow",value:function(t,o,i){return!t||!!E.element(i)&&(E.string(t)?ie(i,t,o):!!E.element(t)&&ee(t,i))}},{key:"testIgnore",value:function(t,o,i){return!(!t||!E.element(i))&&(E.string(t)?ie(i,t,o):!!E.element(t)&&ee(t,i))}},{key:"fire",value:function(t){return this.events.fire(t),this}},{key:"_onOff",value:function(t,o,i,c,f){E.object(o)&&!E.array(o)&&(c=i,i=null);var d=Ye(o,i,f);for(var p in d){p==="wheel"&&(p=te.wheelEvent);for(var v=0,w=d[p];v<w.length;v++){var y=w[v];Nn(p,this._actions)?this.events[t===$e.On?"on":"off"](p,y):E.string(this.target)?this._scopeEvents[t===$e.On?"addDelegate":"removeDelegate"](this.target,this._context,p,y,c):this._scopeEvents[t===$e.On?"add":"remove"](this.target,p,y,c)}}return this}},{key:"on",value:function(t,o,i){return this._onOff($e.On,t,o,i)}},{key:"off",value:function(t,o,i){return this._onOff($e.Off,t,o,i)}},{key:"set",value:function(t){var o=this._defaults;for(var i in E.object(t)||(t={}),this.options=ft(o.base),this._actions.methodDict){var c=i,f=this._actions.methodDict[c];this.options[c]={},this.setPerAction(c,J(J({},o.perAction),o.actions[c])),this[f](t[c])}for(var d in t)d!=="getRect"?E.func(this[d])&&this[d](t[d]):this.rectChecker(t.getRect);return this}},{key:"unset",value:function(){if(E.string(this.target))for(var t in this._scopeEvents.delegatedEvents)for(var o=this._scopeEvents.delegatedEvents[t],i=o.length-1;i>=0;i--){var c=o[i],f=c.selector,d=c.context,p=c.listeners;f===this.target&&d===this._context&&o.splice(i,1);for(var v=p.length-1;v>=0;v--)this._scopeEvents.removeDelegate(this.target,this._context,t,p[v][0],p[v][1])}else this._scopeEvents.remove(this.target,"all")}}]),n}(),Lc=function(){function n(t){var o=this;u(this,n),this.list=[],this.selectorMap={},this.scope=void 0,this.scope=t,t.addListeners({"interactable:unset":function(i){var c=i.interactable,f=c.target,d=E.string(f)?o.selectorMap[f]:f[o.scope.id],p=_t(d,function(v){return v===c});d.splice(p,1)}})}return g(n,[{key:"new",value:function(t,o){o=J(o||{},{actions:this.scope.actions});var i=new this.scope.Interactable(t,o,this.scope.document,this.scope.events);return this.scope.addDocument(i._doc),this.list.push(i),E.string(t)?(this.selectorMap[t]||(this.selectorMap[t]=[]),this.selectorMap[t].push(i)):(i.target[this.scope.id]||Object.defineProperty(t,this.scope.id,{value:[],configurable:!0}),t[this.scope.id].push(i)),this.scope.fire("interactable:new",{target:t,options:o,interactable:i,win:this.scope._win}),i}},{key:"getExisting",value:function(t,o){var i=o&&o.context||this.scope.document,c=E.string(t),f=c?this.selectorMap[t]:t[this.scope.id];if(f)return Pt(f,function(d){return d._context===i&&(c||d.inContext(t))})}},{key:"forEachMatch",value:function(t,o){for(var i=0,c=this.list;i<c.length;i++){var f=c[i],d=void 0;if((E.string(f.target)?E.element(t)&&C(t,f.target):t===f.target)&&f.inContext(t)&&(d=o(f)),d!==void 0)return d}}}]),n}(),Fc=function(){function n(){var t=this;u(this,n),this.id="__interact_scope_".concat(Math.floor(100*Math.random())),this.isInitialized=!1,this.listenerMaps=[],this.browser=te,this.defaults=ft(di),this.Eventable=xi,this.actions={map:{},phases:{start:!0,move:!0,end:!0},methodDict:{},phaselessTypes:{}},this.interactStatic=function(i){var c=function f(d,p){var v=i.interactables.getExisting(d,p);return v||((v=i.interactables.new(d,p)).events.global=f.globalEvents),v};return c.getPointerAverage=Go,c.getTouchBBox=ur,c.getTouchDistance=fr,c.getTouchAngle=dr,c.getElementRect=Ee,c.getElementClientRect=ve,c.matchesSelector=C,c.closest=ce,c.globalEvents={},c.version="1.10.27",c.scope=i,c.use=function(f,d){return this.scope.usePlugin(f,d),this},c.isSet=function(f,d){return!!this.scope.interactables.get(f,d&&d.context)},c.on=Ot(function(f,d,p){if(E.string(f)&&f.search(" ")!==-1&&(f=f.trim().split(/ +/)),E.array(f)){for(var v=0,w=f;v<w.length;v++){var y=w[v];this.on(y,d,p)}return this}if(E.object(f)){for(var _ in f)this.on(_,f[_],d);return this}return Nn(f,this.scope.actions)?this.globalEvents[f]?this.globalEvents[f].push(d):this.globalEvents[f]=[d]:this.scope.events.add(this.scope.document,f,d,{options:p}),this},"The interact.on() method is being deprecated"),c.off=Ot(function(f,d,p){if(E.string(f)&&f.search(" ")!==-1&&(f=f.trim().split(/ +/)),E.array(f)){for(var v=0,w=f;v<w.length;v++){var y=w[v];this.off(y,d,p)}return this}if(E.object(f)){for(var _ in f)this.off(_,f[_],d);return this}var A;return Nn(f,this.scope.actions)?f in this.globalEvents&&(A=this.globalEvents[f].indexOf(d))!==-1&&this.globalEvents[f].splice(A,1):this.scope.events.remove(this.scope.document,f,d,p),this},"The interact.off() method is being deprecated"),c.debug=function(){return this.scope},c.supportsTouch=function(){return te.supportsTouch},c.supportsPointerEvent=function(){return te.supportsPointerEvent},c.stop=function(){for(var f=0,d=this.scope.interactions.list;f<d.length;f++)d[f].stop();return this},c.pointerMoveTolerance=function(f){return E.number(f)?(this.scope.interactions.pointerMoveTolerance=f,this):this.scope.interactions.pointerMoveTolerance},c.addDocument=function(f,d){this.scope.addDocument(f,d)},c.removeDocument=function(f){this.scope.removeDocument(f)},c}(this),this.InteractEvent=Nr,this.Interactable=void 0,this.interactables=new Lc(this),this._win=void 0,this.document=void 0,this.window=void 0,this.documents=[],this._plugins={list:[],map:{}},this.onWindowUnload=function(i){return t.removeDocument(i.target)};var o=this;this.Interactable=function(i){S(f,i);var c=j(f);function f(){return u(this,f),c.apply(this,arguments)}return g(f,[{key:"_defaults",get:function(){return o.defaults}},{key:"set",value:function(d){return L(k(f.prototype),"set",this).call(this,d),o.fire("interactable:set",{options:d,interactable:this}),this}},{key:"unset",value:function(){L(k(f.prototype),"unset",this).call(this);var d=o.interactables.list.indexOf(this);d<0||(o.interactables.list.splice(d,1),o.fire("interactable:unset",{interactable:this}))}}]),f}(zc)}return g(n,[{key:"addListeners",value:function(t,o){this.listenerMaps.push({id:o,map:t})}},{key:"fire",value:function(t,o){for(var i=0,c=this.listenerMaps;i<c.length;i++){var f=c[i].map[t];if(f&&f(o,this,t)===!1)return!1}}},{key:"init",value:function(t){return this.isInitialized?this:function(o,i){return o.isInitialized=!0,E.window(i)&&B(i),D.init(i),te.init(i),Ze.init(i),o.window=i,o.document=i.document,o.usePlugin(Mc),o.usePlugin(Rc),o}(this,t)}},{key:"pluginIsInstalled",value:function(t){var o=t.id;return o?!!this._plugins.map[o]:this._plugins.list.indexOf(t)!==-1}},{key:"usePlugin",value:function(t,o){if(!this.isInitialized)return this;if(this.pluginIsInstalled(t))return this;if(t.id&&(this._plugins.map[t.id]=t),this._plugins.list.push(t),t.install&&t.install(this,o),t.listeners&&t.before){for(var i=0,c=this.listenerMaps.length,f=t.before.reduce(function(p,v){return p[v]=!0,p[Si(v)]=!0,p},{});i<c;i++){var d=this.listenerMaps[i].id;if(d&&(f[d]||f[Si(d)]))break}this.listenerMaps.splice(i,0,{id:t.id,map:t.listeners})}else t.listeners&&this.listenerMaps.push({id:t.id,map:t.listeners});return this}},{key:"addDocument",value:function(t,o){if(this.getDocIndex(t)!==-1)return!1;var i=G(t);o=o?J({},o):{},this.documents.push({doc:t,options:o}),this.events.documents.push(t),t!==this.document&&this.events.add(i,"unload",this.onWindowUnload),this.fire("scope:add-document",{doc:t,window:i,scope:this,options:o})}},{key:"removeDocument",value:function(t){var o=this.getDocIndex(t),i=G(t),c=this.documents[o].options;this.events.remove(i,"unload",this.onWindowUnload),this.documents.splice(o,1),this.events.documents.splice(o,1),this.fire("scope:remove-document",{doc:t,window:i,scope:this,options:c})}},{key:"getDocIndex",value:function(t){for(var o=0;o<this.documents.length;o++)if(this.documents[o].doc===t)return o;return-1}},{key:"getDocOptions",value:function(t){var o=this.getDocIndex(t);return o===-1?null:this.documents[o].options}},{key:"now",value:function(){return(this.window.Date||Date).now()}}]),n}();function Si(n){return n&&n.replace(/\/.*$/,"")}var Ti=new Fc,Re=Ti.interactStatic,Dc=typeof globalThis<"u"?globalThis:window;Ti.init(Dc);var Vc=Object.freeze({__proto__:null,edgeTarget:function(){},elements:function(){},grid:function(n){var t=[["x","y"],["left","top"],["right","bottom"],["width","height"]].filter(function(i){var c=i[0],f=i[1];return c in n||f in n}),o=function(i,c){for(var f=n.range,d=n.limits,p=d===void 0?{left:-1/0,right:1/0,top:-1/0,bottom:1/0}:d,v=n.offset,w=v===void 0?{x:0,y:0}:v,y={range:f,grid:n,x:null,y:null},_=0;_<t.length;_++){var A=t[_],X=A[0],V=A[1],K=Math.round((i-w.x)/n[X]),se=Math.round((c-w.y)/n[V]);y[X]=Math.max(p.left,Math.min(p.right,K*n[X]+w.x)),y[V]=Math.max(p.top,Math.min(p.bottom,se*n[V]+w.y))}return y};return o.grid=n,o.coordFields=t,o}}),Bc={id:"snappers",install:function(n){var t=n.interactStatic;t.snappers=J(t.snappers||{},Vc),t.createSnapGrid=t.snappers.grid}},Hc=Bc,Yc={start:function(n){var t=n.state,o=n.rect,i=n.edges,c=n.pageCoords,f=t.options,d=f.ratio,p=f.enabled,v=t.options,w=v.equalDelta,y=v.modifiers;d==="preserve"&&(d=o.width/o.height),t.startCoords=J({},c),t.startRect=J({},o),t.ratio=d,t.equalDelta=w;var _=t.linkedEdges={top:i.top||i.left&&!i.bottom,left:i.left||i.top&&!i.right,bottom:i.bottom||i.right&&!i.top,right:i.right||i.bottom&&!i.left};if(t.xIsPrimaryAxis=!(!i.left&&!i.right),t.equalDelta){var A=(_.left?1:-1)*(_.top?1:-1);t.edgeSign={x:A,y:A}}else t.edgeSign={x:_.left?-1:1,y:_.top?-1:1};if(p!==!1&&J(i,_),y!=null&&y.length){var X=new Er(n.interaction);X.copyFrom(n.interaction.modification),X.prepareStates(y),t.subModification=X,X.startAll(a({},n))}},set:function(n){var t=n.state,o=n.rect,i=n.coords,c=t.linkedEdges,f=J({},i),d=t.equalDelta?Xc:Uc;if(J(n.edges,c),d(t,t.xIsPrimaryAxis,i,o),!t.subModification)return null;var p=J({},o);Ae(c,p,{x:i.x-f.x,y:i.y-f.y});var v=t.subModification.setAll(a(a({},n),{},{rect:p,edges:c,pageCoords:i,prevCoords:i,prevRect:p})),w=v.delta;return v.changed&&(d(t,Math.abs(w.x)>Math.abs(w.y),v.coords,v.rect),J(i,v.coords)),v.eventProps},defaults:{ratio:"preserve",equalDelta:!1,modifiers:[],enabled:!1}};function Xc(n,t,o){var i=n.startCoords,c=n.edgeSign;t?o.y=i.y+(o.x-i.x)*c.y:o.x=i.x+(o.y-i.y)*c.x}function Uc(n,t,o,i){var c=n.startRect,f=n.startCoords,d=n.ratio,p=n.edgeSign;if(t){var v=i.width/d;o.y=f.y+(v-c.height)*p.y}else{var w=i.height*d;o.x=f.x+(w-c.width)*p.x}}var Gc=Qe(Yc,"aspectRatio"),Ci=function(){};Ci._defaults={};var kn=Ci;function it(n,t,o){return E.func(n)?_e(n,t.interactable,t.element,[o.x,o.y,t]):_e(n,t.interactable,t.element)}var _n={start:function(n){var t=n.rect,o=n.startOffset,i=n.state,c=n.interaction,f=n.pageCoords,d=i.options,p=d.elementRect,v=J({left:0,top:0,right:0,bottom:0},d.offset||{});if(t&&p){var w=it(d.restriction,c,f);if(w){var y=w.right-w.left-t.width,_=w.bottom-w.top-t.height;y<0&&(v.left+=y,v.right+=y),_<0&&(v.top+=_,v.bottom+=_)}v.left+=o.left-t.width*p.left,v.top+=o.top-t.height*p.top,v.right+=o.right-t.width*(1-p.right),v.bottom+=o.bottom-t.height*(1-p.bottom)}i.offset=v},set:function(n){var t=n.coords,o=n.interaction,i=n.state,c=i.options,f=i.offset,d=it(c.restriction,o,t);if(d){var p=function(v){return!v||"left"in v&&"top"in v||((v=J({},v)).left=v.x||0,v.top=v.y||0,v.right=v.right||v.left+v.width,v.bottom=v.bottom||v.top+v.height),v}(d);t.x=Math.max(Math.min(p.right-f.right,t.x),p.left+f.left),t.y=Math.max(Math.min(p.bottom-f.bottom,t.y),p.top+f.top)}},defaults:{restriction:null,elementRect:null,offset:null,endOnly:!1,enabled:!1}},Kc=Qe(_n,"restrict"),ki={top:1/0,left:1/0,bottom:-1/0,right:-1/0},_i={top:-1/0,left:-1/0,bottom:1/0,right:1/0};function Pi(n,t){for(var o=0,i=["top","left","bottom","right"];o<i.length;o++){var c=i[o];c in n||(n[c]=t[c])}return n}var jt={noInner:ki,noOuter:_i,start:function(n){var t,o=n.interaction,i=n.startOffset,c=n.state,f=c.options;f&&(t=ke(it(f.offset,o,o.coords.start.page))),t=t||{x:0,y:0},c.offset={top:t.y+i.top,left:t.x+i.left,bottom:t.y-i.bottom,right:t.x-i.right}},set:function(n){var t=n.coords,o=n.edges,i=n.interaction,c=n.state,f=c.offset,d=c.options;if(o){var p=J({},t),v=it(d.inner,i,p)||{},w=it(d.outer,i,p)||{};Pi(v,ki),Pi(w,_i),o.top?t.y=Math.min(Math.max(w.top+f.top,p.y),v.top+f.top):o.bottom&&(t.y=Math.max(Math.min(w.bottom+f.bottom,p.y),v.bottom+f.bottom)),o.left?t.x=Math.min(Math.max(w.left+f.left,p.x),v.left+f.left):o.right&&(t.x=Math.max(Math.min(w.right+f.right,p.x),v.right+f.right))}},defaults:{inner:null,outer:null,offset:null,endOnly:!1,enabled:!1}},Wc=Qe(jt,"restrictEdges"),Jc=J({get elementRect(){return{top:0,left:0,bottom:1,right:1}},set elementRect(n){}},_n.defaults),Zc=Qe({start:_n.start,set:_n.set,defaults:Jc},"restrictRect"),Qc={width:-1/0,height:-1/0},$c={width:1/0,height:1/0},qc=Qe({start:function(n){return jt.start(n)},set:function(n){var t=n.interaction,o=n.state,i=n.rect,c=n.edges,f=o.options;if(c){var d=De(it(f.min,t,n.coords))||Qc,p=De(it(f.max,t,n.coords))||$c;o.options={endOnly:f.endOnly,inner:J({},jt.noInner),outer:J({},jt.noOuter)},c.top?(o.options.inner.top=i.bottom-d.height,o.options.outer.top=i.bottom-p.height):c.bottom&&(o.options.inner.bottom=i.top+d.height,o.options.outer.bottom=i.top+p.height),c.left?(o.options.inner.left=i.right-d.width,o.options.outer.left=i.right-p.width):c.right&&(o.options.inner.right=i.left+d.width,o.options.outer.right=i.left+p.width),jt.set(n),o.options=f}},defaults:{min:null,max:null,endOnly:!1,enabled:!1}},"restrictSize"),_r={start:function(n){var t,o=n.interaction,i=n.interactable,c=n.element,f=n.rect,d=n.state,p=n.startOffset,v=d.options,w=v.offsetWithOrigin?function(A){var X=A.interaction.element,V=ke(_e(A.state.options.origin,null,null,[X])),K=V||He(A.interactable,X,A.interaction.prepared.name);return K}(n):{x:0,y:0};if(v.offset==="startCoords")t={x:o.coords.start.page.x,y:o.coords.start.page.y};else{var y=_e(v.offset,i,c,[o]);(t=ke(y)||{x:0,y:0}).x+=w.x,t.y+=w.y}var _=v.relativePoints;d.offsets=f&&_&&_.length?_.map(function(A,X){return{index:X,relativePoint:A,x:p.left-f.width*A.x+t.x,y:p.top-f.height*A.y+t.y}}):[{index:0,relativePoint:null,x:t.x,y:t.y}]},set:function(n){var t=n.interaction,o=n.coords,i=n.state,c=i.options,f=i.offsets,d=He(t.interactable,t.element,t.prepared.name),p=J({},o),v=[];c.offsetWithOrigin||(p.x-=d.x,p.y-=d.y);for(var w=0,y=f;w<y.length;w++)for(var _=y[w],A=p.x-_.x,X=p.y-_.y,V=0,K=c.targets.length;V<K;V++){var se=c.targets[V],ne=void 0;(ne=E.func(se)?se(A,X,t._proxy,_,V):se)&&v.push({x:(E.number(ne.x)?ne.x:A)+_.x,y:(E.number(ne.y)?ne.y:X)+_.y,range:E.number(ne.range)?ne.range:c.range,source:se,index:V,offset:_})}for(var ue={target:null,inRange:!1,distance:0,range:0,delta:{x:0,y:0}},ye=0;ye<v.length;ye++){var we=v[ye],de=we.range,be=we.x-p.x,je=we.y-p.y,Te=Ct(be,je),Me=Te<=de;de===1/0&&ue.inRange&&ue.range!==1/0&&(Me=!1),ue.target&&!(Me?ue.inRange&&de!==1/0?Te/de<ue.distance/ue.range:de===1/0&&ue.range!==1/0||Te<ue.distance:!ue.inRange&&Te<ue.distance)||(ue.target=we,ue.distance=Te,ue.range=de,ue.inRange=Me,ue.delta.x=be,ue.delta.y=je)}return ue.inRange&&(o.x=ue.target.x,o.y=ue.target.y),i.closest=ue,ue},defaults:{range:1/0,targets:null,offset:null,offsetWithOrigin:!0,origin:null,relativePoints:null,endOnly:!1,enabled:!1}},el=Qe(_r,"snap"),Pn={start:function(n){var t=n.state,o=n.edges,i=t.options;if(!o)return null;n.state={options:{targets:null,relativePoints:[{x:o.left?0:1,y:o.top?0:1}],offset:i.offset||"self",origin:{x:0,y:0},range:i.range}},t.targetFields=t.targetFields||[["width","height"],["x","y"]],_r.start(n),t.offsets=n.state.offsets,n.state=t},set:function(n){var t=n.interaction,o=n.state,i=n.coords,c=o.options,f=o.offsets,d={x:i.x-f[0].x,y:i.y-f[0].y};o.options=J({},c),o.options.targets=[];for(var p=0,v=c.targets||[];p<v.length;p++){var w=v[p],y=void 0;if(y=E.func(w)?w(d.x,d.y,t):w){for(var _=0,A=o.targetFields;_<A.length;_++){var X=A[_],V=X[0],K=X[1];if(V in y||K in y){y.x=y[V],y.y=y[K];break}}o.options.targets.push(y)}}var se=_r.set(n);return o.options=c,se},defaults:{range:1/0,targets:null,offset:null,endOnly:!1,enabled:!1}},tl=Qe(Pn,"snapSize"),Pr={aspectRatio:Gc,restrictEdges:Wc,restrict:Kc,restrictRect:Zc,restrictSize:qc,snapEdges:Qe({start:function(n){var t=n.edges;return t?(n.state.targetFields=n.state.targetFields||[[t.left?"left":"right",t.top?"top":"bottom"]],Pn.start(n)):null},set:Pn.set,defaults:J(ft(Pn.defaults),{targets:void 0,range:void 0,offset:{x:0,y:0}})},"snapEdges"),snap:el,snapSize:tl,spring:kn,avoid:kn,transform:kn,rubberband:kn},nl={id:"modifiers",install:function(n){var t=n.interactStatic;for(var o in n.usePlugin(fi),n.usePlugin(Hc),t.modifiers=Pr,Pr){var i=Pr[o],c=i._defaults,f=i._methods;c._methods=f,n.defaults.perAction[o]=c}}},rl=nl,Oi=function(n){S(o,n);var t=j(o);function o(i,c,f,d,p,v){var w;if(u(this,o),yn(O(w=t.call(this,p)),f),f!==c&&yn(O(w),c),w.timeStamp=v,w.originalEvent=f,w.type=i,w.pointerId=kt(c),w.pointerType=Ko(c),w.target=d,w.currentTarget=null,i==="tap"){var y=p.getPointerIndex(c);w.dt=w.timeStamp-p.pointers[y].downTime;var _=w.timeStamp-p.tapTime;w.double=!!p.prevTap&&p.prevTap.type!=="doubletap"&&p.prevTap.target===w.target&&_<500}else i==="doubletap"&&(w.dt=c.timeStamp-p.tapTime,w.double=!0);return w}return g(o,[{key:"_subtractOrigin",value:function(i){var c=i.x,f=i.y;return this.pageX-=c,this.pageY-=f,this.clientX-=c,this.clientY-=f,this}},{key:"_addOrigin",value:function(i){var c=i.x,f=i.y;return this.pageX+=c,this.pageY+=f,this.clientX+=c,this.clientY+=f,this}},{key:"preventDefault",value:function(){this.originalEvent.preventDefault()}}]),o}(wn),At={id:"pointer-events/base",before:["inertia","modifiers","auto-start","actions"],install:function(n){n.pointerEvents=At,n.defaults.actions.pointerEvents=At.defaults,J(n.actions.phaselessTypes,At.types)},listeners:{"interactions:new":function(n){var t=n.interaction;t.prevTap=null,t.tapTime=0},"interactions:update-pointer":function(n){var t=n.down,o=n.pointerInfo;!t&&o.hold||(o.hold={duration:1/0,timeout:null})},"interactions:move":function(n,t){var o=n.interaction,i=n.pointer,c=n.event,f=n.eventTarget;n.duplicate||o.pointerIsDown&&!o.pointerWasMoved||(o.pointerIsDown&&Or(n),qe({interaction:o,pointer:i,event:c,eventTarget:f,type:"move"},t))},"interactions:down":function(n,t){(function(o,i){for(var c=o.interaction,f=o.pointer,d=o.event,p=o.eventTarget,v=o.pointerIndex,w=c.pointers[v].hold,y=Se(p),_={interaction:c,pointer:f,event:d,eventTarget:p,type:"hold",targets:[],path:y,node:null},A=0;A<y.length;A++){var X=y[A];_.node=X,i.fire("pointerEvents:collect-targets",_)}if(_.targets.length){for(var V=1/0,K=0,se=_.targets;K<se.length;K++){var ne=se[K].eventable.options.holdDuration;ne<V&&(V=ne)}w.duration=V,w.timeout=setTimeout(function(){qe({interaction:c,eventTarget:p,pointer:f,event:d,type:"hold"},i)},V)}})(n,t),qe(n,t)},"interactions:up":function(n,t){Or(n),qe(n,t),function(o,i){var c=o.interaction,f=o.pointer,d=o.event,p=o.eventTarget;c.pointerWasMoved||qe({interaction:c,eventTarget:p,pointer:f,event:d,type:"tap"},i)}(n,t)},"interactions:cancel":function(n,t){Or(n),qe(n,t)}},PointerEvent:Oi,fire:qe,collectEventTargets:Ii,defaults:{holdDuration:600,ignoreFrom:null,allowFrom:null,origin:{x:0,y:0}},types:{down:!0,move:!0,up:!0,cancel:!0,tap:!0,doubletap:!0,hold:!0}};function qe(n,t){var o=n.interaction,i=n.pointer,c=n.event,f=n.eventTarget,d=n.type,p=n.targets,v=p===void 0?Ii(n,t):p,w=new Oi(d,i,c,f,o,t.now());t.fire("pointerEvents:new",{pointerEvent:w});for(var y={interaction:o,pointer:i,event:c,eventTarget:f,targets:v,type:d,pointerEvent:w},_=0;_<v.length;_++){var A=v[_];for(var X in A.props||{})w[X]=A.props[X];var V=He(A.eventable,A.node);if(w._subtractOrigin(V),w.eventable=A.eventable,w.currentTarget=A.node,A.eventable.fire(w),w._addOrigin(V),w.immediatePropagationStopped||w.propagationStopped&&_+1<v.length&&v[_+1].node!==w.currentTarget)break}if(t.fire("pointerEvents:fired",y),d==="tap"){var K=w.double?qe({interaction:o,pointer:i,event:c,eventTarget:f,type:"doubletap"},t):w;o.prevTap=K,o.tapTime=K.timeStamp}return w}function Ii(n,t){var o=n.interaction,i=n.pointer,c=n.event,f=n.eventTarget,d=n.type,p=o.getPointerIndex(i),v=o.pointers[p];if(d==="tap"&&(o.pointerWasMoved||!v||v.downTarget!==f))return[];for(var w=Se(f),y={interaction:o,pointer:i,event:c,eventTarget:f,type:d,path:w,targets:[],node:null},_=0;_<w.length;_++){var A=w[_];y.node=A,t.fire("pointerEvents:collect-targets",y)}return d==="hold"&&(y.targets=y.targets.filter(function(X){var V,K;return X.eventable.options.holdDuration===((V=o.pointers[p])==null||(K=V.hold)==null?void 0:K.duration)})),y.targets}function Or(n){var t=n.interaction,o=n.pointerIndex,i=t.pointers[o].hold;i&&i.timeout&&(clearTimeout(i.timeout),i.timeout=null)}var ol=Object.freeze({__proto__:null,default:At});function il(n){var t=n.interaction;t.holdIntervalHandle&&(clearInterval(t.holdIntervalHandle),t.holdIntervalHandle=null)}var sl={id:"pointer-events/holdRepeat",install:function(n){n.usePlugin(At);var t=n.pointerEvents;t.defaults.holdRepeatInterval=0,t.types.holdrepeat=n.actions.phaselessTypes.holdrepeat=!0},listeners:["move","up","cancel","endall"].reduce(function(n,t){return n["pointerEvents:".concat(t)]=il,n},{"pointerEvents:new":function(n){var t=n.pointerEvent;t.type==="hold"&&(t.count=(t.count||0)+1)},"pointerEvents:fired":function(n,t){var o=n.interaction,i=n.pointerEvent,c=n.eventTarget,f=n.targets;if(i.type==="hold"&&f.length){var d=f[0].eventable.options.holdRepeatInterval;d<=0||(o.holdIntervalHandle=setTimeout(function(){t.pointerEvents.fire({interaction:o,eventTarget:c,type:"hold",pointer:i,event:i},t)},d))}}})},al=sl,cl={id:"pointer-events/interactableTargets",install:function(n){var t=n.Interactable;t.prototype.pointerEvents=function(i){return J(this.events.options,i),this};var o=t.prototype._backCompatOption;t.prototype._backCompatOption=function(i,c){var f=o.call(this,i,c);return f===this&&(this.events.options[i]=c),f}},listeners:{"pointerEvents:collect-targets":function(n,t){var o=n.targets,i=n.node,c=n.type,f=n.eventTarget;t.interactables.forEachMatch(i,function(d){var p=d.events,v=p.options;p.types[c]&&p.types[c].length&&d.testIgnoreAllow(v,i,f)&&o.push({node:i,eventable:p,props:{interactable:d}})})},"interactable:new":function(n){var t=n.interactable;t.events.getRect=function(o){return t.getRect(o)}},"interactable:set":function(n,t){var o=n.interactable,i=n.options;J(o.events.options,t.pointerEvents.defaults),J(o.events.options,i.pointerEvents||{})}}},ll=cl,ul={id:"pointer-events",install:function(n){n.usePlugin(ol),n.usePlugin(al),n.usePlugin(ll)}},fl=ul,dl={id:"reflow",install:function(n){var t=n.Interactable;n.actions.phases.reflow=!0,t.prototype.reflow=function(o){return function(i,c,f){for(var d=i.getAllElements(),p=f.window.Promise,v=p?[]:null,w=function(){var _=d[y],A=i.getRect(_);if(!A)return 1;var X,V=Pt(f.interactions.list,function(ne){return ne.interacting()&&ne.interactable===i&&ne.element===_&&ne.prepared.name===c.name});if(V)V.move(),v&&(X=V._reflowPromise||new p(function(ne){V._reflowResolve=ne}));else{var K=De(A),se=function(ne){return{coords:ne,get page(){return this.coords.page},get client(){return this.coords.client},get timeStamp(){return this.coords.timeStamp},get pageX(){return this.coords.page.x},get pageY(){return this.coords.page.y},get clientX(){return this.coords.client.x},get clientY(){return this.coords.client.y},get pointerId(){return this.coords.pointerId},get target(){return this.coords.target},get type(){return this.coords.type},get pointerType(){return this.coords.pointerType},get buttons(){return this.coords.buttons},preventDefault:function(){}}}({page:{x:K.x,y:K.y},client:{x:K.x,y:K.y},timeStamp:f.now()});X=function(ne,ue,ye,we,de){var be=ne.interactions.new({pointerType:"reflow"}),je={interaction:be,event:de,pointer:de,eventTarget:ye,phase:"reflow"};be.interactable=ue,be.element=ye,be.prevEvent=de,be.updatePointer(de,de,ye,!0),Yo(be.coords.delta),yr(be.prepared,we),be._doPhase(je);var Te=ne.window,Me=Te.Promise,Le=Me?new Me(function(Ge){be._reflowResolve=Ge}):void 0;return be._reflowPromise=Le,be.start(we,ue,ye),be._interacting?(be.move(je),be.end(de)):(be.stop(),be._reflowResolve()),be.removePointer(de,de),Le}(f,i,_,c,se)}v&&v.push(X)},y=0;y<d.length&&!w();y++);return v&&p.all(v).then(function(){return i})}(this,o,n)}},listeners:{"interactions:stop":function(n,t){var o=n.interaction;o.pointerType==="reflow"&&(o._reflowResolve&&o._reflowResolve(),function(i,c){i.splice(i.indexOf(c),1)}(t.interactions.list,o))}}},hl=dl;if(Re.use(ui),Re.use(mi),Re.use(fl),Re.use(Oc),Re.use(rl),Re.use(yc),Re.use(ac),Re.use(lc),Re.use(hl),Re.default=Re,l(e)==="object"&&e)try{e.exports=Re}catch{}return Re.default=Re,Re})}(tn)),tn.exports}var ma=ga();const va=Ir(ma);function Fe(e){return e==null?"":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):typeof e=="function"?e.toString():e instanceof Date?e.toISOString():e instanceof RegExp?e.toString():e instanceof Map?JSON.stringify(Array.from(e.entries())):e instanceof Set?JSON.stringify(Array.from(e.values())):e instanceof WeakMap||e instanceof WeakSet?"":e instanceof ArrayBuffer?e.toString():Array.isArray(e)?JSON.stringify(e.map(Fe)):typeof e=="object"?JSON.stringify(Object.entries(e).sort(([r],[s])=>r.localeCompare(s))):""}function Eo(e,{isEnabled:r=!0,onDragStart:s,onDragMove:a,onDragEnd:l,...u}){const h=Ne(s),g=Ne(a),m=Ne(l);N.useLayoutEffect(()=>{if(!r)return;const S=e.current;if(!S)return;const k=va(S).draggable({inertia:!0,...u,onstart:({client:P})=>{const O=pe.make(P);h.current?.(O)},onmove:({client:P,clientX0:O,clientY0:j,dx:L,dy:x})=>{const R=pe.make(O,j),$=pe.make(P),Q=pe.make(L,x);g.current?.(Q,$,R)},onend:({client:P,clientX0:O,clientY0:j})=>{const L=pe.make(O,j),x=pe.make(P);m.current?.(x,L)}});return()=>{k.unset(),m.current?.(pe.zero,pe.zero)}},[r,Fe(u)])}function at(e,{initialValue:r,transform:s,onDragStart:a,onDragMove:l,onDragEnd:u,...h}){const g=N.useRef(r),[m,S]=N.useState(!1),[k,P]=N.useState(!1),[O,j]=N.useState(r),L=Ne(a),x=Ne(l),R=Ne(u),$=Ne(s);return Eo(e,{onDragStart:T=>{S(!0),P(!1),L.current?.(T)},onDragMove:(T,I,E)=>{const F=$.current(g.current,T.x,T.y);No(g,F)&&j(F),S(!0),P(!1),x.current?.(T,I,E)},onDragEnd:(T,I)=>{S(!1),P(!0),R.current?.(T,I)},...h}),N.useEffect(()=>{No(g,O)},[O]),{isDragging:m,isReleasing:k,value:O,setValue:j}}function No(e,r){return Ve(e.current,r)?!1:(e.current=r,!0)}const nr=N.forwardRef(({angle:e=0,speed:r=1,src:s,zeroAnchor:a=0,onAngleChange:l,onPositionChange:u,onDragStart:h,onDragEnd:g,onLoadImageStart:m,onLoadImageComplete:S,onLoadImageError:k,onImageSizeChange:P,...O},j)=>{const L=N.useCallback((F,W,Z)=>F-W*r,[r]),x=N.useRef(null),R=Be(x),$=Vn({src:s},{onLoadStart:m,onLoadComplete:S,onLoadError:k}),[Q,B]=N.useState(e),{isDragging:G,value:T,setValue:I}=at(x,{initialValue:0,transform:L,onDragStart:h,onDragEnd:g});N.useEffect(()=>{if(G||!$)return;const F=ba(e,$,ge.size(R),a);F!==T&&I(F),e!==Q&&B(e)},[e,$,R.width,R.height,a]),N.useEffect(()=>{if(!G||!$)return;const F=xa(T,$,ge.size(R),a);Q!==F&&B(F)},[T,$,R.width,R.height,a]),N.useEffect(()=>{l?.(Q,G),u?.(Q/360,G)},[Q]),N.useEffect(()=>{P?.($)},[$?.width,$?.height]);const E=ya({src:s,displacement:T});return b.jsx("div",{...O,ref:j,"aria-valuenow":Q,role:"slider",children:b.jsx("div",{ref:x,style:E.body})})});function ya({src:e="",displacement:r=NaN}){return{body:{backgroundImage:`url(${e})`,backgroundPositionX:`${-r}px`,backgroundRepeat:"repeat",backgroundSize:"auto 100%",height:"100%",touchAction:"none",width:"100%"}}}function So(e,r){const{width:s,height:a}=e,{height:l}=r;if(a<=0)return Pe.zero;const h=l/a*s;return Pe.make(h,l)}function ba(e,r,s,a){const{width:l}=So(r,s),{width:u}=s,h=u*a;return e/360*l-h}function xa(e,r,s,a){const{width:l}=So(r,s),{width:u}=s,h=u*a;let g=(e+h)%l/l*360;for(;g<0;)g+=360;return g}process.env.NODE_ENV!=="production"&&(nr.displayName="Panorama");const To=N.forwardRef(({className:e,style:r,angle:s=0,autoDimension:a="width",children:l,fov:u,speed:h=1,src:g,viewportSize:m,zeroAnchor:S=0,onAngleChange:k,onDragEnd:P,onDragStart:O,onLoadImageComplete:j,onLoadImageError:L,onLoadImageStart:x,onImageSizeChange:R,onPositionChange:$,...Q},B)=>{const G=N.useRef(null),T=Be(G),[I,E]=N.useState(),[F,W]=N.useState(!1),re=N.useCallback(()=>{if(!I)return 0;const{width:C,height:Y}=I;return Y===0?0:C/Y},[I?.width,I?.height])(),U=N.useCallback(()=>{const C=Math.min(360,Math.max(0,u??(m?m.width/(m.height*re)*360:0)));return T.width*(C/360)},[m?.width,m?.height,re,T.width,u])(),z=N.useCallback(()=>T.width<=0?S:((T.width-U)*.5+S*U)/T.width,[T.width,U,S])(),te=N.useCallback(()=>{W(!0),O?.()},[O]),ee=N.useCallback(()=>{W(!1),P?.()},[P]),ce=Oe(l,{track:bt,reticle:rn,indicator:nn}),H=wa({autoDimension:a,panoramaRect:T,aspectRatio:re,reticleWidth:U});return b.jsxs("div",{...Q,ref:B,className:ae(e,{dragging:F}),style:le(r,H.root),children:[b.jsx(nr,{ref:G,angle:s,speed:h,src:g,style:H.panorama,zeroAnchor:z,onAngleChange:k,onDragEnd:ee,onDragStart:te,onImageSizeChange:E,onLoadImageComplete:j,onLoadImageError:L,onLoadImageStart:x,onPositionChange:$}),b.jsx("div",{style:H.body,children:b.jsxs("div",{style:H.controls,children:[b.jsx(me,{className:ae({dragging:F}),element:ce.track??b.jsx(bt,{}),style:H.track}),b.jsx(me,{className:ae({dragging:F}),element:ce.reticle??b.jsx(rn,{}),style:H.reticle}),b.jsx(me,{className:ae({dragging:F}),element:ce.track??b.jsx(bt,{}),style:H.track})]})}),b.jsx(me,{className:ae({dragging:F}),element:ce.indicator??b.jsx(nn,{}),style:H.indicator})]})}),nn=({...e})=>b.jsx("div",{...e}),rn=({...e})=>b.jsx("div",{...e}),bt=({...e})=>b.jsx("div",{...e});function wa({autoDimension:e="width",panoramaRect:r=ge.zero,aspectRatio:s=0,reticleWidth:a=0}){return{root:{...e==="width"?{width:`${r.height*s}px`}:{height:`${r.width/s}px`}},body:{height:"100%",left:"0",overflow:"hidden",pointerEvents:"none",position:"absolute",top:"0",width:"100%"},panorama:{height:"100%",width:"100%"},controls:{alignItems:"center",display:"flex",height:"100%",justifyContent:"flex-start",left:"0",overflow:"visible",position:"absolute",top:"0",width:"100%"},track:{flex:"1 0 auto"},reticle:{width:`${a}px`},indicator:{width:`${a}px`}}}process.env.NODE_ENV!=="production"&&(To.displayName="PanoramaSlider",nn.displayName="PanoramaSliderIndicator",rn.displayName="PanoramaSliderReticle",bt.displayName="PanoramaSliderTrack");const Co=N.forwardRef(({children:e,className:r,decimalPlaces:s=2,isClipped:a=!1,knobHeight:l=28,knobPadding:u=0,knobWidth:h=40,max:g,min:m,orientation:S="vertical",range:k,steps:P=-1,onChange:O,...j},L)=>{const x=N.useRef(null),R=Be(x),$=N.useRef(null),Q=N.useRef(null),[B,G]=N.useState(k??[m,g]),T=_a(m,g,P),[I,E]=B.map(oe=>rt(oe,m,g,S,R,h,l,a)),F=E-I,W=Oe(e,{gutter:on,highlight:sn,knob:wt,knobContainer:an,label:xt}),Z=N.useCallback((oe,ie,fe)=>{const ve=S==="horizontal"?ie:fe,Ee=rt(m,m,g,S,R,h,l,a),Se=rt(B[1],m,g,S,R,h,l,a),xe=rt(oe,m,g,S,R,h,l,a)+ve;return ko(Math.max(Ee,Math.min(Se,xe)),m,g,S,R,h,l,a)},[h,l,a,m,g,S,B[1],ge.toString(R)]),re=N.useCallback((oe,ie,fe)=>{const ve=S==="horizontal"?ie:fe,Ee=rt(B[0],m,g,S,R,h,l,a),Se=rt(g,m,g,S,R,h,l,a),xe=rt(oe,m,g,S,R,h,l,a)+ve;return ko(Math.max(Ee,Math.min(Se,xe)),m,g,S,R,h,l,a)},[h,l,a,m,g,S,B[0],ge.toString(R)]),{isDragging:q,isReleasing:U,value:D,setValue:z}=at($,{initialValue:k?.[0]??m,transform:Z}),{isDragging:te,isReleasing:ee,value:ce,setValue:H}=at(Q,{initialValue:k?.[1]??g,transform:re}),C=Ea({isDraggingEndKnob:te,isDraggingStartKnob:q,isReleasingEndKnob:ee,isReleasingStartKnob:U}),Y=Na({orientation:S,highlightLength:F,start:I,knobPadding:u,knobWidth:h,knobHeight:l});return N.useEffect(()=>{G([D,ce])},[D,ce]),N.useEffect(()=>{O?.(B)},[B[0],B[1]]),N.useEffect(()=>{q||te||ee||Ve(k,B)||(G(k??[m,g]),z(k?.[0]??m),H(k?.[1]??g))},[k?.[0],k?.[1],q,te,ee]),N.useEffect(()=>{T&&z(_o(D,T))},[U,Fe(T)]),N.useEffect(()=>{!T||!ee||H(_o(ce,T))},[ee,Fe(T)]),b.jsx("div",{...j,ref:L,"aria-valuemax":g,"aria-valuemin":m,className:ae(r,S),role:"slider",children:b.jsxs("div",{ref:x,style:Y.body,children:[b.jsx(me,{element:W.gutter??b.jsx(on,{}),style:le(Y.gutter)}),b.jsx(me,{element:W.highlight??b.jsx(sn,{}),style:le(Y.highlight)}),b.jsx(me,{ref:$,className:C.startKnobContainer,disabled:Ve([D,ce],[m,m]),element:W.knobContainer??b.jsx(an,{}),style:le(Y.knobContainer,{pointerEvents:Ve([D,ce],[m,m])?"none":"auto"},S==="horizontal"?{left:`${I}px`,top:`${R.height*.5}px`}:{left:`${R.width*.5}px`,top:`${I}px`}),children:b.jsxs(me,{className:C.startKnob,element:W.knob??b.jsx(wt,{}),style:le(Y.knob),children:[b.jsx("div",{style:Y.knobHitBox}),W.label&&b.jsx(me,{className:C.startLabel,element:W.label??b.jsx(xt,{}),style:le(Y.label),children:Number(D.toFixed(s)).toLocaleString()})]})}),b.jsx(me,{ref:Q,className:C.endKnobContainer,disabled:Ve([D,ce],[g,g]),element:W.knobContainer??b.jsx(an,{}),style:le(Y.knobContainer,{pointerEvents:Ve([D,ce],[g,g])?"none":"auto"},S==="horizontal"?{left:`${E}px`,top:`${R.height*.5}px`}:{left:`${R.width*.5}px`,top:`${E}px`}),children:b.jsxs(me,{className:C.endKnob,element:W.knob??b.jsx(wt,{}),style:le(Y.knob),children:[b.jsx("div",{style:Y.knobHitBox}),W.label&&b.jsx(me,{className:C.endLabel,element:W.label??b.jsx(xt,{}),style:le(Y.label),children:Number(ce.toFixed(s)).toLocaleString()})]})})]})})}),on=({...e})=>b.jsx("div",{...e}),xt=({...e})=>b.jsx("div",{...e}),sn=({...e})=>b.jsx("div",{...e}),wt=({...e})=>b.jsx("div",{...e}),an=({...e})=>b.jsx("button",{...e});function Ea({isDraggingStartKnob:e=!1,isReleasingStartKnob:r=!1,isDraggingEndKnob:s=!1,isReleasingEndKnob:a=!1}){return{startKnobContainer:ae({dragging:e,releasing:r}),startKnob:ae({dragging:e,releasing:r}),startLabel:ae({dragging:e,releasing:r}),endKnobContainer:ae({dragging:s,releasing:a}),endKnob:ae({dragging:s,releasing:a}),endLabel:ae({dragging:s,releasing:a})}}function Na({orientation:e="horizontal",knobWidth:r=0,knobHeight:s=0,highlightLength:a=0,start:l=0,knobPadding:u=0}){return{body:{height:"100%",width:"100%"},gutter:{display:"block",top:"0",left:"0",position:"absolute",width:"100%",height:"100%"},highlight:{left:"0",position:"absolute",top:"0",...e==="horizontal"?{height:"100%",width:`${a}px`,transform:`translate(${l}px, 0)`}:{height:`${a}px`,width:"100%",transform:`translate(0, ${l}px)`}},knobContainer:{background:"none",border:"none",outline:"none",position:"absolute",transform:"translate(-50%, -50%)",zIndex:"1"},knob:{height:`${s}px`,touchAction:"none",width:`${r}px`},knobHitBox:{background:"none",height:`calc(100% + ${u*2}px)`,left:`-${u}px`,padding:`${u}px`,position:"absolute",top:`-${u}px`,width:`calc(100% + ${u*2}px)`},label:{pointerEvents:"none",position:"relative",userSelect:"none"}}}function Sa(e,r,s){return(e-r)/(s-r)}function Ta(e,r,s,a,l,u){switch(r){case"horizontal":{const h=u?s.width-a:s.width;return(e-(u?a*.5:0))/h}case"vertical":{const h=u?s.height-l:s.height;return(e-(u?l*.5:0))/h}default:return console.error(`[etudes::RangeSlider] Invalid orientation: ${r}`),NaN}}function Ca(e,r,s){return e*(s-r)+r}function ko(e,r,s,a,l,u,h,g){const m=Ta(e,a,l,u,h,g);return Ca(m,r,s)}function ka(e,r,s,a,l,u){switch(r){case"horizontal":{const h=u?s.width-a:s.width;return e*h+(u?a*.5:0)}case"vertical":{const h=u?s.height-l:s.height;return e*h+(u?l*.5:0)}default:return console.error(`[etudes::RangeSlider] Invalid orientation: ${r}`),NaN}}function rt(e,r,s,a,l,u,h,g){const m=Sa(e,r,s);return ka(m,a,l,u,h,g)}function _o(e,r){const s=r.length;let a=0,l=1/0;for(let u=0;u<s;u++){const h=r[u],g=Math.abs(e-h);g<l&&(l=g,a=u)}return r[a]}function _a(e,r,s){if(!(s<0))return[e,...[...Array(s)].map((a,l)=>e+(l+1)*(r-e)/(1+s)),r]}process.env.NODE_ENV!=="production"&&(Co.displayName="RangeSlider",on.displayName="RangeSliderGutter",xt.displayName="RangeSliderLabel",sn.displayName="RangeSliderHighlight",wt.displayName="RangeSliderKnob");const Po=N.forwardRef(({children:e,id:r,isRequired:s=!1,name:a,options:l,placeholder:u,value:h="",onChange:g,...m},S)=>{const k=Oe(e,{expandIcon:rr,option:Et,toggle:cn});return b.jsxs("div",{...m,ref:S,style:or.root,children:[b.jsxs(me,{"aria-required":s?"true":void 0,element:k.toggle??b.jsx(cn,{}),name:a,required:s,style:or.select,value:h,onChange:P=>g?.(P.target.value),children:[u!==void 0&&b.jsx(me,{disabled:!0,hidden:!0,element:k.option??b.jsx(Et,{}),value:"",children:u}),l.map((P,O)=>b.jsx(me,{element:k.option??b.jsx(Et,{}),value:P,children:P},`${O}-${P}`))]}),k.expandIcon&&b.jsx(me,{element:k.expandIcon,style:or.expandIcon})]})}),rr=({children:e,style:r,...s})=>b.jsx("figure",{...s,"aria-hidden":!0,style:le(r,{pointerEvents:"none"}),children:e}),cn=({children:e,...r})=>b.jsx("select",{...r,children:e}),Et=({...e})=>b.jsx("option",{...e}),or={root:{alignItems:"center",display:"flex",flexDirection:"row",justifyContent:"flex-end",position:"relative"},select:{appearance:"none",boxSizing:"border-box",height:"100%",left:0,position:"absolute",top:0,width:"100%"},expandIcon:{pointerEvents:"none",zIndex:1}};process.env.NODE_ENV!=="production"&&(Po.displayName="Select",rr.displayName="SelectExpandIcon",Et.displayName="SelectOption",cn.displayName="SelectToggle");const Oo=N.forwardRef(({children:e,className:r,isDeselectable:s=!1,isDisabled:a=!1,isSelected:l=!1,label:u,onDeselect:h,onSelect:g,onToggle:m,...S},k)=>{const P=()=>{if(!a)if(l){if(!s)return;m?.(l),h?.()}else m?.(l),g?.()};return b.jsx("button",{...S,ref:k,"aria-disabled":a,"aria-label":u,"aria-selected":l,className:ae(r,{active:l,disabled:a||l&&!s}),disabled:a||l&&!s,onClick:P,children:e??u})});process.env.NODE_ENV!=="production"&&(Oo.displayName="SelectableButton");const Io=N.forwardRef(({children:e,className:r,isClipped:s=!1,isInverted:a=!1,isTrackInteractive:l=!0,knobHeight:u=30,knobPadding:h=0,knobWidth:g=30,onlyDispatchesOnDragEnd:m=!1,orientation:S="vertical",position:k=0,trackPadding:P=0,labelProvider:O,onDragEnd:j,onDragStart:L,onChange:x,...R},$)=>{const Q=N.useRef(null),B=N.useRef(null),G=N.useCallback((te,ee,ce)=>{const H=ge.from(Q.current)??ge.zero,C=a?1-te:te;switch(S){case"horizontal":{const Y=s?H.width-g:H.width,oe=C*Y+ee,ie=Math.max(0,Math.min(1,oe/Y));return a?1-ie:ie}case"vertical":{const Y=s?H.height-u:H.height,oe=C*Y+ce,ie=Math.max(0,Math.min(1,oe/Y));return a?1-ie:ie}default:return console.error(`[etudes::Slider] Invalid orientation: ${S}`),NaN}},[Q.current,s,a,g,u,S]),T=N.useCallback(te=>{if(!l)return;const ee=ge.from(Q.current)??ge.zero,ce=ge.fromViewport();switch(S){case"horizontal":{const H=(te.clientX+ce.left-ee.left)/ee.width,C=a?1-H:H;W(C);break}case"vertical":{const H=(te.clientY+ce.top-ee.top)/ee.height,C=a?1-H:H;W(C);break}default:console.error(`[etudes::Slider] Invalid orientation: ${S}`)}},[Q.current,a,l,S]),{isDragging:I,isReleasing:E,value:F,setValue:W}=at(B,{initialValue:k,transform:G,onDragStart:L,onDragEnd:j}),Z=a?1-F:F,U=Pa({orientation:S,isAtEnd:a?F===0:F===1,isAtStart:a?F===1:F===0,isDragging:I,isReleasing:E}),D=Oa({orientation:S,isClipped:s,naturalPosition:Z,knobPadding:h,knobHeight:u,knobWidth:g,isTrackInteractive:l});N.useEffect(()=>{I||k===F||W(k)},[k]),N.useEffect(()=>{I&&m||x?.(F,I)},[F]),N.useEffect(()=>{I||!m||x?.(F,!0)},[I]);const z=Oe(e,{knob:ln,knobContainer:un,label:fn,track:Nt});return b.jsx("div",{...R,ref:$,"aria-orientation":S,"aria-valuenow":F,className:ae(r,U.root),role:"slider",children:b.jsxs("div",{ref:Q,style:D.body,children:[b.jsx(me,{element:z.track??b.jsx(Nt,{}),style:le(D.track,S==="vertical"?{height:`calc(${Z*100}% - ${P<=0?0:u*.5}px - ${P}px)`,top:"0"}:{left:"0",width:`calc(${Z*100}% - ${P<=0?0:g*.5}px - ${P}px)`}),onClick:T,children:b.jsx("div",{style:D.trackHitBox})}),b.jsx(me,{element:z.track??b.jsx(Nt,{}),style:le(D.track,S==="vertical"?{bottom:"0",height:`calc(${(1-Z)*100}% - ${P<=0?0:u*.5}px - ${P}px)`}:{right:"0",width:`calc(${(1-Z)*100}% - ${P<=0?0:g*.5}px - ${P}px)`}),onClick:T,children:b.jsx("div",{style:D.trackHitBox})}),b.jsx(me,{ref:B,className:ae(U.knobContainer),element:z.knobContainer??b.jsx(un,{}),style:D.knobContainer,children:b.jsxs(me,{className:ae(U.knob),element:z.knob??b.jsx(ln,{}),style:le(D.knob),children:[b.jsx("div",{style:D.knobHitBox}),O&&b.jsx(me,{className:ae(U.label),element:z.label??b.jsx(fn,{}),style:le(D.label),children:O(F)})]})})]})})}),Nt=({...e})=>b.jsx("div",{...e}),ln=({...e})=>b.jsx("div",{...e}),un=({...e})=>b.jsx("button",{...e}),fn=({...e})=>b.jsx("div",{...e});function Pa({orientation:e="vertical",isAtEnd:r=!1,isAtStart:s=!1,isDragging:a=!1,isReleasing:l=!1}){return{root:ae(e,{"at-end":r,"at-start":s,dragging:a,releasing:l}),track:ae(e,{"at-end":r,"at-start":s,dragging:a,releasing:l}),knob:ae(e,{"at-end":r,"at-start":s,dragging:a,releasing:l}),knobContainer:ae(e,{"at-end":r,"at-start":s,dragging:a,releasing:l}),label:ae(e,{"at-end":r,"at-start":s,dragging:a,releasing:l})}}function Oa({orientation:e="vertical",isClipped:r=!1,naturalPosition:s=0,knobPadding:a=0,knobHeight:l=0,knobWidth:u=0,isTrackInteractive:h=!0}){return{body:{height:"100%",width:"100%"},knobContainer:{background:"none",border:"none",outline:"none",position:"absolute",transform:"translate(-50%, -50%)",zIndex:"1",...e==="vertical"?{left:"50%",top:r?`calc(${s*100}% + ${l*.5-s*l}px)`:`${s*100}%`}:{left:r?`calc(${s*100}% + ${u*.5-s*u}px)`:`${s*100}%`,top:"50%"}},knob:{height:`${l}px`,touchAction:"none",width:`${u}px`},knobHitBox:{background:"none",height:`calc(100% + ${a*2}px)`,left:`-${a}px`,padding:`${a}px`,position:"absolute",top:`-${a}px`,width:`calc(100% + ${a*2}px)`},label:{pointerEvents:"none",userSelect:"none"},track:{cursor:h?"pointer":"auto",pointerEvents:h?"auto":"none",position:"absolute",...e==="vertical"?{left:"0",margin:"0 auto",right:"0",width:"100%"}:{bottom:"0",height:"100%",margin:"auto 0",top:"0"}},trackHitBox:{height:"100%",minHeight:"20px",minWidth:"20px",position:"absolute",transform:e==="horizontal"?"translate(0, -50%)":"translate(-50%, 0)",width:"100%"}}}process.env.NODE_ENV!=="production"&&(Io.displayName="Slider",Nt.displayName="SliderTrack",ln.displayName="SliderKnob",un.displayName="SliderKnobContainer",fn.displayName="SliderLabel");const Ro=N.forwardRef(({children:e,className:r,index:s=0,isClipped:a=!1,isInverted:l=!1,isTrackInteractive:u=!0,knobHeight:h=30,knobPadding:g=0,knobWidth:m=30,labelProvider:S,onlyDispatchesOnDragEnd:k=!1,orientation:P="vertical",steps:O=jo(10),trackPadding:j=0,onDragEnd:L,onDragStart:x,onIndexChange:R,onPositionChange:$,...Q},B)=>{const G=N.useRef(null),T=N.useRef(null),I=Be(G),[E,F]=N.useState(s),W=N.useCallback((Y,oe,ie)=>{const fe=l?Je(Y):Y;switch(P){case"horizontal":{const ve=a?I.width-m:I.width,Ee=fe*ve+oe,Se=gn(Ee/ve);return l?Je(Se):Se}case"vertical":{const ve=a?I.height-h:I.height,Ee=fe*ve+ie,Se=gn(Ee/ve);return l?Je(Se):Se}default:return console.error(`[etudes::StepSlider] Invalid orientation: ${P}`),NaN}},[I.width,I.height,a,l,m,h,P]),{isDragging:Z,isReleasing:re,value:q,setValue:U}=at(T,{initialValue:ct(s,O),transform:W,onDragStart:x,onDragEnd:L}),D=N.useCallback(Y=>{if(!u)return;const oe=ge.fromViewport();switch(P){case"horizontal":{const ie=(Y.clientX+oe.left-I.left)/I.width,fe=l?Je(ie):ie,ve=Tt(fe,O);if(ve===E){const Ee=fe>q?ve+1:ve-1;F(gn(Ee,O.length-1))}else F(ve);break}case"vertical":{const ie=(Y.clientY+oe.top-I.top)/I.height,fe=l?Je(ie):ie,ve=Tt(fe,O);if(ve===E){const Ee=fe>q?ve+1:ve-1,Se=ct(Ee,O);U(Se),F(gn(Ee,O.length-1))}else{const Ee=ct(ve,O);U(Ee),F(ve)}break}default:console.error(`[etudes::StepSlider] Invalid orientation: ${P}`)}},[I.width,I.left,I.top,I.height,E,q,l,u,P,Fe(O)]),z=l?Je(q):q,ce=Ia({orientation:P,isAtEnd:l?q===0:q===1,isAtStart:l?q===1:q===0,isDragging:Z,isReleasing:re}),H=Ra({orientation:P,naturalPosition:z,isClipped:a,knobPadding:g,knobHeight:h,knobWidth:m,isTrackInteractive:u}),C=Oe(e,{knob:dn,knobContainer:hn,label:pn,track:St});return N.useEffect(()=>{Z||(U(ct(s,O)),F(s))},[s,Z,Fe(O)]),N.useEffect(()=>{if(Z){if(k)return;F(Tt(q,O))}else{const Y=Tt(q,O),oe=ct(Y,O);U(oe),F(Y)}},[q,Z,k,Fe(O)]),N.useEffect(()=>{$?.(q,Z)},[q,Z]),N.useEffect(()=>{R?.(E,Z)},[E,Z]),b.jsx("div",{...Q,ref:B,"aria-valuenow":E,className:ae(r,ce.root),role:"slider",children:b.jsxs("div",{ref:G,style:H.body,children:[b.jsx(me,{className:ae(l?"end":"start",ce.track),element:C.track??b.jsx(St,{}),style:le(H.track,P==="vertical"?{height:`calc(${z*100}% - ${j<=0?0:h*.5}px - ${j}px)`,top:"0"}:{left:"0",width:`calc(${z*100}% - ${j<=0?0:m*.5}px - ${j}px)`}),onClick:D,children:b.jsx("div",{style:H.trackHitBox})}),b.jsx(me,{className:ae(l?"start":"end",ce.track),element:C.track??b.jsx(St,{}),style:le(H.track,P==="vertical"?{bottom:"0",height:`calc(${Je(z)*100}% - ${j<=0?0:h*.5}px - ${j}px)`}:{right:"0",width:`calc(${Je(z)*100}% - ${j<=0?0:m*.5}px - ${j}px)`}),onClick:D,children:b.jsx("div",{style:H.trackHitBox})}),b.jsx(me,{ref:T,className:ae(ce.knobContainer),element:C.knobContainer??b.jsx(hn,{}),style:le(H.knobContainer),children:b.jsxs(me,{className:ae(ce.knob),element:C.knob??b.jsx(dn,{}),style:le(H.knob),children:[b.jsx("div",{style:H.knobHitBox}),O&&S&&b.jsx(me,{className:ae(ce.label),element:C.label??b.jsx(pn,{}),style:le(H.label),children:S(q,Tt(q,O))})]})})]})})}),dn=({...e})=>b.jsx("div",{...e}),hn=({...e})=>b.jsx("button",{...e}),pn=({...e})=>b.jsx("div",{...e}),St=({...e})=>b.jsx("div",{...e});function jo(e){if(e<=1)return console.error("[etudes::StepSlider] `length` value must be greater than or equal to 2"),[];if(Math.round(e)!==e)return console.error("[etudes::StepSlider] `length` value must be an integer"),[];const r=1/(e-1);return Array(e).fill(null).map((s,a)=>r*a)}function Tt(e,r){let s=-1,a=NaN;for(let l=0,u=r.length;l<u;l++){const h=ct(l,r);if(isNaN(h))continue;const g=Math.abs(e-h);(isNaN(a)||g<a)&&(a=g,s=l)}return s}function ct(e,r){return e>=r.length?NaN:r[e]}function Ia({orientation:e="vertical",isAtEnd:r=!1,isAtStart:s=!1,isDragging:a=!1,isReleasing:l=!1}){return{root:ae(e,{"at-end":r,"at-start":s,dragging:a,releasing:l}),track:ae(e,{"at-end":r,"at-start":s,dragging:a,releasing:l}),knob:ae(e,{"at-end":r,"at-start":s,dragging:a,releasing:l}),knobContainer:ae(e,{"at-end":r,"at-start":s,dragging:a,releasing:l}),label:ae(e,{"at-end":r,"at-start":s,dragging:a,releasing:l})}}function Ra({orientation:e="vertical",naturalPosition:r=0,isClipped:s=!1,knobPadding:a=0,knobHeight:l=0,knobWidth:u=0,isTrackInteractive:h=!1}){return{body:{height:"100%",width:"100%"},knobContainer:{background:"none",border:"none",outline:"none",position:"absolute",transform:"translate3d(-50%, -50%, 0)",zIndex:"1",...e==="vertical"?{left:"50%",top:s?`calc(${r*100}% + ${l*.5-r*l}px)`:`${r*100}%`}:{left:s?`calc(${r*100}% + ${u*.5-r*u}px)`:`${r*100}%`,top:"50%"}},knob:{height:`${l}px`,touchAction:"none",width:`${u}px`},knobHitBox:{background:"none",height:`calc(100% + ${a*2}px)`,left:`-${a}px`,padding:`${a}px`,position:"absolute",top:`-${a}px`,width:`calc(100% + ${a*2}px)`},label:{pointerEvents:"none",userSelect:"none"},track:{cursor:h?"pointer":"auto",pointerEvents:h?"auto":"none",position:"absolute",...e==="vertical"?{left:"0",margin:"0 auto",right:"0",width:"100%"}:{bottom:"0",height:"100%",margin:"auto 0",top:"0"}},trackHitBox:{height:"100%",minHeight:"20px",minWidth:"20px",position:"absolute",transform:e==="horizontal"?"translate3d(0, -50%, 0)":"translate3d(-50%, 0, 0)",width:"100%"}}}function Je(e){return 1-e}function gn(e,r=1,s=0){return Math.max(s,Math.min(r,e))}process.env.NODE_ENV!=="production"&&(Ro.displayName="StepSlider",St.displayName="StepSliderTrack",dn.displayName="StepSliderKnob",hn.displayName="StepSliderKnobContainer",pn.displayName="StepSliderLabel");const Ao=N.forwardRef(({children:e,isEnabled:r=!0,threshold:s=.5,onSwipeDown:a,onSwipeLeft:l,onSwipeRight:u,onSwipeUp:h,...g},m)=>{const[S,k]=N.useState(void 0),[P,O]=N.useState(void 0),[j,L]=N.useState(NaN),x=(B,G)=>{if(isNaN(B)||isNaN(G))return Q();k(pe.make(B,G))},R=(B,G)=>{const T=S;if(T===void 0)return;const I=T.x!==B||T.y!==G,E=!isNaN(j);I&&(E||L(Date.now()),O(pe.make(B,G)))},$=()=>{const B=j,G=S,T=P;if(isNaN(B)||G===void 0||T===void 0)return;const I=Date.now()-B,E=T.x-G.x,F=T.y-G.y,W=E/I,Z=F/I;r&&(Math.abs(W)>=s&&Math.abs(W)>Math.abs(Z)?W>0?u?.():l?.():Math.abs(Z)>=s&&Math.abs(Z)>Math.abs(W)&&(Z>0?a?.():h?.())),Q()},Q=()=>{k(void 0),O(void 0),L(NaN)};return b.jsx("div",{...g,ref:m,onMouseDown:B=>x(B.clientX,B.clientY),onMouseLeave:()=>Q(),onMouseMove:B=>R(B.clientX,B.clientY),onMouseUp:()=>$(),onTouchEnd:()=>$(),onTouchMove:B=>R(B.targetTouches[0].clientX,B.targetTouches[0].clientY),onTouchStart:B=>x(B.targetTouches[0].clientX,B.targetTouches[0].clientY),children:e})});process.env.NODE_ENV!=="production"&&(Ao.displayName="SwipeRegion");const Mo=N.forwardRef(({onChange:e,...r},s)=>b.jsx("textarea",{...r,ref:s,onChange:a=>e(a.target.value)}));process.env.NODE_ENV!=="production"&&(Mo.displayName="TextArea");const zo=N.forwardRef(({className:e,children:r,isInverted:s=!1,isOn:a=!1,orientation:l="horizontal",style:u,onChange:h,...g},m)=>{const S=N.useRef(null),k=jn(S),P=Oe(r,{knob:vn,track:mn}),O=ja({isOn:a}),j=Aa({isOn:a,isInverted:s,orientation:l,knobSize:k});return b.jsxs("label",{...g,ref:m,className:ae(e,O.root),style:le(u,j.root),children:[b.jsx("input",{checked:a,style:j.input,type:"checkbox",onChange:L=>h?.(L.target.checked)}),b.jsx(me,{className:O.track,element:P.track??b.jsx(mn,{}),style:j.track,children:b.jsx("div",{style:{position:"relative",width:"100%",height:"100%"},children:b.jsx(me,{ref:S,className:O.knob,element:P.knob??b.jsx(vn,{}),style:j.knob})})})]})}),mn=({children:e,...r})=>b.jsx("div",{...r,children:e}),vn=({children:e,...r})=>b.jsx("div",{...r,children:e});function ja({isOn:e=!1}){return{root:ae({active:e}),knob:ae({active:e}),track:ae({active:e})}}function Aa({isOn:e=!1,isInverted:r=!1,knobSize:s=Pe.zero,orientation:a="horizontal"}){return{root:{alignItems:"center",display:"flex",justifyContent:"start",position:"relative",...a==="horizontal"?{flexDirection:"row"}:{flexDirection:"column"}},input:{position:"absolute",top:0,left:0,opacity:0,width:0,height:0},knob:{position:"absolute",...a==="horizontal"?{...s.height>0?{top:`calc((100% - ${s.height}px) / 2)`}:{visibility:"hidden"},...s.width>0?{...r?{left:e?"0":`calc(100% - ${s.width}px)`}:{left:e?`calc(100% - ${s.width}px)`:"0"}}:{visibility:"hidden"}}:{...s.width>0?{left:`calc((100% - ${s.width}px) / 2)`}:{visibility:"hidden"},...s.height>0?{...r?{top:e?"0":`calc(100% - ${s.height}px)`}:{top:e?`calc(100% - ${s.height}px)`:"0"}}:{visibility:"hidden"}}},track:{position:"relative"}}}process.env.NODE_ENV!=="production"&&(zo.displayName="Toggle",vn.displayName="ToggleKnob",mn.displayName="ToggleTrack");const ir=N.forwardRef(({children:e,...r},s)=>(Array.isArray(e)&&console.error(`[etudes::ExtractChild] Only one child is expected, but found ${e.length}. Only the first child is extracted while the rest are discarded.`),N.Children.map(e,(a,l)=>{if(!(l>0))return N.isValidElement(a)?Ft(a,{...r,ref:s}):a})));process.env.NODE_ENV!=="production"&&(ir.displayName="ExtractChild");function Lo({children:e,className:r,style:s,alignment:a,arrowHeight:l=6,arrowWidth:u=12,gap:h=4,hint:g,maxWidth:m=200,threshold:S=100}){const k=N.useRef(null),P=N.useRef(void 0),O=Be(k),j=N.useCallback(()=>{const R=document.createElement("span");R.className=ae(r),R.innerHTML=g,R.role="tooltip";const $=a??(k.current?za(k.current,S):"tl"),Q=Ma(R),B=Da({alignment:$,arrowSize:Pe.make(u,l),gap:h,maxDialogWidth:m,fullDialogWidth:Q.width,targetWidth:O.width}),G=le(s,B.dialog);Object.keys(G).forEach(I=>R.style[I]=G[I]);const T=document.createElement("span");return Object.keys(B.arrow).forEach(I=>T.style[I]=B.arrow[I]),R.appendChild(T),R},[r,a,g,m,Fe(s),O.width,S,l,u,h]),L=N.useCallback(()=>{P.current&&(P.current.style.opacity="1",P.current.ariaHidden="false")},[]),x=N.useCallback(()=>{P.current&&(P.current.style.opacity="0",P.current.ariaHidden="true")},[]);return N.useEffect(()=>{const R=j();return k.current?.appendChild(R),P.current=R,()=>{k.current?.removeChild(R),P.current=void 0}},[j]),b.jsx(ir,{ref:k,onMouseEnter:L,onMouseLeave:x,children:e})}function Ma(e){const r=e.cloneNode(!1);r.innerHTML=e.innerHTML,r.style.visibility="hidden",r.style.whiteSpace="pre",document.body.appendChild(r);const s=r.getBoundingClientRect();return document.body.removeChild(r),Pe.make(s.width,s.height)}function za(e,r){const s=ge.fromViewport(),a=ge.intersecting(e);if(a){const l=a.left-s.left<r,u=s.right-a.right<r,h=a.top-s.top<r,g=s.bottom-a.bottom<r;if(l&&h)return"br";if(l&&g)return"tr";if(u&&h)return"bl";if(u&&g)return"tl";if(l)return"cr";if(u)return"cl";if(g)return"tc"}return"tc"}function La({alignment:e,arrowSize:r,fullDialogWidth:s,gap:a,maxDialogWidth:l,targetWidth:u}){const h=Math.min(s,l),g=u>h;switch(e){case"tl":return{bottom:`calc(100% + ${r.height}px + ${a}px)`,right:g?"":"0",left:g?"50%":"",transform:`translate(${h>u?"0":"-50%"}, 0)`};case"tc":return{bottom:`calc(100% + ${r.height}px + ${a}px)`,left:"50%",transform:"translateX(-50%)"};case"tr":return{bottom:`calc(100% + ${r.height}px + ${a}px)`,left:g?"50%":"0",transform:`translate(${h>u?"0":"-50%"}, 0)`};case"cl":return{top:"50%",right:`calc(100% + ${r.height+a}px)`,transform:"translate(0, -50%)"};case"cr":return{top:"50%",left:`calc(100% + ${r.height+a}px)`,transform:"translate(0, -50%)"};case"bl":return{left:g?"50%":"",right:g?"":"0",top:`calc(100% + ${r.height}px + ${a}px)`,transform:`translate(${h>u?"0":"-50%"}, 0)`};case"bc":return{left:"50%",top:`calc(100% + ${r.height}px + ${a}px)`,transform:"translateX(-50%)"};case"br":return{left:g?"50%":"0",top:`calc(100% + ${r.height}px + ${a}px)`,transform:`translate(${h>u?"0":"-50%"}, 0)`};default:return console.error(`[etudes::WithTooltip] Invalid alignment: ${e}`),{}}}function Fa({alignment:e,arrowSize:r,fullDialogWidth:s,maxDialogWidth:a,targetWidth:l}){const u=Math.min(s,a),h=l>u;switch(e){case"tl":return{bottom:0,clipPath:"polygon(50% 100%,100% 0,0 0)",height:`${r.height}px`,left:h?"50%":"",right:h?"":`${l-r.width/2-l/2}px`,transform:`translate(${h?"-50%":"0"}, 100%)`,width:`${r.width}px`};case"tc":return{bottom:0,clipPath:"polygon(50% 100%,100% 0,0 0)",height:`${r.height}px`,left:"50%",transform:"translate(-50%, 100%)",width:`${r.width}px`};case"tr":return{bottom:0,clipPath:"polygon(50% 100%,100% 0,0 0)",height:`${r.height}px`,left:h?"50%":`${l-r.width/2-l/2}px`,transform:`translate(${h?"-50%":"0"}, 100%)`,width:`${r.width}px`};case"cl":return{clipPath:"polygon(0 0,100% 50%,0 100%)",height:`${r.width}px`,right:"0",top:"50%",transform:"translate(100%, -50%)",width:`${r.height}px`};case"cr":return{clipPath:"polygon(100% 0,0 50%,100% 100%)",height:`${r.width}px`,left:"0",top:"50%",transform:"translate(-100%, -50%)",width:`${r.height}px`};case"bl":return{clipPath:"polygon(50% 0,100% 100%,0 100%)",height:`${r.height}px`,left:h?"50%":"",right:h?"":`${l-r.width/2-l/2}px`,top:"0",transform:`translate(${h?"-50%":"0"}, -100%)`,width:`${r.width}px`};case"bc":return{clipPath:"polygon(50% 0,100% 100%,0 100%)",height:`${r.height}px`,left:"50%",top:"0",transform:"translate(-50%, -100%)",width:`${r.width}px`};case"br":return{clipPath:"polygon(50% 0,100% 100%,0 100%)",height:`${r.height}px`,left:h?"50%":`${l-r.width/2-l/2}px`,top:"0",transform:`translate(${h?"-50%":"0"}, -100%)`,width:`${r.width}px`};default:return console.error(`[etudes::WithTooltip] Invalid alignment: ${e}`),{}}}function Da({alignment:e,arrowSize:r,fullDialogWidth:s,gap:a,maxDialogWidth:l,targetWidth:u}){return{dialog:{boxSizing:"border-box",height:"auto",margin:"0",opacity:"0",pointerEvents:"none",position:"absolute",userSelect:"none",whiteSpace:s>l?"normal":"pre",width:s>l?`${l}px`:"",...La({alignment:e,arrowSize:r,fullDialogWidth:s,gap:a,maxDialogWidth:l,targetWidth:u})},arrow:{background:"inherit",position:"absolute",...Fa({alignment:e,arrowSize:r,fullDialogWidth:s,maxDialogWidth:l,targetWidth:u})}}}process.env.NODE_ENV!=="production"&&(Lo.displayName="WithTooltip");function Va(e,r){const s=Ne(r);N.useLayoutEffect(()=>{const a=l=>{if(!(l.target instanceof Node))return;let u=!0,h=l.target;const m=[].concat(e).map(S=>S.current);for(;h;){if(m.find(S=>S===h)){u=!1;break}if(!h.parentNode)break;h=h.parentNode}u&&s.current()};return window.addEventListener("click",a,!0),()=>{window.removeEventListener("click",a,!0)}},[])}function Ba(e){const[r,s]=N.useState(!1),a=N.useCallback(h=>{h.preventDefault(),h.stopPropagation(),s(!0)},[]),l=N.useCallback(h=>{h.preventDefault(),h.stopPropagation(),s(!1)},[]),u=N.useCallback(h=>{h.preventDefault(),h.stopPropagation(),s(!1);const g=h.dataTransfer.files;if(g&&g.length>0){const m=g[0];new FormData().append("file",m),e(m)}},[]);return{isDropping:r,onDragOver:a,onDragLeave:l,onDrop:u}}function Ha(e,r){const s=Ne(r);N.useEffect(()=>{const a=l=>{l.key===e&&s.current?.()};return window.addEventListener("keydown",a),()=>{window.removeEventListener("keydown",a)}},[e])}function Ya(){const[e,r]=N.useState(!1);return N.useEffect(()=>(r(!0),()=>{r(!1)}),[]),e}function Xa({onChange:e}){const r=Ne(e),s=N.useRef(void 0),a=N.useRef(!1);N.useLayoutEffect(()=>{const l=()=>{const h=Ua();h&&(r.current(h,s.current),s.current=h)},u=()=>{a.current||typeof requestAnimationFrame=="function"&&(a.current=!0,requestAnimationFrame(()=>{l(),a.current=!1}))};return window.addEventListener("scroll",u,{passive:!0}),window.addEventListener("resize",u),window.addEventListener("orientationchange",u),u(),()=>{window.removeEventListener("scroll",u),window.removeEventListener("resize",u),window.removeEventListener("orientationchange",u)}},[])}function Ua(){const e=ge.fromViewport(),r=ge.clone(e,{x:0,y:0}),s=ge.from(window,{overflow:!0});if(!s)return;const a=ge.clone(r,{x:s.width-e.width,y:s.height-e.height}),l=pe.make(e.left/a.left,e.top/a.top);return{minPos:pe.make(r.left,r.top),maxPos:pe.make(a.left,a.top),pos:pe.make(e.left,e.top),step:l}}function Ga(e,r,{mapSearchParamToState:s,mapStateToSearchParam:a,shouldPopulateDefaultState:l=!1}={}){const u=N.useCallback((O,j)=>s?s(O):O||j,[s]),h=N.useCallback(O=>a?a(O):!l&&O===r?void 0:`${O}`,[r,l,a]),[g,m]=In.useSearchParams(),S=u(g.get(e)??void 0,r),[k,P]=N.useState(S);return N.useEffect(()=>{const O=g.get(e),j=h(k);j!==O&&(j?g.set(e,j):g.delete(e),m(g))},[k,h]),[k,P]}function Ka(e,{autoStarts:r=!0,onTimeout:s}){const a=N.useRef(void 0),l=Ne(s),u=N.useCallback(()=>{a.current!==void 0&&(clearTimeout(a.current),a.current=void 0)},[]),h=N.useCallback(()=>{u(),!(e<0)&&(a.current=setTimeout(()=>{u(),l.current()},e))},[e,u]);return N.useEffect(()=>(r&&e>=0&&h(),u),[r,e,h,u]),{start:h,stop:u}}function Fo({children:e,if:r}){switch(typeof r){case"function":return r()?b.jsx(b.Fragment,{children:e}):b.jsx(b.Fragment,{});default:return r?b.jsx(b.Fragment,{children:e}):b.jsx(b.Fragment,{})}}process.env.NODE_ENV!=="production"&&(Fo.displayName="Conditional");function Do({children:e,...r}){return b.jsx(b.Fragment,{children:N.Children.map(e,s=>N.isValidElement(s)?Ft(s,{...r}):s)})}process.env.NODE_ENV!=="production"&&(Do.displayName="ExtractChildren");function Wa({children:e,condition:r}){const s=N.Children.toArray(e);if(s.length===0)return console.error("[etudes::Switch] `Switch` must have at least one child"),b.jsx(b.Fragment,{});if(!Ja(s))return console.error("[etudes::Switch] `Switch` children must be of `Case` type or `Default` type"),b.jsx(b.Fragment,{});const a=s.filter(u=>u.type===sr);if(a.length>1)return console.error("[etudes::Switch] `Switch` can only have maximum one `Default` child"),b.jsx(b.Fragment,{});const l=a[0];for(const u of s)if(typeof r=="function"){if(r(u.props.value))return u}else if(r===u.props.value)return u;if(l)return l}function Vo({children:e}){return e}function sr({children:e}){return e}function Ja(e){return e.every(r=>N.isValidElement(r)&&(r.type===Vo||r.type===sr))}M.ColorScheme=void 0,(e=>{function r(s){return s==="light"?"dark":"light"}e.toggled=r})(M.ColorScheme||(M.ColorScheme={}));function Za({children:e}){const r=()=>{const l=localStorage.getItem("color-scheme");return l||(window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light")},[s,a]=N.useState(r());return N.useEffect(()=>{localStorage.setItem("color-scheme",s),document.documentElement.classList.toggle("dark",s==="dark")},[s]),b.jsx(lt.Provider,{value:{colorScheme:s,setColorScheme:a},children:e})}const lt=N.createContext(void 0);function Qa(){const e=N.useContext(lt);return e?e.colorScheme:(console.error("useColorScheme must be used within a ColorSchemeProvider"),"light")}function $a(){const e=N.useContext(lt);return e?e.setColorScheme:(console.error("useSetColorScheme must be used within a ColorSchemeProvider"),()=>{})}function qa(){const e=N.useContext(lt);return e?N.useCallback(()=>{e.setColorScheme(r=>M.ColorScheme.toggled(r))},[]):(console.error("useToggleColorScheme must be used within a ColorSchemeProvider"),()=>{})}process.env.NODE_ENV!=="production"&&(lt.displayName="ColorSchemeContext");const ar=N.createContext(void 0);function Bo({children:e}){const r=N.useRef(!1),[s,a]=N.useState({minPos:pe.zero,maxPos:pe.zero,pos:pe.zero,step:pe.zero});return N.useEffect(()=>{const l=()=>{const h=ge.fromViewport(),g=ge.clone(h,{x:0,y:0}),m=ge.from(window,{overflow:!0});if(!m)return;const S=ge.clone(g,{x:m.width-h.width,y:m.height-h.height}),k=pe.make(h.left/S.left,h.top/S.top);a({minPos:pe.make(g.left,g.top),maxPos:pe.make(S.left,S.top),pos:pe.make(h.left,h.top),step:k})},u=()=>{r.current||typeof requestAnimationFrame=="function"&&(r.current=!0,requestAnimationFrame(()=>{l(),r.current=!1}))};return window.addEventListener("scroll",u,{passive:!0}),window.addEventListener("resize",u),window.addEventListener("orientationchange",u),u(),()=>{window.removeEventListener("scroll",u),window.removeEventListener("resize",u),window.removeEventListener("orientationchange",u)}},[]),b.jsx(ar.Provider,{value:s,children:e})}function ec(e){const r=N.useContext(ar);if(!r)return console.error("Cannot fetch the current scroll position context, is the corresponding provider instated?"),{pos:pe.zero,step:pe.zero};if(!e)return{pos:r.pos,step:r.step};const s=e.current,a=ge.fromViewport(),l=ge.from(s);if(!a||!l)return{pos:pe.zero,step:pe.zero};const u=a.right-l.left,h=a.bottom-l.top,g=u/l.width,m=h/l.height;return{pos:pe.make(u,h),step:pe.make(g,m)}}process.env.NODE_ENV!=="production"&&(Bo.displayName="ScrollPositionProvider");function cr(e){return e==null?"":Array.isArray(e)?JSON.stringify(e.map(cr)):typeof e=="object"?JSON.stringify(Object.entries(e).sort(([r],[s])=>r.localeCompare(s)).map(([r,s])=>[r,cr(s)])):Fe(e)}M.Accordion=Fr,M.AccordionCollapseIcon=Mn,M.AccordionExpandIcon=An,M.AccordionHeader=Vt,M.AccordionItem=Bt,M.AccordionSection=zn,M.Burger=Ln,M.BurgerBar=mt,M.BurgerButton=Vr,M.BurgerButtonBar=Br,M.Button=Hr,M.Carousel=Ur,M.Case=Vo,M.Collection=Dt,M.CollectionItem=st,M.ColorSchemeContext=lt,M.ColorSchemeProvider=Za,M.Conditional=Fo,M.Counter=Kr,M.CounterAddButton=Ut,M.CounterSubtractButton=Gt,M.CounterTextField=Xt,M.CoverImage=Zr,M.CoverImageContent=Hn,M.CoverImageViewport=Yn,M.CoverVideo=qr,M.CoverVideoContent=Gn,M.CoverVideoViewport=Kn,M.Default=sr,M.Dial=eo,M.DialKnob=Jt,M.DialTrack=Wt,M.Dropdown=no,M.DropdownCollapseIcon=Jn,M.DropdownCollection=Zt,M.DropdownExpandIcon=Zn,M.DropdownItem=Qt,M.DropdownToggle=$t,M.Each=gt,M.ExtractChild=ir,M.ExtractChildren=Do,M.FlatSVG=go,M.Image=Bn,M.MasonryGrid=vo,M.OptionButton=xo,M.Panorama=nr,M.PanoramaSlider=To,M.PanoramaSliderIndicator=nn,M.PanoramaSliderReticle=rn,M.PanoramaSliderTrack=bt,M.RangeSlider=Co,M.RangeSliderGutter=on,M.RangeSliderHighlight=sn,M.RangeSliderKnob=wt,M.RangeSliderKnobContainer=an,M.RangeSliderLabel=xt,M.Repeat=Yt,M.ScrollPositionContext=ar,M.ScrollPositionProvider=Bo,M.Select=Po,M.SelectExpandIcon=rr,M.SelectOption=Et,M.SelectToggle=cn,M.SelectableButton=Oo,M.Slider=Io,M.SliderKnob=ln,M.SliderKnobContainer=un,M.SliderLabel=fn,M.SliderTrack=Nt,M.StepSlider=Ro,M.StepSliderKnob=dn,M.StepSliderKnobContainer=hn,M.StepSliderLabel=pn,M.StepSliderTrack=St,M.SwipeRegion=Ao,M.Switch=Wa,M.TextArea=Mo,M.TextField=Dn,M.Toggle=zo,M.ToggleKnob=vn,M.ToggleTrack=mn,M.Video=Un,M.WithTooltip=Lo,M.asClassNameDict=Gi,M.asComponentDict=Oe,M.asStyleDict=Fi,M.cloneStyledElement=Ft,M.createKey=Fe,M.createKeyDeep=cr,M.generateSteps=jo,M.styles=le,M.useClickOutside=Va,M.useColorScheme=Qa,M.useDrag=Yr,M.useDropzone=Ba,M.useImageLoader=Jr,M.useImageSize=Vn,M.useInertiaDrag=Eo,M.useInertiaDragValue=at,M.useInterval=Xr,M.useKeyboardShortcut=Ha,M.useLatest=Ne,M.useMounted=Ya,M.usePosition=Xa,M.usePrevious=Gr,M.useRect=Be,M.useScrollPosition=ec,M.useSearchState=Ga,M.useSetColorScheme=$a,M.useSize=jn,M.useSizeObserver=Lt,M.useTimeout=Ka,M.useToggleColorScheme=qa,M.useVideoMetadataLoader=Qr,M.useVideoSize=$r,M.useViewportSize=Wr,Object.defineProperty(M,Symbol.toStringTag,{value:"Module"})});
|