@dss-kit/ui-kit 0.1.4 → 0.1.5

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.
@@ -10,7 +10,7 @@
10
10
  ${p}px !important;
11
11
  top: ${h}px !important;
12
12
  }
13
- `),()=>{v.contains(m)&&v.removeChild(m)}},[e]),b.jsx(_u,{isPresent:e,childRef:r,sizeRef:o,children:V.cloneElement(t,{ref:l})})}const Tu=({children:t,initial:e,isPresent:n,onExitComplete:s,custom:i,presenceAffectsLayout:r,mode:o,anchorX:a,root:l})=>{const u=Zn(Pu),c=w.useId();let h=!0,d=w.useMemo(()=>(h=!1,{id:c,initial:e,isPresent:n,custom:i,onExitComplete:f=>{u.set(f,!0);for(const p of u.values())if(!p)return;s&&s()},register:f=>(u.set(f,!1),()=>u.delete(f))}),[n,u,s]);return r&&h&&(d={...d}),w.useMemo(()=>{u.forEach((f,p)=>u.set(p,!1))},[n]),V.useEffect(()=>{!n&&!u.size&&s&&s()},[n]),o==="popLayout"&&(t=b.jsx(Su,{isPresent:n,anchorX:a,root:l,children:t})),b.jsx(Ye.Provider,{value:d,children:t})};function Pu(){return new Map}function vo(t=!0){const e=w.useContext(Ye);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:i}=e,r=w.useId();w.useEffect(()=>{if(t)return i(r)},[t]);const o=w.useCallback(()=>t&&s&&s(r),[r,s,t]);return!n&&s?[!1,o]:[!0]}const Me=t=>t.key||"";function hi(t){const e=[];return w.Children.forEach(t,n=>{w.isValidElement(n)&&e.push(n)}),e}const Mu=({children:t,custom:e,initial:n=!0,onExitComplete:s,presenceAffectsLayout:i=!0,mode:r="sync",propagate:o=!1,anchorX:a="left",root:l})=>{const[u,c]=vo(o),h=w.useMemo(()=>hi(t),[t]),d=o&&!u?[]:h.map(Me),f=w.useRef(!0),p=w.useRef(h),m=Zn(()=>new Map),[v,y]=w.useState(h),[x,g]=w.useState(h);Pr(()=>{f.current=!1,p.current=h;for(let P=0;P<x.length;P++){const _=Me(x[P]);d.includes(_)?m.delete(_):m.get(_)!==!0&&m.set(_,!1)}},[x,d.length,d.join("-")]);const C=[];if(h!==v){let P=[...h];for(let _=0;_<x.length;_++){const T=x[_],E=Me(T);d.includes(E)||(P.splice(_,0,T),C.push(T))}return r==="wait"&&C.length&&(P=C),g(hi(P)),y(h),null}process.env.NODE_ENV!=="production"&&r==="wait"&&x.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:S}=w.useContext(Xn);return b.jsx(b.Fragment,{children:x.map(P=>{const _=Me(P),T=o&&!u?!1:h===x||d.includes(_),E=()=>{if(m.has(_))m.set(_,!0);else return;let L=!0;m.forEach(Q=>{Q||(L=!1)}),L&&(S?.(),g(p.current),o&&c?.(),s&&s())};return b.jsx(Tu,{isPresent:T,initial:!f.current||n?void 0:!1,custom:e,presenceAffectsLayout:i,mode:r,root:l,onExitComplete:T?void 0:E,anchorX:a,children:P},_)})})},xo=w.createContext({strict:!1}),di={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},qt={};for(const t in di)qt[t]={isEnabled:e=>di[t].some(n=>!!e[n])};function Eu(t){for(const e in t)qt[e]={...qt[e],...t[e]}}const Au=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function $e(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Au.has(t)}let bo=t=>!$e(t);function Vu(t){typeof t=="function"&&(bo=e=>e.startsWith("on")?!$e(e):t(e))}try{Vu(require("@emotion/is-prop-valid").default)}catch{}function ku(t,e,n){const s={};for(const i in t)i==="values"&&typeof t.values=="object"||(bo(i)||n===!0&&$e(i)||!e&&!$e(i)||t.draggable&&i.startsWith("onDrag"))&&(s[i]=t[i]);return s}const Xe=w.createContext({});function Ze(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function pe(t){return typeof t=="string"||Array.isArray(t)}const ws=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Cs=["initial",...ws];function Je(t){return Ze(t.animate)||Cs.some(e=>pe(t[e]))}function wo(t){return!!(Je(t)||t.variants)}function Ru(t,e){if(Je(t)){const{initial:n,animate:s}=t;return{initial:n===!1||pe(n)?n:void 0,animate:pe(s)?s:void 0}}return t.inherit!==!1?e:{}}function Du(t){const{initial:e,animate:n}=Ru(t,w.useContext(Xe));return w.useMemo(()=>({initial:e,animate:n}),[fi(e),fi(n)])}function fi(t){return Array.isArray(t)?t.join(" "):t}const ge={};function ju(t){for(const e in t)ge[e]=t[e],os(e)&&(ge[e].isCSSVariable=!0)}function Co(t,{layout:e,layoutId:n}){return Qt.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!ge[t]||t==="opacity")}const Lu={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Ou=Jt.length;function Iu(t,e,n){let s="",i=!0;for(let r=0;r<Ou;r++){const o=Jt[r],a=t[o];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(o.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const u=ho(a,ys[o]);if(!l){i=!1;const c=Lu[o]||o;s+=`${c}(${u}) `}n&&(e[o]=u)}}return s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}function _s(t,e,n){const{style:s,vars:i,transformOrigin:r}=t;let o=!1,a=!1;for(const l in e){const u=e[l];if(Qt.has(l)){o=!0;continue}else if(os(l)){i[l]=u;continue}else{const c=ho(u,ys[l]);l.startsWith("origin")?(a=!0,r[l]=c):s[l]=c}}if(e.transform||(o||n?s.transform=Iu(e,t.transform,n):s.transform&&(s.transform="none")),a){const{originX:l="50%",originY:u="50%",originZ:c=0}=r;s.transformOrigin=`${l} ${u} ${c}`}}const Ss=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function _o(t,e,n){for(const s in e)!Z(e[s])&&!Co(s,n)&&(t[s]=e[s])}function Bu({transformTemplate:t},e){return w.useMemo(()=>{const n=Ss();return _s(n,e,t),Object.assign({},n.vars,n.style)},[e])}function Nu(t,e){const n=t.style||{},s={};return _o(s,n,t),Object.assign(s,Bu(t,e)),s}function Fu(t,e){const n={},s=Nu(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=s,n}const zu={offset:"stroke-dashoffset",array:"stroke-dasharray"},$u={offset:"strokeDashoffset",array:"strokeDasharray"};function Wu(t,e,n=1,s=0,i=!0){t.pathLength=1;const r=i?zu:$u;t[r.offset]=M.transform(-s);const o=M.transform(e),a=M.transform(n);t[r.array]=`${o} ${a}`}function So(t,{attrX:e,attrY:n,attrScale:s,pathLength:i,pathSpacing:r=1,pathOffset:o=0,...a},l,u,c){if(_s(t,a,u),l){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:h,style:d}=t;h.transform&&(d.transform=h.transform,delete h.transform),(d.transform||h.transformOrigin)&&(d.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),d.transform&&(d.transformBox=c?.transformBox??"fill-box",delete h.transformBox),e!==void 0&&(h.x=e),n!==void 0&&(h.y=n),s!==void 0&&(h.scale=s),i!==void 0&&Wu(h,i,r,o,!1)}const To=()=>({...Ss(),attrs:{}}),Po=t=>typeof t=="string"&&t.toLowerCase()==="svg";function Uu(t,e,n,s){const i=w.useMemo(()=>{const r=To();return So(r,e,Po(s),t.transformTemplate,t.style),{...r.attrs,style:{...r.style}}},[e]);if(t.style){const r={};_o(r,t.style,t),i.style={...r,...i.style}}return i}const Ku=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Ts(t){return typeof t!="string"||t.includes("-")?!1:!!(Ku.indexOf(t)>-1||/[A-Z]/u.test(t))}function Hu(t,e,n,{latestValues:s},i,r=!1){const a=(Ts(t)?Uu:Fu)(e,s,i,t),l=ku(e,typeof t=="string",r),u=t!==w.Fragment?{...l,...a,ref:n}:{},{children:c}=e,h=w.useMemo(()=>Z(c)?c.get():c,[c]);return w.createElement(t,{...u,children:h})}function mi(t){const e=[{},{}];return t?.values.forEach((n,s)=>{e[0][s]=n.get(),e[1][s]=n.getVelocity()}),e}function Ps(t,e,n,s){if(typeof e=="function"){const[i,r]=mi(s);e=e(n!==void 0?n:t.custom,i,r)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,r]=mi(s);e=e(n!==void 0?n:t.custom,i,r)}return e}function Le(t){return Z(t)?t.get():t}function Gu({scrapeMotionValuesFromProps:t,createRenderState:e},n,s,i){return{latestValues:qu(n,s,i,t),renderState:e()}}function qu(t,e,n,s){const i={},r=s(t,{});for(const d in r)i[d]=Le(r[d]);let{initial:o,animate:a}=t;const l=Je(t),u=wo(t);e&&u&&!l&&t.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let c=n?n.initial===!1:!1;c=c||o===!1;const h=c?a:o;if(h&&typeof h!="boolean"&&!Ze(h)){const d=Array.isArray(h)?h:[h];for(let f=0;f<d.length;f++){const p=Ps(t,d[f]);if(p){const{transitionEnd:m,transition:v,...y}=p;for(const x in y){let g=y[x];if(Array.isArray(g)){const C=c?g.length-1:0;g=g[C]}g!==null&&(i[x]=g)}for(const x in m)i[x]=m[x]}}}return i}const Mo=t=>(e,n)=>{const s=w.useContext(Xe),i=w.useContext(Ye),r=()=>Gu(t,e,s,i);return n?r():Zn(r)};function Ms(t,e,n){const{style:s}=t,i={};for(const r in s)(Z(s[r])||e.style&&Z(e.style[r])||Co(r,t)||n?.getValue(r)?.liveStyle!==void 0)&&(i[r]=s[r]);return i}const Yu=Mo({scrapeMotionValuesFromProps:Ms,createRenderState:Ss});function Eo(t,e,n){const s=Ms(t,e,n);for(const i in t)if(Z(t[i])||Z(e[i])){const r=Jt.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[r]=t[i]}return s}const Xu=Mo({scrapeMotionValuesFromProps:Eo,createRenderState:To}),Zu=Symbol.for("motionComponentSymbol");function Ft(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Ju(t,e,n){return w.useCallback(s=>{s&&t.onMount&&t.onMount(s),e&&(s?e.mount(s):e.unmount()),n&&(typeof n=="function"?n(s):Ft(n)&&(n.current=s))},[e])}const Es=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Qu="framerAppearId",Ao="data-"+Es(Qu),Vo=w.createContext({});function th(t,e,n,s,i){const{visualElement:r}=w.useContext(Xe),o=w.useContext(xo),a=w.useContext(Ye),l=w.useContext(bs).reducedMotion,u=w.useRef(null);s=s||o.renderer,!u.current&&s&&(u.current=s(t,{visualState:e,parent:r,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));const c=u.current,h=w.useContext(Vo);c&&!c.projection&&i&&(c.type==="html"||c.type==="svg")&&eh(u.current,n,i,h);const d=w.useRef(!1);w.useInsertionEffect(()=>{c&&d.current&&c.update(n,a)});const f=n[Ao],p=w.useRef(!!f&&!window.MotionHandoffIsComplete?.(f)&&window.MotionHasOptimisedAnimation?.(f));return Pr(()=>{c&&(d.current=!0,window.MotionIsMounted=!0,c.updateFeatures(),c.scheduleRenderMicrotask(),p.current&&c.animationState&&c.animationState.animateChanges())}),w.useEffect(()=>{c&&(!p.current&&c.animationState&&c.animationState.animateChanges(),p.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(f)}),p.current=!1),c.enteringChildren=void 0)}),c}function eh(t,e,n,s){const{layoutId:i,layout:r,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:u,layoutCrossfade:c}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:ko(t.parent)),t.projection.setOptions({layoutId:i,layout:r,alwaysMeasureLayout:!!o||a&&Ft(a),visualElement:t,animationType:typeof r=="string"?r:"both",initialPromotionConfig:s,crossfade:c,layoutScroll:l,layoutRoot:u})}function ko(t){if(t)return t.options.allowProjection!==!1?t.projection:ko(t.parent)}function dn(t,{forwardMotionProps:e=!1}={},n,s){n&&Eu(n);const i=Ts(t)?Xu:Yu;function r(a,l){let u;const c={...w.useContext(bs),...a,layoutId:nh(a)},{isStatic:h}=c,d=Du(a),f=i(a,h);if(!h&&Jn){sh(c,n);const p=ih(c);u=p.MeasureLayout,d.visualElement=th(t,f,c,s,p.ProjectionNode)}return b.jsxs(Xe.Provider,{value:d,children:[u&&d.visualElement?b.jsx(u,{visualElement:d.visualElement,...c}):null,Hu(t,a,Ju(f,d.visualElement,l),f,h,e)]})}r.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const o=w.forwardRef(r);return o[Zu]=t,o}function nh({layoutId:t}){const e=w.useContext(Xn).id;return e&&t!==void 0?e+"-"+t:t}function sh(t,e){const n=w.useContext(xo).strict;if(process.env.NODE_ENV!=="production"&&e&&n){const s="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";t.ignoreStrict?Xt(!1,s,"lazy-strict-mode"):gt(!1,s,"lazy-strict-mode")}}function ih(t){const{drag:e,layout:n}=qt;if(!e&&!n)return{};const s={...e,...n};return{MeasureLayout:e?.isEnabled(t)||n?.isEnabled(t)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function rh(t,e){if(typeof Proxy>"u")return dn;const n=new Map,s=(r,o)=>dn(r,o,t,e),i=(r,o)=>(process.env.NODE_ENV!=="production"&&ss(!1,"motion() is deprecated. Use motion.create() instead."),s(r,o));return new Proxy(i,{get:(r,o)=>o==="create"?s:(n.has(o)||n.set(o,dn(o,void 0,t,e)),n.get(o))})}function Ro({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function oh({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function ah(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function fn(t){return t===void 0||t===1}function Bn({scale:t,scaleX:e,scaleY:n}){return!fn(t)||!fn(e)||!fn(n)}function Et(t){return Bn(t)||Do(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Do(t){return pi(t.x)||pi(t.y)}function pi(t){return t&&t!=="0%"}function We(t,e,n){const s=t-n,i=e*s;return n+i}function gi(t,e,n,s,i){return i!==void 0&&(t=We(t,i,s)),We(t,n,s)+e}function Nn(t,e=0,n=1,s,i){t.min=gi(t.min,e,n,s,i),t.max=gi(t.max,e,n,s,i)}function jo(t,{x:e,y:n}){Nn(t.x,e.translate,e.scale,e.originPoint),Nn(t.y,n.translate,n.scale,n.originPoint)}const yi=.999999999999,vi=1.0000000000001;function lh(t,e,n,s=!1){const i=n.length;if(!i)return;e.x=e.y=1;let r,o;for(let a=0;a<i;a++){r=n[a],o=r.projectionDelta;const{visualElement:l}=r.options;l&&l.props.style&&l.props.style.display==="contents"||(s&&r.options.layoutScroll&&r.scroll&&r!==r.root&&$t(t,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),o&&(e.x*=o.x.scale,e.y*=o.y.scale,jo(t,o)),s&&Et(r.latestValues)&&$t(t,r.latestValues))}e.x<vi&&e.x>yi&&(e.x=1),e.y<vi&&e.y>yi&&(e.y=1)}function zt(t,e){t.min=t.min+e,t.max=t.max+e}function xi(t,e,n,s,i=.5){const r=F(t.min,t.max,i);Nn(t,e,n,r,s)}function $t(t,e){xi(t.x,e.x,e.scaleX,e.scale,e.originX),xi(t.y,e.y,e.scaleY,e.scale,e.originY)}function Lo(t,e){return Ro(ah(t.getBoundingClientRect(),e))}function ch(t,e,n){const s=Lo(t,n),{scroll:i}=e;return i&&(zt(s.x,i.offset.x),zt(s.y,i.offset.y)),s}const bi=()=>({translate:0,scale:1,origin:0,originPoint:0}),Wt=()=>({x:bi(),y:bi()}),wi=()=>({min:0,max:0}),W=()=>({x:wi(),y:wi()}),Fn={current:null},Oo={current:!1};function uh(){if(Oo.current=!0,!!Jn)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Fn.current=t.matches;t.addEventListener("change",e),e()}else Fn.current=!1}const hh=new WeakMap;function dh(t,e,n){for(const s in e){const i=e[s],r=n[s];if(Z(i))t.addValue(s,i);else if(Z(r))t.addValue(s,Gt(i,{owner:t}));else if(r!==i)if(t.hasValue(s)){const o=t.getValue(s);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=t.getStaticValue(s);t.addValue(s,Gt(o!==void 0?o:i,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const Ci=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class fh{scrapeMotionValuesFromProps(e,n,s){return{}}constructor({parent:e,props:n,presenceContext:s,reducedMotionConfig:i,blockInitialAnimation:r,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=ps,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const d=tt.now();this.renderScheduledAt<d&&(this.renderScheduledAt=d,B.render(this.render,!1,!0))};const{latestValues:l,renderState:u}=o;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=u,this.parent=e,this.props=n,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!r,this.isControllingVariants=Je(n),this.isVariantNode=wo(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:c,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const d in h){const f=h[d];l[d]!==void 0&&Z(f)&&f.set(l[d])}}mount(e){this.current=e,hh.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,s)=>this.bindToMotionValue(s,n)),Oo.current||uh(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Fn.current,process.env.NODE_ENV!=="production"&&ss(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),wt(this.notifyUpdate),wt(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const s=Qt.has(e);s&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&B.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let r;window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),r&&r(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in qt){const n=qt[e];if(!n)continue;const{isEnabled:s,Feature:i}=n;if(!this.features[e]&&i&&s(this.props)&&(this.features[e]=new i(this)),this.features[e]){const r=this.features[e];r.isMounted?r.update():(r.mount(),r.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):W()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<Ci.length;s++){const i=Ci[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const r="on"+i,o=e[r];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=dh(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const s=this.values.get(e);n!==s&&(s&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let s=this.values.get(e);return s===void 0&&n!==void 0&&(s=Gt(n===null?void 0:n,{owner:this}),this.addValue(e,s)),s}readValue(e,n){let s=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return s!=null&&(typeof s=="string"&&(Mr(s)||Ar(s))?s=parseFloat(s):!bu(s)&&Ct.test(n)&&(s=uo(e,n)),this.setBaseTarget(e,Z(s)?s.get():s)),Z(s)?s.get():s}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const r=Ps(this.props,n,this.presenceContext?.custom);r&&(s=r[e])}if(n&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!Z(i)?i:this.initialValues[e]!==void 0&&s===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new ns),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){vs.render(this.render)}}class Io extends fh{constructor(){super(...arguments),this.KeyframeResolver=lu}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:s}){delete n[e],delete s[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Z(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Bo(t,{style:e,vars:n},s,i){const r=t.style;let o;for(o in e)r[o]=e[o];i?.applyProjectionStyles(r,s);for(o in n)r.setProperty(o,n[o])}function mh(t){return window.getComputedStyle(t)}class ph extends Io{constructor(){super(...arguments),this.type="html",this.renderInstance=Bo}readValueFromInstance(e,n){if(Qt.has(n))return this.projection?.isProjecting?kn(n):Pc(e,n);{const s=mh(e),i=(os(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return Lo(e,n)}build(e,n,s){_s(e,n,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return Ms(e,n,s)}}const No=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function gh(t,e,n,s){Bo(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(No.has(i)?i:Es(i),e.attrs[i])}class yh extends Io{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=W}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Qt.has(n)){const s=co(n);return s&&s.default||0}return n=No.has(n)?n:Es(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,s){return Eo(e,n,s)}build(e,n,s){So(e,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(e,n,s,i){gh(e,n,s,i)}mount(e){this.isSVGTag=Po(e.tagName),super.mount(e)}}const vh=(t,e)=>Ts(t)?new yh(e):new ph(e,{allowProjection:t!==w.Fragment});function Kt(t,e,n){const s=t.getProps();return Ps(s,e,n!==void 0?n:s.custom,t)}const zn=t=>Array.isArray(t);function xh(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Gt(n))}function bh(t){return zn(t)?t[t.length-1]||0:t}function wh(t,e){const n=Kt(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const o in r){const a=bh(r[o]);xh(t,o,a)}}function Ch(t){return!!(Z(t)&&t.add)}function $n(t,e){const n=t.getValue("willChange");if(Ch(n))return n.add(e);if(!n&&yt.WillChange){const s=new yt.WillChange("auto");t.addValue("willChange",s),s.add(e)}}function Fo(t){return t.props[Ao]}const _h=t=>t!==null;function Sh(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(_h),r=e&&n!=="loop"&&e%2===1?0:i.length-1;return i[r]}const Th={type:"spring",stiffness:500,damping:25,restSpeed:10},Ph=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),Mh={type:"keyframes",duration:.8},Eh={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Ah=(t,{keyframes:e})=>e.length>2?Mh:Qt.has(t)?t.startsWith("scale")?Ph(e[1]):Th:Eh;function Vh({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:r,repeatType:o,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length}const As=(t,e,n,s={},i,r)=>o=>{const a=gs(s,t)||{},l=a.delay||s.delay||0;let{elapsed:u=0}=s;u=u-ht(l);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:d=>{e.set(d),a.onUpdate&&a.onUpdate(d)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:r?void 0:i};Vh(a)||Object.assign(c,Ah(t,c)),c.duration&&(c.duration=ht(c.duration)),c.repeatDelay&&(c.repeatDelay=ht(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let h=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(On(c),c.delay===0&&(h=!0)),(yt.instantAnimations||yt.skipAnimations)&&(h=!0,On(c),c.delay=0),c.allowFlatten=!a.type&&!a.ease,h&&!r&&e.get()!==void 0){const d=Sh(c.keyframes,a);if(d!==void 0){B.update(()=>{c.onUpdate(d),c.onComplete()});return}}return a.isSync?new ms(c):new Yc(c)};function kh({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function zo(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:r=t.getDefaultTransition(),transitionEnd:o,...a}=e;s&&(r=s);const l=[],u=i&&t.animationState&&t.animationState.getState()[i];for(const c in a){const h=t.getValue(c,t.latestValues[c]??null),d=a[c];if(d===void 0||u&&kh(u,c))continue;const f={delay:n,...gs(r||{},c)},p=h.get();if(p!==void 0&&!h.isAnimating&&!Array.isArray(d)&&d===p&&!f.velocity)continue;let m=!1;if(window.MotionHandoffAnimation){const y=Fo(t);if(y){const x=window.MotionHandoffAnimation(y,c,B);x!==null&&(f.startTime=x,m=!0)}}$n(t,c),h.start(As(c,h,d,t.shouldReduceMotion&&oo.has(c)?{type:!1}:f,t,m));const v=h.animation;v&&l.push(v)}return o&&Promise.all(l).then(()=>{B.update(()=>{o&&wh(t,o)})}),l}function $o(t,e,n,s=0,i=1){const r=Array.from(t).sort((u,c)=>u.sortNodePosition(c)).indexOf(e),o=t.size,a=(o-1)*s;return typeof n=="function"?n(r,o):i===1?r*s:a-r*s}function Wn(t,e,n={}){const s=Kt(t,e,n.type==="exit"?t.presenceContext?.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const r=s?()=>Promise.all(zo(t,s,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(l=0)=>{const{delayChildren:u=0,staggerChildren:c,staggerDirection:h}=i;return Rh(t,e,l,u,c,h,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[l,u]=a==="beforeChildren"?[r,o]:[o,r];return l().then(()=>u())}else return Promise.all([r(),o(n.delay)])}function Rh(t,e,n=0,s=0,i=0,r=1,o){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(Wn(l,e,{...o,delay:n+(typeof s=="function"?0:s)+$o(t.variantChildren,l,s,i,r)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}function Dh(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(r=>Wn(t,r,n));s=Promise.all(i)}else if(typeof e=="string")s=Wn(t,e,n);else{const i=typeof e=="function"?Kt(t,e,n.custom):e;s=Promise.all(zo(t,i,n))}return s.then(()=>{t.notify("AnimationComplete",e)})}function Wo(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}const jh=Cs.length;function Uo(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?Uo(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<jh;n++){const s=Cs[n],i=t.props[s];(pe(i)||i===!1)&&(e[s]=i)}return e}const Lh=[...ws].reverse(),Oh=ws.length;function Ih(t){return e=>Promise.all(e.map(({animation:n,options:s})=>Dh(t,n,s)))}function Bh(t){let e=Ih(t),n=_i(),s=!0;const i=l=>(u,c)=>{const h=Kt(t,c,l==="exit"?t.presenceContext?.custom:void 0);if(h){const{transition:d,transitionEnd:f,...p}=h;u={...u,...p,...f}}return u};function r(l){e=l(t)}function o(l){const{props:u}=t,c=Uo(t.parent)||{},h=[],d=new Set;let f={},p=1/0;for(let v=0;v<Oh;v++){const y=Lh[v],x=n[y],g=u[y]!==void 0?u[y]:c[y],C=pe(g),S=y===l?x.isActive:null;S===!1&&(p=v);let P=g===c[y]&&g!==u[y]&&C;if(P&&s&&t.manuallyAnimateOnMount&&(P=!1),x.protectedKeys={...f},!x.isActive&&S===null||!g&&!x.prevProp||Ze(g)||typeof g=="boolean")continue;const _=Nh(x.prevProp,g);let T=_||y===l&&x.isActive&&!P&&C||v>p&&C,E=!1;const L=Array.isArray(g)?g:[g];let Q=L.reduce(i(y),{});S===!1&&(Q={});const{prevResolvedValues:St={}}=x,Tt={...St,...Q},vt=z=>{T=!0,d.has(z)&&(E=!0,d.delete(z)),x.needsAnimating[z]=!0;const k=t.getValue(z);k&&(k.liveStyle=!1)};for(const z in Tt){const k=Q[z],j=St[z];if(f.hasOwnProperty(z))continue;let $=!1;zn(k)&&zn(j)?$=!Wo(k,j):$=k!==j,$?k!=null?vt(z):d.add(z):k!==void 0&&d.has(z)?vt(z):x.protectedKeys[z]=!0}x.prevProp=g,x.prevResolvedValues=Q,x.isActive&&(f={...f,...Q}),s&&t.blockInitialAnimation&&(T=!1);const jt=P&&_;T&&(!jt||E)&&h.push(...L.map(z=>{const k={type:y};if(typeof z=="string"&&s&&!jt&&t.manuallyAnimateOnMount&&t.parent){const{parent:j}=t,$=Kt(j,z);if(j.enteringChildren&&$){const{delayChildren:Ot}=$.transition||{};k.delay=$o(j.enteringChildren,t,Ot)}}return{animation:z,options:k}}))}if(d.size){const v={};if(typeof u.initial!="boolean"){const y=Kt(t,Array.isArray(u.initial)?u.initial[0]:u.initial);y&&y.transition&&(v.transition=y.transition)}d.forEach(y=>{const x=t.getBaseTarget(y),g=t.getValue(y);g&&(g.liveStyle=!0),v[y]=x??null}),h.push({animation:v})}let m=!!h.length;return s&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(m=!1),s=!1,m?e(h):Promise.resolve()}function a(l,u){if(n[l].isActive===u)return Promise.resolve();t.variantChildren?.forEach(h=>h.animationState?.setActive(l,u)),n[l].isActive=u;const c=o(l);for(const h in n)n[h].protectedKeys={};return c}return{animateChanges:o,setActive:a,setAnimateFunction:r,getState:()=>n,reset:()=>{n=_i(),s=!0}}}function Nh(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!Wo(e,t):!1}function Pt(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function _i(){return{animate:Pt(!0),whileInView:Pt(),whileHover:Pt(),whileTap:Pt(),whileDrag:Pt(),whileFocus:Pt(),exit:Pt()}}class _t{constructor(e){this.isMounted=!1,this.node=e}update(){}}class Fh extends _t{constructor(e){super(e),e.animationState||(e.animationState=Bh(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Ze(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let zh=0;class $h extends _t{constructor(){super(...arguments),this.id=zh++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===s)return;const i=this.node.animationState.setActive("exit",!e);n&&!e&&i.then(()=>{n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const Wh={animation:{Feature:Fh},exit:{Feature:$h}};function ye(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}function _e(t){return{point:{x:t.pageX,y:t.pageY}}}const Uh=t=>e=>xs(e)&&t(e,_e(e));function oe(t,e,n,s){return ye(t,e,Uh(n),s)}const Ko=1e-4,Kh=1-Ko,Hh=1+Ko,Ho=.01,Gh=0-Ho,qh=0+Ho;function J(t){return t.max-t.min}function Yh(t,e,n){return Math.abs(t-e)<=n}function Si(t,e,n,s=.5){t.origin=s,t.originPoint=F(e.min,e.max,t.origin),t.scale=J(n)/J(e),t.translate=F(n.min,n.max,t.origin)-t.originPoint,(t.scale>=Kh&&t.scale<=Hh||isNaN(t.scale))&&(t.scale=1),(t.translate>=Gh&&t.translate<=qh||isNaN(t.translate))&&(t.translate=0)}function ae(t,e,n,s){Si(t.x,e.x,n.x,s?s.originX:void 0),Si(t.y,e.y,n.y,s?s.originY:void 0)}function Ti(t,e,n){t.min=n.min+e.min,t.max=t.min+J(e)}function Xh(t,e,n){Ti(t.x,e.x,n.x),Ti(t.y,e.y,n.y)}function Pi(t,e,n){t.min=e.min-n.min,t.max=t.min+J(e)}function le(t,e,n){Pi(t.x,e.x,n.x),Pi(t.y,e.y,n.y)}function rt(t){return[t("x"),t("y")]}const Go=({current:t})=>t?t.ownerDocument.defaultView:null,Mi=(t,e)=>Math.abs(t-e);function Zh(t,e){const n=Mi(t.x,e.x),s=Mi(t.y,e.y);return Math.sqrt(n**2+s**2)}class qo{constructor(e,n,{transformPagePoint:s,contextWindow:i=window,dragSnapToOrigin:r=!1,distanceThreshold:o=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=pn(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,p=Zh(d.offset,{x:0,y:0})>=this.distanceThreshold;if(!f&&!p)return;const{point:m}=d,{timestamp:v}=G;this.history.push({...m,timestamp:v});const{onStart:y,onMove:x}=this.handlers;f||(y&&y(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),x&&x(this.lastMoveEvent,d)},this.handlePointerMove=(d,f)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=mn(f,this.transformPagePoint),B.update(this.updatePoint,!0)},this.handlePointerUp=(d,f)=>{this.end();const{onEnd:p,onSessionEnd:m,resumeAnimation:v}=this.handlers;if(this.dragSnapToOrigin&&v&&v(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=pn(d.type==="pointercancel"?this.lastMoveEventInfo:mn(f,this.transformPagePoint),this.history);this.startEvent&&p&&p(d,y),m&&m(d,y)},!xs(e))return;this.dragSnapToOrigin=r,this.handlers=n,this.transformPagePoint=s,this.distanceThreshold=o,this.contextWindow=i||window;const a=_e(e),l=mn(a,this.transformPagePoint),{point:u}=l,{timestamp:c}=G;this.history=[{...u,timestamp:c}];const{onSessionStart:h}=n;h&&h(e,pn(l,this.history)),this.removeListeners=be(oe(this.contextWindow,"pointermove",this.handlePointerMove),oe(this.contextWindow,"pointerup",this.handlePointerUp),oe(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),wt(this.updatePoint)}}function mn(t,e){return e?{point:e(t.point)}:t}function Ei(t,e){return{x:t.x-e.x,y:t.y-e.y}}function pn({point:t},e){return{point:t,delta:Ei(t,Yo(e)),offset:Ei(t,Jh(e)),velocity:Qh(e,.1)}}function Jh(t){return t[0]}function Yo(t){return t[t.length-1]}function Qh(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const i=Yo(t);for(;n>=0&&(s=t[n],!(i.timestamp-s.timestamp>ht(e)));)n--;if(!s)return{x:0,y:0};const r=ot(i.timestamp-s.timestamp);if(r===0)return{x:0,y:0};const o={x:(i.x-s.x)/r,y:(i.y-s.y)/r};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function td(t,{min:e,max:n},s){return e!==void 0&&t<e?t=s?F(e,t,s.min):Math.max(t,e):n!==void 0&&t>n&&(t=s?F(n,t,s.max):Math.min(t,n)),t}function Ai(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function ed(t,{top:e,left:n,bottom:s,right:i}){return{x:Ai(t.x,n,i),y:Ai(t.y,e,s)}}function Vi(t,e){let n=e.min-t.min,s=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,s]=[s,n]),{min:n,max:s}}function nd(t,e){return{x:Vi(t.x,e.x),y:Vi(t.y,e.y)}}function sd(t,e){let n=.5;const s=J(t),i=J(e);return i>s?n=de(e.min,e.max-s,t.min):s>i&&(n=de(t.min,t.max-i,e.min)),pt(0,1,n)}function id(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const Un=.35;function rd(t=Un){return t===!1?t=0:t===!0&&(t=Un),{x:ki(t,"left","right"),y:ki(t,"top","bottom")}}function ki(t,e,n){return{min:Ri(t,e),max:Ri(t,n)}}function Ri(t,e){return typeof t=="number"?t:t[e]||0}const od=new WeakMap;class ad{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=W(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:s}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const r=h=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(_e(h).point)},o=(h,d)=>{const{drag:f,dragPropagation:p,onDragStart:m}=this.getProps();if(f&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=du(f),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=d,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),rt(y=>{let x=this.getAxisMotionValue(y).get()||0;if(mt.test(x)){const{projection:g}=this.visualElement;if(g&&g.layout){const C=g.layout.layoutBox[y];C&&(x=J(C)*(parseFloat(x)/100))}}this.originPoint[y]=x}),m&&B.postRender(()=>m(h,d)),$n(this.visualElement,"transform");const{animationState:v}=this.visualElement;v&&v.setActive("whileDrag",!0)},a=(h,d)=>{this.latestPointerEvent=h,this.latestPanInfo=d;const{dragPropagation:f,dragDirectionLock:p,onDirectionLock:m,onDrag:v}=this.getProps();if(!f&&!this.openDragLock)return;const{offset:y}=d;if(p&&this.currentDirection===null){this.currentDirection=ld(y),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",d.point,y),this.updateAxis("y",d.point,y),this.visualElement.render(),v&&v(h,d)},l=(h,d)=>{this.latestPointerEvent=h,this.latestPanInfo=d,this.stop(h,d),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>rt(h=>this.getAnimationState(h)==="paused"&&this.getAxisMotionValue(h).animation?.play()),{dragSnapToOrigin:c}=this.getProps();this.panSession=new qo(e,{onSessionStart:r,onStart:o,onMove:a,onSessionEnd:l,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,distanceThreshold:s,contextWindow:Go(this.visualElement)})}stop(e,n){const s=e||this.latestPointerEvent,i=n||this.latestPanInfo,r=this.isDragging;if(this.cancel(),!r||!i||!s)return;const{velocity:o}=i;this.startAnimation(o);const{onDragEnd:a}=this.getProps();a&&B.postRender(()=>a(s,i))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(e,n,s){const{drag:i}=this.getProps();if(!s||!Ee(e,i,this.currentDirection))return;const r=this.getAxisMotionValue(e);let o=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(o=td(o,this.constraints[e],this.elastic[e])),r.set(o)}resolveConstraints(){const{dragConstraints:e,dragElastic:n}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;e&&Ft(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&s?this.constraints=ed(s.layoutBox,e):this.constraints=!1,this.elastic=rd(n),i!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&rt(r=>{this.constraints!==!1&&this.getAxisMotionValue(r)&&(this.constraints[r]=id(s.layoutBox[r],this.constraints[r]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!Ft(e))return!1;const s=e.current;gt(s!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const r=ch(s,i.root,this.visualElement.getTransformPagePoint());let o=nd(i.layout.layoutBox,r);if(n){const a=n(oh(o));this.hasMutatedConstraints=!!a,a&&(o=Ro(a))}return o}startAnimation(e){const{drag:n,dragMomentum:s,dragElastic:i,dragTransition:r,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=rt(c=>{if(!Ee(c,n,this.currentDirection))return;let h=l&&l[c]||{};o&&(h={min:0,max:0});const d=i?200:1e6,f=i?40:1e7,p={type:"inertia",velocity:s?e[c]:0,bounceStiffness:d,bounceDamping:f,timeConstant:750,restDelta:1,restSpeed:10,...r,...h};return this.startAxisValueAnimation(c,p)});return Promise.all(u).then(a)}startAxisValueAnimation(e,n){const s=this.getAxisMotionValue(e);return $n(this.visualElement,e),s.start(As(e,s,0,n,this.visualElement,!1))}stopAnimation(){rt(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){rt(e=>this.getAxisMotionValue(e).animation?.pause())}getAnimationState(e){return this.getAxisMotionValue(e).animation?.state}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,s=this.visualElement.getProps(),i=s[n];return i||this.visualElement.getValue(e,(s.initial?s.initial[e]:void 0)||0)}snapToCursor(e){rt(n=>{const{drag:s}=this.getProps();if(!Ee(n,s,this.currentDirection))return;const{projection:i}=this.visualElement,r=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[n];r.set(e[n]-F(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!Ft(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};rt(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();i[o]=sd({min:l,max:l},this.constraints[o])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.resolveConstraints(),rt(o=>{if(!Ee(o,e,null))return;const a=this.getAxisMotionValue(o),{min:l,max:u}=this.constraints[o];a.set(F(l,u,i[o]))})}addListeners(){if(!this.visualElement.current)return;od.set(this.visualElement,this);const e=this.visualElement.current,n=oe(e,"pointerdown",l=>{const{drag:u,dragListener:c=!0}=this.getProps();u&&c&&this.start(l)}),s=()=>{const{dragConstraints:l}=this.getProps();Ft(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,r=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),B.read(s);const o=ye(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(rt(c=>{const h=this.getAxisMotionValue(c);h&&(this.originPoint[c]+=l[c].translate,h.set(h.get()+l[c].translate))}),this.visualElement.render())}));return()=>{o(),n(),r(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:i=!1,dragConstraints:r=!1,dragElastic:o=Un,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:s,dragPropagation:i,dragConstraints:r,dragElastic:o,dragMomentum:a}}}function Ee(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function ld(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class cd extends _t{constructor(e){super(e),this.removeGroupControls=at,this.removeListeners=at,this.controls=new ad(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||at}unmount(){this.removeGroupControls(),this.removeListeners()}}const Di=t=>(e,n)=>{t&&B.postRender(()=>t(e,n))};class ud extends _t{constructor(){super(...arguments),this.removePointerDownListener=at}onPointerDown(e){this.session=new qo(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Go(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:Di(e),onStart:Di(n),onMove:s,onEnd:(r,o)=>{delete this.session,i&&B.postRender(()=>i(r,o))}}}mount(){this.removePointerDownListener=oe(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Oe={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function ji(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const ne={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(M.test(t))t=parseFloat(t);else return t;const n=ji(t,e.target.x),s=ji(t,e.target.y);return`${n}% ${s}%`}},hd={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=Ct.parse(t);if(i.length>5)return s;const r=Ct.createTransformer(t),o=typeof i[0]!="number"?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;i[0+o]/=a,i[1+o]/=l;const u=F(a,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=u),typeof i[3+o]=="number"&&(i[3+o]/=u),r(i)}};let gn=!1;class dd extends w.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s,layoutId:i}=this.props,{projection:r}=e;ju(fd),r&&(n.group&&n.group.add(r),s&&s.register&&i&&s.register(r),gn&&r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,onExitComplete:()=>this.safeToRemove()})),Oe.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:s,drag:i,isPresent:r}=this.props,{projection:o}=s;return o&&(o.isPresent=r,gn=!0,i||e.layoutDependency!==n||n===void 0||e.isPresent!==r?o.willUpdate():this.safeToRemove(),e.isPresent!==r&&(r?o.promote():o.relegate()||B.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),vs.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:i}=e;gn=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),s&&s.deregister&&s.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function Xo(t){const[e,n]=vo(),s=w.useContext(Xn);return b.jsx(dd,{...t,layoutGroup:s,switchLayoutGroup:w.useContext(Vo),isPresent:e,safeToRemove:n})}const fd={borderRadius:{...ne,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:ne,borderTopRightRadius:ne,borderBottomLeftRadius:ne,borderBottomRightRadius:ne,boxShadow:hd};function md(t,e,n){const s=Z(t)?t:Gt(t);return s.start(As("",s,e,n)),s.animation}const pd=(t,e)=>t.depth-e.depth;class gd{constructor(){this.children=[],this.isDirty=!1}add(e){Qn(this.children,e),this.isDirty=!0}remove(e){ts(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(pd),this.isDirty=!1,this.children.forEach(e)}}function yd(t,e){const n=tt.now(),s=({timestamp:i})=>{const r=i-n;r>=e&&(wt(s),t(r-e))};return B.setup(s,!0),()=>wt(s)}const Zo=["TopLeft","TopRight","BottomLeft","BottomRight"],vd=Zo.length,Li=t=>typeof t=="string"?parseFloat(t):t,Oi=t=>typeof t=="number"||M.test(t);function xd(t,e,n,s,i,r){i?(t.opacity=F(0,n.opacity??1,bd(s)),t.opacityExit=F(e.opacity??1,0,wd(s))):r&&(t.opacity=F(e.opacity??1,n.opacity??1,s));for(let o=0;o<vd;o++){const a=`border${Zo[o]}Radius`;let l=Ii(e,a),u=Ii(n,a);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||Oi(l)===Oi(u)?(t[a]=Math.max(F(Li(l),Li(u),s),0),(mt.test(u)||mt.test(l))&&(t[a]+="%")):t[a]=u}(e.rotate||n.rotate)&&(t.rotate=F(e.rotate||0,n.rotate||0,s))}function Ii(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const bd=Jo(0,.5,Ir),wd=Jo(.5,.95,at);function Jo(t,e,n){return s=>s<t?0:s>e?1:n(de(t,e,s))}function Bi(t,e){t.min=e.min,t.max=e.max}function st(t,e){Bi(t.x,e.x),Bi(t.y,e.y)}function Ni(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function Fi(t,e,n,s,i){return t-=e,t=We(t,1/n,s),i!==void 0&&(t=We(t,1/i,s)),t}function Cd(t,e=0,n=1,s=.5,i,r=t,o=t){if(mt.test(e)&&(e=parseFloat(e),e=F(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=F(r.min,r.max,s);t===r&&(a-=e),t.min=Fi(t.min,e,n,a,i),t.max=Fi(t.max,e,n,a,i)}function zi(t,e,[n,s,i],r,o){Cd(t,e[n],e[s],e[i],e.scale,r,o)}const _d=["x","scaleX","originX"],Sd=["y","scaleY","originY"];function $i(t,e,n,s){zi(t.x,e,_d,n?n.x:void 0,s?s.x:void 0),zi(t.y,e,Sd,n?n.y:void 0,s?s.y:void 0)}function Wi(t){return t.translate===0&&t.scale===1}function Qo(t){return Wi(t.x)&&Wi(t.y)}function Ui(t,e){return t.min===e.min&&t.max===e.max}function Td(t,e){return Ui(t.x,e.x)&&Ui(t.y,e.y)}function Ki(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function ta(t,e){return Ki(t.x,e.x)&&Ki(t.y,e.y)}function Hi(t){return J(t.x)/J(t.y)}function Gi(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class Pd{constructor(){this.members=[]}add(e){Qn(this.members,e),e.scheduleRender()}remove(e){if(ts(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(i=>e===i);if(n===0)return!1;let s;for(let i=n;i>=0;i--){const r=this.members[i];if(r.isPresent!==!1){s=r;break}}return s?(this.promote(s),!0):!1}promote(e,n){const s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.instance&&s.scheduleRender(),e.scheduleRender(),e.resumeFrom=s,n&&(e.resumeFrom.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:i}=e.options;i===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:s}=e;n.onExitComplete&&n.onExitComplete(),s&&s.options.onExitComplete&&s.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Md(t,e,n){let s="";const i=t.x.translate/e.x,r=t.y.translate/e.y,o=n?.z||0;if((i||r||o)&&(s=`translate3d(${i}px, ${r}px, ${o}px) `),(e.x!==1||e.y!==1)&&(s+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:u,rotate:c,rotateX:h,rotateY:d,skewX:f,skewY:p}=n;u&&(s=`perspective(${u}px) ${s}`),c&&(s+=`rotate(${c}deg) `),h&&(s+=`rotateX(${h}deg) `),d&&(s+=`rotateY(${d}deg) `),f&&(s+=`skewX(${f}deg) `),p&&(s+=`skewY(${p}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return(a!==1||l!==1)&&(s+=`scale(${a}, ${l})`),s||"none"}const yn=["","X","Y","Z"],Ed=1e3;let Ad=0;function vn(t,e,n,s){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),s&&(s[t]=0))}function ea(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Fo(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:r}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",B,!(i||r))}const{parent:s}=t;s&&!s.hasCheckedOptimisedAppear&&ea(s)}function na({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(o={},a=e?.()){this.id=Ad++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Rd),this.nodes.forEach(Od),this.nodes.forEach(Id),this.nodes.forEach(Dd)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new gd)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new ns),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=yo(o)&&!vu(o),this.instance=o;const{layoutId:a,layout:l,visualElement:u}=this.options;if(u&&!u.current&&u.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),t){let c,h=0;const d=()=>this.root.updateBlockedByResize=!1;B.read(()=>{h=window.innerWidth}),t(o,()=>{const f=window.innerWidth;f!==h&&(h=f,this.root.updateBlockedByResize=!0,c&&c(),c=yd(d,250),Oe.hasAnimatedSinceResize&&(Oe.hasAnimatedSinceResize=!1,this.nodes.forEach(Xi)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&u&&(a||l)&&this.addEventListener("didUpdate",({delta:c,hasLayoutChanged:h,hasRelativeLayoutChanged:d,layout:f})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const p=this.options.transition||u.getDefaultTransition()||$d,{onLayoutAnimationStart:m,onLayoutAnimationComplete:v}=u.getProps(),y=!this.targetLayout||!ta(this.targetLayout,f),x=!h&&d;if(this.options.layoutRoot||this.resumeFrom||x||h&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const g={...gs(p,"layout"),onPlay:m,onComplete:v};(u.shouldReduceMotion||this.options.layoutRoot)&&(g.delay=0,g.type=!1),this.startAnimation(g),this.setAnimationOrigin(c,x)}else h||Xi(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=f})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),wt(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Bd),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&ea(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){const h=this.path[c];h.shouldResetTransform=!0,h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(qi);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Yi);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Ld),this.nodes.forEach(Vd),this.nodes.forEach(kd)):this.nodes.forEach(Yi),this.clearAllSnapshots();const a=tt.now();G.delta=pt(0,1e3/60,a-G.timestamp),G.timestamp=a,G.isProcessing=!0,on.update.process(G),on.preRender.process(G),on.render.process(G),G.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,vs.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(jd),this.sharedNodes.forEach(Nd)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,B.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){B.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!J(this.snapshot.measuredBox.x)&&!J(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=W(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a&&this.instance){const l=s(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Qo(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;o&&this.instance&&(a||Et(this.latestValues)||c)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),Wd(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:o}=this.options;if(!o)return W();const a=o.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Ud))){const{scroll:u}=this.root;u&&(zt(a.x,u.offset.x),zt(a.y,u.offset.y))}return a}removeElementScroll(o){const a=W();if(st(a,o),this.scroll?.wasRoot)return a;for(let l=0;l<this.path.length;l++){const u=this.path[l],{scroll:c,options:h}=u;u!==this.root&&c&&h.layoutScroll&&(c.wasRoot&&st(a,o),zt(a.x,c.offset.x),zt(a.y,c.offset.y))}return a}applyTransform(o,a=!1){const l=W();st(l,o);for(let u=0;u<this.path.length;u++){const c=this.path[u];!a&&c.options.layoutScroll&&c.scroll&&c!==c.root&&$t(l,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),Et(c.latestValues)&&$t(l,c.latestValues)}return Et(this.latestValues)&&$t(l,this.latestValues),l}removeTransform(o){const a=W();st(a,o);for(let l=0;l<this.path.length;l++){const u=this.path[l];if(!u.instance||!Et(u.latestValues))continue;Bn(u.latestValues)&&u.updateSnapshot();const c=W(),h=u.measurePageBox();st(c,h),$i(a,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,c)}return Et(this.latestValues)&&$i(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==G.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(o||l&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:c,layoutId:h}=this.options;if(!(!this.layout||!(c||h))){if(this.resolvedRelativeTargetAt=G.timestamp,!this.targetDelta&&!this.relativeTarget){const d=this.getClosestProjectingParent();d&&d.layout&&this.animationProgress!==1?(this.relativeParent=d,this.forceRelativeParentToResolveTarget(),this.relativeTarget=W(),this.relativeTargetOrigin=W(),le(this.relativeTargetOrigin,this.layout.layoutBox,d.layout.layoutBox),st(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=W(),this.targetWithTransforms=W()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Xh(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):st(this.target,this.layout.layoutBox),jo(this.target,this.targetDelta)):st(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const d=this.getClosestProjectingParent();d&&!!d.resumingFrom==!!this.resumingFrom&&!d.options.layoutScroll&&d.target&&this.animationProgress!==1?(this.relativeParent=d,this.forceRelativeParentToResolveTarget(),this.relativeTarget=W(),this.relativeTargetOrigin=W(),le(this.relativeTargetOrigin,this.target,d.target),st(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||Bn(this.parent.latestValues)||Do(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){const o=this.getLead(),a=!!this.resumingFrom||this!==o;let l=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===G.timestamp&&(l=!1),l)return;const{layout:u,layoutId:c}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||c))return;st(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,d=this.treeScale.y;lh(this.layoutCorrected,this.treeScale,this.path,a),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=W());const{target:f}=o;if(!f){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Ni(this.prevProjectionDelta.x,this.projectionDelta.x),Ni(this.prevProjectionDelta.y,this.projectionDelta.y)),ae(this.projectionDelta,this.layoutCorrected,f,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==d||!Gi(this.projectionDelta.x,this.prevProjectionDelta.x)||!Gi(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",f))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){if(this.options.visualElement?.scheduleRender(),o){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Wt(),this.projectionDelta=Wt(),this.projectionDeltaWithTransform=Wt()}setAnimationOrigin(o,a=!1){const l=this.snapshot,u=l?l.latestValues:{},c={...this.latestValues},h=Wt();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const d=W(),f=l?l.source:void 0,p=this.layout?this.layout.source:void 0,m=f!==p,v=this.getStack(),y=!v||v.members.length<=1,x=!!(m&&!y&&this.options.crossfade===!0&&!this.path.some(zd));this.animationProgress=0;let g;this.mixTargetDelta=C=>{const S=C/1e3;Zi(h.x,o.x,S),Zi(h.y,o.y,S),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(le(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Fd(this.relativeTarget,this.relativeTargetOrigin,d,S),g&&Td(this.relativeTarget,g)&&(this.isProjectionDirty=!1),g||(g=W()),st(g,this.relativeTarget)),m&&(this.animationValues=c,xd(c,u,this.latestValues,S,x,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(wt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=B.update(()=>{Oe.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Gt(0)),this.currentAnimation=md(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Ed),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:c}=o;if(!(!a||!l||!u)){if(this!==o&&this.layout&&u&&sa(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||W();const h=J(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+h;const d=J(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+d}st(a,l),$t(a,c),ae(this.projectionDeltaWithTransform,this.layoutCorrected,a,c)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Pd),this.sharedNodes.get(o).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){const{layoutId:o}=this.options;return o?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:o}=this.options;return o?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const u={};l.z&&vn("z",o,u,this.animationValues);for(let c=0;c<yn.length;c++)vn(`rotate${yn[c]}`,o,u,this.animationValues),vn(`skew${yn[c]}`,o,u,this.animationValues);o.render();for(const c in u)o.setStaticValue(c,u[c]),this.animationValues&&(this.animationValues[c]=u[c]);o.scheduleRender()}applyProjectionStyles(o,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=Le(a?.pointerEvents)||"",o.transform=l?l(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=Le(a?.pointerEvents)||""),this.hasProjected&&!Et(this.latestValues)&&(o.transform=l?l({},""):"none",this.hasProjected=!1);return}o.visibility="";const c=u.animationValues||u.latestValues;this.applyTransformsToTarget();let h=Md(this.projectionDeltaWithTransform,this.treeScale,c);l&&(h=l(c,h)),o.transform=h;const{x:d,y:f}=this.projectionDelta;o.transformOrigin=`${d.origin*100}% ${f.origin*100}% 0`,u.animationValues?o.opacity=u===this?c.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:c.opacityExit:o.opacity=u===this?c.opacity!==void 0?c.opacity:"":c.opacityExit!==void 0?c.opacityExit:0;for(const p in ge){if(c[p]===void 0)continue;const{correct:m,applyTo:v,isCSSVariable:y}=ge[p],x=h==="none"?c[p]:m(c[p],u);if(v){const g=v.length;for(let C=0;C<g;C++)o[v[C]]=x}else y?this.options.visualElement.renderState.vars[p]=x:o[p]=x}this.options.layoutId&&(o.pointerEvents=u===this?Le(a?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>o.currentAnimation?.stop()),this.root.nodes.forEach(qi),this.root.sharedNodes.clear()}}}function Vd(t){t.updateLayout()}function kd(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:s}=t.layout,{animationType:i}=t.options,r=e.source!==t.layout.source;i==="size"?rt(c=>{const h=r?e.measuredBox[c]:e.layoutBox[c],d=J(h);h.min=n[c].min,h.max=h.min+d}):sa(i,e.layoutBox,n)&&rt(c=>{const h=r?e.measuredBox[c]:e.layoutBox[c],d=J(n[c]);h.max=h.min+d,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[c].max=t.relativeTarget[c].min+d)});const o=Wt();ae(o,n,e.layoutBox);const a=Wt();r?ae(a,t.applyTransform(s,!0),e.measuredBox):ae(a,n,e.layoutBox);const l=!Qo(o);let u=!1;if(!t.resumeFrom){const c=t.getClosestProjectingParent();if(c&&!c.resumeFrom){const{snapshot:h,layout:d}=c;if(h&&d){const f=W();le(f,e.layoutBox,h.layoutBox);const p=W();le(p,n,d.layoutBox),ta(f,p)||(u=!0),c.options.layoutRoot&&(t.relativeTarget=p,t.relativeTargetOrigin=f,t.relativeParent=c)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:o,hasLayoutChanged:l,hasRelativeLayoutChanged:u})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function Rd(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Dd(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function jd(t){t.clearSnapshot()}function qi(t){t.clearMeasurements()}function Yi(t){t.isLayoutDirty=!1}function Ld(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Xi(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Od(t){t.resolveTargetDelta()}function Id(t){t.calcProjection()}function Bd(t){t.resetSkewAndRotation()}function Nd(t){t.removeLeadSnapshot()}function Zi(t,e,n){t.translate=F(e.translate,0,n),t.scale=F(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Ji(t,e,n,s){t.min=F(e.min,n.min,s),t.max=F(e.max,n.max,s)}function Fd(t,e,n,s){Ji(t.x,e.x,n.x,s),Ji(t.y,e.y,n.y,s)}function zd(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const $d={duration:.45,ease:[.4,0,.1,1]},Qi=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),tr=Qi("applewebkit/")&&!Qi("chrome/")?Math.round:at;function er(t){t.min=tr(t.min),t.max=tr(t.max)}function Wd(t){er(t.x),er(t.y)}function sa(t,e,n){return t==="position"||t==="preserve-aspect"&&!Yh(Hi(e),Hi(n),.2)}function Ud(t){return t!==t.root&&t.scroll?.wasRoot}const Kd=na({attachResizeListener:(t,e)=>ye(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),xn={current:void 0},ia=na({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!xn.current){const t=new Kd({});t.mount(window),t.setOptions({layoutScroll:!0}),xn.current=t}return xn.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),Hd={pan:{Feature:ud},drag:{Feature:cd,ProjectionNode:ia,MeasureLayout:Xo}};function nr(t,e,n){const{props:s}=t;t.animationState&&s.whileHover&&t.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,r=s[i];r&&B.postRender(()=>r(e,_e(e)))}class Gd extends _t{mount(){const{current:e}=this.node;e&&(this.unmount=fu(e,(n,s)=>(nr(this.node,s,"Start"),i=>nr(this.node,i,"End"))))}unmount(){}}class qd extends _t{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=be(ye(this.node.current,"focus",()=>this.onFocus()),ye(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function sr(t,e,n){const{props:s}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&s.whileTap&&t.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),r=s[i];r&&B.postRender(()=>r(e,_e(e)))}class Yd extends _t{mount(){const{current:e}=this.node;e&&(this.unmount=yu(e,(n,s)=>(sr(this.node,s,"Start"),(i,{success:r})=>sr(this.node,i,r?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Kn=new WeakMap,bn=new WeakMap,Xd=t=>{const e=Kn.get(t.target);e&&e(t)},Zd=t=>{t.forEach(Xd)};function Jd({root:t,...e}){const n=t||document;bn.has(n)||bn.set(n,{});const s=bn.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(Zd,{root:t,...e})),s[i]}function Qd(t,e,n){const s=Jd(e);return Kn.set(t,n),s.observe(t),()=>{Kn.delete(t),s.unobserve(t)}}const tf={some:0,all:1};class ef extends _t{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:s,amount:i="some",once:r}=e,o={root:n?n.current:void 0,rootMargin:s,threshold:typeof i=="number"?i:tf[i]},a=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,r&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:c,onViewportLeave:h}=this.node.getProps(),d=u?c:h;d&&d(l)};return Qd(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(nf(e,n))&&this.startObserver()}unmount(){}}function nf({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const sf={inView:{Feature:ef},tap:{Feature:Yd},focus:{Feature:qd},hover:{Feature:Gd}},rf={layout:{ProjectionNode:ia,MeasureLayout:Xo}},of={...Wh,...sf,...Hd,...rf},Vs=rh(of,vh),af=t=>{let e;t.center?e="center":t.left?e="left":t.right&&(e="right");let n;return t.uppercase?n="uppercase":t.lowercase?n="lowercase":t.capitalize&&(n="capitalize"),X({marginTop:t.mt,marginBottom:t.mb,marginRight:t.mr,marginLeft:t.ml,flex:t.flex,cursor:t.cursor,wordBreak:t.wordBreak,whiteSpace:t.whiteSpace,textOverflow:t.textOverflow,textDecoration:t.decoration,textAlign:e,textTransform:n,color:t.color,opacity:t.disabled?.5:void 0,overflow:t.overflow})},lf="_primary_13825_8",cf="_secondary_13825_12",uf="_tertiary_13825_16",hf="_positive_13825_20",df="_negative_13825_24",ff="_warning_13825_28",mf="_accent_13825_32",pf="_inverse_13825_36",gf="_text_13825_111",yf="_regular_13825_117",vf="_medium_13825_121",xf="_semibold_13825_125",bf="_bold_13825_129",Ae={primary:lf,secondary:cf,tertiary:uf,positive:hf,negative:df,warning:ff,accent:mf,inverse:pf,"title-1":"_title-1_13825_41","title-2":"_title-2_13825_51","title-3":"_title-3_13825_61","headline-1":"_headline-1_13825_76","headline-2":"_headline-2_13825_81","headline-3":"_headline-3_13825_86","body-1":"_body-1_13825_91","body-2":"_body-2_13825_96","caption-1":"_caption-1_13825_101","caption-2":"_caption-2_13825_106",text:gf,regular:yf,medium:vf,semibold:xf,bold:bf},O=w.forwardRef((t,e)=>{const{children:n,className:s,variant:i="body-1",fontWeight:r="medium",tag:o="p",colorName:a="primary",style:l,clickOpacity:u=.5,opacityDuration:c=200,onClick:h,disabled:d,...f}=t,[p,m]=w.useState(!1),v=!!h,y=()=>v&&m(!0),x=()=>v&&m(!1),g=o,C=v?X({opacity:p?u:1,transition:`opacity ${c}ms ease`}):"";return b.jsx(g,{ref:e,...f,className:I(Ae.text,Ae[i],Ae[r],Ae[a],af(t),C,s),style:l,onClick:h,onMouseDown:y,onMouseUp:x,onMouseLeave:x,onTouchStart:y,onTouchEnd:x,role:v?"button":void 0,tabIndex:v?0:void 0,children:n})});O.displayName="Text";const ra=Vs(O),wf="_loader_1qleq_8",Cf={loader:wf},_f=({color:t="var(--text-accent)"})=>b.jsx("span",{className:I(Cf.loader,X({"--loader-color":t}))}),Sf=X({display:"flex",alignItems:"center",justifyContent:"center",position:"relative",borderRadius:16,height:48,padding:"0 16px",cursor:"pointer",fontSize:16,fontWeight:600,overflow:"hidden",transition:"all 0.2s ease",gap:8}),se={zero:"var(--corner-zero)",xs:"var(--corner-xs)",sm:"var(--corner-sm)",md:"var(--corner-md)",lg:"var(--corner-lg)",xl:"var(--corner-xl)","2xl":"var(--corner-2xl)","3xl":"var(--corner-3xl)","4xl":"var(--corner-4xl)","5xl":"var(--corner-5xl)","6xl":"var(--corner-6xl)","full-round":"var(--corner-full-round)"},Tf={xs:"var(--height-button-xs)",sm:"var(--height-button-sm)",md:"var(--height-button-md)",lg:"var(--height-button-lg)"},Pf={clear:X({backgroundColor:"transparent",border:"none"}),filled:X({backgroundColor:"var(--fill-accent-primary)",color:"white",border:"none"}),outline:X({backgroundColor:"transparent",border:"1px solid var(--border-accent-primary)"})},Mf=(t,e,n,s)=>{if(s)return X({cursor:"not-allowed",opacity:.7});const i={transition:"all 0.2s ease",borderRadius:"var(--corner-lg)",border:"none",color:t==="filled"?"var(--text-inverse)":`var(--text-${e})`};switch(t){case"filled":return X({...i,backgroundColor:`var(--fill-${e}-${n})`,":hover":{backgroundColor:`var(--fill-${e}-${n}-hover)`},":active":{backgroundColor:`var(--fill-${e}-${n}-hover)`}});case"outline":return X({...i,backgroundColor:"transparent",border:`1px solid var(--border-${e}-${n})`,":hover":{backgroundColor:`var(--fill-${e}-secondary-hover)`},":active":{backgroundColor:`var(--fill-${e}-secondary-hover)`}});case"clear":return X({...i,backgroundColor:"transparent",":hover":{backgroundColor:`var(--fill-${e}-secondary-hover)`},":active":{backgroundColor:`var(--fill-${e}-secondary-hover)`}});default:return X(i)}},Ef=({disabled:t,loading:e,onClick:n,wrapperClassName:s,buttonClassName:i,buttonDisabledClassName:r,textClassName:o,children:a,variant:l="filled",backgroundColor:u,textColor:c,textFontWeight:h,borderColor:d,color:f="accent",borderRadius:p,width:m="full",size:v="md",iconLeft:y,iconRight:x,intensity:g="primary",...C})=>{const S=w.useMemo(()=>{switch(m){case"full":return"100%";case"auto":return"auto";default:return m}},[m]),P=w.useMemo(()=>u||(l==="filled"?`var(--fill-${f}-${g})`:"transparent"),[l,t,u,f,g]),_=w.useMemo(()=>{if(c)return c;if(g==="primary"){if(f==="neutral")return"var(--text-secondary)";if(l==="filled")return"var(--text-inverse)"}return`var(--text-${f}, #111)`},[l,t,c,f,g]),T=w.useMemo(()=>d||(l==="outline"?`var(--border-${f}-${g})`:"transparent"),[l,d,f,g]),E=w.useMemo(()=>{switch(v){case"lg":return se.lg;case"md":case"sm":return se.md;case"xs":return se.sm;default:return se.md}},[v]),L=I(Sf,Mf(l,f,g,t),Pf[l],i,t?r:void 0,X({borderRadius:p?se[p]:E,backgroundColor:P,borderColor:T,color:_,width:"100%",height:Tf[v],opacity:t?.7:1})),Q=w.useMemo(()=>{switch(v){case"lg":case"md":return"body-1";case"sm":case"xs":return"body-2";default:return"body-1"}},[v]);return b.jsx(A,{className:I(s),w:S,relative:!0,overflow:"hidden",children:b.jsxs(Vs.button,{whileTap:!t&&!e?{scale:.99,boxShadow:"inset 0 0 0 10000px rgba(0,0,0,0.1)",transition:{duration:0}}:{},className:L,disabled:t||e,onClick:n,...C,children:[e?b.jsx(_f,{color:_}):b.jsxs(b.Fragment,{children:[y,b.jsx(ra,{color:_,variant:Q,className:o,textOverflow:"ellipsis",overflow:"hidden",children:a}),x]}),b.jsx(xe,{})]})})},Af=t=>V.createElement("svg",{viewBox:"0 0 24 24",fill:"none",...t},V.createElement("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z",fill:"currentColor"})),Vf=t=>V.createElement("svg",{viewBox:"0 0 24 24",fill:"none",...t},V.createElement("path",{d:"M19 13H5v-2h14v2z",fill:"currentColor"})),kf="_checkbox_1hy9q_8",Rf="_disabled_1hy9q_15",Df="_checkbox__input_1hy9q_27",jf="_checkbox__box_1hy9q_35",Mt={checkbox:kf,disabled:Rf,checkbox__input:Df,checkbox__box:jf,"checkbox__box--checked":"_checkbox__box--checked_1hy9q_51"},Lf={sm:20,md:24},ks=w.forwardRef(({checked:t,onChange:e,disabled:n,indeterminate:s,size:i="md",title:r,titleColor:o,subtitle:a,subtitleColor:l="secondary",name:u,value:c,required:h},d)=>{const[f,p]=w.useState(!1),m=t!==void 0,v=m?t:f,y=C=>{m||p(C.target.checked),e?.(C)},x=Lf[i],g=v||s;return b.jsxs("label",{className:I(Mt.checkbox,{[Mt.disabled]:n}),children:[b.jsxs(A,{relative:!0,display:"inline-flex",style:{"--checkbox-size":`${x}px`,"--checkbox-size-double":`${x*2}px`},children:[b.jsx("input",{ref:d,type:"checkbox",checked:v,onChange:y,onClick:C=>C.stopPropagation(),disabled:n,name:u,value:c,required:h,className:I(Mt.checkbox__input,{[Mt.disabled]:n})}),b.jsx("div",{className:I(Mt.checkbox__box,g&&Mt["checkbox__box--checked"],{[Mt.disabled]:n}),children:g&&(s?b.jsx(Vf,{width:x*.75,height:x*.75}):b.jsx(Af,{width:x*.75,height:x*.75}))})]}),(r||a)&&b.jsxs(A,{gap:4,children:[r&&b.jsx(O,{colorName:o,variant:i==="sm"?"body-2":"body-1",children:r}),a&&b.jsx(O,{variant:"body-2",colorName:l,children:a})]})]})});ks.displayName="Checkbox";const Of=t=>V.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},V.createElement("g",{opacity:.5},V.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.0002 17.9999C14.4185 17.9999 18.0002 14.4182 18.0002 9.99991C18.0002 5.58163 14.4185 1.99991 10.0002 1.99991C5.58197 1.99991 2.00024 5.58163 2.00024 9.99991C2.00024 14.4182 5.58197 17.9999 10.0002 17.9999ZM6.46514 6.46446C6.85566 6.07393 7.48883 6.07393 7.87935 6.46446L9.64712 8.23222C9.84238 8.42749 10.159 8.42749 10.3542 8.23222L12.122 6.46446C12.5125 6.07393 13.1457 6.07393 13.5362 6.46446C13.9267 6.85498 13.9267 7.48814 13.5362 7.87867L11.7684 9.64644C11.5732 9.8417 11.5732 10.1583 11.7684 10.3535L13.5362 12.1213C13.9267 12.5118 13.9267 13.145 13.5362 13.5355C13.1457 13.926 12.5125 13.926 12.122 13.5355L10.3542 11.7678C10.159 11.5725 9.84238 11.5725 9.64712 11.7678L7.87935 13.5355C7.48883 13.926 6.85566 13.926 6.46514 13.5355C6.07462 13.145 6.07462 12.5118 6.46514 12.1213L8.23291 10.3535C8.42817 10.1583 8.42817 9.8417 8.23291 9.64644L6.46514 7.87867C6.07462 7.48815 6.07462 6.85498 6.46514 6.46446Z",fill:"currentColor"}))),If="_disabled_15p1l_20",Bf="_input_15p1l_8",Nf="_sm_15p1l_61",Ff="_md_15p1l_66",zf="_error_15p1l_71",$f="_white_15p1l_75",Wf="_gray_15p1l_79",lt={"input-container":"_input-container_15p1l_8",disabled:If,input:Bf,"input-text-size_sm":"_input-text-size_sm_15p1l_52","input-text-size_md":"_input-text-size_md_15p1l_56",sm:Nf,md:Ff,error:zf,white:$f,gray:Wf,"clear-button":"_clear-button_15p1l_83"};function ir(t){return{...new Event("input",{bubbles:!0}),target:t,currentTarget:t}}const oa=w.forwardRef((t,e)=>{const{label:n,prompt:s,error:i,errorText:r,size:o="md",prefix:a,suffix:l,background:u="white",showClearButton:c,disabled:h,value:d,defaultValue:f,...p}=t,m=t.multiline===!0,v=w.useRef(null),y=w.useRef(null),[x,g]=Ge(d!==void 0?String(d):void 0,f!==void 0?String(f):"");w.useImperativeHandle(e,()=>({focus:()=>{v.current?.focus(),y.current?.focus()},blur:()=>{v.current?.blur(),y.current?.blur()},get value(){return v.current?.value||y.current?.value}}));const C=_=>{if(g(_.target.value),m){const T=t.onChange;T?.(_)}else{const T=t.onChange;T?.(_)}};w.useEffect(()=>{m&&t.autoResize&&y.current&&(y.current.style.height="auto",y.current.style.height=`${y.current.scrollHeight}px`)},[x,m,t.autoResize]);const S=()=>{if(g(""),!m){const T=v.current;if(T){T.value="";const E=ir(T),L=t.onChange;L?.(E)}return}const _=y.current;if(_){_.value="";const T=ir(_),E=t.onChange;E?.(T)}},P=()=>{if(m){const{rows:L,autoResize:Q,onChange:St,multiline:Tt,...vt}=p;return b.jsx("textarea",{ref:y,rows:t.rows??3,className:I(lt.input,{[lt.disabled]:h}),disabled:h,maxLength:t.maxLength,...vt,value:x,onChange:C})}const{onChange:_,multiline:T,...E}=p;return b.jsx("input",{...E,ref:v,className:I(lt.input,lt[`input-text-size_${o}`],{[lt.disabled]:h}),disabled:h,type:t.type??"text",value:x,onChange:C})};return b.jsxs(A,{w:"full",gap:"var(--spacing-sm)",children:[n&&b.jsx(O,{variant:"body-2",fontWeight:"regular",colorName:i?"negative":"tertiary",children:n}),b.jsxs(A,{row:!0,alignItems:"center",w:"full",gap:"var(--spacing-md)",className:I(lt["input-container"],lt[u],lt[o],{[lt.error]:i,[lt.disabled]:h}),children:[a&&b.jsx(A,{flex:"none",children:a}),b.jsx(A,{flex:"1",children:P()}),c&&x&&!h&&b.jsx(A,{flex:"none",children:b.jsx("span",{className:lt["clear-button"],onClick:S,children:b.jsx(Of,{})})}),l&&b.jsx(A,{flex:"none",children:l})]}),(s||m)&&b.jsxs(A,{row:!0,gap:10,w:"full",children:[typeof s=="string"?b.jsx(O,{variant:"caption-1",colorName:"tertiary",children:s}):s,m&&t.maxLength&&b.jsx(O,{right:!0,ml:"auto",flex:"none",variant:"caption-1",colorName:"tertiary",children:`${x.length}/${t.maxLength}`})]}),r&&i&&b.jsx(O,{variant:"body-2",colorName:"negative",fontWeight:"regular",children:r})]})});oa.displayName="Input";const Uf="_avatar_1oe2p_8",Kf="_avatar_primary_1oe2p_22",Hf="_avatar_secondary_1oe2p_25",Gf="_avatar_negative_1oe2p_28",qf="_avatar_positive_1oe2p_31",Yf="_avatar_warning_1oe2p_34",Xf="_avatar_lgSize_1oe2p_71",Zf="_avatar_mdSize_1oe2p_85",Jf="_avatar_smSize_1oe2p_99",wn={avatar:Uf,avatar_primary:Kf,avatar_secondary:Hf,avatar_negative:Gf,avatar_positive:qf,avatar_warning:Yf,avatar_lgSize:Xf,avatar_mdSize:Zf,avatar_smSize:Jf};function Qf({attr:t,children:e,className:n,color:s="primary",size:i="md",...r}){const o="avatar";return b.jsx("div",{...t,...r,className:At(wn[o],n,he(wn,o,i),qe(wn,o,s)),children:e})}const tm=t=>V.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},V.createElement("circle",{cx:12,cy:12,r:10,fill:"currentColor",fillOpacity:.15}),V.createElement("path",{d:"M16 9L10.0337 15L8 12.9548",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),rr=t=>V.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},V.createElement("path",{d:"M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z",fill:"currentColor",fillOpacity:.15}),V.createElement("path",{d:"M12 6C11.4477 6 11 6.44772 11 7V13C11 13.5523 11.4477 14 12 14C12.5523 14 13 13.5523 13 13V7C13 6.44772 12.5523 6 12 6Z",fill:"currentColor"}),V.createElement("path",{d:"M12 15C11.4477 15 11 15.4477 11 16V17C11 17.5523 11.4477 18 12 18C12.5523 18 13 17.5523 13 17V16C13 15.4477 12.5523 15 12 15Z",fill:"currentColor"})),em=t=>V.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},V.createElement("circle",{cx:12,cy:12,r:10,fill:"currentColor",fillOpacity:.12}),V.createElement("path",{d:"M16 8L8 16M16 16L8 8",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"})),nm=t=>V.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:"black",...t},V.createElement("path",{d:"M12 2V22M19.0711 4.92893L4.92893 19.0711M22 12H2M19.0711 19.0711L4.92893 4.92893",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),sm="_hint_prca1_8",im="_md_prca1_19",rm="_sm_prca1_24",om="_icon_prca1_29",am="_content_prca1_40",lm="_title_prca1_46",cm="_subtitle_prca1_50",um="_disabled_prca1_55",hm="_warning_prca1_60",dm="_solid_prca1_60",fm="_negative_prca1_65",mm="_positive_prca1_70",pm="_accent_prca1_75",gm="_neutral_prca1_80",ym="_soft_prca1_85",it={hint:sm,md:im,sm:rm,icon:om,content:am,title:lm,subtitle:cm,disabled:um,warning:hm,solid:dm,negative:fm,positive:mm,accent:pm,neutral:gm,soft:ym},vm={negative:b.jsx(em,{}),positive:b.jsx(tm,{}),accent:b.jsx(rr,{}),warning:b.jsx(rr,{}),neutral:b.jsx(nm,{})},xm=({title:t,subtitle:e,color:n="warning",variant:s="soft",size:i="md",icon:r,disabled:o=!1,className:a,style:l})=>{const u=r||vm[n];return b.jsxs("div",{className:At(it.hint,it[n],it[s],it[i],o&&it.disabled,a),style:l,"aria-disabled":o,children:[u&&b.jsx("span",{className:At(it.icon,it[n]),children:u}),b.jsxs("div",{className:it.content,children:[t&&b.jsx(O,{className:At(it.title,he(it,"title",i)),variant:i==="md"?"body-1":"caption-2",children:t}),e&&b.jsx(O,{className:At(it.subtitle,he(it,"subtitle",i)),variant:i==="md"?"body-2":"caption-1",children:e})]})]})},bm={primary:{bg:"var(--status-neutral-tint-low)",color:"var(--text-primary)"},accent:{bg:"var(--status-accent-tint-low)",color:"var(--text-accent)"},warning:{bg:"var(--status-warning-tint-low)",color:"var(--text-warning)"},positive:{bg:"var(--status-positive-tint-low)",color:"var(--text-positive)"},negative:{bg:"var(--status-negative-tint-low)",color:"var(--text-negative)"}},wm={sm:28,md:32,lg:40},Rs=w.forwardRef(({label:t,color:e="primary",size:n="md",onClick:s,onDelete:i,avatar:r,icon:o,disabled:a,className:l},u)=>{const c=w.useRef(null),h=bm[e],d=X({cursor:a?"not-allowed":s?"pointer":"default",opacity:a?.5:1,userSelect:"none",position:"relative",transition:"background-color 0.2s, opacity 0.2s","&:hover":a?void 0:{backgroundColor:h.bg}}),f=X({cursor:"pointer",opacity:.6,"&:hover":{opacity:1}});return b.jsxs(A,{ref:p=>{c.current=p,typeof u=="function"?u(p):u&&(u.current=p)},row:!0,alignItems:"center",gap:6,px:10,py:4,h:wm[n],maxWidth:196,overflow:"hidden",borderRadius:"var(--corner-sm)",backgroundColor:h.bg,color:h.color,onClick:s,className:I(d,l),children:[s&&b.jsx(xe,{}),r&&b.jsx(A,{w:20,h:20,borderRadius:"50%",overflow:"hidden",children:r}),o&&b.jsx(A,{children:o}),b.jsx(O,{variant:"caption-1",color:h.color,textOverflow:"ellipsis",children:t}),i&&!a&&b.jsx(O,{className:f,colorName:e,onClick:p=>{p.stopPropagation(),i(p)},children:"×"})]})});Rs.displayName="Tag";const aa=({children:t})=>{const[e]=w.useState(()=>document.createElement("div"));return w.useEffect(()=>{let n=document.getElementById("portal-root");return n||(n=document.createElement("div"),n.id="portal-root",document.body.appendChild(n)),n.appendChild(e),()=>{n&&n.contains(e)&&n.removeChild(e)}},[e]),dr.createPortal(t,e)},Cm=t=>V.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},V.createElement("path",{d:"M6 9L12 15L18 9",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),_m=t=>V.createElement("svg",{fill:"currentColor",id:"Capa_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 462.035 462.035",xmlSpace:"preserve",...t},V.createElement("g",null,V.createElement("path",{d:"M457.83,158.441c-0.021-0.028-0.033-0.058-0.057-0.087l-50.184-62.48c-0.564-0.701-1.201-1.305-1.879-1.845 c-2.16-2.562-5.355-4.225-8.967-4.225H65.292c-3.615,0-6.804,1.661-8.965,4.225c-0.678,0.54-1.316,1.138-1.885,1.845l-50.178,62.48 c-0.023,0.029-0.034,0.059-0.057,0.087C1.655,160.602,0,163.787,0,167.39v193.07c0,6.5,5.27,11.771,11.77,11.771h438.496 c6.5,0,11.77-5.271,11.77-11.771V167.39C462.037,163.787,460.381,160.602,457.83,158.441z M408.516,134.615l16.873,21.005h-16.873 V134.615z M384.975,113.345v42.274H296.84c-2.514,0-4.955,0.805-6.979,2.293l-58.837,43.299l-58.849-43.305 c-2.023-1.482-4.466-2.287-6.978-2.287H77.061v-42.274H384.975z M53.523,155.62H36.65l16.873-21.005V155.62z M438.498,348.69H23.54 V179.16h137.796l62.711,46.148c4.15,3.046,9.805,3.052,13.954-0.005l62.698-46.144h137.799V348.69L438.498,348.69z"}))),Sm="_disabled_6kgqd_40",Tm="_open_6kgqd_48",Pm="_error_6kgqd_51",Mm="_hidden_6kgqd_87",Em="_visible_6kgqd_90",Am="_selected_6kgqd_163",H={"select-container":"_select-container_6kgqd_8","full-width":"_full-width_6kgqd_13","select-input":"_select-input_6kgqd_17","size-xs":"_size-xs_6kgqd_25","size-sm":"_size-sm_6kgqd_30","size-md":"_size-md_6kgqd_35",disabled:Sm,open:Tm,"select-arrow":"_select-arrow_6kgqd_48",error:Pm,"select-value":"_select-value_6kgqd_62","select-value_xs":"_select-value_xs_6kgqd_74","select-placeholder":"_select-placeholder_6kgqd_81",hidden:Mm,visible:Em,"select-arrow_xs":"_select-arrow_xs_6kgqd_106","select-dropdown":"_select-dropdown_6kgqd_116","select-menu":"_select-menu_6kgqd_126","select-menu-item":"_select-menu-item_6kgqd_145","select-menu-item-first":"_select-menu-item-first_6kgqd_158",selected:Am,"overflow-tooltip-container":"_overflow-tooltip-container_6kgqd_167","overflow-tooltip-text":"_overflow-tooltip-text_6kgqd_172","empty-block":"_empty-block_6kgqd_179"},Vm={xs:"sm",sm:"md",md:"lg"};function km({value:t,onChange:e,multiple:n=!1,returnedValue:s,renderItem:i,placeholder:r,items:o,fullWidth:a,size:l="md",showDefaultItem:u,disabled:c,label:h,firstItem:d,lastItem:f,observer:p,emptyText:m,onBlur:v,error:y,errorText:x}){const[g,C]=Ge(t,n?[]:null),S=w.useRef(null),P=w.useRef(null),[_,T]=w.useState(!1),E=w.useMemo(()=>n?g||[]:g!=null?[g]:[],[g,n]),L=w.useMemo(()=>{const k=new Map;return o.forEach(j=>k.set(s(j),j)),k},[o,s]),Q=_r(S,_),St=!o.length&&!y,Tt=k=>{const j=s(k);if(n){const $=E.includes(j)?E.filter(Ot=>Ot!==j):[...E,j];C($),e?.($)}else C(j),e?.(j),T(!1)},vt=k=>{if(!n)return;const j=E.filter($=>$!==k);C(j),e?.(j)},jt=()=>{const k=n?[]:null;C(k),e?.(k),n||T(!1)};w.useEffect(()=>{if(!_)return;const k=j=>{const $=j.target;!S.current?.contains($)&&!P.current?.contains($)&&T(!1)};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[_]);const Lt=()=>{if(!E.length)return b.jsx(O,{variant:l==="xs"?"caption-1":"body-2",textOverflow:"ellipsis",overflow:"hidden",children:r??"Select..."});if(n)return b.jsx(A,{flexWrap:"wrap",row:!0,gap:10,children:E.map($=>{const Ot=L.get($);return Ot?b.jsx(Rs,{size:Vm[l],label:i(Ot),onDelete:fa=>{fa.stopPropagation(),vt($)}},$):null})});const k=L.get(E[0]);if(!k)return b.jsx(O,{variant:l==="xs"?"caption-1":"body-2",textOverflow:"ellipsis",overflow:"hidden",children:r});const j=i(k);return typeof j=="string"?b.jsx(O,{variant:l==="xs"?"caption-1":"body-2",tag:"p",textOverflow:"ellipsis",overflow:"hidden",children:j}):b.jsx(b.Fragment,{children:j})},z=_&&b.jsx(aa,{children:b.jsx(Vs.div,{ref:P,className:H["select-dropdown"],initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.25,ease:"easeInOut"},style:{...Q,position:"absolute",zIndex:1},children:b.jsxs("ul",{className:H["select-menu"],children:[u&&!n&&b.jsx(A,{className:H["select-menu-item"],role:"option",onClick:jt,children:b.jsx(O,{variant:"body-2",children:r})}),d&&b.jsx(A,{className:I(H["select-menu-item"],H["select-menu-item-first"]),children:d}),St&&b.jsxs(A,{className:H["empty-block"],children:[b.jsx(A,{w:20,h:20,children:b.jsx(_m,{})}),b.jsx(O,{variant:"body-2",children:m??"There is nothing yet"})]}),o.map(k=>{const j=s(k),$=E.includes(j);return b.jsxs(A,{row:!0,gap:10,alignItems:"center",className:I(H["select-menu-item"],{[H.selected]:$}),role:"option",relative:!0,onClick:()=>Tt(k),children:[n&&b.jsx(ks,{size:"sm",checked:$}),typeof i(k)=="string"?b.jsx(O,{variant:"body-2",tag:"p",wordBreak:"break-all",whiteSpace:"break-spaces",children:i(k)}):i(k),b.jsx(xe,{})]},j)}),p,f&&b.jsx(A,{className:I(H["select-menu-item"],H["select-menu-item-first"]),children:f})]})},"dropdown")});return b.jsxs(A,{relative:!0,display:"inline-block",minWidth:120,w:a?"full":"auto",children:[typeof h=="string"?b.jsx(O,{variant:"body-2",colorName:"tertiary",fontWeight:"regular",mb:l==="sm"?4:8,children:h}):h,b.jsxs(A,{ref:S,row:!0,gap:10,tabIndex:c?-1:0,role:"button",alignItems:"flex-start","aria-haspopup":"listbox",relative:!0,w:"100%",className:I(H["select-input"],H[`size-${l}`],{[H.error]:y,[H.disabled]:c,[H.open]:_}),onClick:()=>!c&&T(k=>!k),onBlur:v,children:[b.jsx(A,{className:I(H["select-value"]),children:Lt()}),b.jsx(A,{className:I(H["select-arrow"],H[`select-arrow_${l}`]),children:b.jsx(Cm,{})})]}),y&&x&&b.jsx(O,{tag:"p",colorName:"negative",variant:"body-2",mt:5,children:x}),b.jsx(Mu,{initial:!1,children:z})]})}const Rm=t=>V.createElement("svg",{width:10,height:10,viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},V.createElement("path",{d:"M3.94629 0.220237C3.78013 0.264025 3.64089 0.377624 3.56348 0.53176C3.27371 1.11189 3.05664 1.46395 2.83887 1.74953C2.61807 2.03873 2.38547 2.27579 2.03027 2.63039C1.21079 3.45057 0.799805 4.52619 0.799805 5.60012C0.799838 6.67406 1.21073 7.74968 2.03027 8.56985C3.67062 10.2096 6.32931 10.2095 7.96973 8.56985C8.78929 7.74968 9.20016 6.67408 9.2002 5.60012C9.15131 4.32908 8.43217 3.48543 7.94727 3.05813C7.76902 2.90106 7.40643 3.02424 7.2627 3.2134C7.24031 3.24286 7.21612 3.2739 7.18945 3.30617C6.93211 3.61754 6.56236 3.80807 6.41504 3.83156C6.38264 3.83667 6.36979 3.76513 6.2959 3.58254C5.79455 2.34427 5.78927 2.49365 5.58887 2.01125C5.48847 1.7692 5.05517 1.02727 4.92676 0.828635C4.80206 0.635591 4.64095 0.439873 4.43359 0.301292C4.29028 0.205951 4.1124 0.175957 3.94629 0.220237ZM4.75293 4.17824C5.2689 4.63997 5.60857 5.26651 5.71484 5.95071C6.10631 5.85571 6.46727 5.68318 6.78125 5.45071C6.86578 5.70826 6.89338 5.98123 6.8623 6.25051C6.83115 6.51993 6.74174 6.77966 6.60059 7.01125C6.45944 7.24281 6.27008 7.44117 6.04492 7.59231C5.81977 7.74344 5.56462 7.8443 5.29688 7.88723C5.0292 7.93013 4.75518 7.91446 4.49414 7.84133C4.23299 7.76812 3.99064 7.6383 3.78418 7.46242C3.5778 7.28657 3.41161 7.06792 3.29785 6.8218C3.18419 6.57572 3.12519 6.30771 3.125 6.03664C3.12508 5.58233 3.29054 5.14308 3.58984 4.80129C3.88917 4.4597 4.30271 4.2382 4.75293 4.17824Z",fill:"#FEAD34"})),Dm=t=>V.createElement("svg",{width:12,height:12,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},V.createElement("path",{d:"M10.1483 8.61509C10.3344 8.26159 9.98299 7.89856 9.58534 7.93723C9.42671 7.95265 9.25857 7.9605 9.07422 7.96035C6.36522 7.9582 4.17129 5.76427 4.16914 3.05527C4.169 2.87115 4.17682 2.70321 4.19221 2.54477C4.23082 2.14712 3.86769 1.79411 3.50976 1.97161C2.03398 2.70343 1.20002 4.02274 1.20002 5.89477C1.20002 8.60377 3.3961 10.7998 6.1051 10.7998C7.97571 10.7998 9.38737 10.06 10.1483 8.61509Z",fill:"white"})),jm="_container_e7tan_8",Lm="_disabled_e7tan_17",Om="_reverse_e7tan_21",Im="_input_e7tan_25",Bm="_switchContainer_e7tan_35",Nm="_variant_accent_e7tan_43",Fm="_variant_secondary_e7tan_47",zm="_thumb_e7tan_51",$m="_variant_theme_e7tan_54",Wm="_moon_e7tan_58",Um="_fire_e7tan_61",Km="_size_sm_e7tan_74",Hm="_size_md_e7tan_80",Gm="_size_lg_e7tan_86",ct={container:jm,disabled:Lm,reverse:Om,input:Im,switchContainer:Bm,variant_accent:Nm,variant_secondary:Fm,switch:"_switch_e7tan_35",thumb:zm,variant_theme:$m,moon:Wm,fire:Um,size_sm:Km,size_md:Hm,size_lg:Gm},la=w.forwardRef(({title:t,text:e,icon:n,disabled:s,onChange:i,checked:r,defaultValue:o,className:a,size:l="md",variant:u="accent",reverse:c=!1,w:h="auto",...d},f)=>{const[p,m]=Ge(r,o),v=w.useRef(null);w.useImperativeHandle(f,()=>({focus:()=>{v.current?.focus()},blur:()=>{v.current?.blur()},get checked(){return p??!1},setChecked:C=>{m(C),i?.(C)},toggle:()=>{const C=!p;m(C),i?.(C)},isFocused:()=>document.activeElement===v.current,isDisabled:()=>s??!1,getInputElement:()=>v.current,checkValidity:()=>v.current?.checkValidity()??!0,reset:()=>{const C=o??!1;m(C),i?.(C)}}),[p,m,i,s,o]);const y=w.useCallback(C=>{m(C.target.checked),i?.(C.target.checked)},[i]),x=w.useMemo(()=>typeof t=="string"?b.jsx(O,{variant:"body-1",colorName:"primary",fontWeight:"medium",children:t}):t,[t]),g=w.useMemo(()=>typeof e=="string"?b.jsx(O,{variant:"body-2",colorName:"secondary",fontWeight:"regular",children:e}):e,[e]);return b.jsxs(A,{row:!0,w:h,gap:"var(--spacing-sm)",children:[b.jsxs("label",{className:I(ct.container,a,{[ct.disabled]:s,[ct.reverse]:c}),children:[b.jsxs(A,{className:I(ct.switchContainer,ct[`size_${l}`],ct[`variant_${u}`]),children:[b.jsx("input",{ref:v,type:"checkbox",checked:p,className:ct.input,onChange:y,disabled:s,...d}),b.jsx("div",{className:ct.switch,children:b.jsx("div",{className:ct.thumb,children:u==="theme"&&b.jsxs(b.Fragment,{children:[b.jsx(Dm,{className:ct.moon}),b.jsx(Rm,{className:ct.fire})]})})})]}),b.jsxs(A,{gap:"var(--spacing-xs)",children:[x,g]})]}),n]})});la.displayName="Switch";const qm="_header_446to_8",Ym={header:qm},ca=w.forwardRef(({title:t,subtitle:e,onClose:n,w:s="full",p:i,py:r,px:o="var(--spacing-2xl)",pt:a="var(--spacing-2xl)",pb:l="var(--spacing-lg)",row:u=!0,justifyContent:c="space-between",showCloseButton:h=!0},d)=>b.jsxs(A,{w:s,p:i,py:r,px:o,pt:a,pb:l,row:u,justifyContent:c,ref:d,className:Ym.header,children:[b.jsxs(A,{gap:"var(--spacing-sm)",children:[b.jsx(O,{variant:"title-3",colorName:"primary",fontWeight:"semibold",children:t}),b.jsx(O,{variant:"body-1",colorName:"tertiary",fontWeight:"medium",children:e})]}),h&&b.jsx(A,{children:b.jsx(Yn,{onClick:n,color:"neutral",children:b.jsx(Sr,{})})})]}));ca.displayName="ModalHeader";const Xm="_footer_1bo08_8",Zm={footer:Xm},ua=w.forwardRef(({children:t,row:e=!0,flex:n=!0,gap:s="var(--spacing-lg)",p:i="var(--spacing-2xl)",className:r,...o},a)=>b.jsx(A,{flex:n,row:e,gap:s,p:i,className:I(Zm.footer,r),ref:a,...o,children:t}));ua.displayName="ModalFooter";function It(t,e,n){let s=n.initialDeps??[],i;function r(){var o,a,l,u;let c;n.key&&((o=n.debug)!=null&&o.call(n))&&(c=Date.now());const h=t();if(!(h.length!==s.length||h.some((p,m)=>s[m]!==p)))return i;s=h;let f;if(n.key&&((a=n.debug)!=null&&a.call(n))&&(f=Date.now()),i=e(...h),n.key&&((l=n.debug)!=null&&l.call(n))){const p=Math.round((Date.now()-c)*100)/100,m=Math.round((Date.now()-f)*100)/100,v=m/16,y=(x,g)=>{for(x=String(x);x.length<g;)x=" "+x;return x};console.info(`%c⏱ ${y(m,5)} /${y(p,5)} ms`,`
13
+ `),()=>{v.contains(m)&&v.removeChild(m)}},[e]),b.jsx(_u,{isPresent:e,childRef:r,sizeRef:o,children:V.cloneElement(t,{ref:l})})}const Tu=({children:t,initial:e,isPresent:n,onExitComplete:s,custom:i,presenceAffectsLayout:r,mode:o,anchorX:a,root:l})=>{const u=Zn(Pu),c=w.useId();let h=!0,d=w.useMemo(()=>(h=!1,{id:c,initial:e,isPresent:n,custom:i,onExitComplete:f=>{u.set(f,!0);for(const p of u.values())if(!p)return;s&&s()},register:f=>(u.set(f,!1),()=>u.delete(f))}),[n,u,s]);return r&&h&&(d={...d}),w.useMemo(()=>{u.forEach((f,p)=>u.set(p,!1))},[n]),V.useEffect(()=>{!n&&!u.size&&s&&s()},[n]),o==="popLayout"&&(t=b.jsx(Su,{isPresent:n,anchorX:a,root:l,children:t})),b.jsx(Ye.Provider,{value:d,children:t})};function Pu(){return new Map}function vo(t=!0){const e=w.useContext(Ye);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:i}=e,r=w.useId();w.useEffect(()=>{if(t)return i(r)},[t]);const o=w.useCallback(()=>t&&s&&s(r),[r,s,t]);return!n&&s?[!1,o]:[!0]}const Me=t=>t.key||"";function hi(t){const e=[];return w.Children.forEach(t,n=>{w.isValidElement(n)&&e.push(n)}),e}const Mu=({children:t,custom:e,initial:n=!0,onExitComplete:s,presenceAffectsLayout:i=!0,mode:r="sync",propagate:o=!1,anchorX:a="left",root:l})=>{const[u,c]=vo(o),h=w.useMemo(()=>hi(t),[t]),d=o&&!u?[]:h.map(Me),f=w.useRef(!0),p=w.useRef(h),m=Zn(()=>new Map),[v,y]=w.useState(h),[x,g]=w.useState(h);Pr(()=>{f.current=!1,p.current=h;for(let P=0;P<x.length;P++){const _=Me(x[P]);d.includes(_)?m.delete(_):m.get(_)!==!0&&m.set(_,!1)}},[x,d.length,d.join("-")]);const C=[];if(h!==v){let P=[...h];for(let _=0;_<x.length;_++){const T=x[_],E=Me(T);d.includes(E)||(P.splice(_,0,T),C.push(T))}return r==="wait"&&C.length&&(P=C),g(hi(P)),y(h),null}process.env.NODE_ENV!=="production"&&r==="wait"&&x.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:S}=w.useContext(Xn);return b.jsx(b.Fragment,{children:x.map(P=>{const _=Me(P),T=o&&!u?!1:h===x||d.includes(_),E=()=>{if(m.has(_))m.set(_,!0);else return;let L=!0;m.forEach(Q=>{Q||(L=!1)}),L&&(S?.(),g(p.current),o&&c?.(),s&&s())};return b.jsx(Tu,{isPresent:T,initial:!f.current||n?void 0:!1,custom:e,presenceAffectsLayout:i,mode:r,root:l,onExitComplete:T?void 0:E,anchorX:a,children:P},_)})})},xo=w.createContext({strict:!1}),di={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},qt={};for(const t in di)qt[t]={isEnabled:e=>di[t].some(n=>!!e[n])};function Eu(t){for(const e in t)qt[e]={...qt[e],...t[e]}}const Au=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function $e(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Au.has(t)}let bo=t=>!$e(t);function Vu(t){typeof t=="function"&&(bo=e=>e.startsWith("on")?!$e(e):t(e))}try{Vu(require("@emotion/is-prop-valid").default)}catch{}function ku(t,e,n){const s={};for(const i in t)i==="values"&&typeof t.values=="object"||(bo(i)||n===!0&&$e(i)||!e&&!$e(i)||t.draggable&&i.startsWith("onDrag"))&&(s[i]=t[i]);return s}const Xe=w.createContext({});function Ze(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function pe(t){return typeof t=="string"||Array.isArray(t)}const ws=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Cs=["initial",...ws];function Je(t){return Ze(t.animate)||Cs.some(e=>pe(t[e]))}function wo(t){return!!(Je(t)||t.variants)}function Ru(t,e){if(Je(t)){const{initial:n,animate:s}=t;return{initial:n===!1||pe(n)?n:void 0,animate:pe(s)?s:void 0}}return t.inherit!==!1?e:{}}function Du(t){const{initial:e,animate:n}=Ru(t,w.useContext(Xe));return w.useMemo(()=>({initial:e,animate:n}),[fi(e),fi(n)])}function fi(t){return Array.isArray(t)?t.join(" "):t}const ge={};function ju(t){for(const e in t)ge[e]=t[e],os(e)&&(ge[e].isCSSVariable=!0)}function Co(t,{layout:e,layoutId:n}){return Qt.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!ge[t]||t==="opacity")}const Lu={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Ou=Jt.length;function Iu(t,e,n){let s="",i=!0;for(let r=0;r<Ou;r++){const o=Jt[r],a=t[o];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(o.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const u=ho(a,ys[o]);if(!l){i=!1;const c=Lu[o]||o;s+=`${c}(${u}) `}n&&(e[o]=u)}}return s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}function _s(t,e,n){const{style:s,vars:i,transformOrigin:r}=t;let o=!1,a=!1;for(const l in e){const u=e[l];if(Qt.has(l)){o=!0;continue}else if(os(l)){i[l]=u;continue}else{const c=ho(u,ys[l]);l.startsWith("origin")?(a=!0,r[l]=c):s[l]=c}}if(e.transform||(o||n?s.transform=Iu(e,t.transform,n):s.transform&&(s.transform="none")),a){const{originX:l="50%",originY:u="50%",originZ:c=0}=r;s.transformOrigin=`${l} ${u} ${c}`}}const Ss=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function _o(t,e,n){for(const s in e)!Z(e[s])&&!Co(s,n)&&(t[s]=e[s])}function Bu({transformTemplate:t},e){return w.useMemo(()=>{const n=Ss();return _s(n,e,t),Object.assign({},n.vars,n.style)},[e])}function Nu(t,e){const n=t.style||{},s={};return _o(s,n,t),Object.assign(s,Bu(t,e)),s}function Fu(t,e){const n={},s=Nu(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=s,n}const zu={offset:"stroke-dashoffset",array:"stroke-dasharray"},$u={offset:"strokeDashoffset",array:"strokeDasharray"};function Wu(t,e,n=1,s=0,i=!0){t.pathLength=1;const r=i?zu:$u;t[r.offset]=M.transform(-s);const o=M.transform(e),a=M.transform(n);t[r.array]=`${o} ${a}`}function So(t,{attrX:e,attrY:n,attrScale:s,pathLength:i,pathSpacing:r=1,pathOffset:o=0,...a},l,u,c){if(_s(t,a,u),l){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:h,style:d}=t;h.transform&&(d.transform=h.transform,delete h.transform),(d.transform||h.transformOrigin)&&(d.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),d.transform&&(d.transformBox=c?.transformBox??"fill-box",delete h.transformBox),e!==void 0&&(h.x=e),n!==void 0&&(h.y=n),s!==void 0&&(h.scale=s),i!==void 0&&Wu(h,i,r,o,!1)}const To=()=>({...Ss(),attrs:{}}),Po=t=>typeof t=="string"&&t.toLowerCase()==="svg";function Uu(t,e,n,s){const i=w.useMemo(()=>{const r=To();return So(r,e,Po(s),t.transformTemplate,t.style),{...r.attrs,style:{...r.style}}},[e]);if(t.style){const r={};_o(r,t.style,t),i.style={...r,...i.style}}return i}const Ku=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Ts(t){return typeof t!="string"||t.includes("-")?!1:!!(Ku.indexOf(t)>-1||/[A-Z]/u.test(t))}function Hu(t,e,n,{latestValues:s},i,r=!1){const a=(Ts(t)?Uu:Fu)(e,s,i,t),l=ku(e,typeof t=="string",r),u=t!==w.Fragment?{...l,...a,ref:n}:{},{children:c}=e,h=w.useMemo(()=>Z(c)?c.get():c,[c]);return w.createElement(t,{...u,children:h})}function mi(t){const e=[{},{}];return t?.values.forEach((n,s)=>{e[0][s]=n.get(),e[1][s]=n.getVelocity()}),e}function Ps(t,e,n,s){if(typeof e=="function"){const[i,r]=mi(s);e=e(n!==void 0?n:t.custom,i,r)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,r]=mi(s);e=e(n!==void 0?n:t.custom,i,r)}return e}function Le(t){return Z(t)?t.get():t}function Gu({scrapeMotionValuesFromProps:t,createRenderState:e},n,s,i){return{latestValues:qu(n,s,i,t),renderState:e()}}function qu(t,e,n,s){const i={},r=s(t,{});for(const d in r)i[d]=Le(r[d]);let{initial:o,animate:a}=t;const l=Je(t),u=wo(t);e&&u&&!l&&t.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let c=n?n.initial===!1:!1;c=c||o===!1;const h=c?a:o;if(h&&typeof h!="boolean"&&!Ze(h)){const d=Array.isArray(h)?h:[h];for(let f=0;f<d.length;f++){const p=Ps(t,d[f]);if(p){const{transitionEnd:m,transition:v,...y}=p;for(const x in y){let g=y[x];if(Array.isArray(g)){const C=c?g.length-1:0;g=g[C]}g!==null&&(i[x]=g)}for(const x in m)i[x]=m[x]}}}return i}const Mo=t=>(e,n)=>{const s=w.useContext(Xe),i=w.useContext(Ye),r=()=>Gu(t,e,s,i);return n?r():Zn(r)};function Ms(t,e,n){const{style:s}=t,i={};for(const r in s)(Z(s[r])||e.style&&Z(e.style[r])||Co(r,t)||n?.getValue(r)?.liveStyle!==void 0)&&(i[r]=s[r]);return i}const Yu=Mo({scrapeMotionValuesFromProps:Ms,createRenderState:Ss});function Eo(t,e,n){const s=Ms(t,e,n);for(const i in t)if(Z(t[i])||Z(e[i])){const r=Jt.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[r]=t[i]}return s}const Xu=Mo({scrapeMotionValuesFromProps:Eo,createRenderState:To}),Zu=Symbol.for("motionComponentSymbol");function Ft(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Ju(t,e,n){return w.useCallback(s=>{s&&t.onMount&&t.onMount(s),e&&(s?e.mount(s):e.unmount()),n&&(typeof n=="function"?n(s):Ft(n)&&(n.current=s))},[e])}const Es=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Qu="framerAppearId",Ao="data-"+Es(Qu),Vo=w.createContext({});function th(t,e,n,s,i){const{visualElement:r}=w.useContext(Xe),o=w.useContext(xo),a=w.useContext(Ye),l=w.useContext(bs).reducedMotion,u=w.useRef(null);s=s||o.renderer,!u.current&&s&&(u.current=s(t,{visualState:e,parent:r,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));const c=u.current,h=w.useContext(Vo);c&&!c.projection&&i&&(c.type==="html"||c.type==="svg")&&eh(u.current,n,i,h);const d=w.useRef(!1);w.useInsertionEffect(()=>{c&&d.current&&c.update(n,a)});const f=n[Ao],p=w.useRef(!!f&&!window.MotionHandoffIsComplete?.(f)&&window.MotionHasOptimisedAnimation?.(f));return Pr(()=>{c&&(d.current=!0,window.MotionIsMounted=!0,c.updateFeatures(),c.scheduleRenderMicrotask(),p.current&&c.animationState&&c.animationState.animateChanges())}),w.useEffect(()=>{c&&(!p.current&&c.animationState&&c.animationState.animateChanges(),p.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(f)}),p.current=!1),c.enteringChildren=void 0)}),c}function eh(t,e,n,s){const{layoutId:i,layout:r,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:u,layoutCrossfade:c}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:ko(t.parent)),t.projection.setOptions({layoutId:i,layout:r,alwaysMeasureLayout:!!o||a&&Ft(a),visualElement:t,animationType:typeof r=="string"?r:"both",initialPromotionConfig:s,crossfade:c,layoutScroll:l,layoutRoot:u})}function ko(t){if(t)return t.options.allowProjection!==!1?t.projection:ko(t.parent)}function dn(t,{forwardMotionProps:e=!1}={},n,s){n&&Eu(n);const i=Ts(t)?Xu:Yu;function r(a,l){let u;const c={...w.useContext(bs),...a,layoutId:nh(a)},{isStatic:h}=c,d=Du(a),f=i(a,h);if(!h&&Jn){sh(c,n);const p=ih(c);u=p.MeasureLayout,d.visualElement=th(t,f,c,s,p.ProjectionNode)}return b.jsxs(Xe.Provider,{value:d,children:[u&&d.visualElement?b.jsx(u,{visualElement:d.visualElement,...c}):null,Hu(t,a,Ju(f,d.visualElement,l),f,h,e)]})}r.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const o=w.forwardRef(r);return o[Zu]=t,o}function nh({layoutId:t}){const e=w.useContext(Xn).id;return e&&t!==void 0?e+"-"+t:t}function sh(t,e){const n=w.useContext(xo).strict;if(process.env.NODE_ENV!=="production"&&e&&n){const s="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";t.ignoreStrict?Xt(!1,s,"lazy-strict-mode"):gt(!1,s,"lazy-strict-mode")}}function ih(t){const{drag:e,layout:n}=qt;if(!e&&!n)return{};const s={...e,...n};return{MeasureLayout:e?.isEnabled(t)||n?.isEnabled(t)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function rh(t,e){if(typeof Proxy>"u")return dn;const n=new Map,s=(r,o)=>dn(r,o,t,e),i=(r,o)=>(process.env.NODE_ENV!=="production"&&ss(!1,"motion() is deprecated. Use motion.create() instead."),s(r,o));return new Proxy(i,{get:(r,o)=>o==="create"?s:(n.has(o)||n.set(o,dn(o,void 0,t,e)),n.get(o))})}function Ro({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function oh({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function ah(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function fn(t){return t===void 0||t===1}function Bn({scale:t,scaleX:e,scaleY:n}){return!fn(t)||!fn(e)||!fn(n)}function Et(t){return Bn(t)||Do(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Do(t){return pi(t.x)||pi(t.y)}function pi(t){return t&&t!=="0%"}function We(t,e,n){const s=t-n,i=e*s;return n+i}function gi(t,e,n,s,i){return i!==void 0&&(t=We(t,i,s)),We(t,n,s)+e}function Nn(t,e=0,n=1,s,i){t.min=gi(t.min,e,n,s,i),t.max=gi(t.max,e,n,s,i)}function jo(t,{x:e,y:n}){Nn(t.x,e.translate,e.scale,e.originPoint),Nn(t.y,n.translate,n.scale,n.originPoint)}const yi=.999999999999,vi=1.0000000000001;function lh(t,e,n,s=!1){const i=n.length;if(!i)return;e.x=e.y=1;let r,o;for(let a=0;a<i;a++){r=n[a],o=r.projectionDelta;const{visualElement:l}=r.options;l&&l.props.style&&l.props.style.display==="contents"||(s&&r.options.layoutScroll&&r.scroll&&r!==r.root&&$t(t,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),o&&(e.x*=o.x.scale,e.y*=o.y.scale,jo(t,o)),s&&Et(r.latestValues)&&$t(t,r.latestValues))}e.x<vi&&e.x>yi&&(e.x=1),e.y<vi&&e.y>yi&&(e.y=1)}function zt(t,e){t.min=t.min+e,t.max=t.max+e}function xi(t,e,n,s,i=.5){const r=F(t.min,t.max,i);Nn(t,e,n,r,s)}function $t(t,e){xi(t.x,e.x,e.scaleX,e.scale,e.originX),xi(t.y,e.y,e.scaleY,e.scale,e.originY)}function Lo(t,e){return Ro(ah(t.getBoundingClientRect(),e))}function ch(t,e,n){const s=Lo(t,n),{scroll:i}=e;return i&&(zt(s.x,i.offset.x),zt(s.y,i.offset.y)),s}const bi=()=>({translate:0,scale:1,origin:0,originPoint:0}),Wt=()=>({x:bi(),y:bi()}),wi=()=>({min:0,max:0}),W=()=>({x:wi(),y:wi()}),Fn={current:null},Oo={current:!1};function uh(){if(Oo.current=!0,!!Jn)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Fn.current=t.matches;t.addEventListener("change",e),e()}else Fn.current=!1}const hh=new WeakMap;function dh(t,e,n){for(const s in e){const i=e[s],r=n[s];if(Z(i))t.addValue(s,i);else if(Z(r))t.addValue(s,Gt(i,{owner:t}));else if(r!==i)if(t.hasValue(s)){const o=t.getValue(s);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=t.getStaticValue(s);t.addValue(s,Gt(o!==void 0?o:i,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const Ci=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class fh{scrapeMotionValuesFromProps(e,n,s){return{}}constructor({parent:e,props:n,presenceContext:s,reducedMotionConfig:i,blockInitialAnimation:r,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=ps,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const d=tt.now();this.renderScheduledAt<d&&(this.renderScheduledAt=d,B.render(this.render,!1,!0))};const{latestValues:l,renderState:u}=o;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=u,this.parent=e,this.props=n,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!r,this.isControllingVariants=Je(n),this.isVariantNode=wo(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:c,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const d in h){const f=h[d];l[d]!==void 0&&Z(f)&&f.set(l[d])}}mount(e){this.current=e,hh.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,s)=>this.bindToMotionValue(s,n)),Oo.current||uh(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Fn.current,process.env.NODE_ENV!=="production"&&ss(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),wt(this.notifyUpdate),wt(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const s=Qt.has(e);s&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&B.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let r;window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),r&&r(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in qt){const n=qt[e];if(!n)continue;const{isEnabled:s,Feature:i}=n;if(!this.features[e]&&i&&s(this.props)&&(this.features[e]=new i(this)),this.features[e]){const r=this.features[e];r.isMounted?r.update():(r.mount(),r.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):W()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<Ci.length;s++){const i=Ci[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const r="on"+i,o=e[r];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=dh(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const s=this.values.get(e);n!==s&&(s&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let s=this.values.get(e);return s===void 0&&n!==void 0&&(s=Gt(n===null?void 0:n,{owner:this}),this.addValue(e,s)),s}readValue(e,n){let s=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return s!=null&&(typeof s=="string"&&(Mr(s)||Ar(s))?s=parseFloat(s):!bu(s)&&Ct.test(n)&&(s=uo(e,n)),this.setBaseTarget(e,Z(s)?s.get():s)),Z(s)?s.get():s}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const r=Ps(this.props,n,this.presenceContext?.custom);r&&(s=r[e])}if(n&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!Z(i)?i:this.initialValues[e]!==void 0&&s===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new ns),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){vs.render(this.render)}}class Io extends fh{constructor(){super(...arguments),this.KeyframeResolver=lu}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:s}){delete n[e],delete s[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Z(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Bo(t,{style:e,vars:n},s,i){const r=t.style;let o;for(o in e)r[o]=e[o];i?.applyProjectionStyles(r,s);for(o in n)r.setProperty(o,n[o])}function mh(t){return window.getComputedStyle(t)}class ph extends Io{constructor(){super(...arguments),this.type="html",this.renderInstance=Bo}readValueFromInstance(e,n){if(Qt.has(n))return this.projection?.isProjecting?kn(n):Pc(e,n);{const s=mh(e),i=(os(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return Lo(e,n)}build(e,n,s){_s(e,n,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return Ms(e,n,s)}}const No=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function gh(t,e,n,s){Bo(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(No.has(i)?i:Es(i),e.attrs[i])}class yh extends Io{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=W}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Qt.has(n)){const s=co(n);return s&&s.default||0}return n=No.has(n)?n:Es(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,s){return Eo(e,n,s)}build(e,n,s){So(e,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(e,n,s,i){gh(e,n,s,i)}mount(e){this.isSVGTag=Po(e.tagName),super.mount(e)}}const vh=(t,e)=>Ts(t)?new yh(e):new ph(e,{allowProjection:t!==w.Fragment});function Kt(t,e,n){const s=t.getProps();return Ps(s,e,n!==void 0?n:s.custom,t)}const zn=t=>Array.isArray(t);function xh(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Gt(n))}function bh(t){return zn(t)?t[t.length-1]||0:t}function wh(t,e){const n=Kt(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const o in r){const a=bh(r[o]);xh(t,o,a)}}function Ch(t){return!!(Z(t)&&t.add)}function $n(t,e){const n=t.getValue("willChange");if(Ch(n))return n.add(e);if(!n&&yt.WillChange){const s=new yt.WillChange("auto");t.addValue("willChange",s),s.add(e)}}function Fo(t){return t.props[Ao]}const _h=t=>t!==null;function Sh(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(_h),r=e&&n!=="loop"&&e%2===1?0:i.length-1;return i[r]}const Th={type:"spring",stiffness:500,damping:25,restSpeed:10},Ph=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),Mh={type:"keyframes",duration:.8},Eh={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Ah=(t,{keyframes:e})=>e.length>2?Mh:Qt.has(t)?t.startsWith("scale")?Ph(e[1]):Th:Eh;function Vh({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:r,repeatType:o,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length}const As=(t,e,n,s={},i,r)=>o=>{const a=gs(s,t)||{},l=a.delay||s.delay||0;let{elapsed:u=0}=s;u=u-ht(l);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:d=>{e.set(d),a.onUpdate&&a.onUpdate(d)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:r?void 0:i};Vh(a)||Object.assign(c,Ah(t,c)),c.duration&&(c.duration=ht(c.duration)),c.repeatDelay&&(c.repeatDelay=ht(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let h=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(On(c),c.delay===0&&(h=!0)),(yt.instantAnimations||yt.skipAnimations)&&(h=!0,On(c),c.delay=0),c.allowFlatten=!a.type&&!a.ease,h&&!r&&e.get()!==void 0){const d=Sh(c.keyframes,a);if(d!==void 0){B.update(()=>{c.onUpdate(d),c.onComplete()});return}}return a.isSync?new ms(c):new Yc(c)};function kh({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function zo(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:r=t.getDefaultTransition(),transitionEnd:o,...a}=e;s&&(r=s);const l=[],u=i&&t.animationState&&t.animationState.getState()[i];for(const c in a){const h=t.getValue(c,t.latestValues[c]??null),d=a[c];if(d===void 0||u&&kh(u,c))continue;const f={delay:n,...gs(r||{},c)},p=h.get();if(p!==void 0&&!h.isAnimating&&!Array.isArray(d)&&d===p&&!f.velocity)continue;let m=!1;if(window.MotionHandoffAnimation){const y=Fo(t);if(y){const x=window.MotionHandoffAnimation(y,c,B);x!==null&&(f.startTime=x,m=!0)}}$n(t,c),h.start(As(c,h,d,t.shouldReduceMotion&&oo.has(c)?{type:!1}:f,t,m));const v=h.animation;v&&l.push(v)}return o&&Promise.all(l).then(()=>{B.update(()=>{o&&wh(t,o)})}),l}function $o(t,e,n,s=0,i=1){const r=Array.from(t).sort((u,c)=>u.sortNodePosition(c)).indexOf(e),o=t.size,a=(o-1)*s;return typeof n=="function"?n(r,o):i===1?r*s:a-r*s}function Wn(t,e,n={}){const s=Kt(t,e,n.type==="exit"?t.presenceContext?.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const r=s?()=>Promise.all(zo(t,s,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(l=0)=>{const{delayChildren:u=0,staggerChildren:c,staggerDirection:h}=i;return Rh(t,e,l,u,c,h,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[l,u]=a==="beforeChildren"?[r,o]:[o,r];return l().then(()=>u())}else return Promise.all([r(),o(n.delay)])}function Rh(t,e,n=0,s=0,i=0,r=1,o){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(Wn(l,e,{...o,delay:n+(typeof s=="function"?0:s)+$o(t.variantChildren,l,s,i,r)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}function Dh(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(r=>Wn(t,r,n));s=Promise.all(i)}else if(typeof e=="string")s=Wn(t,e,n);else{const i=typeof e=="function"?Kt(t,e,n.custom):e;s=Promise.all(zo(t,i,n))}return s.then(()=>{t.notify("AnimationComplete",e)})}function Wo(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}const jh=Cs.length;function Uo(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?Uo(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<jh;n++){const s=Cs[n],i=t.props[s];(pe(i)||i===!1)&&(e[s]=i)}return e}const Lh=[...ws].reverse(),Oh=ws.length;function Ih(t){return e=>Promise.all(e.map(({animation:n,options:s})=>Dh(t,n,s)))}function Bh(t){let e=Ih(t),n=_i(),s=!0;const i=l=>(u,c)=>{const h=Kt(t,c,l==="exit"?t.presenceContext?.custom:void 0);if(h){const{transition:d,transitionEnd:f,...p}=h;u={...u,...p,...f}}return u};function r(l){e=l(t)}function o(l){const{props:u}=t,c=Uo(t.parent)||{},h=[],d=new Set;let f={},p=1/0;for(let v=0;v<Oh;v++){const y=Lh[v],x=n[y],g=u[y]!==void 0?u[y]:c[y],C=pe(g),S=y===l?x.isActive:null;S===!1&&(p=v);let P=g===c[y]&&g!==u[y]&&C;if(P&&s&&t.manuallyAnimateOnMount&&(P=!1),x.protectedKeys={...f},!x.isActive&&S===null||!g&&!x.prevProp||Ze(g)||typeof g=="boolean")continue;const _=Nh(x.prevProp,g);let T=_||y===l&&x.isActive&&!P&&C||v>p&&C,E=!1;const L=Array.isArray(g)?g:[g];let Q=L.reduce(i(y),{});S===!1&&(Q={});const{prevResolvedValues:St={}}=x,Tt={...St,...Q},vt=z=>{T=!0,d.has(z)&&(E=!0,d.delete(z)),x.needsAnimating[z]=!0;const k=t.getValue(z);k&&(k.liveStyle=!1)};for(const z in Tt){const k=Q[z],j=St[z];if(f.hasOwnProperty(z))continue;let $=!1;zn(k)&&zn(j)?$=!Wo(k,j):$=k!==j,$?k!=null?vt(z):d.add(z):k!==void 0&&d.has(z)?vt(z):x.protectedKeys[z]=!0}x.prevProp=g,x.prevResolvedValues=Q,x.isActive&&(f={...f,...Q}),s&&t.blockInitialAnimation&&(T=!1);const jt=P&&_;T&&(!jt||E)&&h.push(...L.map(z=>{const k={type:y};if(typeof z=="string"&&s&&!jt&&t.manuallyAnimateOnMount&&t.parent){const{parent:j}=t,$=Kt(j,z);if(j.enteringChildren&&$){const{delayChildren:Ot}=$.transition||{};k.delay=$o(j.enteringChildren,t,Ot)}}return{animation:z,options:k}}))}if(d.size){const v={};if(typeof u.initial!="boolean"){const y=Kt(t,Array.isArray(u.initial)?u.initial[0]:u.initial);y&&y.transition&&(v.transition=y.transition)}d.forEach(y=>{const x=t.getBaseTarget(y),g=t.getValue(y);g&&(g.liveStyle=!0),v[y]=x??null}),h.push({animation:v})}let m=!!h.length;return s&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(m=!1),s=!1,m?e(h):Promise.resolve()}function a(l,u){if(n[l].isActive===u)return Promise.resolve();t.variantChildren?.forEach(h=>h.animationState?.setActive(l,u)),n[l].isActive=u;const c=o(l);for(const h in n)n[h].protectedKeys={};return c}return{animateChanges:o,setActive:a,setAnimateFunction:r,getState:()=>n,reset:()=>{n=_i(),s=!0}}}function Nh(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!Wo(e,t):!1}function Pt(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function _i(){return{animate:Pt(!0),whileInView:Pt(),whileHover:Pt(),whileTap:Pt(),whileDrag:Pt(),whileFocus:Pt(),exit:Pt()}}class _t{constructor(e){this.isMounted=!1,this.node=e}update(){}}class Fh extends _t{constructor(e){super(e),e.animationState||(e.animationState=Bh(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Ze(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let zh=0;class $h extends _t{constructor(){super(...arguments),this.id=zh++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===s)return;const i=this.node.animationState.setActive("exit",!e);n&&!e&&i.then(()=>{n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const Wh={animation:{Feature:Fh},exit:{Feature:$h}};function ye(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}function _e(t){return{point:{x:t.pageX,y:t.pageY}}}const Uh=t=>e=>xs(e)&&t(e,_e(e));function oe(t,e,n,s){return ye(t,e,Uh(n),s)}const Ko=1e-4,Kh=1-Ko,Hh=1+Ko,Ho=.01,Gh=0-Ho,qh=0+Ho;function J(t){return t.max-t.min}function Yh(t,e,n){return Math.abs(t-e)<=n}function Si(t,e,n,s=.5){t.origin=s,t.originPoint=F(e.min,e.max,t.origin),t.scale=J(n)/J(e),t.translate=F(n.min,n.max,t.origin)-t.originPoint,(t.scale>=Kh&&t.scale<=Hh||isNaN(t.scale))&&(t.scale=1),(t.translate>=Gh&&t.translate<=qh||isNaN(t.translate))&&(t.translate=0)}function ae(t,e,n,s){Si(t.x,e.x,n.x,s?s.originX:void 0),Si(t.y,e.y,n.y,s?s.originY:void 0)}function Ti(t,e,n){t.min=n.min+e.min,t.max=t.min+J(e)}function Xh(t,e,n){Ti(t.x,e.x,n.x),Ti(t.y,e.y,n.y)}function Pi(t,e,n){t.min=e.min-n.min,t.max=t.min+J(e)}function le(t,e,n){Pi(t.x,e.x,n.x),Pi(t.y,e.y,n.y)}function rt(t){return[t("x"),t("y")]}const Go=({current:t})=>t?t.ownerDocument.defaultView:null,Mi=(t,e)=>Math.abs(t-e);function Zh(t,e){const n=Mi(t.x,e.x),s=Mi(t.y,e.y);return Math.sqrt(n**2+s**2)}class qo{constructor(e,n,{transformPagePoint:s,contextWindow:i=window,dragSnapToOrigin:r=!1,distanceThreshold:o=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=pn(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,p=Zh(d.offset,{x:0,y:0})>=this.distanceThreshold;if(!f&&!p)return;const{point:m}=d,{timestamp:v}=G;this.history.push({...m,timestamp:v});const{onStart:y,onMove:x}=this.handlers;f||(y&&y(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),x&&x(this.lastMoveEvent,d)},this.handlePointerMove=(d,f)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=mn(f,this.transformPagePoint),B.update(this.updatePoint,!0)},this.handlePointerUp=(d,f)=>{this.end();const{onEnd:p,onSessionEnd:m,resumeAnimation:v}=this.handlers;if(this.dragSnapToOrigin&&v&&v(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=pn(d.type==="pointercancel"?this.lastMoveEventInfo:mn(f,this.transformPagePoint),this.history);this.startEvent&&p&&p(d,y),m&&m(d,y)},!xs(e))return;this.dragSnapToOrigin=r,this.handlers=n,this.transformPagePoint=s,this.distanceThreshold=o,this.contextWindow=i||window;const a=_e(e),l=mn(a,this.transformPagePoint),{point:u}=l,{timestamp:c}=G;this.history=[{...u,timestamp:c}];const{onSessionStart:h}=n;h&&h(e,pn(l,this.history)),this.removeListeners=be(oe(this.contextWindow,"pointermove",this.handlePointerMove),oe(this.contextWindow,"pointerup",this.handlePointerUp),oe(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),wt(this.updatePoint)}}function mn(t,e){return e?{point:e(t.point)}:t}function Ei(t,e){return{x:t.x-e.x,y:t.y-e.y}}function pn({point:t},e){return{point:t,delta:Ei(t,Yo(e)),offset:Ei(t,Jh(e)),velocity:Qh(e,.1)}}function Jh(t){return t[0]}function Yo(t){return t[t.length-1]}function Qh(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const i=Yo(t);for(;n>=0&&(s=t[n],!(i.timestamp-s.timestamp>ht(e)));)n--;if(!s)return{x:0,y:0};const r=ot(i.timestamp-s.timestamp);if(r===0)return{x:0,y:0};const o={x:(i.x-s.x)/r,y:(i.y-s.y)/r};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function td(t,{min:e,max:n},s){return e!==void 0&&t<e?t=s?F(e,t,s.min):Math.max(t,e):n!==void 0&&t>n&&(t=s?F(n,t,s.max):Math.min(t,n)),t}function Ai(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function ed(t,{top:e,left:n,bottom:s,right:i}){return{x:Ai(t.x,n,i),y:Ai(t.y,e,s)}}function Vi(t,e){let n=e.min-t.min,s=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,s]=[s,n]),{min:n,max:s}}function nd(t,e){return{x:Vi(t.x,e.x),y:Vi(t.y,e.y)}}function sd(t,e){let n=.5;const s=J(t),i=J(e);return i>s?n=de(e.min,e.max-s,t.min):s>i&&(n=de(t.min,t.max-i,e.min)),pt(0,1,n)}function id(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const Un=.35;function rd(t=Un){return t===!1?t=0:t===!0&&(t=Un),{x:ki(t,"left","right"),y:ki(t,"top","bottom")}}function ki(t,e,n){return{min:Ri(t,e),max:Ri(t,n)}}function Ri(t,e){return typeof t=="number"?t:t[e]||0}const od=new WeakMap;class ad{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=W(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:s}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const r=h=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(_e(h).point)},o=(h,d)=>{const{drag:f,dragPropagation:p,onDragStart:m}=this.getProps();if(f&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=du(f),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=d,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),rt(y=>{let x=this.getAxisMotionValue(y).get()||0;if(mt.test(x)){const{projection:g}=this.visualElement;if(g&&g.layout){const C=g.layout.layoutBox[y];C&&(x=J(C)*(parseFloat(x)/100))}}this.originPoint[y]=x}),m&&B.postRender(()=>m(h,d)),$n(this.visualElement,"transform");const{animationState:v}=this.visualElement;v&&v.setActive("whileDrag",!0)},a=(h,d)=>{this.latestPointerEvent=h,this.latestPanInfo=d;const{dragPropagation:f,dragDirectionLock:p,onDirectionLock:m,onDrag:v}=this.getProps();if(!f&&!this.openDragLock)return;const{offset:y}=d;if(p&&this.currentDirection===null){this.currentDirection=ld(y),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",d.point,y),this.updateAxis("y",d.point,y),this.visualElement.render(),v&&v(h,d)},l=(h,d)=>{this.latestPointerEvent=h,this.latestPanInfo=d,this.stop(h,d),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>rt(h=>this.getAnimationState(h)==="paused"&&this.getAxisMotionValue(h).animation?.play()),{dragSnapToOrigin:c}=this.getProps();this.panSession=new qo(e,{onSessionStart:r,onStart:o,onMove:a,onSessionEnd:l,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,distanceThreshold:s,contextWindow:Go(this.visualElement)})}stop(e,n){const s=e||this.latestPointerEvent,i=n||this.latestPanInfo,r=this.isDragging;if(this.cancel(),!r||!i||!s)return;const{velocity:o}=i;this.startAnimation(o);const{onDragEnd:a}=this.getProps();a&&B.postRender(()=>a(s,i))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(e,n,s){const{drag:i}=this.getProps();if(!s||!Ee(e,i,this.currentDirection))return;const r=this.getAxisMotionValue(e);let o=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(o=td(o,this.constraints[e],this.elastic[e])),r.set(o)}resolveConstraints(){const{dragConstraints:e,dragElastic:n}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;e&&Ft(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&s?this.constraints=ed(s.layoutBox,e):this.constraints=!1,this.elastic=rd(n),i!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&rt(r=>{this.constraints!==!1&&this.getAxisMotionValue(r)&&(this.constraints[r]=id(s.layoutBox[r],this.constraints[r]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!Ft(e))return!1;const s=e.current;gt(s!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const r=ch(s,i.root,this.visualElement.getTransformPagePoint());let o=nd(i.layout.layoutBox,r);if(n){const a=n(oh(o));this.hasMutatedConstraints=!!a,a&&(o=Ro(a))}return o}startAnimation(e){const{drag:n,dragMomentum:s,dragElastic:i,dragTransition:r,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=rt(c=>{if(!Ee(c,n,this.currentDirection))return;let h=l&&l[c]||{};o&&(h={min:0,max:0});const d=i?200:1e6,f=i?40:1e7,p={type:"inertia",velocity:s?e[c]:0,bounceStiffness:d,bounceDamping:f,timeConstant:750,restDelta:1,restSpeed:10,...r,...h};return this.startAxisValueAnimation(c,p)});return Promise.all(u).then(a)}startAxisValueAnimation(e,n){const s=this.getAxisMotionValue(e);return $n(this.visualElement,e),s.start(As(e,s,0,n,this.visualElement,!1))}stopAnimation(){rt(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){rt(e=>this.getAxisMotionValue(e).animation?.pause())}getAnimationState(e){return this.getAxisMotionValue(e).animation?.state}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,s=this.visualElement.getProps(),i=s[n];return i||this.visualElement.getValue(e,(s.initial?s.initial[e]:void 0)||0)}snapToCursor(e){rt(n=>{const{drag:s}=this.getProps();if(!Ee(n,s,this.currentDirection))return;const{projection:i}=this.visualElement,r=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[n];r.set(e[n]-F(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!Ft(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};rt(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();i[o]=sd({min:l,max:l},this.constraints[o])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.resolveConstraints(),rt(o=>{if(!Ee(o,e,null))return;const a=this.getAxisMotionValue(o),{min:l,max:u}=this.constraints[o];a.set(F(l,u,i[o]))})}addListeners(){if(!this.visualElement.current)return;od.set(this.visualElement,this);const e=this.visualElement.current,n=oe(e,"pointerdown",l=>{const{drag:u,dragListener:c=!0}=this.getProps();u&&c&&this.start(l)}),s=()=>{const{dragConstraints:l}=this.getProps();Ft(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,r=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),B.read(s);const o=ye(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(rt(c=>{const h=this.getAxisMotionValue(c);h&&(this.originPoint[c]+=l[c].translate,h.set(h.get()+l[c].translate))}),this.visualElement.render())}));return()=>{o(),n(),r(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:i=!1,dragConstraints:r=!1,dragElastic:o=Un,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:s,dragPropagation:i,dragConstraints:r,dragElastic:o,dragMomentum:a}}}function Ee(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function ld(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class cd extends _t{constructor(e){super(e),this.removeGroupControls=at,this.removeListeners=at,this.controls=new ad(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||at}unmount(){this.removeGroupControls(),this.removeListeners()}}const Di=t=>(e,n)=>{t&&B.postRender(()=>t(e,n))};class ud extends _t{constructor(){super(...arguments),this.removePointerDownListener=at}onPointerDown(e){this.session=new qo(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Go(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:Di(e),onStart:Di(n),onMove:s,onEnd:(r,o)=>{delete this.session,i&&B.postRender(()=>i(r,o))}}}mount(){this.removePointerDownListener=oe(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Oe={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function ji(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const ne={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(M.test(t))t=parseFloat(t);else return t;const n=ji(t,e.target.x),s=ji(t,e.target.y);return`${n}% ${s}%`}},hd={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=Ct.parse(t);if(i.length>5)return s;const r=Ct.createTransformer(t),o=typeof i[0]!="number"?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;i[0+o]/=a,i[1+o]/=l;const u=F(a,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=u),typeof i[3+o]=="number"&&(i[3+o]/=u),r(i)}};let gn=!1;class dd extends w.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s,layoutId:i}=this.props,{projection:r}=e;ju(fd),r&&(n.group&&n.group.add(r),s&&s.register&&i&&s.register(r),gn&&r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,onExitComplete:()=>this.safeToRemove()})),Oe.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:s,drag:i,isPresent:r}=this.props,{projection:o}=s;return o&&(o.isPresent=r,gn=!0,i||e.layoutDependency!==n||n===void 0||e.isPresent!==r?o.willUpdate():this.safeToRemove(),e.isPresent!==r&&(r?o.promote():o.relegate()||B.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),vs.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:i}=e;gn=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),s&&s.deregister&&s.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function Xo(t){const[e,n]=vo(),s=w.useContext(Xn);return b.jsx(dd,{...t,layoutGroup:s,switchLayoutGroup:w.useContext(Vo),isPresent:e,safeToRemove:n})}const fd={borderRadius:{...ne,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:ne,borderTopRightRadius:ne,borderBottomLeftRadius:ne,borderBottomRightRadius:ne,boxShadow:hd};function md(t,e,n){const s=Z(t)?t:Gt(t);return s.start(As("",s,e,n)),s.animation}const pd=(t,e)=>t.depth-e.depth;class gd{constructor(){this.children=[],this.isDirty=!1}add(e){Qn(this.children,e),this.isDirty=!0}remove(e){ts(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(pd),this.isDirty=!1,this.children.forEach(e)}}function yd(t,e){const n=tt.now(),s=({timestamp:i})=>{const r=i-n;r>=e&&(wt(s),t(r-e))};return B.setup(s,!0),()=>wt(s)}const Zo=["TopLeft","TopRight","BottomLeft","BottomRight"],vd=Zo.length,Li=t=>typeof t=="string"?parseFloat(t):t,Oi=t=>typeof t=="number"||M.test(t);function xd(t,e,n,s,i,r){i?(t.opacity=F(0,n.opacity??1,bd(s)),t.opacityExit=F(e.opacity??1,0,wd(s))):r&&(t.opacity=F(e.opacity??1,n.opacity??1,s));for(let o=0;o<vd;o++){const a=`border${Zo[o]}Radius`;let l=Ii(e,a),u=Ii(n,a);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||Oi(l)===Oi(u)?(t[a]=Math.max(F(Li(l),Li(u),s),0),(mt.test(u)||mt.test(l))&&(t[a]+="%")):t[a]=u}(e.rotate||n.rotate)&&(t.rotate=F(e.rotate||0,n.rotate||0,s))}function Ii(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const bd=Jo(0,.5,Ir),wd=Jo(.5,.95,at);function Jo(t,e,n){return s=>s<t?0:s>e?1:n(de(t,e,s))}function Bi(t,e){t.min=e.min,t.max=e.max}function st(t,e){Bi(t.x,e.x),Bi(t.y,e.y)}function Ni(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function Fi(t,e,n,s,i){return t-=e,t=We(t,1/n,s),i!==void 0&&(t=We(t,1/i,s)),t}function Cd(t,e=0,n=1,s=.5,i,r=t,o=t){if(mt.test(e)&&(e=parseFloat(e),e=F(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=F(r.min,r.max,s);t===r&&(a-=e),t.min=Fi(t.min,e,n,a,i),t.max=Fi(t.max,e,n,a,i)}function zi(t,e,[n,s,i],r,o){Cd(t,e[n],e[s],e[i],e.scale,r,o)}const _d=["x","scaleX","originX"],Sd=["y","scaleY","originY"];function $i(t,e,n,s){zi(t.x,e,_d,n?n.x:void 0,s?s.x:void 0),zi(t.y,e,Sd,n?n.y:void 0,s?s.y:void 0)}function Wi(t){return t.translate===0&&t.scale===1}function Qo(t){return Wi(t.x)&&Wi(t.y)}function Ui(t,e){return t.min===e.min&&t.max===e.max}function Td(t,e){return Ui(t.x,e.x)&&Ui(t.y,e.y)}function Ki(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function ta(t,e){return Ki(t.x,e.x)&&Ki(t.y,e.y)}function Hi(t){return J(t.x)/J(t.y)}function Gi(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class Pd{constructor(){this.members=[]}add(e){Qn(this.members,e),e.scheduleRender()}remove(e){if(ts(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(i=>e===i);if(n===0)return!1;let s;for(let i=n;i>=0;i--){const r=this.members[i];if(r.isPresent!==!1){s=r;break}}return s?(this.promote(s),!0):!1}promote(e,n){const s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.instance&&s.scheduleRender(),e.scheduleRender(),e.resumeFrom=s,n&&(e.resumeFrom.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:i}=e.options;i===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:s}=e;n.onExitComplete&&n.onExitComplete(),s&&s.options.onExitComplete&&s.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Md(t,e,n){let s="";const i=t.x.translate/e.x,r=t.y.translate/e.y,o=n?.z||0;if((i||r||o)&&(s=`translate3d(${i}px, ${r}px, ${o}px) `),(e.x!==1||e.y!==1)&&(s+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:u,rotate:c,rotateX:h,rotateY:d,skewX:f,skewY:p}=n;u&&(s=`perspective(${u}px) ${s}`),c&&(s+=`rotate(${c}deg) `),h&&(s+=`rotateX(${h}deg) `),d&&(s+=`rotateY(${d}deg) `),f&&(s+=`skewX(${f}deg) `),p&&(s+=`skewY(${p}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return(a!==1||l!==1)&&(s+=`scale(${a}, ${l})`),s||"none"}const yn=["","X","Y","Z"],Ed=1e3;let Ad=0;function vn(t,e,n,s){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),s&&(s[t]=0))}function ea(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Fo(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:r}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",B,!(i||r))}const{parent:s}=t;s&&!s.hasCheckedOptimisedAppear&&ea(s)}function na({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(o={},a=e?.()){this.id=Ad++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Rd),this.nodes.forEach(Od),this.nodes.forEach(Id),this.nodes.forEach(Dd)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new gd)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new ns),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=yo(o)&&!vu(o),this.instance=o;const{layoutId:a,layout:l,visualElement:u}=this.options;if(u&&!u.current&&u.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),t){let c,h=0;const d=()=>this.root.updateBlockedByResize=!1;B.read(()=>{h=window.innerWidth}),t(o,()=>{const f=window.innerWidth;f!==h&&(h=f,this.root.updateBlockedByResize=!0,c&&c(),c=yd(d,250),Oe.hasAnimatedSinceResize&&(Oe.hasAnimatedSinceResize=!1,this.nodes.forEach(Xi)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&u&&(a||l)&&this.addEventListener("didUpdate",({delta:c,hasLayoutChanged:h,hasRelativeLayoutChanged:d,layout:f})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const p=this.options.transition||u.getDefaultTransition()||$d,{onLayoutAnimationStart:m,onLayoutAnimationComplete:v}=u.getProps(),y=!this.targetLayout||!ta(this.targetLayout,f),x=!h&&d;if(this.options.layoutRoot||this.resumeFrom||x||h&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const g={...gs(p,"layout"),onPlay:m,onComplete:v};(u.shouldReduceMotion||this.options.layoutRoot)&&(g.delay=0,g.type=!1),this.startAnimation(g),this.setAnimationOrigin(c,x)}else h||Xi(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=f})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),wt(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Bd),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&ea(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){const h=this.path[c];h.shouldResetTransform=!0,h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(qi);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Yi);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Ld),this.nodes.forEach(Vd),this.nodes.forEach(kd)):this.nodes.forEach(Yi),this.clearAllSnapshots();const a=tt.now();G.delta=pt(0,1e3/60,a-G.timestamp),G.timestamp=a,G.isProcessing=!0,on.update.process(G),on.preRender.process(G),on.render.process(G),G.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,vs.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(jd),this.sharedNodes.forEach(Nd)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,B.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){B.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!J(this.snapshot.measuredBox.x)&&!J(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=W(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a&&this.instance){const l=s(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Qo(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;o&&this.instance&&(a||Et(this.latestValues)||c)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),Wd(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:o}=this.options;if(!o)return W();const a=o.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Ud))){const{scroll:u}=this.root;u&&(zt(a.x,u.offset.x),zt(a.y,u.offset.y))}return a}removeElementScroll(o){const a=W();if(st(a,o),this.scroll?.wasRoot)return a;for(let l=0;l<this.path.length;l++){const u=this.path[l],{scroll:c,options:h}=u;u!==this.root&&c&&h.layoutScroll&&(c.wasRoot&&st(a,o),zt(a.x,c.offset.x),zt(a.y,c.offset.y))}return a}applyTransform(o,a=!1){const l=W();st(l,o);for(let u=0;u<this.path.length;u++){const c=this.path[u];!a&&c.options.layoutScroll&&c.scroll&&c!==c.root&&$t(l,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),Et(c.latestValues)&&$t(l,c.latestValues)}return Et(this.latestValues)&&$t(l,this.latestValues),l}removeTransform(o){const a=W();st(a,o);for(let l=0;l<this.path.length;l++){const u=this.path[l];if(!u.instance||!Et(u.latestValues))continue;Bn(u.latestValues)&&u.updateSnapshot();const c=W(),h=u.measurePageBox();st(c,h),$i(a,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,c)}return Et(this.latestValues)&&$i(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==G.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(o||l&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:c,layoutId:h}=this.options;if(!(!this.layout||!(c||h))){if(this.resolvedRelativeTargetAt=G.timestamp,!this.targetDelta&&!this.relativeTarget){const d=this.getClosestProjectingParent();d&&d.layout&&this.animationProgress!==1?(this.relativeParent=d,this.forceRelativeParentToResolveTarget(),this.relativeTarget=W(),this.relativeTargetOrigin=W(),le(this.relativeTargetOrigin,this.layout.layoutBox,d.layout.layoutBox),st(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=W(),this.targetWithTransforms=W()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Xh(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):st(this.target,this.layout.layoutBox),jo(this.target,this.targetDelta)):st(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const d=this.getClosestProjectingParent();d&&!!d.resumingFrom==!!this.resumingFrom&&!d.options.layoutScroll&&d.target&&this.animationProgress!==1?(this.relativeParent=d,this.forceRelativeParentToResolveTarget(),this.relativeTarget=W(),this.relativeTargetOrigin=W(),le(this.relativeTargetOrigin,this.target,d.target),st(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||Bn(this.parent.latestValues)||Do(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){const o=this.getLead(),a=!!this.resumingFrom||this!==o;let l=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===G.timestamp&&(l=!1),l)return;const{layout:u,layoutId:c}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||c))return;st(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,d=this.treeScale.y;lh(this.layoutCorrected,this.treeScale,this.path,a),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=W());const{target:f}=o;if(!f){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Ni(this.prevProjectionDelta.x,this.projectionDelta.x),Ni(this.prevProjectionDelta.y,this.projectionDelta.y)),ae(this.projectionDelta,this.layoutCorrected,f,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==d||!Gi(this.projectionDelta.x,this.prevProjectionDelta.x)||!Gi(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",f))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){if(this.options.visualElement?.scheduleRender(),o){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Wt(),this.projectionDelta=Wt(),this.projectionDeltaWithTransform=Wt()}setAnimationOrigin(o,a=!1){const l=this.snapshot,u=l?l.latestValues:{},c={...this.latestValues},h=Wt();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const d=W(),f=l?l.source:void 0,p=this.layout?this.layout.source:void 0,m=f!==p,v=this.getStack(),y=!v||v.members.length<=1,x=!!(m&&!y&&this.options.crossfade===!0&&!this.path.some(zd));this.animationProgress=0;let g;this.mixTargetDelta=C=>{const S=C/1e3;Zi(h.x,o.x,S),Zi(h.y,o.y,S),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(le(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Fd(this.relativeTarget,this.relativeTargetOrigin,d,S),g&&Td(this.relativeTarget,g)&&(this.isProjectionDirty=!1),g||(g=W()),st(g,this.relativeTarget)),m&&(this.animationValues=c,xd(c,u,this.latestValues,S,x,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(wt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=B.update(()=>{Oe.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Gt(0)),this.currentAnimation=md(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Ed),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:c}=o;if(!(!a||!l||!u)){if(this!==o&&this.layout&&u&&sa(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||W();const h=J(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+h;const d=J(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+d}st(a,l),$t(a,c),ae(this.projectionDeltaWithTransform,this.layoutCorrected,a,c)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Pd),this.sharedNodes.get(o).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){const{layoutId:o}=this.options;return o?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:o}=this.options;return o?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const u={};l.z&&vn("z",o,u,this.animationValues);for(let c=0;c<yn.length;c++)vn(`rotate${yn[c]}`,o,u,this.animationValues),vn(`skew${yn[c]}`,o,u,this.animationValues);o.render();for(const c in u)o.setStaticValue(c,u[c]),this.animationValues&&(this.animationValues[c]=u[c]);o.scheduleRender()}applyProjectionStyles(o,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=Le(a?.pointerEvents)||"",o.transform=l?l(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=Le(a?.pointerEvents)||""),this.hasProjected&&!Et(this.latestValues)&&(o.transform=l?l({},""):"none",this.hasProjected=!1);return}o.visibility="";const c=u.animationValues||u.latestValues;this.applyTransformsToTarget();let h=Md(this.projectionDeltaWithTransform,this.treeScale,c);l&&(h=l(c,h)),o.transform=h;const{x:d,y:f}=this.projectionDelta;o.transformOrigin=`${d.origin*100}% ${f.origin*100}% 0`,u.animationValues?o.opacity=u===this?c.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:c.opacityExit:o.opacity=u===this?c.opacity!==void 0?c.opacity:"":c.opacityExit!==void 0?c.opacityExit:0;for(const p in ge){if(c[p]===void 0)continue;const{correct:m,applyTo:v,isCSSVariable:y}=ge[p],x=h==="none"?c[p]:m(c[p],u);if(v){const g=v.length;for(let C=0;C<g;C++)o[v[C]]=x}else y?this.options.visualElement.renderState.vars[p]=x:o[p]=x}this.options.layoutId&&(o.pointerEvents=u===this?Le(a?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>o.currentAnimation?.stop()),this.root.nodes.forEach(qi),this.root.sharedNodes.clear()}}}function Vd(t){t.updateLayout()}function kd(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:s}=t.layout,{animationType:i}=t.options,r=e.source!==t.layout.source;i==="size"?rt(c=>{const h=r?e.measuredBox[c]:e.layoutBox[c],d=J(h);h.min=n[c].min,h.max=h.min+d}):sa(i,e.layoutBox,n)&&rt(c=>{const h=r?e.measuredBox[c]:e.layoutBox[c],d=J(n[c]);h.max=h.min+d,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[c].max=t.relativeTarget[c].min+d)});const o=Wt();ae(o,n,e.layoutBox);const a=Wt();r?ae(a,t.applyTransform(s,!0),e.measuredBox):ae(a,n,e.layoutBox);const l=!Qo(o);let u=!1;if(!t.resumeFrom){const c=t.getClosestProjectingParent();if(c&&!c.resumeFrom){const{snapshot:h,layout:d}=c;if(h&&d){const f=W();le(f,e.layoutBox,h.layoutBox);const p=W();le(p,n,d.layoutBox),ta(f,p)||(u=!0),c.options.layoutRoot&&(t.relativeTarget=p,t.relativeTargetOrigin=f,t.relativeParent=c)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:o,hasLayoutChanged:l,hasRelativeLayoutChanged:u})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function Rd(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Dd(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function jd(t){t.clearSnapshot()}function qi(t){t.clearMeasurements()}function Yi(t){t.isLayoutDirty=!1}function Ld(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Xi(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Od(t){t.resolveTargetDelta()}function Id(t){t.calcProjection()}function Bd(t){t.resetSkewAndRotation()}function Nd(t){t.removeLeadSnapshot()}function Zi(t,e,n){t.translate=F(e.translate,0,n),t.scale=F(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Ji(t,e,n,s){t.min=F(e.min,n.min,s),t.max=F(e.max,n.max,s)}function Fd(t,e,n,s){Ji(t.x,e.x,n.x,s),Ji(t.y,e.y,n.y,s)}function zd(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const $d={duration:.45,ease:[.4,0,.1,1]},Qi=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),tr=Qi("applewebkit/")&&!Qi("chrome/")?Math.round:at;function er(t){t.min=tr(t.min),t.max=tr(t.max)}function Wd(t){er(t.x),er(t.y)}function sa(t,e,n){return t==="position"||t==="preserve-aspect"&&!Yh(Hi(e),Hi(n),.2)}function Ud(t){return t!==t.root&&t.scroll?.wasRoot}const Kd=na({attachResizeListener:(t,e)=>ye(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),xn={current:void 0},ia=na({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!xn.current){const t=new Kd({});t.mount(window),t.setOptions({layoutScroll:!0}),xn.current=t}return xn.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),Hd={pan:{Feature:ud},drag:{Feature:cd,ProjectionNode:ia,MeasureLayout:Xo}};function nr(t,e,n){const{props:s}=t;t.animationState&&s.whileHover&&t.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,r=s[i];r&&B.postRender(()=>r(e,_e(e)))}class Gd extends _t{mount(){const{current:e}=this.node;e&&(this.unmount=fu(e,(n,s)=>(nr(this.node,s,"Start"),i=>nr(this.node,i,"End"))))}unmount(){}}class qd extends _t{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=be(ye(this.node.current,"focus",()=>this.onFocus()),ye(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function sr(t,e,n){const{props:s}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&s.whileTap&&t.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),r=s[i];r&&B.postRender(()=>r(e,_e(e)))}class Yd extends _t{mount(){const{current:e}=this.node;e&&(this.unmount=yu(e,(n,s)=>(sr(this.node,s,"Start"),(i,{success:r})=>sr(this.node,i,r?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Kn=new WeakMap,bn=new WeakMap,Xd=t=>{const e=Kn.get(t.target);e&&e(t)},Zd=t=>{t.forEach(Xd)};function Jd({root:t,...e}){const n=t||document;bn.has(n)||bn.set(n,{});const s=bn.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(Zd,{root:t,...e})),s[i]}function Qd(t,e,n){const s=Jd(e);return Kn.set(t,n),s.observe(t),()=>{Kn.delete(t),s.unobserve(t)}}const tf={some:0,all:1};class ef extends _t{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:s,amount:i="some",once:r}=e,o={root:n?n.current:void 0,rootMargin:s,threshold:typeof i=="number"?i:tf[i]},a=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,r&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:c,onViewportLeave:h}=this.node.getProps(),d=u?c:h;d&&d(l)};return Qd(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(nf(e,n))&&this.startObserver()}unmount(){}}function nf({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const sf={inView:{Feature:ef},tap:{Feature:Yd},focus:{Feature:qd},hover:{Feature:Gd}},rf={layout:{ProjectionNode:ia,MeasureLayout:Xo}},of={...Wh,...sf,...Hd,...rf},Vs=rh(of,vh),af=t=>{let e;t.center?e="center":t.left?e="left":t.right&&(e="right");let n;return t.uppercase?n="uppercase":t.lowercase?n="lowercase":t.capitalize&&(n="capitalize"),X({marginTop:t.mt,marginBottom:t.mb,marginRight:t.mr,marginLeft:t.ml,flex:t.flex,cursor:t.cursor,wordBreak:t.wordBreak,whiteSpace:t.whiteSpace,textOverflow:t.textOverflow,textDecoration:t.decoration,textAlign:e,textTransform:n,color:t.color,opacity:t.disabled?.5:void 0,overflow:t.overflow})},lf="_primary_13825_8",cf="_secondary_13825_12",uf="_tertiary_13825_16",hf="_positive_13825_20",df="_negative_13825_24",ff="_warning_13825_28",mf="_accent_13825_32",pf="_inverse_13825_36",gf="_text_13825_111",yf="_regular_13825_117",vf="_medium_13825_121",xf="_semibold_13825_125",bf="_bold_13825_129",Ae={primary:lf,secondary:cf,tertiary:uf,positive:hf,negative:df,warning:ff,accent:mf,inverse:pf,"title-1":"_title-1_13825_41","title-2":"_title-2_13825_51","title-3":"_title-3_13825_61","headline-1":"_headline-1_13825_76","headline-2":"_headline-2_13825_81","headline-3":"_headline-3_13825_86","body-1":"_body-1_13825_91","body-2":"_body-2_13825_96","caption-1":"_caption-1_13825_101","caption-2":"_caption-2_13825_106",text:gf,regular:yf,medium:vf,semibold:xf,bold:bf},O=w.forwardRef((t,e)=>{const{children:n,className:s,variant:i="body-1",fontWeight:r="medium",tag:o="p",colorName:a="primary",style:l,clickOpacity:u=.5,opacityDuration:c=200,onClick:h,disabled:d,...f}=t,[p,m]=w.useState(!1),v=!!h,y=()=>v&&m(!0),x=()=>v&&m(!1),g=o,C=v?X({opacity:p?u:1,transition:`opacity ${c}ms ease`}):"";return b.jsx(g,{ref:e,...f,className:I(Ae.text,Ae[i],Ae[r],Ae[a],af(t),C,s),style:l,onClick:h,onMouseDown:y,onMouseUp:x,onMouseLeave:x,onTouchStart:y,onTouchEnd:x,role:v?"button":void 0,tabIndex:v?0:void 0,children:n})});O.displayName="Text";const ra=Vs(O),wf="_loader_1qleq_8",Cf={loader:wf},_f=({color:t="var(--text-accent)"})=>b.jsx("span",{className:I(Cf.loader,X({"--loader-color":t}))}),Sf=X({display:"flex",alignItems:"center",justifyContent:"center",position:"relative",borderRadius:16,height:48,padding:"0 16px",cursor:"pointer",fontSize:16,fontWeight:600,overflow:"hidden",transition:"all 0.2s ease",gap:8}),se={zero:"var(--corner-zero)",xs:"var(--corner-xs)",sm:"var(--corner-sm)",md:"var(--corner-md)",lg:"var(--corner-lg)",xl:"var(--corner-xl)","2xl":"var(--corner-2xl)","3xl":"var(--corner-3xl)","4xl":"var(--corner-4xl)","5xl":"var(--corner-5xl)","6xl":"var(--corner-6xl)","full-round":"var(--corner-full-round)"},Tf={xs:"var(--height-button-xs)",sm:"var(--height-button-sm)",md:"var(--height-button-md)",lg:"var(--height-button-lg)"},Pf={clear:X({backgroundColor:"transparent",border:"none"}),filled:X({backgroundColor:"var(--fill-accent-primary)",color:"white",border:"none"}),outline:X({backgroundColor:"transparent",border:"1px solid var(--border-accent-primary)"})},Mf=(t,e,n,s)=>{if(s)return X({cursor:"not-allowed",opacity:.7});const i={transition:"all 0.2s ease",borderRadius:"var(--corner-lg)",border:"none",color:t==="filled"?"var(--text-inverse)":`var(--text-${e})`};switch(t){case"filled":return X({...i,backgroundColor:`var(--fill-${e}-${n})`,":hover":{backgroundColor:`var(--fill-${e}-${n}-hover)`},":active":{backgroundColor:`var(--fill-${e}-${n}-hover)`}});case"outline":return X({...i,backgroundColor:"transparent",border:`1px solid var(--border-${e}-${n})`,":hover":{backgroundColor:`var(--fill-${e}-secondary-hover)`},":active":{backgroundColor:`var(--fill-${e}-secondary-hover)`}});case"clear":return X({...i,backgroundColor:"transparent",":hover":{backgroundColor:`var(--fill-${e}-secondary-hover)`},":active":{backgroundColor:`var(--fill-${e}-secondary-hover)`}});default:return X(i)}},Ef=({disabled:t,loading:e,onClick:n,wrapperClassName:s,buttonClassName:i,buttonDisabledClassName:r,textClassName:o,children:a,variant:l="filled",backgroundColor:u,textColor:c,textFontWeight:h,borderColor:d,color:f="accent",borderRadius:p,width:m="full",size:v="md",iconLeft:y,iconRight:x,intensity:g="primary",...C})=>{const S=w.useMemo(()=>{switch(m){case"full":return"100%";case"auto":return"auto";default:return m}},[m]),P=w.useMemo(()=>u||(l==="filled"?f==="neutral"?"var(--fill-neutral-secondary)":`var(--fill-${f}-${g})`:"transparent"),[l,t,u,f,g]),_=w.useMemo(()=>{if(c)return c;if(g==="primary"){if(f==="neutral")return"var(--text-secondary)";if(l==="filled")return"var(--text-inverse)"}return`var(--text-${f}, #111)`},[l,t,c,f,g]),T=w.useMemo(()=>d||(l==="outline"?`var(--border-${f}-${g})`:"transparent"),[l,d,f,g]),E=w.useMemo(()=>{switch(v){case"lg":return se.lg;case"md":case"sm":return se.md;case"xs":return se.sm;default:return se.md}},[v]),L=I(Sf,Mf(l,f,g,t),Pf[l],i,t?r:void 0,X({borderRadius:p?se[p]:E,backgroundColor:P,borderColor:T,color:_,width:"100%",height:Tf[v],opacity:t?.7:1})),Q=w.useMemo(()=>{switch(v){case"lg":case"md":return"body-1";case"sm":case"xs":return"body-2";default:return"body-1"}},[v]);return b.jsx(A,{className:I(s),w:S,relative:!0,overflow:"hidden",children:b.jsxs(Vs.button,{whileTap:!t&&!e?{scale:.99,boxShadow:"inset 0 0 0 10000px rgba(0,0,0,0.1)",transition:{duration:0}}:{},className:L,disabled:t||e,onClick:n,...C,children:[e?b.jsx(_f,{color:_}):b.jsxs(b.Fragment,{children:[y,b.jsx(ra,{color:_,variant:Q,className:o,textOverflow:"ellipsis",overflow:"hidden",children:a}),x]}),b.jsx(xe,{})]})})},Af=t=>V.createElement("svg",{viewBox:"0 0 24 24",fill:"none",...t},V.createElement("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z",fill:"currentColor"})),Vf=t=>V.createElement("svg",{viewBox:"0 0 24 24",fill:"none",...t},V.createElement("path",{d:"M19 13H5v-2h14v2z",fill:"currentColor"})),kf="_checkbox_1hy9q_8",Rf="_disabled_1hy9q_15",Df="_checkbox__input_1hy9q_27",jf="_checkbox__box_1hy9q_35",Mt={checkbox:kf,disabled:Rf,checkbox__input:Df,checkbox__box:jf,"checkbox__box--checked":"_checkbox__box--checked_1hy9q_51"},Lf={sm:20,md:24},ks=w.forwardRef(({checked:t,onChange:e,disabled:n,indeterminate:s,size:i="md",title:r,titleColor:o,subtitle:a,subtitleColor:l="secondary",name:u,value:c,required:h},d)=>{const[f,p]=w.useState(!1),m=t!==void 0,v=m?t:f,y=C=>{m||p(C.target.checked),e?.(C)},x=Lf[i],g=v||s;return b.jsxs("label",{className:I(Mt.checkbox,{[Mt.disabled]:n}),children:[b.jsxs(A,{relative:!0,display:"inline-flex",style:{"--checkbox-size":`${x}px`,"--checkbox-size-double":`${x*2}px`},children:[b.jsx("input",{ref:d,type:"checkbox",checked:v,onChange:y,onClick:C=>C.stopPropagation(),disabled:n,name:u,value:c,required:h,className:I(Mt.checkbox__input,{[Mt.disabled]:n})}),b.jsx("div",{className:I(Mt.checkbox__box,g&&Mt["checkbox__box--checked"],{[Mt.disabled]:n}),children:g&&(s?b.jsx(Vf,{width:x*.75,height:x*.75}):b.jsx(Af,{width:x*.75,height:x*.75}))})]}),(r||a)&&b.jsxs(A,{gap:4,children:[r&&b.jsx(O,{colorName:o,variant:i==="sm"?"body-2":"body-1",children:r}),a&&b.jsx(O,{variant:"body-2",colorName:l,children:a})]})]})});ks.displayName="Checkbox";const Of=t=>V.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},V.createElement("g",{opacity:.5},V.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.0002 17.9999C14.4185 17.9999 18.0002 14.4182 18.0002 9.99991C18.0002 5.58163 14.4185 1.99991 10.0002 1.99991C5.58197 1.99991 2.00024 5.58163 2.00024 9.99991C2.00024 14.4182 5.58197 17.9999 10.0002 17.9999ZM6.46514 6.46446C6.85566 6.07393 7.48883 6.07393 7.87935 6.46446L9.64712 8.23222C9.84238 8.42749 10.159 8.42749 10.3542 8.23222L12.122 6.46446C12.5125 6.07393 13.1457 6.07393 13.5362 6.46446C13.9267 6.85498 13.9267 7.48814 13.5362 7.87867L11.7684 9.64644C11.5732 9.8417 11.5732 10.1583 11.7684 10.3535L13.5362 12.1213C13.9267 12.5118 13.9267 13.145 13.5362 13.5355C13.1457 13.926 12.5125 13.926 12.122 13.5355L10.3542 11.7678C10.159 11.5725 9.84238 11.5725 9.64712 11.7678L7.87935 13.5355C7.48883 13.926 6.85566 13.926 6.46514 13.5355C6.07462 13.145 6.07462 12.5118 6.46514 12.1213L8.23291 10.3535C8.42817 10.1583 8.42817 9.8417 8.23291 9.64644L6.46514 7.87867C6.07462 7.48815 6.07462 6.85498 6.46514 6.46446Z",fill:"currentColor"}))),If="_disabled_15p1l_20",Bf="_input_15p1l_8",Nf="_sm_15p1l_61",Ff="_md_15p1l_66",zf="_error_15p1l_71",$f="_white_15p1l_75",Wf="_gray_15p1l_79",lt={"input-container":"_input-container_15p1l_8",disabled:If,input:Bf,"input-text-size_sm":"_input-text-size_sm_15p1l_52","input-text-size_md":"_input-text-size_md_15p1l_56",sm:Nf,md:Ff,error:zf,white:$f,gray:Wf,"clear-button":"_clear-button_15p1l_83"};function ir(t){return{...new Event("input",{bubbles:!0}),target:t,currentTarget:t}}const oa=w.forwardRef((t,e)=>{const{label:n,prompt:s,error:i,errorText:r,size:o="md",prefix:a,suffix:l,background:u="white",showClearButton:c,disabled:h,value:d,defaultValue:f,...p}=t,m=t.multiline===!0,v=w.useRef(null),y=w.useRef(null),[x,g]=Ge(d!==void 0?String(d):void 0,f!==void 0?String(f):"");w.useImperativeHandle(e,()=>({focus:()=>{v.current?.focus(),y.current?.focus()},blur:()=>{v.current?.blur(),y.current?.blur()},get value(){return v.current?.value||y.current?.value}}));const C=_=>{if(g(_.target.value),m){const T=t.onChange;T?.(_)}else{const T=t.onChange;T?.(_)}};w.useEffect(()=>{m&&t.autoResize&&y.current&&(y.current.style.height="auto",y.current.style.height=`${y.current.scrollHeight}px`)},[x,m,t.autoResize]);const S=()=>{if(g(""),!m){const T=v.current;if(T){T.value="";const E=ir(T),L=t.onChange;L?.(E)}return}const _=y.current;if(_){_.value="";const T=ir(_),E=t.onChange;E?.(T)}},P=()=>{if(m){const{rows:L,autoResize:Q,onChange:St,multiline:Tt,...vt}=p;return b.jsx("textarea",{ref:y,rows:t.rows??3,className:I(lt.input,{[lt.disabled]:h}),disabled:h,maxLength:t.maxLength,...vt,value:x,onChange:C})}const{onChange:_,multiline:T,...E}=p;return b.jsx("input",{...E,ref:v,className:I(lt.input,lt[`input-text-size_${o}`],{[lt.disabled]:h}),disabled:h,type:t.type??"text",value:x,onChange:C})};return b.jsxs(A,{w:"full",gap:"var(--spacing-sm)",children:[n&&b.jsx(O,{variant:"body-2",fontWeight:"regular",colorName:i?"negative":"tertiary",children:n}),b.jsxs(A,{row:!0,alignItems:"center",w:"full",gap:"var(--spacing-md)",className:I(lt["input-container"],lt[u],lt[o],{[lt.error]:i,[lt.disabled]:h}),children:[a&&b.jsx(A,{flex:"none",children:a}),b.jsx(A,{flex:"1",children:P()}),c&&x&&!h&&b.jsx(A,{flex:"none",children:b.jsx("span",{className:lt["clear-button"],onClick:S,children:b.jsx(Of,{})})}),l&&b.jsx(A,{flex:"none",children:l})]}),(s||m)&&b.jsxs(A,{row:!0,gap:10,w:"full",children:[typeof s=="string"?b.jsx(O,{variant:"caption-1",colorName:"tertiary",children:s}):s,m&&t.maxLength&&b.jsx(O,{right:!0,ml:"auto",flex:"none",variant:"caption-1",colorName:"tertiary",children:`${x.length}/${t.maxLength}`})]}),r&&i&&b.jsx(O,{variant:"body-2",colorName:"negative",fontWeight:"regular",children:r})]})});oa.displayName="Input";const Uf="_avatar_1oe2p_8",Kf="_avatar_primary_1oe2p_22",Hf="_avatar_secondary_1oe2p_25",Gf="_avatar_negative_1oe2p_28",qf="_avatar_positive_1oe2p_31",Yf="_avatar_warning_1oe2p_34",Xf="_avatar_lgSize_1oe2p_71",Zf="_avatar_mdSize_1oe2p_85",Jf="_avatar_smSize_1oe2p_99",wn={avatar:Uf,avatar_primary:Kf,avatar_secondary:Hf,avatar_negative:Gf,avatar_positive:qf,avatar_warning:Yf,avatar_lgSize:Xf,avatar_mdSize:Zf,avatar_smSize:Jf};function Qf({attr:t,children:e,className:n,color:s="primary",size:i="md",...r}){const o="avatar";return b.jsx("div",{...t,...r,className:At(wn[o],n,he(wn,o,i),qe(wn,o,s)),children:e})}const tm=t=>V.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},V.createElement("circle",{cx:12,cy:12,r:10,fill:"currentColor",fillOpacity:.15}),V.createElement("path",{d:"M16 9L10.0337 15L8 12.9548",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),rr=t=>V.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},V.createElement("path",{d:"M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z",fill:"currentColor",fillOpacity:.15}),V.createElement("path",{d:"M12 6C11.4477 6 11 6.44772 11 7V13C11 13.5523 11.4477 14 12 14C12.5523 14 13 13.5523 13 13V7C13 6.44772 12.5523 6 12 6Z",fill:"currentColor"}),V.createElement("path",{d:"M12 15C11.4477 15 11 15.4477 11 16V17C11 17.5523 11.4477 18 12 18C12.5523 18 13 17.5523 13 17V16C13 15.4477 12.5523 15 12 15Z",fill:"currentColor"})),em=t=>V.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},V.createElement("circle",{cx:12,cy:12,r:10,fill:"currentColor",fillOpacity:.12}),V.createElement("path",{d:"M16 8L8 16M16 16L8 8",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"})),nm=t=>V.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:"black",...t},V.createElement("path",{d:"M12 2V22M19.0711 4.92893L4.92893 19.0711M22 12H2M19.0711 19.0711L4.92893 4.92893",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),sm="_hint_prca1_8",im="_md_prca1_19",rm="_sm_prca1_24",om="_icon_prca1_29",am="_content_prca1_40",lm="_title_prca1_46",cm="_subtitle_prca1_50",um="_disabled_prca1_55",hm="_warning_prca1_60",dm="_solid_prca1_60",fm="_negative_prca1_65",mm="_positive_prca1_70",pm="_accent_prca1_75",gm="_neutral_prca1_80",ym="_soft_prca1_85",it={hint:sm,md:im,sm:rm,icon:om,content:am,title:lm,subtitle:cm,disabled:um,warning:hm,solid:dm,negative:fm,positive:mm,accent:pm,neutral:gm,soft:ym},vm={negative:b.jsx(em,{}),positive:b.jsx(tm,{}),accent:b.jsx(rr,{}),warning:b.jsx(rr,{}),neutral:b.jsx(nm,{})},xm=({title:t,subtitle:e,color:n="warning",variant:s="soft",size:i="md",icon:r,disabled:o=!1,className:a,style:l})=>{const u=r||vm[n];return b.jsxs("div",{className:At(it.hint,it[n],it[s],it[i],o&&it.disabled,a),style:l,"aria-disabled":o,children:[u&&b.jsx("span",{className:At(it.icon,it[n]),children:u}),b.jsxs("div",{className:it.content,children:[t&&b.jsx(O,{className:At(it.title,he(it,"title",i)),variant:i==="md"?"body-1":"caption-2",children:t}),e&&b.jsx(O,{className:At(it.subtitle,he(it,"subtitle",i)),variant:i==="md"?"body-2":"caption-1",children:e})]})]})},bm={primary:{bg:"var(--status-neutral-tint-low)",color:"var(--text-primary)"},accent:{bg:"var(--status-accent-tint-low)",color:"var(--text-accent)"},warning:{bg:"var(--status-warning-tint-low)",color:"var(--text-warning)"},positive:{bg:"var(--status-positive-tint-low)",color:"var(--text-positive)"},negative:{bg:"var(--status-negative-tint-low)",color:"var(--text-negative)"}},wm={sm:28,md:32,lg:40},Rs=w.forwardRef(({label:t,color:e="primary",size:n="md",onClick:s,onDelete:i,avatar:r,icon:o,disabled:a,className:l},u)=>{const c=w.useRef(null),h=bm[e],d=X({cursor:a?"not-allowed":s?"pointer":"default",opacity:a?.5:1,userSelect:"none",position:"relative",transition:"background-color 0.2s, opacity 0.2s","&:hover":a?void 0:{backgroundColor:h.bg}}),f=X({cursor:"pointer",opacity:.6,"&:hover":{opacity:1}});return b.jsxs(A,{ref:p=>{c.current=p,typeof u=="function"?u(p):u&&(u.current=p)},row:!0,alignItems:"center",gap:6,px:10,py:4,h:wm[n],maxWidth:196,overflow:"hidden",borderRadius:"var(--corner-sm)",backgroundColor:h.bg,color:h.color,onClick:s,className:I(d,l),children:[s&&b.jsx(xe,{}),r&&b.jsx(A,{w:20,h:20,borderRadius:"50%",overflow:"hidden",children:r}),o&&b.jsx(A,{children:o}),b.jsx(O,{variant:"caption-1",color:h.color,textOverflow:"ellipsis",children:t}),i&&!a&&b.jsx(O,{className:f,colorName:e,onClick:p=>{p.stopPropagation(),i(p)},children:"×"})]})});Rs.displayName="Tag";const aa=({children:t})=>{const[e]=w.useState(()=>document.createElement("div"));return w.useEffect(()=>{let n=document.getElementById("portal-root");return n||(n=document.createElement("div"),n.id="portal-root",document.body.appendChild(n)),n.appendChild(e),()=>{n&&n.contains(e)&&n.removeChild(e)}},[e]),dr.createPortal(t,e)},Cm=t=>V.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},V.createElement("path",{d:"M6 9L12 15L18 9",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),_m=t=>V.createElement("svg",{fill:"currentColor",id:"Capa_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 462.035 462.035",xmlSpace:"preserve",...t},V.createElement("g",null,V.createElement("path",{d:"M457.83,158.441c-0.021-0.028-0.033-0.058-0.057-0.087l-50.184-62.48c-0.564-0.701-1.201-1.305-1.879-1.845 c-2.16-2.562-5.355-4.225-8.967-4.225H65.292c-3.615,0-6.804,1.661-8.965,4.225c-0.678,0.54-1.316,1.138-1.885,1.845l-50.178,62.48 c-0.023,0.029-0.034,0.059-0.057,0.087C1.655,160.602,0,163.787,0,167.39v193.07c0,6.5,5.27,11.771,11.77,11.771h438.496 c6.5,0,11.77-5.271,11.77-11.771V167.39C462.037,163.787,460.381,160.602,457.83,158.441z M408.516,134.615l16.873,21.005h-16.873 V134.615z M384.975,113.345v42.274H296.84c-2.514,0-4.955,0.805-6.979,2.293l-58.837,43.299l-58.849-43.305 c-2.023-1.482-4.466-2.287-6.978-2.287H77.061v-42.274H384.975z M53.523,155.62H36.65l16.873-21.005V155.62z M438.498,348.69H23.54 V179.16h137.796l62.711,46.148c4.15,3.046,9.805,3.052,13.954-0.005l62.698-46.144h137.799V348.69L438.498,348.69z"}))),Sm="_disabled_6kgqd_40",Tm="_open_6kgqd_48",Pm="_error_6kgqd_51",Mm="_hidden_6kgqd_87",Em="_visible_6kgqd_90",Am="_selected_6kgqd_163",H={"select-container":"_select-container_6kgqd_8","full-width":"_full-width_6kgqd_13","select-input":"_select-input_6kgqd_17","size-xs":"_size-xs_6kgqd_25","size-sm":"_size-sm_6kgqd_30","size-md":"_size-md_6kgqd_35",disabled:Sm,open:Tm,"select-arrow":"_select-arrow_6kgqd_48",error:Pm,"select-value":"_select-value_6kgqd_62","select-value_xs":"_select-value_xs_6kgqd_74","select-placeholder":"_select-placeholder_6kgqd_81",hidden:Mm,visible:Em,"select-arrow_xs":"_select-arrow_xs_6kgqd_106","select-dropdown":"_select-dropdown_6kgqd_116","select-menu":"_select-menu_6kgqd_126","select-menu-item":"_select-menu-item_6kgqd_145","select-menu-item-first":"_select-menu-item-first_6kgqd_158",selected:Am,"overflow-tooltip-container":"_overflow-tooltip-container_6kgqd_167","overflow-tooltip-text":"_overflow-tooltip-text_6kgqd_172","empty-block":"_empty-block_6kgqd_179"},Vm={xs:"sm",sm:"md",md:"lg"};function km({value:t,onChange:e,multiple:n=!1,returnedValue:s,renderItem:i,placeholder:r,items:o,fullWidth:a,size:l="md",showDefaultItem:u,disabled:c,label:h,firstItem:d,lastItem:f,observer:p,emptyText:m,onBlur:v,error:y,errorText:x}){const[g,C]=Ge(t,n?[]:null),S=w.useRef(null),P=w.useRef(null),[_,T]=w.useState(!1),E=w.useMemo(()=>n?g||[]:g!=null?[g]:[],[g,n]),L=w.useMemo(()=>{const k=new Map;return o.forEach(j=>k.set(s(j),j)),k},[o,s]),Q=_r(S,_),St=!o.length&&!y,Tt=k=>{const j=s(k);if(n){const $=E.includes(j)?E.filter(Ot=>Ot!==j):[...E,j];C($),e?.($)}else C(j),e?.(j),T(!1)},vt=k=>{if(!n)return;const j=E.filter($=>$!==k);C(j),e?.(j)},jt=()=>{const k=n?[]:null;C(k),e?.(k),n||T(!1)};w.useEffect(()=>{if(!_)return;const k=j=>{const $=j.target;!S.current?.contains($)&&!P.current?.contains($)&&T(!1)};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[_]);const Lt=()=>{if(!E.length)return b.jsx(O,{variant:l==="xs"?"caption-1":"body-2",textOverflow:"ellipsis",overflow:"hidden",children:r??"Select..."});if(n)return b.jsx(A,{flexWrap:"wrap",row:!0,gap:10,children:E.map($=>{const Ot=L.get($);return Ot?b.jsx(Rs,{size:Vm[l],label:i(Ot),onDelete:fa=>{fa.stopPropagation(),vt($)}},$):null})});const k=L.get(E[0]);if(!k)return b.jsx(O,{variant:l==="xs"?"caption-1":"body-2",textOverflow:"ellipsis",overflow:"hidden",children:r});const j=i(k);return typeof j=="string"?b.jsx(O,{variant:l==="xs"?"caption-1":"body-2",tag:"p",textOverflow:"ellipsis",overflow:"hidden",children:j}):b.jsx(b.Fragment,{children:j})},z=_&&b.jsx(aa,{children:b.jsx(Vs.div,{ref:P,className:H["select-dropdown"],initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.25,ease:"easeInOut"},style:{...Q,position:"absolute",zIndex:1},children:b.jsxs("ul",{className:H["select-menu"],children:[u&&!n&&b.jsx(A,{className:H["select-menu-item"],role:"option",onClick:jt,children:b.jsx(O,{variant:"body-2",children:r})}),d&&b.jsx(A,{className:I(H["select-menu-item"],H["select-menu-item-first"]),children:d}),St&&b.jsxs(A,{className:H["empty-block"],children:[b.jsx(A,{w:20,h:20,children:b.jsx(_m,{})}),b.jsx(O,{variant:"body-2",children:m??"There is nothing yet"})]}),o.map(k=>{const j=s(k),$=E.includes(j);return b.jsxs(A,{row:!0,gap:10,alignItems:"center",className:I(H["select-menu-item"],{[H.selected]:$}),role:"option",relative:!0,onClick:()=>Tt(k),children:[n&&b.jsx(ks,{size:"sm",checked:$}),typeof i(k)=="string"?b.jsx(O,{variant:"body-2",tag:"p",wordBreak:"break-all",whiteSpace:"break-spaces",children:i(k)}):i(k),b.jsx(xe,{})]},j)}),p,f&&b.jsx(A,{className:I(H["select-menu-item"],H["select-menu-item-first"]),children:f})]})},"dropdown")});return b.jsxs(A,{relative:!0,display:"inline-block",minWidth:120,w:a?"full":"auto",children:[typeof h=="string"?b.jsx(O,{variant:"body-2",colorName:"tertiary",fontWeight:"regular",mb:l==="sm"?4:8,children:h}):h,b.jsxs(A,{ref:S,row:!0,gap:10,tabIndex:c?-1:0,role:"button",alignItems:"flex-start","aria-haspopup":"listbox",relative:!0,w:"100%",className:I(H["select-input"],H[`size-${l}`],{[H.error]:y,[H.disabled]:c,[H.open]:_}),onClick:()=>!c&&T(k=>!k),onBlur:v,children:[b.jsx(A,{className:I(H["select-value"]),children:Lt()}),b.jsx(A,{className:I(H["select-arrow"],H[`select-arrow_${l}`]),children:b.jsx(Cm,{})})]}),y&&x&&b.jsx(O,{tag:"p",colorName:"negative",variant:"body-2",mt:5,children:x}),b.jsx(Mu,{initial:!1,children:z})]})}const Rm=t=>V.createElement("svg",{width:10,height:10,viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},V.createElement("path",{d:"M3.94629 0.220237C3.78013 0.264025 3.64089 0.377624 3.56348 0.53176C3.27371 1.11189 3.05664 1.46395 2.83887 1.74953C2.61807 2.03873 2.38547 2.27579 2.03027 2.63039C1.21079 3.45057 0.799805 4.52619 0.799805 5.60012C0.799838 6.67406 1.21073 7.74968 2.03027 8.56985C3.67062 10.2096 6.32931 10.2095 7.96973 8.56985C8.78929 7.74968 9.20016 6.67408 9.2002 5.60012C9.15131 4.32908 8.43217 3.48543 7.94727 3.05813C7.76902 2.90106 7.40643 3.02424 7.2627 3.2134C7.24031 3.24286 7.21612 3.2739 7.18945 3.30617C6.93211 3.61754 6.56236 3.80807 6.41504 3.83156C6.38264 3.83667 6.36979 3.76513 6.2959 3.58254C5.79455 2.34427 5.78927 2.49365 5.58887 2.01125C5.48847 1.7692 5.05517 1.02727 4.92676 0.828635C4.80206 0.635591 4.64095 0.439873 4.43359 0.301292C4.29028 0.205951 4.1124 0.175957 3.94629 0.220237ZM4.75293 4.17824C5.2689 4.63997 5.60857 5.26651 5.71484 5.95071C6.10631 5.85571 6.46727 5.68318 6.78125 5.45071C6.86578 5.70826 6.89338 5.98123 6.8623 6.25051C6.83115 6.51993 6.74174 6.77966 6.60059 7.01125C6.45944 7.24281 6.27008 7.44117 6.04492 7.59231C5.81977 7.74344 5.56462 7.8443 5.29688 7.88723C5.0292 7.93013 4.75518 7.91446 4.49414 7.84133C4.23299 7.76812 3.99064 7.6383 3.78418 7.46242C3.5778 7.28657 3.41161 7.06792 3.29785 6.8218C3.18419 6.57572 3.12519 6.30771 3.125 6.03664C3.12508 5.58233 3.29054 5.14308 3.58984 4.80129C3.88917 4.4597 4.30271 4.2382 4.75293 4.17824Z",fill:"#FEAD34"})),Dm=t=>V.createElement("svg",{width:12,height:12,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},V.createElement("path",{d:"M10.1483 8.61509C10.3344 8.26159 9.98299 7.89856 9.58534 7.93723C9.42671 7.95265 9.25857 7.9605 9.07422 7.96035C6.36522 7.9582 4.17129 5.76427 4.16914 3.05527C4.169 2.87115 4.17682 2.70321 4.19221 2.54477C4.23082 2.14712 3.86769 1.79411 3.50976 1.97161C2.03398 2.70343 1.20002 4.02274 1.20002 5.89477C1.20002 8.60377 3.3961 10.7998 6.1051 10.7998C7.97571 10.7998 9.38737 10.06 10.1483 8.61509Z",fill:"white"})),jm="_container_e7tan_8",Lm="_disabled_e7tan_17",Om="_reverse_e7tan_21",Im="_input_e7tan_25",Bm="_switchContainer_e7tan_35",Nm="_variant_accent_e7tan_43",Fm="_variant_secondary_e7tan_47",zm="_thumb_e7tan_51",$m="_variant_theme_e7tan_54",Wm="_moon_e7tan_58",Um="_fire_e7tan_61",Km="_size_sm_e7tan_74",Hm="_size_md_e7tan_80",Gm="_size_lg_e7tan_86",ct={container:jm,disabled:Lm,reverse:Om,input:Im,switchContainer:Bm,variant_accent:Nm,variant_secondary:Fm,switch:"_switch_e7tan_35",thumb:zm,variant_theme:$m,moon:Wm,fire:Um,size_sm:Km,size_md:Hm,size_lg:Gm},la=w.forwardRef(({title:t,text:e,icon:n,disabled:s,onChange:i,checked:r,defaultValue:o,className:a,size:l="md",variant:u="accent",reverse:c=!1,w:h="auto",...d},f)=>{const[p,m]=Ge(r,o),v=w.useRef(null);w.useImperativeHandle(f,()=>({focus:()=>{v.current?.focus()},blur:()=>{v.current?.blur()},get checked(){return p??!1},setChecked:C=>{m(C),i?.(C)},toggle:()=>{const C=!p;m(C),i?.(C)},isFocused:()=>document.activeElement===v.current,isDisabled:()=>s??!1,getInputElement:()=>v.current,checkValidity:()=>v.current?.checkValidity()??!0,reset:()=>{const C=o??!1;m(C),i?.(C)}}),[p,m,i,s,o]);const y=w.useCallback(C=>{m(C.target.checked),i?.(C.target.checked)},[i]),x=w.useMemo(()=>typeof t=="string"?b.jsx(O,{variant:"body-1",colorName:"primary",fontWeight:"medium",children:t}):t,[t]),g=w.useMemo(()=>typeof e=="string"?b.jsx(O,{variant:"body-2",colorName:"secondary",fontWeight:"regular",children:e}):e,[e]);return b.jsxs(A,{row:!0,w:h,gap:"var(--spacing-sm)",children:[b.jsxs("label",{className:I(ct.container,a,{[ct.disabled]:s,[ct.reverse]:c}),children:[b.jsxs(A,{className:I(ct.switchContainer,ct[`size_${l}`],ct[`variant_${u}`]),children:[b.jsx("input",{ref:v,type:"checkbox",checked:p,className:ct.input,onChange:y,disabled:s,...d}),b.jsx("div",{className:ct.switch,children:b.jsx("div",{className:ct.thumb,children:u==="theme"&&b.jsxs(b.Fragment,{children:[b.jsx(Dm,{className:ct.moon}),b.jsx(Rm,{className:ct.fire})]})})})]}),b.jsxs(A,{gap:"var(--spacing-xs)",children:[x,g]})]}),n]})});la.displayName="Switch";const qm="_header_446to_8",Ym={header:qm},ca=w.forwardRef(({title:t,subtitle:e,onClose:n,w:s="full",p:i,py:r,px:o="var(--spacing-2xl)",pt:a="var(--spacing-2xl)",pb:l="var(--spacing-lg)",row:u=!0,justifyContent:c="space-between",showCloseButton:h=!0},d)=>b.jsxs(A,{w:s,p:i,py:r,px:o,pt:a,pb:l,row:u,justifyContent:c,ref:d,className:Ym.header,children:[b.jsxs(A,{gap:"var(--spacing-sm)",children:[b.jsx(O,{variant:"title-3",colorName:"primary",fontWeight:"semibold",children:t}),b.jsx(O,{variant:"body-1",colorName:"tertiary",fontWeight:"medium",children:e})]}),h&&b.jsx(A,{children:b.jsx(Yn,{onClick:n,color:"neutral",children:b.jsx(Sr,{})})})]}));ca.displayName="ModalHeader";const Xm="_footer_1bo08_8",Zm={footer:Xm},ua=w.forwardRef(({children:t,row:e=!0,flex:n=!0,gap:s="var(--spacing-lg)",p:i="var(--spacing-2xl)",className:r,...o},a)=>b.jsx(A,{flex:n,row:e,gap:s,p:i,className:I(Zm.footer,r),ref:a,...o,children:t}));ua.displayName="ModalFooter";function It(t,e,n){let s=n.initialDeps??[],i;function r(){var o,a,l,u;let c;n.key&&((o=n.debug)!=null&&o.call(n))&&(c=Date.now());const h=t();if(!(h.length!==s.length||h.some((p,m)=>s[m]!==p)))return i;s=h;let f;if(n.key&&((a=n.debug)!=null&&a.call(n))&&(f=Date.now()),i=e(...h),n.key&&((l=n.debug)!=null&&l.call(n))){const p=Math.round((Date.now()-c)*100)/100,m=Math.round((Date.now()-f)*100)/100,v=m/16,y=(x,g)=>{for(x=String(x);x.length<g;)x=" "+x;return x};console.info(`%c⏱ ${y(m,5)} /${y(p,5)} ms`,`
14
14
  font-size: .6rem;
15
15
  font-weight: bold;
16
16
  color: hsl(${Math.max(0,Math.min(120-120*v,120))}deg 100% 31%);`,n?.key)}return(u=n?.onChange)==null||u.call(n,i),i}return r.updateDeps=o=>{s=o},r}function or(t,e){if(t===void 0)throw new Error("Unexpected undefined");return t}const Jm=(t,e)=>Math.abs(t-e)<1.01,Qm=(t,e,n)=>{let s;return function(...i){t.clearTimeout(s),s=t.setTimeout(()=>e.apply(this,i),n)}},ar=t=>{const{offsetWidth:e,offsetHeight:n}=t;return{width:e,height:n}},tp=t=>t,ep=t=>{const e=Math.max(t.startIndex-t.overscan,0),n=Math.min(t.endIndex+t.overscan,t.count-1),s=[];for(let i=e;i<=n;i++)s.push(i);return s},np=(t,e)=>{const n=t.scrollElement;if(!n)return;const s=t.targetWindow;if(!s)return;const i=o=>{const{width:a,height:l}=o;e({width:Math.round(a),height:Math.round(l)})};if(i(ar(n)),!s.ResizeObserver)return()=>{};const r=new s.ResizeObserver(o=>{const a=()=>{const l=o[0];if(l?.borderBoxSize){const u=l.borderBoxSize[0];if(u){i({width:u.inlineSize,height:u.blockSize});return}}i(ar(n))};t.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return r.observe(n,{box:"border-box"}),()=>{r.unobserve(n)}},lr={passive:!0},cr=typeof window>"u"?!0:"onscrollend"in window,sp=(t,e)=>{const n=t.scrollElement;if(!n)return;const s=t.targetWindow;if(!s)return;let i=0;const r=t.options.useScrollendEvent&&cr?()=>{}:Qm(s,()=>{e(i,!1)},t.options.isScrollingResetDelay),o=c=>()=>{const{horizontal:h,isRtl:d}=t.options;i=h?n.scrollLeft*(d&&-1||1):n.scrollTop,r(),e(i,c)},a=o(!0),l=o(!1);l(),n.addEventListener("scroll",a,lr);const u=t.options.useScrollendEvent&&cr;return u&&n.addEventListener("scrollend",l,lr),()=>{n.removeEventListener("scroll",a),u&&n.removeEventListener("scrollend",l)}},ip=(t,e,n)=>{if(e?.borderBoxSize){const s=e.borderBoxSize[0];if(s)return Math.round(s[n.options.horizontal?"inlineSize":"blockSize"])}return t[n.options.horizontal?"offsetWidth":"offsetHeight"]},rp=(t,{adjustments:e=0,behavior:n},s)=>{var i,r;const o=t+e;(r=(i=s.scrollElement)==null?void 0:i.scrollTo)==null||r.call(i,{[s.options.horizontal?"left":"top"]:o,behavior:n})};class op{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const s=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(i=>{i.forEach(r=>{const o=()=>{this._measureElement(r.target,r)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()})}));return{disconnect:()=>{var i;(i=s())==null||i.disconnect(),n=null},observe:i=>{var r;return(r=s())==null?void 0:r.observe(i,{box:"border-box"})},unobserve:i=>{var r;return(r=s())==null?void 0:r.unobserve(i)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([s,i])=>{typeof i>"u"&&delete n[s]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:tp,rangeExtractor:ep,onChange:()=>{},measureElement:ip,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var s,i;(i=(s=this.options).onChange)==null||i.call(s,this,n)},this.maybeNotify=It(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const s=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==s){if(this.cleanup(),!s){this.maybeNotify();return}this.scrollElement=s,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(i=>{this.observer.observe(i)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,i=>{this.scrollRect=i,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(i,r)=>{this.scrollAdjustments=0,this.scrollDirection=r?this.getScrollOffset()<i?"forward":"backward":null,this.scrollOffset=i,this.isScrolling=r,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,s)=>{const i=new Map,r=new Map;for(let o=s-1;o>=0;o--){const a=n[o];if(i.has(a.lane))continue;const l=r.get(a.lane);if(l==null||a.end>l.end?r.set(a.lane,a):a.end<l.end&&i.set(a.lane,!0),i.size===this.options.lanes)break}return r.size===this.options.lanes?Array.from(r.values()).sort((o,a)=>o.end===a.end?o.index-a.index:o.end-a.end)[0]:void 0},this.getMeasurementOptions=It(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(n,s,i,r,o)=>(this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:s,scrollMargin:i,getItemKey:r,enabled:o}),{key:!1}),this.getMeasurements=It(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:s,scrollMargin:i,getItemKey:r,enabled:o},a)=>{if(!o)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(c=>{this.itemSizeCache.set(c.key,c.size)}));const l=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const u=this.measurementsCache.slice(0,l);for(let c=l;c<n;c++){const h=r(c),d=this.options.lanes===1?u[c-1]:this.getFurthestMeasurement(u,c),f=d?d.end+this.options.gap:s+i,p=a.get(h),m=typeof p=="number"?p:this.options.estimateSize(c),v=f+m,y=d?d.lane:c%this.options.lanes;u[c]={index:c,start:f,size:m,end:v,key:h,lane:y}}return this.measurementsCache=u,u},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=It(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,s,i,r)=>this.range=n.length>0&&s>0?ap({measurements:n,outerSize:s,scrollOffset:i,lanes:r}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=It(()=>{let n=null,s=null;const i=this.calculateRange();return i&&(n=i.startIndex,s=i.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,s]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,s]},(n,s,i,r,o)=>r===null||o===null?[]:n({startIndex:r,endIndex:o,overscan:s,count:i}),{key:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=n=>{const s=this.options.indexAttribute,i=n.getAttribute(s);return i?parseInt(i,10):(console.warn(`Missing attribute name '${s}={index}' on measured element.`),-1)},this._measureElement=(n,s)=>{const i=this.indexFromElement(n),r=this.measurementsCache[i];if(!r)return;const o=r.key,a=this.elementsCache.get(o);a!==n&&(a&&this.observer.unobserve(a),this.observer.observe(n),this.elementsCache.set(o,n)),n.isConnected&&this.resizeItem(i,this.options.measureElement(n,s,this))},this.resizeItem=(n,s)=>{const i=this.measurementsCache[n];if(!i)return;const r=this.itemSizeCache.get(i.key)??i.size,o=s-r;o!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(i,o,this):i.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",o),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=o,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(i.index),this.itemSizeCache=new Map(this.itemSizeCache.set(i.key,s)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((s,i)=>{s.isConnected||(this.observer.unobserve(s),this.elementsCache.delete(i))});return}this._measureElement(n,void 0)},this.getVirtualItems=It(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,s)=>{const i=[];for(let r=0,o=n.length;r<o;r++){const a=n[r],l=s[a];i.push(l)}return i},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const s=this.getMeasurements();if(s.length!==0)return or(s[ha(0,s.length-1,i=>or(s[i]).start,n)])},this.getOffsetForAlignment=(n,s,i=0)=>{const r=this.getSize(),o=this.getScrollOffset();s==="auto"&&(s=n>=o+r?"end":"start"),s==="center"?n+=(i-r)/2:s==="end"&&(n-=r);const a=this.getTotalSize()+this.options.scrollMargin-r;return Math.max(Math.min(a,n),0)},this.getOffsetForIndex=(n,s="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const i=this.measurementsCache[n];if(!i)return;const r=this.getSize(),o=this.getScrollOffset();if(s==="auto")if(i.end>=o+r-this.options.scrollPaddingEnd)s="end";else if(i.start<=o+this.options.scrollPaddingStart)s="start";else return[o,s];const a=s==="end"?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,s,i.size),s]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(n,{align:s="start",behavior:i}={})=>{i==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,s),{adjustments:void 0,behavior:i})},this.scrollToIndex=(n,{align:s="auto",behavior:i}={})=>{i==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),n=Math.max(0,Math.min(n,this.options.count-1));let r=0;const o=10,a=u=>{if(!this.targetWindow)return;const c=this.getOffsetForIndex(n,u);if(!c){console.warn("Failed to get offset for index:",n);return}const[h,d]=c;this._scrollToOffset(h,{adjustments:void 0,behavior:i}),this.targetWindow.requestAnimationFrame(()=>{const f=this.getScrollOffset(),p=this.getOffsetForIndex(n,d);if(!p){console.warn("Failed to get offset for index:",n);return}Jm(p[0],f)||l(d)})},l=u=>{this.targetWindow&&(r++,r<o?(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("Schedule retry",r,o),this.targetWindow.requestAnimationFrame(()=>a(u))):console.warn(`Failed to scroll to index ${n} after ${o} attempts.`))};a(s)},this.scrollBy=(n,{behavior:s}={})=>{s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:s})},this.getTotalSize=()=>{var n;const s=this.getMeasurements();let i;if(s.length===0)i=this.options.paddingStart;else if(this.options.lanes===1)i=((n=s[s.length-1])==null?void 0:n.end)??0;else{const r=Array(this.options.lanes).fill(null);let o=s.length-1;for(;o>=0&&r.some(a=>a===null);){const a=s[o];r[a.lane]===null&&(r[a.lane]=a.end),o--}i=Math.max(...r.filter(a=>a!==null))}return Math.max(i-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:s,behavior:i})=>{this.options.scrollToFn(n,{behavior:i,adjustments:s},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(e)}}const ha=(t,e,n,s)=>{for(;t<=e;){const i=(t+e)/2|0,r=n(i);if(r<s)t=i+1;else if(r>s)e=i-1;else return i}return t>0?t-1:0};function ap({measurements:t,outerSize:e,scrollOffset:n,lanes:s}){const i=t.length-1,r=l=>t[l].start;if(t.length<=s)return{startIndex:0,endIndex:i};let o=ha(0,i,r,n),a=o;if(s===1)for(;a<i&&t[a].end<n+e;)a++;else if(s>1){const l=Array(s).fill(0);for(;a<i&&l.some(c=>c<n+e);){const c=t[a];l[c.lane]=c.end,a++}const u=Array(s).fill(n+e);for(;o>=0&&u.some(c=>c>=n);){const c=t[o];u[c.lane]=c.start,o--}o=Math.max(0,o-o%s),a=Math.min(i,a+(s-1-a%s))}return{startIndex:o,endIndex:a}}const ur=typeof document<"u"?V.useLayoutEffect:V.useEffect;function lp(t){const e=V.useReducer(()=>({}),{})[1],n={...t,onChange:(i,r)=>{var o;r?dr.flushSync(e):e(),(o=t.onChange)==null||o.call(t,i,r)}},[s]=V.useState(()=>new op(n));return s.setOptions(n),ur(()=>s._didMount(),[]),ur(()=>s._willUpdate()),s}function cp(t){return lp({observeElementRect:np,observeElementOffset:sp,scrollToFn:rp,...t})}const up="_main_pl2ip_8",hr={main:up},da=w.forwardRef(({children:t,className:e,row:n=!1,estimatedItemHeight:s=100,virtualize:i=!1},r)=>{const o=w.useRef(null),a=w.useMemo(()=>w.Children.toArray(t),[t]),l=cp({count:a.length,getScrollElement:()=>o.current,estimateSize:()=>s,measureElement:c=>c.getBoundingClientRect().height});return w.useImperativeHandle(r,()=>({scrollToTop:()=>l.scrollToOffset(0,{behavior:"smooth"}),scrollToBottom:()=>l.scrollToOffset(l.getTotalSize(),{behavior:"smooth"}),scrollToIndex:(c,h={})=>l.scrollToIndex(c,{behavior:"smooth",...h}),scrollToOffset:(c,h={})=>l.scrollToOffset(c,{behavior:"smooth",...h}),scrollBy:c=>{const h=l.scrollOffset||0;l.scrollToOffset(h+c,{behavior:"smooth"})},getElement:()=>o.current,getScrollOffset:()=>l.scrollOffset||0,getTotalSize:()=>l.getTotalSize()}),[l]),w.useMemo(()=>i||a.length>50,[i,a])&&a.length>0?b.jsx(A,{ref:o,className:I(hr.main,e),w:"full",row:n,p:"var(--spacing-2xl)",children:b.jsx(A,{style:{height:`${l.getTotalSize()}px`,position:"relative"},children:l.getVirtualItems().map(c=>b.jsx(A,{"data-index":c.index,ref:l.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${c.start}px)`},children:a[c.index]},c.key))})}):b.jsx(A,{ref:o,className:I(hr.main,e),w:"full",row:n,pl:"var(--spacing-2xl)",pr:"var(--spacing-xs)",children:b.jsx(A,{py:"var(--spacing-2xl)",pr:"var(--spacing-xl)",children:t})})});da.displayName="ModalMain";const Qe=Tr;Qe.Header=ca;Qe.Main=da;Qe.Footer=ua;const hp="_themeProviderScoped_10kh5_9",dp={themeProviderScoped:hp};function fp({className:t,children:e,theme:n}){return b.jsx("div",{className:At(dp.themeProviderScoped,t),id:"theme-provider-scoped","data-theme":n,children:e})}exports.AnimatedText=ra;exports.Avatar=Qf;exports.Box=A;exports.Button=Ef;exports.Checkbox=ks;exports.Hint=xm;exports.IconButton=Yn;exports.Input=oa;exports.Modal=Qe;exports.Portal=aa;exports.Ripple=xe;exports.Select=km;exports.Switch=la;exports.Tag=Rs;exports.Text=O;exports.ThemeProviderScoped=fp;exports.getSizeClass=he;exports.getStyleClass=qe;exports.useControlled=Ge;exports.useDropdownPosition=_r;