etudes 21.2.1 → 21.2.2

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 CHANGED
@@ -5364,7 +5364,7 @@ const Qo = /* @__PURE__ */ _e(({
5364
5364
  if (!r) return;
5365
5365
  const M = T.findIndex((Y) => Y === "");
5366
5366
  M !== -1 && N(M);
5367
- }, [T, r]), /* @__PURE__ */ b.jsx("div", { ...x, ref: O, style: ce(d, C.root), children: /* @__PURE__ */ b.jsx(nn, { count: u, children: (M) => /* @__PURE__ */ b.jsx(
5367
+ }, [r]), /* @__PURE__ */ b.jsx("div", { ...x, ref: O, style: ce(d, C.root), children: /* @__PURE__ */ b.jsx(nn, { count: u, children: (M) => /* @__PURE__ */ b.jsx(
5368
5368
  ge,
5369
5369
  {
5370
5370
  ref: (Y) => I.current[M] = Y,
@@ -3,7 +3,7 @@
3
3
  <%s {...props} />
4
4
  React keys must be passed directly to JSX without using spread:
5
5
  let props = %s;
6
- <%s key={someKey} {...props} />`,Z,de,Ne,de),D[de+Z]=!0)}if(de=null,q!==void 0&&(i(q),de=""+q),d(J)&&(i(J.key),de=""+J.key),"key"in J){q={};for(var te in J)te!=="key"&&(q[te]=J[te])}else q=J;return de&&g(q,typeof I=="function"?I.displayName||I.name||"Unknown":I),b(I,de,q,c(),pe,ve)}function _(I){P(I)?I._store&&(I._store.validated=1):typeof I=="object"&&I!==null&&I.$$typeof===G&&(I._payload.status==="fulfilled"?P(I._payload.value)&&I._payload.value._store&&(I._payload.value._store.validated=1):I._store&&(I._store.validated=1))}function P(I){return typeof I=="object"&&I!==null&&I.$$typeof===z}var A=T,z=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),ne=Symbol.for("react.strict_mode"),$=Symbol.for("react.profiler"),L=Symbol.for("react.consumer"),K=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),F=Symbol.for("react.memo"),G=Symbol.for("react.lazy"),Q=Symbol.for("react.activity"),se=Symbol.for("react.client.reference"),ee=A.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=Object.prototype.hasOwnProperty,X=Array.isArray,V=console.createTask?console.createTask:function(){return null};A={react_stack_bottom_frame:function(I){return I()}};var re,oe={},le=A.react_stack_bottom_frame.bind(A,u)(),H=V(a(u)),D={};dt.Fragment=R,dt.jsx=function(I,J,q){var Z=1e4>ee.recentlyCreatedOwnerStacks++;return k(I,J,q,!1,Z?Error("react-stack-top-frame"):le,Z?V(a(I)):H)},dt.jsxs=function(I,J,q){var Z=1e4>ee.recentlyCreatedOwnerStacks++;return k(I,J,q,!0,Z?Error("react-stack-top-frame"):le,Z?V(a(I)):H)}})()),dt}var Mr;function Xi(){return Mr||(Mr=1,process.env.NODE_ENV==="production"?Lt.exports=Hi():Lt.exports=Yi()),Lt.exports}var w=Xi();function zr(e){var r,i,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var c=e.length;for(r=0;r<c;r++)e[r]&&(i=zr(e[r]))&&(a&&(a+=" "),a+=i)}else for(i in e)e[i]&&(a&&(a+=" "),a+=i);return a}function ce(){for(var e,r,i=0,a="",c=arguments.length;i<c;i++)(e=arguments[i])&&(r=zr(e))&&(a&&(a+=" "),a+=r);return a}function pt({count:e=1,children:r,render:i}){return w.jsx(w.Fragment,{children:[...Array(e)].map((a,c)=>w.jsx(T.Fragment,{children:i?.(c)??(typeof r=="function"?r(c):r)},`element-${c}`))})}process.env.NODE_ENV==="development"&&(pt.displayName="Repeat");function Ft(e,r={},...i){const{className:a,style:c,...u}=r,{className:d,style:g,...m}=e.props;return T.cloneElement(e,{className:`${d??""} ${a??""}`.split(" ").filter(Boolean).join(" ")||void 0,style:{...g??{},...c??{}},...m,...u},...i)}function me({children:e,element:r,...i}){return Ft(r,i,...e?Array.isArray(e)?e:[e]:[])}process.env.NODE_ENV==="development"&&(me.displayName="Styled");function Ui(e){return e}function ke(e,r={}){const i=Object.keys(r),a=Object.values(r),c={};return T.Children.forEach(e,u=>{if(u==null)return;if(!T.isValidElement(u)){console.error("[etudes::asComponentDict] Invalid child detected");return}const d=a.indexOf(u.type);if(d<0){console.error(`[etudes::asComponentDict] Unsupported child, only the following children are allowed: ${a.map(m=>m.displayName??m.name).join(", ")}`);return}const g=i[d];if(c[g]){console.error(`[etudes::asComponentDict] Only one ${a[d]} can be provided as a child`);return}c[g]=u}),c}function Ki(e){return e}function ue(...e){return e.reduce((r,i)=>({...r,...i||{}}),{})}const Rn=T.forwardRef(({children:e,className:r,isActive:i=!1,isTailHidden:a=!1,isSplit:c=!1,numberOfBars:u=3,...d},g)=>{const m=ke(e,{bar:ht}),b={root:ce({active:i}),bar:ce({active:i})},k=Gi({isSplit:c,isActive:i,isTailHidden:a});return w.jsx("div",{...d,ref:g,className:ce(r,b.root),children:w.jsx(pt,{count:c?2:1,children:_=>w.jsx("div",{"aria-hidden":!0,style:ue(k.section,k[`section${_}`]),children:w.jsx(pt,{count:u,children:P=>w.jsx(me,{"aria-hidden":!0,className:ce(b.bar),element:m.bar??w.jsx(ht,{}),style:(()=>{switch(u){case 2:return ue(k.bar,k[`bar${_}${P===0?0:2}`]);case 3:default:return ue(k.bar,k[`bar${_}${P}`])}})()})})})})})}),ht=({...e})=>w.jsx("span",{...e});function Gi({isActive:e=!1,isSplit:r=!1,isTailHidden:i=!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%":`${i?"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:i&&!e?"0":"100%"}}}process.env.NODE_ENV==="development"&&(Rn.displayName="Burger",ht.displayName="BurgerBar");const Lr=T.forwardRef(({children:e,className:r,style:i,isActive:a=!1,isTailHidden:c=!1,isSplit:u=!1,numberOfBars:d=3,onActivate:g,onDeactivate:m,onToggle:b,...k},_)=>{const P=()=>{const N=!a;b?.(N),N?g?.():m?.()},A={root:ce({active:a})},z=Wi();return w.jsx("button",{...k,ref:_,"aria-expanded":a,className:ce(r,A.root),style:ue(i,z.root),onClick:P,children:w.jsx(Rn,{isActive:a,isSplit:u,isTailHidden:c,numberOfBars:d,children:e})})}),Fr=ht;function Wi(){return{root:{background:"transparent",border:"none",display:"block",outline:"none"}}}process.env.NODE_ENV==="development"&&(Lr.displayName="BurgerButton",Fr.displayName="BurgerButtonBar");var Se;(e=>{e.zero=r();function r(N=0,R=0){if(typeof N=="number")return{x:N,y:R};if(!P(N))throw Error("Invalid parameters passed to constructor");return N instanceof Array?{x:N[0],y:N[1]}:{x:N.x,y:N.y}}e.make=r;function i(N,R={}){return r({x:typeof R.x=="number"?R.x:N.x,y:typeof R.y=="number"?R.y:N.y})}e.clone=i;function a(N,R){return r({x:N.x+R.x,y:N.y+R.y})}e.add=a;function c(N,R){return r({x:N.x-R.x,y:N.y-R.y})}e.subtract=c;function u(N,R){return r({x:N.x*R.x,y:N.y*R.y})}e.multiply=u;function d(N,R){return r({x:N.x/R.x,y:N.y/R.y})}e.divide=d;function g(N){return r({x:N.y,y:N.x})}e.reflect=g;function m(N,R){return!(N.x!==R.x||N.y!==R.y)}e.isEqual=m;function b(N){return`Point(x=${N.x}, y=${N.y})`}e.toString=b;function k(N){return Object.freeze({x:N.x,y:N.y})}e.toJSON=k;function _(N){return[N.x,N.y]}e.toArray=_;function P(N){return N instanceof Array?!(N.length!==2||typeof N[0]!="number"||typeof N[1]!="number"):typeof N=="object"?!(typeof N.x!="number"||typeof N.y!="number"):!1}e.isValidDescriptor=P;function A(N){return typeof N=="object"&&typeof N.x=="number"&&typeof N.y=="number"}e.isPoint=A;function z(N){return N.x===0&&N.y===0}e.isZero=z})(Se||(Se={}));function Ji(e,r){try{const i=Se.isValidDescriptor(e)&&Se.make(e),a=Se.isValidDescriptor(r)&&Se.make(r);if(i&&!a){const c=r instanceof Array?r:[r],u=c.length;for(let d=0;d<u;d++){const g=we.from(c[d]);if(!g)continue;const m=i.x>=g.left&&i.x<=g.right,b=i.y>=g.top&&i.y<=g.bottom;if(m&&b)return!0}return!1}else if(!i&&a){const c=e instanceof Array?e:[e],u=c.length;for(let d=0;d<u;d++){const g=we.from(c[d]);if(!g)continue;const m=a.x>=g.left&&a.x<=g.right,b=a.y>=g.top&&a.y<=g.bottom;if(m&&b)return!0}return!1}else{if(i&&a)return Se.isEqual(i,a);{const c=[...e instanceof Array?e:[e],...r instanceof Array?r:[r]],u=we.intersecting.apply(null,c);return u?u.width*u.height!==0:!1}}}catch(i){return console.error(i),!1}}var Oe;(e=>{e.zero=r();function r(N=0,R=0){if(typeof N=="number")return{width:N,height:R};if(!P(N))throw Error("Invalid parameters passed to constructor");return N instanceof Array?{width:N[0],height:N[1]}:{width:N.width,height:N.height}}e.make=r;function i(N,R={}){return r({width:typeof R.width=="number"?R.width:N.width,height:typeof R.height=="number"?R.height:N.height})}e.clone=i;function a(N,R){return r({width:N.width+R.width,height:N.height+R.height})}e.add=a;function c(N,R){return r({width:N.width-R.width,height:N.height-R.height})}e.subtract=c;function u(N,R){return r({width:N.width*R.width,height:N.height*R.height})}e.multiply=u;function d(N,R){return r({width:N.width/R.width,height:N.height/R.height})}e.divide=d;function g(N){return r({width:N.height,height:N.width})}e.rotate=g;function m(N,R){return!(N.width!==R.width||N.height!==R.height)}e.isEqual=m;function b(N){return`Size(width=${N.width}, height=${N.height})`}e.toString=b;function k(N){return Object.freeze({width:N.width,height:N.height})}e.toJSON=k;function _(N){return[N.width,N.height]}e.toArray=_;function P(N){return N instanceof Array?!(N.length!==2||typeof N[0]!="number"||typeof N[1]!="number"):typeof N=="object"?!(typeof N.width!="number"||typeof N.height!="number"):!1}e.isValidDescriptor=P;function A(N){return typeof N=="object"&&typeof N.width=="number"&&typeof N.height=="number"}e.isSize=A;function z(N){return N.width===0&&N.height===0}e.isZero=z})(Oe||(Oe={}));var we;(e=>{e.zero=r();function r(x=0,O=0,E=0,F=0){if(typeof x=="number"&&typeof O=="number"){const G=x,Q=O;return{top:Q,right:G+E,bottom:Q+F,left:G,width:E,height:F}}else if(Se.isPoint(x)&&Oe.isSize(O)){const G=x,Q=O;return{top:G.y,right:G.x+Q.width,bottom:G.y+Q.height,left:G.x,width:Q.width,height:Q.height}}else{const G=x;if(!$(G))throw Error("Invalid parameters passed to constructor");return{top:G.y,right:G.x+G.width,bottom:G.y+G.height,left:G.x,width:G.width,height:G.height}}}e.make=r;function i(x){return Se.make({x:(x.right-x.left)/2+x.left,y:(x.bottom-x.top)/2+x.top})}e.center=i;function a(x){return Oe.make({width:x.width,height:x.height})}e.size=a;function c(x,O={}){try{if(x==null)return;if(L(x))return x;if(gt(x))return c(document.documentElement||document.body.parentNode||document.body,O);const E=x instanceof Array?x:[x],F=E.length,G=O.reference||window,Q=u(),se=gt(G)?Q:c(O.reference);if(!Q||!se)return;let ee;for(let W=0;W<F;W++){const X=E[W],V=X.getBoundingClientRect(),re=r({x:V.left+Q.left-(gt(G)?0:se.left),y:V.top+Q.top-(gt(G)?0:se.top),width:O.overflow?X.scrollWidth:X instanceof HTMLElement?X.offsetWidth:V.width,height:O.overflow?X.scrollHeight:X instanceof HTMLElement?X.offsetHeight:V.height});ee=ee?P(ee,re):re}return ee}catch(E){console.error(E);return}}e.from=c;function u(){const x=Math.max(document.documentElement.clientWidth,window.innerWidth||0),O=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:x,height:O})}e.fromViewport=u;function d(x,O={}){if(x)return gt(x)?c(Array.from(document.body.children)):c(Array.from(x.children),{overflow:O.overflow,reference:O.reference||x})}e.fromChildrenOf=d;function g(x,O,E={}){if(!O)return;const F=Array.from(O.children);return x<=0?r():x>=F.length?c(F,{reference:E.reference,overflow:!1}):(F.splice(x),c(F,{reference:E.reference||O,overflow:!1}))}e.fromChildrenBefore=g;function m(x,O,E={}){if(!O)return;const F=Array.from(O.children);return x<0?c(F,{reference:E.reference,overflow:!1}):x>=F.length-1?r():(F.splice(0,F.length-x-1),c(F,{reference:E.reference||O,overflow:!1}))}e.fromChildrenAfter=m;function b(x,O,E={}){if(!O)return;const F=O.children[x];return c(F,{overflow:E.overflow,reference:E.reference||O})}e.fromChildAt=b;function k(...x){try{const O=x.length,E={};let F,G;for(let Q=0;Q<O;Q++){if(F||(F=c(x[Q])),Q===0&&Q+1===O)G=u();else if(Q+1<O)G=c(x[Q+1]);else break;!F||!G||(E.width=Math.max(0,Math.min(F.right,G.right)-Math.max(F.left,G.left)),E.height=Math.max(0,Math.min(F.bottom,G.bottom)-Math.max(F.top,G.top)),E.y=Math.max(F.top,G.top),E.x=Math.max(F.left,G.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(O){console.error(O);return}}e.intersecting=k;function _(x,O={}){return r({x:typeof O.x=="number"?O.x:x.left,y:typeof O.y=="number"?O.y:x.top,width:typeof O.width=="number"?O.width:x.width,height:typeof O.height=="number"?O.height:x.height})}e.clone=_;function P(x,O){return r({x:Math.min(x.left,O.left),y:Math.min(x.top,O.top),width:Math.max(x.right,O.right)-Math.min(x.left,O.left),height:Math.max(x.bottom,O.bottom)-Math.min(x.top,O.top)})}e.concat=P;function A(x){return r({x:x.left,y:x.top,width:x.height,height:x.width})}e.rotate=A;function z(x,O){return!(x.top!==O.top||x.right!==O.right||x.bottom!==O.bottom||x.left!==O.left||x.width!==O.width||x.height!==O.height)}e.isEqual=z;function N(x,O){return Ji(O,x)}e.contains=N;function R(x){return`Rect(top=${x.top}, right=${x.right}, bottom=${x.bottom}, left=${x.left}, width=${x.width}, height=${x.height})`}e.toString=R;function ne(x){return Object.freeze({top:x.top,right:x.right,bottom:x.bottom,left:x.left,width:x.width,height:x.height})}e.toJSON=ne;function $(x){return!(typeof x.x!="number"||typeof x.y!="number"||typeof x.width!="number"||typeof x.height!="number")}e.isValidDescriptor=$;function L(x){return typeof x=="object"&&typeof x.top=="number"&&typeof x.right=="number"&&typeof x.bottom=="number"&&typeof x.left=="number"&&typeof x.width=="number"&&typeof x.height=="number"}e.isRect=L;function K(x){return x.top===0&&x.right===0&&x.bottom===0&&x.left===0&&x.width===0&&x.height===0}e.isZero=K})(we||(we={}));function gt(e){return e===window}function Ee(e){const r=T.useRef(e);return T.useEffect(()=>{r.current=e},[e]),r}function Dr(e,{onChange:r}){const i=Ee(r);T.useLayoutEffect(()=>{const a=e.current;if(!a)return;const c=new IntersectionObserver(u=>{for(const d of u)if(d.target===a){i.current?.(a);break}});return c.observe(a),()=>{c.disconnect()}},[e.current])}function Dt(e,{onResize:r}){const i=Ee(r);T.useLayoutEffect(()=>{const a=e.current;if(!a)return;const c=new ResizeObserver(()=>{i.current?.(a)});return c.observe(a),()=>{c.disconnect()}},[e.current])}function Vr(){const[e,r]=T.useState(Oe.zero);return T.useLayoutEffect(()=>{const i=()=>{const a=we.size(we.fromViewport());r(a)};return window.addEventListener("resize",i),i(),()=>{window.removeEventListener("resize",i)}},[]),e}function Be(e){const[r,i]=T.useState(we.zero),a=Vr();return Dt(e,{onResize:c=>{const u=we.from(c);u&&i(u)}}),Dr(e,{onChange:c=>{const u=we.from(c);u&&i(u)}}),T.useLayoutEffect(()=>{const c=e.current,u=we.from(c);u&&i(u)},[Oe.toString(a)]),r}j.ImageSource=void 0,(e=>{function r(u){try{return i(u),{media:u.media,sizes:c(u),srcSet:a(u),type:u.type}}catch(d){console.error(`[etudes:ImageSource] ${d}`);return}}e.asProps=r;function i({sizes:u=[],srcSet:d}){if(u.length>0&&!d.some(({width:g})=>g!==void 0))throw Error("If `sizes` is specified, at least one entry in `sourceSet` must have a `width` specified");if(u.length>0&&u[u.length-1].media!==void 0)throw Error("The last item in `sizes` must not have a `media` condition");if(d.length===0)throw Error("At least one entry in `sourceSet` must be specified");d.forEach(({src:g,width:m,pixelDensity:b})=>{if(g===void 0||g==="")throw Error("Each entry in `sourceSet` must have a non-empty `src`");if(m!==void 0&&(!isFinite(m)||!Number.isInteger(m)||m<=0))throw Error("If `width` is specified, it must be a positive integer greater than 0");if(b!==void 0&&(!isFinite(b)||b<=0))throw Error("If `pixelDensity` is specified, it must be a number greater than 0");if(m!==void 0&&b!==void 0)throw Error("Only one of `width` or `pixelDensity` can be specified")})}function a(u){return u.srcSet.map(({pixelDensity:d,src:g,width:m})=>{let b=g;return m!==void 0?b+=` ${m}w`:d!==void 0&&(b+=` ${d}x`),b}).filter(Boolean).join(", ")}function c(u){return u.sizes?.map(({media:d,width:g})=>{let m=g;return d&&(m=`${d} ${m}`),m}).filter(Boolean).join(", ")}})(j.ImageSource||(j.ImageSource={}));function Br({src:e,srcSet:r,sizes:i},{onLoadStart:a,onLoadComplete:c,onLoadError:u}={}){const d=T.useRef(void 0),g=Ee(a),m=Ee(c),b=Ee(u);T.useLayoutEffect(()=>{let k=!1;const _=z=>{if(k)return;const N=z.currentTarget;m.current?.(N)},P=z=>{if(k)return;const N=z.currentTarget;b.current?.(N)},A=new Image;return A.addEventListener("load",_),A.addEventListener("error",P),g.current?.(A),r&&(A.srcset=r),i&&(A.sizes=i),A.src=e,d.current=A,()=>{k=!0,A.removeEventListener("load",_),A.removeEventListener("error",P),d.current=void 0}},[e,r,i])}function jn({src:e,srcSet:r,sizes:i},{preservesSizeBetweenLoads:a=!0,onLoadStart:c,onLoadComplete:u,onLoadError:d}={}){const[g,m]=T.useState(),b=Ee(c),k=Ee(u),_=Ee(d),P=T.useCallback(N=>{a||m(void 0),b.current?.(N)},[a]),A=T.useCallback(N=>{m(Zi(N)),k.current?.(N)},[]),z=T.useCallback(N=>{a||m(void 0),_.current?.(N)},[a]);return Br({src:e,srcSet:r,sizes:i},{onLoadStart:P,onLoadComplete:A,onLoadError:z}),g}function Zi(e){if(e&&typeof e.width=="number"&&typeof e.height=="number")return Oe.make(e.width,e.height)}const An=T.forwardRef(({alt:e,source:r,loadingMode:i,src:a,style:c,onLoadStart:u,onLoadComplete:d,onLoadError:g,onSizeChange:m,...b},k)=>{const _=r?j.ImageSource.asProps(r):void 0,P=jn({src:a,srcSet:_?.srcSet,sizes:_?.sizes},{onLoadStart:u,onLoadComplete:d,onLoadError:g}),A=Qi();return T.useEffect(()=>{m?.(P)},[P?.width,P?.height]),w.jsx("img",{...b,..._,ref:k,alt:e,loading:i,src:a,style:{...A.root,...c}})});function Qi(){return{root:{fontSize:"0"}}}process.env.NODE_ENV==="development"&&(An.displayName="Image");const Mn=T.forwardRef(({alt:e,loadingMode:r,sources:i=[],src:a,onLoadComplete:c,onLoadError:u,onLoadStart:d,onSizeChange:g,...m},b)=>w.jsxs("picture",{...m,ref:b,children:[i.map((k,_)=>w.jsx("source",{...j.ImageSource.asProps(k)},_)),w.jsx(An,{alt:e,loadingMode:r,src:a,style:{width:"100%",height:"100%"},onLoadComplete:c,onLoadError:u,onLoadStart:d,onSizeChange:g})]}));process.env.NODE_ENV==="development"&&(Mn.displayName="Picture");const Hr=T.forwardRef(({children:e,alt:r,aspectRatio:i=NaN,sources:a,loadingMode:c,src:u,style:d,onLoadStart:g,onLoadComplete:m,onLoadError:b,...k},_)=>{const P=O=>{R(O?O.width/O.height:NaN)},A=T.useRef(null),z=_??A,[N,R]=T.useState(NaN),ne=isNaN(i)?N:i,$=Be(z),L=$.width/$.height,K=Oe.make(L>1?Math.max($.width,$.height*ne):Math.max($.width,Math.max($.height,$.width/ne)*ne),L>1?Math.max($.height,Math.max($.width,$.height*ne)/ne):Math.max($.height,$.width/ne)),x=ke(e,{content:zn,viewport:Ln});return w.jsxs("div",{...k,ref:z,style:ue(d,Fn.root),children:[w.jsx(Mn,{alt:r,sources:a,src:u,style:ue(Fn.viewport,{height:`${K.height}px`,maxWidth:"unset",width:`${K.width}px`}),onLoadComplete:m,onLoadError:b,onLoadStart:g,onSizeChange:O=>P(O)}),x.viewport&&w.jsx(me,{element:x.viewport,style:ue(Fn.viewport,{height:`${K.height}px`,pointerEvents:"none",width:`${K.width}px`})}),x.content]})}),zn=({children:e,...r})=>w.jsx("div",{...r,children:e}),Ln=({children:e,...r})=>w.jsx("div",{...r,children:e}),Fn={root:{overflow:"hidden"},viewport:{fontSize:"0",left:"50%",position:"absolute",top:"50%",transform:"translate(-50%, -50%)"}};process.env.NODE_ENV==="development"&&(Hr.displayName="CoverImage",zn.displayName="CoverImageContent",Ln.displayName="CoverImageViewport");function Yr(e,{onLoadStart:r,onLoadComplete:i,onLoadError:a}={}){const c=Ee(r),u=Ee(i),d=Ee(a);T.useLayoutEffect(()=>{if(!e)return;const g=window.document.createElement("video"),m=()=>u.current?.(g),b=()=>d.current?.(g);return g.addEventListener("loadedmetadata",m),g.addEventListener("error",b),g.src=e,c.current?.(g),()=>{g.removeEventListener("loadedmetadata",m),g.removeEventListener("error",b),g.src=""}},[e])}function Xr(e,{preservesSizeBetweenLoads:r=!0,onLoadStart:i,onLoadComplete:a,onLoadError:c}={}){const[u,d]=T.useState(),g=Ee(i),m=Ee(a),b=Ee(c),k=T.useCallback(A=>{r||d(void 0),g.current?.(A)},[r]),_=T.useCallback(A=>{d($i(A)),m.current?.(A)},[]),P=T.useCallback(A=>{r||d(void 0),b.current?.(A)},[r]);return Yr(e,{onLoadStart:k,onLoadComplete:_,onLoadError:P}),u}function $i(e){if(e&&typeof e.videoWidth=="number"&&typeof e.videoHeight=="number")return Oe.make(e.videoWidth,e.videoHeight)}const Dn=T.forwardRef(({autoLoop:e=!0,autoPlay:r=!0,hasControls:i=!1,isMuted:a=!0,playsInline:c=!0,posterSrc:u,src:d,style:g,onCanPlay:m,onEnd:b,onFullscreenChange:k,onLoadMetadata:_,onLoadMetadataComplete:P,onLoadMetadataError:A,onPause:z,onPlay:N,onSizeChange:R,onTimeUpdate:ne,...$},L)=>{const K=T.useRef(null),x=L??K,O=Xr(d,{onLoadStart:_,onLoadComplete:P,onLoadError:A}),E=qi();T.useEffect(()=>{if(!x.current)return;if(d.toLowerCase().endsWith(".m3u8")){const re=!!x.current.canPlayType("application/x-mpegURL"),oe=typeof window.Hls<"u"?window.Hls:void 0;if(!re&&oe?.isSupported()){const le=new oe;le.loadSource(d),le.attachMedia(x.current)}}const V=re=>{const oe=window.document.fullScreen||window.document.mozFullScreen||window.document.webkitIsFullScreen;oe!==void 0&&k?.(oe)};return x.current.muted=a,x.current.load(),x.current.addEventListener("webkitfullscreenchange",V),x.current.addEventListener("mozfullscreenchange",V),x.current.addEventListener("fullscreenchange",V),()=>{X(),x.current?.removeEventListener("webkitfullscreenchange",V),x.current?.removeEventListener("mozfullscreenchange",V),x.current?.removeEventListener("fullscreenchange",V)}},[d]),T.useEffect(()=>{R?.(O)},[O]);const F=V=>{const re=V.currentTarget;r&&re.paused&&W(),m?.()},G=V=>{N?.()},Q=V=>{z?.()},se=V=>{b?.()},ee=V=>{const re=V.currentTarget;ne?.(re.currentTime,re.duration)},W=()=>{x.current&&x.current.play()},X=()=>{x.current&&x.current.pause()};return w.jsx("video",{...$,ref:x,autoPlay:r,controls:i,loop:e,muted:a,playsInline:c,poster:u,style:{...E.root,...g},onCanPlay:F,onEnded:se,onPause:Q,onPlay:G,onTimeUpdate:ee,children:w.jsx("source",{src:d})})});function qi(){return{root:{fontSize:"0"}}}process.env.NODE_ENV==="development"&&(Dn.displayName="Video");const Ur=T.forwardRef(({className:e,children:r,style:i,aspectRatio:a=NaN,autoLoop:c,autoPlay:u,hasControls:d,isMuted:g,playsInline:m,posterSrc:b,src:k,onCanPlay:_,onEnd:P,onFullscreenChange:A,onLoadMetadata:z,onLoadMetadataComplete:N,onLoadMetadataError:R,onPause:ne,onPlay:$,onSizeChange:L,...K},x)=>{const O=V=>{Q(V?V.width/V.height:NaN),L?.(V)},E=x??T.useRef(null),F=Be(E),[G,Q]=T.useState(NaN),se=isNaN(a)?G:a,ee=F.width/F.height,W=Oe.make(ee>1?Math.max(F.width,F.height*se):Math.max(F.width,Math.max(F.height,F.width/se)*se),ee>1?Math.max(F.height,Math.max(F.width,F.height*se)/se):Math.max(F.height,F.width/se)),X=ke(r,{content:Vn,viewport:Bn});return w.jsxs("div",{...K,ref:E,className:e,style:ue(i,Hn.root),children:[w.jsx(Dn,{autoLoop:c,autoPlay:u,hasControls:d,isMuted:g,playsInline:m,posterSrc:b,src:k,style:ue(Hn.viewport,{width:`${W.width}px`,height:`${W.height}px`,maxWidth:"unset"}),onCanPlay:_,onEnd:P,onFullscreenChange:A,onLoadMetadata:z,onLoadMetadataComplete:N,onLoadMetadataError:R,onPause:ne,onPlay:$,onSizeChange:V=>O(V)}),X.viewport&&w.jsx(me,{element:X.viewport,style:ue(Hn.viewport,{height:`${W.height}px`,pointerEvents:"none",width:`${W.width}px`})}),X.content]})}),Vn=({children:e,...r})=>w.jsx("div",{...r,children:e}),Bn=({children:e,...r})=>w.jsx("div",{...r,children:e}),Hn={root:{overflow:"hidden"},viewport:{fontSize:"0",left:"50%",position:"absolute",top:"50%",transform:"translate(-50%, -50%)"}};process.env.NODE_ENV==="development"&&(Ur.displayName="CoverVideo",Vn.displayName="CoverVideoContent",Bn.displayName="CoverVideoViewport");const Yn=T.forwardRef((e,r)=>{switch(!0){case es(e):{const{action:i,children:a,className:c,isDisabled:u,label:d,opensInNewTab:g,...m}=e;return w.jsx("a",{...m,ref:r,"aria-disabled":u,"aria-label":d,className:ce(c,{disabled:u}),href:i,rel:g?"noopener,noreferrer":void 0,target:g?"_blank":void 0,children:a??d})}case ts(e):{const{action:i,children:a,className:c,isDisabled:u,label:d,type:g="button",...m}=e;return w.jsx("button",{...m,ref:r,"aria-disabled":u,"aria-label":d,className:c,disabled:u,type:g,onClick:i,children:a??d})}default:return console.error("[etudes::Button] Unknown button type"),w.jsx("div",{children:"asdf"})}});function es(e){return typeof e.action=="string"}function ts(e){return typeof e.action=="function"||typeof e.type=="string"}process.env.NODE_ENV==="development"&&(Yn.displayName="Button");const Kr=T.forwardRef(({index:e=0,isDisabled:r=!1,options:i,onChange:a,...c},u)=>{const d=i.length-1,g=i[e],m=typeof g=="string"?g:g?.label,b=T.useCallback(()=>{if(r)return;const k=e<d?e+1:0,_=i[k],P=typeof _=="string"?_:_?.value;a?.(P,k)},[d,r,e,i,a]);return w.jsx(Yn,{...c,ref:u,action:b,isDisabled:r,label:m})});process.env.NODE_ENV==="development"&&(Kr.displayName="OptionButton");var Xn,Gr;function ns(){return Gr||(Gr=1,Xn=function e(r,i){if(r===i)return!0;if(r&&i&&typeof r=="object"&&typeof i=="object"){if(r.constructor!==i.constructor)return!1;var a,c,u;if(Array.isArray(r)){if(a=r.length,a!=i.length)return!1;for(c=a;c--!==0;)if(!e(r[c],i[c]))return!1;return!0}if(r.constructor===RegExp)return r.source===i.source&&r.flags===i.flags;if(r.valueOf!==Object.prototype.valueOf)return r.valueOf()===i.valueOf();if(r.toString!==Object.prototype.toString)return r.toString()===i.toString();if(u=Object.keys(r),a=u.length,a!==Object.keys(i).length)return!1;for(c=a;c--!==0;)if(!Object.prototype.hasOwnProperty.call(i,u[c]))return!1;for(c=a;c--!==0;){var d=u[c];if(!(d==="_owner"&&r.$$typeof)&&!e(r[d],i[d]))return!1}return!0}return r!==r&&i!==i}),Xn}var rs=ns();const He=Rr(rs);var Vt={exports:{}},os=Vt.exports,Wr;function is(){return Wr||(Wr=1,(function(e,r){(function(i,a){e.exports=a()})(os,(function(){function i(n,t){var o=Object.keys(n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);t&&(s=s.filter((function(l){return Object.getOwnPropertyDescriptor(n,l).enumerable}))),o.push.apply(o,s)}return o}function a(n){for(var t=1;t<arguments.length;t++){var o=arguments[t]!=null?arguments[t]:{};t%2?i(Object(o),!0).forEach((function(s){m(n,s,o[s])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):i(Object(o)).forEach((function(s){Object.defineProperty(n,s,Object.getOwnPropertyDescriptor(o,s))}))}return n}function c(n){return c=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},c(n)}function u(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function d(n,t){for(var o=0;o<t.length;o++){var s=t[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(n,N(s.key),s)}}function g(n,t,o){return t&&d(n.prototype,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function m(n,t,o){return(t=N(t))in n?Object.defineProperty(n,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[t]=o,n}function b(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&&_(n,t)}function k(n){return k=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},k(n)}function _(n,t){return _=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,s){return o.__proto__=s,o},_(n,t)}function P(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function A(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,s=k(n);if(t){var l=k(this).constructor;o=Reflect.construct(s,arguments,l)}else o=s.apply(this,arguments);return(function(f,p){if(p&&(typeof p=="object"||typeof p=="function"))return p;if(p!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return P(f)})(this,o)}}function z(){return z=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(n,t,o){var s=(function(f,p){for(;!Object.prototype.hasOwnProperty.call(f,p)&&(f=k(f))!==null;);return f})(n,t);if(s){var l=Object.getOwnPropertyDescriptor(s,t);return l.get?l.get.call(arguments.length<3?n:o):l.value}},z.apply(this,arguments)}function N(n){var t=(function(o,s){if(typeof o!="object"||o===null)return o;var l=o[Symbol.toPrimitive];if(l!==void 0){var f=l.call(o,s);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},ne=void 0,$=void 0;function L(n){ne=n;var t=n.document.createTextNode("");t.ownerDocument!==n.document&&typeof n.wrap=="function"&&n.wrap(t)===t&&(n=n.wrap(n)),$=n}function K(n){return R(n)?n:(n.ownerDocument||n).defaultView||$.window}typeof window<"u"&&window&&L(window);var x=function(n){return!!n&&c(n)==="object"},O=function(n){return typeof n=="function"},E={window:function(n){return n===$||R(n)},docFrag:function(n){return x(n)&&n.nodeType===11},object:x,func:O,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||c(n)!=="object")return!1;var t=K(n)||$;return/object|function/.test(typeof Element>"u"?"undefined":c(Element))?n instanceof Element||n instanceof t.Element:n.nodeType===1&&typeof n.nodeName=="string"},plainObject:function(n){return x(n)&&!!n.constructor&&/function Object\b/.test(n.constructor.toString())},array:function(n){return x(n)&&n.length!==void 0&&O(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 G(n){var t=n.iEvent,o=n.interaction;if(o.prepared.name==="drag"){var s=o.prepared.axis;if(s==="x"||s==="y"){var l=s==="x"?"y":"x";t.page[l]=o.coords.start.page[l],t.client[l]=o.coords.start.client[l],t.delta[l]=0}}}var Q={id:"actions/drag",install:function(n){var t=n.actions,o=n.Interactable,s=n.defaults;o.prototype.draggable=Q.draggable,t.map.drag=Q,t.methodDict.drag="draggable",s.actions.drag=Q.defaults},listeners:{"interactions:before-action-move":F,"interactions:action-resume":F,"interactions:action-move":G,"auto-start:check":function(n){var t=n.interaction,o=n.interactable,s=n.buttons,l=o.options.drag;if(l&&l.enabled&&(!t.pointerIsDown||!/mouse|pointer/.test(t.pointerType)||(s&o.options.drag.mouseButtons)!=0))return n.action={name:"drag",axis:l.lockAxis==="start"?l.startAxis:l.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:G,defaults:{startAxis:"xy",lockAxis:"xy"},getCursor:function(){return"move"},filterEventType:function(n){return n.search("drag")===0}},se=Q,ee={init:function(n){var t=n;ee.document=t.document,ee.DocumentFragment=t.DocumentFragment||W,ee.SVGElement=t.SVGElement||W,ee.SVGSVGElement=t.SVGSVGElement||W,ee.SVGElementInstance=t.SVGElementInstance||W,ee.Element=t.Element||W,ee.HTMLElement=t.HTMLElement||ee.Element,ee.Event=t.Event,ee.Touch=t.Touch||W,ee.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 W(){}var X=ee,V={init:function(n){var t=X.Element,o=n.navigator||{};V.supportsTouch="ontouchstart"in n||E.func(n.DocumentTouch)&&X.document instanceof n.DocumentTouch,V.supportsPointerEvent=o.pointerEnabled!==!1&&!!X.PointerEvent,V.isIOS=/iP(hone|od|ad)/.test(o.platform),V.isIOS7=/iP(hone|od|ad)/.test(o.platform)&&/OS 7[^\d]/.test(o.appVersion),V.isIe9=/MSIE 9/.test(o.userAgent),V.isOperaMobile=o.appName==="Opera"&&V.supportsTouch&&/Presto/.test(o.userAgent),V.prefixedMatchesSelector="matches"in t.prototype?"matches":"webkitMatchesSelector"in t.prototype?"webkitMatchesSelector":"mozMatchesSelector"in t.prototype?"mozMatchesSelector":"oMatchesSelector"in t.prototype?"oMatchesSelector":"msMatchesSelector",V.pEventTypes=V.supportsPointerEvent?X.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,V.wheelEvent=X.document&&"onmousewheel"in X.document?"mousewheel":"wheel"},supportsTouch:null,supportsPointerEvent:null,isIOS7:null,isIOS:null,isIe9:null,isOperaMobile:null,prefixedMatchesSelector:null,pEventTypes:null,wheelEvent:null},re=V;function oe(n,t){if(n.contains)return n.contains(t);for(;t;){if(t===n)return!0;t=t.parentNode}return!1}function le(n,t){for(;E.element(n);){if(D(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 D(n,t){return $!==ne&&(t=t.replace(/\/deep\//g," ")),n[re.prefixedMatchesSelector](t)}var I=function(n){return n.parentNode||n.host};function J(n,t){for(var o,s=[],l=n;(o=I(l))&&l!==t&&o!==l.ownerDocument;)s.unshift(l),l=o;return s}function q(n,t,o){for(;E.element(n);){if(D(n,t))return!0;if((n=H(n))===o)return D(n,t)}return!1}function Z(n){return n.correspondingUseElement||n}function pe(n){var t=n instanceof X.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 ve(n){var t,o=pe(n);if(!re.isIOS7&&o){var s={x:(t=(t=K(n))||$).scrollX||t.document.documentElement.scrollLeft,y:t.scrollY||t.document.documentElement.scrollTop};o.left+=s.x,o.right+=s.x,o.top+=s.y,o.bottom+=s.y}return o}function de(n){for(var t=[];n;)t.push(n),n=H(n);return t}function Ne(n){return!!E.string(n)&&(X.document.querySelector(n),!0)}function te(n,t){for(var o in t)n[o]=t[o];return n}function De(n,t,o){return n==="parent"?H(o):n==="self"?t.getRect(o):le(o,n)}function Pe(n,t,o,s){var l=n;return E.string(l)?l=De(l,t,o):E.func(l)&&(l=l.apply(void 0,s)),E.element(l)&&(l=ve(l)),l}function Ce(n){return n&&{x:"x"in n?n.x:n.left,y:"y"in n?n.y:n.top}}function Ve(n){return!n||"x"in n&&"y"in n||((n=te({},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 Me(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 Ye(n,t,o){var s=o&&n.options[o];return Ce(Pe(s&&s.origin||n.options.origin,n,t,[n&&t]))||{x:0,y:0}}function Xe(n,t){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(v){return!0},s=arguments.length>3?arguments[3]:void 0;if(s=s||{},E.string(n)&&n.search(" ")!==-1&&(n=$o(n)),E.array(n))return n.forEach((function(v){return Xe(v,t,o,s)})),s;if(E.object(n)&&(t=n,n=""),E.func(t)&&o(n))s[n]=s[n]||[],s[n].push(t);else if(E.array(t))for(var l=0,f=t;l<f.length;l++){var p=f[l];Xe(n,p,o,s)}else if(E.object(t))for(var h in t)Xe($o(h).map((function(v){return"".concat(n).concat(v)})),t[h],o,s);return s}function $o(n){return n.trim().split(/ +/)}var Ct=function(n,t){return Math.sqrt(n*n+t*t)},xc=["webkit","moz"];function bn(n,t){n.__set||(n.__set={});var o=function(l){if(xc.some((function(f){return l.indexOf(f)===0})))return 1;typeof n[l]!="function"&&l!=="__set"&&Object.defineProperty(n,l,{get:function(){return l in n.__set?n.__set[l]:n.__set[l]=t[l]},set:function(f){n.__set[l]=f},configurable:!0})};for(var s in t)o(s);return n}function wn(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 qo(n){n.page.x=0,n.page.y=0,n.client.x=0,n.client.y=0}function ei(n){return n instanceof X.Event||n instanceof X.Touch}function xn(n,t,o){return n=n||"page",(o=o||{}).x=t[n+"X"],o.y=t[n+"Y"],o}function ti(n,t){return t=t||{x:0,y:0},re.isOperaMobile&&ei(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 Ec(n,t,o){var s=t.length>1?ni(t):t[0];ti(s,n.page),(function(l,f){f=f||{},re.isOperaMobile&&ei(l)?xn("screen",l,f):xn("client",l,f)})(s,n.client),n.timeStamp=o}function ur(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 ni(n){for(var t={pageX:0,pageY:0,clientX:0,clientY:0,screenX:0,screenY:0},o=0;o<n.length;o++){var s=n[o];for(var l in t)t[l]+=s[l]}for(var f in t)t[f]/=n.length;return t}function fr(n){if(!n.length)return null;var t=ur(n),o=Math.min(t[0].pageX,t[1].pageX),s=Math.min(t[0].pageY,t[1].pageY),l=Math.max(t[0].pageX,t[1].pageX),f=Math.max(t[0].pageY,t[1].pageY);return{x:o,y:s,left:o,top:s,right:l,bottom:f,width:l-o,height:f-s}}function dr(n,t){var o=t+"X",s=t+"Y",l=ur(n),f=l[0][o]-l[1][o],p=l[0][s]-l[1][s];return Ct(f,p)}function pr(n,t){var o=t+"X",s=t+"Y",l=ur(n),f=l[1][o]-l[0][o],p=l[1][s]-l[0][s];return 180*Math.atan2(p,f)/Math.PI}function ri(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 X.Touch?"touch":"mouse"}function oi(n){var t=E.func(n.composedPath)?n.composedPath():n.path;return[Z(t?t[0]:n.target),Z(n.currentTarget)]}var En=(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(En.prototype,"interaction",{get:function(){return this._interaction._proxy},set:function(){}});var ii=function(n,t){for(var o=0;o<t.length;o++){var s=t[o];n.push(s)}return n},si=function(n){return ii([],n)},Ot=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[Ot(n,t)]},lt=(function(n){b(o,n);var t=A(o);function o(s,l,f){var p;u(this,o),(p=t.call(this,l._interaction)).dropzone=void 0,p.dragEvent=void 0,p.relatedTarget=void 0,p.draggable=void 0,p.propagationStopped=!1,p.immediatePropagationStopped=!1;var h=f==="dragleave"?s.prev:s.cur,v=h.element,S=h.dropzone;return p.type=f,p.target=v,p.currentTarget=v,p.dropzone=S,p.dragEvent=l,p.relatedTarget=l.target,p.draggable=l.interactable,p.timeStamp=l.timeStamp,p}return g(o,[{key:"reject",value:function(){var s=this,l=this._interaction.dropState;if(this.type==="dropactivate"||this.dropzone&&l.cur.dropzone===this.dropzone&&l.cur.element===this.target)if(l.prev.dropzone=this.dropzone,l.prev.element=this.target,l.rejected=!0,l.events.enter=null,this.stopImmediatePropagation(),this.type==="dropactivate"){var f=l.activeDrops,p=Ot(f,(function(v){var S=v.dropzone,y=v.element;return S===s.dropzone&&y===s.target}));l.activeDrops.splice(p,1);var h=new o(l,this.dragEvent,"dropdeactivate");h.dropzone=this.dropzone,h.target=this.target,this.dropzone.fire(h)}else this.dropzone.fire(new o(l,this.dragEvent,"dragleave"))}},{key:"preventDefault",value:function(){}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}}]),o})(En);function ai(n,t){for(var o=0,s=n.slice();o<s.length;o++){var l=s[o],f=l.dropzone,p=l.element;t.dropzone=f,t.target=p,f.fire(t),t.propagationStopped=t.immediatePropagationStopped=!1}}function hr(n,t){for(var o=(function(f,p){for(var h=[],v=0,S=f.interactables.list;v<S.length;v++){var y=S[v];if(y.options.drop.enabled){var C=y.options.drop.accept;if(!(E.element(C)&&C!==p||E.string(C)&&!D(p,C)||E.func(C)&&!C({dropzone:y,draggableElement:p})))for(var M=0,Y=y.getAllElements();M<Y.length;M++){var B=Y[M];B!==p&&h.push({dropzone:y,element:B,rect:y.getRect(B)})}}}return h})(n,t),s=0;s<o.length;s++){var l=o[s];l.rect=l.dropzone.getRect(l.element)}return o}function ci(n,t,o){for(var s=n.dropState,l=n.interactable,f=n.element,p=[],h=0,v=s.activeDrops;h<v.length;h++){var S=v[h],y=S.dropzone,C=S.element,M=S.rect,Y=y.dropCheck(t,o,l,f,C,M);p.push(Y?C:null)}var B=(function(U){for(var ae,ie,fe,ye=[],xe=0;xe<U.length;xe++){var he=U[xe],be=U[ae];if(he&&xe!==ae)if(be){var je=I(he),Te=I(be);if(je!==he.ownerDocument)if(Te!==he.ownerDocument)if(je!==Te){ye=ye.length?ye:J(be);var ze=void 0;if(be instanceof X.HTMLElement&&he instanceof X.SVGElement&&!(he instanceof X.SVGSVGElement)){if(he===Te)continue;ze=he.ownerSVGElement}else ze=he;for(var Le=J(ze,be.ownerDocument),Ge=0;Le[Ge]&&Le[Ge]===ye[Ge];)Ge++;var In=[Le[Ge-1],Le[Ge],ye[Ge]];if(In[0])for(var zt=In[0].lastChild;zt;){if(zt===In[1]){ae=xe,ye=Le;break}if(zt===In[2])break;zt=zt.previousSibling}}else fe=be,(parseInt(K(ie=he).getComputedStyle(ie).zIndex,10)||0)>=(parseInt(K(fe).getComputedStyle(fe).zIndex,10)||0)&&(ae=xe);else ae=xe}else ae=xe}return ae})(p);return s.activeDrops[B]||null}function gr(n,t,o){var s=n.dropState,l={enter:null,leave:null,activate:null,deactivate:null,move:null,drop:null};return o.type==="dragstart"&&(l.activate=new lt(s,o,"dropactivate"),l.activate.target=null,l.activate.dropzone=null),o.type==="dragend"&&(l.deactivate=new lt(s,o,"dropdeactivate"),l.deactivate.target=null,l.deactivate.dropzone=null),s.rejected||(s.cur.element!==s.prev.element&&(s.prev.dropzone&&(l.leave=new lt(s,o,"dragleave"),o.dragLeave=l.leave.target=s.prev.element,o.prevDropzone=l.leave.dropzone=s.prev.dropzone),s.cur.dropzone&&(l.enter=new lt(s,o,"dragenter"),o.dragEnter=s.cur.element,o.dropzone=s.cur.dropzone)),o.type==="dragend"&&s.cur.dropzone&&(l.drop=new lt(s,o,"drop"),o.dropzone=s.cur.dropzone,o.relatedTarget=s.cur.element),o.type==="dragmove"&&s.cur.dropzone&&(l.move=new lt(s,o,"dropmove"),o.dropzone=s.cur.dropzone)),l}function mr(n,t){var o=n.dropState,s=o.activeDrops,l=o.cur,f=o.prev;t.leave&&f.dropzone.fire(t.leave),t.enter&&l.dropzone.fire(t.enter),t.move&&l.dropzone.fire(t.move),t.drop&&l.dropzone.fire(t.drop),t.deactivate&&ai(s,t.deactivate),o.prev.dropzone=l.dropzone,o.prev.element=l.element}function li(n,t){var o=n.interaction,s=n.iEvent,l=n.event;if(s.type==="dragmove"||s.type==="dragend"){var f=o.dropState;t.dynamicDrop&&(f.activeDrops=hr(t,o.element));var p=s,h=ci(o,p,l);f.rejected=f.rejected&&!!h&&h.dropzone===f.cur.dropzone&&h.element===f.cur.element,f.cur.dropzone=h&&h.dropzone,f.cur.element=h&&h.element,f.events=gr(o,0,p)}}var ui={id:"actions/drop",install:function(n){var t=n.actions,o=n.interactStatic,s=n.Interactable,l=n.defaults;n.usePlugin(se),s.prototype.dropzone=function(f){return(function(p,h){if(E.object(h)){if(p.options.drop.enabled=h.enabled!==!1,h.listeners){var v=Xe(h.listeners),S=Object.keys(v).reduce((function(C,M){return C[/^(enter|leave)/.test(M)?"drag".concat(M):/^(activate|deactivate|move)/.test(M)?"drop".concat(M):M]=v[M],C}),{}),y=p.options.drop.listeners;y&&p.off(y),p.on(S),p.options.drop.listeners=S}return E.func(h.ondrop)&&p.on("drop",h.ondrop),E.func(h.ondropactivate)&&p.on("dropactivate",h.ondropactivate),E.func(h.ondropdeactivate)&&p.on("dropdeactivate",h.ondropdeactivate),E.func(h.ondragenter)&&p.on("dragenter",h.ondragenter),E.func(h.ondragleave)&&p.on("dragleave",h.ondragleave),E.func(h.ondropmove)&&p.on("dropmove",h.ondropmove),/^(pointer|center)$/.test(h.overlap)?p.options.drop.overlap=h.overlap:E.number(h.overlap)&&(p.options.drop.overlap=Math.max(Math.min(1,h.overlap),0)),"accept"in h&&(p.options.drop.accept=h.accept),"checker"in h&&(p.options.drop.checker=h.checker),p}return E.bool(h)?(p.options.drop.enabled=h,p):p.options.drop})(this,f)},s.prototype.dropCheck=function(f,p,h,v,S,y){return(function(C,M,Y,B,U,ae,ie){var fe=!1;if(!(ie=ie||C.getRect(ae)))return!!C.options.drop.checker&&C.options.drop.checker(M,Y,fe,C,ae,B,U);var ye=C.options.drop.overlap;if(ye==="pointer"){var xe=Ye(B,U,"drag"),he=ti(M);he.x+=xe.x,he.y+=xe.y;var be=he.x>ie.left&&he.x<ie.right,je=he.y>ie.top&&he.y<ie.bottom;fe=be&&je}var Te=B.getRect(U);if(Te&&ye==="center"){var ze=Te.left+Te.width/2,Le=Te.top+Te.height/2;fe=ze>=ie.left&&ze<=ie.right&&Le>=ie.top&&Le<=ie.bottom}return Te&&E.number(ye)&&(fe=Math.max(0,Math.min(ie.right,Te.right)-Math.max(ie.left,Te.left))*Math.max(0,Math.min(ie.bottom,Te.bottom)-Math.max(ie.top,Te.top))/(Te.width*Te.height)>=ye),C.options.drop.checker&&(fe=C.options.drop.checker(M,Y,fe,C,ae,B,U)),fe})(this,f,p,h,v,S,y)},o.dynamicDrop=function(f){return E.bool(f)?(n.dynamicDrop=f,o):n.dynamicDrop},te(t.phaselessTypes,{dragenter:!0,dragleave:!0,dropactivate:!0,dropdeactivate:!0,dropmove:!0,drop:!0}),t.methodDict.drop="dropzone",n.dynamicDrop=!1,l.actions.drop=ui.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,s=n.iEvent;if(o.prepared.name==="drag"){var l=o.dropState;l.activeDrops=[],l.events={},l.activeDrops=hr(t,o.element),l.events=gr(o,0,s),l.events.activate&&(ai(l.activeDrops,l.events.activate),t.fire("actions/drop:start",{interaction:o,dragEvent:s}))}},"interactions:action-move":li,"interactions:after-action-move":function(n,t){var o=n.interaction,s=n.iEvent;if(o.prepared.name==="drag"){var l=o.dropState;mr(o,l.events),t.fire("actions/drop:move",{interaction:o,dragEvent:s}),l.events={}}},"interactions:action-end":function(n,t){if(n.interaction.prepared.name==="drag"){var o=n.interaction,s=n.iEvent;li(n,t),mr(o,o.dropState.events),t.fire("actions/drop:end",{interaction:o,dragEvent:s})}},"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:ci,getDropEvents:gr,fireDropEvents:mr,filterEventType:function(n){return n.search("drag")===0||n.search("drop")===0},defaults:{enabled:!1,accept:null,overlap:"pointer"}},Nc=ui;function vr(n){var t=n.interaction,o=n.iEvent,s=n.phase;if(t.prepared.name==="gesture"){var l=t.pointers.map((function(S){return S.pointer})),f=s==="start",p=s==="end",h=t.interactable.options.deltaSource;if(o.touches=[l[0],l[1]],f)o.distance=dr(l,h),o.box=fr(l),o.scale=1,o.ds=0,o.angle=pr(l,h),o.da=0,t.gesture.startDistance=o.distance,t.gesture.startAngle=o.angle;else if(p||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=dr(l,h),o.box=fr(l),o.scale=o.distance/t.gesture.startDistance,o.angle=pr(l,h),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 yr={id:"actions/gesture",before:["actions/drag","actions/resize"],install:function(n){var t=n.actions,o=n.Interactable,s=n.defaults;o.prototype.gesturable=function(l){return E.object(l)?(this.options.gesture.enabled=l.enabled!==!1,this.setPerAction("gesture",l),this.setOnEvents("gesture",l),this):E.bool(l)?(this.options.gesture.enabled=l,this):this.options.gesture},t.map.gesture=yr,t.methodDict.gesture="gesturable",s.actions.gesture=yr.defaults},listeners:{"interactions:action-start":vr,"interactions:action-move":vr,"interactions:action-end":vr,"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}},Sc=yr;function Tc(n,t,o,s,l,f,p){if(!t)return!1;if(t===!0){var h=E.number(f.width)?f.width:f.right-f.left,v=E.number(f.height)?f.height:f.bottom-f.top;if(p=Math.min(p,Math.abs((n==="left"||n==="right"?h:v)/2)),h<0&&(n==="left"?n="right":n==="right"&&(n="left")),v<0&&(n==="top"?n="bottom":n==="bottom"&&(n="top")),n==="left"){var S=h>=0?f.left:f.right;return o.x<S+p}if(n==="top"){var y=v>=0?f.top:f.bottom;return o.y<y+p}if(n==="right")return o.x>(h>=0?f.right:f.left)-p;if(n==="bottom")return o.y>(v>=0?f.bottom:f.top)-p}return!!E.element(s)&&(E.element(t)?t===s:q(s,t,l))}function fi(n){var t=n.iEvent,o=n.interaction;if(o.prepared.name==="resize"&&o.resizeAxes){var s=t;o.interactable.options.resize.square?(o.resizeAxes==="y"?s.delta.x=s.delta.y:s.delta.y=s.delta.x,s.axes="xy"):(s.axes=o.resizeAxes,o.resizeAxes==="x"?s.delta.y=0:o.resizeAxes==="y"&&(s.delta.x=0))}}var Ue,ot,Ke={id:"actions/resize",before:["actions/drag"],install:function(n){var t=n.actions,o=n.browser,s=n.Interactable,l=n.defaults;Ke.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),Ke.defaultMargin=o.supportsTouch||o.supportsPointerEvent?20:10,s.prototype.resizable=function(f){return(function(p,h,v){return E.object(h)?(p.options.resize.enabled=h.enabled!==!1,p.setPerAction("resize",h),p.setOnEvents("resize",h),E.string(h.axis)&&/^x$|^y$|^xy$/.test(h.axis)?p.options.resize.axis=h.axis:h.axis===null&&(p.options.resize.axis=v.defaults.actions.resize.axis),E.bool(h.preserveAspectRatio)?p.options.resize.preserveAspectRatio=h.preserveAspectRatio:E.bool(h.square)&&(p.options.resize.square=h.square),p):E.bool(h)?(p.options.resize.enabled=h,p):p.options.resize})(this,f,n)},t.map.resize=Ke,t.methodDict.resize="resizable",l.actions.resize=Ke.defaults},listeners:{"interactions:new":function(n){n.interaction.resizeAxes="xy"},"interactions:action-start":function(n){(function(t){var o=t.iEvent,s=t.interaction;if(s.prepared.name==="resize"&&s.prepared.edges){var l=o,f=s.rect;s._rects={start:te({},f),corrected:te({},f),previous:te({},f),delta:{left:0,right:0,width:0,top:0,bottom:0,height:0}},l.edges=s.prepared.edges,l.rect=s._rects.corrected,l.deltaRect=s._rects.delta}})(n),fi(n)},"interactions:action-move":function(n){(function(t){var o=t.iEvent,s=t.interaction;if(s.prepared.name==="resize"&&s.prepared.edges){var l=o,f=s.interactable.options.resize.invert,p=f==="reposition"||f==="negate",h=s.rect,v=s._rects,S=v.start,y=v.corrected,C=v.delta,M=v.previous;if(te(M,y),p){if(te(y,h),f==="reposition"){if(y.top>y.bottom){var Y=y.top;y.top=y.bottom,y.bottom=Y}if(y.left>y.right){var B=y.left;y.left=y.right,y.right=B}}}else y.top=Math.min(h.top,S.bottom),y.bottom=Math.max(h.bottom,S.top),y.left=Math.min(h.left,S.right),y.right=Math.max(h.right,S.left);for(var U in y.width=y.right-y.left,y.height=y.bottom-y.top,y)C[U]=y[U]-M[U];l.edges=s.prepared.edges,l.rect=y,l.deltaRect=C}})(n),fi(n)},"interactions:action-end":function(n){var t=n.iEvent,o=n.interaction;if(o.prepared.name==="resize"&&o.prepared.edges){var s=t;s.edges=o.prepared.edges,s.rect=o._rects.corrected,s.deltaRect=o._rects.delta}},"auto-start:check":function(n){var t=n.interaction,o=n.interactable,s=n.element,l=n.rect,f=n.buttons;if(l){var p=te({},t.coords.cur.page),h=o.options.resize;if(h&&h.enabled&&(!t.pointerIsDown||!/mouse|pointer/.test(t.pointerType)||(f&h.mouseButtons)!=0)){if(E.object(h.edges)){var v={left:!1,right:!1,top:!1,bottom:!1};for(var S in v)v[S]=Tc(S,h.edges[S],p,t._latestPointer.eventTarget,s,l,h.margin||Ke.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=h.axis!=="y"&&p.x>l.right-Ke.defaultMargin,C=h.axis!=="x"&&p.y>l.bottom-Ke.defaultMargin;(y||C)&&(n.action={name:"resize",axes:(y?"x":"")+(C?"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,s=n.name,l=Ke.cursors,f=null;if(o)f=l[s+o];else if(t){for(var p="",h=0,v=["top","bottom","left","right"];h<v.length;h++){var S=v[h];t[S]&&(p+=S)}f=l[p]}return f},filterEventType:function(n){return n.search("resize")===0},defaultMargin:null},_c=Ke,Cc={id:"actions",install:function(n){n.usePlugin(Sc),n.usePlugin(_c),n.usePlugin(se),n.usePlugin(Nc)}},di=0,Ze={request:function(n){return Ue(n)},cancel:function(n){return ot(n)},init:function(n){if(Ue=n.requestAnimationFrame,ot=n.cancelAnimationFrame,!Ue)for(var t=["ms","moz","webkit","o"],o=0;o<t.length;o++){var s=t[o];Ue=n["".concat(s,"RequestAnimationFrame")],ot=n["".concat(s,"CancelAnimationFrame")]||n["".concat(s,"CancelRequestAnimationFrame")]}Ue=Ue&&Ue.bind(n),ot=ot&&ot.bind(n),Ue||(Ue=function(l){var f=Date.now(),p=Math.max(0,16-(f-di)),h=n.setTimeout((function(){l(f+p)}),p);return di=f+p,h},ot=function(l){return clearTimeout(l)})}},ge={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){ge.isScrolling=!0,Ze.cancel(ge.i),n.autoScroll=ge,ge.interaction=n,ge.prevTime=ge.now(),ge.i=Ze.request(ge.scroll)},stop:function(){ge.isScrolling=!1,ge.interaction&&(ge.interaction.autoScroll=null),Ze.cancel(ge.i)},scroll:function(){var n=ge.interaction,t=n.interactable,o=n.element,s=n.prepared.name,l=t.options[s].autoScroll,f=pi(l.container,t,o),p=ge.now(),h=(p-ge.prevTime)/1e3,v=l.speed*h;if(v>=1){var S={x:ge.x*v,y:ge.y*v};if(S.x||S.y){var y=hi(f);E.window(f)?f.scrollBy(S.x,S.y):f&&(f.scrollLeft+=S.x,f.scrollTop+=S.y);var C=hi(f),M={x:C.x-y.x,y:C.y-y.y};(M.x||M.y)&&t.fire({type:"autoscroll",target:o,interactable:t,delta:M,interaction:n,container:f})}ge.prevTime=p}ge.isScrolling&&(Ze.cancel(ge.i),ge.i=Ze.request(ge.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()&&ge.check(t.interactable,t.prepared.name))if(t.simulation)ge.x=ge.y=0;else{var s,l,f,p,h=t.interactable,v=t.element,S=t.prepared.name,y=h.options[S].autoScroll,C=pi(y.container,h,v);if(E.window(C))p=o.clientX<ge.margin,s=o.clientY<ge.margin,l=o.clientX>C.innerWidth-ge.margin,f=o.clientY>C.innerHeight-ge.margin;else{var M=pe(C);p=o.clientX<M.left+ge.margin,s=o.clientY<M.top+ge.margin,l=o.clientX>M.right-ge.margin,f=o.clientY>M.bottom-ge.margin}ge.x=l?1:p?-1:0,ge.y=f?1:s?-1:0,ge.isScrolling||(ge.margin=y.margin,ge.speed=y.speed,ge.start(t))}}};function pi(n,t,o){return(E.string(n)?De(n,t,o):n)||K(o)}function hi(n){return E.window(n)&&(n=window.document.body),{x:n.scrollLeft,y:n.scrollTop}}var kc={id:"auto-scroll",install:function(n){var t=n.defaults,o=n.actions;n.autoScroll=ge,ge.now=function(){return n.now()},o.phaselessTypes.autoscroll=!0,t.perAction.autoScroll=ge.defaults},listeners:{"interactions:new":function(n){n.interaction.autoScroll=null},"interactions:destroy":function(n){n.interaction.autoScroll=null,ge.stop(),ge.interaction&&(ge.interaction=null)},"interactions:stop":ge.stop,"interactions:action-move":function(n){return ge.onInteractionMove(n)}}},Oc=kc;function It(n,t){var o=!1;return function(){return o||($.console.warn(t),o=!0),n.apply(this,arguments)}}function br(n,t){return n.name=t.name,n.axis=t.axis,n.edges=t.edges,n}function Pc(n){return E.bool(n)?(this.options.styleCursor=n,this):n===null?(delete this.options.styleCursor,this):this.options.styleCursor}function Ic(n){return E.func(n)?(this.options.actionChecker=n,this):n===null?(delete this.options.actionChecker,this):this.options.actionChecker}var Rc={id:"auto-start/interactableMethods",install:function(n){var t=n.Interactable;t.prototype.getAction=function(o,s,l,f){var p=(function(h,v,S,y,C){var M=h.getRect(y),Y=v.buttons||{0:1,1:4,3:8,4:16}[v.button],B={action:null,interactable:h,interaction:S,element:y,rect:M,buttons:Y};return C.fire("auto-start:check",B),B.action})(this,s,l,f,n);return this.options.actionChecker?this.options.actionChecker(o,s,p,this,f,l):p},t.prototype.ignoreFrom=It((function(o){return this._backCompatOption("ignoreFrom",o)}),"Interactable.ignoreFrom() has been deprecated. Use Interactble.draggable({ignoreFrom: newValue})."),t.prototype.allowFrom=It((function(o){return this._backCompatOption("allowFrom",o)}),"Interactable.allowFrom() has been deprecated. Use Interactble.draggable({allowFrom: newValue})."),t.prototype.actionChecker=Ic,t.prototype.styleCursor=Pc}};function gi(n,t,o,s,l){return t.testIgnoreAllow(t.options[n.name],o,s)&&t.options[n.name].enabled&&Nn(t,o,n,l)?n:null}function jc(n,t,o,s,l,f,p){for(var h=0,v=s.length;h<v;h++){var S=s[h],y=l[h],C=S.getAction(t,o,n,y);if(C){var M=gi(C,S,y,f,p);if(M)return{action:M,interactable:S,element:y}}}return{action:null,interactable:null,element:null}}function mi(n,t,o,s,l){var f=[],p=[],h=s;function v(y){f.push(y),p.push(h)}for(;E.element(h);){f=[],p=[],l.interactables.forEachMatch(h,v);var S=jc(n,t,o,f,p,s,l);if(S.action&&!S.interactable.options[S.action.name].manualStart)return S;h=H(h)}return{action:null,interactable:null,element:null}}function vi(n,t,o){var s=t.action,l=t.interactable,f=t.element;s=s||{name:null},n.interactable=l,n.element=f,br(n.prepared,s),n.rect=l&&s.name?l.getRect(f):null,bi(n,o),o.fire("autoStart:prepared",{interaction:n})}function Nn(n,t,o,s){var l=n.options,f=l[o.name].max,p=l[o.name].maxPerElement,h=s.autoStart.maxInteractions,v=0,S=0,y=0;if(!(f&&p&&h))return!1;for(var C=0,M=s.interactions.list;C<M.length;C++){var Y=M[C],B=Y.prepared.name;if(Y.interacting()&&(++v>=h||Y.interactable===n&&((S+=B===o.name?1:0)>=f||Y.element===t&&(y++,B===o.name&&y>=p))))return!1}return h>0}function yi(n,t){return E.number(n)?(t.autoStart.maxInteractions=n,this):t.autoStart.maxInteractions}function wr(n,t,o){var s=o.autoStart.cursorElement;s&&s!==n&&(s.style.cursor=""),n.ownerDocument.documentElement.style.cursor=t,n.style.cursor=t,o.autoStart.cursorElement=t?n:null}function bi(n,t){var o=n.interactable,s=n.element,l=n.prepared;if(n.pointerType==="mouse"&&o&&o.options.styleCursor){var f="";if(l.name){var p=o.options[l.name].cursorChecker;f=E.func(p)?p(l,o,s,n._interacting):t.actions.map[l.name].getCursor(l)}wr(n.element,f||"",t)}else t.autoStart.cursorElement&&wr(t.autoStart.cursorElement,"",t)}var Ac={id:"auto-start/base",before:["actions"],install:function(n){var t=n.interactStatic,o=n.defaults;n.usePlugin(Rc),o.base.actionChecker=null,o.base.styleCursor=!0,te(o.perAction,{manualStart:!1,max:1/0,maxPerElement:1,allowFrom:null,ignoreFrom:null,mouseButtons:1}),t.maxInteractions=function(s){return yi(s,n)},n.autoStart={maxInteractions:1/0,withinInteractionLimit:Nn,cursorElement:null}},listeners:{"interactions:down":function(n,t){var o=n.interaction,s=n.pointer,l=n.event,f=n.eventTarget;o.interacting()||vi(o,mi(o,s,l,f,t),t)},"interactions:move":function(n,t){(function(o,s){var l=o.interaction,f=o.pointer,p=o.event,h=o.eventTarget;l.pointerType!=="mouse"||l.pointerIsDown||l.interacting()||vi(l,mi(l,f,p,h,s),s)})(n,t),(function(o,s){var l=o.interaction;if(l.pointerIsDown&&!l.interacting()&&l.pointerWasMoved&&l.prepared.name){s.fire("autoStart:before-start",o);var f=l.interactable,p=l.prepared.name;p&&f&&(f.options[p].manualStart||!Nn(f,l.element,l.prepared,s)?l.stop():(l.start(l.prepared,f,l.element),bi(l,s)))}})(n,t)},"interactions:stop":function(n,t){var o=n.interaction,s=o.interactable;s&&s.options.styleCursor&&wr(o.element,"",t)}},maxInteractions:yi,withinInteractionLimit:Nn,validateAction:gi},xr=Ac,Mc={id:"auto-start/dragAxis",listeners:{"autoStart:before-start":function(n,t){var o=n.interaction,s=n.eventTarget,l=n.dx,f=n.dy;if(o.prepared.name==="drag"){var p=Math.abs(l),h=Math.abs(f),v=o.interactable.options.drag,S=v.startAxis,y=p>h?"x":p<h?"y":"xy";if(o.prepared.axis=v.lockAxis==="start"?y[0]:v.lockAxis,y!=="xy"&&S!=="xy"&&S!==y){o.prepared.name=null;for(var C=s,M=function(B){if(B!==o.interactable){var U=o.interactable.options.drag;if(!U.manualStart&&B.testIgnoreAllow(U,C,s)){var ae=B.getAction(o.downPointer,o.downEvent,o,C);if(ae&&ae.name==="drag"&&(function(ie,fe){if(!fe)return!1;var ye=fe.options.drag.startAxis;return ie==="xy"||ye==="xy"||ye===ie})(y,B)&&xr.validateAction(ae,B,C,s,t))return B}}};E.element(C);){var Y=t.interactables.forEachMatch(C,M);if(Y){o.prepared.name="drag",o.interactable=Y,o.element=C;break}C=H(C)}}}}}};function Er(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 zc={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=Er(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;Er(t)>0&&(t.prepared.name=null)}},getHoldDuration:Er},Lc=zc,Fc={id:"auto-start",install:function(n){n.usePlugin(xr),n.usePlugin(Lc),n.usePlugin(Mc)}},Dc=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 Vc(n){var t=n.interaction,o=n.event;t.interactable&&t.interactable.checkAndPreventDefault(o)}var wi={id:"core/interactablePreventDefault",install:function(n){var t=n.Interactable;t.prototype.preventDefault=Dc,t.prototype.checkAndPreventDefault=function(o){return(function(s,l,f){var p=s.options.preventDefault;if(p!=="never")if(p!=="always"){if(l.events.supportsPassive&&/^touch(start|move)$/.test(f.type)){var h=K(f.target).document,v=l.getDocOptions(h);if(!v||!v.events||v.events.passive!==!1)return}/^(mouse|pointer|touch)*(down|start)/i.test(f.type)||E.element(f.target)&&D(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 s=0,l=n.interactions.list;s<l.length;s++){var f=l[s];if(f.element&&(f.element===o.target||oe(f.element,o.target)))return void f.interactable.checkAndPreventDefault(o)}}})},listeners:["down","move","up","cancel"].reduce((function(n,t){return n["interactions:".concat(t)]=Vc,n}),{})};function Sn(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 ut(n){var t={};for(var o in n){var s=n[o];E.plainObject(s)?t[o]=ut(s):E.array(s)?t[o]=si(s):t[o]=s}return t}var Nr=(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=Tn(),this.edges={left:!1,right:!1,top:!1,bottom:!1}}return g(n,[{key:"start",value:function(t,o){var s,l,f=t.phase,p=this.interaction,h=(function(S){var y=S.interactable.options[S.prepared.name],C=y.modifiers;return C&&C.length?C:["snap","snapSize","snapEdges","restrict","restrictEdges","restrictSize"].map((function(M){var Y=y[M];return Y&&Y.enabled&&{options:Y,methods:Y._methods}})).filter((function(M){return!!M}))})(p);this.prepareStates(h),this.startEdges=te({},p.edges),this.edges=te({},this.startEdges),this.startOffset=(s=p.rect,l=o,s?{left:l.x-s.left,top:l.y-s.top,right:s.right-l.x,bottom:s.bottom-l.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=Tn(),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,s=this.states;o<s.length;o++){var l=s[o];l.methods.start&&(t.state=l,l.methods.start(t))}}},{key:"setAll",value:function(t){var o=t.phase,s=t.preEnd,l=t.skipModifiers,f=t.rect,p=t.edges;t.coords=te({},t.pageCoords),t.rect=te({},f),t.edges=te({},p);for(var h=l?this.states.slice(l):this.states,v=Tn(t.coords,t.rect),S=0;S<h.length;S++){var y,C=h[S],M=C.options,Y=te({},t.coords),B=null;(y=C.methods)!=null&&y.set&&this.shouldDo(M,s,o)&&(t.state=C,B=C.methods.set(t),Me(t.edges,t.rect,{x:t.coords.x-Y.x,y:t.coords.y-Y.y})),v.eventProps.push(B)}te(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 U=this.result.coords,ae=this.result.rect;if(U&&ae){var ie=v.rect.left!==ae.left||v.rect.right!==ae.right||v.rect.top!==ae.top||v.rect.bottom!==ae.bottom;v.changed=ie||U.x!==v.coords.x||U.y!==v.coords.y}return v}},{key:"applyToInteraction",value:function(t){var o=this.interaction,s=t.phase,l=o.coords.cur,f=o.coords.start,p=this.result,h=this.startDelta,v=p.delta;s==="start"&&te(this.startDelta,p.delta);for(var S=0,y=[[f,h],[l,v]];S<y.length;S++){var C=y[S],M=C[0],Y=C[1];M.page.x+=Y.x,M.page.y+=Y.y,M.client.x+=Y.x,M.client.y+=Y.y}var B=this.result.rectDelta,U=t.rect||o.rect;U.left+=B.left,U.right+=B.right,U.top+=B.top,U.bottom+=B.bottom,U.width=U.right-U.left,U.height=U.bottom-U.top}},{key:"setAndApply",value:function(t){var o=this.interaction,s=t.phase,l=t.preEnd,f=t.skipModifiers,p=this.setAll(this.fillArg({preEnd:l,phase:s,pageCoords:t.modifiedCoords||o.coords.cur.page}));if(this.result=p,!p.changed&&(!f||f<this.states.length)&&o.interacting())return!1;if(t.modifiedCoords){var h=o.coords.cur.page,v={x:t.modifiedCoords.x-h.x,y:t.modifiedCoords.y-h.y};p.coords.x+=v.x,p.coords.y+=v.y,p.delta.x+=v.x,p.delta.y+=v.y}this.applyToInteraction(t)}},{key:"beforeEnd",value:function(t){var o=t.interaction,s=t.event,l=this.states;if(l&&l.length){for(var f=!1,p=0;p<l.length;p++){var h=l[p];t.state=h;var v=h.options,S=h.methods,y=S.beforeEnd&&S.beforeEnd(t);if(y)return this.endResult=y,!1;f=f||!f&&this.shouldDo(v,!0,t.phase,!0)}f&&o.move({event:s,preEnd:!0})}}},{key:"stop",value:function(t){var o=t.interaction;if(this.states&&this.states.length){var s=te({states:this.states,interactable:o.interactable,element:o.element,rect:null},t);this.fillArg(s);for(var l=0,f=this.states;l<f.length;l++){var p=f[l];s.state=p,p.methods.stop&&p.methods.stop(s)}this.states=null,this.endResult=null}}},{key:"prepareStates",value:function(t){this.states=[];for(var o=0;o<t.length;o++){var s=t[o],l=s.options,f=s.methods,p=s.name;this.states.push({options:l,methods:f,index:o,name:p})}return this.states}},{key:"restoreInteractionCoords",value:function(t){var o=t.interaction,s=o.coords,l=o.rect,f=o.modification;if(f.result){for(var p=f.startDelta,h=f.result,v=h.delta,S=h.rectDelta,y=0,C=[[s.start,p],[s.cur,v]];y<C.length;y++){var M=C[y],Y=M[0],B=M[1];Y.page.x-=B.x,Y.page.y-=B.y,Y.client.x-=B.x,Y.client.y-=B.y}l.left-=S.left,l.right-=S.right,l.top-=S.top,l.bottom-=S.bottom}}},{key:"shouldDo",value:function(t,o,s,l){return!(!t||t.enabled===!1||l&&!t.endOnly||t.endOnly&&!o||s==="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 ut(o)})),this.result=Tn(te({},t.result.coords),te({},t.result.rect))}},{key:"destroy",value:function(){for(var t in this)this[t]=null}}]),n})();function Tn(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,s={start:n.start,set:n.set,beforeEnd:n.beforeEnd,stop:n.stop},l=function(f){var p=f||{};for(var h in p.enabled=p.enabled!==!1,o)h in p||(p[h]=o[h]);var v={options:p,methods:s,name:t,enable:function(){return p.enabled=!0,v},disable:function(){return p.enabled=!1,v}};return v};return t&&typeof t=="string"&&(l._defaults=o,l._methods=s),l}function Rt(n){var t=n.iEvent,o=n.interaction.modification.result;o&&(t.modifiers=o.eventProps)}var Bc={id:"modifiers/base",before:["actions"],install:function(n){n.defaults.perAction.modifiers=[]},listeners:{"interactions:new":function(n){var t=n.interaction;t.modification=new Nr(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,s=o.setAndApply(n);return t.edges=o.edges,s},"interactions:before-action-end":function(n){var t=n.interaction,o=t.modification,s=o.beforeEnd(n);return t.edges=o.startEdges,s},"interactions:action-start":Rt,"interactions:action-move":Rt,"interactions:action-end":Rt,"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)}}},xi=Bc,Ei={base:{preventDefault:"auto",deltaSource:"page"},perAction:{enabled:!1,origin:{x:0,y:0}},actions:{}},Sr=(function(n){b(o,n);var t=A(o);function o(s,l,f,p,h,v,S){var y;u(this,o),(y=t.call(this,s)).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,h=h||s.element;var C=s.interactable,M=(C&&C.options||Ei).deltaSource,Y=Ye(C,h,f),B=p==="start",U=p==="end",ae=B?P(y):s.prevEvent,ie=B?s.coords.start:U?{page:ae.page,client:ae.client,timeStamp:s.coords.cur.timeStamp}:s.coords.cur;return y.page=te({},ie.page),y.client=te({},ie.client),y.rect=te({},s.rect),y.timeStamp=ie.timeStamp,U||(y.page.x-=Y.x,y.page.y-=Y.y,y.client.x-=Y.x,y.client.y-=Y.y),y.ctrlKey=l.ctrlKey,y.altKey=l.altKey,y.shiftKey=l.shiftKey,y.metaKey=l.metaKey,y.button=l.button,y.buttons=l.buttons,y.target=h,y.currentTarget=h,y.preEnd=v,y.type=S||f+(p||""),y.interactable=C,y.t0=B?s.pointers[s.pointers.length-1].downTime:ae.t0,y.x0=s.coords.start.page.x-Y.x,y.y0=s.coords.start.page.y-Y.y,y.clientX0=s.coords.start.client.x-Y.x,y.clientY0=s.coords.start.client.y-Y.y,y.delta=B||U?{x:0,y:0}:{x:y[M].x-ae[M].x,y:y[M].y-ae[M].y},y.dt=s.coords.delta.timeStamp,y.duration=y.timeStamp-y.t0,y.velocity=te({},s.coords.velocity[M]),y.speed=Ct(y.velocity.x,y.velocity.y),y.swipe=U||p==="inertiastart"?y.getSwipe():null,y}return g(o,[{key:"getSwipe",value:function(){var s=this._interaction;if(s.prevEvent.speed<600||this.timeStamp-s.prevEvent.timeStamp>150)return null;var l=180*Math.atan2(s.prevEvent.velocityY,s.prevEvent.velocityX)/Math.PI;l<0&&(l+=360);var f=112.5<=l&&l<247.5,p=202.5<=l&&l<337.5;return{up:p,down:!p&&22.5<=l&&l<157.5,left:f,right:!f&&(292.5<=l||l<67.5),angle:l,speed:s.prevEvent.speed,velocity:{x:s.prevEvent.velocityX,y:s.prevEvent.velocityY}}}},{key:"preventDefault",value:function(){}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}}]),o})(En);Object.defineProperties(Sr.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 Hc=g((function n(t,o,s,l,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=s,this.downTime=l,this.downTarget=f})),Yc=(function(n){return n.interactable="",n.element="",n.prepared="",n.pointerIsDown="",n.pointerWasMoved="",n._proxy="",n})({}),Ni=(function(n){return n.start="",n.move="",n.end="",n.stop="",n.interacting="",n})({}),Xc=0,Uc=(function(){function n(t){var o=this,s=t.pointerType,l=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=It((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=Xc++,this._scopeFire=l,this.pointerType=s;var f=this;this._proxy={};var p=function(y){Object.defineProperty(o._proxy,y,{get:function(){return f[y]}})};for(var h in Yc)p(h);var v=function(y){Object.defineProperty(o._proxy,y,{value:function(){return f[y].apply(f,arguments)}})};for(var S in Ni)v(S);this._scopeFire("interactions:new",{interaction:this})}return g(n,[{key:"pointerMoveTolerance",get:function(){return 1}},{key:"pointerDown",value:function(t,o,s){var l=this.updatePointer(t,o,s,!0),f=this.pointers[l];this._scopeFire("interactions:down",{pointer:t,event:o,eventTarget:s,pointerIndex:l,pointerInfo:f,type:"down",interaction:this})}},{key:"start",value:function(t,o,s){return!(this.interacting()||!this.pointerIsDown||this.pointers.length<(t.name==="gesture"?2:1)||!o.options[t.name].enabled)&&(br(this.prepared,t),this.interactable=o,this.element=s,this.rect=o.getRect(s),this.edges=this.prepared.edges?te({},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,s){this.simulation||this.modification&&this.modification.endResult||this.updatePointer(t,o,s,!1);var l,f,p=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&&(l=this.coords.cur.client.x-this.coords.start.client.x,f=this.coords.cur.client.y-this.coords.start.client.y,this.pointerWasMoved=Ct(l,f)>this.pointerMoveTolerance);var h,v,S,y=this.getPointerIndex(t),C={pointer:t,pointerIndex:y,pointerInfo:this.pointers[y],event:o,type:"move",eventTarget:s,dx:l,dy:f,duplicate:p,interaction:this};p||(h=this.coords.velocity,v=this.coords.delta,S=Math.max(v.timeStamp/1e3,.001),h.page.x=v.page.x/S,h.page.y=v.page.y/S,h.client.x=v.client.x/S,h.client.y=v.client.y/S,h.timeStamp=S),this._scopeFire("interactions:move",C),p||this.simulation||(this.interacting()&&(C.type=null,this.move(C)),this.pointerWasMoved&&wn(this.coords.prev,this.coords.cur))}},{key:"move",value:function(t){t&&t.event||qo(this.coords.delta),(t=te({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,s,l){var f=this.getPointerIndex(t);f===-1&&(f=this.updatePointer(t,o,s,!1));var p=/cancel$/i.test(o.type)?"cancel":"up";this._scopeFire("interactions:".concat(p),{pointer:t,pointerIndex:f,pointerInfo:this.pointers[f],event:o,eventTarget:s,type:p,curEventTarget:l,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:Ot(this.pointers,(function(s){return s.id===o}))}},{key:"getPointerInfo",value:function(t){return this.pointers[this.getPointerIndex(t)]}},{key:"updatePointer",value:function(t,o,s,l){var f,p,h,v=kt(t),S=this.getPointerIndex(t),y=this.pointers[S];return l=l!==!1&&(l||/(down|start)$/i.test(o.type)),y?y.pointer=t:(y=new Hc(v,t,o,null,null),S=this.pointers.length,this.pointers.push(y)),Ec(this.coords.cur,this.pointers.map((function(C){return C.pointer})),this._now()),f=this.coords.delta,p=this.coords.prev,h=this.coords.cur,f.page.x=h.page.x-p.page.x,f.page.y=h.page.y-p.page.y,f.client.x=h.client.x-p.client.x,f.client.y=h.client.y-p.client.y,f.timeStamp=h.timeStamp-p.timeStamp,l&&(this.pointerIsDown=!0,y.downTime=this.coords.cur.timeStamp,y.downTarget=s,bn(this.downPointer,t),this.interacting()||(wn(this.coords.start,this.coords.cur),wn(this.coords.prev,this.coords.cur),this.downEvent=o,this.pointerWasMoved=!1)),this._updateLatestPointer(t,o,s),this._scopeFire("interactions:update-pointer",{pointer:t,event:o,eventTarget:s,down:l,pointerInfo:y,pointerIndex:S,interaction:this}),S}},{key:"removePointer",value:function(t,o){var s=this.getPointerIndex(t);if(s!==-1){var l=this.pointers[s];this._scopeFire("interactions:remove-pointer",{pointer:t,event:o,eventTarget:null,pointerIndex:s,pointerInfo:l,interaction:this}),this.pointers.splice(s,1),this.pointerIsDown=!1}}},{key:"_updateLatestPointer",value:function(t,o,s){this._latestPointer.pointer=t,this._latestPointer.event=o,this._latestPointer.eventTarget=s}},{key:"destroy",value:function(){this._latestPointer.pointer=null,this._latestPointer.event=null,this._latestPointer.eventTarget=null}},{key:"_createPreparedEvent",value:function(t,o,s,l){return new Sr(this,t,this.prepared.name,o,this.element,s,l)}},{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,s=t.phase,l=t.preEnd,f=t.type,p=this.rect;if(p&&s==="move"&&(Me(this.edges,p,this.coords.delta[this.interactable.options.deltaSource]),p.width=p.right-p.left,p.height=p.bottom-p.top),this._scopeFire("interactions:before-action-".concat(s),t)===!1)return!1;var h=t.iEvent=this._createPreparedEvent(o,s,l,f);return this._scopeFire("interactions:action-".concat(s),t),s==="start"&&(this.prevEvent=h),this._fireEvent(h),this._scopeFire("interactions:after-action-".concat(s),t),!0}},{key:"_now",value:function(){return Date.now()}}]),n})();function Si(n){Ti(n.interaction)}function Ti(n){if(!(function(o){return!(!o.offset.pending.x&&!o.offset.pending.y)})(n))return!1;var t=n.offset.pending;return Tr(n.coords.cur,t),Tr(n.coords.delta,t),Me(n.edges,n.rect,t),t.x=0,t.y=0,!0}function Kc(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 Tr(n,t){var o=n.page,s=n.client,l=t.x,f=t.y;o.x+=l,o.y+=f,s.x+=l,s.y+=f}Ni.offsetBy="";var Gc={id:"offset",before:["modifiers","pointer-events","actions","inertia"],install:function(n){n.Interaction.prototype.offsetBy=Kc},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&&(Tr(t.coords.cur,t.offset.total),t.offset.pending.x=0,t.offset.pending.y=0)})(n.interaction)},"interactions:before-action-start":Si,"interactions:before-action-move":Si,"interactions:before-action-end":function(n){var t=n.interaction;if(Ti(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}}},_i=Gc,Wc=(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,s=_n(o);if(!s||!s.enabled)return!1;var l=o.coords.velocity.client,f=Ct(l.x,l.y),p=this.modification||(this.modification=new Nr(o));if(p.copyFrom(o.modification),this.t0=o._now(),this.allowResume=s.allowResume,this.v0=f,this.currentOffset={x:0,y:0},this.startCoords=o.coords.cur.page,this.modifierArg=p.fillArg({pageCoords:this.startCoords,preEnd:!0,phase:"inertiastart"}),this.t0-o.coords.cur.timeStamp<50&&f>s.minSpeed&&f>s.endSpeed)this.startInertia();else{if(p.result=p.setAll(this.modifierArg),!p.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,s=_n(this.interaction),l=s.resistance,f=-Math.log(s.endSpeed/this.v0)/l;this.targetOffset={x:(o.x-f)/l,y:(o.y-f)/l},this.te=f,this.lambda_v0=l/this.v0,this.one_ve_v0=1-s.endSpeed/this.v0;var p=this.modification,h=this.modifierArg;h.pageCoords={x:this.startCoords.x+this.targetOffset.x,y:this.startCoords.y+this.targetOffset.y},p.result=p.setAll(h),p.result.changed&&(this.isModified=!0,this.modifiedOffset={x:this.targetOffset.x+p.result.delta.x,y:this.targetOffset.y+p.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,s,l,f,p,h,v=this,S=this.interaction,y=_n(S).resistance,C=(S._now()-this.t0)/1e3;if(C<this.te){var M,Y=1-(Math.exp(-y*C)-this.lambda_v0)/this.one_ve_v0;this.isModified?(t=0,o=0,s=this.targetOffset.x,l=this.targetOffset.y,f=this.modifiedOffset.x,p=this.modifiedOffset.y,M={x:Ci(h=Y,t,s,f),y:Ci(h,o,l,p)}):M={x:this.targetOffset.x*Y,y:this.targetOffset.y*Y};var B={x:M.x-this.currentOffset.x,y:M.y-this.currentOffset.y};this.currentOffset.x+=B.x,this.currentOffset.y+=B.y,S.offsetBy(B),S.move(),this.onNextFrame((function(){return v.inertiaTick()}))}else S.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,s=o._now()-this.t0,l=_n(o).smoothEndDuration;if(s<l){var f={x:ki(s,0,this.targetOffset.x,l),y:ki(s,0,this.targetOffset.y,l)},p={x:f.x-this.currentOffset.x,y:f.y-this.currentOffset.y};this.currentOffset.x+=p.x,this.currentOffset.y+=p.y,o.offsetBy(p),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,s=t.event,l=t.eventTarget,f=this.interaction;f.offsetBy({x:-this.currentOffset.x,y:-this.currentOffset.y}),f.updatePointer(o,s,l,!0),f._doPhase({interaction:f,event:s,phase:"resume"}),wn(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 _n(n){var t=n.interactable,o=n.prepared;return t&&t.options&&o.name&&t.options[o.name].inertia}var Jc={id:"inertia",before:["modifiers","actions"],install:function(n){var t=n.defaults;n.usePlugin(_i),n.usePlugin(xi),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 Wc(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,s=t.inertia;if(s.active)for(var l=o;E.element(l);){if(l===t.element){s.resume(n);break}l=H(l)}},"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":Rt,"interactions:action-inertiastart":Rt,"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 Ci(n,t,o,s){var l=1-n;return l*l*t+2*l*n*o+n*n*s}function ki(n,t,o,s){return-o*(n/=s)*(n-2)+t}var Zc=Jc;function Oi(n,t){for(var o=0;o<t.length;o++){var s=t[o];if(n.immediatePropagationStopped)break;s(n)}}var Pi=(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=te({},t||{})}return g(n,[{key:"fire",value:function(t){var o,s=this.global;(o=this.types[t.type])&&Oi(t,o),!t.propagationStopped&&s&&(o=s[t.type])&&Oi(t,o)}},{key:"on",value:function(t,o){var s=Xe(t,o);for(t in s)this.types[t]=ii(this.types[t]||[],s[t])}},{key:"off",value:function(t,o){var s=Xe(t,o);for(t in s){var l=this.types[t];if(l&&l.length)for(var f=0,p=s[t];f<p.length;f++){var h=p[f],v=l.indexOf(h);v!==-1&&l.splice(v,1)}}}},{key:"getRect",value:function(t){return null}}]),n})(),Qc=(function(){function n(t){u(this,n),this.currentTarget=void 0,this.originalEvent=void 0,this.type=void 0,this.originalEvent=t,bn(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 jt(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 $c={id:"events",install:function(n){var t,o=[],s={},l=[],f={add:p,remove:h,addDelegate:function(y,C,M,Y,B){var U=jt(B);if(!s[M]){s[M]=[];for(var ae=0;ae<l.length;ae++){var ie=l[ae];p(ie,M,v),p(ie,M,S,!0)}}var fe=s[M],ye=Pt(fe,(function(xe){return xe.selector===y&&xe.context===C}));ye||(ye={selector:y,context:C,listeners:[]},fe.push(ye)),ye.listeners.push({func:Y,options:U})},removeDelegate:function(y,C,M,Y,B){var U,ae=jt(B),ie=s[M],fe=!1;if(ie)for(U=ie.length-1;U>=0;U--){var ye=ie[U];if(ye.selector===y&&ye.context===C){for(var xe=ye.listeners,he=xe.length-1;he>=0;he--){var be=xe[he];if(be.func===Y&&Cn(be.options,ae)){xe.splice(he,1),xe.length||(ie.splice(U,1),h(C,M,v),h(C,M,S,!0)),fe=!0;break}}if(fe)break}}},delegateListener:v,delegateUseCapture:S,delegatedEvents:s,documents:l,targets:o,supportsOptions:!1,supportsPassive:!1};function p(y,C,M,Y){if(y.addEventListener){var B=jt(Y),U=Pt(o,(function(ae){return ae.eventTarget===y}));U||(U={eventTarget:y,events:{}},o.push(U)),U.events[C]||(U.events[C]=[]),Pt(U.events[C],(function(ae){return ae.func===M&&Cn(ae.options,B)}))||(y.addEventListener(C,M,f.supportsOptions?B:B.capture),U.events[C].push({func:M,options:B}))}}function h(y,C,M,Y){if(y.addEventListener&&y.removeEventListener){var B=Ot(o,(function(je){return je.eventTarget===y})),U=o[B];if(U&&U.events)if(C!=="all"){var ae=!1,ie=U.events[C];if(ie){if(M==="all"){for(var fe=ie.length-1;fe>=0;fe--){var ye=ie[fe];h(y,C,ye.func,ye.options)}return}for(var xe=jt(Y),he=0;he<ie.length;he++){var be=ie[he];if(be.func===M&&Cn(be.options,xe)){y.removeEventListener(C,M,f.supportsOptions?xe:xe.capture),ie.splice(he,1),ie.length===0&&(delete U.events[C],ae=!0);break}}}ae&&!Object.keys(U.events).length&&o.splice(B,1)}else for(C in U.events)U.events.hasOwnProperty(C)&&h(y,C,"all")}}function v(y,C){for(var M=jt(C),Y=new Qc(y),B=s[y.type],U=oi(y)[0],ae=U;E.element(ae);){for(var ie=0;ie<B.length;ie++){var fe=B[ie],ye=fe.selector,xe=fe.context;if(D(ae,ye)&&oe(xe,U)&&oe(xe,ae)){var he=fe.listeners;Y.currentTarget=ae;for(var be=0;be<he.length;be++){var je=he[be];Cn(je.options,M)&&je.func(Y)}}}ae=H(ae)}}function S(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}},_r={methodOrder:["simulationResume","mouseOrPen","hasPointer","idle"],search:function(n){for(var t=0,o=_r.methodOrder;t<o.length;t++){var s=o[t],l=_r[s](n);if(l)return l}return null},simulationResume:function(n){var t=n.pointerType,o=n.eventType,s=n.eventTarget,l=n.scope;if(!/down|start/i.test(o))return null;for(var f=0,p=l.interactions.list;f<p.length;f++){var h=p[f],v=s;if(h.simulation&&h.simulation.allowResume&&h.pointerType===t)for(;v;){if(v===h.element)return h;v=H(v)}}return null},mouseOrPen:function(n){var t,o=n.pointerId,s=n.pointerType,l=n.eventType,f=n.scope;if(s!=="mouse"&&s!=="pen")return null;for(var p=0,h=f.interactions.list;p<h.length;p++){var v=h[p];if(v.pointerType===s){if(v.simulation&&!Ii(v,o))continue;if(v.interacting())return v;t||(t=v)}}if(t)return t;for(var S=0,y=f.interactions.list;S<y.length;S++){var C=y[S];if(!(C.pointerType!==s||/down/i.test(l)&&C.simulation))return C}return null},hasPointer:function(n){for(var t=n.pointerId,o=0,s=n.scope.interactions.list;o<s.length;o++){var l=s[o];if(Ii(l,t))return l}return null},idle:function(n){for(var t=n.pointerType,o=0,s=n.scope.interactions.list;o<s.length;o++){var l=s[o];if(l.pointers.length===1){var f=l.interactable;if(f&&(!f.options.gesture||!f.options.gesture.enabled))continue}else if(l.pointers.length>=2)continue;if(!l.interacting()&&t===l.pointerType)return l}return null}};function Ii(n,t){return n.pointers.some((function(o){return o.id===t}))}var qc=_r,Cr=["pointerDown","pointerMove","pointerUp","updatePointer","removePointer","windowBlur"];function Ri(n,t){return function(o){var s=t.interactions.list,l=ri(o),f=oi(o),p=f[0],h=f[1],v=[];if(/^touch/.test(o.type)){t.prevTouchTime=t.now();for(var S=0,y=o.changedTouches;S<y.length;S++){var C=y[S],M={pointer:C,pointerId:kt(C),pointerType:l,eventType:o.type,eventTarget:p,curEventTarget:h,scope:t},Y=ji(M);v.push([M.pointer,M.eventTarget,M.curEventTarget,Y])}}else{var B=!1;if(!re.supportsPointerEvent&&/mouse/.test(o.type)){for(var U=0;U<s.length&&!B;U++)B=s[U].pointerType!=="mouse"&&s[U].pointerIsDown;B=B||t.now()-t.prevTouchTime<500||o.timeStamp===0}if(!B){var ae={pointer:o,pointerId:kt(o),pointerType:l,eventType:o.type,curEventTarget:h,eventTarget:p,scope:t},ie=ji(ae);v.push([ae.pointer,ae.eventTarget,ae.curEventTarget,ie])}}for(var fe=0;fe<v.length;fe++){var ye=v[fe],xe=ye[0],he=ye[1],be=ye[2];ye[3][n](xe,o,he,be)}}}function ji(n){var t=n.pointerType,o=n.scope,s={interaction:qc.search(n),searchDetails:n};return o.fire("interactions:find",s),s.interaction||o.interactions.new({pointerType:t})}function kr(n,t){var o=n.doc,s=n.scope,l=n.options,f=s.interactions.docEvents,p=s.events,h=p[t];for(var v in s.browser.isIOS&&!l.events&&(l.events={passive:!1}),p.delegatedEvents)h(o,v,p.delegateListener),h(o,v,p.delegateUseCapture,!0);for(var S=l&&l.events,y=0;y<f.length;y++){var C=f[y];h(o,C.type,C.listener,S)}}var el={id:"core/interactions",install:function(n){for(var t={},o=0;o<Cr.length;o++){var s=Cr[o];t[s]=Ri(s,n)}var l,f=re.pEventTypes;function p(){for(var h=0,v=n.interactions.list;h<v.length;h++){var S=v[h];if(S.pointerIsDown&&S.pointerType==="touch"&&!S._interacting)for(var y=function(){var Y=M[C];n.documents.some((function(B){return oe(B.doc,Y.downTarget)}))||S.removePointer(Y.pointer,Y.event)},C=0,M=S.pointers;C<M.length;C++)y()}}(l=X.PointerEvent?[{type:f.down,listener:p},{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:p},{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(h){for(var v=0,S=n.interactions.list;v<S.length;v++)S[v].documentBlur(h)}}),n.prevTouchTime=0,n.Interaction=(function(h){b(S,h);var v=A(S);function S(){return u(this,S),v.apply(this,arguments)}return g(S,[{key:"pointerMoveTolerance",get:function(){return n.interactions.pointerMoveTolerance},set:function(y){n.interactions.pointerMoveTolerance=y}},{key:"_now",value:function(){return n.now()}}]),S})(Uc),n.interactions={list:[],new:function(h){h.scopeFire=function(S,y){return n.fire(S,y)};var v=new n.Interaction(h);return n.interactions.list.push(v),v},listeners:t,docEvents:l,pointerMoveTolerance:1},n.usePlugin(wi)},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,s=t.interactions.list.length-1;s>=0;s--){var l=t.interactions.list[s];l.interactable===o&&(l.stop(),t.fire("interactions:destroy",{interaction:l}),l.destroy(),t.interactions.list.length>2&&t.interactions.list.splice(s,1))}}},onDocSignal:kr,doOnInteractions:Ri,methodNames:Cr},tl=el,$e=(function(n){return n[n.On=0]="On",n[n.Off=1]="Off",n})($e||{}),nl=(function(){function n(t,o,s,l){u(this,n),this.target=void 0,this.options=void 0,this._actions=void 0,this.events=new Pi,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||s,this._win=K(Ne(t)?this._context:t),this._doc=this._win.document,this._scopeEvents=l,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,s){var l,f=this,p=(l=this._actions.map[t])==null?void 0:l.filterEventType,h=function(v){return(p==null||p(v))&&Sn(v,f._actions)};(E.array(o)||E.object(o))&&this._onOff($e.Off,t,o,void 0,h),(E.array(s)||E.object(s))&&this._onOff($e.On,t,s,void 0,h)}},{key:"setPerAction",value:function(t,o){var s=this._defaults;for(var l in o){var f=l,p=this.options[t],h=o[f];f==="listeners"&&this.updatePerActionListeners(t,p.listeners,h),E.array(h)?p[f]=si(h):E.plainObject(h)?(p[f]=te(p[f]||{},ut(h)),E.object(s.perAction[f])&&"enabled"in s.perAction[f]&&(p[f].enabled=h.enabled!==!1)):E.bool(h)&&E.object(s.perAction[f])?p[f].enabled=h:p[f]=h}}},{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)),ve(t)}},{key:"rectChecker",value:function(t){var o=this;return E.func(t)?(this.getRect=function(s){var l=te({},t.apply(o,s));return"width"in l||(l.width=l.right-l.left,l.height=l.bottom-l.top),l},this):t===null?(delete this.getRect,this):this.getRect}},{key:"_backCompatOption",value:function(t,o){if(Ne(o)||E.object(o)){for(var s in this.options[t]=o,this._actions.map)this.options[s][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||oe(this._context,t)}},{key:"testIgnoreAllow",value:function(t,o,s){return!this.testIgnore(t.ignoreFrom,o,s)&&this.testAllow(t.allowFrom,o,s)}},{key:"testAllow",value:function(t,o,s){return!t||!!E.element(s)&&(E.string(t)?q(s,t,o):!!E.element(t)&&oe(t,s))}},{key:"testIgnore",value:function(t,o,s){return!(!t||!E.element(s))&&(E.string(t)?q(s,t,o):!!E.element(t)&&oe(t,s))}},{key:"fire",value:function(t){return this.events.fire(t),this}},{key:"_onOff",value:function(t,o,s,l,f){E.object(o)&&!E.array(o)&&(l=s,s=null);var p=Xe(o,s,f);for(var h in p){h==="wheel"&&(h=re.wheelEvent);for(var v=0,S=p[h];v<S.length;v++){var y=S[v];Sn(h,this._actions)?this.events[t===$e.On?"on":"off"](h,y):E.string(this.target)?this._scopeEvents[t===$e.On?"addDelegate":"removeDelegate"](this.target,this._context,h,y,l):this._scopeEvents[t===$e.On?"add":"remove"](this.target,h,y,l)}}return this}},{key:"on",value:function(t,o,s){return this._onOff($e.On,t,o,s)}},{key:"off",value:function(t,o,s){return this._onOff($e.Off,t,o,s)}},{key:"set",value:function(t){var o=this._defaults;for(var s in E.object(t)||(t={}),this.options=ut(o.base),this._actions.methodDict){var l=s,f=this._actions.methodDict[l];this.options[l]={},this.setPerAction(l,te(te({},o.perAction),o.actions[l])),this[f](t[l])}for(var p in t)p!=="getRect"?E.func(this[p])&&this[p](t[p]):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],s=o.length-1;s>=0;s--){var l=o[s],f=l.selector,p=l.context,h=l.listeners;f===this.target&&p===this._context&&o.splice(s,1);for(var v=h.length-1;v>=0;v--)this._scopeEvents.removeDelegate(this.target,this._context,t,h[v][0],h[v][1])}else this._scopeEvents.remove(this.target,"all")}}]),n})(),rl=(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(s){var l=s.interactable,f=l.target,p=E.string(f)?o.selectorMap[f]:f[o.scope.id],h=Ot(p,(function(v){return v===l}));p.splice(h,1)}})}return g(n,[{key:"new",value:function(t,o){o=te(o||{},{actions:this.scope.actions});var s=new this.scope.Interactable(t,o,this.scope.document,this.scope.events);return this.scope.addDocument(s._doc),this.list.push(s),E.string(t)?(this.selectorMap[t]||(this.selectorMap[t]=[]),this.selectorMap[t].push(s)):(s.target[this.scope.id]||Object.defineProperty(t,this.scope.id,{value:[],configurable:!0}),t[this.scope.id].push(s)),this.scope.fire("interactable:new",{target:t,options:o,interactable:s,win:this.scope._win}),s}},{key:"getExisting",value:function(t,o){var s=o&&o.context||this.scope.document,l=E.string(t),f=l?this.selectorMap[t]:t[this.scope.id];if(f)return Pt(f,(function(p){return p._context===s&&(l||p.inContext(t))}))}},{key:"forEachMatch",value:function(t,o){for(var s=0,l=this.list;s<l.length;s++){var f=l[s],p=void 0;if((E.string(f.target)?E.element(t)&&D(t,f.target):t===f.target)&&f.inContext(t)&&(p=o(f)),p!==void 0)return p}}}]),n})(),ol=(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=re,this.defaults=ut(Ei),this.Eventable=Pi,this.actions={map:{},phases:{start:!0,move:!0,end:!0},methodDict:{},phaselessTypes:{}},this.interactStatic=(function(s){var l=function f(p,h){var v=s.interactables.getExisting(p,h);return v||((v=s.interactables.new(p,h)).events.global=f.globalEvents),v};return l.getPointerAverage=ni,l.getTouchBBox=fr,l.getTouchDistance=dr,l.getTouchAngle=pr,l.getElementRect=ve,l.getElementClientRect=pe,l.matchesSelector=D,l.closest=le,l.globalEvents={},l.version="1.10.27",l.scope=s,l.use=function(f,p){return this.scope.usePlugin(f,p),this},l.isSet=function(f,p){return!!this.scope.interactables.get(f,p&&p.context)},l.on=It((function(f,p,h){if(E.string(f)&&f.search(" ")!==-1&&(f=f.trim().split(/ +/)),E.array(f)){for(var v=0,S=f;v<S.length;v++){var y=S[v];this.on(y,p,h)}return this}if(E.object(f)){for(var C in f)this.on(C,f[C],p);return this}return Sn(f,this.scope.actions)?this.globalEvents[f]?this.globalEvents[f].push(p):this.globalEvents[f]=[p]:this.scope.events.add(this.scope.document,f,p,{options:h}),this}),"The interact.on() method is being deprecated"),l.off=It((function(f,p,h){if(E.string(f)&&f.search(" ")!==-1&&(f=f.trim().split(/ +/)),E.array(f)){for(var v=0,S=f;v<S.length;v++){var y=S[v];this.off(y,p,h)}return this}if(E.object(f)){for(var C in f)this.off(C,f[C],p);return this}var M;return Sn(f,this.scope.actions)?f in this.globalEvents&&(M=this.globalEvents[f].indexOf(p))!==-1&&this.globalEvents[f].splice(M,1):this.scope.events.remove(this.scope.document,f,p,h),this}),"The interact.off() method is being deprecated"),l.debug=function(){return this.scope},l.supportsTouch=function(){return re.supportsTouch},l.supportsPointerEvent=function(){return re.supportsPointerEvent},l.stop=function(){for(var f=0,p=this.scope.interactions.list;f<p.length;f++)p[f].stop();return this},l.pointerMoveTolerance=function(f){return E.number(f)?(this.scope.interactions.pointerMoveTolerance=f,this):this.scope.interactions.pointerMoveTolerance},l.addDocument=function(f,p){this.scope.addDocument(f,p)},l.removeDocument=function(f){this.scope.removeDocument(f)},l})(this),this.InteractEvent=Sr,this.Interactable=void 0,this.interactables=new rl(this),this._win=void 0,this.document=void 0,this.window=void 0,this.documents=[],this._plugins={list:[],map:{}},this.onWindowUnload=function(s){return t.removeDocument(s.target)};var o=this;this.Interactable=(function(s){b(f,s);var l=A(f);function f(){return u(this,f),l.apply(this,arguments)}return g(f,[{key:"_defaults",get:function(){return o.defaults}},{key:"set",value:function(p){return z(k(f.prototype),"set",this).call(this,p),o.fire("interactable:set",{options:p,interactable:this}),this}},{key:"unset",value:function(){z(k(f.prototype),"unset",this).call(this);var p=o.interactables.list.indexOf(this);p<0||(o.interactables.list.splice(p,1),o.fire("interactable:unset",{interactable:this}))}}]),f})(nl)}return g(n,[{key:"addListeners",value:function(t,o){this.listenerMaps.push({id:o,map:t})}},{key:"fire",value:function(t,o){for(var s=0,l=this.listenerMaps;s<l.length;s++){var f=l[s].map[t];if(f&&f(o,this,t)===!1)return!1}}},{key:"init",value:function(t){return this.isInitialized?this:(function(o,s){return o.isInitialized=!0,E.window(s)&&L(s),X.init(s),re.init(s),Ze.init(s),o.window=s,o.document=s.document,o.usePlugin(tl),o.usePlugin($c),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 s=0,l=this.listenerMaps.length,f=t.before.reduce((function(h,v){return h[v]=!0,h[Ai(v)]=!0,h}),{});s<l;s++){var p=this.listenerMaps[s].id;if(p&&(f[p]||f[Ai(p)]))break}this.listenerMaps.splice(s,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 s=K(t);o=o?te({},o):{},this.documents.push({doc:t,options:o}),this.events.documents.push(t),t!==this.document&&this.events.add(s,"unload",this.onWindowUnload),this.fire("scope:add-document",{doc:t,window:s,scope:this,options:o})}},{key:"removeDocument",value:function(t){var o=this.getDocIndex(t),s=K(t),l=this.documents[o].options;this.events.remove(s,"unload",this.onWindowUnload),this.documents.splice(o,1),this.events.documents.splice(o,1),this.fire("scope:remove-document",{doc:t,window:s,scope:this,options:l})}},{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 Ai(n){return n&&n.replace(/\/.*$/,"")}var Mi=new ol,Re=Mi.interactStatic,il=typeof globalThis<"u"?globalThis:window;Mi.init(il);var sl=Object.freeze({__proto__:null,edgeTarget:function(){},elements:function(){},grid:function(n){var t=[["x","y"],["left","top"],["right","bottom"],["width","height"]].filter((function(s){var l=s[0],f=s[1];return l in n||f in n})),o=function(s,l){for(var f=n.range,p=n.limits,h=p===void 0?{left:-1/0,right:1/0,top:-1/0,bottom:1/0}:p,v=n.offset,S=v===void 0?{x:0,y:0}:v,y={range:f,grid:n,x:null,y:null},C=0;C<t.length;C++){var M=t[C],Y=M[0],B=M[1],U=Math.round((s-S.x)/n[Y]),ae=Math.round((l-S.y)/n[B]);y[Y]=Math.max(h.left,Math.min(h.right,U*n[Y]+S.x)),y[B]=Math.max(h.top,Math.min(h.bottom,ae*n[B]+S.y))}return y};return o.grid=n,o.coordFields=t,o}}),al={id:"snappers",install:function(n){var t=n.interactStatic;t.snappers=te(t.snappers||{},sl),t.createSnapGrid=t.snappers.grid}},cl=al,ll={start:function(n){var t=n.state,o=n.rect,s=n.edges,l=n.pageCoords,f=t.options,p=f.ratio,h=f.enabled,v=t.options,S=v.equalDelta,y=v.modifiers;p==="preserve"&&(p=o.width/o.height),t.startCoords=te({},l),t.startRect=te({},o),t.ratio=p,t.equalDelta=S;var C=t.linkedEdges={top:s.top||s.left&&!s.bottom,left:s.left||s.top&&!s.right,bottom:s.bottom||s.right&&!s.top,right:s.right||s.bottom&&!s.left};if(t.xIsPrimaryAxis=!(!s.left&&!s.right),t.equalDelta){var M=(C.left?1:-1)*(C.top?1:-1);t.edgeSign={x:M,y:M}}else t.edgeSign={x:C.left?-1:1,y:C.top?-1:1};if(h!==!1&&te(s,C),y!=null&&y.length){var Y=new Nr(n.interaction);Y.copyFrom(n.interaction.modification),Y.prepareStates(y),t.subModification=Y,Y.startAll(a({},n))}},set:function(n){var t=n.state,o=n.rect,s=n.coords,l=t.linkedEdges,f=te({},s),p=t.equalDelta?ul:fl;if(te(n.edges,l),p(t,t.xIsPrimaryAxis,s,o),!t.subModification)return null;var h=te({},o);Me(l,h,{x:s.x-f.x,y:s.y-f.y});var v=t.subModification.setAll(a(a({},n),{},{rect:h,edges:l,pageCoords:s,prevCoords:s,prevRect:h})),S=v.delta;return v.changed&&(p(t,Math.abs(S.x)>Math.abs(S.y),v.coords,v.rect),te(s,v.coords)),v.eventProps},defaults:{ratio:"preserve",equalDelta:!1,modifiers:[],enabled:!1}};function ul(n,t,o){var s=n.startCoords,l=n.edgeSign;t?o.y=s.y+(o.x-s.x)*l.y:o.x=s.x+(o.y-s.y)*l.x}function fl(n,t,o,s){var l=n.startRect,f=n.startCoords,p=n.ratio,h=n.edgeSign;if(t){var v=s.width/p;o.y=f.y+(v-l.height)*h.y}else{var S=s.height*p;o.x=f.x+(S-l.width)*h.x}}var dl=Qe(ll,"aspectRatio"),zi=function(){};zi._defaults={};var kn=zi;function it(n,t,o){return E.func(n)?Pe(n,t.interactable,t.element,[o.x,o.y,t]):Pe(n,t.interactable,t.element)}var On={start:function(n){var t=n.rect,o=n.startOffset,s=n.state,l=n.interaction,f=n.pageCoords,p=s.options,h=p.elementRect,v=te({left:0,top:0,right:0,bottom:0},p.offset||{});if(t&&h){var S=it(p.restriction,l,f);if(S){var y=S.right-S.left-t.width,C=S.bottom-S.top-t.height;y<0&&(v.left+=y,v.right+=y),C<0&&(v.top+=C,v.bottom+=C)}v.left+=o.left-t.width*h.left,v.top+=o.top-t.height*h.top,v.right+=o.right-t.width*(1-h.right),v.bottom+=o.bottom-t.height*(1-h.bottom)}s.offset=v},set:function(n){var t=n.coords,o=n.interaction,s=n.state,l=s.options,f=s.offset,p=it(l.restriction,o,t);if(p){var h=(function(v){return!v||"left"in v&&"top"in v||((v=te({},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})(p);t.x=Math.max(Math.min(h.right-f.right,t.x),h.left+f.left),t.y=Math.max(Math.min(h.bottom-f.bottom,t.y),h.top+f.top)}},defaults:{restriction:null,elementRect:null,offset:null,endOnly:!1,enabled:!1}},pl=Qe(On,"restrict"),Li={top:1/0,left:1/0,bottom:-1/0,right:-1/0},Fi={top:-1/0,left:-1/0,bottom:1/0,right:1/0};function Di(n,t){for(var o=0,s=["top","left","bottom","right"];o<s.length;o++){var l=s[o];l in n||(n[l]=t[l])}return n}var At={noInner:Li,noOuter:Fi,start:function(n){var t,o=n.interaction,s=n.startOffset,l=n.state,f=l.options;f&&(t=Ce(it(f.offset,o,o.coords.start.page))),t=t||{x:0,y:0},l.offset={top:t.y+s.top,left:t.x+s.left,bottom:t.y-s.bottom,right:t.x-s.right}},set:function(n){var t=n.coords,o=n.edges,s=n.interaction,l=n.state,f=l.offset,p=l.options;if(o){var h=te({},t),v=it(p.inner,s,h)||{},S=it(p.outer,s,h)||{};Di(v,Li),Di(S,Fi),o.top?t.y=Math.min(Math.max(S.top+f.top,h.y),v.top+f.top):o.bottom&&(t.y=Math.max(Math.min(S.bottom+f.bottom,h.y),v.bottom+f.bottom)),o.left?t.x=Math.min(Math.max(S.left+f.left,h.x),v.left+f.left):o.right&&(t.x=Math.max(Math.min(S.right+f.right,h.x),v.right+f.right))}},defaults:{inner:null,outer:null,offset:null,endOnly:!1,enabled:!1}},hl=Qe(At,"restrictEdges"),gl=te({get elementRect(){return{top:0,left:0,bottom:1,right:1}},set elementRect(n){}},On.defaults),ml=Qe({start:On.start,set:On.set,defaults:gl},"restrictRect"),vl={width:-1/0,height:-1/0},yl={width:1/0,height:1/0},bl=Qe({start:function(n){return At.start(n)},set:function(n){var t=n.interaction,o=n.state,s=n.rect,l=n.edges,f=o.options;if(l){var p=Ve(it(f.min,t,n.coords))||vl,h=Ve(it(f.max,t,n.coords))||yl;o.options={endOnly:f.endOnly,inner:te({},At.noInner),outer:te({},At.noOuter)},l.top?(o.options.inner.top=s.bottom-p.height,o.options.outer.top=s.bottom-h.height):l.bottom&&(o.options.inner.bottom=s.top+p.height,o.options.outer.bottom=s.top+h.height),l.left?(o.options.inner.left=s.right-p.width,o.options.outer.left=s.right-h.width):l.right&&(o.options.inner.right=s.left+p.width,o.options.outer.right=s.left+h.width),At.set(n),o.options=f}},defaults:{min:null,max:null,endOnly:!1,enabled:!1}},"restrictSize"),Or={start:function(n){var t,o=n.interaction,s=n.interactable,l=n.element,f=n.rect,p=n.state,h=n.startOffset,v=p.options,S=v.offsetWithOrigin?(function(M){var Y=M.interaction.element,B=Ce(Pe(M.state.options.origin,null,null,[Y])),U=B||Ye(M.interactable,Y,M.interaction.prepared.name);return U})(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=Pe(v.offset,s,l,[o]);(t=Ce(y)||{x:0,y:0}).x+=S.x,t.y+=S.y}var C=v.relativePoints;p.offsets=f&&C&&C.length?C.map((function(M,Y){return{index:Y,relativePoint:M,x:h.left-f.width*M.x+t.x,y:h.top-f.height*M.y+t.y}})):[{index:0,relativePoint:null,x:t.x,y:t.y}]},set:function(n){var t=n.interaction,o=n.coords,s=n.state,l=s.options,f=s.offsets,p=Ye(t.interactable,t.element,t.prepared.name),h=te({},o),v=[];l.offsetWithOrigin||(h.x-=p.x,h.y-=p.y);for(var S=0,y=f;S<y.length;S++)for(var C=y[S],M=h.x-C.x,Y=h.y-C.y,B=0,U=l.targets.length;B<U;B++){var ae=l.targets[B],ie=void 0;(ie=E.func(ae)?ae(M,Y,t._proxy,C,B):ae)&&v.push({x:(E.number(ie.x)?ie.x:M)+C.x,y:(E.number(ie.y)?ie.y:Y)+C.y,range:E.number(ie.range)?ie.range:l.range,source:ae,index:B,offset:C})}for(var fe={target:null,inRange:!1,distance:0,range:0,delta:{x:0,y:0}},ye=0;ye<v.length;ye++){var xe=v[ye],he=xe.range,be=xe.x-h.x,je=xe.y-h.y,Te=Ct(be,je),ze=Te<=he;he===1/0&&fe.inRange&&fe.range!==1/0&&(ze=!1),fe.target&&!(ze?fe.inRange&&he!==1/0?Te/he<fe.distance/fe.range:he===1/0&&fe.range!==1/0||Te<fe.distance:!fe.inRange&&Te<fe.distance)||(fe.target=xe,fe.distance=Te,fe.range=he,fe.inRange=ze,fe.delta.x=be,fe.delta.y=je)}return fe.inRange&&(o.x=fe.target.x,o.y=fe.target.y),s.closest=fe,fe},defaults:{range:1/0,targets:null,offset:null,offsetWithOrigin:!0,origin:null,relativePoints:null,endOnly:!1,enabled:!1}},wl=Qe(Or,"snap"),Pn={start:function(n){var t=n.state,o=n.edges,s=t.options;if(!o)return null;n.state={options:{targets:null,relativePoints:[{x:o.left?0:1,y:o.top?0:1}],offset:s.offset||"self",origin:{x:0,y:0},range:s.range}},t.targetFields=t.targetFields||[["width","height"],["x","y"]],Or.start(n),t.offsets=n.state.offsets,n.state=t},set:function(n){var t=n.interaction,o=n.state,s=n.coords,l=o.options,f=o.offsets,p={x:s.x-f[0].x,y:s.y-f[0].y};o.options=te({},l),o.options.targets=[];for(var h=0,v=l.targets||[];h<v.length;h++){var S=v[h],y=void 0;if(y=E.func(S)?S(p.x,p.y,t):S){for(var C=0,M=o.targetFields;C<M.length;C++){var Y=M[C],B=Y[0],U=Y[1];if(B in y||U in y){y.x=y[B],y.y=y[U];break}}o.options.targets.push(y)}}var ae=Or.set(n);return o.options=l,ae},defaults:{range:1/0,targets:null,offset:null,endOnly:!1,enabled:!1}},xl=Qe(Pn,"snapSize"),Pr={aspectRatio:dl,restrictEdges:hl,restrict:pl,restrictRect:ml,restrictSize:bl,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:te(ut(Pn.defaults),{targets:void 0,range:void 0,offset:{x:0,y:0}})},"snapEdges"),snap:wl,snapSize:xl,spring:kn,avoid:kn,transform:kn,rubberband:kn},El={id:"modifiers",install:function(n){var t=n.interactStatic;for(var o in n.usePlugin(xi),n.usePlugin(cl),t.modifiers=Pr,Pr){var s=Pr[o],l=s._defaults,f=s._methods;l._methods=f,n.defaults.perAction[o]=l}}},Nl=El,Vi=(function(n){b(o,n);var t=A(o);function o(s,l,f,p,h,v){var S;if(u(this,o),bn(P(S=t.call(this,h)),f),f!==l&&bn(P(S),l),S.timeStamp=v,S.originalEvent=f,S.type=s,S.pointerId=kt(l),S.pointerType=ri(l),S.target=p,S.currentTarget=null,s==="tap"){var y=h.getPointerIndex(l);S.dt=S.timeStamp-h.pointers[y].downTime;var C=S.timeStamp-h.tapTime;S.double=!!h.prevTap&&h.prevTap.type!=="doubletap"&&h.prevTap.target===S.target&&C<500}else s==="doubletap"&&(S.dt=l.timeStamp-h.tapTime,S.double=!0);return S}return g(o,[{key:"_subtractOrigin",value:function(s){var l=s.x,f=s.y;return this.pageX-=l,this.pageY-=f,this.clientX-=l,this.clientY-=f,this}},{key:"_addOrigin",value:function(s){var l=s.x,f=s.y;return this.pageX+=l,this.pageY+=f,this.clientX+=l,this.clientY+=f,this}},{key:"preventDefault",value:function(){this.originalEvent.preventDefault()}}]),o})(En),Mt={id:"pointer-events/base",before:["inertia","modifiers","auto-start","actions"],install:function(n){n.pointerEvents=Mt,n.defaults.actions.pointerEvents=Mt.defaults,te(n.actions.phaselessTypes,Mt.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,s=n.pointer,l=n.event,f=n.eventTarget;n.duplicate||o.pointerIsDown&&!o.pointerWasMoved||(o.pointerIsDown&&Ir(n),qe({interaction:o,pointer:s,event:l,eventTarget:f,type:"move"},t))},"interactions:down":function(n,t){(function(o,s){for(var l=o.interaction,f=o.pointer,p=o.event,h=o.eventTarget,v=o.pointerIndex,S=l.pointers[v].hold,y=de(h),C={interaction:l,pointer:f,event:p,eventTarget:h,type:"hold",targets:[],path:y,node:null},M=0;M<y.length;M++){var Y=y[M];C.node=Y,s.fire("pointerEvents:collect-targets",C)}if(C.targets.length){for(var B=1/0,U=0,ae=C.targets;U<ae.length;U++){var ie=ae[U].eventable.options.holdDuration;ie<B&&(B=ie)}S.duration=B,S.timeout=setTimeout((function(){qe({interaction:l,eventTarget:h,pointer:f,event:p,type:"hold"},s)}),B)}})(n,t),qe(n,t)},"interactions:up":function(n,t){Ir(n),qe(n,t),(function(o,s){var l=o.interaction,f=o.pointer,p=o.event,h=o.eventTarget;l.pointerWasMoved||qe({interaction:l,eventTarget:h,pointer:f,event:p,type:"tap"},s)})(n,t)},"interactions:cancel":function(n,t){Ir(n),qe(n,t)}},PointerEvent:Vi,fire:qe,collectEventTargets:Bi,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,s=n.pointer,l=n.event,f=n.eventTarget,p=n.type,h=n.targets,v=h===void 0?Bi(n,t):h,S=new Vi(p,s,l,f,o,t.now());t.fire("pointerEvents:new",{pointerEvent:S});for(var y={interaction:o,pointer:s,event:l,eventTarget:f,targets:v,type:p,pointerEvent:S},C=0;C<v.length;C++){var M=v[C];for(var Y in M.props||{})S[Y]=M.props[Y];var B=Ye(M.eventable,M.node);if(S._subtractOrigin(B),S.eventable=M.eventable,S.currentTarget=M.node,M.eventable.fire(S),S._addOrigin(B),S.immediatePropagationStopped||S.propagationStopped&&C+1<v.length&&v[C+1].node!==S.currentTarget)break}if(t.fire("pointerEvents:fired",y),p==="tap"){var U=S.double?qe({interaction:o,pointer:s,event:l,eventTarget:f,type:"doubletap"},t):S;o.prevTap=U,o.tapTime=U.timeStamp}return S}function Bi(n,t){var o=n.interaction,s=n.pointer,l=n.event,f=n.eventTarget,p=n.type,h=o.getPointerIndex(s),v=o.pointers[h];if(p==="tap"&&(o.pointerWasMoved||!v||v.downTarget!==f))return[];for(var S=de(f),y={interaction:o,pointer:s,event:l,eventTarget:f,type:p,path:S,targets:[],node:null},C=0;C<S.length;C++){var M=S[C];y.node=M,t.fire("pointerEvents:collect-targets",y)}return p==="hold"&&(y.targets=y.targets.filter((function(Y){var B,U;return Y.eventable.options.holdDuration===((B=o.pointers[h])==null||(U=B.hold)==null?void 0:U.duration)}))),y.targets}function Ir(n){var t=n.interaction,o=n.pointerIndex,s=t.pointers[o].hold;s&&s.timeout&&(clearTimeout(s.timeout),s.timeout=null)}var Sl=Object.freeze({__proto__:null,default:Mt});function Tl(n){var t=n.interaction;t.holdIntervalHandle&&(clearInterval(t.holdIntervalHandle),t.holdIntervalHandle=null)}var _l={id:"pointer-events/holdRepeat",install:function(n){n.usePlugin(Mt);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)]=Tl,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,s=n.pointerEvent,l=n.eventTarget,f=n.targets;if(s.type==="hold"&&f.length){var p=f[0].eventable.options.holdRepeatInterval;p<=0||(o.holdIntervalHandle=setTimeout((function(){t.pointerEvents.fire({interaction:o,eventTarget:l,type:"hold",pointer:s,event:s},t)}),p))}}})},Cl=_l,kl={id:"pointer-events/interactableTargets",install:function(n){var t=n.Interactable;t.prototype.pointerEvents=function(s){return te(this.events.options,s),this};var o=t.prototype._backCompatOption;t.prototype._backCompatOption=function(s,l){var f=o.call(this,s,l);return f===this&&(this.events.options[s]=l),f}},listeners:{"pointerEvents:collect-targets":function(n,t){var o=n.targets,s=n.node,l=n.type,f=n.eventTarget;t.interactables.forEachMatch(s,(function(p){var h=p.events,v=h.options;h.types[l]&&h.types[l].length&&p.testIgnoreAllow(v,s,f)&&o.push({node:s,eventable:h,props:{interactable:p}})}))},"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,s=n.options;te(o.events.options,t.pointerEvents.defaults),te(o.events.options,s.pointerEvents||{})}}},Ol=kl,Pl={id:"pointer-events",install:function(n){n.usePlugin(Sl),n.usePlugin(Cl),n.usePlugin(Ol)}},Il=Pl,Rl={id:"reflow",install:function(n){var t=n.Interactable;n.actions.phases.reflow=!0,t.prototype.reflow=function(o){return(function(s,l,f){for(var p=s.getAllElements(),h=f.window.Promise,v=h?[]:null,S=function(){var C=p[y],M=s.getRect(C);if(!M)return 1;var Y,B=Pt(f.interactions.list,(function(ie){return ie.interacting()&&ie.interactable===s&&ie.element===C&&ie.prepared.name===l.name}));if(B)B.move(),v&&(Y=B._reflowPromise||new h((function(ie){B._reflowResolve=ie})));else{var U=Ve(M),ae=(function(ie){return{coords:ie,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:U.x,y:U.y},client:{x:U.x,y:U.y},timeStamp:f.now()});Y=(function(ie,fe,ye,xe,he){var be=ie.interactions.new({pointerType:"reflow"}),je={interaction:be,event:he,pointer:he,eventTarget:ye,phase:"reflow"};be.interactable=fe,be.element=ye,be.prevEvent=he,be.updatePointer(he,he,ye,!0),qo(be.coords.delta),br(be.prepared,xe),be._doPhase(je);var Te=ie.window,ze=Te.Promise,Le=ze?new ze((function(Ge){be._reflowResolve=Ge})):void 0;return be._reflowPromise=Le,be.start(xe,fe,ye),be._interacting?(be.move(je),be.end(he)):(be.stop(),be._reflowResolve()),be.removePointer(he,he),Le})(f,s,C,l,ae)}v&&v.push(Y)},y=0;y<p.length&&!S();y++);return v&&h.all(v).then((function(){return s}))})(this,o,n)}},listeners:{"interactions:stop":function(n,t){var o=n.interaction;o.pointerType==="reflow"&&(o._reflowResolve&&o._reflowResolve(),(function(s,l){s.splice(s.indexOf(l),1)})(t.interactions.list,o))}}},jl=Rl;if(Re.use(wi),Re.use(_i),Re.use(Il),Re.use(Zc),Re.use(Nl),Re.use(Fc),Re.use(Cc),Re.use(Oc),Re.use(jl),Re.default=Re,c(e)==="object"&&e)try{e.exports=Re}catch{}return Re.default=Re,Re}))})(Vt)),Vt.exports}var ss=is();const as=Rr(ss);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],[i])=>r.localeCompare(i))):""}function Jr(e,{isEnabled:r=!0,onDragStart:i,onDragMove:a,onDragEnd:c,...u}){const d=Ee(i),g=Ee(a),m=Ee(c);T.useLayoutEffect(()=>{if(!r)return;const b=e.current;if(!b)return;const k=as(b).draggable({inertia:!0,...u,onstart:({client:_})=>{const P=Se.make(_);d.current?.(P)},onmove:({client:_,clientX0:P,clientY0:A,dx:z,dy:N})=>{const R=Se.make(P,A),ne=Se.make(_),$=Se.make(z,N);g.current?.($,ne,R)},onend:({client:_,clientX0:P,clientY0:A})=>{const z=Se.make(P,A),N=Se.make(_);m.current?.(N,z)}});return()=>{k.unset(),m.current?.(Se.zero,Se.zero)}},[r,Fe(u)])}function st(e,{initialValue:r,transform:i,onDragStart:a,onDragMove:c,onDragEnd:u,...d}){const g=T.useRef(r),[m,b]=T.useState(!1),[k,_]=T.useState(!1),[P,A]=T.useState(r),z=Ee(a),N=Ee(c),R=Ee(u),ne=Ee(i);return Jr(e,{onDragStart:x=>{b(!0),_(!1),z.current?.(x)},onDragMove:(x,O,E)=>{const F=ne.current(g.current,x.x,x.y);Zr(g,F)&&A(F),b(!0),_(!1),N.current?.(x,O,E)},onDragEnd:(x,O)=>{b(!1),_(!0),R.current?.(x,O)},...d}),T.useEffect(()=>{Zr(g,P)},[P]),{isDragging:m,isReleasing:k,value:P,setValue:A}}function Zr(e,r){return He(e.current,r)?!1:(e.current=r,!0)}const Un=T.forwardRef(({angle:e=0,speed:r=1,src:i,zeroAnchor:a=0,onAngleChange:c,onPositionChange:u,onDragStart:d,onDragEnd:g,onLoadImageStart:m,onLoadImageComplete:b,onLoadImageError:k,onImageSizeChange:_,...P},A)=>{const z=T.useCallback((F,G,Q)=>F-G*r,[r]),N=T.useRef(null),R=Be(N),ne=jn({src:i},{onLoadStart:m,onLoadComplete:b,onLoadError:k}),[$,L]=T.useState(e),{isDragging:K,value:x,setValue:O}=st(N,{initialValue:0,transform:z,onDragStart:d,onDragEnd:g});T.useEffect(()=>{if(K||!ne)return;const F=ls(e,ne,we.size(R),a);F!==x&&O(F),e!==$&&L(e)},[e,ne,R.width,R.height,a]),T.useEffect(()=>{if(!K||!ne)return;const F=us(x,ne,we.size(R),a);$!==F&&L(F)},[x,ne,R.width,R.height,a]),T.useEffect(()=>{c?.($,K),u?.($/360,K)},[$]),T.useEffect(()=>{_?.(ne)},[ne?.width,ne?.height]);const E=cs({src:i,displacement:x});return w.jsx("div",{...P,ref:A,"aria-valuenow":$,role:"slider",children:w.jsx("div",{ref:N,style:E.body})})});function cs({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 Qr(e,r){const{width:i,height:a}=e,{height:c}=r;if(a<=0)return Oe.zero;const d=c/a*i;return Oe.make(d,c)}function ls(e,r,i,a){const{width:c}=Qr(r,i),{width:u}=i,d=u*a;return e/360*c-d}function us(e,r,i,a){const{width:c}=Qr(r,i),{width:u}=i,d=u*a;let g=(e+d)%c/c*360;for(;g<0;)g+=360;return g}process.env.NODE_ENV==="development"&&(Un.displayName="Panorama");const $r=T.forwardRef(({className:e,style:r,angle:i=0,autoDimension:a="width",children:c,fov:u,speed:d=1,src:g,viewportSize:m,zeroAnchor:b=0,onAngleChange:k,onDragEnd:_,onDragStart:P,onLoadImageComplete:A,onLoadImageError:z,onLoadImageStart:N,onImageSizeChange:R,onPositionChange:ne,...$},L)=>{const K=T.useRef(null),x=Be(K),[O,E]=T.useState(),[F,G]=T.useState(!1),se=T.useCallback(()=>{if(!O)return 0;const{width:D,height:I}=O;return I===0?0:D/I},[O?.width,O?.height])(),W=T.useCallback(()=>{const D=Math.min(360,Math.max(0,u??(m?m.width/(m.height*se)*360:0)));return x.width*(D/360)},[m?.width,m?.height,se,x.width,u])(),V=T.useCallback(()=>x.width<=0?b:((x.width-W)*.5+b*W)/x.width,[x.width,W,b])(),re=T.useCallback(()=>{G(!0),P?.()},[P]),oe=T.useCallback(()=>{G(!1),_?.()},[_]),le=ke(c,{track:mt,reticle:Ht,indicator:Bt}),H=fs({autoDimension:a,panoramaRect:x,aspectRatio:se,reticleWidth:W});return w.jsxs("div",{...$,ref:L,className:ce(e,{dragging:F}),style:ue(r,H.root),children:[w.jsx(Un,{ref:K,angle:i,speed:d,src:g,style:H.panorama,zeroAnchor:V,onAngleChange:k,onDragEnd:oe,onDragStart:re,onImageSizeChange:E,onLoadImageComplete:A,onLoadImageError:z,onLoadImageStart:N,onPositionChange:ne}),w.jsx("div",{style:H.body,children:w.jsxs("div",{style:H.controls,children:[w.jsx(me,{className:ce({dragging:F}),element:le.track??w.jsx(mt,{}),style:H.track}),w.jsx(me,{className:ce({dragging:F}),element:le.reticle??w.jsx(Ht,{}),style:H.reticle}),w.jsx(me,{className:ce({dragging:F}),element:le.track??w.jsx(mt,{}),style:H.track})]})}),w.jsx(me,{className:ce({dragging:F}),element:le.indicator??w.jsx(Bt,{}),style:H.indicator})]})}),Bt=({...e})=>w.jsx("div",{...e}),Ht=({...e})=>w.jsx("div",{...e}),mt=({...e})=>w.jsx("div",{...e});function fs({autoDimension:e="width",panoramaRect:r=we.zero,aspectRatio:i=0,reticleWidth:a=0}){return{root:{...e==="width"?{width:`${r.height*i}px`}:{height:`${r.width/i}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==="development"&&($r.displayName="PanoramaSlider",Bt.displayName="PanoramaSliderIndicator",Ht.displayName="PanoramaSliderReticle",mt.displayName="PanoramaSliderTrack");const qr=T.forwardRef(({children:e,className:r,isDeselectable:i=!1,isDisabled:a=!1,isSelected:c=!1,label:u,onDeselect:d,onSelect:g,onToggle:m,...b},k)=>{const _=()=>{if(!a)if(c){if(!i)return;m?.(c),d?.()}else m?.(c),g?.()};return w.jsx("button",{...b,ref:k,"aria-disabled":a,"aria-label":u,"aria-selected":c,className:ce(r,{active:c,disabled:a||c&&!i}),disabled:a||c&&!i,onClick:_,children:e??u})});process.env.NODE_ENV==="development"&&(qr.displayName="SelectableButton");function eo({children:e,if:r}){switch(typeof r){case"function":return r()?w.jsx(w.Fragment,{children:e}):w.jsx(w.Fragment,{});default:return r?w.jsx(w.Fragment,{children:e}):w.jsx(w.Fragment,{})}}process.env.NODE_ENV==="development"&&(eo.displayName="Conditional");function vt({in:e,children:r,render:i}){if(e==null)return w.jsx(w.Fragment,{});if(!(e instanceof Array))throw TypeError(`Provided list <${e}> is not an array`);return w.jsx(w.Fragment,{children:e.map((a,c)=>w.jsx(T.Fragment,{children:i?.(a,c)??(typeof r=="function"?r(a,c):r)},`item-${c}`))})}process.env.NODE_ENV==="development"&&(vt.displayName="Each");function ds({children:e,condition:r}){const i=T.Children.toArray(e);if(i.length===0)return console.error("[etudes::Switch] `Switch` must have at least one child"),w.jsx(w.Fragment,{});if(!ps(i))return console.error("[etudes::Switch] `Switch` children must be of `Case` type or `Default` type"),w.jsx(w.Fragment,{});const a=i.filter(u=>u.type===Kn);if(a.length>1)return console.error("[etudes::Switch] `Switch` can only have maximum one `Default` child"),w.jsx(w.Fragment,{});const c=a[0];for(const u of i)if(typeof r=="function"){if(r(u.props.value))return u}else if(r===u.props.value)return u;if(c)return c}function to({children:e}){return e}function Kn({children:e}){return e}function ps(e){return e.every(r=>T.isValidElement(r)&&(r.type===to||r.type===Kn))}const Gn=T.forwardRef(({children:e,...r},i)=>(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.`),T.Children.map(e,(a,c)=>{if(!(c>0))return T.isValidElement(a)?Ft(a,{...r,ref:i}):a})));process.env.NODE_ENV==="development"&&(Gn.displayName="ExtractChild");function no({children:e,className:r,style:i,alignment:a,arrowHeight:c=6,arrowWidth:u=12,gap:d=4,hint:g,maxWidth:m=200,threshold:b=100}){const k=T.useRef(null),_=T.useRef(void 0),P=Be(k),A=T.useCallback(()=>{const R=window.document.createElement("span");R.className=ce(r),R.innerHTML=g,R.role="tooltip";const ne=a??(k.current?gs(k.current,b):"tl"),$=hs(R),L=ys({alignment:ne,arrowSize:Oe.make(u,c),gap:d,maxDialogWidth:m,fullDialogWidth:$.width,targetWidth:P.width}),K=ue(i,L.dialog);Object.keys(K).forEach(O=>R.style[O]=K[O]);const x=window.document.createElement("span");return Object.keys(L.arrow).forEach(O=>x.style[O]=L.arrow[O]),R.appendChild(x),R},[r,a,g,m,Fe(i),P.width,b,c,u,d]),z=T.useCallback(()=>{_.current&&(_.current.style.opacity="1",_.current.ariaHidden="false")},[]),N=T.useCallback(()=>{_.current&&(_.current.style.opacity="0",_.current.ariaHidden="true")},[]);return T.useEffect(()=>{const R=A();return k.current?.appendChild(R),_.current=R,()=>{k.current?.removeChild(R),_.current=void 0}},[A]),w.jsx(Gn,{ref:k,onMouseEnter:z,onMouseLeave:N,children:e})}function hs(e){if(typeof window>"u")return Oe.zero;const r=e.cloneNode(!1);r.innerHTML=e.innerHTML,r.style.visibility="hidden",r.style.whiteSpace="pre",window.document.body.appendChild(r);const i=r.getBoundingClientRect();return window.document.body.removeChild(r),Oe.make(i.width,i.height)}function gs(e,r){const i=we.fromViewport(),a=we.intersecting(e);if(a){const c=a.left-i.left<r,u=i.right-a.right<r,d=a.top-i.top<r,g=i.bottom-a.bottom<r;if(c&&d)return"br";if(c&&g)return"tr";if(u&&d)return"bl";if(u&&g)return"tl";if(c)return"cr";if(u)return"cl";if(g)return"tc"}return"tc"}function ms({alignment:e,arrowSize:r,fullDialogWidth:i,gap:a,maxDialogWidth:c,targetWidth:u}){const d=Math.min(i,c),g=u>d;switch(e){case"tl":return{bottom:`calc(100% + ${r.height}px + ${a}px)`,right:g?"":"0",left:g?"50%":"",transform:`translate(${d>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(${d>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(${d>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(${d>u?"0":"-50%"}, 0)`};default:return console.error(`[etudes::WithTooltip] Invalid alignment: ${e}`),{}}}function vs({alignment:e,arrowSize:r,fullDialogWidth:i,maxDialogWidth:a,targetWidth:c}){const u=Math.min(i,a),d=c>u;switch(e){case"tl":return{bottom:0,clipPath:"polygon(50% 100%,100% 0,0 0)",height:`${r.height}px`,left:d?"50%":"",right:d?"":`${c-r.width/2-c/2}px`,transform:`translate(${d?"-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:d?"50%":`${c-r.width/2-c/2}px`,transform:`translate(${d?"-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:d?"50%":"",right:d?"":`${c-r.width/2-c/2}px`,top:"0",transform:`translate(${d?"-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:d?"50%":`${c-r.width/2-c/2}px`,top:"0",transform:`translate(${d?"-50%":"0"}, -100%)`,width:`${r.width}px`};default:return console.error(`[etudes::WithTooltip] Invalid alignment: ${e}`),{}}}function ys({alignment:e,arrowSize:r,fullDialogWidth:i,gap:a,maxDialogWidth:c,targetWidth:u}){return{dialog:{boxSizing:"border-box",height:"auto",margin:"0",opacity:"0",pointerEvents:"none",position:"absolute",userSelect:"none",whiteSpace:i>c?"normal":"pre",width:i>c?`${c}px`:"",...ms({alignment:e,arrowSize:r,fullDialogWidth:i,gap:a,maxDialogWidth:c,targetWidth:u})},arrow:{background:"inherit",position:"absolute",...vs({alignment:e,arrowSize:r,fullDialogWidth:i,maxDialogWidth:c,targetWidth:u})}}}process.env.NODE_ENV==="development"&&(no.displayName="WithTooltip");function bs(){const e=navigator.userAgent||navigator.vendor||window.opera;return T.useMemo(()=>{switch(!0){case/android/i.test(e):return"android";case(/iPad|iPhone|iPod/.test(e)&&!window.MSStream):return"ios";case/win/i.test(e):return"windows";case/mac/i.test(e):return"macos";case/linux/i.test(e):return"linux";default:return"unknown"}},[e])}function ws(e,{element:r,isEnabled:i=!0}={}){T.useLayoutEffect(()=>{if(!i)return;const a=r??window.document.documentElement,c=a.className;return a.classList.add(e),()=>{a.className=c}},[e,r,i])}function xs(e,r){const i=Ee(r);T.useLayoutEffect(()=>{const a=c=>{if(!(c.target instanceof Node))return;let u=!0,d=c.target;const m=[].concat(e).map(b=>b.current);for(;d;){if(m.find(b=>b===d)){u=!1;break}if(!d.parentNode)break;d=d.parentNode}u&&i.current()};return window.addEventListener("click",a,!0),()=>{window.removeEventListener("click",a,!0)}},[])}function Es(){return typeof window>"u"?1:window.devicePixelRatio||1}function Ns(){return T.useMemo(()=>Es(),[])}function ro(e,{isEnabled:r=!0,updatesCursor:i=!0,onDragStart:a,onDragMove:c,onDragEnd:u}){const d=T.useRef(void 0),g=T.useRef(void 0),m=Ee(a),b=Ee(c),k=Ee(u),_=T.useCallback(z=>{if(!d.current)return;const N=Se.make(z.clientX,z.clientY),R=Se.subtract(N,g.current??d.current);g.current=N,b.current?.(R,N,d.current)},[]),P=T.useCallback(z=>{const N=e.current;if(!N||!d.current)return;const R=Se.make(z.clientX,z.clientY),ne=Se.subtract(g.current??d.current,R);k.current?.(R,ne,d.current),d.current=void 0,g.current=void 0,N.removeEventListener("mousemove",_),N.removeEventListener("mouseup",P,{capture:!0}),N.removeEventListener("mouseleave",P),i&&(N.style.cursor="grab")},[i,_]),A=T.useCallback(z=>{const N=e.current;if(!N)return;z.preventDefault();const R=Se.make(z.clientX,z.clientY);d.current=R,g.current=R,N.addEventListener("mousemove",_),N.addEventListener("mouseup",P,{capture:!0}),N.addEventListener("mouseleave",P),i&&(N.style.cursor="grabbing"),m.current?.(R)},[i,_,P]);T.useLayoutEffect(()=>{const z=e.current;if(!z||!r||!i)return;const N=z.style.cursor;return z.style.cursor="grab",()=>{z.style.cursor=N}},[r,i]),T.useLayoutEffect(()=>{const z=e.current;if(!(!z||!r))return z.addEventListener("mousedown",A),()=>{z.removeEventListener("mousedown",A),z.removeEventListener("mousemove",_),z.removeEventListener("mouseup",P,{capture:!0}),z.removeEventListener("mouseleave",P)}},[r,_,P,A])}function Ss(e){const[r,i]=T.useState(!1),a=T.useCallback(d=>{d.preventDefault(),d.stopPropagation(),i(!0)},[]),c=T.useCallback(d=>{d.preventDefault(),d.stopPropagation(),i(!1)},[]),u=T.useCallback(d=>{d.preventDefault(),d.stopPropagation(),i(!1);const g=d.dataTransfer.files;if(g&&g.length>0){const m=g[0];new FormData().append("file",m),e(m)}},[]);return{isDropping:r,onDragOver:a,onDragLeave:c,onDrop:u}}function oo(e,{autoStarts:r=!0,shouldInvokeInitially:i=!1,onInterval:a},c=[]){const u=T.useRef(void 0),d=Ee(a),g=T.useCallback(()=>{clearInterval(u.current),u.current=void 0},[]),m=T.useCallback(()=>{g(),!(e<0)&&(i&&d.current(),u.current=setInterval(()=>{d.current()},e))},[e,i,g]);return T.useEffect(()=>(r&&e>0&&m(),g),[r,e,m,g,...c]),{start:m,stop:g}}function Ts(){const[e,r]=T.useState(!1);return T.useEffect(()=>(r(!0),()=>{r(!1)}),[]),e}function io(){return typeof window>"u"?!1:!!(typeof window.navigator<"u"&&(window.navigator.maxTouchPoints>0||"msMaxTouchPoints"in window.navigator&&window.navigator.msMaxTouchPoints>0)||window.matchMedia("(pointer: coarse)").matches||window.matchMedia("(hover: none)").matches||"ontouchstart"in window||"ontouchstart"in window.document.documentElement)}function so(){return T.useMemo(()=>io(),[])}function _s(e,r){const i=Ee(r);T.useEffect(()=>{const a=c=>{c.key===e&&i.current?.()};return window.addEventListener("keydown",a),()=>{window.removeEventListener("keydown",a)}},[e])}const Wn=typeof window<"u"?window.localStorage:void 0;function ao({defaultTTL:e=300}={}){return{get:ks,invalidate:co,set:(r,i,a=e)=>Os(r,i,a)}}function co(e){Wn?.removeItem(e)}function Cs(e){const{timestamp:r,ttl:i}=e;return(Date.now()-r)/1e3>=i}function ks(e){const r=Wn?.getItem(e);if(!r)return;const i=JSON.parse(r);if(i)if(Cs(i)){co(e);return}else return i.value}function Os(e,r,i){const a={value:e,timestamp:Date.now(),ttl:i};return Wn?.setItem(r,JSON.stringify(a)),e}function Ps(e){return T.useMemo(()=>ao({defaultTTL:e}),[e])}function Is(e,r=[]){const i=Ee(e),a=T.useRef(void 0),c=T.useRef(!1);T.useLayoutEffect(()=>{const u=()=>{const g=Rs();g&&(i.current(g,a.current),a.current=g)},d=()=>{c.current||typeof requestAnimationFrame=="function"&&(c.current=!0,requestAnimationFrame(()=>{u(),c.current=!1}))};return window.addEventListener("scroll",d,{passive:!0}),window.addEventListener("resize",d),window.addEventListener("orientationchange",d),d(),()=>{window.removeEventListener("scroll",d),window.removeEventListener("resize",d),window.removeEventListener("orientationchange",d)}},[...r])}function Rs(){const e=we.fromViewport(),r=we.clone(e,{x:0,y:0}),i=we.from(window,{overflow:!0});if(!i)return;const a=we.clone(r,{x:i.width-e.width,y:i.height-e.height}),c=Se.make(e.left/a.left,e.top/a.top);return{minPos:Se.make(r.left,r.top),maxPos:Se.make(a.left,a.top),pos:Se.make(e.left,e.top),step:c}}function lo(e){const r=T.useRef(void 0);return T.useEffect(()=>{r.current=e},[e]),r.current}const Jn=typeof window<"u"?window.sessionStorage:void 0;function uo({defaultTTL:e=300}={}){return{get:As,invalidate:fo,set:(r,i,a=e)=>Ms(r,i,a)}}function fo(e){Jn?.removeItem(e)}function js(e){const{timestamp:r,ttl:i}=e;return(Date.now()-r)/1e3>=i}function As(e){const r=Jn?.getItem(e);if(!r)return;const i=JSON.parse(r);if(i)if(js(i)){fo(e);return}else return i.value}function Ms(e,r,i){const a={value:e,timestamp:Date.now(),ttl:i};return Jn?.setItem(r,JSON.stringify(a)),e}function zs(e){return T.useMemo(()=>uo({defaultTTL:e}),[e])}function Zn(e){const[r,i]=T.useState(we.zero);return Dt(e,{onResize:a=>{const c=we.from(a);c&&i(c)}}),we.size(r)}function po(e,{element:r,computed:i}){if(typeof window>"u")return;const a=r??window.document.documentElement;return i?window.getComputedStyle(a).getPropertyValue(e)||void 0:a.style.getPropertyValue(e)||void 0}function Qn(e,r,{element:i}={}){if(typeof window>"u")return;const a=i??window.document.documentElement;r===void 0?a.style.removeProperty(e):a.style.setProperty(e,r)}function Ls(e,r,{element:i,isEnabled:a=!0}={}){T.useLayoutEffect(()=>{if(!a)return;const c=i??window.document.documentElement,u=po(e,{element:c,computed:!1});return Qn(e,r,{element:c}),()=>{Qn(e,u,{element:c})}},[e,r,i,a])}function Fs(e,{autoStarts:r=!0,onTimeout:i},a=[]){const c=T.useRef(void 0),u=Ee(i),d=T.useCallback(()=>{c.current!==void 0&&(clearTimeout(c.current),c.current=void 0)},[]),g=T.useCallback(()=>{d(),!(e<0)&&(c.current=setTimeout(()=>{d(),u.current()},e))},[e,d]);return T.useEffect(()=>(r&&e>=0&&g(),d),[r,e,g,d,...a]),{start:g,stop:d}}const Yt=T.forwardRef(({className:e,children:r,style:i,isSelectionTogglable:a=!1,itemLength:c,itemPadding:u=0,items:d=[],layout:g="list",numSegments:m=1,orientation:b="vertical",selection:k,selectionMode:_="none",onActivateAt:P,onDeselectAt:A,onCustomEvent:z,onSelectAt:N,onSelectionChange:R,ItemComponent:ne,...$},L)=>{const K=Vs(k??[],d),x=Bs({itemLength:c,itemPadding:u,layout:g,numSegments:m,orientation:b}),O=W=>K.indexOf(W)>=0,E=W=>{O(W)?G(W):F(W)},F=W=>{if(O(W))return;let X;switch(_){case"multiple":{X=oe=>ho([...oe.filter(le=>le!==W),W]);break}case"single":{X=oe=>[W];break}default:return}const V=K,re=X(K);se(V,re)},G=W=>{if(!O(W))return;const X=oe=>oe.filter(le=>le!==W),V=K,re=X(K);se(V,re)},Q=W=>{P?.(W),_!=="none"&&(a?E(W):F(W))},se=(W,X)=>{if(He(W,X))return;const V=W?.filter(oe=>X.indexOf(oe)===-1)??[],re=X.filter(oe=>W?.indexOf(oe)===-1);V.forEach(oe=>A?.(oe)),re.forEach(oe=>N?.(oe)),R?.(X)};T.useEffect(()=>{const W=K;let X;switch(_){case"multiple":X=K;break;case"single":X=K.slice(-1);break;default:X=[];break}se(W,X)},[_]);const ee=ke(r,{item:at});return w.jsx("div",{...$,ref:L,"aria-multiselectable":_==="multiple",className:ce(e),role:g==="grid"?"grid":_==="none"?"list":"listbox",style:ue(i,x.root),children:w.jsx(vt,{in:d,children:(W,X)=>{const V=g==="grid"?"gridcell":_==="none"?"listitem":"option",re=O(X),oe=ue(x.item,{pointerEvents:a!==!0&&O(X)?"none":"auto",...X>=d.length-1?{}:{...g==="list"?{...b==="vertical"?{marginBottom:`${u}px`}:{marginRight:`${u}px`}}:{}}});return ne?w.jsx(ne,{"aria-selected":re,className:ce({active:re}),index:X,isSelected:O(X),item:W,orientation:b,role:V,style:oe,onClick:()=>Q(X),onCustomEvent:(le,H)=>z?.(X,le,H)}):w.jsx(me,{"aria-selected":re,className:ce({active:re}),element:ee.item??w.jsx(at,{}),role:V,selectionMode:_,style:oe,onActivateAt:P,onClick:()=>Q(X),children:`${W}`})}})})}),at=({children:e,selectionMode:r,onActivateAt:i,...a})=>i||r==="single"||r==="multiple"?w.jsx("button",{...a,children:e}):w.jsx("div",{...a,children:e});function Ds(e,r){return!!(isNaN(e)||e>=r.length||e<0)}function Vs(e,r){return ho(e).filter(i=>!Ds(i,r))}function ho(e){return e.sort((r,i)=>r-i)}function Bs({itemLength:e=NaN,itemPadding:r=0,layout:i="collection",numSegments:a=1,orientation:c="vertical"}){return{root:{counterReset:"item-counter",listStyle:"none",...i==="list"?{alignItems:"flex-start",display:"flex",flex:"0 0 auto",flexDirection:c==="horizontal"?"row":"column",justifyContent:"flex-start"}:{display:"grid",gap:`${r}px`,...c==="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",...i==="list"?{...c==="vertical"?{width:"100%",height:isNaN(e)?void 0:`${e}px`}:{width:isNaN(e)?void 0:`${e}px`,height:"100%"}}:{}}}}process.env.NODE_ENV==="development"&&(Yt.displayName="Collection",at.displayName="CollectionItem");const go=T.forwardRef(({children:e,style:r,autoCollapseSections:i=!1,expandedSectionIndices:a,orientation:c="vertical",sectionPadding:u=0,sections:d,selection:g,selectionMode:m="single",onActivateAt:b,onCollapseSectionAt:k,onDeselectAt:_,onExpandedSectionsChange:P,onExpandSectionAt:A,onHeaderCustomEvent:z,onItemCustomEvent:N,onSelectAt:R,onSelectionChange:ne,HeaderComponent:$,ItemComponent:L,...K},x)=>{const O=Xs(g??{},d),E=Ys(a??[],d),F=Us({orientation:c}),G=d.map(()=>T.useRef(null)),Q=G.map(H=>Zn(H)),se=(H,D)=>(O[D]?.indexOf(H)??-1)>=0,ee=H=>E.indexOf(H)>=0,W=H=>{let D;ee(H)?D=I=>I.filter(J=>J!==H):i?D=I=>[H]:D=I=>[...I.filter(J=>J!==H),H],re(E,D(E))},X=(H,D)=>{if(se(H,D))return;let I;switch(m){case"multiple":I=q=>({...q,[D]:Kt([...(q[D]??[]).filter(Z=>Z!==H),H])});break;case"single":I=q=>({[D]:[H]});break;default:return}const J=I(O);oe(O,J)},V=(H,D)=>{if(!se(H,D))return;const J=(q=>({...q,[D]:(q[D]??[]).filter(Z=>Z!==H)}))(O);oe(O,J)},re=(H,D)=>{if(He(H,D))return;const I=H?.filter(q=>D.indexOf(q)===-1)??[],J=D.filter(q=>H?.indexOf(q)===-1);I.forEach(q=>k?.(q)),J.forEach(q=>A?.(q)),P?.(D)},oe=(H,D)=>{if(He(H,D))return;const I=d.length;let J=[],q=[];for(let Z=0;Z<I;Z++){const pe=H?.[Z]??[],ve=D[Z]??[],de=pe.filter(te=>ve.indexOf(te)===-1),Ne=ve.filter(te=>pe?.indexOf(te)===-1);J=[...J,...de.map(te=>[te,Z])],q=[...q,...Ne.map(te=>[te,Z])]}J.forEach(Z=>_?.(Z[0],Z[1])),q.forEach(Z=>R?.(Z[0],Z[1])),ne?.(D)},le=ke(e,{collapseIcon:qn,expandIcon:$n,header:Xt,item:Ut,section:er});return w.jsx("div",{...K,ref:x,style:ue(r,F.root),children:w.jsx(vt,{in:d,children:(H,D)=>{const{collectionPadding:I=0,items:J=[],itemLength:q=50,itemPadding:Z=0,isSelectionTogglable:pe,layout:ve="list",maxVisible:de=-1,numSegments:Ne=1}=H,te=ve==="list"?J.length:Math.ceil(J.length/Ne),De=de<0?te:Math.min(te,de),Pe=q*De+Z*(De-1),Ce=!ee(D),Ve=Q[D];return w.jsxs(me,{element:le.section??w.jsx(er,{}),style:ue(F.section,c==="vertical"?{marginTop:D===0?"0px":`${u}px`,...Ve.height>0?{height:Ce?`${Ve.height}px`:`${Pe+Ve.height+I}px`}:{visibility:"hidden"}}:{marginLeft:D===0?"0px":`${u}px`,...Ve.width>0?{width:Ce?`${Ve.width}px`:`${Pe+Ve.width+I}px`}:{visibility:"hidden"}}),children:[w.jsx("div",{ref:G[D],style:ue(F.headerContainer),children:$?w.jsx($,{"aria-expanded":!Ce,className:ce({collapsed:Ce,expanded:!Ce}),index:D,isCollapsed:Ce,role:"button",section:H,style:ue(F.header),onClick:()=>W(D),onCustomEvent:(Me,Ye)=>z?.(D,Me,Ye)}):w.jsxs(me,{"aria-expanded":!Ce,className:ce({collapsed:Ce,expanded:!Ce}),element:le.header??w.jsx(Xt,{}),role:"button",style:ue(F.header),onClick:()=>W(D),children:[w.jsx("span",{dangerouslySetInnerHTML:{__html:H.label}}),le.expandIcon&&w.jsx(me,{className:ce({collapsed:Ce,expanded:!Ce}),element:Ce?le.collapseIcon??le.expandIcon:le.expandIcon,style:ue(Ce?F.collapseIcon:F.expandIcon)})]})}),w.jsx("div",{role:"region",style:ue({pointerEvents:Ce?"none":"auto"},c==="vertical"?{width:"100%",height:`${Pe}px`,marginTop:`${I}px`,overflowY:de<0||de>=te?"hidden":"scroll"}:{marginLeft:`${I}px`,overflowX:de<0||de>=te?"hidden":"scroll",width:`${Pe}px`,height:"100%"}),children:w.jsx(Yt,{className:ce({collapsed:Ce,expanded:!Ce}),isSelectionTogglable:pe,ItemComponent:L,itemLength:q,itemPadding:Z,items:J,layout:ve,numSegments:Ne,orientation:c,selection:O[D]??[],selectionMode:m,style:ue(c==="vertical"?{width:"100%"}:{height:"100%"}),onActivateAt:Me=>b?.(Me,D),onCustomEvent:(Me,Ye,Xe)=>N?.(Me,D,Ye,Xe),onDeselectAt:Me=>V(Me,D),onSelectAt:Me=>X(Me,D),children:!L&&(le.item??w.jsx(Ut,{}))})})]})}})})}),Xt=({children:e,...r})=>w.jsx("button",{...r,children:e}),$n=({children:e,...r})=>w.jsx("figure",{...r,children:e}),qn=({children:e,...r})=>w.jsx("figure",{...r,children:e}),er=({children:e,...r})=>w.jsx("div",{...r,children:e}),Ut=at;function mo(e,r){return e>=r.length||e<0}function Hs(e,r,i){if(mo(r,i))return!0;const a=i[r].items??[];return e>=a.length||e<0}function Ys(e,r){return Kt(e).filter(i=>!mo(i,r))}function Xs(e,r){const i={};for(const a in r){if(!Object.hasOwn(r,a))continue;const c=Kt([...e[a]??[]]);i[Number(a)]=Kt(c).filter(u=>!Hs(u,Number(a),r))}return i}function Kt(e){return e.sort((r,i)=>r-i)}function Us({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==="development"&&(go.displayName="Accordion",Xt.displayName="AccordionHeader",$n.displayName="AccordionExpandIcon",qn.displayName="AccordionCollapseIcon",Ut.displayName="AccordionItem");const vo=T.forwardRef(({autoAdvanceInterval:e=0,index:r=0,isDragEnabled:i=!0,items:a=[],orientation:c="horizontal",tracksItemExposure:u=!1,onAutoAdvancePause:d,onAutoAdvanceResume:g,onIndexChange:m,ItemComponent:b,...k},_)=>{const P=T.useRef(void 0),A=T.useRef(null),z=T.useRef(void 0),N=T.useRef(void 0),R=T.useRef(void 0),ne=1e3,$=Ee(d),L=Ee(g),K=Ee(m),x=T.useRef(!1),O=T.useRef(!1),E=so(),[F,G]=T.useState(yo(A,c)),[Q,se]=T.useState(!1),ee=Ws({scrollSnapEnabled:E||!Q,orientation:c}),W=e>0,X=T.useCallback(()=>{R.current!==void 0&&(clearTimeout(R.current),R.current=void 0)},[]),V=T.useCallback(()=>{X(),R.current=setTimeout(()=>{clearTimeout(R.current),R.current=void 0},ne)},[ne,X]),re=T.useCallback(()=>{Ks(A,r,c),V()},[r,c]),oe=T.useCallback(()=>{G(yo(A,c))},[c]),le=T.useCallback(Z=>{E||(z.current=Se.make(Z.clientX,Z.clientY),se(!0))},[E]),H=T.useCallback(Z=>{E||(N.current=Se.make(Z.clientX,Z.clientY),re(),se(!1))},[E,re]),D=T.useCallback(Z=>{const pe=z.current,ve=N.current;if(!pe||!ve)return;const de=5,Ne=Se.subtract(pe,ve);(Math.abs(Ne.x)>de||Math.abs(Ne.y)>de)&&Z.stopPropagation(),z.current=void 0,N.current=void 0},[]),I=T.useCallback(()=>{const Z=(r+a.length+1)%a.length;K.current?.(Z)},[Q,r,a.length]),J=T.useCallback(({x:Z,y:pe})=>{const ve=A.current;!ve||x.current||(X(),x.current=!0,requestAnimationFrame(()=>{switch(c){case"horizontal":ve.scrollLeft-=Z*1.5;break;case"vertical":ve.scrollTop-=pe*1.5;default:console.error(`[etudes::Carousel] Unsupported orientation: ${c}`)}x.current=!1}))},[c]),q=T.useCallback(()=>{const Z=A.current;!Z||O.current||(O.current=!0,requestAnimationFrame(()=>{if(u&&oe(),!(R.current!==void 0)){const ve=Math.round(c==="horizontal"?Z.scrollLeft/Z.clientWidth:Z.scrollTop/Z.clientHeight),de=Math.max(0,Math.min(a.length-1,ve));de!==r&&(P.current=de,K.current?.(de))}O.current=!1}))},[a.length,r,c,u,oe]);return ro(A,{isEnabled:!E&&i&&a.length>1,onDragMove:J}),oo(Q||!W?-1:e,{onInterval:I},[r]),T.useLayoutEffect(()=>{!W||E||(Q?$.current?.():L.current?.())},[E,Q,W]),T.useLayoutEffect(()=>{const Z=A.current;if(!Z)return;const pe=P.current===void 0,ve=P.current===r;return Z.addEventListener("scroll",q),u&&oe(),ve||(P.current=r,pe||(K.current?.(r),re())),()=>{Z.removeEventListener("scroll",q)}},[r,u,re,q,oe]),w.jsx("div",{...k,ref:_,role:"region",onClick:D,onPointerCancel:H,onPointerDown:le,onPointerLeave:H,onPointerUp:H,children:w.jsx("div",{ref:A,style:ue(ee.viewport),children:w.jsx(vt,{in:a,children:({style:Z,...pe},ve)=>w.jsx("div",{style:ue(ee.itemContainer),children:w.jsx(b,{"aria-hidden":ve!==r,exposure:u?F?.[ve]:void 0,style:ue(Z,ee.item),...pe})})})})})});function Ks(e,r,i){const a=e?.current;if(!a)return;const c=i==="horizontal"?0:a.clientHeight*r,u=i==="horizontal"?a.clientWidth*r:0;a.scrollTop===c&&a.scrollLeft===u||a.scrollTo({top:c,left:u,behavior:"smooth"})}function yo(e,r){const i=e?.current;if(!i)return;const a=[];for(let c=0;c<i.children.length;c++)a.push(Gs(c,e,r));return a}function Gs(e,r,i){const a=r?.current,c=a?.children[e];if(!c)return 0;const u=we.intersecting(c,a);if(!u)return 0;switch(i){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: ${i}`),NaN}}function Ws({scrollSnapEnabled:e=!1,orientation:r="horizontal"}){return{viewport:{alignItems:"center",display:"flex",height:"100%",userSelect:e?"auto":"none",justifyContent:"flex-start",scrollSnapStop:"always",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==="development"&&(vo.displayName="Carousel");const bo=T.forwardRef(({children:e,autoFocus:r=!1,isDisabled:i=!1,isRequired:a=!0,placeholder:c,size:u,style:d,value:g,onChange:m,...b},k)=>{const _=Zs(g,u),P=T.useRef([]),A=Js(),z=ke(e,{field:Gt}),N=L=>{L<0?P.current[0]?.focus():L>=u?P.current[u-1]?.focus():P.current[L]?.focus()},R=L=>K=>{const x=_[L],O=K.target.value,E=$s(O,x).slice(-1),F=_.slice();F[L]=E,m(F),N(E?L+1:L-1)},ne=L=>K=>{switch(K.key){case"Backspace":{if(K.preventDefault(),_[L]){const x=_.slice();x[L]="",m(x),N(L-1)}else N(L-1);break}case"ArrowLeft":{K.preventDefault(),N(L-1);break}case"ArrowRight":{K.preventDefault(),N(L+1);break}}},$=L=>K=>{K.preventDefault();const x=K.clipboardData.getData("text").trim(),O=Qs(_.slice(),x.split("").slice(0,u),L);m(O);const E=Math.min(L+x.length,u-1);N(E)};return T.useEffect(()=>{if(!r)return;const L=_.findIndex(K=>K==="");L!==-1&&N(L)},[_,r]),w.jsx("div",{...b,ref:k,style:ue(d,A.root),children:w.jsx(pt,{count:u,children:L=>w.jsx(me,{ref:K=>P.current[L]=K,"aria-disabled":i,"aria-required":a,disabled:i,element:z.field??w.jsx(Gt,{}),placeholder:c,required:a,style:ue(A.field),value:_[L],onChange:R(L),onKeyDown:ne(L),onPaste:$(L)})})})}),Gt=({...e})=>w.jsx("input",{...e,type:"text"});function Js(){return{root:{alignItems:"stretch",display:"flex",justifyContent:"stretch"},field:{caretColor:"transparent",flex:"1",minWidth:"0"}}}function Zs(e,r){const i=e.slice(0,r);for(;i.length<r;)i.push("");return i}function Qs(e,r,i=0){let a=i,c=0;for(;c<r.length&&a<e.length;)e[a]=r[c],a++,c++;for(;c<r.length;)e.shift(),e.push(r[c]),c++;return e}function $s(e,r,i=""){const a=e.indexOf(r);return a===-1?e:e.slice(0,a)+i+e.slice(a+r.length)}const qs=Object.assign(bo,{Field:Gt});process.env.NODE_ENV==="development"&&(bo.displayName="CodeInput",Gt.displayName="CodeInput.Field");const tr=T.forwardRef(({className:e,emptyValue:r="",isDisabled:i=!1,isRequired:a=!1,placeholder:c,type:u="text",value:d,formatter:g,onFocus:m,onUnfocus:b,onChange:k,..._},P)=>{const A=T.useCallback(z=>{const N=(g?.(z)??z)||r;k?.(N)},[k,g]);return w.jsx("input",{..._,ref:P,"aria-disabled":i,"aria-placeholder":c,"aria-required":a,className:ce(e,{disabled:i}),disabled:i,placeholder:c,required:a,type:u,value:d||r,onBlur:({target:z})=>b?.(z.value),onChange:({target:z})=>A(z.value),onFocus:({target:z})=>m?.(z.value)})});process.env.NODE_ENV==="development"&&(tr.displayName="TextField");const wo=T.forwardRef(({children:e,style:r,allowsInput:i=!0,max:a=NaN,min:c=NaN,quantity:u=0,onChange:d,...g},m)=>{const b=()=>{d?.(N(u-1))},k=()=>{d?.(N(u+1))},_=O=>{ne(O)},P=O=>{const E=z(O);E!==u?d?.(E):ne(A(E))},A=O=>O.toLocaleString(),z=O=>{const E=parseInt(O,10);return E.toString()!==O.replace(/^0+/,"")?u:N(E)},N=O=>{let E=O;return isNaN(c)||(E=Math.max(c,E)),isNaN(a)||(E=Math.min(a,E)),E},[R,ne]=T.useState(A(u)),$=lo(u),L=!isNaN(a)&&u+1>a,K=!isNaN(c)&&u-1<c;T.useEffect(()=>{if($===void 0||$===u)return;const O=N(u);ne(A(O))},[u,c,a]);const x=ke(e,{textField:Wt,addButton:Jt,subscribeButton:Zt});return w.jsxs("div",{...g,ref:m,style:ue(r,Qt.root),children:[w.jsx(me,{className:ce({disabled:K}),element:x.subscribeButton??w.jsx(Zt,{}),style:ue(Qt.subtract),onClick:()=>b()}),w.jsx(me,{element:x.textField??w.jsx(Wt,{}),isDisabled:!i,style:ue(Qt.textField),value:R,onChange:_,onUnfocus:P}),w.jsx(me,{className:ce({disabled:L}),element:x.addButton??w.jsx(Jt,{}),style:ue(Qt.add),onClick:()=>k()})]})}),Wt=({...e})=>w.jsx(tr,{...e}),Jt=({children:e,...r})=>w.jsx("button",{...r,children:e}),Zt=({children:e,...r})=>w.jsx("button",{...r,children:e}),Qt={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==="development"&&(wo.displayName="Counter",Jt.displayName="CounterAddButton",Zt.displayName="CounterSubtractButton",Wt.displayName="CounterTextField");const xo=T.forwardRef(({children:e,style:r,angle:i=0,knobLength:a=30,knobThickness:c=10,radius:u=50,trackGap:d=0,trackThickness:g=2,...m},b)=>{const k=u*2,_=Math.max(0,Math.min(360,a)),P=ke(e,{track:$t,knob:qt}),A=ta({angle:i,diameter:k});return w.jsxs("div",{...m,ref:b,style:ue(r,A.root),children:[w.jsx("div",{style:A.trackContainer,children:w.jsx("svg",{height:k,style:A.svgContainer,viewBox:`0 0 ${k} ${k}`,width:k,children:w.jsx(me,{cx:u,cy:u,element:P.track??w.jsx($t,{}),fill:"none",r:u-g/2,strokeDasharray:d,strokeWidth:g})})}),w.jsx("div",{style:ue(A.knobContainer),children:w.jsx("svg",{style:A.svgContainer,viewBox:`0 0 ${k} ${k}`,xmlns:"http://www.w3.org/2000/svg",children:w.jsx(me,{d:ea(u,u,u-c/2-(g-c)/2,-_/2,_/2),element:P.knob??w.jsx(qt,{}),fill:"none",strokeWidth:c})})})]})}),$t=({...e})=>w.jsx("circle",{...e}),qt=({...e})=>w.jsx("path",{...e});function Eo(e,r,i,a){const c=(a-90)*Math.PI/180;return{x:e+i*Math.cos(c),y:r+i*Math.sin(c)}}function ea(e,r,i,a,c){const u=Eo(e,r,i,c),d=Eo(e,r,i,a),g=c-a<=180?"0":"1";return["M",u.x,u.y,"A",i,i,0,g,0,d.x,d.y].join(" ")}function ta({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==="development"&&(xo.displayName="Dial",$t.displayName="DialTrack",qt.displayName="DialKnob");const No=T.forwardRef(({children:e,className:r,style:i,collapsesOnSelect:a=!0,collectionPadding:c=0,isCollapsed:u,isInverted:d=!1,label:g,layout:m="list",isSelectionTogglable:b=!1,itemLength:k,itemPadding:_=0,items:P=[],maxVisibleItems:A=-1,numSegments:z=1,orientation:N="vertical",selection:R=[],selectionMode:ne="single",onActivateAt:$,onCollapse:L,onDeselectAt:K,onExpand:x,onSelectAt:O,onSelectionChange:E,onToggleCustomEvent:F,ItemComponent:G,ToggleComponent:Q,...se},ee)=>{const W=T.useRef(null),X=Be(W),V=P.length,re=ia(P,A,z,m),oe=k??(N==="vertical"?X.height:X.width),le=oe*re+_*(re-1),H=ra(R,P),[D,I]=T.useState(u??!0),J=sa({isCollapsed:D,collectionPadding:c,isInverted:d,maxVisibleItems:A,menuLength:le,numItems:V,orientation:N}),q=ke(e,{collapseIcon:nr,collection:en,expandIcon:rr,item:tn,toggle:nn}),Z=()=>{D&&(I(!1),x?.())},pe=()=>{D||(I(!0),L?.())},ve=()=>{D?Z():pe()},de=Ne=>{O?.(Ne),ne==="single"&&a&&pe()};return T.useEffect(()=>{u!==void 0&&I(u)},[u]),T.useEffect(()=>{const Ne=te=>{if(D||!(te.target instanceof Node))return;let De=!0,Pe=te.target;for(;Pe;){if(Pe===W.current){De=!1;break}if(!Pe.parentNode)break;Pe=Pe.parentNode}De&&pe()};return window.addEventListener("click",Ne),()=>{window.removeEventListener("click",Ne)}},[D]),w.jsx("div",{...se,ref:ee,className:ce(r,{collapsed:D,expanded:!D}),style:ue(i,J.root),children:w.jsxs("div",{ref:W,style:ue(J.body),children:[Q?w.jsx(Q,{"aria-expanded":!D,"aria-haspopup":"listbox",className:ce({collapsed:D,expanded:!D}),style:ue(J.toggle),onClick:ve,onCustomEvent:(Ne,te)=>F?.(Ne,te)}):w.jsxs(me,{"aria-expanded":!D,"aria-haspopup":"listbox",className:ce({collapsed:D,expanded:!D}),element:q.toggle??w.jsx(nn,{}),style:ue(J.toggle),onClick:ve,children:[w.jsx("span",{dangerouslySetInnerHTML:{__html:g?.(H)??(H.length>0?H.map(Ne=>P[Ne]).join(", "):"")}}),q.expandIcon&&w.jsx(me,{className:ce({collapsed:D,expanded:!D}),element:D?q.collapseIcon??q.expandIcon:q.expandIcon,style:ue(D?J.collapseIcon:J.expandIcon)})]}),w.jsx(me,{element:q.collection??w.jsx(en,{}),isSelectionTogglable:b,ItemComponent:G,itemLength:oe,itemPadding:_,items:P,layout:m,numSegments:z,orientation:N,selection:H,selectionMode:ne,style:ue(J.collection),onActivateAt:$,onDeselectAt:K,onSelectAt:de,onSelectionChange:E,children:!G&&(q.item??w.jsx(tn,{}))})]})})}),en=Yt,tn=at,nn=({children:e,...r})=>w.jsx("button",{...r,children:e}),nr=({children:e,...r})=>w.jsx("figure",{...r,"aria-hidden":!0,children:e}),rr=({children:e,...r})=>w.jsx("figure",{...r,"aria-hidden":!0,children:e});function na(e,r){return!!(isNaN(e)||e>=r.length||e<0)}function ra(e,r){return oa(e).filter(i=>!na(i,r))}function oa(e){return e.sort((r,i)=>r-i)}function ia(e,r,i,a){const c=e.length;switch(a){case"grid":{const u=i<1?c:Math.ceil(c/i);return r<0?u:Math.min(u,r)}default:return r<0?c:Math.min(c,r)}}function sa({isCollapsed:e=!0,isInverted:r=!1,collectionPadding:i=0,maxVisibleItems:a=0,menuLength:c=NaN,numItems:u=0,orientation:d="vertical"}){return{root:{alignItems:"center",display:"flex",justifyContent:"flex-start",overflow:"visible",...d==="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",...d==="vertical"?{width:"100%",height:e?"0px":`${c}px`,overflowY:a!==-1&&a<u?"scroll":"hidden",...r?{marginBottom:`${i}px`,bottom:"100%"}:{top:"100%",marginTop:`${i}px`}}:{width:e?"0px":`${c}px`,height:"100%",overflowX:a!==-1&&a<u?"scroll":"hidden",...r?{marginRight:`${i}px`,right:"100%"}:{left:"100%",marginLeft:`${i}px`}}},expandIcon:{pointerEvents:"none",zIndex:1},collapseIcon:{pointerEvents:"none",zIndex:1}}}process.env.NODE_ENV==="development"&&(No.displayName="Dropdown",en.displayName="DropdownCollection",nr.displayName="DropdownCollapseIcon",rr.displayName="DropdownExpandIcon",tn.displayName="DropdownItem",nn.displayName="DropdownToggle");const So=":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",aa=So+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",ca="["+So+"]["+aa+"]*",la=new RegExp("^"+ca+"$");function To(e,r){const i=[];let a=r.exec(e);for(;a;){const c=[];c.startIndex=r.lastIndex-a[0].length;const u=a.length;for(let d=0;d<u;d++)c.push(a[d]);i.push(c),a=r.exec(e)}return i}const rn=function(e){const r=la.exec(e);return!(r===null||typeof r>"u")};function ua(e){return typeof e<"u"}const fa={allowBooleanAttributes:!1,unpairedTags:[]};function da(e,r){r=Object.assign({},fa,r);const i=[];let a=!1,c=!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=Co(e,u),u.err)return u}else if(e[u]==="<"){let d=u;if(u++,e[u]==="!"){u=ko(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]!==`
6
+ <%s key={someKey} {...props} />`,Z,de,Ne,de),D[de+Z]=!0)}if(de=null,q!==void 0&&(i(q),de=""+q),d(J)&&(i(J.key),de=""+J.key),"key"in J){q={};for(var te in J)te!=="key"&&(q[te]=J[te])}else q=J;return de&&g(q,typeof I=="function"?I.displayName||I.name||"Unknown":I),b(I,de,q,c(),pe,ve)}function _(I){P(I)?I._store&&(I._store.validated=1):typeof I=="object"&&I!==null&&I.$$typeof===G&&(I._payload.status==="fulfilled"?P(I._payload.value)&&I._payload.value._store&&(I._payload.value._store.validated=1):I._store&&(I._store.validated=1))}function P(I){return typeof I=="object"&&I!==null&&I.$$typeof===z}var A=T,z=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),ne=Symbol.for("react.strict_mode"),$=Symbol.for("react.profiler"),L=Symbol.for("react.consumer"),K=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),F=Symbol.for("react.memo"),G=Symbol.for("react.lazy"),Q=Symbol.for("react.activity"),se=Symbol.for("react.client.reference"),ee=A.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=Object.prototype.hasOwnProperty,X=Array.isArray,V=console.createTask?console.createTask:function(){return null};A={react_stack_bottom_frame:function(I){return I()}};var re,oe={},le=A.react_stack_bottom_frame.bind(A,u)(),H=V(a(u)),D={};dt.Fragment=R,dt.jsx=function(I,J,q){var Z=1e4>ee.recentlyCreatedOwnerStacks++;return k(I,J,q,!1,Z?Error("react-stack-top-frame"):le,Z?V(a(I)):H)},dt.jsxs=function(I,J,q){var Z=1e4>ee.recentlyCreatedOwnerStacks++;return k(I,J,q,!0,Z?Error("react-stack-top-frame"):le,Z?V(a(I)):H)}})()),dt}var Mr;function Xi(){return Mr||(Mr=1,process.env.NODE_ENV==="production"?Lt.exports=Hi():Lt.exports=Yi()),Lt.exports}var w=Xi();function zr(e){var r,i,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var c=e.length;for(r=0;r<c;r++)e[r]&&(i=zr(e[r]))&&(a&&(a+=" "),a+=i)}else for(i in e)e[i]&&(a&&(a+=" "),a+=i);return a}function ce(){for(var e,r,i=0,a="",c=arguments.length;i<c;i++)(e=arguments[i])&&(r=zr(e))&&(a&&(a+=" "),a+=r);return a}function pt({count:e=1,children:r,render:i}){return w.jsx(w.Fragment,{children:[...Array(e)].map((a,c)=>w.jsx(T.Fragment,{children:i?.(c)??(typeof r=="function"?r(c):r)},`element-${c}`))})}process.env.NODE_ENV==="development"&&(pt.displayName="Repeat");function Ft(e,r={},...i){const{className:a,style:c,...u}=r,{className:d,style:g,...m}=e.props;return T.cloneElement(e,{className:`${d??""} ${a??""}`.split(" ").filter(Boolean).join(" ")||void 0,style:{...g??{},...c??{}},...m,...u},...i)}function me({children:e,element:r,...i}){return Ft(r,i,...e?Array.isArray(e)?e:[e]:[])}process.env.NODE_ENV==="development"&&(me.displayName="Styled");function Ui(e){return e}function ke(e,r={}){const i=Object.keys(r),a=Object.values(r),c={};return T.Children.forEach(e,u=>{if(u==null)return;if(!T.isValidElement(u)){console.error("[etudes::asComponentDict] Invalid child detected");return}const d=a.indexOf(u.type);if(d<0){console.error(`[etudes::asComponentDict] Unsupported child, only the following children are allowed: ${a.map(m=>m.displayName??m.name).join(", ")}`);return}const g=i[d];if(c[g]){console.error(`[etudes::asComponentDict] Only one ${a[d]} can be provided as a child`);return}c[g]=u}),c}function Ki(e){return e}function ue(...e){return e.reduce((r,i)=>({...r,...i||{}}),{})}const Rn=T.forwardRef(({children:e,className:r,isActive:i=!1,isTailHidden:a=!1,isSplit:c=!1,numberOfBars:u=3,...d},g)=>{const m=ke(e,{bar:ht}),b={root:ce({active:i}),bar:ce({active:i})},k=Gi({isSplit:c,isActive:i,isTailHidden:a});return w.jsx("div",{...d,ref:g,className:ce(r,b.root),children:w.jsx(pt,{count:c?2:1,children:_=>w.jsx("div",{"aria-hidden":!0,style:ue(k.section,k[`section${_}`]),children:w.jsx(pt,{count:u,children:P=>w.jsx(me,{"aria-hidden":!0,className:ce(b.bar),element:m.bar??w.jsx(ht,{}),style:(()=>{switch(u){case 2:return ue(k.bar,k[`bar${_}${P===0?0:2}`]);case 3:default:return ue(k.bar,k[`bar${_}${P}`])}})()})})})})})}),ht=({...e})=>w.jsx("span",{...e});function Gi({isActive:e=!1,isSplit:r=!1,isTailHidden:i=!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%":`${i?"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:i&&!e?"0":"100%"}}}process.env.NODE_ENV==="development"&&(Rn.displayName="Burger",ht.displayName="BurgerBar");const Lr=T.forwardRef(({children:e,className:r,style:i,isActive:a=!1,isTailHidden:c=!1,isSplit:u=!1,numberOfBars:d=3,onActivate:g,onDeactivate:m,onToggle:b,...k},_)=>{const P=()=>{const N=!a;b?.(N),N?g?.():m?.()},A={root:ce({active:a})},z=Wi();return w.jsx("button",{...k,ref:_,"aria-expanded":a,className:ce(r,A.root),style:ue(i,z.root),onClick:P,children:w.jsx(Rn,{isActive:a,isSplit:u,isTailHidden:c,numberOfBars:d,children:e})})}),Fr=ht;function Wi(){return{root:{background:"transparent",border:"none",display:"block",outline:"none"}}}process.env.NODE_ENV==="development"&&(Lr.displayName="BurgerButton",Fr.displayName="BurgerButtonBar");var Se;(e=>{e.zero=r();function r(N=0,R=0){if(typeof N=="number")return{x:N,y:R};if(!P(N))throw Error("Invalid parameters passed to constructor");return N instanceof Array?{x:N[0],y:N[1]}:{x:N.x,y:N.y}}e.make=r;function i(N,R={}){return r({x:typeof R.x=="number"?R.x:N.x,y:typeof R.y=="number"?R.y:N.y})}e.clone=i;function a(N,R){return r({x:N.x+R.x,y:N.y+R.y})}e.add=a;function c(N,R){return r({x:N.x-R.x,y:N.y-R.y})}e.subtract=c;function u(N,R){return r({x:N.x*R.x,y:N.y*R.y})}e.multiply=u;function d(N,R){return r({x:N.x/R.x,y:N.y/R.y})}e.divide=d;function g(N){return r({x:N.y,y:N.x})}e.reflect=g;function m(N,R){return!(N.x!==R.x||N.y!==R.y)}e.isEqual=m;function b(N){return`Point(x=${N.x}, y=${N.y})`}e.toString=b;function k(N){return Object.freeze({x:N.x,y:N.y})}e.toJSON=k;function _(N){return[N.x,N.y]}e.toArray=_;function P(N){return N instanceof Array?!(N.length!==2||typeof N[0]!="number"||typeof N[1]!="number"):typeof N=="object"?!(typeof N.x!="number"||typeof N.y!="number"):!1}e.isValidDescriptor=P;function A(N){return typeof N=="object"&&typeof N.x=="number"&&typeof N.y=="number"}e.isPoint=A;function z(N){return N.x===0&&N.y===0}e.isZero=z})(Se||(Se={}));function Ji(e,r){try{const i=Se.isValidDescriptor(e)&&Se.make(e),a=Se.isValidDescriptor(r)&&Se.make(r);if(i&&!a){const c=r instanceof Array?r:[r],u=c.length;for(let d=0;d<u;d++){const g=we.from(c[d]);if(!g)continue;const m=i.x>=g.left&&i.x<=g.right,b=i.y>=g.top&&i.y<=g.bottom;if(m&&b)return!0}return!1}else if(!i&&a){const c=e instanceof Array?e:[e],u=c.length;for(let d=0;d<u;d++){const g=we.from(c[d]);if(!g)continue;const m=a.x>=g.left&&a.x<=g.right,b=a.y>=g.top&&a.y<=g.bottom;if(m&&b)return!0}return!1}else{if(i&&a)return Se.isEqual(i,a);{const c=[...e instanceof Array?e:[e],...r instanceof Array?r:[r]],u=we.intersecting.apply(null,c);return u?u.width*u.height!==0:!1}}}catch(i){return console.error(i),!1}}var Oe;(e=>{e.zero=r();function r(N=0,R=0){if(typeof N=="number")return{width:N,height:R};if(!P(N))throw Error("Invalid parameters passed to constructor");return N instanceof Array?{width:N[0],height:N[1]}:{width:N.width,height:N.height}}e.make=r;function i(N,R={}){return r({width:typeof R.width=="number"?R.width:N.width,height:typeof R.height=="number"?R.height:N.height})}e.clone=i;function a(N,R){return r({width:N.width+R.width,height:N.height+R.height})}e.add=a;function c(N,R){return r({width:N.width-R.width,height:N.height-R.height})}e.subtract=c;function u(N,R){return r({width:N.width*R.width,height:N.height*R.height})}e.multiply=u;function d(N,R){return r({width:N.width/R.width,height:N.height/R.height})}e.divide=d;function g(N){return r({width:N.height,height:N.width})}e.rotate=g;function m(N,R){return!(N.width!==R.width||N.height!==R.height)}e.isEqual=m;function b(N){return`Size(width=${N.width}, height=${N.height})`}e.toString=b;function k(N){return Object.freeze({width:N.width,height:N.height})}e.toJSON=k;function _(N){return[N.width,N.height]}e.toArray=_;function P(N){return N instanceof Array?!(N.length!==2||typeof N[0]!="number"||typeof N[1]!="number"):typeof N=="object"?!(typeof N.width!="number"||typeof N.height!="number"):!1}e.isValidDescriptor=P;function A(N){return typeof N=="object"&&typeof N.width=="number"&&typeof N.height=="number"}e.isSize=A;function z(N){return N.width===0&&N.height===0}e.isZero=z})(Oe||(Oe={}));var we;(e=>{e.zero=r();function r(x=0,O=0,E=0,F=0){if(typeof x=="number"&&typeof O=="number"){const G=x,Q=O;return{top:Q,right:G+E,bottom:Q+F,left:G,width:E,height:F}}else if(Se.isPoint(x)&&Oe.isSize(O)){const G=x,Q=O;return{top:G.y,right:G.x+Q.width,bottom:G.y+Q.height,left:G.x,width:Q.width,height:Q.height}}else{const G=x;if(!$(G))throw Error("Invalid parameters passed to constructor");return{top:G.y,right:G.x+G.width,bottom:G.y+G.height,left:G.x,width:G.width,height:G.height}}}e.make=r;function i(x){return Se.make({x:(x.right-x.left)/2+x.left,y:(x.bottom-x.top)/2+x.top})}e.center=i;function a(x){return Oe.make({width:x.width,height:x.height})}e.size=a;function c(x,O={}){try{if(x==null)return;if(L(x))return x;if(gt(x))return c(document.documentElement||document.body.parentNode||document.body,O);const E=x instanceof Array?x:[x],F=E.length,G=O.reference||window,Q=u(),se=gt(G)?Q:c(O.reference);if(!Q||!se)return;let ee;for(let W=0;W<F;W++){const X=E[W],V=X.getBoundingClientRect(),re=r({x:V.left+Q.left-(gt(G)?0:se.left),y:V.top+Q.top-(gt(G)?0:se.top),width:O.overflow?X.scrollWidth:X instanceof HTMLElement?X.offsetWidth:V.width,height:O.overflow?X.scrollHeight:X instanceof HTMLElement?X.offsetHeight:V.height});ee=ee?P(ee,re):re}return ee}catch(E){console.error(E);return}}e.from=c;function u(){const x=Math.max(document.documentElement.clientWidth,window.innerWidth||0),O=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:x,height:O})}e.fromViewport=u;function d(x,O={}){if(x)return gt(x)?c(Array.from(document.body.children)):c(Array.from(x.children),{overflow:O.overflow,reference:O.reference||x})}e.fromChildrenOf=d;function g(x,O,E={}){if(!O)return;const F=Array.from(O.children);return x<=0?r():x>=F.length?c(F,{reference:E.reference,overflow:!1}):(F.splice(x),c(F,{reference:E.reference||O,overflow:!1}))}e.fromChildrenBefore=g;function m(x,O,E={}){if(!O)return;const F=Array.from(O.children);return x<0?c(F,{reference:E.reference,overflow:!1}):x>=F.length-1?r():(F.splice(0,F.length-x-1),c(F,{reference:E.reference||O,overflow:!1}))}e.fromChildrenAfter=m;function b(x,O,E={}){if(!O)return;const F=O.children[x];return c(F,{overflow:E.overflow,reference:E.reference||O})}e.fromChildAt=b;function k(...x){try{const O=x.length,E={};let F,G;for(let Q=0;Q<O;Q++){if(F||(F=c(x[Q])),Q===0&&Q+1===O)G=u();else if(Q+1<O)G=c(x[Q+1]);else break;!F||!G||(E.width=Math.max(0,Math.min(F.right,G.right)-Math.max(F.left,G.left)),E.height=Math.max(0,Math.min(F.bottom,G.bottom)-Math.max(F.top,G.top)),E.y=Math.max(F.top,G.top),E.x=Math.max(F.left,G.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(O){console.error(O);return}}e.intersecting=k;function _(x,O={}){return r({x:typeof O.x=="number"?O.x:x.left,y:typeof O.y=="number"?O.y:x.top,width:typeof O.width=="number"?O.width:x.width,height:typeof O.height=="number"?O.height:x.height})}e.clone=_;function P(x,O){return r({x:Math.min(x.left,O.left),y:Math.min(x.top,O.top),width:Math.max(x.right,O.right)-Math.min(x.left,O.left),height:Math.max(x.bottom,O.bottom)-Math.min(x.top,O.top)})}e.concat=P;function A(x){return r({x:x.left,y:x.top,width:x.height,height:x.width})}e.rotate=A;function z(x,O){return!(x.top!==O.top||x.right!==O.right||x.bottom!==O.bottom||x.left!==O.left||x.width!==O.width||x.height!==O.height)}e.isEqual=z;function N(x,O){return Ji(O,x)}e.contains=N;function R(x){return`Rect(top=${x.top}, right=${x.right}, bottom=${x.bottom}, left=${x.left}, width=${x.width}, height=${x.height})`}e.toString=R;function ne(x){return Object.freeze({top:x.top,right:x.right,bottom:x.bottom,left:x.left,width:x.width,height:x.height})}e.toJSON=ne;function $(x){return!(typeof x.x!="number"||typeof x.y!="number"||typeof x.width!="number"||typeof x.height!="number")}e.isValidDescriptor=$;function L(x){return typeof x=="object"&&typeof x.top=="number"&&typeof x.right=="number"&&typeof x.bottom=="number"&&typeof x.left=="number"&&typeof x.width=="number"&&typeof x.height=="number"}e.isRect=L;function K(x){return x.top===0&&x.right===0&&x.bottom===0&&x.left===0&&x.width===0&&x.height===0}e.isZero=K})(we||(we={}));function gt(e){return e===window}function Ee(e){const r=T.useRef(e);return T.useEffect(()=>{r.current=e},[e]),r}function Dr(e,{onChange:r}){const i=Ee(r);T.useLayoutEffect(()=>{const a=e.current;if(!a)return;const c=new IntersectionObserver(u=>{for(const d of u)if(d.target===a){i.current?.(a);break}});return c.observe(a),()=>{c.disconnect()}},[e.current])}function Dt(e,{onResize:r}){const i=Ee(r);T.useLayoutEffect(()=>{const a=e.current;if(!a)return;const c=new ResizeObserver(()=>{i.current?.(a)});return c.observe(a),()=>{c.disconnect()}},[e.current])}function Vr(){const[e,r]=T.useState(Oe.zero);return T.useLayoutEffect(()=>{const i=()=>{const a=we.size(we.fromViewport());r(a)};return window.addEventListener("resize",i),i(),()=>{window.removeEventListener("resize",i)}},[]),e}function Be(e){const[r,i]=T.useState(we.zero),a=Vr();return Dt(e,{onResize:c=>{const u=we.from(c);u&&i(u)}}),Dr(e,{onChange:c=>{const u=we.from(c);u&&i(u)}}),T.useLayoutEffect(()=>{const c=e.current,u=we.from(c);u&&i(u)},[Oe.toString(a)]),r}j.ImageSource=void 0,(e=>{function r(u){try{return i(u),{media:u.media,sizes:c(u),srcSet:a(u),type:u.type}}catch(d){console.error(`[etudes:ImageSource] ${d}`);return}}e.asProps=r;function i({sizes:u=[],srcSet:d}){if(u.length>0&&!d.some(({width:g})=>g!==void 0))throw Error("If `sizes` is specified, at least one entry in `sourceSet` must have a `width` specified");if(u.length>0&&u[u.length-1].media!==void 0)throw Error("The last item in `sizes` must not have a `media` condition");if(d.length===0)throw Error("At least one entry in `sourceSet` must be specified");d.forEach(({src:g,width:m,pixelDensity:b})=>{if(g===void 0||g==="")throw Error("Each entry in `sourceSet` must have a non-empty `src`");if(m!==void 0&&(!isFinite(m)||!Number.isInteger(m)||m<=0))throw Error("If `width` is specified, it must be a positive integer greater than 0");if(b!==void 0&&(!isFinite(b)||b<=0))throw Error("If `pixelDensity` is specified, it must be a number greater than 0");if(m!==void 0&&b!==void 0)throw Error("Only one of `width` or `pixelDensity` can be specified")})}function a(u){return u.srcSet.map(({pixelDensity:d,src:g,width:m})=>{let b=g;return m!==void 0?b+=` ${m}w`:d!==void 0&&(b+=` ${d}x`),b}).filter(Boolean).join(", ")}function c(u){return u.sizes?.map(({media:d,width:g})=>{let m=g;return d&&(m=`${d} ${m}`),m}).filter(Boolean).join(", ")}})(j.ImageSource||(j.ImageSource={}));function Br({src:e,srcSet:r,sizes:i},{onLoadStart:a,onLoadComplete:c,onLoadError:u}={}){const d=T.useRef(void 0),g=Ee(a),m=Ee(c),b=Ee(u);T.useLayoutEffect(()=>{let k=!1;const _=z=>{if(k)return;const N=z.currentTarget;m.current?.(N)},P=z=>{if(k)return;const N=z.currentTarget;b.current?.(N)},A=new Image;return A.addEventListener("load",_),A.addEventListener("error",P),g.current?.(A),r&&(A.srcset=r),i&&(A.sizes=i),A.src=e,d.current=A,()=>{k=!0,A.removeEventListener("load",_),A.removeEventListener("error",P),d.current=void 0}},[e,r,i])}function jn({src:e,srcSet:r,sizes:i},{preservesSizeBetweenLoads:a=!0,onLoadStart:c,onLoadComplete:u,onLoadError:d}={}){const[g,m]=T.useState(),b=Ee(c),k=Ee(u),_=Ee(d),P=T.useCallback(N=>{a||m(void 0),b.current?.(N)},[a]),A=T.useCallback(N=>{m(Zi(N)),k.current?.(N)},[]),z=T.useCallback(N=>{a||m(void 0),_.current?.(N)},[a]);return Br({src:e,srcSet:r,sizes:i},{onLoadStart:P,onLoadComplete:A,onLoadError:z}),g}function Zi(e){if(e&&typeof e.width=="number"&&typeof e.height=="number")return Oe.make(e.width,e.height)}const An=T.forwardRef(({alt:e,source:r,loadingMode:i,src:a,style:c,onLoadStart:u,onLoadComplete:d,onLoadError:g,onSizeChange:m,...b},k)=>{const _=r?j.ImageSource.asProps(r):void 0,P=jn({src:a,srcSet:_?.srcSet,sizes:_?.sizes},{onLoadStart:u,onLoadComplete:d,onLoadError:g}),A=Qi();return T.useEffect(()=>{m?.(P)},[P?.width,P?.height]),w.jsx("img",{...b,..._,ref:k,alt:e,loading:i,src:a,style:{...A.root,...c}})});function Qi(){return{root:{fontSize:"0"}}}process.env.NODE_ENV==="development"&&(An.displayName="Image");const Mn=T.forwardRef(({alt:e,loadingMode:r,sources:i=[],src:a,onLoadComplete:c,onLoadError:u,onLoadStart:d,onSizeChange:g,...m},b)=>w.jsxs("picture",{...m,ref:b,children:[i.map((k,_)=>w.jsx("source",{...j.ImageSource.asProps(k)},_)),w.jsx(An,{alt:e,loadingMode:r,src:a,style:{width:"100%",height:"100%"},onLoadComplete:c,onLoadError:u,onLoadStart:d,onSizeChange:g})]}));process.env.NODE_ENV==="development"&&(Mn.displayName="Picture");const Hr=T.forwardRef(({children:e,alt:r,aspectRatio:i=NaN,sources:a,loadingMode:c,src:u,style:d,onLoadStart:g,onLoadComplete:m,onLoadError:b,...k},_)=>{const P=O=>{R(O?O.width/O.height:NaN)},A=T.useRef(null),z=_??A,[N,R]=T.useState(NaN),ne=isNaN(i)?N:i,$=Be(z),L=$.width/$.height,K=Oe.make(L>1?Math.max($.width,$.height*ne):Math.max($.width,Math.max($.height,$.width/ne)*ne),L>1?Math.max($.height,Math.max($.width,$.height*ne)/ne):Math.max($.height,$.width/ne)),x=ke(e,{content:zn,viewport:Ln});return w.jsxs("div",{...k,ref:z,style:ue(d,Fn.root),children:[w.jsx(Mn,{alt:r,sources:a,src:u,style:ue(Fn.viewport,{height:`${K.height}px`,maxWidth:"unset",width:`${K.width}px`}),onLoadComplete:m,onLoadError:b,onLoadStart:g,onSizeChange:O=>P(O)}),x.viewport&&w.jsx(me,{element:x.viewport,style:ue(Fn.viewport,{height:`${K.height}px`,pointerEvents:"none",width:`${K.width}px`})}),x.content]})}),zn=({children:e,...r})=>w.jsx("div",{...r,children:e}),Ln=({children:e,...r})=>w.jsx("div",{...r,children:e}),Fn={root:{overflow:"hidden"},viewport:{fontSize:"0",left:"50%",position:"absolute",top:"50%",transform:"translate(-50%, -50%)"}};process.env.NODE_ENV==="development"&&(Hr.displayName="CoverImage",zn.displayName="CoverImageContent",Ln.displayName="CoverImageViewport");function Yr(e,{onLoadStart:r,onLoadComplete:i,onLoadError:a}={}){const c=Ee(r),u=Ee(i),d=Ee(a);T.useLayoutEffect(()=>{if(!e)return;const g=window.document.createElement("video"),m=()=>u.current?.(g),b=()=>d.current?.(g);return g.addEventListener("loadedmetadata",m),g.addEventListener("error",b),g.src=e,c.current?.(g),()=>{g.removeEventListener("loadedmetadata",m),g.removeEventListener("error",b),g.src=""}},[e])}function Xr(e,{preservesSizeBetweenLoads:r=!0,onLoadStart:i,onLoadComplete:a,onLoadError:c}={}){const[u,d]=T.useState(),g=Ee(i),m=Ee(a),b=Ee(c),k=T.useCallback(A=>{r||d(void 0),g.current?.(A)},[r]),_=T.useCallback(A=>{d($i(A)),m.current?.(A)},[]),P=T.useCallback(A=>{r||d(void 0),b.current?.(A)},[r]);return Yr(e,{onLoadStart:k,onLoadComplete:_,onLoadError:P}),u}function $i(e){if(e&&typeof e.videoWidth=="number"&&typeof e.videoHeight=="number")return Oe.make(e.videoWidth,e.videoHeight)}const Dn=T.forwardRef(({autoLoop:e=!0,autoPlay:r=!0,hasControls:i=!1,isMuted:a=!0,playsInline:c=!0,posterSrc:u,src:d,style:g,onCanPlay:m,onEnd:b,onFullscreenChange:k,onLoadMetadata:_,onLoadMetadataComplete:P,onLoadMetadataError:A,onPause:z,onPlay:N,onSizeChange:R,onTimeUpdate:ne,...$},L)=>{const K=T.useRef(null),x=L??K,O=Xr(d,{onLoadStart:_,onLoadComplete:P,onLoadError:A}),E=qi();T.useEffect(()=>{if(!x.current)return;if(d.toLowerCase().endsWith(".m3u8")){const re=!!x.current.canPlayType("application/x-mpegURL"),oe=typeof window.Hls<"u"?window.Hls:void 0;if(!re&&oe?.isSupported()){const le=new oe;le.loadSource(d),le.attachMedia(x.current)}}const V=re=>{const oe=window.document.fullScreen||window.document.mozFullScreen||window.document.webkitIsFullScreen;oe!==void 0&&k?.(oe)};return x.current.muted=a,x.current.load(),x.current.addEventListener("webkitfullscreenchange",V),x.current.addEventListener("mozfullscreenchange",V),x.current.addEventListener("fullscreenchange",V),()=>{X(),x.current?.removeEventListener("webkitfullscreenchange",V),x.current?.removeEventListener("mozfullscreenchange",V),x.current?.removeEventListener("fullscreenchange",V)}},[d]),T.useEffect(()=>{R?.(O)},[O]);const F=V=>{const re=V.currentTarget;r&&re.paused&&W(),m?.()},G=V=>{N?.()},Q=V=>{z?.()},se=V=>{b?.()},ee=V=>{const re=V.currentTarget;ne?.(re.currentTime,re.duration)},W=()=>{x.current&&x.current.play()},X=()=>{x.current&&x.current.pause()};return w.jsx("video",{...$,ref:x,autoPlay:r,controls:i,loop:e,muted:a,playsInline:c,poster:u,style:{...E.root,...g},onCanPlay:F,onEnded:se,onPause:Q,onPlay:G,onTimeUpdate:ee,children:w.jsx("source",{src:d})})});function qi(){return{root:{fontSize:"0"}}}process.env.NODE_ENV==="development"&&(Dn.displayName="Video");const Ur=T.forwardRef(({className:e,children:r,style:i,aspectRatio:a=NaN,autoLoop:c,autoPlay:u,hasControls:d,isMuted:g,playsInline:m,posterSrc:b,src:k,onCanPlay:_,onEnd:P,onFullscreenChange:A,onLoadMetadata:z,onLoadMetadataComplete:N,onLoadMetadataError:R,onPause:ne,onPlay:$,onSizeChange:L,...K},x)=>{const O=V=>{Q(V?V.width/V.height:NaN),L?.(V)},E=x??T.useRef(null),F=Be(E),[G,Q]=T.useState(NaN),se=isNaN(a)?G:a,ee=F.width/F.height,W=Oe.make(ee>1?Math.max(F.width,F.height*se):Math.max(F.width,Math.max(F.height,F.width/se)*se),ee>1?Math.max(F.height,Math.max(F.width,F.height*se)/se):Math.max(F.height,F.width/se)),X=ke(r,{content:Vn,viewport:Bn});return w.jsxs("div",{...K,ref:E,className:e,style:ue(i,Hn.root),children:[w.jsx(Dn,{autoLoop:c,autoPlay:u,hasControls:d,isMuted:g,playsInline:m,posterSrc:b,src:k,style:ue(Hn.viewport,{width:`${W.width}px`,height:`${W.height}px`,maxWidth:"unset"}),onCanPlay:_,onEnd:P,onFullscreenChange:A,onLoadMetadata:z,onLoadMetadataComplete:N,onLoadMetadataError:R,onPause:ne,onPlay:$,onSizeChange:V=>O(V)}),X.viewport&&w.jsx(me,{element:X.viewport,style:ue(Hn.viewport,{height:`${W.height}px`,pointerEvents:"none",width:`${W.width}px`})}),X.content]})}),Vn=({children:e,...r})=>w.jsx("div",{...r,children:e}),Bn=({children:e,...r})=>w.jsx("div",{...r,children:e}),Hn={root:{overflow:"hidden"},viewport:{fontSize:"0",left:"50%",position:"absolute",top:"50%",transform:"translate(-50%, -50%)"}};process.env.NODE_ENV==="development"&&(Ur.displayName="CoverVideo",Vn.displayName="CoverVideoContent",Bn.displayName="CoverVideoViewport");const Yn=T.forwardRef((e,r)=>{switch(!0){case es(e):{const{action:i,children:a,className:c,isDisabled:u,label:d,opensInNewTab:g,...m}=e;return w.jsx("a",{...m,ref:r,"aria-disabled":u,"aria-label":d,className:ce(c,{disabled:u}),href:i,rel:g?"noopener,noreferrer":void 0,target:g?"_blank":void 0,children:a??d})}case ts(e):{const{action:i,children:a,className:c,isDisabled:u,label:d,type:g="button",...m}=e;return w.jsx("button",{...m,ref:r,"aria-disabled":u,"aria-label":d,className:c,disabled:u,type:g,onClick:i,children:a??d})}default:return console.error("[etudes::Button] Unknown button type"),w.jsx("div",{children:"asdf"})}});function es(e){return typeof e.action=="string"}function ts(e){return typeof e.action=="function"||typeof e.type=="string"}process.env.NODE_ENV==="development"&&(Yn.displayName="Button");const Kr=T.forwardRef(({index:e=0,isDisabled:r=!1,options:i,onChange:a,...c},u)=>{const d=i.length-1,g=i[e],m=typeof g=="string"?g:g?.label,b=T.useCallback(()=>{if(r)return;const k=e<d?e+1:0,_=i[k],P=typeof _=="string"?_:_?.value;a?.(P,k)},[d,r,e,i,a]);return w.jsx(Yn,{...c,ref:u,action:b,isDisabled:r,label:m})});process.env.NODE_ENV==="development"&&(Kr.displayName="OptionButton");var Xn,Gr;function ns(){return Gr||(Gr=1,Xn=function e(r,i){if(r===i)return!0;if(r&&i&&typeof r=="object"&&typeof i=="object"){if(r.constructor!==i.constructor)return!1;var a,c,u;if(Array.isArray(r)){if(a=r.length,a!=i.length)return!1;for(c=a;c--!==0;)if(!e(r[c],i[c]))return!1;return!0}if(r.constructor===RegExp)return r.source===i.source&&r.flags===i.flags;if(r.valueOf!==Object.prototype.valueOf)return r.valueOf()===i.valueOf();if(r.toString!==Object.prototype.toString)return r.toString()===i.toString();if(u=Object.keys(r),a=u.length,a!==Object.keys(i).length)return!1;for(c=a;c--!==0;)if(!Object.prototype.hasOwnProperty.call(i,u[c]))return!1;for(c=a;c--!==0;){var d=u[c];if(!(d==="_owner"&&r.$$typeof)&&!e(r[d],i[d]))return!1}return!0}return r!==r&&i!==i}),Xn}var rs=ns();const He=Rr(rs);var Vt={exports:{}},os=Vt.exports,Wr;function is(){return Wr||(Wr=1,(function(e,r){(function(i,a){e.exports=a()})(os,(function(){function i(n,t){var o=Object.keys(n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);t&&(s=s.filter((function(l){return Object.getOwnPropertyDescriptor(n,l).enumerable}))),o.push.apply(o,s)}return o}function a(n){for(var t=1;t<arguments.length;t++){var o=arguments[t]!=null?arguments[t]:{};t%2?i(Object(o),!0).forEach((function(s){m(n,s,o[s])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):i(Object(o)).forEach((function(s){Object.defineProperty(n,s,Object.getOwnPropertyDescriptor(o,s))}))}return n}function c(n){return c=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},c(n)}function u(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function d(n,t){for(var o=0;o<t.length;o++){var s=t[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(n,N(s.key),s)}}function g(n,t,o){return t&&d(n.prototype,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function m(n,t,o){return(t=N(t))in n?Object.defineProperty(n,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[t]=o,n}function b(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&&_(n,t)}function k(n){return k=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},k(n)}function _(n,t){return _=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,s){return o.__proto__=s,o},_(n,t)}function P(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function A(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,s=k(n);if(t){var l=k(this).constructor;o=Reflect.construct(s,arguments,l)}else o=s.apply(this,arguments);return(function(f,p){if(p&&(typeof p=="object"||typeof p=="function"))return p;if(p!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return P(f)})(this,o)}}function z(){return z=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(n,t,o){var s=(function(f,p){for(;!Object.prototype.hasOwnProperty.call(f,p)&&(f=k(f))!==null;);return f})(n,t);if(s){var l=Object.getOwnPropertyDescriptor(s,t);return l.get?l.get.call(arguments.length<3?n:o):l.value}},z.apply(this,arguments)}function N(n){var t=(function(o,s){if(typeof o!="object"||o===null)return o;var l=o[Symbol.toPrimitive];if(l!==void 0){var f=l.call(o,s);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},ne=void 0,$=void 0;function L(n){ne=n;var t=n.document.createTextNode("");t.ownerDocument!==n.document&&typeof n.wrap=="function"&&n.wrap(t)===t&&(n=n.wrap(n)),$=n}function K(n){return R(n)?n:(n.ownerDocument||n).defaultView||$.window}typeof window<"u"&&window&&L(window);var x=function(n){return!!n&&c(n)==="object"},O=function(n){return typeof n=="function"},E={window:function(n){return n===$||R(n)},docFrag:function(n){return x(n)&&n.nodeType===11},object:x,func:O,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||c(n)!=="object")return!1;var t=K(n)||$;return/object|function/.test(typeof Element>"u"?"undefined":c(Element))?n instanceof Element||n instanceof t.Element:n.nodeType===1&&typeof n.nodeName=="string"},plainObject:function(n){return x(n)&&!!n.constructor&&/function Object\b/.test(n.constructor.toString())},array:function(n){return x(n)&&n.length!==void 0&&O(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 G(n){var t=n.iEvent,o=n.interaction;if(o.prepared.name==="drag"){var s=o.prepared.axis;if(s==="x"||s==="y"){var l=s==="x"?"y":"x";t.page[l]=o.coords.start.page[l],t.client[l]=o.coords.start.client[l],t.delta[l]=0}}}var Q={id:"actions/drag",install:function(n){var t=n.actions,o=n.Interactable,s=n.defaults;o.prototype.draggable=Q.draggable,t.map.drag=Q,t.methodDict.drag="draggable",s.actions.drag=Q.defaults},listeners:{"interactions:before-action-move":F,"interactions:action-resume":F,"interactions:action-move":G,"auto-start:check":function(n){var t=n.interaction,o=n.interactable,s=n.buttons,l=o.options.drag;if(l&&l.enabled&&(!t.pointerIsDown||!/mouse|pointer/.test(t.pointerType)||(s&o.options.drag.mouseButtons)!=0))return n.action={name:"drag",axis:l.lockAxis==="start"?l.startAxis:l.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:G,defaults:{startAxis:"xy",lockAxis:"xy"},getCursor:function(){return"move"},filterEventType:function(n){return n.search("drag")===0}},se=Q,ee={init:function(n){var t=n;ee.document=t.document,ee.DocumentFragment=t.DocumentFragment||W,ee.SVGElement=t.SVGElement||W,ee.SVGSVGElement=t.SVGSVGElement||W,ee.SVGElementInstance=t.SVGElementInstance||W,ee.Element=t.Element||W,ee.HTMLElement=t.HTMLElement||ee.Element,ee.Event=t.Event,ee.Touch=t.Touch||W,ee.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 W(){}var X=ee,V={init:function(n){var t=X.Element,o=n.navigator||{};V.supportsTouch="ontouchstart"in n||E.func(n.DocumentTouch)&&X.document instanceof n.DocumentTouch,V.supportsPointerEvent=o.pointerEnabled!==!1&&!!X.PointerEvent,V.isIOS=/iP(hone|od|ad)/.test(o.platform),V.isIOS7=/iP(hone|od|ad)/.test(o.platform)&&/OS 7[^\d]/.test(o.appVersion),V.isIe9=/MSIE 9/.test(o.userAgent),V.isOperaMobile=o.appName==="Opera"&&V.supportsTouch&&/Presto/.test(o.userAgent),V.prefixedMatchesSelector="matches"in t.prototype?"matches":"webkitMatchesSelector"in t.prototype?"webkitMatchesSelector":"mozMatchesSelector"in t.prototype?"mozMatchesSelector":"oMatchesSelector"in t.prototype?"oMatchesSelector":"msMatchesSelector",V.pEventTypes=V.supportsPointerEvent?X.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,V.wheelEvent=X.document&&"onmousewheel"in X.document?"mousewheel":"wheel"},supportsTouch:null,supportsPointerEvent:null,isIOS7:null,isIOS:null,isIe9:null,isOperaMobile:null,prefixedMatchesSelector:null,pEventTypes:null,wheelEvent:null},re=V;function oe(n,t){if(n.contains)return n.contains(t);for(;t;){if(t===n)return!0;t=t.parentNode}return!1}function le(n,t){for(;E.element(n);){if(D(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 D(n,t){return $!==ne&&(t=t.replace(/\/deep\//g," ")),n[re.prefixedMatchesSelector](t)}var I=function(n){return n.parentNode||n.host};function J(n,t){for(var o,s=[],l=n;(o=I(l))&&l!==t&&o!==l.ownerDocument;)s.unshift(l),l=o;return s}function q(n,t,o){for(;E.element(n);){if(D(n,t))return!0;if((n=H(n))===o)return D(n,t)}return!1}function Z(n){return n.correspondingUseElement||n}function pe(n){var t=n instanceof X.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 ve(n){var t,o=pe(n);if(!re.isIOS7&&o){var s={x:(t=(t=K(n))||$).scrollX||t.document.documentElement.scrollLeft,y:t.scrollY||t.document.documentElement.scrollTop};o.left+=s.x,o.right+=s.x,o.top+=s.y,o.bottom+=s.y}return o}function de(n){for(var t=[];n;)t.push(n),n=H(n);return t}function Ne(n){return!!E.string(n)&&(X.document.querySelector(n),!0)}function te(n,t){for(var o in t)n[o]=t[o];return n}function De(n,t,o){return n==="parent"?H(o):n==="self"?t.getRect(o):le(o,n)}function Pe(n,t,o,s){var l=n;return E.string(l)?l=De(l,t,o):E.func(l)&&(l=l.apply(void 0,s)),E.element(l)&&(l=ve(l)),l}function Ce(n){return n&&{x:"x"in n?n.x:n.left,y:"y"in n?n.y:n.top}}function Ve(n){return!n||"x"in n&&"y"in n||((n=te({},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 Me(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 Ye(n,t,o){var s=o&&n.options[o];return Ce(Pe(s&&s.origin||n.options.origin,n,t,[n&&t]))||{x:0,y:0}}function Xe(n,t){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(v){return!0},s=arguments.length>3?arguments[3]:void 0;if(s=s||{},E.string(n)&&n.search(" ")!==-1&&(n=$o(n)),E.array(n))return n.forEach((function(v){return Xe(v,t,o,s)})),s;if(E.object(n)&&(t=n,n=""),E.func(t)&&o(n))s[n]=s[n]||[],s[n].push(t);else if(E.array(t))for(var l=0,f=t;l<f.length;l++){var p=f[l];Xe(n,p,o,s)}else if(E.object(t))for(var h in t)Xe($o(h).map((function(v){return"".concat(n).concat(v)})),t[h],o,s);return s}function $o(n){return n.trim().split(/ +/)}var Ct=function(n,t){return Math.sqrt(n*n+t*t)},xc=["webkit","moz"];function bn(n,t){n.__set||(n.__set={});var o=function(l){if(xc.some((function(f){return l.indexOf(f)===0})))return 1;typeof n[l]!="function"&&l!=="__set"&&Object.defineProperty(n,l,{get:function(){return l in n.__set?n.__set[l]:n.__set[l]=t[l]},set:function(f){n.__set[l]=f},configurable:!0})};for(var s in t)o(s);return n}function wn(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 qo(n){n.page.x=0,n.page.y=0,n.client.x=0,n.client.y=0}function ei(n){return n instanceof X.Event||n instanceof X.Touch}function xn(n,t,o){return n=n||"page",(o=o||{}).x=t[n+"X"],o.y=t[n+"Y"],o}function ti(n,t){return t=t||{x:0,y:0},re.isOperaMobile&&ei(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 Ec(n,t,o){var s=t.length>1?ni(t):t[0];ti(s,n.page),(function(l,f){f=f||{},re.isOperaMobile&&ei(l)?xn("screen",l,f):xn("client",l,f)})(s,n.client),n.timeStamp=o}function ur(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 ni(n){for(var t={pageX:0,pageY:0,clientX:0,clientY:0,screenX:0,screenY:0},o=0;o<n.length;o++){var s=n[o];for(var l in t)t[l]+=s[l]}for(var f in t)t[f]/=n.length;return t}function fr(n){if(!n.length)return null;var t=ur(n),o=Math.min(t[0].pageX,t[1].pageX),s=Math.min(t[0].pageY,t[1].pageY),l=Math.max(t[0].pageX,t[1].pageX),f=Math.max(t[0].pageY,t[1].pageY);return{x:o,y:s,left:o,top:s,right:l,bottom:f,width:l-o,height:f-s}}function dr(n,t){var o=t+"X",s=t+"Y",l=ur(n),f=l[0][o]-l[1][o],p=l[0][s]-l[1][s];return Ct(f,p)}function pr(n,t){var o=t+"X",s=t+"Y",l=ur(n),f=l[1][o]-l[0][o],p=l[1][s]-l[0][s];return 180*Math.atan2(p,f)/Math.PI}function ri(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 X.Touch?"touch":"mouse"}function oi(n){var t=E.func(n.composedPath)?n.composedPath():n.path;return[Z(t?t[0]:n.target),Z(n.currentTarget)]}var En=(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(En.prototype,"interaction",{get:function(){return this._interaction._proxy},set:function(){}});var ii=function(n,t){for(var o=0;o<t.length;o++){var s=t[o];n.push(s)}return n},si=function(n){return ii([],n)},Ot=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[Ot(n,t)]},lt=(function(n){b(o,n);var t=A(o);function o(s,l,f){var p;u(this,o),(p=t.call(this,l._interaction)).dropzone=void 0,p.dragEvent=void 0,p.relatedTarget=void 0,p.draggable=void 0,p.propagationStopped=!1,p.immediatePropagationStopped=!1;var h=f==="dragleave"?s.prev:s.cur,v=h.element,S=h.dropzone;return p.type=f,p.target=v,p.currentTarget=v,p.dropzone=S,p.dragEvent=l,p.relatedTarget=l.target,p.draggable=l.interactable,p.timeStamp=l.timeStamp,p}return g(o,[{key:"reject",value:function(){var s=this,l=this._interaction.dropState;if(this.type==="dropactivate"||this.dropzone&&l.cur.dropzone===this.dropzone&&l.cur.element===this.target)if(l.prev.dropzone=this.dropzone,l.prev.element=this.target,l.rejected=!0,l.events.enter=null,this.stopImmediatePropagation(),this.type==="dropactivate"){var f=l.activeDrops,p=Ot(f,(function(v){var S=v.dropzone,y=v.element;return S===s.dropzone&&y===s.target}));l.activeDrops.splice(p,1);var h=new o(l,this.dragEvent,"dropdeactivate");h.dropzone=this.dropzone,h.target=this.target,this.dropzone.fire(h)}else this.dropzone.fire(new o(l,this.dragEvent,"dragleave"))}},{key:"preventDefault",value:function(){}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}}]),o})(En);function ai(n,t){for(var o=0,s=n.slice();o<s.length;o++){var l=s[o],f=l.dropzone,p=l.element;t.dropzone=f,t.target=p,f.fire(t),t.propagationStopped=t.immediatePropagationStopped=!1}}function hr(n,t){for(var o=(function(f,p){for(var h=[],v=0,S=f.interactables.list;v<S.length;v++){var y=S[v];if(y.options.drop.enabled){var C=y.options.drop.accept;if(!(E.element(C)&&C!==p||E.string(C)&&!D(p,C)||E.func(C)&&!C({dropzone:y,draggableElement:p})))for(var M=0,Y=y.getAllElements();M<Y.length;M++){var B=Y[M];B!==p&&h.push({dropzone:y,element:B,rect:y.getRect(B)})}}}return h})(n,t),s=0;s<o.length;s++){var l=o[s];l.rect=l.dropzone.getRect(l.element)}return o}function ci(n,t,o){for(var s=n.dropState,l=n.interactable,f=n.element,p=[],h=0,v=s.activeDrops;h<v.length;h++){var S=v[h],y=S.dropzone,C=S.element,M=S.rect,Y=y.dropCheck(t,o,l,f,C,M);p.push(Y?C:null)}var B=(function(U){for(var ae,ie,fe,ye=[],xe=0;xe<U.length;xe++){var he=U[xe],be=U[ae];if(he&&xe!==ae)if(be){var je=I(he),Te=I(be);if(je!==he.ownerDocument)if(Te!==he.ownerDocument)if(je!==Te){ye=ye.length?ye:J(be);var ze=void 0;if(be instanceof X.HTMLElement&&he instanceof X.SVGElement&&!(he instanceof X.SVGSVGElement)){if(he===Te)continue;ze=he.ownerSVGElement}else ze=he;for(var Le=J(ze,be.ownerDocument),Ge=0;Le[Ge]&&Le[Ge]===ye[Ge];)Ge++;var In=[Le[Ge-1],Le[Ge],ye[Ge]];if(In[0])for(var zt=In[0].lastChild;zt;){if(zt===In[1]){ae=xe,ye=Le;break}if(zt===In[2])break;zt=zt.previousSibling}}else fe=be,(parseInt(K(ie=he).getComputedStyle(ie).zIndex,10)||0)>=(parseInt(K(fe).getComputedStyle(fe).zIndex,10)||0)&&(ae=xe);else ae=xe}else ae=xe}return ae})(p);return s.activeDrops[B]||null}function gr(n,t,o){var s=n.dropState,l={enter:null,leave:null,activate:null,deactivate:null,move:null,drop:null};return o.type==="dragstart"&&(l.activate=new lt(s,o,"dropactivate"),l.activate.target=null,l.activate.dropzone=null),o.type==="dragend"&&(l.deactivate=new lt(s,o,"dropdeactivate"),l.deactivate.target=null,l.deactivate.dropzone=null),s.rejected||(s.cur.element!==s.prev.element&&(s.prev.dropzone&&(l.leave=new lt(s,o,"dragleave"),o.dragLeave=l.leave.target=s.prev.element,o.prevDropzone=l.leave.dropzone=s.prev.dropzone),s.cur.dropzone&&(l.enter=new lt(s,o,"dragenter"),o.dragEnter=s.cur.element,o.dropzone=s.cur.dropzone)),o.type==="dragend"&&s.cur.dropzone&&(l.drop=new lt(s,o,"drop"),o.dropzone=s.cur.dropzone,o.relatedTarget=s.cur.element),o.type==="dragmove"&&s.cur.dropzone&&(l.move=new lt(s,o,"dropmove"),o.dropzone=s.cur.dropzone)),l}function mr(n,t){var o=n.dropState,s=o.activeDrops,l=o.cur,f=o.prev;t.leave&&f.dropzone.fire(t.leave),t.enter&&l.dropzone.fire(t.enter),t.move&&l.dropzone.fire(t.move),t.drop&&l.dropzone.fire(t.drop),t.deactivate&&ai(s,t.deactivate),o.prev.dropzone=l.dropzone,o.prev.element=l.element}function li(n,t){var o=n.interaction,s=n.iEvent,l=n.event;if(s.type==="dragmove"||s.type==="dragend"){var f=o.dropState;t.dynamicDrop&&(f.activeDrops=hr(t,o.element));var p=s,h=ci(o,p,l);f.rejected=f.rejected&&!!h&&h.dropzone===f.cur.dropzone&&h.element===f.cur.element,f.cur.dropzone=h&&h.dropzone,f.cur.element=h&&h.element,f.events=gr(o,0,p)}}var ui={id:"actions/drop",install:function(n){var t=n.actions,o=n.interactStatic,s=n.Interactable,l=n.defaults;n.usePlugin(se),s.prototype.dropzone=function(f){return(function(p,h){if(E.object(h)){if(p.options.drop.enabled=h.enabled!==!1,h.listeners){var v=Xe(h.listeners),S=Object.keys(v).reduce((function(C,M){return C[/^(enter|leave)/.test(M)?"drag".concat(M):/^(activate|deactivate|move)/.test(M)?"drop".concat(M):M]=v[M],C}),{}),y=p.options.drop.listeners;y&&p.off(y),p.on(S),p.options.drop.listeners=S}return E.func(h.ondrop)&&p.on("drop",h.ondrop),E.func(h.ondropactivate)&&p.on("dropactivate",h.ondropactivate),E.func(h.ondropdeactivate)&&p.on("dropdeactivate",h.ondropdeactivate),E.func(h.ondragenter)&&p.on("dragenter",h.ondragenter),E.func(h.ondragleave)&&p.on("dragleave",h.ondragleave),E.func(h.ondropmove)&&p.on("dropmove",h.ondropmove),/^(pointer|center)$/.test(h.overlap)?p.options.drop.overlap=h.overlap:E.number(h.overlap)&&(p.options.drop.overlap=Math.max(Math.min(1,h.overlap),0)),"accept"in h&&(p.options.drop.accept=h.accept),"checker"in h&&(p.options.drop.checker=h.checker),p}return E.bool(h)?(p.options.drop.enabled=h,p):p.options.drop})(this,f)},s.prototype.dropCheck=function(f,p,h,v,S,y){return(function(C,M,Y,B,U,ae,ie){var fe=!1;if(!(ie=ie||C.getRect(ae)))return!!C.options.drop.checker&&C.options.drop.checker(M,Y,fe,C,ae,B,U);var ye=C.options.drop.overlap;if(ye==="pointer"){var xe=Ye(B,U,"drag"),he=ti(M);he.x+=xe.x,he.y+=xe.y;var be=he.x>ie.left&&he.x<ie.right,je=he.y>ie.top&&he.y<ie.bottom;fe=be&&je}var Te=B.getRect(U);if(Te&&ye==="center"){var ze=Te.left+Te.width/2,Le=Te.top+Te.height/2;fe=ze>=ie.left&&ze<=ie.right&&Le>=ie.top&&Le<=ie.bottom}return Te&&E.number(ye)&&(fe=Math.max(0,Math.min(ie.right,Te.right)-Math.max(ie.left,Te.left))*Math.max(0,Math.min(ie.bottom,Te.bottom)-Math.max(ie.top,Te.top))/(Te.width*Te.height)>=ye),C.options.drop.checker&&(fe=C.options.drop.checker(M,Y,fe,C,ae,B,U)),fe})(this,f,p,h,v,S,y)},o.dynamicDrop=function(f){return E.bool(f)?(n.dynamicDrop=f,o):n.dynamicDrop},te(t.phaselessTypes,{dragenter:!0,dragleave:!0,dropactivate:!0,dropdeactivate:!0,dropmove:!0,drop:!0}),t.methodDict.drop="dropzone",n.dynamicDrop=!1,l.actions.drop=ui.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,s=n.iEvent;if(o.prepared.name==="drag"){var l=o.dropState;l.activeDrops=[],l.events={},l.activeDrops=hr(t,o.element),l.events=gr(o,0,s),l.events.activate&&(ai(l.activeDrops,l.events.activate),t.fire("actions/drop:start",{interaction:o,dragEvent:s}))}},"interactions:action-move":li,"interactions:after-action-move":function(n,t){var o=n.interaction,s=n.iEvent;if(o.prepared.name==="drag"){var l=o.dropState;mr(o,l.events),t.fire("actions/drop:move",{interaction:o,dragEvent:s}),l.events={}}},"interactions:action-end":function(n,t){if(n.interaction.prepared.name==="drag"){var o=n.interaction,s=n.iEvent;li(n,t),mr(o,o.dropState.events),t.fire("actions/drop:end",{interaction:o,dragEvent:s})}},"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:ci,getDropEvents:gr,fireDropEvents:mr,filterEventType:function(n){return n.search("drag")===0||n.search("drop")===0},defaults:{enabled:!1,accept:null,overlap:"pointer"}},Nc=ui;function vr(n){var t=n.interaction,o=n.iEvent,s=n.phase;if(t.prepared.name==="gesture"){var l=t.pointers.map((function(S){return S.pointer})),f=s==="start",p=s==="end",h=t.interactable.options.deltaSource;if(o.touches=[l[0],l[1]],f)o.distance=dr(l,h),o.box=fr(l),o.scale=1,o.ds=0,o.angle=pr(l,h),o.da=0,t.gesture.startDistance=o.distance,t.gesture.startAngle=o.angle;else if(p||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=dr(l,h),o.box=fr(l),o.scale=o.distance/t.gesture.startDistance,o.angle=pr(l,h),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 yr={id:"actions/gesture",before:["actions/drag","actions/resize"],install:function(n){var t=n.actions,o=n.Interactable,s=n.defaults;o.prototype.gesturable=function(l){return E.object(l)?(this.options.gesture.enabled=l.enabled!==!1,this.setPerAction("gesture",l),this.setOnEvents("gesture",l),this):E.bool(l)?(this.options.gesture.enabled=l,this):this.options.gesture},t.map.gesture=yr,t.methodDict.gesture="gesturable",s.actions.gesture=yr.defaults},listeners:{"interactions:action-start":vr,"interactions:action-move":vr,"interactions:action-end":vr,"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}},Sc=yr;function Tc(n,t,o,s,l,f,p){if(!t)return!1;if(t===!0){var h=E.number(f.width)?f.width:f.right-f.left,v=E.number(f.height)?f.height:f.bottom-f.top;if(p=Math.min(p,Math.abs((n==="left"||n==="right"?h:v)/2)),h<0&&(n==="left"?n="right":n==="right"&&(n="left")),v<0&&(n==="top"?n="bottom":n==="bottom"&&(n="top")),n==="left"){var S=h>=0?f.left:f.right;return o.x<S+p}if(n==="top"){var y=v>=0?f.top:f.bottom;return o.y<y+p}if(n==="right")return o.x>(h>=0?f.right:f.left)-p;if(n==="bottom")return o.y>(v>=0?f.bottom:f.top)-p}return!!E.element(s)&&(E.element(t)?t===s:q(s,t,l))}function fi(n){var t=n.iEvent,o=n.interaction;if(o.prepared.name==="resize"&&o.resizeAxes){var s=t;o.interactable.options.resize.square?(o.resizeAxes==="y"?s.delta.x=s.delta.y:s.delta.y=s.delta.x,s.axes="xy"):(s.axes=o.resizeAxes,o.resizeAxes==="x"?s.delta.y=0:o.resizeAxes==="y"&&(s.delta.x=0))}}var Ue,ot,Ke={id:"actions/resize",before:["actions/drag"],install:function(n){var t=n.actions,o=n.browser,s=n.Interactable,l=n.defaults;Ke.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),Ke.defaultMargin=o.supportsTouch||o.supportsPointerEvent?20:10,s.prototype.resizable=function(f){return(function(p,h,v){return E.object(h)?(p.options.resize.enabled=h.enabled!==!1,p.setPerAction("resize",h),p.setOnEvents("resize",h),E.string(h.axis)&&/^x$|^y$|^xy$/.test(h.axis)?p.options.resize.axis=h.axis:h.axis===null&&(p.options.resize.axis=v.defaults.actions.resize.axis),E.bool(h.preserveAspectRatio)?p.options.resize.preserveAspectRatio=h.preserveAspectRatio:E.bool(h.square)&&(p.options.resize.square=h.square),p):E.bool(h)?(p.options.resize.enabled=h,p):p.options.resize})(this,f,n)},t.map.resize=Ke,t.methodDict.resize="resizable",l.actions.resize=Ke.defaults},listeners:{"interactions:new":function(n){n.interaction.resizeAxes="xy"},"interactions:action-start":function(n){(function(t){var o=t.iEvent,s=t.interaction;if(s.prepared.name==="resize"&&s.prepared.edges){var l=o,f=s.rect;s._rects={start:te({},f),corrected:te({},f),previous:te({},f),delta:{left:0,right:0,width:0,top:0,bottom:0,height:0}},l.edges=s.prepared.edges,l.rect=s._rects.corrected,l.deltaRect=s._rects.delta}})(n),fi(n)},"interactions:action-move":function(n){(function(t){var o=t.iEvent,s=t.interaction;if(s.prepared.name==="resize"&&s.prepared.edges){var l=o,f=s.interactable.options.resize.invert,p=f==="reposition"||f==="negate",h=s.rect,v=s._rects,S=v.start,y=v.corrected,C=v.delta,M=v.previous;if(te(M,y),p){if(te(y,h),f==="reposition"){if(y.top>y.bottom){var Y=y.top;y.top=y.bottom,y.bottom=Y}if(y.left>y.right){var B=y.left;y.left=y.right,y.right=B}}}else y.top=Math.min(h.top,S.bottom),y.bottom=Math.max(h.bottom,S.top),y.left=Math.min(h.left,S.right),y.right=Math.max(h.right,S.left);for(var U in y.width=y.right-y.left,y.height=y.bottom-y.top,y)C[U]=y[U]-M[U];l.edges=s.prepared.edges,l.rect=y,l.deltaRect=C}})(n),fi(n)},"interactions:action-end":function(n){var t=n.iEvent,o=n.interaction;if(o.prepared.name==="resize"&&o.prepared.edges){var s=t;s.edges=o.prepared.edges,s.rect=o._rects.corrected,s.deltaRect=o._rects.delta}},"auto-start:check":function(n){var t=n.interaction,o=n.interactable,s=n.element,l=n.rect,f=n.buttons;if(l){var p=te({},t.coords.cur.page),h=o.options.resize;if(h&&h.enabled&&(!t.pointerIsDown||!/mouse|pointer/.test(t.pointerType)||(f&h.mouseButtons)!=0)){if(E.object(h.edges)){var v={left:!1,right:!1,top:!1,bottom:!1};for(var S in v)v[S]=Tc(S,h.edges[S],p,t._latestPointer.eventTarget,s,l,h.margin||Ke.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=h.axis!=="y"&&p.x>l.right-Ke.defaultMargin,C=h.axis!=="x"&&p.y>l.bottom-Ke.defaultMargin;(y||C)&&(n.action={name:"resize",axes:(y?"x":"")+(C?"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,s=n.name,l=Ke.cursors,f=null;if(o)f=l[s+o];else if(t){for(var p="",h=0,v=["top","bottom","left","right"];h<v.length;h++){var S=v[h];t[S]&&(p+=S)}f=l[p]}return f},filterEventType:function(n){return n.search("resize")===0},defaultMargin:null},_c=Ke,Cc={id:"actions",install:function(n){n.usePlugin(Sc),n.usePlugin(_c),n.usePlugin(se),n.usePlugin(Nc)}},di=0,Ze={request:function(n){return Ue(n)},cancel:function(n){return ot(n)},init:function(n){if(Ue=n.requestAnimationFrame,ot=n.cancelAnimationFrame,!Ue)for(var t=["ms","moz","webkit","o"],o=0;o<t.length;o++){var s=t[o];Ue=n["".concat(s,"RequestAnimationFrame")],ot=n["".concat(s,"CancelAnimationFrame")]||n["".concat(s,"CancelRequestAnimationFrame")]}Ue=Ue&&Ue.bind(n),ot=ot&&ot.bind(n),Ue||(Ue=function(l){var f=Date.now(),p=Math.max(0,16-(f-di)),h=n.setTimeout((function(){l(f+p)}),p);return di=f+p,h},ot=function(l){return clearTimeout(l)})}},ge={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){ge.isScrolling=!0,Ze.cancel(ge.i),n.autoScroll=ge,ge.interaction=n,ge.prevTime=ge.now(),ge.i=Ze.request(ge.scroll)},stop:function(){ge.isScrolling=!1,ge.interaction&&(ge.interaction.autoScroll=null),Ze.cancel(ge.i)},scroll:function(){var n=ge.interaction,t=n.interactable,o=n.element,s=n.prepared.name,l=t.options[s].autoScroll,f=pi(l.container,t,o),p=ge.now(),h=(p-ge.prevTime)/1e3,v=l.speed*h;if(v>=1){var S={x:ge.x*v,y:ge.y*v};if(S.x||S.y){var y=hi(f);E.window(f)?f.scrollBy(S.x,S.y):f&&(f.scrollLeft+=S.x,f.scrollTop+=S.y);var C=hi(f),M={x:C.x-y.x,y:C.y-y.y};(M.x||M.y)&&t.fire({type:"autoscroll",target:o,interactable:t,delta:M,interaction:n,container:f})}ge.prevTime=p}ge.isScrolling&&(Ze.cancel(ge.i),ge.i=Ze.request(ge.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()&&ge.check(t.interactable,t.prepared.name))if(t.simulation)ge.x=ge.y=0;else{var s,l,f,p,h=t.interactable,v=t.element,S=t.prepared.name,y=h.options[S].autoScroll,C=pi(y.container,h,v);if(E.window(C))p=o.clientX<ge.margin,s=o.clientY<ge.margin,l=o.clientX>C.innerWidth-ge.margin,f=o.clientY>C.innerHeight-ge.margin;else{var M=pe(C);p=o.clientX<M.left+ge.margin,s=o.clientY<M.top+ge.margin,l=o.clientX>M.right-ge.margin,f=o.clientY>M.bottom-ge.margin}ge.x=l?1:p?-1:0,ge.y=f?1:s?-1:0,ge.isScrolling||(ge.margin=y.margin,ge.speed=y.speed,ge.start(t))}}};function pi(n,t,o){return(E.string(n)?De(n,t,o):n)||K(o)}function hi(n){return E.window(n)&&(n=window.document.body),{x:n.scrollLeft,y:n.scrollTop}}var kc={id:"auto-scroll",install:function(n){var t=n.defaults,o=n.actions;n.autoScroll=ge,ge.now=function(){return n.now()},o.phaselessTypes.autoscroll=!0,t.perAction.autoScroll=ge.defaults},listeners:{"interactions:new":function(n){n.interaction.autoScroll=null},"interactions:destroy":function(n){n.interaction.autoScroll=null,ge.stop(),ge.interaction&&(ge.interaction=null)},"interactions:stop":ge.stop,"interactions:action-move":function(n){return ge.onInteractionMove(n)}}},Oc=kc;function It(n,t){var o=!1;return function(){return o||($.console.warn(t),o=!0),n.apply(this,arguments)}}function br(n,t){return n.name=t.name,n.axis=t.axis,n.edges=t.edges,n}function Pc(n){return E.bool(n)?(this.options.styleCursor=n,this):n===null?(delete this.options.styleCursor,this):this.options.styleCursor}function Ic(n){return E.func(n)?(this.options.actionChecker=n,this):n===null?(delete this.options.actionChecker,this):this.options.actionChecker}var Rc={id:"auto-start/interactableMethods",install:function(n){var t=n.Interactable;t.prototype.getAction=function(o,s,l,f){var p=(function(h,v,S,y,C){var M=h.getRect(y),Y=v.buttons||{0:1,1:4,3:8,4:16}[v.button],B={action:null,interactable:h,interaction:S,element:y,rect:M,buttons:Y};return C.fire("auto-start:check",B),B.action})(this,s,l,f,n);return this.options.actionChecker?this.options.actionChecker(o,s,p,this,f,l):p},t.prototype.ignoreFrom=It((function(o){return this._backCompatOption("ignoreFrom",o)}),"Interactable.ignoreFrom() has been deprecated. Use Interactble.draggable({ignoreFrom: newValue})."),t.prototype.allowFrom=It((function(o){return this._backCompatOption("allowFrom",o)}),"Interactable.allowFrom() has been deprecated. Use Interactble.draggable({allowFrom: newValue})."),t.prototype.actionChecker=Ic,t.prototype.styleCursor=Pc}};function gi(n,t,o,s,l){return t.testIgnoreAllow(t.options[n.name],o,s)&&t.options[n.name].enabled&&Nn(t,o,n,l)?n:null}function jc(n,t,o,s,l,f,p){for(var h=0,v=s.length;h<v;h++){var S=s[h],y=l[h],C=S.getAction(t,o,n,y);if(C){var M=gi(C,S,y,f,p);if(M)return{action:M,interactable:S,element:y}}}return{action:null,interactable:null,element:null}}function mi(n,t,o,s,l){var f=[],p=[],h=s;function v(y){f.push(y),p.push(h)}for(;E.element(h);){f=[],p=[],l.interactables.forEachMatch(h,v);var S=jc(n,t,o,f,p,s,l);if(S.action&&!S.interactable.options[S.action.name].manualStart)return S;h=H(h)}return{action:null,interactable:null,element:null}}function vi(n,t,o){var s=t.action,l=t.interactable,f=t.element;s=s||{name:null},n.interactable=l,n.element=f,br(n.prepared,s),n.rect=l&&s.name?l.getRect(f):null,bi(n,o),o.fire("autoStart:prepared",{interaction:n})}function Nn(n,t,o,s){var l=n.options,f=l[o.name].max,p=l[o.name].maxPerElement,h=s.autoStart.maxInteractions,v=0,S=0,y=0;if(!(f&&p&&h))return!1;for(var C=0,M=s.interactions.list;C<M.length;C++){var Y=M[C],B=Y.prepared.name;if(Y.interacting()&&(++v>=h||Y.interactable===n&&((S+=B===o.name?1:0)>=f||Y.element===t&&(y++,B===o.name&&y>=p))))return!1}return h>0}function yi(n,t){return E.number(n)?(t.autoStart.maxInteractions=n,this):t.autoStart.maxInteractions}function wr(n,t,o){var s=o.autoStart.cursorElement;s&&s!==n&&(s.style.cursor=""),n.ownerDocument.documentElement.style.cursor=t,n.style.cursor=t,o.autoStart.cursorElement=t?n:null}function bi(n,t){var o=n.interactable,s=n.element,l=n.prepared;if(n.pointerType==="mouse"&&o&&o.options.styleCursor){var f="";if(l.name){var p=o.options[l.name].cursorChecker;f=E.func(p)?p(l,o,s,n._interacting):t.actions.map[l.name].getCursor(l)}wr(n.element,f||"",t)}else t.autoStart.cursorElement&&wr(t.autoStart.cursorElement,"",t)}var Ac={id:"auto-start/base",before:["actions"],install:function(n){var t=n.interactStatic,o=n.defaults;n.usePlugin(Rc),o.base.actionChecker=null,o.base.styleCursor=!0,te(o.perAction,{manualStart:!1,max:1/0,maxPerElement:1,allowFrom:null,ignoreFrom:null,mouseButtons:1}),t.maxInteractions=function(s){return yi(s,n)},n.autoStart={maxInteractions:1/0,withinInteractionLimit:Nn,cursorElement:null}},listeners:{"interactions:down":function(n,t){var o=n.interaction,s=n.pointer,l=n.event,f=n.eventTarget;o.interacting()||vi(o,mi(o,s,l,f,t),t)},"interactions:move":function(n,t){(function(o,s){var l=o.interaction,f=o.pointer,p=o.event,h=o.eventTarget;l.pointerType!=="mouse"||l.pointerIsDown||l.interacting()||vi(l,mi(l,f,p,h,s),s)})(n,t),(function(o,s){var l=o.interaction;if(l.pointerIsDown&&!l.interacting()&&l.pointerWasMoved&&l.prepared.name){s.fire("autoStart:before-start",o);var f=l.interactable,p=l.prepared.name;p&&f&&(f.options[p].manualStart||!Nn(f,l.element,l.prepared,s)?l.stop():(l.start(l.prepared,f,l.element),bi(l,s)))}})(n,t)},"interactions:stop":function(n,t){var o=n.interaction,s=o.interactable;s&&s.options.styleCursor&&wr(o.element,"",t)}},maxInteractions:yi,withinInteractionLimit:Nn,validateAction:gi},xr=Ac,Mc={id:"auto-start/dragAxis",listeners:{"autoStart:before-start":function(n,t){var o=n.interaction,s=n.eventTarget,l=n.dx,f=n.dy;if(o.prepared.name==="drag"){var p=Math.abs(l),h=Math.abs(f),v=o.interactable.options.drag,S=v.startAxis,y=p>h?"x":p<h?"y":"xy";if(o.prepared.axis=v.lockAxis==="start"?y[0]:v.lockAxis,y!=="xy"&&S!=="xy"&&S!==y){o.prepared.name=null;for(var C=s,M=function(B){if(B!==o.interactable){var U=o.interactable.options.drag;if(!U.manualStart&&B.testIgnoreAllow(U,C,s)){var ae=B.getAction(o.downPointer,o.downEvent,o,C);if(ae&&ae.name==="drag"&&(function(ie,fe){if(!fe)return!1;var ye=fe.options.drag.startAxis;return ie==="xy"||ye==="xy"||ye===ie})(y,B)&&xr.validateAction(ae,B,C,s,t))return B}}};E.element(C);){var Y=t.interactables.forEachMatch(C,M);if(Y){o.prepared.name="drag",o.interactable=Y,o.element=C;break}C=H(C)}}}}}};function Er(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 zc={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=Er(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;Er(t)>0&&(t.prepared.name=null)}},getHoldDuration:Er},Lc=zc,Fc={id:"auto-start",install:function(n){n.usePlugin(xr),n.usePlugin(Lc),n.usePlugin(Mc)}},Dc=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 Vc(n){var t=n.interaction,o=n.event;t.interactable&&t.interactable.checkAndPreventDefault(o)}var wi={id:"core/interactablePreventDefault",install:function(n){var t=n.Interactable;t.prototype.preventDefault=Dc,t.prototype.checkAndPreventDefault=function(o){return(function(s,l,f){var p=s.options.preventDefault;if(p!=="never")if(p!=="always"){if(l.events.supportsPassive&&/^touch(start|move)$/.test(f.type)){var h=K(f.target).document,v=l.getDocOptions(h);if(!v||!v.events||v.events.passive!==!1)return}/^(mouse|pointer|touch)*(down|start)/i.test(f.type)||E.element(f.target)&&D(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 s=0,l=n.interactions.list;s<l.length;s++){var f=l[s];if(f.element&&(f.element===o.target||oe(f.element,o.target)))return void f.interactable.checkAndPreventDefault(o)}}})},listeners:["down","move","up","cancel"].reduce((function(n,t){return n["interactions:".concat(t)]=Vc,n}),{})};function Sn(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 ut(n){var t={};for(var o in n){var s=n[o];E.plainObject(s)?t[o]=ut(s):E.array(s)?t[o]=si(s):t[o]=s}return t}var Nr=(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=Tn(),this.edges={left:!1,right:!1,top:!1,bottom:!1}}return g(n,[{key:"start",value:function(t,o){var s,l,f=t.phase,p=this.interaction,h=(function(S){var y=S.interactable.options[S.prepared.name],C=y.modifiers;return C&&C.length?C:["snap","snapSize","snapEdges","restrict","restrictEdges","restrictSize"].map((function(M){var Y=y[M];return Y&&Y.enabled&&{options:Y,methods:Y._methods}})).filter((function(M){return!!M}))})(p);this.prepareStates(h),this.startEdges=te({},p.edges),this.edges=te({},this.startEdges),this.startOffset=(s=p.rect,l=o,s?{left:l.x-s.left,top:l.y-s.top,right:s.right-l.x,bottom:s.bottom-l.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=Tn(),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,s=this.states;o<s.length;o++){var l=s[o];l.methods.start&&(t.state=l,l.methods.start(t))}}},{key:"setAll",value:function(t){var o=t.phase,s=t.preEnd,l=t.skipModifiers,f=t.rect,p=t.edges;t.coords=te({},t.pageCoords),t.rect=te({},f),t.edges=te({},p);for(var h=l?this.states.slice(l):this.states,v=Tn(t.coords,t.rect),S=0;S<h.length;S++){var y,C=h[S],M=C.options,Y=te({},t.coords),B=null;(y=C.methods)!=null&&y.set&&this.shouldDo(M,s,o)&&(t.state=C,B=C.methods.set(t),Me(t.edges,t.rect,{x:t.coords.x-Y.x,y:t.coords.y-Y.y})),v.eventProps.push(B)}te(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 U=this.result.coords,ae=this.result.rect;if(U&&ae){var ie=v.rect.left!==ae.left||v.rect.right!==ae.right||v.rect.top!==ae.top||v.rect.bottom!==ae.bottom;v.changed=ie||U.x!==v.coords.x||U.y!==v.coords.y}return v}},{key:"applyToInteraction",value:function(t){var o=this.interaction,s=t.phase,l=o.coords.cur,f=o.coords.start,p=this.result,h=this.startDelta,v=p.delta;s==="start"&&te(this.startDelta,p.delta);for(var S=0,y=[[f,h],[l,v]];S<y.length;S++){var C=y[S],M=C[0],Y=C[1];M.page.x+=Y.x,M.page.y+=Y.y,M.client.x+=Y.x,M.client.y+=Y.y}var B=this.result.rectDelta,U=t.rect||o.rect;U.left+=B.left,U.right+=B.right,U.top+=B.top,U.bottom+=B.bottom,U.width=U.right-U.left,U.height=U.bottom-U.top}},{key:"setAndApply",value:function(t){var o=this.interaction,s=t.phase,l=t.preEnd,f=t.skipModifiers,p=this.setAll(this.fillArg({preEnd:l,phase:s,pageCoords:t.modifiedCoords||o.coords.cur.page}));if(this.result=p,!p.changed&&(!f||f<this.states.length)&&o.interacting())return!1;if(t.modifiedCoords){var h=o.coords.cur.page,v={x:t.modifiedCoords.x-h.x,y:t.modifiedCoords.y-h.y};p.coords.x+=v.x,p.coords.y+=v.y,p.delta.x+=v.x,p.delta.y+=v.y}this.applyToInteraction(t)}},{key:"beforeEnd",value:function(t){var o=t.interaction,s=t.event,l=this.states;if(l&&l.length){for(var f=!1,p=0;p<l.length;p++){var h=l[p];t.state=h;var v=h.options,S=h.methods,y=S.beforeEnd&&S.beforeEnd(t);if(y)return this.endResult=y,!1;f=f||!f&&this.shouldDo(v,!0,t.phase,!0)}f&&o.move({event:s,preEnd:!0})}}},{key:"stop",value:function(t){var o=t.interaction;if(this.states&&this.states.length){var s=te({states:this.states,interactable:o.interactable,element:o.element,rect:null},t);this.fillArg(s);for(var l=0,f=this.states;l<f.length;l++){var p=f[l];s.state=p,p.methods.stop&&p.methods.stop(s)}this.states=null,this.endResult=null}}},{key:"prepareStates",value:function(t){this.states=[];for(var o=0;o<t.length;o++){var s=t[o],l=s.options,f=s.methods,p=s.name;this.states.push({options:l,methods:f,index:o,name:p})}return this.states}},{key:"restoreInteractionCoords",value:function(t){var o=t.interaction,s=o.coords,l=o.rect,f=o.modification;if(f.result){for(var p=f.startDelta,h=f.result,v=h.delta,S=h.rectDelta,y=0,C=[[s.start,p],[s.cur,v]];y<C.length;y++){var M=C[y],Y=M[0],B=M[1];Y.page.x-=B.x,Y.page.y-=B.y,Y.client.x-=B.x,Y.client.y-=B.y}l.left-=S.left,l.right-=S.right,l.top-=S.top,l.bottom-=S.bottom}}},{key:"shouldDo",value:function(t,o,s,l){return!(!t||t.enabled===!1||l&&!t.endOnly||t.endOnly&&!o||s==="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 ut(o)})),this.result=Tn(te({},t.result.coords),te({},t.result.rect))}},{key:"destroy",value:function(){for(var t in this)this[t]=null}}]),n})();function Tn(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,s={start:n.start,set:n.set,beforeEnd:n.beforeEnd,stop:n.stop},l=function(f){var p=f||{};for(var h in p.enabled=p.enabled!==!1,o)h in p||(p[h]=o[h]);var v={options:p,methods:s,name:t,enable:function(){return p.enabled=!0,v},disable:function(){return p.enabled=!1,v}};return v};return t&&typeof t=="string"&&(l._defaults=o,l._methods=s),l}function Rt(n){var t=n.iEvent,o=n.interaction.modification.result;o&&(t.modifiers=o.eventProps)}var Bc={id:"modifiers/base",before:["actions"],install:function(n){n.defaults.perAction.modifiers=[]},listeners:{"interactions:new":function(n){var t=n.interaction;t.modification=new Nr(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,s=o.setAndApply(n);return t.edges=o.edges,s},"interactions:before-action-end":function(n){var t=n.interaction,o=t.modification,s=o.beforeEnd(n);return t.edges=o.startEdges,s},"interactions:action-start":Rt,"interactions:action-move":Rt,"interactions:action-end":Rt,"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)}}},xi=Bc,Ei={base:{preventDefault:"auto",deltaSource:"page"},perAction:{enabled:!1,origin:{x:0,y:0}},actions:{}},Sr=(function(n){b(o,n);var t=A(o);function o(s,l,f,p,h,v,S){var y;u(this,o),(y=t.call(this,s)).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,h=h||s.element;var C=s.interactable,M=(C&&C.options||Ei).deltaSource,Y=Ye(C,h,f),B=p==="start",U=p==="end",ae=B?P(y):s.prevEvent,ie=B?s.coords.start:U?{page:ae.page,client:ae.client,timeStamp:s.coords.cur.timeStamp}:s.coords.cur;return y.page=te({},ie.page),y.client=te({},ie.client),y.rect=te({},s.rect),y.timeStamp=ie.timeStamp,U||(y.page.x-=Y.x,y.page.y-=Y.y,y.client.x-=Y.x,y.client.y-=Y.y),y.ctrlKey=l.ctrlKey,y.altKey=l.altKey,y.shiftKey=l.shiftKey,y.metaKey=l.metaKey,y.button=l.button,y.buttons=l.buttons,y.target=h,y.currentTarget=h,y.preEnd=v,y.type=S||f+(p||""),y.interactable=C,y.t0=B?s.pointers[s.pointers.length-1].downTime:ae.t0,y.x0=s.coords.start.page.x-Y.x,y.y0=s.coords.start.page.y-Y.y,y.clientX0=s.coords.start.client.x-Y.x,y.clientY0=s.coords.start.client.y-Y.y,y.delta=B||U?{x:0,y:0}:{x:y[M].x-ae[M].x,y:y[M].y-ae[M].y},y.dt=s.coords.delta.timeStamp,y.duration=y.timeStamp-y.t0,y.velocity=te({},s.coords.velocity[M]),y.speed=Ct(y.velocity.x,y.velocity.y),y.swipe=U||p==="inertiastart"?y.getSwipe():null,y}return g(o,[{key:"getSwipe",value:function(){var s=this._interaction;if(s.prevEvent.speed<600||this.timeStamp-s.prevEvent.timeStamp>150)return null;var l=180*Math.atan2(s.prevEvent.velocityY,s.prevEvent.velocityX)/Math.PI;l<0&&(l+=360);var f=112.5<=l&&l<247.5,p=202.5<=l&&l<337.5;return{up:p,down:!p&&22.5<=l&&l<157.5,left:f,right:!f&&(292.5<=l||l<67.5),angle:l,speed:s.prevEvent.speed,velocity:{x:s.prevEvent.velocityX,y:s.prevEvent.velocityY}}}},{key:"preventDefault",value:function(){}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}}]),o})(En);Object.defineProperties(Sr.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 Hc=g((function n(t,o,s,l,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=s,this.downTime=l,this.downTarget=f})),Yc=(function(n){return n.interactable="",n.element="",n.prepared="",n.pointerIsDown="",n.pointerWasMoved="",n._proxy="",n})({}),Ni=(function(n){return n.start="",n.move="",n.end="",n.stop="",n.interacting="",n})({}),Xc=0,Uc=(function(){function n(t){var o=this,s=t.pointerType,l=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=It((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=Xc++,this._scopeFire=l,this.pointerType=s;var f=this;this._proxy={};var p=function(y){Object.defineProperty(o._proxy,y,{get:function(){return f[y]}})};for(var h in Yc)p(h);var v=function(y){Object.defineProperty(o._proxy,y,{value:function(){return f[y].apply(f,arguments)}})};for(var S in Ni)v(S);this._scopeFire("interactions:new",{interaction:this})}return g(n,[{key:"pointerMoveTolerance",get:function(){return 1}},{key:"pointerDown",value:function(t,o,s){var l=this.updatePointer(t,o,s,!0),f=this.pointers[l];this._scopeFire("interactions:down",{pointer:t,event:o,eventTarget:s,pointerIndex:l,pointerInfo:f,type:"down",interaction:this})}},{key:"start",value:function(t,o,s){return!(this.interacting()||!this.pointerIsDown||this.pointers.length<(t.name==="gesture"?2:1)||!o.options[t.name].enabled)&&(br(this.prepared,t),this.interactable=o,this.element=s,this.rect=o.getRect(s),this.edges=this.prepared.edges?te({},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,s){this.simulation||this.modification&&this.modification.endResult||this.updatePointer(t,o,s,!1);var l,f,p=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&&(l=this.coords.cur.client.x-this.coords.start.client.x,f=this.coords.cur.client.y-this.coords.start.client.y,this.pointerWasMoved=Ct(l,f)>this.pointerMoveTolerance);var h,v,S,y=this.getPointerIndex(t),C={pointer:t,pointerIndex:y,pointerInfo:this.pointers[y],event:o,type:"move",eventTarget:s,dx:l,dy:f,duplicate:p,interaction:this};p||(h=this.coords.velocity,v=this.coords.delta,S=Math.max(v.timeStamp/1e3,.001),h.page.x=v.page.x/S,h.page.y=v.page.y/S,h.client.x=v.client.x/S,h.client.y=v.client.y/S,h.timeStamp=S),this._scopeFire("interactions:move",C),p||this.simulation||(this.interacting()&&(C.type=null,this.move(C)),this.pointerWasMoved&&wn(this.coords.prev,this.coords.cur))}},{key:"move",value:function(t){t&&t.event||qo(this.coords.delta),(t=te({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,s,l){var f=this.getPointerIndex(t);f===-1&&(f=this.updatePointer(t,o,s,!1));var p=/cancel$/i.test(o.type)?"cancel":"up";this._scopeFire("interactions:".concat(p),{pointer:t,pointerIndex:f,pointerInfo:this.pointers[f],event:o,eventTarget:s,type:p,curEventTarget:l,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:Ot(this.pointers,(function(s){return s.id===o}))}},{key:"getPointerInfo",value:function(t){return this.pointers[this.getPointerIndex(t)]}},{key:"updatePointer",value:function(t,o,s,l){var f,p,h,v=kt(t),S=this.getPointerIndex(t),y=this.pointers[S];return l=l!==!1&&(l||/(down|start)$/i.test(o.type)),y?y.pointer=t:(y=new Hc(v,t,o,null,null),S=this.pointers.length,this.pointers.push(y)),Ec(this.coords.cur,this.pointers.map((function(C){return C.pointer})),this._now()),f=this.coords.delta,p=this.coords.prev,h=this.coords.cur,f.page.x=h.page.x-p.page.x,f.page.y=h.page.y-p.page.y,f.client.x=h.client.x-p.client.x,f.client.y=h.client.y-p.client.y,f.timeStamp=h.timeStamp-p.timeStamp,l&&(this.pointerIsDown=!0,y.downTime=this.coords.cur.timeStamp,y.downTarget=s,bn(this.downPointer,t),this.interacting()||(wn(this.coords.start,this.coords.cur),wn(this.coords.prev,this.coords.cur),this.downEvent=o,this.pointerWasMoved=!1)),this._updateLatestPointer(t,o,s),this._scopeFire("interactions:update-pointer",{pointer:t,event:o,eventTarget:s,down:l,pointerInfo:y,pointerIndex:S,interaction:this}),S}},{key:"removePointer",value:function(t,o){var s=this.getPointerIndex(t);if(s!==-1){var l=this.pointers[s];this._scopeFire("interactions:remove-pointer",{pointer:t,event:o,eventTarget:null,pointerIndex:s,pointerInfo:l,interaction:this}),this.pointers.splice(s,1),this.pointerIsDown=!1}}},{key:"_updateLatestPointer",value:function(t,o,s){this._latestPointer.pointer=t,this._latestPointer.event=o,this._latestPointer.eventTarget=s}},{key:"destroy",value:function(){this._latestPointer.pointer=null,this._latestPointer.event=null,this._latestPointer.eventTarget=null}},{key:"_createPreparedEvent",value:function(t,o,s,l){return new Sr(this,t,this.prepared.name,o,this.element,s,l)}},{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,s=t.phase,l=t.preEnd,f=t.type,p=this.rect;if(p&&s==="move"&&(Me(this.edges,p,this.coords.delta[this.interactable.options.deltaSource]),p.width=p.right-p.left,p.height=p.bottom-p.top),this._scopeFire("interactions:before-action-".concat(s),t)===!1)return!1;var h=t.iEvent=this._createPreparedEvent(o,s,l,f);return this._scopeFire("interactions:action-".concat(s),t),s==="start"&&(this.prevEvent=h),this._fireEvent(h),this._scopeFire("interactions:after-action-".concat(s),t),!0}},{key:"_now",value:function(){return Date.now()}}]),n})();function Si(n){Ti(n.interaction)}function Ti(n){if(!(function(o){return!(!o.offset.pending.x&&!o.offset.pending.y)})(n))return!1;var t=n.offset.pending;return Tr(n.coords.cur,t),Tr(n.coords.delta,t),Me(n.edges,n.rect,t),t.x=0,t.y=0,!0}function Kc(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 Tr(n,t){var o=n.page,s=n.client,l=t.x,f=t.y;o.x+=l,o.y+=f,s.x+=l,s.y+=f}Ni.offsetBy="";var Gc={id:"offset",before:["modifiers","pointer-events","actions","inertia"],install:function(n){n.Interaction.prototype.offsetBy=Kc},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&&(Tr(t.coords.cur,t.offset.total),t.offset.pending.x=0,t.offset.pending.y=0)})(n.interaction)},"interactions:before-action-start":Si,"interactions:before-action-move":Si,"interactions:before-action-end":function(n){var t=n.interaction;if(Ti(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}}},_i=Gc,Wc=(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,s=_n(o);if(!s||!s.enabled)return!1;var l=o.coords.velocity.client,f=Ct(l.x,l.y),p=this.modification||(this.modification=new Nr(o));if(p.copyFrom(o.modification),this.t0=o._now(),this.allowResume=s.allowResume,this.v0=f,this.currentOffset={x:0,y:0},this.startCoords=o.coords.cur.page,this.modifierArg=p.fillArg({pageCoords:this.startCoords,preEnd:!0,phase:"inertiastart"}),this.t0-o.coords.cur.timeStamp<50&&f>s.minSpeed&&f>s.endSpeed)this.startInertia();else{if(p.result=p.setAll(this.modifierArg),!p.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,s=_n(this.interaction),l=s.resistance,f=-Math.log(s.endSpeed/this.v0)/l;this.targetOffset={x:(o.x-f)/l,y:(o.y-f)/l},this.te=f,this.lambda_v0=l/this.v0,this.one_ve_v0=1-s.endSpeed/this.v0;var p=this.modification,h=this.modifierArg;h.pageCoords={x:this.startCoords.x+this.targetOffset.x,y:this.startCoords.y+this.targetOffset.y},p.result=p.setAll(h),p.result.changed&&(this.isModified=!0,this.modifiedOffset={x:this.targetOffset.x+p.result.delta.x,y:this.targetOffset.y+p.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,s,l,f,p,h,v=this,S=this.interaction,y=_n(S).resistance,C=(S._now()-this.t0)/1e3;if(C<this.te){var M,Y=1-(Math.exp(-y*C)-this.lambda_v0)/this.one_ve_v0;this.isModified?(t=0,o=0,s=this.targetOffset.x,l=this.targetOffset.y,f=this.modifiedOffset.x,p=this.modifiedOffset.y,M={x:Ci(h=Y,t,s,f),y:Ci(h,o,l,p)}):M={x:this.targetOffset.x*Y,y:this.targetOffset.y*Y};var B={x:M.x-this.currentOffset.x,y:M.y-this.currentOffset.y};this.currentOffset.x+=B.x,this.currentOffset.y+=B.y,S.offsetBy(B),S.move(),this.onNextFrame((function(){return v.inertiaTick()}))}else S.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,s=o._now()-this.t0,l=_n(o).smoothEndDuration;if(s<l){var f={x:ki(s,0,this.targetOffset.x,l),y:ki(s,0,this.targetOffset.y,l)},p={x:f.x-this.currentOffset.x,y:f.y-this.currentOffset.y};this.currentOffset.x+=p.x,this.currentOffset.y+=p.y,o.offsetBy(p),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,s=t.event,l=t.eventTarget,f=this.interaction;f.offsetBy({x:-this.currentOffset.x,y:-this.currentOffset.y}),f.updatePointer(o,s,l,!0),f._doPhase({interaction:f,event:s,phase:"resume"}),wn(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 _n(n){var t=n.interactable,o=n.prepared;return t&&t.options&&o.name&&t.options[o.name].inertia}var Jc={id:"inertia",before:["modifiers","actions"],install:function(n){var t=n.defaults;n.usePlugin(_i),n.usePlugin(xi),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 Wc(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,s=t.inertia;if(s.active)for(var l=o;E.element(l);){if(l===t.element){s.resume(n);break}l=H(l)}},"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":Rt,"interactions:action-inertiastart":Rt,"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 Ci(n,t,o,s){var l=1-n;return l*l*t+2*l*n*o+n*n*s}function ki(n,t,o,s){return-o*(n/=s)*(n-2)+t}var Zc=Jc;function Oi(n,t){for(var o=0;o<t.length;o++){var s=t[o];if(n.immediatePropagationStopped)break;s(n)}}var Pi=(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=te({},t||{})}return g(n,[{key:"fire",value:function(t){var o,s=this.global;(o=this.types[t.type])&&Oi(t,o),!t.propagationStopped&&s&&(o=s[t.type])&&Oi(t,o)}},{key:"on",value:function(t,o){var s=Xe(t,o);for(t in s)this.types[t]=ii(this.types[t]||[],s[t])}},{key:"off",value:function(t,o){var s=Xe(t,o);for(t in s){var l=this.types[t];if(l&&l.length)for(var f=0,p=s[t];f<p.length;f++){var h=p[f],v=l.indexOf(h);v!==-1&&l.splice(v,1)}}}},{key:"getRect",value:function(t){return null}}]),n})(),Qc=(function(){function n(t){u(this,n),this.currentTarget=void 0,this.originalEvent=void 0,this.type=void 0,this.originalEvent=t,bn(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 jt(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 $c={id:"events",install:function(n){var t,o=[],s={},l=[],f={add:p,remove:h,addDelegate:function(y,C,M,Y,B){var U=jt(B);if(!s[M]){s[M]=[];for(var ae=0;ae<l.length;ae++){var ie=l[ae];p(ie,M,v),p(ie,M,S,!0)}}var fe=s[M],ye=Pt(fe,(function(xe){return xe.selector===y&&xe.context===C}));ye||(ye={selector:y,context:C,listeners:[]},fe.push(ye)),ye.listeners.push({func:Y,options:U})},removeDelegate:function(y,C,M,Y,B){var U,ae=jt(B),ie=s[M],fe=!1;if(ie)for(U=ie.length-1;U>=0;U--){var ye=ie[U];if(ye.selector===y&&ye.context===C){for(var xe=ye.listeners,he=xe.length-1;he>=0;he--){var be=xe[he];if(be.func===Y&&Cn(be.options,ae)){xe.splice(he,1),xe.length||(ie.splice(U,1),h(C,M,v),h(C,M,S,!0)),fe=!0;break}}if(fe)break}}},delegateListener:v,delegateUseCapture:S,delegatedEvents:s,documents:l,targets:o,supportsOptions:!1,supportsPassive:!1};function p(y,C,M,Y){if(y.addEventListener){var B=jt(Y),U=Pt(o,(function(ae){return ae.eventTarget===y}));U||(U={eventTarget:y,events:{}},o.push(U)),U.events[C]||(U.events[C]=[]),Pt(U.events[C],(function(ae){return ae.func===M&&Cn(ae.options,B)}))||(y.addEventListener(C,M,f.supportsOptions?B:B.capture),U.events[C].push({func:M,options:B}))}}function h(y,C,M,Y){if(y.addEventListener&&y.removeEventListener){var B=Ot(o,(function(je){return je.eventTarget===y})),U=o[B];if(U&&U.events)if(C!=="all"){var ae=!1,ie=U.events[C];if(ie){if(M==="all"){for(var fe=ie.length-1;fe>=0;fe--){var ye=ie[fe];h(y,C,ye.func,ye.options)}return}for(var xe=jt(Y),he=0;he<ie.length;he++){var be=ie[he];if(be.func===M&&Cn(be.options,xe)){y.removeEventListener(C,M,f.supportsOptions?xe:xe.capture),ie.splice(he,1),ie.length===0&&(delete U.events[C],ae=!0);break}}}ae&&!Object.keys(U.events).length&&o.splice(B,1)}else for(C in U.events)U.events.hasOwnProperty(C)&&h(y,C,"all")}}function v(y,C){for(var M=jt(C),Y=new Qc(y),B=s[y.type],U=oi(y)[0],ae=U;E.element(ae);){for(var ie=0;ie<B.length;ie++){var fe=B[ie],ye=fe.selector,xe=fe.context;if(D(ae,ye)&&oe(xe,U)&&oe(xe,ae)){var he=fe.listeners;Y.currentTarget=ae;for(var be=0;be<he.length;be++){var je=he[be];Cn(je.options,M)&&je.func(Y)}}}ae=H(ae)}}function S(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}},_r={methodOrder:["simulationResume","mouseOrPen","hasPointer","idle"],search:function(n){for(var t=0,o=_r.methodOrder;t<o.length;t++){var s=o[t],l=_r[s](n);if(l)return l}return null},simulationResume:function(n){var t=n.pointerType,o=n.eventType,s=n.eventTarget,l=n.scope;if(!/down|start/i.test(o))return null;for(var f=0,p=l.interactions.list;f<p.length;f++){var h=p[f],v=s;if(h.simulation&&h.simulation.allowResume&&h.pointerType===t)for(;v;){if(v===h.element)return h;v=H(v)}}return null},mouseOrPen:function(n){var t,o=n.pointerId,s=n.pointerType,l=n.eventType,f=n.scope;if(s!=="mouse"&&s!=="pen")return null;for(var p=0,h=f.interactions.list;p<h.length;p++){var v=h[p];if(v.pointerType===s){if(v.simulation&&!Ii(v,o))continue;if(v.interacting())return v;t||(t=v)}}if(t)return t;for(var S=0,y=f.interactions.list;S<y.length;S++){var C=y[S];if(!(C.pointerType!==s||/down/i.test(l)&&C.simulation))return C}return null},hasPointer:function(n){for(var t=n.pointerId,o=0,s=n.scope.interactions.list;o<s.length;o++){var l=s[o];if(Ii(l,t))return l}return null},idle:function(n){for(var t=n.pointerType,o=0,s=n.scope.interactions.list;o<s.length;o++){var l=s[o];if(l.pointers.length===1){var f=l.interactable;if(f&&(!f.options.gesture||!f.options.gesture.enabled))continue}else if(l.pointers.length>=2)continue;if(!l.interacting()&&t===l.pointerType)return l}return null}};function Ii(n,t){return n.pointers.some((function(o){return o.id===t}))}var qc=_r,Cr=["pointerDown","pointerMove","pointerUp","updatePointer","removePointer","windowBlur"];function Ri(n,t){return function(o){var s=t.interactions.list,l=ri(o),f=oi(o),p=f[0],h=f[1],v=[];if(/^touch/.test(o.type)){t.prevTouchTime=t.now();for(var S=0,y=o.changedTouches;S<y.length;S++){var C=y[S],M={pointer:C,pointerId:kt(C),pointerType:l,eventType:o.type,eventTarget:p,curEventTarget:h,scope:t},Y=ji(M);v.push([M.pointer,M.eventTarget,M.curEventTarget,Y])}}else{var B=!1;if(!re.supportsPointerEvent&&/mouse/.test(o.type)){for(var U=0;U<s.length&&!B;U++)B=s[U].pointerType!=="mouse"&&s[U].pointerIsDown;B=B||t.now()-t.prevTouchTime<500||o.timeStamp===0}if(!B){var ae={pointer:o,pointerId:kt(o),pointerType:l,eventType:o.type,curEventTarget:h,eventTarget:p,scope:t},ie=ji(ae);v.push([ae.pointer,ae.eventTarget,ae.curEventTarget,ie])}}for(var fe=0;fe<v.length;fe++){var ye=v[fe],xe=ye[0],he=ye[1],be=ye[2];ye[3][n](xe,o,he,be)}}}function ji(n){var t=n.pointerType,o=n.scope,s={interaction:qc.search(n),searchDetails:n};return o.fire("interactions:find",s),s.interaction||o.interactions.new({pointerType:t})}function kr(n,t){var o=n.doc,s=n.scope,l=n.options,f=s.interactions.docEvents,p=s.events,h=p[t];for(var v in s.browser.isIOS&&!l.events&&(l.events={passive:!1}),p.delegatedEvents)h(o,v,p.delegateListener),h(o,v,p.delegateUseCapture,!0);for(var S=l&&l.events,y=0;y<f.length;y++){var C=f[y];h(o,C.type,C.listener,S)}}var el={id:"core/interactions",install:function(n){for(var t={},o=0;o<Cr.length;o++){var s=Cr[o];t[s]=Ri(s,n)}var l,f=re.pEventTypes;function p(){for(var h=0,v=n.interactions.list;h<v.length;h++){var S=v[h];if(S.pointerIsDown&&S.pointerType==="touch"&&!S._interacting)for(var y=function(){var Y=M[C];n.documents.some((function(B){return oe(B.doc,Y.downTarget)}))||S.removePointer(Y.pointer,Y.event)},C=0,M=S.pointers;C<M.length;C++)y()}}(l=X.PointerEvent?[{type:f.down,listener:p},{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:p},{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(h){for(var v=0,S=n.interactions.list;v<S.length;v++)S[v].documentBlur(h)}}),n.prevTouchTime=0,n.Interaction=(function(h){b(S,h);var v=A(S);function S(){return u(this,S),v.apply(this,arguments)}return g(S,[{key:"pointerMoveTolerance",get:function(){return n.interactions.pointerMoveTolerance},set:function(y){n.interactions.pointerMoveTolerance=y}},{key:"_now",value:function(){return n.now()}}]),S})(Uc),n.interactions={list:[],new:function(h){h.scopeFire=function(S,y){return n.fire(S,y)};var v=new n.Interaction(h);return n.interactions.list.push(v),v},listeners:t,docEvents:l,pointerMoveTolerance:1},n.usePlugin(wi)},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,s=t.interactions.list.length-1;s>=0;s--){var l=t.interactions.list[s];l.interactable===o&&(l.stop(),t.fire("interactions:destroy",{interaction:l}),l.destroy(),t.interactions.list.length>2&&t.interactions.list.splice(s,1))}}},onDocSignal:kr,doOnInteractions:Ri,methodNames:Cr},tl=el,$e=(function(n){return n[n.On=0]="On",n[n.Off=1]="Off",n})($e||{}),nl=(function(){function n(t,o,s,l){u(this,n),this.target=void 0,this.options=void 0,this._actions=void 0,this.events=new Pi,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||s,this._win=K(Ne(t)?this._context:t),this._doc=this._win.document,this._scopeEvents=l,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,s){var l,f=this,p=(l=this._actions.map[t])==null?void 0:l.filterEventType,h=function(v){return(p==null||p(v))&&Sn(v,f._actions)};(E.array(o)||E.object(o))&&this._onOff($e.Off,t,o,void 0,h),(E.array(s)||E.object(s))&&this._onOff($e.On,t,s,void 0,h)}},{key:"setPerAction",value:function(t,o){var s=this._defaults;for(var l in o){var f=l,p=this.options[t],h=o[f];f==="listeners"&&this.updatePerActionListeners(t,p.listeners,h),E.array(h)?p[f]=si(h):E.plainObject(h)?(p[f]=te(p[f]||{},ut(h)),E.object(s.perAction[f])&&"enabled"in s.perAction[f]&&(p[f].enabled=h.enabled!==!1)):E.bool(h)&&E.object(s.perAction[f])?p[f].enabled=h:p[f]=h}}},{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)),ve(t)}},{key:"rectChecker",value:function(t){var o=this;return E.func(t)?(this.getRect=function(s){var l=te({},t.apply(o,s));return"width"in l||(l.width=l.right-l.left,l.height=l.bottom-l.top),l},this):t===null?(delete this.getRect,this):this.getRect}},{key:"_backCompatOption",value:function(t,o){if(Ne(o)||E.object(o)){for(var s in this.options[t]=o,this._actions.map)this.options[s][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||oe(this._context,t)}},{key:"testIgnoreAllow",value:function(t,o,s){return!this.testIgnore(t.ignoreFrom,o,s)&&this.testAllow(t.allowFrom,o,s)}},{key:"testAllow",value:function(t,o,s){return!t||!!E.element(s)&&(E.string(t)?q(s,t,o):!!E.element(t)&&oe(t,s))}},{key:"testIgnore",value:function(t,o,s){return!(!t||!E.element(s))&&(E.string(t)?q(s,t,o):!!E.element(t)&&oe(t,s))}},{key:"fire",value:function(t){return this.events.fire(t),this}},{key:"_onOff",value:function(t,o,s,l,f){E.object(o)&&!E.array(o)&&(l=s,s=null);var p=Xe(o,s,f);for(var h in p){h==="wheel"&&(h=re.wheelEvent);for(var v=0,S=p[h];v<S.length;v++){var y=S[v];Sn(h,this._actions)?this.events[t===$e.On?"on":"off"](h,y):E.string(this.target)?this._scopeEvents[t===$e.On?"addDelegate":"removeDelegate"](this.target,this._context,h,y,l):this._scopeEvents[t===$e.On?"add":"remove"](this.target,h,y,l)}}return this}},{key:"on",value:function(t,o,s){return this._onOff($e.On,t,o,s)}},{key:"off",value:function(t,o,s){return this._onOff($e.Off,t,o,s)}},{key:"set",value:function(t){var o=this._defaults;for(var s in E.object(t)||(t={}),this.options=ut(o.base),this._actions.methodDict){var l=s,f=this._actions.methodDict[l];this.options[l]={},this.setPerAction(l,te(te({},o.perAction),o.actions[l])),this[f](t[l])}for(var p in t)p!=="getRect"?E.func(this[p])&&this[p](t[p]):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],s=o.length-1;s>=0;s--){var l=o[s],f=l.selector,p=l.context,h=l.listeners;f===this.target&&p===this._context&&o.splice(s,1);for(var v=h.length-1;v>=0;v--)this._scopeEvents.removeDelegate(this.target,this._context,t,h[v][0],h[v][1])}else this._scopeEvents.remove(this.target,"all")}}]),n})(),rl=(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(s){var l=s.interactable,f=l.target,p=E.string(f)?o.selectorMap[f]:f[o.scope.id],h=Ot(p,(function(v){return v===l}));p.splice(h,1)}})}return g(n,[{key:"new",value:function(t,o){o=te(o||{},{actions:this.scope.actions});var s=new this.scope.Interactable(t,o,this.scope.document,this.scope.events);return this.scope.addDocument(s._doc),this.list.push(s),E.string(t)?(this.selectorMap[t]||(this.selectorMap[t]=[]),this.selectorMap[t].push(s)):(s.target[this.scope.id]||Object.defineProperty(t,this.scope.id,{value:[],configurable:!0}),t[this.scope.id].push(s)),this.scope.fire("interactable:new",{target:t,options:o,interactable:s,win:this.scope._win}),s}},{key:"getExisting",value:function(t,o){var s=o&&o.context||this.scope.document,l=E.string(t),f=l?this.selectorMap[t]:t[this.scope.id];if(f)return Pt(f,(function(p){return p._context===s&&(l||p.inContext(t))}))}},{key:"forEachMatch",value:function(t,o){for(var s=0,l=this.list;s<l.length;s++){var f=l[s],p=void 0;if((E.string(f.target)?E.element(t)&&D(t,f.target):t===f.target)&&f.inContext(t)&&(p=o(f)),p!==void 0)return p}}}]),n})(),ol=(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=re,this.defaults=ut(Ei),this.Eventable=Pi,this.actions={map:{},phases:{start:!0,move:!0,end:!0},methodDict:{},phaselessTypes:{}},this.interactStatic=(function(s){var l=function f(p,h){var v=s.interactables.getExisting(p,h);return v||((v=s.interactables.new(p,h)).events.global=f.globalEvents),v};return l.getPointerAverage=ni,l.getTouchBBox=fr,l.getTouchDistance=dr,l.getTouchAngle=pr,l.getElementRect=ve,l.getElementClientRect=pe,l.matchesSelector=D,l.closest=le,l.globalEvents={},l.version="1.10.27",l.scope=s,l.use=function(f,p){return this.scope.usePlugin(f,p),this},l.isSet=function(f,p){return!!this.scope.interactables.get(f,p&&p.context)},l.on=It((function(f,p,h){if(E.string(f)&&f.search(" ")!==-1&&(f=f.trim().split(/ +/)),E.array(f)){for(var v=0,S=f;v<S.length;v++){var y=S[v];this.on(y,p,h)}return this}if(E.object(f)){for(var C in f)this.on(C,f[C],p);return this}return Sn(f,this.scope.actions)?this.globalEvents[f]?this.globalEvents[f].push(p):this.globalEvents[f]=[p]:this.scope.events.add(this.scope.document,f,p,{options:h}),this}),"The interact.on() method is being deprecated"),l.off=It((function(f,p,h){if(E.string(f)&&f.search(" ")!==-1&&(f=f.trim().split(/ +/)),E.array(f)){for(var v=0,S=f;v<S.length;v++){var y=S[v];this.off(y,p,h)}return this}if(E.object(f)){for(var C in f)this.off(C,f[C],p);return this}var M;return Sn(f,this.scope.actions)?f in this.globalEvents&&(M=this.globalEvents[f].indexOf(p))!==-1&&this.globalEvents[f].splice(M,1):this.scope.events.remove(this.scope.document,f,p,h),this}),"The interact.off() method is being deprecated"),l.debug=function(){return this.scope},l.supportsTouch=function(){return re.supportsTouch},l.supportsPointerEvent=function(){return re.supportsPointerEvent},l.stop=function(){for(var f=0,p=this.scope.interactions.list;f<p.length;f++)p[f].stop();return this},l.pointerMoveTolerance=function(f){return E.number(f)?(this.scope.interactions.pointerMoveTolerance=f,this):this.scope.interactions.pointerMoveTolerance},l.addDocument=function(f,p){this.scope.addDocument(f,p)},l.removeDocument=function(f){this.scope.removeDocument(f)},l})(this),this.InteractEvent=Sr,this.Interactable=void 0,this.interactables=new rl(this),this._win=void 0,this.document=void 0,this.window=void 0,this.documents=[],this._plugins={list:[],map:{}},this.onWindowUnload=function(s){return t.removeDocument(s.target)};var o=this;this.Interactable=(function(s){b(f,s);var l=A(f);function f(){return u(this,f),l.apply(this,arguments)}return g(f,[{key:"_defaults",get:function(){return o.defaults}},{key:"set",value:function(p){return z(k(f.prototype),"set",this).call(this,p),o.fire("interactable:set",{options:p,interactable:this}),this}},{key:"unset",value:function(){z(k(f.prototype),"unset",this).call(this);var p=o.interactables.list.indexOf(this);p<0||(o.interactables.list.splice(p,1),o.fire("interactable:unset",{interactable:this}))}}]),f})(nl)}return g(n,[{key:"addListeners",value:function(t,o){this.listenerMaps.push({id:o,map:t})}},{key:"fire",value:function(t,o){for(var s=0,l=this.listenerMaps;s<l.length;s++){var f=l[s].map[t];if(f&&f(o,this,t)===!1)return!1}}},{key:"init",value:function(t){return this.isInitialized?this:(function(o,s){return o.isInitialized=!0,E.window(s)&&L(s),X.init(s),re.init(s),Ze.init(s),o.window=s,o.document=s.document,o.usePlugin(tl),o.usePlugin($c),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 s=0,l=this.listenerMaps.length,f=t.before.reduce((function(h,v){return h[v]=!0,h[Ai(v)]=!0,h}),{});s<l;s++){var p=this.listenerMaps[s].id;if(p&&(f[p]||f[Ai(p)]))break}this.listenerMaps.splice(s,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 s=K(t);o=o?te({},o):{},this.documents.push({doc:t,options:o}),this.events.documents.push(t),t!==this.document&&this.events.add(s,"unload",this.onWindowUnload),this.fire("scope:add-document",{doc:t,window:s,scope:this,options:o})}},{key:"removeDocument",value:function(t){var o=this.getDocIndex(t),s=K(t),l=this.documents[o].options;this.events.remove(s,"unload",this.onWindowUnload),this.documents.splice(o,1),this.events.documents.splice(o,1),this.fire("scope:remove-document",{doc:t,window:s,scope:this,options:l})}},{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 Ai(n){return n&&n.replace(/\/.*$/,"")}var Mi=new ol,Re=Mi.interactStatic,il=typeof globalThis<"u"?globalThis:window;Mi.init(il);var sl=Object.freeze({__proto__:null,edgeTarget:function(){},elements:function(){},grid:function(n){var t=[["x","y"],["left","top"],["right","bottom"],["width","height"]].filter((function(s){var l=s[0],f=s[1];return l in n||f in n})),o=function(s,l){for(var f=n.range,p=n.limits,h=p===void 0?{left:-1/0,right:1/0,top:-1/0,bottom:1/0}:p,v=n.offset,S=v===void 0?{x:0,y:0}:v,y={range:f,grid:n,x:null,y:null},C=0;C<t.length;C++){var M=t[C],Y=M[0],B=M[1],U=Math.round((s-S.x)/n[Y]),ae=Math.round((l-S.y)/n[B]);y[Y]=Math.max(h.left,Math.min(h.right,U*n[Y]+S.x)),y[B]=Math.max(h.top,Math.min(h.bottom,ae*n[B]+S.y))}return y};return o.grid=n,o.coordFields=t,o}}),al={id:"snappers",install:function(n){var t=n.interactStatic;t.snappers=te(t.snappers||{},sl),t.createSnapGrid=t.snappers.grid}},cl=al,ll={start:function(n){var t=n.state,o=n.rect,s=n.edges,l=n.pageCoords,f=t.options,p=f.ratio,h=f.enabled,v=t.options,S=v.equalDelta,y=v.modifiers;p==="preserve"&&(p=o.width/o.height),t.startCoords=te({},l),t.startRect=te({},o),t.ratio=p,t.equalDelta=S;var C=t.linkedEdges={top:s.top||s.left&&!s.bottom,left:s.left||s.top&&!s.right,bottom:s.bottom||s.right&&!s.top,right:s.right||s.bottom&&!s.left};if(t.xIsPrimaryAxis=!(!s.left&&!s.right),t.equalDelta){var M=(C.left?1:-1)*(C.top?1:-1);t.edgeSign={x:M,y:M}}else t.edgeSign={x:C.left?-1:1,y:C.top?-1:1};if(h!==!1&&te(s,C),y!=null&&y.length){var Y=new Nr(n.interaction);Y.copyFrom(n.interaction.modification),Y.prepareStates(y),t.subModification=Y,Y.startAll(a({},n))}},set:function(n){var t=n.state,o=n.rect,s=n.coords,l=t.linkedEdges,f=te({},s),p=t.equalDelta?ul:fl;if(te(n.edges,l),p(t,t.xIsPrimaryAxis,s,o),!t.subModification)return null;var h=te({},o);Me(l,h,{x:s.x-f.x,y:s.y-f.y});var v=t.subModification.setAll(a(a({},n),{},{rect:h,edges:l,pageCoords:s,prevCoords:s,prevRect:h})),S=v.delta;return v.changed&&(p(t,Math.abs(S.x)>Math.abs(S.y),v.coords,v.rect),te(s,v.coords)),v.eventProps},defaults:{ratio:"preserve",equalDelta:!1,modifiers:[],enabled:!1}};function ul(n,t,o){var s=n.startCoords,l=n.edgeSign;t?o.y=s.y+(o.x-s.x)*l.y:o.x=s.x+(o.y-s.y)*l.x}function fl(n,t,o,s){var l=n.startRect,f=n.startCoords,p=n.ratio,h=n.edgeSign;if(t){var v=s.width/p;o.y=f.y+(v-l.height)*h.y}else{var S=s.height*p;o.x=f.x+(S-l.width)*h.x}}var dl=Qe(ll,"aspectRatio"),zi=function(){};zi._defaults={};var kn=zi;function it(n,t,o){return E.func(n)?Pe(n,t.interactable,t.element,[o.x,o.y,t]):Pe(n,t.interactable,t.element)}var On={start:function(n){var t=n.rect,o=n.startOffset,s=n.state,l=n.interaction,f=n.pageCoords,p=s.options,h=p.elementRect,v=te({left:0,top:0,right:0,bottom:0},p.offset||{});if(t&&h){var S=it(p.restriction,l,f);if(S){var y=S.right-S.left-t.width,C=S.bottom-S.top-t.height;y<0&&(v.left+=y,v.right+=y),C<0&&(v.top+=C,v.bottom+=C)}v.left+=o.left-t.width*h.left,v.top+=o.top-t.height*h.top,v.right+=o.right-t.width*(1-h.right),v.bottom+=o.bottom-t.height*(1-h.bottom)}s.offset=v},set:function(n){var t=n.coords,o=n.interaction,s=n.state,l=s.options,f=s.offset,p=it(l.restriction,o,t);if(p){var h=(function(v){return!v||"left"in v&&"top"in v||((v=te({},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})(p);t.x=Math.max(Math.min(h.right-f.right,t.x),h.left+f.left),t.y=Math.max(Math.min(h.bottom-f.bottom,t.y),h.top+f.top)}},defaults:{restriction:null,elementRect:null,offset:null,endOnly:!1,enabled:!1}},pl=Qe(On,"restrict"),Li={top:1/0,left:1/0,bottom:-1/0,right:-1/0},Fi={top:-1/0,left:-1/0,bottom:1/0,right:1/0};function Di(n,t){for(var o=0,s=["top","left","bottom","right"];o<s.length;o++){var l=s[o];l in n||(n[l]=t[l])}return n}var At={noInner:Li,noOuter:Fi,start:function(n){var t,o=n.interaction,s=n.startOffset,l=n.state,f=l.options;f&&(t=Ce(it(f.offset,o,o.coords.start.page))),t=t||{x:0,y:0},l.offset={top:t.y+s.top,left:t.x+s.left,bottom:t.y-s.bottom,right:t.x-s.right}},set:function(n){var t=n.coords,o=n.edges,s=n.interaction,l=n.state,f=l.offset,p=l.options;if(o){var h=te({},t),v=it(p.inner,s,h)||{},S=it(p.outer,s,h)||{};Di(v,Li),Di(S,Fi),o.top?t.y=Math.min(Math.max(S.top+f.top,h.y),v.top+f.top):o.bottom&&(t.y=Math.max(Math.min(S.bottom+f.bottom,h.y),v.bottom+f.bottom)),o.left?t.x=Math.min(Math.max(S.left+f.left,h.x),v.left+f.left):o.right&&(t.x=Math.max(Math.min(S.right+f.right,h.x),v.right+f.right))}},defaults:{inner:null,outer:null,offset:null,endOnly:!1,enabled:!1}},hl=Qe(At,"restrictEdges"),gl=te({get elementRect(){return{top:0,left:0,bottom:1,right:1}},set elementRect(n){}},On.defaults),ml=Qe({start:On.start,set:On.set,defaults:gl},"restrictRect"),vl={width:-1/0,height:-1/0},yl={width:1/0,height:1/0},bl=Qe({start:function(n){return At.start(n)},set:function(n){var t=n.interaction,o=n.state,s=n.rect,l=n.edges,f=o.options;if(l){var p=Ve(it(f.min,t,n.coords))||vl,h=Ve(it(f.max,t,n.coords))||yl;o.options={endOnly:f.endOnly,inner:te({},At.noInner),outer:te({},At.noOuter)},l.top?(o.options.inner.top=s.bottom-p.height,o.options.outer.top=s.bottom-h.height):l.bottom&&(o.options.inner.bottom=s.top+p.height,o.options.outer.bottom=s.top+h.height),l.left?(o.options.inner.left=s.right-p.width,o.options.outer.left=s.right-h.width):l.right&&(o.options.inner.right=s.left+p.width,o.options.outer.right=s.left+h.width),At.set(n),o.options=f}},defaults:{min:null,max:null,endOnly:!1,enabled:!1}},"restrictSize"),Or={start:function(n){var t,o=n.interaction,s=n.interactable,l=n.element,f=n.rect,p=n.state,h=n.startOffset,v=p.options,S=v.offsetWithOrigin?(function(M){var Y=M.interaction.element,B=Ce(Pe(M.state.options.origin,null,null,[Y])),U=B||Ye(M.interactable,Y,M.interaction.prepared.name);return U})(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=Pe(v.offset,s,l,[o]);(t=Ce(y)||{x:0,y:0}).x+=S.x,t.y+=S.y}var C=v.relativePoints;p.offsets=f&&C&&C.length?C.map((function(M,Y){return{index:Y,relativePoint:M,x:h.left-f.width*M.x+t.x,y:h.top-f.height*M.y+t.y}})):[{index:0,relativePoint:null,x:t.x,y:t.y}]},set:function(n){var t=n.interaction,o=n.coords,s=n.state,l=s.options,f=s.offsets,p=Ye(t.interactable,t.element,t.prepared.name),h=te({},o),v=[];l.offsetWithOrigin||(h.x-=p.x,h.y-=p.y);for(var S=0,y=f;S<y.length;S++)for(var C=y[S],M=h.x-C.x,Y=h.y-C.y,B=0,U=l.targets.length;B<U;B++){var ae=l.targets[B],ie=void 0;(ie=E.func(ae)?ae(M,Y,t._proxy,C,B):ae)&&v.push({x:(E.number(ie.x)?ie.x:M)+C.x,y:(E.number(ie.y)?ie.y:Y)+C.y,range:E.number(ie.range)?ie.range:l.range,source:ae,index:B,offset:C})}for(var fe={target:null,inRange:!1,distance:0,range:0,delta:{x:0,y:0}},ye=0;ye<v.length;ye++){var xe=v[ye],he=xe.range,be=xe.x-h.x,je=xe.y-h.y,Te=Ct(be,je),ze=Te<=he;he===1/0&&fe.inRange&&fe.range!==1/0&&(ze=!1),fe.target&&!(ze?fe.inRange&&he!==1/0?Te/he<fe.distance/fe.range:he===1/0&&fe.range!==1/0||Te<fe.distance:!fe.inRange&&Te<fe.distance)||(fe.target=xe,fe.distance=Te,fe.range=he,fe.inRange=ze,fe.delta.x=be,fe.delta.y=je)}return fe.inRange&&(o.x=fe.target.x,o.y=fe.target.y),s.closest=fe,fe},defaults:{range:1/0,targets:null,offset:null,offsetWithOrigin:!0,origin:null,relativePoints:null,endOnly:!1,enabled:!1}},wl=Qe(Or,"snap"),Pn={start:function(n){var t=n.state,o=n.edges,s=t.options;if(!o)return null;n.state={options:{targets:null,relativePoints:[{x:o.left?0:1,y:o.top?0:1}],offset:s.offset||"self",origin:{x:0,y:0},range:s.range}},t.targetFields=t.targetFields||[["width","height"],["x","y"]],Or.start(n),t.offsets=n.state.offsets,n.state=t},set:function(n){var t=n.interaction,o=n.state,s=n.coords,l=o.options,f=o.offsets,p={x:s.x-f[0].x,y:s.y-f[0].y};o.options=te({},l),o.options.targets=[];for(var h=0,v=l.targets||[];h<v.length;h++){var S=v[h],y=void 0;if(y=E.func(S)?S(p.x,p.y,t):S){for(var C=0,M=o.targetFields;C<M.length;C++){var Y=M[C],B=Y[0],U=Y[1];if(B in y||U in y){y.x=y[B],y.y=y[U];break}}o.options.targets.push(y)}}var ae=Or.set(n);return o.options=l,ae},defaults:{range:1/0,targets:null,offset:null,endOnly:!1,enabled:!1}},xl=Qe(Pn,"snapSize"),Pr={aspectRatio:dl,restrictEdges:hl,restrict:pl,restrictRect:ml,restrictSize:bl,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:te(ut(Pn.defaults),{targets:void 0,range:void 0,offset:{x:0,y:0}})},"snapEdges"),snap:wl,snapSize:xl,spring:kn,avoid:kn,transform:kn,rubberband:kn},El={id:"modifiers",install:function(n){var t=n.interactStatic;for(var o in n.usePlugin(xi),n.usePlugin(cl),t.modifiers=Pr,Pr){var s=Pr[o],l=s._defaults,f=s._methods;l._methods=f,n.defaults.perAction[o]=l}}},Nl=El,Vi=(function(n){b(o,n);var t=A(o);function o(s,l,f,p,h,v){var S;if(u(this,o),bn(P(S=t.call(this,h)),f),f!==l&&bn(P(S),l),S.timeStamp=v,S.originalEvent=f,S.type=s,S.pointerId=kt(l),S.pointerType=ri(l),S.target=p,S.currentTarget=null,s==="tap"){var y=h.getPointerIndex(l);S.dt=S.timeStamp-h.pointers[y].downTime;var C=S.timeStamp-h.tapTime;S.double=!!h.prevTap&&h.prevTap.type!=="doubletap"&&h.prevTap.target===S.target&&C<500}else s==="doubletap"&&(S.dt=l.timeStamp-h.tapTime,S.double=!0);return S}return g(o,[{key:"_subtractOrigin",value:function(s){var l=s.x,f=s.y;return this.pageX-=l,this.pageY-=f,this.clientX-=l,this.clientY-=f,this}},{key:"_addOrigin",value:function(s){var l=s.x,f=s.y;return this.pageX+=l,this.pageY+=f,this.clientX+=l,this.clientY+=f,this}},{key:"preventDefault",value:function(){this.originalEvent.preventDefault()}}]),o})(En),Mt={id:"pointer-events/base",before:["inertia","modifiers","auto-start","actions"],install:function(n){n.pointerEvents=Mt,n.defaults.actions.pointerEvents=Mt.defaults,te(n.actions.phaselessTypes,Mt.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,s=n.pointer,l=n.event,f=n.eventTarget;n.duplicate||o.pointerIsDown&&!o.pointerWasMoved||(o.pointerIsDown&&Ir(n),qe({interaction:o,pointer:s,event:l,eventTarget:f,type:"move"},t))},"interactions:down":function(n,t){(function(o,s){for(var l=o.interaction,f=o.pointer,p=o.event,h=o.eventTarget,v=o.pointerIndex,S=l.pointers[v].hold,y=de(h),C={interaction:l,pointer:f,event:p,eventTarget:h,type:"hold",targets:[],path:y,node:null},M=0;M<y.length;M++){var Y=y[M];C.node=Y,s.fire("pointerEvents:collect-targets",C)}if(C.targets.length){for(var B=1/0,U=0,ae=C.targets;U<ae.length;U++){var ie=ae[U].eventable.options.holdDuration;ie<B&&(B=ie)}S.duration=B,S.timeout=setTimeout((function(){qe({interaction:l,eventTarget:h,pointer:f,event:p,type:"hold"},s)}),B)}})(n,t),qe(n,t)},"interactions:up":function(n,t){Ir(n),qe(n,t),(function(o,s){var l=o.interaction,f=o.pointer,p=o.event,h=o.eventTarget;l.pointerWasMoved||qe({interaction:l,eventTarget:h,pointer:f,event:p,type:"tap"},s)})(n,t)},"interactions:cancel":function(n,t){Ir(n),qe(n,t)}},PointerEvent:Vi,fire:qe,collectEventTargets:Bi,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,s=n.pointer,l=n.event,f=n.eventTarget,p=n.type,h=n.targets,v=h===void 0?Bi(n,t):h,S=new Vi(p,s,l,f,o,t.now());t.fire("pointerEvents:new",{pointerEvent:S});for(var y={interaction:o,pointer:s,event:l,eventTarget:f,targets:v,type:p,pointerEvent:S},C=0;C<v.length;C++){var M=v[C];for(var Y in M.props||{})S[Y]=M.props[Y];var B=Ye(M.eventable,M.node);if(S._subtractOrigin(B),S.eventable=M.eventable,S.currentTarget=M.node,M.eventable.fire(S),S._addOrigin(B),S.immediatePropagationStopped||S.propagationStopped&&C+1<v.length&&v[C+1].node!==S.currentTarget)break}if(t.fire("pointerEvents:fired",y),p==="tap"){var U=S.double?qe({interaction:o,pointer:s,event:l,eventTarget:f,type:"doubletap"},t):S;o.prevTap=U,o.tapTime=U.timeStamp}return S}function Bi(n,t){var o=n.interaction,s=n.pointer,l=n.event,f=n.eventTarget,p=n.type,h=o.getPointerIndex(s),v=o.pointers[h];if(p==="tap"&&(o.pointerWasMoved||!v||v.downTarget!==f))return[];for(var S=de(f),y={interaction:o,pointer:s,event:l,eventTarget:f,type:p,path:S,targets:[],node:null},C=0;C<S.length;C++){var M=S[C];y.node=M,t.fire("pointerEvents:collect-targets",y)}return p==="hold"&&(y.targets=y.targets.filter((function(Y){var B,U;return Y.eventable.options.holdDuration===((B=o.pointers[h])==null||(U=B.hold)==null?void 0:U.duration)}))),y.targets}function Ir(n){var t=n.interaction,o=n.pointerIndex,s=t.pointers[o].hold;s&&s.timeout&&(clearTimeout(s.timeout),s.timeout=null)}var Sl=Object.freeze({__proto__:null,default:Mt});function Tl(n){var t=n.interaction;t.holdIntervalHandle&&(clearInterval(t.holdIntervalHandle),t.holdIntervalHandle=null)}var _l={id:"pointer-events/holdRepeat",install:function(n){n.usePlugin(Mt);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)]=Tl,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,s=n.pointerEvent,l=n.eventTarget,f=n.targets;if(s.type==="hold"&&f.length){var p=f[0].eventable.options.holdRepeatInterval;p<=0||(o.holdIntervalHandle=setTimeout((function(){t.pointerEvents.fire({interaction:o,eventTarget:l,type:"hold",pointer:s,event:s},t)}),p))}}})},Cl=_l,kl={id:"pointer-events/interactableTargets",install:function(n){var t=n.Interactable;t.prototype.pointerEvents=function(s){return te(this.events.options,s),this};var o=t.prototype._backCompatOption;t.prototype._backCompatOption=function(s,l){var f=o.call(this,s,l);return f===this&&(this.events.options[s]=l),f}},listeners:{"pointerEvents:collect-targets":function(n,t){var o=n.targets,s=n.node,l=n.type,f=n.eventTarget;t.interactables.forEachMatch(s,(function(p){var h=p.events,v=h.options;h.types[l]&&h.types[l].length&&p.testIgnoreAllow(v,s,f)&&o.push({node:s,eventable:h,props:{interactable:p}})}))},"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,s=n.options;te(o.events.options,t.pointerEvents.defaults),te(o.events.options,s.pointerEvents||{})}}},Ol=kl,Pl={id:"pointer-events",install:function(n){n.usePlugin(Sl),n.usePlugin(Cl),n.usePlugin(Ol)}},Il=Pl,Rl={id:"reflow",install:function(n){var t=n.Interactable;n.actions.phases.reflow=!0,t.prototype.reflow=function(o){return(function(s,l,f){for(var p=s.getAllElements(),h=f.window.Promise,v=h?[]:null,S=function(){var C=p[y],M=s.getRect(C);if(!M)return 1;var Y,B=Pt(f.interactions.list,(function(ie){return ie.interacting()&&ie.interactable===s&&ie.element===C&&ie.prepared.name===l.name}));if(B)B.move(),v&&(Y=B._reflowPromise||new h((function(ie){B._reflowResolve=ie})));else{var U=Ve(M),ae=(function(ie){return{coords:ie,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:U.x,y:U.y},client:{x:U.x,y:U.y},timeStamp:f.now()});Y=(function(ie,fe,ye,xe,he){var be=ie.interactions.new({pointerType:"reflow"}),je={interaction:be,event:he,pointer:he,eventTarget:ye,phase:"reflow"};be.interactable=fe,be.element=ye,be.prevEvent=he,be.updatePointer(he,he,ye,!0),qo(be.coords.delta),br(be.prepared,xe),be._doPhase(je);var Te=ie.window,ze=Te.Promise,Le=ze?new ze((function(Ge){be._reflowResolve=Ge})):void 0;return be._reflowPromise=Le,be.start(xe,fe,ye),be._interacting?(be.move(je),be.end(he)):(be.stop(),be._reflowResolve()),be.removePointer(he,he),Le})(f,s,C,l,ae)}v&&v.push(Y)},y=0;y<p.length&&!S();y++);return v&&h.all(v).then((function(){return s}))})(this,o,n)}},listeners:{"interactions:stop":function(n,t){var o=n.interaction;o.pointerType==="reflow"&&(o._reflowResolve&&o._reflowResolve(),(function(s,l){s.splice(s.indexOf(l),1)})(t.interactions.list,o))}}},jl=Rl;if(Re.use(wi),Re.use(_i),Re.use(Il),Re.use(Zc),Re.use(Nl),Re.use(Fc),Re.use(Cc),Re.use(Oc),Re.use(jl),Re.default=Re,c(e)==="object"&&e)try{e.exports=Re}catch{}return Re.default=Re,Re}))})(Vt)),Vt.exports}var ss=is();const as=Rr(ss);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],[i])=>r.localeCompare(i))):""}function Jr(e,{isEnabled:r=!0,onDragStart:i,onDragMove:a,onDragEnd:c,...u}){const d=Ee(i),g=Ee(a),m=Ee(c);T.useLayoutEffect(()=>{if(!r)return;const b=e.current;if(!b)return;const k=as(b).draggable({inertia:!0,...u,onstart:({client:_})=>{const P=Se.make(_);d.current?.(P)},onmove:({client:_,clientX0:P,clientY0:A,dx:z,dy:N})=>{const R=Se.make(P,A),ne=Se.make(_),$=Se.make(z,N);g.current?.($,ne,R)},onend:({client:_,clientX0:P,clientY0:A})=>{const z=Se.make(P,A),N=Se.make(_);m.current?.(N,z)}});return()=>{k.unset(),m.current?.(Se.zero,Se.zero)}},[r,Fe(u)])}function st(e,{initialValue:r,transform:i,onDragStart:a,onDragMove:c,onDragEnd:u,...d}){const g=T.useRef(r),[m,b]=T.useState(!1),[k,_]=T.useState(!1),[P,A]=T.useState(r),z=Ee(a),N=Ee(c),R=Ee(u),ne=Ee(i);return Jr(e,{onDragStart:x=>{b(!0),_(!1),z.current?.(x)},onDragMove:(x,O,E)=>{const F=ne.current(g.current,x.x,x.y);Zr(g,F)&&A(F),b(!0),_(!1),N.current?.(x,O,E)},onDragEnd:(x,O)=>{b(!1),_(!0),R.current?.(x,O)},...d}),T.useEffect(()=>{Zr(g,P)},[P]),{isDragging:m,isReleasing:k,value:P,setValue:A}}function Zr(e,r){return He(e.current,r)?!1:(e.current=r,!0)}const Un=T.forwardRef(({angle:e=0,speed:r=1,src:i,zeroAnchor:a=0,onAngleChange:c,onPositionChange:u,onDragStart:d,onDragEnd:g,onLoadImageStart:m,onLoadImageComplete:b,onLoadImageError:k,onImageSizeChange:_,...P},A)=>{const z=T.useCallback((F,G,Q)=>F-G*r,[r]),N=T.useRef(null),R=Be(N),ne=jn({src:i},{onLoadStart:m,onLoadComplete:b,onLoadError:k}),[$,L]=T.useState(e),{isDragging:K,value:x,setValue:O}=st(N,{initialValue:0,transform:z,onDragStart:d,onDragEnd:g});T.useEffect(()=>{if(K||!ne)return;const F=ls(e,ne,we.size(R),a);F!==x&&O(F),e!==$&&L(e)},[e,ne,R.width,R.height,a]),T.useEffect(()=>{if(!K||!ne)return;const F=us(x,ne,we.size(R),a);$!==F&&L(F)},[x,ne,R.width,R.height,a]),T.useEffect(()=>{c?.($,K),u?.($/360,K)},[$]),T.useEffect(()=>{_?.(ne)},[ne?.width,ne?.height]);const E=cs({src:i,displacement:x});return w.jsx("div",{...P,ref:A,"aria-valuenow":$,role:"slider",children:w.jsx("div",{ref:N,style:E.body})})});function cs({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 Qr(e,r){const{width:i,height:a}=e,{height:c}=r;if(a<=0)return Oe.zero;const d=c/a*i;return Oe.make(d,c)}function ls(e,r,i,a){const{width:c}=Qr(r,i),{width:u}=i,d=u*a;return e/360*c-d}function us(e,r,i,a){const{width:c}=Qr(r,i),{width:u}=i,d=u*a;let g=(e+d)%c/c*360;for(;g<0;)g+=360;return g}process.env.NODE_ENV==="development"&&(Un.displayName="Panorama");const $r=T.forwardRef(({className:e,style:r,angle:i=0,autoDimension:a="width",children:c,fov:u,speed:d=1,src:g,viewportSize:m,zeroAnchor:b=0,onAngleChange:k,onDragEnd:_,onDragStart:P,onLoadImageComplete:A,onLoadImageError:z,onLoadImageStart:N,onImageSizeChange:R,onPositionChange:ne,...$},L)=>{const K=T.useRef(null),x=Be(K),[O,E]=T.useState(),[F,G]=T.useState(!1),se=T.useCallback(()=>{if(!O)return 0;const{width:D,height:I}=O;return I===0?0:D/I},[O?.width,O?.height])(),W=T.useCallback(()=>{const D=Math.min(360,Math.max(0,u??(m?m.width/(m.height*se)*360:0)));return x.width*(D/360)},[m?.width,m?.height,se,x.width,u])(),V=T.useCallback(()=>x.width<=0?b:((x.width-W)*.5+b*W)/x.width,[x.width,W,b])(),re=T.useCallback(()=>{G(!0),P?.()},[P]),oe=T.useCallback(()=>{G(!1),_?.()},[_]),le=ke(c,{track:mt,reticle:Ht,indicator:Bt}),H=fs({autoDimension:a,panoramaRect:x,aspectRatio:se,reticleWidth:W});return w.jsxs("div",{...$,ref:L,className:ce(e,{dragging:F}),style:ue(r,H.root),children:[w.jsx(Un,{ref:K,angle:i,speed:d,src:g,style:H.panorama,zeroAnchor:V,onAngleChange:k,onDragEnd:oe,onDragStart:re,onImageSizeChange:E,onLoadImageComplete:A,onLoadImageError:z,onLoadImageStart:N,onPositionChange:ne}),w.jsx("div",{style:H.body,children:w.jsxs("div",{style:H.controls,children:[w.jsx(me,{className:ce({dragging:F}),element:le.track??w.jsx(mt,{}),style:H.track}),w.jsx(me,{className:ce({dragging:F}),element:le.reticle??w.jsx(Ht,{}),style:H.reticle}),w.jsx(me,{className:ce({dragging:F}),element:le.track??w.jsx(mt,{}),style:H.track})]})}),w.jsx(me,{className:ce({dragging:F}),element:le.indicator??w.jsx(Bt,{}),style:H.indicator})]})}),Bt=({...e})=>w.jsx("div",{...e}),Ht=({...e})=>w.jsx("div",{...e}),mt=({...e})=>w.jsx("div",{...e});function fs({autoDimension:e="width",panoramaRect:r=we.zero,aspectRatio:i=0,reticleWidth:a=0}){return{root:{...e==="width"?{width:`${r.height*i}px`}:{height:`${r.width/i}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==="development"&&($r.displayName="PanoramaSlider",Bt.displayName="PanoramaSliderIndicator",Ht.displayName="PanoramaSliderReticle",mt.displayName="PanoramaSliderTrack");const qr=T.forwardRef(({children:e,className:r,isDeselectable:i=!1,isDisabled:a=!1,isSelected:c=!1,label:u,onDeselect:d,onSelect:g,onToggle:m,...b},k)=>{const _=()=>{if(!a)if(c){if(!i)return;m?.(c),d?.()}else m?.(c),g?.()};return w.jsx("button",{...b,ref:k,"aria-disabled":a,"aria-label":u,"aria-selected":c,className:ce(r,{active:c,disabled:a||c&&!i}),disabled:a||c&&!i,onClick:_,children:e??u})});process.env.NODE_ENV==="development"&&(qr.displayName="SelectableButton");function eo({children:e,if:r}){switch(typeof r){case"function":return r()?w.jsx(w.Fragment,{children:e}):w.jsx(w.Fragment,{});default:return r?w.jsx(w.Fragment,{children:e}):w.jsx(w.Fragment,{})}}process.env.NODE_ENV==="development"&&(eo.displayName="Conditional");function vt({in:e,children:r,render:i}){if(e==null)return w.jsx(w.Fragment,{});if(!(e instanceof Array))throw TypeError(`Provided list <${e}> is not an array`);return w.jsx(w.Fragment,{children:e.map((a,c)=>w.jsx(T.Fragment,{children:i?.(a,c)??(typeof r=="function"?r(a,c):r)},`item-${c}`))})}process.env.NODE_ENV==="development"&&(vt.displayName="Each");function ds({children:e,condition:r}){const i=T.Children.toArray(e);if(i.length===0)return console.error("[etudes::Switch] `Switch` must have at least one child"),w.jsx(w.Fragment,{});if(!ps(i))return console.error("[etudes::Switch] `Switch` children must be of `Case` type or `Default` type"),w.jsx(w.Fragment,{});const a=i.filter(u=>u.type===Kn);if(a.length>1)return console.error("[etudes::Switch] `Switch` can only have maximum one `Default` child"),w.jsx(w.Fragment,{});const c=a[0];for(const u of i)if(typeof r=="function"){if(r(u.props.value))return u}else if(r===u.props.value)return u;if(c)return c}function to({children:e}){return e}function Kn({children:e}){return e}function ps(e){return e.every(r=>T.isValidElement(r)&&(r.type===to||r.type===Kn))}const Gn=T.forwardRef(({children:e,...r},i)=>(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.`),T.Children.map(e,(a,c)=>{if(!(c>0))return T.isValidElement(a)?Ft(a,{...r,ref:i}):a})));process.env.NODE_ENV==="development"&&(Gn.displayName="ExtractChild");function no({children:e,className:r,style:i,alignment:a,arrowHeight:c=6,arrowWidth:u=12,gap:d=4,hint:g,maxWidth:m=200,threshold:b=100}){const k=T.useRef(null),_=T.useRef(void 0),P=Be(k),A=T.useCallback(()=>{const R=window.document.createElement("span");R.className=ce(r),R.innerHTML=g,R.role="tooltip";const ne=a??(k.current?gs(k.current,b):"tl"),$=hs(R),L=ys({alignment:ne,arrowSize:Oe.make(u,c),gap:d,maxDialogWidth:m,fullDialogWidth:$.width,targetWidth:P.width}),K=ue(i,L.dialog);Object.keys(K).forEach(O=>R.style[O]=K[O]);const x=window.document.createElement("span");return Object.keys(L.arrow).forEach(O=>x.style[O]=L.arrow[O]),R.appendChild(x),R},[r,a,g,m,Fe(i),P.width,b,c,u,d]),z=T.useCallback(()=>{_.current&&(_.current.style.opacity="1",_.current.ariaHidden="false")},[]),N=T.useCallback(()=>{_.current&&(_.current.style.opacity="0",_.current.ariaHidden="true")},[]);return T.useEffect(()=>{const R=A();return k.current?.appendChild(R),_.current=R,()=>{k.current?.removeChild(R),_.current=void 0}},[A]),w.jsx(Gn,{ref:k,onMouseEnter:z,onMouseLeave:N,children:e})}function hs(e){if(typeof window>"u")return Oe.zero;const r=e.cloneNode(!1);r.innerHTML=e.innerHTML,r.style.visibility="hidden",r.style.whiteSpace="pre",window.document.body.appendChild(r);const i=r.getBoundingClientRect();return window.document.body.removeChild(r),Oe.make(i.width,i.height)}function gs(e,r){const i=we.fromViewport(),a=we.intersecting(e);if(a){const c=a.left-i.left<r,u=i.right-a.right<r,d=a.top-i.top<r,g=i.bottom-a.bottom<r;if(c&&d)return"br";if(c&&g)return"tr";if(u&&d)return"bl";if(u&&g)return"tl";if(c)return"cr";if(u)return"cl";if(g)return"tc"}return"tc"}function ms({alignment:e,arrowSize:r,fullDialogWidth:i,gap:a,maxDialogWidth:c,targetWidth:u}){const d=Math.min(i,c),g=u>d;switch(e){case"tl":return{bottom:`calc(100% + ${r.height}px + ${a}px)`,right:g?"":"0",left:g?"50%":"",transform:`translate(${d>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(${d>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(${d>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(${d>u?"0":"-50%"}, 0)`};default:return console.error(`[etudes::WithTooltip] Invalid alignment: ${e}`),{}}}function vs({alignment:e,arrowSize:r,fullDialogWidth:i,maxDialogWidth:a,targetWidth:c}){const u=Math.min(i,a),d=c>u;switch(e){case"tl":return{bottom:0,clipPath:"polygon(50% 100%,100% 0,0 0)",height:`${r.height}px`,left:d?"50%":"",right:d?"":`${c-r.width/2-c/2}px`,transform:`translate(${d?"-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:d?"50%":`${c-r.width/2-c/2}px`,transform:`translate(${d?"-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:d?"50%":"",right:d?"":`${c-r.width/2-c/2}px`,top:"0",transform:`translate(${d?"-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:d?"50%":`${c-r.width/2-c/2}px`,top:"0",transform:`translate(${d?"-50%":"0"}, -100%)`,width:`${r.width}px`};default:return console.error(`[etudes::WithTooltip] Invalid alignment: ${e}`),{}}}function ys({alignment:e,arrowSize:r,fullDialogWidth:i,gap:a,maxDialogWidth:c,targetWidth:u}){return{dialog:{boxSizing:"border-box",height:"auto",margin:"0",opacity:"0",pointerEvents:"none",position:"absolute",userSelect:"none",whiteSpace:i>c?"normal":"pre",width:i>c?`${c}px`:"",...ms({alignment:e,arrowSize:r,fullDialogWidth:i,gap:a,maxDialogWidth:c,targetWidth:u})},arrow:{background:"inherit",position:"absolute",...vs({alignment:e,arrowSize:r,fullDialogWidth:i,maxDialogWidth:c,targetWidth:u})}}}process.env.NODE_ENV==="development"&&(no.displayName="WithTooltip");function bs(){const e=navigator.userAgent||navigator.vendor||window.opera;return T.useMemo(()=>{switch(!0){case/android/i.test(e):return"android";case(/iPad|iPhone|iPod/.test(e)&&!window.MSStream):return"ios";case/win/i.test(e):return"windows";case/mac/i.test(e):return"macos";case/linux/i.test(e):return"linux";default:return"unknown"}},[e])}function ws(e,{element:r,isEnabled:i=!0}={}){T.useLayoutEffect(()=>{if(!i)return;const a=r??window.document.documentElement,c=a.className;return a.classList.add(e),()=>{a.className=c}},[e,r,i])}function xs(e,r){const i=Ee(r);T.useLayoutEffect(()=>{const a=c=>{if(!(c.target instanceof Node))return;let u=!0,d=c.target;const m=[].concat(e).map(b=>b.current);for(;d;){if(m.find(b=>b===d)){u=!1;break}if(!d.parentNode)break;d=d.parentNode}u&&i.current()};return window.addEventListener("click",a,!0),()=>{window.removeEventListener("click",a,!0)}},[])}function Es(){return typeof window>"u"?1:window.devicePixelRatio||1}function Ns(){return T.useMemo(()=>Es(),[])}function ro(e,{isEnabled:r=!0,updatesCursor:i=!0,onDragStart:a,onDragMove:c,onDragEnd:u}){const d=T.useRef(void 0),g=T.useRef(void 0),m=Ee(a),b=Ee(c),k=Ee(u),_=T.useCallback(z=>{if(!d.current)return;const N=Se.make(z.clientX,z.clientY),R=Se.subtract(N,g.current??d.current);g.current=N,b.current?.(R,N,d.current)},[]),P=T.useCallback(z=>{const N=e.current;if(!N||!d.current)return;const R=Se.make(z.clientX,z.clientY),ne=Se.subtract(g.current??d.current,R);k.current?.(R,ne,d.current),d.current=void 0,g.current=void 0,N.removeEventListener("mousemove",_),N.removeEventListener("mouseup",P,{capture:!0}),N.removeEventListener("mouseleave",P),i&&(N.style.cursor="grab")},[i,_]),A=T.useCallback(z=>{const N=e.current;if(!N)return;z.preventDefault();const R=Se.make(z.clientX,z.clientY);d.current=R,g.current=R,N.addEventListener("mousemove",_),N.addEventListener("mouseup",P,{capture:!0}),N.addEventListener("mouseleave",P),i&&(N.style.cursor="grabbing"),m.current?.(R)},[i,_,P]);T.useLayoutEffect(()=>{const z=e.current;if(!z||!r||!i)return;const N=z.style.cursor;return z.style.cursor="grab",()=>{z.style.cursor=N}},[r,i]),T.useLayoutEffect(()=>{const z=e.current;if(!(!z||!r))return z.addEventListener("mousedown",A),()=>{z.removeEventListener("mousedown",A),z.removeEventListener("mousemove",_),z.removeEventListener("mouseup",P,{capture:!0}),z.removeEventListener("mouseleave",P)}},[r,_,P,A])}function Ss(e){const[r,i]=T.useState(!1),a=T.useCallback(d=>{d.preventDefault(),d.stopPropagation(),i(!0)},[]),c=T.useCallback(d=>{d.preventDefault(),d.stopPropagation(),i(!1)},[]),u=T.useCallback(d=>{d.preventDefault(),d.stopPropagation(),i(!1);const g=d.dataTransfer.files;if(g&&g.length>0){const m=g[0];new FormData().append("file",m),e(m)}},[]);return{isDropping:r,onDragOver:a,onDragLeave:c,onDrop:u}}function oo(e,{autoStarts:r=!0,shouldInvokeInitially:i=!1,onInterval:a},c=[]){const u=T.useRef(void 0),d=Ee(a),g=T.useCallback(()=>{clearInterval(u.current),u.current=void 0},[]),m=T.useCallback(()=>{g(),!(e<0)&&(i&&d.current(),u.current=setInterval(()=>{d.current()},e))},[e,i,g]);return T.useEffect(()=>(r&&e>0&&m(),g),[r,e,m,g,...c]),{start:m,stop:g}}function Ts(){const[e,r]=T.useState(!1);return T.useEffect(()=>(r(!0),()=>{r(!1)}),[]),e}function io(){return typeof window>"u"?!1:!!(typeof window.navigator<"u"&&(window.navigator.maxTouchPoints>0||"msMaxTouchPoints"in window.navigator&&window.navigator.msMaxTouchPoints>0)||window.matchMedia("(pointer: coarse)").matches||window.matchMedia("(hover: none)").matches||"ontouchstart"in window||"ontouchstart"in window.document.documentElement)}function so(){return T.useMemo(()=>io(),[])}function _s(e,r){const i=Ee(r);T.useEffect(()=>{const a=c=>{c.key===e&&i.current?.()};return window.addEventListener("keydown",a),()=>{window.removeEventListener("keydown",a)}},[e])}const Wn=typeof window<"u"?window.localStorage:void 0;function ao({defaultTTL:e=300}={}){return{get:ks,invalidate:co,set:(r,i,a=e)=>Os(r,i,a)}}function co(e){Wn?.removeItem(e)}function Cs(e){const{timestamp:r,ttl:i}=e;return(Date.now()-r)/1e3>=i}function ks(e){const r=Wn?.getItem(e);if(!r)return;const i=JSON.parse(r);if(i)if(Cs(i)){co(e);return}else return i.value}function Os(e,r,i){const a={value:e,timestamp:Date.now(),ttl:i};return Wn?.setItem(r,JSON.stringify(a)),e}function Ps(e){return T.useMemo(()=>ao({defaultTTL:e}),[e])}function Is(e,r=[]){const i=Ee(e),a=T.useRef(void 0),c=T.useRef(!1);T.useLayoutEffect(()=>{const u=()=>{const g=Rs();g&&(i.current(g,a.current),a.current=g)},d=()=>{c.current||typeof requestAnimationFrame=="function"&&(c.current=!0,requestAnimationFrame(()=>{u(),c.current=!1}))};return window.addEventListener("scroll",d,{passive:!0}),window.addEventListener("resize",d),window.addEventListener("orientationchange",d),d(),()=>{window.removeEventListener("scroll",d),window.removeEventListener("resize",d),window.removeEventListener("orientationchange",d)}},[...r])}function Rs(){const e=we.fromViewport(),r=we.clone(e,{x:0,y:0}),i=we.from(window,{overflow:!0});if(!i)return;const a=we.clone(r,{x:i.width-e.width,y:i.height-e.height}),c=Se.make(e.left/a.left,e.top/a.top);return{minPos:Se.make(r.left,r.top),maxPos:Se.make(a.left,a.top),pos:Se.make(e.left,e.top),step:c}}function lo(e){const r=T.useRef(void 0);return T.useEffect(()=>{r.current=e},[e]),r.current}const Jn=typeof window<"u"?window.sessionStorage:void 0;function uo({defaultTTL:e=300}={}){return{get:As,invalidate:fo,set:(r,i,a=e)=>Ms(r,i,a)}}function fo(e){Jn?.removeItem(e)}function js(e){const{timestamp:r,ttl:i}=e;return(Date.now()-r)/1e3>=i}function As(e){const r=Jn?.getItem(e);if(!r)return;const i=JSON.parse(r);if(i)if(js(i)){fo(e);return}else return i.value}function Ms(e,r,i){const a={value:e,timestamp:Date.now(),ttl:i};return Jn?.setItem(r,JSON.stringify(a)),e}function zs(e){return T.useMemo(()=>uo({defaultTTL:e}),[e])}function Zn(e){const[r,i]=T.useState(we.zero);return Dt(e,{onResize:a=>{const c=we.from(a);c&&i(c)}}),we.size(r)}function po(e,{element:r,computed:i}){if(typeof window>"u")return;const a=r??window.document.documentElement;return i?window.getComputedStyle(a).getPropertyValue(e)||void 0:a.style.getPropertyValue(e)||void 0}function Qn(e,r,{element:i}={}){if(typeof window>"u")return;const a=i??window.document.documentElement;r===void 0?a.style.removeProperty(e):a.style.setProperty(e,r)}function Ls(e,r,{element:i,isEnabled:a=!0}={}){T.useLayoutEffect(()=>{if(!a)return;const c=i??window.document.documentElement,u=po(e,{element:c,computed:!1});return Qn(e,r,{element:c}),()=>{Qn(e,u,{element:c})}},[e,r,i,a])}function Fs(e,{autoStarts:r=!0,onTimeout:i},a=[]){const c=T.useRef(void 0),u=Ee(i),d=T.useCallback(()=>{c.current!==void 0&&(clearTimeout(c.current),c.current=void 0)},[]),g=T.useCallback(()=>{d(),!(e<0)&&(c.current=setTimeout(()=>{d(),u.current()},e))},[e,d]);return T.useEffect(()=>(r&&e>=0&&g(),d),[r,e,g,d,...a]),{start:g,stop:d}}const Yt=T.forwardRef(({className:e,children:r,style:i,isSelectionTogglable:a=!1,itemLength:c,itemPadding:u=0,items:d=[],layout:g="list",numSegments:m=1,orientation:b="vertical",selection:k,selectionMode:_="none",onActivateAt:P,onDeselectAt:A,onCustomEvent:z,onSelectAt:N,onSelectionChange:R,ItemComponent:ne,...$},L)=>{const K=Vs(k??[],d),x=Bs({itemLength:c,itemPadding:u,layout:g,numSegments:m,orientation:b}),O=W=>K.indexOf(W)>=0,E=W=>{O(W)?G(W):F(W)},F=W=>{if(O(W))return;let X;switch(_){case"multiple":{X=oe=>ho([...oe.filter(le=>le!==W),W]);break}case"single":{X=oe=>[W];break}default:return}const V=K,re=X(K);se(V,re)},G=W=>{if(!O(W))return;const X=oe=>oe.filter(le=>le!==W),V=K,re=X(K);se(V,re)},Q=W=>{P?.(W),_!=="none"&&(a?E(W):F(W))},se=(W,X)=>{if(He(W,X))return;const V=W?.filter(oe=>X.indexOf(oe)===-1)??[],re=X.filter(oe=>W?.indexOf(oe)===-1);V.forEach(oe=>A?.(oe)),re.forEach(oe=>N?.(oe)),R?.(X)};T.useEffect(()=>{const W=K;let X;switch(_){case"multiple":X=K;break;case"single":X=K.slice(-1);break;default:X=[];break}se(W,X)},[_]);const ee=ke(r,{item:at});return w.jsx("div",{...$,ref:L,"aria-multiselectable":_==="multiple",className:ce(e),role:g==="grid"?"grid":_==="none"?"list":"listbox",style:ue(i,x.root),children:w.jsx(vt,{in:d,children:(W,X)=>{const V=g==="grid"?"gridcell":_==="none"?"listitem":"option",re=O(X),oe=ue(x.item,{pointerEvents:a!==!0&&O(X)?"none":"auto",...X>=d.length-1?{}:{...g==="list"?{...b==="vertical"?{marginBottom:`${u}px`}:{marginRight:`${u}px`}}:{}}});return ne?w.jsx(ne,{"aria-selected":re,className:ce({active:re}),index:X,isSelected:O(X),item:W,orientation:b,role:V,style:oe,onClick:()=>Q(X),onCustomEvent:(le,H)=>z?.(X,le,H)}):w.jsx(me,{"aria-selected":re,className:ce({active:re}),element:ee.item??w.jsx(at,{}),role:V,selectionMode:_,style:oe,onActivateAt:P,onClick:()=>Q(X),children:`${W}`})}})})}),at=({children:e,selectionMode:r,onActivateAt:i,...a})=>i||r==="single"||r==="multiple"?w.jsx("button",{...a,children:e}):w.jsx("div",{...a,children:e});function Ds(e,r){return!!(isNaN(e)||e>=r.length||e<0)}function Vs(e,r){return ho(e).filter(i=>!Ds(i,r))}function ho(e){return e.sort((r,i)=>r-i)}function Bs({itemLength:e=NaN,itemPadding:r=0,layout:i="collection",numSegments:a=1,orientation:c="vertical"}){return{root:{counterReset:"item-counter",listStyle:"none",...i==="list"?{alignItems:"flex-start",display:"flex",flex:"0 0 auto",flexDirection:c==="horizontal"?"row":"column",justifyContent:"flex-start"}:{display:"grid",gap:`${r}px`,...c==="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",...i==="list"?{...c==="vertical"?{width:"100%",height:isNaN(e)?void 0:`${e}px`}:{width:isNaN(e)?void 0:`${e}px`,height:"100%"}}:{}}}}process.env.NODE_ENV==="development"&&(Yt.displayName="Collection",at.displayName="CollectionItem");const go=T.forwardRef(({children:e,style:r,autoCollapseSections:i=!1,expandedSectionIndices:a,orientation:c="vertical",sectionPadding:u=0,sections:d,selection:g,selectionMode:m="single",onActivateAt:b,onCollapseSectionAt:k,onDeselectAt:_,onExpandedSectionsChange:P,onExpandSectionAt:A,onHeaderCustomEvent:z,onItemCustomEvent:N,onSelectAt:R,onSelectionChange:ne,HeaderComponent:$,ItemComponent:L,...K},x)=>{const O=Xs(g??{},d),E=Ys(a??[],d),F=Us({orientation:c}),G=d.map(()=>T.useRef(null)),Q=G.map(H=>Zn(H)),se=(H,D)=>(O[D]?.indexOf(H)??-1)>=0,ee=H=>E.indexOf(H)>=0,W=H=>{let D;ee(H)?D=I=>I.filter(J=>J!==H):i?D=I=>[H]:D=I=>[...I.filter(J=>J!==H),H],re(E,D(E))},X=(H,D)=>{if(se(H,D))return;let I;switch(m){case"multiple":I=q=>({...q,[D]:Kt([...(q[D]??[]).filter(Z=>Z!==H),H])});break;case"single":I=q=>({[D]:[H]});break;default:return}const J=I(O);oe(O,J)},V=(H,D)=>{if(!se(H,D))return;const J=(q=>({...q,[D]:(q[D]??[]).filter(Z=>Z!==H)}))(O);oe(O,J)},re=(H,D)=>{if(He(H,D))return;const I=H?.filter(q=>D.indexOf(q)===-1)??[],J=D.filter(q=>H?.indexOf(q)===-1);I.forEach(q=>k?.(q)),J.forEach(q=>A?.(q)),P?.(D)},oe=(H,D)=>{if(He(H,D))return;const I=d.length;let J=[],q=[];for(let Z=0;Z<I;Z++){const pe=H?.[Z]??[],ve=D[Z]??[],de=pe.filter(te=>ve.indexOf(te)===-1),Ne=ve.filter(te=>pe?.indexOf(te)===-1);J=[...J,...de.map(te=>[te,Z])],q=[...q,...Ne.map(te=>[te,Z])]}J.forEach(Z=>_?.(Z[0],Z[1])),q.forEach(Z=>R?.(Z[0],Z[1])),ne?.(D)},le=ke(e,{collapseIcon:qn,expandIcon:$n,header:Xt,item:Ut,section:er});return w.jsx("div",{...K,ref:x,style:ue(r,F.root),children:w.jsx(vt,{in:d,children:(H,D)=>{const{collectionPadding:I=0,items:J=[],itemLength:q=50,itemPadding:Z=0,isSelectionTogglable:pe,layout:ve="list",maxVisible:de=-1,numSegments:Ne=1}=H,te=ve==="list"?J.length:Math.ceil(J.length/Ne),De=de<0?te:Math.min(te,de),Pe=q*De+Z*(De-1),Ce=!ee(D),Ve=Q[D];return w.jsxs(me,{element:le.section??w.jsx(er,{}),style:ue(F.section,c==="vertical"?{marginTop:D===0?"0px":`${u}px`,...Ve.height>0?{height:Ce?`${Ve.height}px`:`${Pe+Ve.height+I}px`}:{visibility:"hidden"}}:{marginLeft:D===0?"0px":`${u}px`,...Ve.width>0?{width:Ce?`${Ve.width}px`:`${Pe+Ve.width+I}px`}:{visibility:"hidden"}}),children:[w.jsx("div",{ref:G[D],style:ue(F.headerContainer),children:$?w.jsx($,{"aria-expanded":!Ce,className:ce({collapsed:Ce,expanded:!Ce}),index:D,isCollapsed:Ce,role:"button",section:H,style:ue(F.header),onClick:()=>W(D),onCustomEvent:(Me,Ye)=>z?.(D,Me,Ye)}):w.jsxs(me,{"aria-expanded":!Ce,className:ce({collapsed:Ce,expanded:!Ce}),element:le.header??w.jsx(Xt,{}),role:"button",style:ue(F.header),onClick:()=>W(D),children:[w.jsx("span",{dangerouslySetInnerHTML:{__html:H.label}}),le.expandIcon&&w.jsx(me,{className:ce({collapsed:Ce,expanded:!Ce}),element:Ce?le.collapseIcon??le.expandIcon:le.expandIcon,style:ue(Ce?F.collapseIcon:F.expandIcon)})]})}),w.jsx("div",{role:"region",style:ue({pointerEvents:Ce?"none":"auto"},c==="vertical"?{width:"100%",height:`${Pe}px`,marginTop:`${I}px`,overflowY:de<0||de>=te?"hidden":"scroll"}:{marginLeft:`${I}px`,overflowX:de<0||de>=te?"hidden":"scroll",width:`${Pe}px`,height:"100%"}),children:w.jsx(Yt,{className:ce({collapsed:Ce,expanded:!Ce}),isSelectionTogglable:pe,ItemComponent:L,itemLength:q,itemPadding:Z,items:J,layout:ve,numSegments:Ne,orientation:c,selection:O[D]??[],selectionMode:m,style:ue(c==="vertical"?{width:"100%"}:{height:"100%"}),onActivateAt:Me=>b?.(Me,D),onCustomEvent:(Me,Ye,Xe)=>N?.(Me,D,Ye,Xe),onDeselectAt:Me=>V(Me,D),onSelectAt:Me=>X(Me,D),children:!L&&(le.item??w.jsx(Ut,{}))})})]})}})})}),Xt=({children:e,...r})=>w.jsx("button",{...r,children:e}),$n=({children:e,...r})=>w.jsx("figure",{...r,children:e}),qn=({children:e,...r})=>w.jsx("figure",{...r,children:e}),er=({children:e,...r})=>w.jsx("div",{...r,children:e}),Ut=at;function mo(e,r){return e>=r.length||e<0}function Hs(e,r,i){if(mo(r,i))return!0;const a=i[r].items??[];return e>=a.length||e<0}function Ys(e,r){return Kt(e).filter(i=>!mo(i,r))}function Xs(e,r){const i={};for(const a in r){if(!Object.hasOwn(r,a))continue;const c=Kt([...e[a]??[]]);i[Number(a)]=Kt(c).filter(u=>!Hs(u,Number(a),r))}return i}function Kt(e){return e.sort((r,i)=>r-i)}function Us({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==="development"&&(go.displayName="Accordion",Xt.displayName="AccordionHeader",$n.displayName="AccordionExpandIcon",qn.displayName="AccordionCollapseIcon",Ut.displayName="AccordionItem");const vo=T.forwardRef(({autoAdvanceInterval:e=0,index:r=0,isDragEnabled:i=!0,items:a=[],orientation:c="horizontal",tracksItemExposure:u=!1,onAutoAdvancePause:d,onAutoAdvanceResume:g,onIndexChange:m,ItemComponent:b,...k},_)=>{const P=T.useRef(void 0),A=T.useRef(null),z=T.useRef(void 0),N=T.useRef(void 0),R=T.useRef(void 0),ne=1e3,$=Ee(d),L=Ee(g),K=Ee(m),x=T.useRef(!1),O=T.useRef(!1),E=so(),[F,G]=T.useState(yo(A,c)),[Q,se]=T.useState(!1),ee=Ws({scrollSnapEnabled:E||!Q,orientation:c}),W=e>0,X=T.useCallback(()=>{R.current!==void 0&&(clearTimeout(R.current),R.current=void 0)},[]),V=T.useCallback(()=>{X(),R.current=setTimeout(()=>{clearTimeout(R.current),R.current=void 0},ne)},[ne,X]),re=T.useCallback(()=>{Ks(A,r,c),V()},[r,c]),oe=T.useCallback(()=>{G(yo(A,c))},[c]),le=T.useCallback(Z=>{E||(z.current=Se.make(Z.clientX,Z.clientY),se(!0))},[E]),H=T.useCallback(Z=>{E||(N.current=Se.make(Z.clientX,Z.clientY),re(),se(!1))},[E,re]),D=T.useCallback(Z=>{const pe=z.current,ve=N.current;if(!pe||!ve)return;const de=5,Ne=Se.subtract(pe,ve);(Math.abs(Ne.x)>de||Math.abs(Ne.y)>de)&&Z.stopPropagation(),z.current=void 0,N.current=void 0},[]),I=T.useCallback(()=>{const Z=(r+a.length+1)%a.length;K.current?.(Z)},[Q,r,a.length]),J=T.useCallback(({x:Z,y:pe})=>{const ve=A.current;!ve||x.current||(X(),x.current=!0,requestAnimationFrame(()=>{switch(c){case"horizontal":ve.scrollLeft-=Z*1.5;break;case"vertical":ve.scrollTop-=pe*1.5;default:console.error(`[etudes::Carousel] Unsupported orientation: ${c}`)}x.current=!1}))},[c]),q=T.useCallback(()=>{const Z=A.current;!Z||O.current||(O.current=!0,requestAnimationFrame(()=>{if(u&&oe(),!(R.current!==void 0)){const ve=Math.round(c==="horizontal"?Z.scrollLeft/Z.clientWidth:Z.scrollTop/Z.clientHeight),de=Math.max(0,Math.min(a.length-1,ve));de!==r&&(P.current=de,K.current?.(de))}O.current=!1}))},[a.length,r,c,u,oe]);return ro(A,{isEnabled:!E&&i&&a.length>1,onDragMove:J}),oo(Q||!W?-1:e,{onInterval:I},[r]),T.useLayoutEffect(()=>{!W||E||(Q?$.current?.():L.current?.())},[E,Q,W]),T.useLayoutEffect(()=>{const Z=A.current;if(!Z)return;const pe=P.current===void 0,ve=P.current===r;return Z.addEventListener("scroll",q),u&&oe(),ve||(P.current=r,pe||(K.current?.(r),re())),()=>{Z.removeEventListener("scroll",q)}},[r,u,re,q,oe]),w.jsx("div",{...k,ref:_,role:"region",onClick:D,onPointerCancel:H,onPointerDown:le,onPointerLeave:H,onPointerUp:H,children:w.jsx("div",{ref:A,style:ue(ee.viewport),children:w.jsx(vt,{in:a,children:({style:Z,...pe},ve)=>w.jsx("div",{style:ue(ee.itemContainer),children:w.jsx(b,{"aria-hidden":ve!==r,exposure:u?F?.[ve]:void 0,style:ue(Z,ee.item),...pe})})})})})});function Ks(e,r,i){const a=e?.current;if(!a)return;const c=i==="horizontal"?0:a.clientHeight*r,u=i==="horizontal"?a.clientWidth*r:0;a.scrollTop===c&&a.scrollLeft===u||a.scrollTo({top:c,left:u,behavior:"smooth"})}function yo(e,r){const i=e?.current;if(!i)return;const a=[];for(let c=0;c<i.children.length;c++)a.push(Gs(c,e,r));return a}function Gs(e,r,i){const a=r?.current,c=a?.children[e];if(!c)return 0;const u=we.intersecting(c,a);if(!u)return 0;switch(i){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: ${i}`),NaN}}function Ws({scrollSnapEnabled:e=!1,orientation:r="horizontal"}){return{viewport:{alignItems:"center",display:"flex",height:"100%",userSelect:e?"auto":"none",justifyContent:"flex-start",scrollSnapStop:"always",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==="development"&&(vo.displayName="Carousel");const bo=T.forwardRef(({children:e,autoFocus:r=!1,isDisabled:i=!1,isRequired:a=!0,placeholder:c,size:u,style:d,value:g,onChange:m,...b},k)=>{const _=Zs(g,u),P=T.useRef([]),A=Js(),z=ke(e,{field:Gt}),N=L=>{L<0?P.current[0]?.focus():L>=u?P.current[u-1]?.focus():P.current[L]?.focus()},R=L=>K=>{const x=_[L],O=K.target.value,E=$s(O,x).slice(-1),F=_.slice();F[L]=E,m(F),N(E?L+1:L-1)},ne=L=>K=>{switch(K.key){case"Backspace":{if(K.preventDefault(),_[L]){const x=_.slice();x[L]="",m(x),N(L-1)}else N(L-1);break}case"ArrowLeft":{K.preventDefault(),N(L-1);break}case"ArrowRight":{K.preventDefault(),N(L+1);break}}},$=L=>K=>{K.preventDefault();const x=K.clipboardData.getData("text").trim(),O=Qs(_.slice(),x.split("").slice(0,u),L);m(O);const E=Math.min(L+x.length,u-1);N(E)};return T.useEffect(()=>{if(!r)return;const L=_.findIndex(K=>K==="");L!==-1&&N(L)},[r]),w.jsx("div",{...b,ref:k,style:ue(d,A.root),children:w.jsx(pt,{count:u,children:L=>w.jsx(me,{ref:K=>P.current[L]=K,"aria-disabled":i,"aria-required":a,disabled:i,element:z.field??w.jsx(Gt,{}),placeholder:c,required:a,style:ue(A.field),value:_[L],onChange:R(L),onKeyDown:ne(L),onPaste:$(L)})})})}),Gt=({...e})=>w.jsx("input",{...e,type:"text"});function Js(){return{root:{alignItems:"stretch",display:"flex",justifyContent:"stretch"},field:{caretColor:"transparent",flex:"1",minWidth:"0"}}}function Zs(e,r){const i=e.slice(0,r);for(;i.length<r;)i.push("");return i}function Qs(e,r,i=0){let a=i,c=0;for(;c<r.length&&a<e.length;)e[a]=r[c],a++,c++;for(;c<r.length;)e.shift(),e.push(r[c]),c++;return e}function $s(e,r,i=""){const a=e.indexOf(r);return a===-1?e:e.slice(0,a)+i+e.slice(a+r.length)}const qs=Object.assign(bo,{Field:Gt});process.env.NODE_ENV==="development"&&(bo.displayName="CodeInput",Gt.displayName="CodeInput.Field");const tr=T.forwardRef(({className:e,emptyValue:r="",isDisabled:i=!1,isRequired:a=!1,placeholder:c,type:u="text",value:d,formatter:g,onFocus:m,onUnfocus:b,onChange:k,..._},P)=>{const A=T.useCallback(z=>{const N=(g?.(z)??z)||r;k?.(N)},[k,g]);return w.jsx("input",{..._,ref:P,"aria-disabled":i,"aria-placeholder":c,"aria-required":a,className:ce(e,{disabled:i}),disabled:i,placeholder:c,required:a,type:u,value:d||r,onBlur:({target:z})=>b?.(z.value),onChange:({target:z})=>A(z.value),onFocus:({target:z})=>m?.(z.value)})});process.env.NODE_ENV==="development"&&(tr.displayName="TextField");const wo=T.forwardRef(({children:e,style:r,allowsInput:i=!0,max:a=NaN,min:c=NaN,quantity:u=0,onChange:d,...g},m)=>{const b=()=>{d?.(N(u-1))},k=()=>{d?.(N(u+1))},_=O=>{ne(O)},P=O=>{const E=z(O);E!==u?d?.(E):ne(A(E))},A=O=>O.toLocaleString(),z=O=>{const E=parseInt(O,10);return E.toString()!==O.replace(/^0+/,"")?u:N(E)},N=O=>{let E=O;return isNaN(c)||(E=Math.max(c,E)),isNaN(a)||(E=Math.min(a,E)),E},[R,ne]=T.useState(A(u)),$=lo(u),L=!isNaN(a)&&u+1>a,K=!isNaN(c)&&u-1<c;T.useEffect(()=>{if($===void 0||$===u)return;const O=N(u);ne(A(O))},[u,c,a]);const x=ke(e,{textField:Wt,addButton:Jt,subscribeButton:Zt});return w.jsxs("div",{...g,ref:m,style:ue(r,Qt.root),children:[w.jsx(me,{className:ce({disabled:K}),element:x.subscribeButton??w.jsx(Zt,{}),style:ue(Qt.subtract),onClick:()=>b()}),w.jsx(me,{element:x.textField??w.jsx(Wt,{}),isDisabled:!i,style:ue(Qt.textField),value:R,onChange:_,onUnfocus:P}),w.jsx(me,{className:ce({disabled:L}),element:x.addButton??w.jsx(Jt,{}),style:ue(Qt.add),onClick:()=>k()})]})}),Wt=({...e})=>w.jsx(tr,{...e}),Jt=({children:e,...r})=>w.jsx("button",{...r,children:e}),Zt=({children:e,...r})=>w.jsx("button",{...r,children:e}),Qt={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==="development"&&(wo.displayName="Counter",Jt.displayName="CounterAddButton",Zt.displayName="CounterSubtractButton",Wt.displayName="CounterTextField");const xo=T.forwardRef(({children:e,style:r,angle:i=0,knobLength:a=30,knobThickness:c=10,radius:u=50,trackGap:d=0,trackThickness:g=2,...m},b)=>{const k=u*2,_=Math.max(0,Math.min(360,a)),P=ke(e,{track:$t,knob:qt}),A=ta({angle:i,diameter:k});return w.jsxs("div",{...m,ref:b,style:ue(r,A.root),children:[w.jsx("div",{style:A.trackContainer,children:w.jsx("svg",{height:k,style:A.svgContainer,viewBox:`0 0 ${k} ${k}`,width:k,children:w.jsx(me,{cx:u,cy:u,element:P.track??w.jsx($t,{}),fill:"none",r:u-g/2,strokeDasharray:d,strokeWidth:g})})}),w.jsx("div",{style:ue(A.knobContainer),children:w.jsx("svg",{style:A.svgContainer,viewBox:`0 0 ${k} ${k}`,xmlns:"http://www.w3.org/2000/svg",children:w.jsx(me,{d:ea(u,u,u-c/2-(g-c)/2,-_/2,_/2),element:P.knob??w.jsx(qt,{}),fill:"none",strokeWidth:c})})})]})}),$t=({...e})=>w.jsx("circle",{...e}),qt=({...e})=>w.jsx("path",{...e});function Eo(e,r,i,a){const c=(a-90)*Math.PI/180;return{x:e+i*Math.cos(c),y:r+i*Math.sin(c)}}function ea(e,r,i,a,c){const u=Eo(e,r,i,c),d=Eo(e,r,i,a),g=c-a<=180?"0":"1";return["M",u.x,u.y,"A",i,i,0,g,0,d.x,d.y].join(" ")}function ta({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==="development"&&(xo.displayName="Dial",$t.displayName="DialTrack",qt.displayName="DialKnob");const No=T.forwardRef(({children:e,className:r,style:i,collapsesOnSelect:a=!0,collectionPadding:c=0,isCollapsed:u,isInverted:d=!1,label:g,layout:m="list",isSelectionTogglable:b=!1,itemLength:k,itemPadding:_=0,items:P=[],maxVisibleItems:A=-1,numSegments:z=1,orientation:N="vertical",selection:R=[],selectionMode:ne="single",onActivateAt:$,onCollapse:L,onDeselectAt:K,onExpand:x,onSelectAt:O,onSelectionChange:E,onToggleCustomEvent:F,ItemComponent:G,ToggleComponent:Q,...se},ee)=>{const W=T.useRef(null),X=Be(W),V=P.length,re=ia(P,A,z,m),oe=k??(N==="vertical"?X.height:X.width),le=oe*re+_*(re-1),H=ra(R,P),[D,I]=T.useState(u??!0),J=sa({isCollapsed:D,collectionPadding:c,isInverted:d,maxVisibleItems:A,menuLength:le,numItems:V,orientation:N}),q=ke(e,{collapseIcon:nr,collection:en,expandIcon:rr,item:tn,toggle:nn}),Z=()=>{D&&(I(!1),x?.())},pe=()=>{D||(I(!0),L?.())},ve=()=>{D?Z():pe()},de=Ne=>{O?.(Ne),ne==="single"&&a&&pe()};return T.useEffect(()=>{u!==void 0&&I(u)},[u]),T.useEffect(()=>{const Ne=te=>{if(D||!(te.target instanceof Node))return;let De=!0,Pe=te.target;for(;Pe;){if(Pe===W.current){De=!1;break}if(!Pe.parentNode)break;Pe=Pe.parentNode}De&&pe()};return window.addEventListener("click",Ne),()=>{window.removeEventListener("click",Ne)}},[D]),w.jsx("div",{...se,ref:ee,className:ce(r,{collapsed:D,expanded:!D}),style:ue(i,J.root),children:w.jsxs("div",{ref:W,style:ue(J.body),children:[Q?w.jsx(Q,{"aria-expanded":!D,"aria-haspopup":"listbox",className:ce({collapsed:D,expanded:!D}),style:ue(J.toggle),onClick:ve,onCustomEvent:(Ne,te)=>F?.(Ne,te)}):w.jsxs(me,{"aria-expanded":!D,"aria-haspopup":"listbox",className:ce({collapsed:D,expanded:!D}),element:q.toggle??w.jsx(nn,{}),style:ue(J.toggle),onClick:ve,children:[w.jsx("span",{dangerouslySetInnerHTML:{__html:g?.(H)??(H.length>0?H.map(Ne=>P[Ne]).join(", "):"")}}),q.expandIcon&&w.jsx(me,{className:ce({collapsed:D,expanded:!D}),element:D?q.collapseIcon??q.expandIcon:q.expandIcon,style:ue(D?J.collapseIcon:J.expandIcon)})]}),w.jsx(me,{element:q.collection??w.jsx(en,{}),isSelectionTogglable:b,ItemComponent:G,itemLength:oe,itemPadding:_,items:P,layout:m,numSegments:z,orientation:N,selection:H,selectionMode:ne,style:ue(J.collection),onActivateAt:$,onDeselectAt:K,onSelectAt:de,onSelectionChange:E,children:!G&&(q.item??w.jsx(tn,{}))})]})})}),en=Yt,tn=at,nn=({children:e,...r})=>w.jsx("button",{...r,children:e}),nr=({children:e,...r})=>w.jsx("figure",{...r,"aria-hidden":!0,children:e}),rr=({children:e,...r})=>w.jsx("figure",{...r,"aria-hidden":!0,children:e});function na(e,r){return!!(isNaN(e)||e>=r.length||e<0)}function ra(e,r){return oa(e).filter(i=>!na(i,r))}function oa(e){return e.sort((r,i)=>r-i)}function ia(e,r,i,a){const c=e.length;switch(a){case"grid":{const u=i<1?c:Math.ceil(c/i);return r<0?u:Math.min(u,r)}default:return r<0?c:Math.min(c,r)}}function sa({isCollapsed:e=!0,isInverted:r=!1,collectionPadding:i=0,maxVisibleItems:a=0,menuLength:c=NaN,numItems:u=0,orientation:d="vertical"}){return{root:{alignItems:"center",display:"flex",justifyContent:"flex-start",overflow:"visible",...d==="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",...d==="vertical"?{width:"100%",height:e?"0px":`${c}px`,overflowY:a!==-1&&a<u?"scroll":"hidden",...r?{marginBottom:`${i}px`,bottom:"100%"}:{top:"100%",marginTop:`${i}px`}}:{width:e?"0px":`${c}px`,height:"100%",overflowX:a!==-1&&a<u?"scroll":"hidden",...r?{marginRight:`${i}px`,right:"100%"}:{left:"100%",marginLeft:`${i}px`}}},expandIcon:{pointerEvents:"none",zIndex:1},collapseIcon:{pointerEvents:"none",zIndex:1}}}process.env.NODE_ENV==="development"&&(No.displayName="Dropdown",en.displayName="DropdownCollection",nr.displayName="DropdownCollapseIcon",rr.displayName="DropdownExpandIcon",tn.displayName="DropdownItem",nn.displayName="DropdownToggle");const So=":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",aa=So+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",ca="["+So+"]["+aa+"]*",la=new RegExp("^"+ca+"$");function To(e,r){const i=[];let a=r.exec(e);for(;a;){const c=[];c.startIndex=r.lastIndex-a[0].length;const u=a.length;for(let d=0;d<u;d++)c.push(a[d]);i.push(c),a=r.exec(e)}return i}const rn=function(e){const r=la.exec(e);return!(r===null||typeof r>"u")};function ua(e){return typeof e<"u"}const fa={allowBooleanAttributes:!1,unpairedTags:[]};function da(e,r){r=Object.assign({},fa,r);const i=[];let a=!1,c=!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=Co(e,u),u.err)return u}else if(e[u]==="<"){let d=u;if(u++,e[u]==="!"){u=ko(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]!==`
7
7
  `&&e[u]!=="\r";u++)m+=e[u];if(m=m.trim(),m[m.length-1]==="/"&&(m=m.substring(0,m.length-1),u--),!wa(m)){let _;return m.trim().length===0?_="Invalid space after '<'.":_="Tag '"+m+"' is an invalid name.",_e("InvalidTag",_,Ie(e,u))}const b=ga(e,u);if(b===!1)return _e("InvalidAttr","Attributes for '"+m+"' have open quote.",Ie(e,u));let k=b.value;if(u=b.index,k[k.length-1]==="/"){const _=u-k.length;k=k.substring(0,k.length-1);const P=Oo(k,r);if(P===!0)a=!0;else return _e(P.err.code,P.err.msg,Ie(e,_+P.err.line))}else if(g)if(b.tagClosed){if(k.trim().length>0)return _e("InvalidTag","Closing tag '"+m+"' can't have attributes or invalid starting.",Ie(e,d));if(i.length===0)return _e("InvalidTag","Closing tag '"+m+"' has not been opened.",Ie(e,d));{const _=i.pop();if(m!==_.tagName){let P=Ie(e,_.tagStartPos);return _e("InvalidTag","Expected closing tag '"+_.tagName+"' (opened in line "+P.line+", col "+P.col+") instead of closing tag '"+m+"'.",Ie(e,d))}i.length==0&&(c=!0)}}else return _e("InvalidTag","Closing tag '"+m+"' doesn't have proper closing.",Ie(e,u));else{const _=Oo(k,r);if(_!==!0)return _e(_.err.code,_.err.msg,Ie(e,u-k.length+_.err.line));if(c===!0)return _e("InvalidXml","Multiple possible root nodes found.",Ie(e,u));r.unpairedTags.indexOf(m)!==-1||i.push({tagName:m,tagStartPos:d}),a=!0}for(u++;u<e.length;u++)if(e[u]==="<")if(e[u+1]==="!"){u++,u=ko(e,u);continue}else if(e[u+1]==="?"){if(u=Co(e,++u),u.err)return u}else break;else if(e[u]==="&"){const _=ya(e,u);if(_==-1)return _e("InvalidChar","char '&' is not expected.",Ie(e,u));u=_}else if(c===!0&&!_o(e[u]))return _e("InvalidXml","Extra text at the end",Ie(e,u));e[u]==="<"&&u--}}else{if(_o(e[u]))continue;return _e("InvalidChar","char '"+e[u]+"' is not expected.",Ie(e,u))}if(a){if(i.length==1)return _e("InvalidTag","Unclosed tag '"+i[0].tagName+"'.",Ie(e,i[0].tagStartPos));if(i.length>0)return _e("InvalidXml","Invalid '"+JSON.stringify(i.map(u=>u.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return _e("InvalidXml","Start tag expected.",1);return!0}function _o(e){return e===" "||e===" "||e===`
8
8
  `||e==="\r"}function Co(e,r){const i=r;for(;r<e.length;r++)if(e[r]=="?"||e[r]==" "){const a=e.substr(i,r-i);if(r>5&&a==="xml")return _e("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 ko(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 i=1;for(r+=8;r<e.length;r++)if(e[r]==="<")i++;else if(e[r]===">"&&(i--,i===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 pa='"',ha="'";function ga(e,r){let i="",a="",c=!1;for(;r<e.length;r++){if(e[r]===pa||e[r]===ha)a===""?a=e[r]:a!==e[r]||(a="");else if(e[r]===">"&&a===""){c=!0;break}i+=e[r]}return a!==""?!1:{value:i,index:r,tagClosed:c}}const ma=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function Oo(e,r){const i=To(e,ma),a={};for(let c=0;c<i.length;c++){if(i[c][1].length===0)return _e("InvalidAttr","Attribute '"+i[c][2]+"' has no space in starting.",yt(i[c]));if(i[c][3]!==void 0&&i[c][4]===void 0)return _e("InvalidAttr","Attribute '"+i[c][2]+"' is without value.",yt(i[c]));if(i[c][3]===void 0&&!r.allowBooleanAttributes)return _e("InvalidAttr","boolean attribute '"+i[c][2]+"' is not allowed.",yt(i[c]));const u=i[c][2];if(!ba(u))return _e("InvalidAttr","Attribute '"+u+"' is an invalid name.",yt(i[c]));if(!a.hasOwnProperty(u))a[u]=1;else return _e("InvalidAttr","Attribute '"+u+"' is repeated.",yt(i[c]))}return!0}function va(e,r){let i=/\d/;for(e[r]==="x"&&(r++,i=/[\da-fA-F]/);r<e.length;r++){if(e[r]===";")return r;if(!e[r].match(i))break}return-1}function ya(e,r){if(r++,e[r]===";")return-1;if(e[r]==="#")return r++,va(e,r);let i=0;for(;r<e.length;r++,i++)if(!(e[r].match(/\w/)&&i<20)){if(e[r]===";")break;return-1}return r}function _e(e,r,i){return{err:{code:e,msg:r,line:i.line||i,col:i.col}}}function ba(e){return rn(e)}function wa(e){return rn(e)}function Ie(e,r){const i=e.substring(0,r).split(/\r?\n/);return{line:i.length,col:i[i.length-1].length+1}}function yt(e){return e.startIndex+e[1].length}const xa={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,i){return e},captureMetaData:!1},Ea=function(e){return Object.assign({},xa,e)};let on;typeof Symbol!="function"?on="@@xmlMetadata":on=Symbol("XML Node Metadata");class et{constructor(r){this.tagname=r,this.child=[],this[":@"]={}}add(r,i){r==="__proto__"&&(r="#__proto__"),this.child.push({[r]:i})}addChild(r,i){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}),i!==void 0&&(this.child[this.child.length-1][on]={startIndex:i})}static getMetaDataSymbol(){return on}}class Na{constructor(r){this.suppressValidationErr=!r}readDocType(r,i){const a={};if(r[i+3]==="O"&&r[i+4]==="C"&&r[i+5]==="T"&&r[i+6]==="Y"&&r[i+7]==="P"&&r[i+8]==="E"){i=i+9;let c=1,u=!1,d=!1;for(;i<r.length;i++)if(r[i]==="<"&&!d){if(u&&tt(r,"!ENTITY",i)){i+=7;let g,m;[g,m,i]=this.readEntityExp(r,i+1,this.suppressValidationErr),m.indexOf("&")===-1&&(a[g]={regx:RegExp(`&${g};`,"g"),val:m})}else if(u&&tt(r,"!ELEMENT",i)){i+=8;const{index:g}=this.readElementExp(r,i+1);i=g}else if(u&&tt(r,"!ATTLIST",i))i+=8;else if(u&&tt(r,"!NOTATION",i)){i+=9;const{index:g}=this.readNotationExp(r,i+1,this.suppressValidationErr);i=g}else if(tt(r,"!--",i))d=!0;else throw new Error("Invalid DOCTYPE");c++}else if(r[i]===">"){if(d?r[i-1]==="-"&&r[i-2]==="-"&&(d=!1,c--):c--,c===0)break}else r[i]==="["&&(u=!0);if(c!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:a,i}}readEntityExp(r,i){i=Ae(r,i);let a="";for(;i<r.length&&!/\s/.test(r[i])&&r[i]!=='"'&&r[i]!=="'";)a+=r[i],i++;if(bt(a),i=Ae(r,i),!this.suppressValidationErr){if(r.substring(i,i+6).toUpperCase()==="SYSTEM")throw new Error("External entities are not supported");if(r[i]==="%")throw new Error("Parameter entities are not supported")}let c="";return[i,c]=this.readIdentifierVal(r,i,"entity"),i--,[a,c,i]}readNotationExp(r,i){i=Ae(r,i);let a="";for(;i<r.length&&!/\s/.test(r[i]);)a+=r[i],i++;!this.suppressValidationErr&&bt(a),i=Ae(r,i);const c=r.substring(i,i+6).toUpperCase();if(!this.suppressValidationErr&&c!=="SYSTEM"&&c!=="PUBLIC")throw new Error(`Expected SYSTEM or PUBLIC, found "${c}"`);i+=c.length,i=Ae(r,i);let u=null,d=null;if(c==="PUBLIC")[i,u]=this.readIdentifierVal(r,i,"publicIdentifier"),i=Ae(r,i),(r[i]==='"'||r[i]==="'")&&([i,d]=this.readIdentifierVal(r,i,"systemIdentifier"));else if(c==="SYSTEM"&&([i,d]=this.readIdentifierVal(r,i,"systemIdentifier"),!this.suppressValidationErr&&!d))throw new Error("Missing mandatory system identifier for SYSTEM notation");return{notationName:a,publicIdentifier:u,systemIdentifier:d,index:--i}}readIdentifierVal(r,i,a){let c="";const u=r[i];if(u!=='"'&&u!=="'")throw new Error(`Expected quoted string, found "${u}"`);for(i++;i<r.length&&r[i]!==u;)c+=r[i],i++;if(r[i]!==u)throw new Error(`Unterminated ${a} value`);return i++,[i,c]}readElementExp(r,i){i=Ae(r,i);let a="";for(;i<r.length&&!/\s/.test(r[i]);)a+=r[i],i++;if(!this.suppressValidationErr&&!rn(a))throw new Error(`Invalid element name: "${a}"`);i=Ae(r,i);let c="";if(r[i]==="E"&&tt(r,"MPTY",i))i+=4;else if(r[i]==="A"&&tt(r,"NY",i))i+=2;else if(r[i]==="("){for(i++;i<r.length&&r[i]!==")";)c+=r[i],i++;if(r[i]!==")")throw new Error("Unterminated content model")}else if(!this.suppressValidationErr)throw new Error(`Invalid Element Expression, found "${r[i]}"`);return{elementName:a,contentModel:c.trim(),index:i}}readAttlistExp(r,i){i=Ae(r,i);let a="";for(;i<r.length&&!/\s/.test(r[i]);)a+=r[i],i++;bt(a),i=Ae(r,i);let c="";for(;i<r.length&&!/\s/.test(r[i]);)c+=r[i],i++;if(!bt(c))throw new Error(`Invalid attribute name: "${c}"`);i=Ae(r,i);let u="";if(r.substring(i,i+8).toUpperCase()==="NOTATION"){if(u="NOTATION",i+=8,i=Ae(r,i),r[i]!=="(")throw new Error(`Expected '(', found "${r[i]}"`);i++;let g=[];for(;i<r.length&&r[i]!==")";){let m="";for(;i<r.length&&r[i]!=="|"&&r[i]!==")";)m+=r[i],i++;if(m=m.trim(),!bt(m))throw new Error(`Invalid notation name: "${m}"`);g.push(m),r[i]==="|"&&(i++,i=Ae(r,i))}if(r[i]!==")")throw new Error("Unterminated list of notations");i++,u+=" ("+g.join("|")+")"}else{for(;i<r.length&&!/\s/.test(r[i]);)u+=r[i],i++;const g=["CDATA","ID","IDREF","IDREFS","ENTITY","ENTITIES","NMTOKEN","NMTOKENS"];if(!this.suppressValidationErr&&!g.includes(u.toUpperCase()))throw new Error(`Invalid attribute type: "${u}"`)}i=Ae(r,i);let d="";return r.substring(i,i+8).toUpperCase()==="#REQUIRED"?(d="#REQUIRED",i+=8):r.substring(i,i+7).toUpperCase()==="#IMPLIED"?(d="#IMPLIED",i+=7):[i,d]=this.readIdentifierVal(r,i,"ATTLIST"),{elementName:a,attributeName:c,attributeType:u,defaultValue:d,index:i}}}const Ae=(e,r)=>{for(;r<e.length&&/\s/.test(e[r]);)r++;return r};function tt(e,r,i){for(let a=0;a<r.length;a++)if(r[a]!==e[i+a+1])return!1;return!0}function bt(e){if(rn(e))return e;throw new Error(`Invalid entity name ${e}`)}const Sa=/^[-+]?0x[a-fA-F0-9]+$/,Ta=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,_a={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};function Ca(e,r={}){if(r=Object.assign({},_a,r),!e||typeof e!="string")return e;let i=e.trim();if(r.skipLike!==void 0&&r.skipLike.test(i))return e;if(e==="0")return 0;if(r.hex&&Sa.test(i))return Ia(i,16);if(i.search(/.+[eE].+/)!==-1)return Oa(e,i,r);{const a=Ta.exec(i);if(a){const c=a[1]||"",u=a[2];let d=Pa(a[3]);const g=c?e[u.length+1]===".":e[u.length]===".";if(!r.leadingZeros&&(u.length>1||u.length===1&&!g))return e;{const m=Number(i),b=String(m);if(m===0)return m;if(b.search(/[eE]/)!==-1)return r.eNotation?m:e;if(i.indexOf(".")!==-1)return b==="0"||b===d||b===`${c}${d}`?m:e;let k=u?d:i;return u?k===b||c+k===b?m:e:k===b||k===c+b?m:e}}else return e}}const ka=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function Oa(e,r,i){if(!i.eNotation)return e;const a=r.match(ka);if(a){let c=a[1]||"";const u=a[3].indexOf("e")===-1?"E":"e",d=a[2],g=c?e[d.length+1]===u:e[d.length]===u;return d.length>1&&g?e:d.length===1&&(a[3].startsWith(`.${u}`)||a[3][0]===u)?Number(r):i.leadingZeros&&!g?(r=(a[1]||"")+a[3],Number(r)):e}else return e}function Pa(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 Ia(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 Po(e){return typeof e=="function"?e:Array.isArray(e)?r=>{for(const i of e)if(typeof i=="string"&&r===i||i instanceof RegExp&&i.test(r))return!0}:()=>!1}class Ra{constructor(r){if(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:(i,a)=>String.fromCodePoint(Number.parseInt(a,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(i,a)=>String.fromCodePoint(Number.parseInt(a,16))}},this.addExternalEntities=ja,this.parseXml=Fa,this.parseTextData=Aa,this.resolveNameSpace=Ma,this.buildAttributesMap=La,this.isItStopNode=Ha,this.replaceEntitiesValue=Va,this.readStopNodeData=Xa,this.saveTextToParentTag=Ba,this.addChild=Da,this.ignoreAttributesFn=Po(this.options.ignoreAttributes),this.options.stopNodes&&this.options.stopNodes.length>0){this.stopNodesExact=new Set,this.stopNodesWildcard=new Set;for(let i=0;i<this.options.stopNodes.length;i++){const a=this.options.stopNodes[i];typeof a=="string"&&(a.startsWith("*.")?this.stopNodesWildcard.add(a.substring(2)):this.stopNodesExact.add(a))}}}}function ja(e){const r=Object.keys(e);for(let i=0;i<r.length;i++){const a=r[i];this.lastEntities[a]={regex:new RegExp("&"+a+";","g"),val:e[a]}}}function Aa(e,r,i,a,c,u,d){if(e!==void 0&&(this.options.trimValues&&!a&&(e=e.trim()),e.length>0)){d||(e=this.replaceEntitiesValue(e));const g=this.options.tagValueProcessor(r,e,i,c,u);return g==null?e:typeof g!=typeof e||g!==e?g:this.options.trimValues?ir(e,this.options.parseTagValue,this.options.numberParseOptions):e.trim()===e?ir(e,this.options.parseTagValue,this.options.numberParseOptions):e}}function Ma(e){if(this.options.removeNSPrefix){const r=e.split(":"),i=e.charAt(0)==="/"?"/":"";if(r[0]==="xmlns")return"";r.length===2&&(e=i+r[1])}return e}const za=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function La(e,r,i){if(this.options.ignoreAttributes!==!0&&typeof e=="string"){const a=To(e,za),c=a.length,u={};for(let d=0;d<c;d++){const g=this.resolveNameSpace(a[d][1]);if(this.ignoreAttributesFn(g,r))continue;let m=a[d][4],b=this.options.attributeNamePrefix+g;if(g.length)if(this.options.transformAttributeName&&(b=this.options.transformAttributeName(b)),b==="__proto__"&&(b="#__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[b]=m:typeof k!=typeof m||k!==m?u[b]=k:u[b]=ir(m,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(u[b]=!0)}if(!Object.keys(u).length)return;if(this.options.attributesGroupName){const d={};return d[this.options.attributesGroupName]=u,d}return u}}const Fa=function(e){e=e.replace(/\r\n?/g,`
9
9
  `);const r=new et("!xml");let i=r,a="",c="";const u=new Na(this.options.processEntities);for(let d=0;d<e.length;d++)if(e[d]==="<")if(e[d+1]==="/"){const m=nt(e,">",d,"Closing Tag is not closed.");let b=e.substring(d+2,m).trim();if(this.options.removeNSPrefix){const P=b.indexOf(":");P!==-1&&(b=b.substr(P+1))}this.options.transformTagName&&(b=this.options.transformTagName(b)),i&&(a=this.saveTextToParentTag(a,i,c));const k=c.substring(c.lastIndexOf(".")+1);if(b&&this.options.unpairedTags.indexOf(b)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${b}>`);let _=0;k&&this.options.unpairedTags.indexOf(k)!==-1?(_=c.lastIndexOf(".",c.lastIndexOf(".")-1),this.tagsNodeStack.pop()):_=c.lastIndexOf("."),c=c.substring(0,_),i=this.tagsNodeStack.pop(),a="",d=m}else if(e[d+1]==="?"){let m=or(e,d,!1,"?>");if(!m)throw new Error("Pi Tag is not closed.");if(a=this.saveTextToParentTag(a,i,c),!(this.options.ignoreDeclaration&&m.tagName==="?xml"||this.options.ignorePiTags)){const b=new et(m.tagName);b.add(this.options.textNodeName,""),m.tagName!==m.tagExp&&m.attrExpPresent&&(b[":@"]=this.buildAttributesMap(m.tagExp,c,m.tagName)),this.addChild(i,b,c,d)}d=m.closeIndex+1}else if(e.substr(d+1,3)==="!--"){const m=nt(e,"-->",d+4,"Comment is not closed.");if(this.options.commentPropName){const b=e.substring(d+4,m-2);a=this.saveTextToParentTag(a,i,c),i.add(this.options.commentPropName,[{[this.options.textNodeName]:b}])}d=m}else if(e.substr(d+1,2)==="!D"){const m=u.readDocType(e,d);this.docTypeEntities=m.entities,d=m.i}else if(e.substr(d+1,2)==="!["){const m=nt(e,"]]>",d,"CDATA is not closed.")-2,b=e.substring(d+9,m);a=this.saveTextToParentTag(a,i,c);let k=this.parseTextData(b,i.tagname,c,!0,!1,!0,!0);k==null&&(k=""),this.options.cdataPropName?i.add(this.options.cdataPropName,[{[this.options.textNodeName]:b}]):i.add(this.options.textNodeName,k),d=m+2}else{let m=or(e,d,this.options.removeNSPrefix),b=m.tagName;const k=m.rawTagName;let _=m.tagExp,P=m.attrExpPresent,A=m.closeIndex;this.options.transformTagName&&(b=this.options.transformTagName(b)),i&&a&&i.tagname!=="!xml"&&(a=this.saveTextToParentTag(a,i,c,!1));const z=i;z&&this.options.unpairedTags.indexOf(z.tagname)!==-1&&(i=this.tagsNodeStack.pop(),c=c.substring(0,c.lastIndexOf("."))),b!==r.tagname&&(c+=c?"."+b:b);const N=d;if(this.isItStopNode(this.stopNodesExact,this.stopNodesWildcard,c,b)){let R="";if(_.length>0&&_.lastIndexOf("/")===_.length-1)b[b.length-1]==="/"?(b=b.substr(0,b.length-1),c=c.substr(0,c.length-1),_=b):_=_.substr(0,_.length-1),d=m.closeIndex;else if(this.options.unpairedTags.indexOf(b)!==-1)d=m.closeIndex;else{const $=this.readStopNodeData(e,k,A+1);if(!$)throw new Error(`Unexpected end of ${k}`);d=$.i,R=$.tagContent}const ne=new et(b);b!==_&&P&&(ne[":@"]=this.buildAttributesMap(_,c,b)),R&&(R=this.parseTextData(R,b,c,!0,P,!0,!0)),c=c.substr(0,c.lastIndexOf(".")),ne.add(this.options.textNodeName,R),this.addChild(i,ne,c,N)}else{if(_.length>0&&_.lastIndexOf("/")===_.length-1){b[b.length-1]==="/"?(b=b.substr(0,b.length-1),c=c.substr(0,c.length-1),_=b):_=_.substr(0,_.length-1),this.options.transformTagName&&(b=this.options.transformTagName(b));const R=new et(b);b!==_&&P&&(R[":@"]=this.buildAttributesMap(_,c,b)),this.addChild(i,R,c,N),c=c.substr(0,c.lastIndexOf("."))}else{const R=new et(b);this.tagsNodeStack.push(i),b!==_&&P&&(R[":@"]=this.buildAttributesMap(_,c,b)),this.addChild(i,R,c,N),i=R}a="",d=A}}else a+=e[d];return r.child};function Da(e,r,i,a){this.options.captureMetaData||(a=void 0);const c=this.options.updateTag(r.tagname,i,r[":@"]);c===!1||(typeof c=="string"&&(r.tagname=c),e.addChild(r,a))}const Va=function(e){if(this.options.processEntities){for(let r in this.docTypeEntities){const i=this.docTypeEntities[r];e=e.replace(i.regx,i.val)}for(let r in this.lastEntities){const i=this.lastEntities[r];e=e.replace(i.regex,i.val)}if(this.options.htmlEntities)for(let r in this.htmlEntities){const i=this.htmlEntities[r];e=e.replace(i.regex,i.val)}e=e.replace(this.ampEntity.regex,this.ampEntity.val)}return e};function Ba(e,r,i,a){return e&&(a===void 0&&(a=r.child.length===0),e=this.parseTextData(e,r.tagname,i,!1,r[":@"]?Object.keys(r[":@"]).length!==0:!1,a),e!==void 0&&e!==""&&r.add(this.options.textNodeName,e),e=""),e}function Ha(e,r,i,a){return!!(r&&r.has(a)||e&&e.has(i))}function Ya(e,r,i=">"){let a,c="";for(let u=r;u<e.length;u++){let d=e[u];if(a)d===a&&(a="");else if(d==='"'||d==="'")a=d;else if(d===i[0])if(i[1]){if(e[u+1]===i[1])return{data:c,index:u}}else return{data:c,index:u};else d===" "&&(d=" ");c+=d}}function nt(e,r,i,a){const c=e.indexOf(r,i);if(c===-1)throw new Error(a);return c+r.length-1}function or(e,r,i,a=">"){const c=Ya(e,r+1,a);if(!c)return;let u=c.data;const d=c.index,g=u.search(/\s/);let m=u,b=!0;g!==-1&&(m=u.substring(0,g),u=u.substring(g+1).trimStart());const k=m;if(i){const _=m.indexOf(":");_!==-1&&(m=m.substr(_+1),b=m!==c.data.substr(_+1))}return{tagName:m,tagExp:u,closeIndex:d,attrExpPresent:b,rawTagName:k}}function Xa(e,r,i){const a=i;let c=1;for(;i<e.length;i++)if(e[i]==="<")if(e[i+1]==="/"){const u=nt(e,">",i,`${r} is not closed`);if(e.substring(i+2,u).trim()===r&&(c--,c===0))return{tagContent:e.substring(a,i),i:u};i=u}else if(e[i+1]==="?")i=nt(e,"?>",i+1,"StopNode is not closed.");else if(e.substr(i+1,3)==="!--")i=nt(e,"-->",i+3,"StopNode is not closed.");else if(e.substr(i+1,2)==="![")i=nt(e,"]]>",i,"StopNode is not closed.")-2;else{const u=or(e,i,">");u&&((u&&u.tagName)===r&&u.tagExp[u.tagExp.length-1]!=="/"&&c++,i=u.closeIndex)}}function ir(e,r,i){if(r&&typeof e=="string"){const a=e.trim();return a==="true"?!0:a==="false"?!1:Ca(e,i)}else return ua(e)?e:""}const sr=et.getMetaDataSymbol();function Ua(e,r){return Io(e,r)}function Io(e,r,i){let a;const c={};for(let u=0;u<e.length;u++){const d=e[u],g=Ka(d);let m="";if(i===void 0?m=g:m=i+"."+g,g===r.textNodeName)a===void 0?a=d[g]:a+=""+d[g];else{if(g===void 0)continue;if(d[g]){let b=Io(d[g],r,m);const k=Wa(b,r);d[sr]!==void 0&&(b[sr]=d[sr]),d[":@"]?Ga(b,d[":@"],m,r):Object.keys(b).length===1&&b[r.textNodeName]!==void 0&&!r.alwaysCreateTextNode?b=b[r.textNodeName]:Object.keys(b).length===0&&(r.alwaysCreateTextNode?b[r.textNodeName]="":b=""),c[g]!==void 0&&c.hasOwnProperty(g)?(Array.isArray(c[g])||(c[g]=[c[g]]),c[g].push(b)):r.isArray(g,m,k)?c[g]=[b]:c[g]=b}}}return typeof a=="string"?a.length>0&&(c[r.textNodeName]=a):a!==void 0&&(c[r.textNodeName]=a),c}function Ka(e){const r=Object.keys(e);for(let i=0;i<r.length;i++){const a=r[i];if(a!==":@")return a}}function Ga(e,r,i,a){if(r){const c=Object.keys(r),u=c.length;for(let d=0;d<u;d++){const g=c[d];a.isArray(g,i+"."+g,!0,!0)?e[g]=[r[g]]:e[g]=r[g]}}}function Wa(e,r){const{textNodeName:i}=r,a=Object.keys(e).length;return!!(a===0||a===1&&(e[i]||typeof e[i]=="boolean"||e[i]===0))}class Ja{constructor(r){this.externalEntities={},this.options=Ea(r)}parse(r,i){if(typeof r!="string"&&r.toString)r=r.toString();else if(typeof r!="string")throw new Error("XML data is accepted in String or Bytes[] form.");if(i){i===!0&&(i={});const u=da(r,i);if(u!==!0)throw Error(`${u.err.msg}:${u.err.line}:${u.err.col}`)}const a=new Ra(this.options);a.addExternalEntities(this.externalEntities);const c=a.parseXml(r);return this.options.preserveOrder||c===void 0?c:Ua(c,this.options)}addEntity(r,i){if(i.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 '&#xD;'");if(i==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[r]=i}static getMetaDataSymbol(){return et.getMetaDataSymbol()}}const Za=`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "etudes",
3
- "version": "21.2.1",
3
+ "version": "21.2.2",
4
4
  "description": "A study of headless React components",
5
5
  "type": "module",
6
6
  "main": "./build/etudes.umd.cjs",