@telegraph/combobox 0.0.91 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.mjs +76 -71
- package/dist/esm/index.mjs.map +1 -1
- package/dist/types/Combobox/Combobox.d.ts.map +1 -1
- package/dist/types/Combobox/Combobox.primitives.d.ts.map +1 -1
- package/package.json +11 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# @telegraph/combobox
|
|
2
2
|
|
|
3
|
+
## 0.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#524](https://github.com/knocklabs/telegraph/pull/524) [`fd14d50`](https://github.com/knocklabs/telegraph/commit/fd14d509c3f3f76eafc07d08c73e30db79255a2e) Thanks [@kylemcd](https://github.com/kylemcd)! - bump packages to get tokens upgrades
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`fd14d50`](https://github.com/knocklabs/telegraph/commit/fd14d509c3f3f76eafc07d08c73e30db79255a2e)]:
|
|
10
|
+
- @telegraph/button@0.1.1
|
|
11
|
+
- @telegraph/icon@0.2.1
|
|
12
|
+
- @telegraph/input@0.1.1
|
|
13
|
+
- @telegraph/menu@0.1.1
|
|
14
|
+
- @telegraph/tag@0.0.94
|
|
15
|
+
- @telegraph/layout@0.2.1
|
|
16
|
+
- @telegraph/typography@0.1.23
|
|
17
|
+
- @telegraph/tooltip@0.0.54
|
|
18
|
+
- @telegraph/truncate@0.0.9
|
|
19
|
+
|
|
20
|
+
## 0.1.0
|
|
21
|
+
|
|
22
|
+
### Minor Changes
|
|
23
|
+
|
|
24
|
+
- [#519](https://github.com/knocklabs/telegraph/pull/519) [`aa0df27`](https://github.com/knocklabs/telegraph/commit/aa0df2714578f411fd7c80ce3610713d6e77d053) Thanks [@ksorathia](https://github.com/ksorathia)! - Standardize spacing and style across primitives.
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- Updated dependencies [[`aa0df27`](https://github.com/knocklabs/telegraph/commit/aa0df2714578f411fd7c80ce3610713d6e77d053)]:
|
|
29
|
+
- @telegraph/button@0.1.0
|
|
30
|
+
- @telegraph/input@0.1.0
|
|
31
|
+
- @telegraph/icon@0.2.0
|
|
32
|
+
- @telegraph/menu@0.1.0
|
|
33
|
+
- @telegraph/tag@0.0.93
|
|
34
|
+
|
|
3
35
|
## 0.0.91
|
|
4
36
|
|
|
5
37
|
### Patch Changes
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("react/jsx-runtime"),_s=require("@radix-ui/react-dismissable-layer"),Hs=require("@radix-ui/react-portal"),qs=require("@radix-ui/react-use-controllable-state"),Gs=require("@radix-ui/react-visually-hidden"),oe=require("@telegraph/button"),vn=require("@telegraph/compose-refs"),Us=require("@telegraph/helpers"),xn=require("@telegraph/icon"),zs=require("@telegraph/input"),_=require("@telegraph/layout"),Ee=require("@telegraph/menu"),dt=require("@telegraph/typography"),Q=require("lucide-react"),p=require("react"),ht=require("@telegraph/tag"),Ys=require("@telegraph/tooltip"),Tn=require("@telegraph/truncate");function wn(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const Xs=wn(Hs),Qs=wn(Gs),Zs=p.createContext({});function Js(e){const t=p.useRef(null);return t.current===null&&(t.current=e()),t.current}const pt=typeof window<"u",er=pt?p.useLayoutEffect:p.useEffect,Sn=p.createContext(null);function tr(e,t){e.indexOf(t)===-1&&e.push(t)}function nr(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Z=(e,t,n)=>n>t?t:n<e?e:n;let ve=()=>{},J=()=>{};process.env.NODE_ENV!=="production"&&(ve=(e,t)=>{!e&&typeof console<"u"&&console.warn(t)},J=(e,t)=>{if(!e)throw new Error(t)});const K={},Vn=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function sr(e){return typeof e=="object"&&e!==null}const Cn=e=>/^0[^.\s]+$/u.test(e);function mt(e){let t;return()=>(t===void 0&&(t=e()),t)}const ae=e=>e,rr=(e,t)=>n=>t(e(n)),Ie=(...e)=>e.reduce(rr),An=(e,t,n)=>{const s=t-e;return s===0?1:(n-e)/s};class Mn{constructor(){this.subscriptions=[]}add(t){return tr(this.subscriptions,t),()=>nr(this.subscriptions,t)}notify(t,n,s){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](t,n,s);else for(let i=0;i<r;i++){const o=this.subscriptions[i];o&&o(t,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const B=e=>e*1e3,N=e=>e/1e3;function Pn(e,t){return t?e*(1e3/t):0}const $t=new Set;function Rn(e,t,n){e||$t.has(t)||(console.warn(t),$t.add(t))}const Fn=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,ir=1e-7,or=12;function ar(e,t,n,s,r){let i,o,a=0;do o=t+(n-t)/2,i=Fn(o,s,r)-e,i>0?n=o:t=o;while(Math.abs(i)>ir&&++a<or);return o}function xe(e,t,n,s){if(e===t&&n===s)return ae;const r=i=>ar(i,0,1,e,n);return i=>i===0||i===1?i:Fn(r(i),t,s)}const Dn=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,On=e=>t=>1-e(1-t),En=xe(.33,1.53,.69,.99),gt=On(En),In=Dn(gt),kn=e=>(e*=2)<1?.5*gt(e):.5*(2-Math.pow(2,-10*(e-1))),yt=e=>1-Math.sin(Math.acos(e)),cr=On(yt),jn=Dn(yt),ur=xe(.42,0,1,1),lr=xe(0,0,.58,1),Bn=xe(.42,0,.58,1),fr=e=>Array.isArray(e)&&typeof e[0]!="number",Ln=e=>Array.isArray(e)&&typeof e[0]=="number",Wt={linear:ae,easeIn:ur,easeInOut:Bn,easeOut:lr,circIn:yt,circInOut:jn,circOut:cr,backIn:gt,backInOut:In,backOut:En,anticipate:kn},dr=e=>typeof e=="string",_t=e=>{if(Ln(e)){J(e.length===4,"Cubic bezier arrays must contain four numerical values.");const[t,n,s,r]=e;return xe(t,n,s,r)}else if(dr(e))return J(Wt[e]!==void 0,`Invalid easing type '${e}'`),Wt[e];return e},we=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function hr(e,t){let n=new Set,s=new Set,r=!1,i=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function u(c){o.has(c)&&(l.schedule(c),e()),c(a)}const l={schedule:(c,d=!1,f=!1)=>{const g=f&&r?n:s;return d&&o.add(c),g.has(c)||g.add(c),c},cancel:c=>{s.delete(c),o.delete(c)},process:c=>{if(a=c,r){i=!0;return}r=!0,[n,s]=[s,n],n.forEach(u),n.clear(),r=!1,i&&(i=!1,l.process(c))}};return l}const pr=40;function Nn(e,t){let n=!1,s=!0;const r={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=we.reduce((x,A)=>(x[A]=hr(i),x),{}),{setup:a,read:u,resolveKeyframes:l,preUpdate:c,update:d,preRender:f,render:h,postRender:g}=o,y=()=>{const x=K.useManualTiming?r.timestamp:performance.now();n=!1,K.useManualTiming||(r.delta=s?1e3/60:Math.max(Math.min(x-r.timestamp,pr),1)),r.timestamp=x,r.isProcessing=!0,a.process(r),u.process(r),l.process(r),c.process(r),d.process(r),f.process(r),h.process(r),g.process(r),r.isProcessing=!1,n&&t&&(s=!1,e(y))},v=()=>{n=!0,s=!0,r.isProcessing||e(y)};return{schedule:we.reduce((x,A)=>{const S=o[A];return x[A]=(C,M=!1,V=!1)=>(n||v(),S.schedule(C,M,V)),x},{}),cancel:x=>{for(let A=0;A<we.length;A++)o[we[A]].cancel(x)},state:r,steps:o}}const{schedule:j,cancel:ze,state:Me}=Nn(typeof requestAnimationFrame<"u"?requestAnimationFrame:ae,!0);let Ve;function mr(){Ve=void 0}const k={now:()=>(Ve===void 0&&k.set(Me.isProcessing||K.useManualTiming?Me.timestamp:performance.now()),Ve),set:e=>{Ve=e,queueMicrotask(mr)}},Kn=e=>t=>typeof t=="string"&&t.startsWith(e),$n=Kn("--"),gr=Kn("var(--"),bt=e=>gr(e)?yr.test(e.split("/*")[0].trim()):!1,yr=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,ce={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},me={...ce,transform:e=>Z(0,1,e)},Se={...ce,default:1},pe=e=>Math.round(e*1e5)/1e5,vt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function br(e){return e==null}const vr=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,xt=(e,t)=>n=>!!(typeof n=="string"&&vr.test(n)&&n.startsWith(e)||t&&!br(n)&&Object.prototype.hasOwnProperty.call(n,t)),Wn=(e,t,n)=>s=>{if(typeof s!="string")return s;const[r,i,o,a]=s.match(vt);return{[e]:parseFloat(r),[t]:parseFloat(i),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},xr=e=>Z(0,255,e),$e={...ce,transform:e=>Math.round(xr(e))},U={test:xt("rgb","red"),parse:Wn("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:s=1})=>"rgba("+$e.transform(e)+", "+$e.transform(t)+", "+$e.transform(n)+", "+pe(me.transform(s))+")"};function Tr(e){let t="",n="",s="",r="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),s=e.substring(5,7),r=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),s=e.substring(3,4),r=e.substring(4,5),t+=t,n+=n,s+=s,r+=r),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:r?parseInt(r,16)/255:1}}const Ye={test:xt("#"),parse:Tr,transform:U.transform},Te=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),$=Te("deg"),re=Te("%"),T=Te("px"),wr=Te("vh"),Sr=Te("vw"),Ht={...re,parse:e=>re.parse(e)/100,transform:e=>re.transform(e*100)},ne={test:xt("hsl","hue"),parse:Wn("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:s=1})=>"hsla("+Math.round(e)+", "+re.transform(pe(t))+", "+re.transform(pe(n))+", "+pe(me.transform(s))+")"},R={test:e=>U.test(e)||Ye.test(e)||ne.test(e),parse:e=>U.test(e)?U.parse(e):ne.test(e)?ne.parse(e):Ye.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?U.transform(e):ne.transform(e),getAnimatableNone:e=>{const t=R.parse(e);return t.alpha=0,R.transform(t)}},Vr=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Cr(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(vt))==null?void 0:t.length)||0)+(((n=e.match(Vr))==null?void 0:n.length)||0)>0}const _n="number",Hn="color",Ar="var",Mr="var(",qt="${}",Pr=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function ge(e){const t=e.toString(),n=[],s={color:[],number:[],var:[]},r=[];let i=0;const a=t.replace(Pr,u=>(R.test(u)?(s.color.push(i),r.push(Hn),n.push(R.parse(u))):u.startsWith(Mr)?(s.var.push(i),r.push(Ar),n.push(u)):(s.number.push(i),r.push(_n),n.push(parseFloat(u))),++i,qt)).split(qt);return{values:n,split:a,indexes:s,types:r}}function qn(e){return ge(e).values}function Gn(e){const{split:t,types:n}=ge(e),s=t.length;return r=>{let i="";for(let o=0;o<s;o++)if(i+=t[o],r[o]!==void 0){const a=n[o];a===_n?i+=pe(r[o]):a===Hn?i+=R.transform(r[o]):i+=r[o]}return i}}const Rr=e=>typeof e=="number"?0:R.test(e)?R.getAnimatableNone(e):e;function Fr(e){const t=qn(e);return Gn(e)(t.map(Rr))}const ue={test:Cr,parse:qn,createTransformer:Gn,getAnimatableNone:Fr};function We(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Dr({hue:e,saturation:t,lightness:n,alpha:s}){e/=360,t/=100,n/=100;let r=0,i=0,o=0;if(!t)r=i=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,u=2*n-a;r=We(u,a,e+1/3),i=We(u,a,e),o=We(u,a,e-1/3)}return{red:Math.round(r*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:s}}function Pe(e,t){return n=>n>0?t:e}const ke=(e,t,n)=>e+(t-e)*n,_e=(e,t,n)=>{const s=e*e,r=n*(t*t-s)+s;return r<0?0:Math.sqrt(r)},Or=[Ye,U,ne],Er=e=>Or.find(t=>t.test(e));function Gt(e){const t=Er(e);if(ve(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`),!t)return!1;let n=t.parse(e);return t===ne&&(n=Dr(n)),n}const Ut=(e,t)=>{const n=Gt(e),s=Gt(t);if(!n||!s)return Pe(e,t);const r={...n};return i=>(r.red=_e(n.red,s.red,i),r.green=_e(n.green,s.green,i),r.blue=_e(n.blue,s.blue,i),r.alpha=ke(n.alpha,s.alpha,i),U.transform(r))},Xe=new Set(["none","hidden"]);function Ir(e,t){return Xe.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function kr(e,t){return n=>ke(e,t,n)}function Tt(e){return typeof e=="number"?kr:typeof e=="string"?bt(e)?Pe:R.test(e)?Ut:Lr:Array.isArray(e)?Un:typeof e=="object"?R.test(e)?Ut:jr:Pe}function Un(e,t){const n=[...e],s=n.length,r=e.map((i,o)=>Tt(i)(i,t[o]));return i=>{for(let o=0;o<s;o++)n[o]=r[o](i);return n}}function jr(e,t){const n={...e,...t},s={};for(const r in n)e[r]!==void 0&&t[r]!==void 0&&(s[r]=Tt(e[r])(e[r],t[r]));return r=>{for(const i in s)n[i]=s[i](r);return n}}function Br(e,t){const n=[],s={color:0,var:0,number:0};for(let r=0;r<t.values.length;r++){const i=t.types[r],o=e.indexes[i][s[i]],a=e.values[o]??0;n[r]=a,s[i]++}return n}const Lr=(e,t)=>{const n=ue.createTransformer(t),s=ge(e),r=ge(t);return s.indexes.var.length===r.indexes.var.length&&s.indexes.color.length===r.indexes.color.length&&s.indexes.number.length>=r.indexes.number.length?Xe.has(e)&&!r.values.length||Xe.has(t)&&!s.values.length?Ir(e,t):Ie(Un(Br(s,r),r.values),n):(ve(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),Pe(e,t))};function zn(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?ke(e,t,n):Tt(e)(e,t)}const Nr=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>j.update(t,n),stop:()=>ze(t),now:()=>Me.isProcessing?Me.timestamp:k.now()}},Yn=(e,t,n=10)=>{let s="";const r=Math.max(Math.round(t/n),2);for(let i=0;i<r;i++)s+=Math.round(e(i/(r-1))*1e4)/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},Re=2e4;function wt(e){let t=0;const n=50;let s=e.next(t);for(;!s.done&&t<Re;)t+=n,s=e.next(t);return t>=Re?1/0:t}function Kr(e,t=100,n){const s=n({...e,keyframes:[0,t]}),r=Math.min(wt(s),Re);return{type:"keyframes",ease:i=>s.next(r*i).value/t,duration:N(r)}}const $r=5;function Xn(e,t,n){const s=Math.max(t-$r,0);return Pn(n-e(s),t-s)}const P={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},He=.001;function Wr({duration:e=P.duration,bounce:t=P.bounce,velocity:n=P.velocity,mass:s=P.mass}){let r,i;ve(e<=B(P.maxDuration),"Spring duration must be 10 seconds or less");let o=1-t;o=Z(P.minDamping,P.maxDamping,o),e=Z(P.minDuration,P.maxDuration,N(e)),o<1?(r=l=>{const c=l*o,d=c*e,f=c-n,h=Qe(l,o),g=Math.exp(-d);return He-f/h*g},i=l=>{const d=l*o*e,f=d*n+n,h=Math.pow(o,2)*Math.pow(l,2)*e,g=Math.exp(-d),y=Qe(Math.pow(l,2),o);return(-r(l)+He>0?-1:1)*((f-h)*g)/y}):(r=l=>{const c=Math.exp(-l*e),d=(l-n)*e+1;return-He+c*d},i=l=>{const c=Math.exp(-l*e),d=(n-l)*(e*e);return c*d});const a=5/e,u=Hr(r,i,a);if(e=B(e),isNaN(u))return{stiffness:P.stiffness,damping:P.damping,duration:e};{const l=Math.pow(u,2)*s;return{stiffness:l,damping:o*2*Math.sqrt(s*l),duration:e}}}const _r=12;function Hr(e,t,n){let s=n;for(let r=1;r<_r;r++)s=s-e(s)/t(s);return s}function Qe(e,t){return e*Math.sqrt(1-t*t)}const qr=["duration","bounce"],Gr=["stiffness","damping","mass"];function zt(e,t){return t.some(n=>e[n]!==void 0)}function Ur(e){let t={velocity:P.velocity,stiffness:P.stiffness,damping:P.damping,mass:P.mass,isResolvedFromDuration:!1,...e};if(!zt(e,Gr)&&zt(e,qr))if(e.visualDuration){const n=e.visualDuration,s=2*Math.PI/(n*1.2),r=s*s,i=2*Z(.05,1,1-(e.bounce||0))*Math.sqrt(r);t={...t,mass:P.mass,stiffness:r,damping:i}}else{const n=Wr(e);t={...t,...n,mass:P.mass},t.isResolvedFromDuration=!0}return t}function Fe(e=P.visualDuration,t=P.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:s,restDelta:r}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:i},{stiffness:u,damping:l,mass:c,duration:d,velocity:f,isResolvedFromDuration:h}=Ur({...n,velocity:-N(n.velocity||0)}),g=f||0,y=l/(2*Math.sqrt(u*c)),v=o-i,m=N(Math.sqrt(u/c)),w=Math.abs(v)<5;s||(s=w?P.restSpeed.granular:P.restSpeed.default),r||(r=w?P.restDelta.granular:P.restDelta.default);let x;if(y<1){const S=Qe(m,y);x=C=>{const M=Math.exp(-y*m*C);return o-M*((g+y*m*v)/S*Math.sin(S*C)+v*Math.cos(S*C))}}else if(y===1)x=S=>o-Math.exp(-m*S)*(v+(g+m*v)*S);else{const S=m*Math.sqrt(y*y-1);x=C=>{const M=Math.exp(-y*m*C),V=Math.min(S*C,300);return o-M*((g+y*m*v)*Math.sinh(V)+S*v*Math.cosh(V))/S}}const A={calculatedDuration:h&&d||null,next:S=>{const C=x(S);if(h)a.done=S>=d;else{let M=S===0?g:0;y<1&&(M=S===0?B(g):Xn(x,S,C));const V=Math.abs(M)<=s,F=Math.abs(o-C)<=r;a.done=V&&F}return a.value=a.done?o:C,a},toString:()=>{const S=Math.min(wt(A),Re),C=Yn(M=>A.next(S*M).value,S,30);return S+"ms "+C},toTransition:()=>{}};return A}Fe.applyToOptions=e=>{const t=Kr(e,100,Fe);return e.ease=t.ease,e.duration=B(t.duration),e.type="keyframes",e};function Ze({keyframes:e,velocity:t=0,power:n=.8,timeConstant:s=325,bounceDamping:r=10,bounceStiffness:i=500,modifyTarget:o,min:a,max:u,restDelta:l=.5,restSpeed:c}){const d=e[0],f={done:!1,value:d},h=V=>a!==void 0&&V<a||u!==void 0&&V>u,g=V=>a===void 0?u:u===void 0||Math.abs(a-V)<Math.abs(u-V)?a:u;let y=n*t;const v=d+y,m=o===void 0?v:o(v);m!==v&&(y=m-d);const w=V=>-y*Math.exp(-V/s),x=V=>m+w(V),A=V=>{const F=w(V),I=x(V);f.done=Math.abs(F)<=l,f.value=f.done?m:I};let S,C;const M=V=>{h(f.value)&&(S=V,C=Fe({keyframes:[f.value,g(f.value)],velocity:Xn(x,V,f.value),damping:r,stiffness:i,restDelta:l,restSpeed:c}))};return M(0),{calculatedDuration:null,next:V=>{let F=!1;return!C&&S===void 0&&(F=!0,A(V),M(V)),S!==void 0&&V>=S?C.next(V-S):(!F&&A(V),f)}}}function zr(e,t,n){const s=[],r=n||K.mix||zn,i=e.length-1;for(let o=0;o<i;o++){let a=r(e[o],e[o+1]);if(t){const u=Array.isArray(t)?t[o]||ae:t;a=Ie(u,a)}s.push(a)}return s}function Yr(e,t,{clamp:n=!0,ease:s,mixer:r}={}){const i=e.length;if(J(i===t.length,"Both input and output ranges must be the same length"),i===1)return()=>t[0];if(i===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=zr(t,s,r),u=a.length,l=c=>{if(o&&c<e[0])return t[0];let d=0;if(u>1)for(;d<e.length-2&&!(c<e[d+1]);d++);const f=An(e[d],e[d+1],c);return a[d](f)};return n?c=>l(Z(e[0],e[i-1],c)):l}function Xr(e,t){const n=e[e.length-1];for(let s=1;s<=t;s++){const r=An(0,t,s);e.push(ke(n,1,r))}}function Qr(e){const t=[0];return Xr(t,e.length-1),t}function Zr(e,t){return e.map(n=>n*t)}function Jr(e,t){return e.map(()=>t||Bn).splice(0,e.length-1)}function se({duration:e=300,keyframes:t,times:n,ease:s="easeInOut"}){const r=fr(s)?s.map(_t):_t(s),i={done:!1,value:t[0]},o=Zr(n&&n.length===t.length?n:Qr(t),e),a=Yr(o,t,{ease:Array.isArray(r)?r:Jr(t,r)});return{calculatedDuration:e,next:u=>(i.value=a(u),i.done=u>=e,i)}}const ei=e=>e!==null;function St(e,{repeat:t,repeatType:n="loop"},s,r=1){const i=e.filter(ei),a=r<0||t&&n!=="loop"&&t%2===1?0:i.length-1;return!a||s===void 0?i[a]:s}const ti={decay:Ze,inertia:Ze,tween:se,keyframes:se,spring:Fe};function Qn(e){typeof e.type=="string"&&(e.type=ti[e.type])}class Vt{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const ni=e=>e/100;class Ct extends Vt{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var s,r;const{motionValue:n}=this.options;n&&n.updatedAt!==k.now()&&this.tick(k.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(r=(s=this.options).onStop)==null||r.call(s))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;Qn(t);const{type:n=se,repeat:s=0,repeatDelay:r=0,repeatType:i,velocity:o=0}=t;let{keyframes:a}=t;const u=n||se;process.env.NODE_ENV!=="production"&&u!==se&&J(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`),u!==se&&typeof a[0]!="number"&&(this.mixKeyframes=Ie(ni,zn(a[0],a[1])),a=[0,100]);const l=u({...t,keyframes:a});i==="mirror"&&(this.mirroredGenerator=u({...t,keyframes:[...a].reverse(),velocity:-o})),l.calculatedDuration===null&&(l.calculatedDuration=wt(l));const{calculatedDuration:c}=l;this.calculatedDuration=c,this.resolvedDuration=c+r,this.totalDuration=this.resolvedDuration*(s+1)-r,this.generator=l}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:s,totalDuration:r,mixKeyframes:i,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:u}=this;if(this.startTime===null)return s.next(0);const{delay:l=0,keyframes:c,repeat:d,repeatType:f,repeatDelay:h,type:g,onUpdate:y,finalKeyframe:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-r/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const m=this.currentTime-l*(this.playbackSpeed>=0?1:-1),w=this.playbackSpeed>=0?m<0:m>r;this.currentTime=Math.max(m,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=r);let x=this.currentTime,A=s;if(d){const V=Math.min(this.currentTime,r)/a;let F=Math.floor(V),I=V%1;!I&&V>=1&&(I=1),I===1&&F--,F=Math.min(F,d+1),!!(F%2)&&(f==="reverse"?(I=1-I,h&&(I-=h/a)):f==="mirror"&&(A=o)),x=Z(0,1,I)*a}const S=w?{done:!1,value:c[0]}:A.next(x);i&&(S.value=i(S.value));let{done:C}=S;!w&&u!==null&&(C=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);const M=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&C);return M&&g!==Ze&&(S.value=St(c,this.options,v,this.speed)),y&&y(S.value),M&&this.finish(),S}then(t,n){return this.finished.then(t,n)}get duration(){return N(this.calculatedDuration)}get time(){return N(this.currentTime)}set time(t){var n;t=B(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(k.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=N(this.currentTime))}play(){var r,i;if(this.isStopped)return;const{driver:t=Nr,startTime:n}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),(i=(r=this.options).onPlay)==null||i.call(r);const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=n??s),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(k.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function si(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const z=e=>e*180/Math.PI,Je=e=>{const t=z(Math.atan2(e[1],e[0]));return et(t)},ri={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Je,rotateZ:Je,skewX:e=>z(Math.atan(e[1])),skewY:e=>z(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},et=e=>(e=e%360,e<0&&(e+=360),e),Yt=Je,Xt=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Qt=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),ii={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Xt,scaleY:Qt,scale:e=>(Xt(e)+Qt(e))/2,rotateX:e=>et(z(Math.atan2(e[6],e[5]))),rotateY:e=>et(z(Math.atan2(-e[2],e[0]))),rotateZ:Yt,rotate:Yt,skewX:e=>z(Math.atan(e[4])),skewY:e=>z(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function tt(e){return e.includes("scale")?1:0}function nt(e,t){if(!e||e==="none")return tt(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,r;if(n)s=ii,r=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=ri,r=a}if(!r)return tt(t);const i=s[t],o=r[1].split(",").map(ai);return typeof i=="function"?i(o):o[i]}const oi=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return nt(n,t)};function ai(e){return parseFloat(e.trim())}const le=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],fe=new Set(le),Zt=e=>e===ce||e===T,ci=new Set(["x","y","z"]),ui=le.filter(e=>!ci.has(e));function li(e){const t=[];return ui.forEach(n=>{const s=e.getValue(n);s!==void 0&&(t.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),t}const Y={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>nt(t,"x"),y:(e,{transform:t})=>nt(t,"y")};Y.translateX=Y.x;Y.translateY=Y.y;const X=new Set;let st=!1,rt=!1,it=!1;function Zn(){if(rt){const e=Array.from(X).filter(s=>s.needsMeasurement),t=new Set(e.map(s=>s.element)),n=new Map;t.forEach(s=>{const r=li(s);r.length&&(n.set(s,r),s.render())}),e.forEach(s=>s.measureInitialState()),t.forEach(s=>{s.render();const r=n.get(s);r&&r.forEach(([i,o])=>{var a;(a=s.getValue(i))==null||a.set(o)})}),e.forEach(s=>s.measureEndState()),e.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}rt=!1,st=!1,X.forEach(e=>e.complete(it)),X.clear()}function Jn(){X.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(rt=!0)})}function fi(){it=!0,Jn(),Zn(),it=!1}class At{constructor(t,n,s,r,i,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=s,this.motionValue=r,this.element=i,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(X.add(this),st||(st=!0,j.read(Jn),j.resolveKeyframes(Zn))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:s,motionValue:r}=this;if(t[0]===null){const i=r==null?void 0:r.get(),o=t[t.length-1];if(i!==void 0)t[0]=i;else if(s&&n){const a=s.readValue(n,o);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=o),r&&i===void 0&&r.set(t[0])}si(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),X.delete(this)}cancel(){this.state==="scheduled"&&(X.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const di=e=>e.startsWith("--");function hi(e,t,n){di(t)?e.style.setProperty(t,n):e.style[t]=n}const pi=mt(()=>window.ScrollTimeline!==void 0),mi={};function gi(e,t){const n=mt(e);return()=>mi[t]??n()}const es=gi(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),he=([e,t,n,s])=>`cubic-bezier(${e}, ${t}, ${n}, ${s})`,Jt={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:he([0,.65,.55,1]),circOut:he([.55,0,1,.45]),backIn:he([.31,.01,.66,-.59]),backOut:he([.33,1.53,.69,.99])};function ts(e,t){if(e)return typeof e=="function"?es()?Yn(e,t):"ease-out":Ln(e)?he(e):Array.isArray(e)?e.map(n=>ts(n,t)||Jt.easeOut):Jt[e]}function yi(e,t,n,{delay:s=0,duration:r=300,repeat:i=0,repeatType:o="loop",ease:a="easeOut",times:u}={},l=void 0){const c={[t]:n};u&&(c.offset=u);const d=ts(a,r);Array.isArray(d)&&(c.easing=d);const f={delay:s,duration:r,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"};return l&&(f.pseudoElement=l),e.animate(c,f)}function ns(e){return typeof e=="function"&&"applyToOptions"in e}function bi({type:e,...t}){return ns(e)&&es()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class vi extends Vt{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:n,name:s,keyframes:r,pseudoElement:i,allowFlatten:o=!1,finalKeyframe:a,onComplete:u}=t;this.isPseudoElement=!!i,this.allowFlatten=o,this.options=t,J(typeof t.type!="string",`animateMini doesn't support "type" as a string. Did you mean to import { spring } from "motion"?`);const l=bi(t);this.animation=yi(n,s,r,l,i),l.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const c=St(r,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(c):hi(n,s,c),this.animation.cancel()}u==null||u(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var t,n;this.isPseudoElement||(n=(t=this.animation).commitStyles)==null||n.call(t)}get duration(){var n,s;const t=((s=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:s.call(n).duration)||0;return N(Number(t))}get time(){return N(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=B(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){var s;return this.allowFlatten&&((s=this.animation.effect)==null||s.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&pi()?(this.animation.timeline=t,ae):n(this)}}const ss={anticipate:kn,backInOut:In,circInOut:jn};function xi(e){return e in ss}function Ti(e){typeof e.ease=="string"&&xi(e.ease)&&(e.ease=ss[e.ease])}const en=10;class wi extends vi{constructor(t){Ti(t),Qn(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:s,onComplete:r,element:i,...o}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const a=new Ct({...o,autoplay:!1}),u=B(this.finishedTime??this.time);n.setWithVelocity(a.sample(u-en).value,a.sample(u).value,en),a.stop()}}const tn=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(ue.test(e)||e==="0")&&!e.startsWith("url("));function Si(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function Vi(e,t,n,s){const r=e[0];if(r===null)return!1;if(t==="display"||t==="visibility")return!0;const i=e[e.length-1],o=tn(r,t),a=tn(i,t);return ve(o===a,`You are trying to animate ${t} from "${r}" to "${i}". ${r} is not an animatable value - to enable this animation set ${r} to a value animatable to ${i} via the \`style\` property.`),!o||!a?!1:Si(e)||(n==="spring"||ns(n))&&s}function rs(e){return sr(e)&&"offsetHeight"in e}const Ci=new Set(["opacity","clipPath","filter","transform"]),Ai=mt(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Mi(e){var l;const{motionValue:t,name:n,repeatDelay:s,repeatType:r,damping:i,type:o}=e;if(!rs((l=t==null?void 0:t.owner)==null?void 0:l.current))return!1;const{onUpdate:a,transformTemplate:u}=t.owner.getProps();return Ai()&&n&&Ci.has(n)&&(n!=="transform"||!u)&&!a&&!s&&r!=="mirror"&&i!==0&&o!=="inertia"}const Pi=40;class Ri extends Vt{constructor({autoplay:t=!0,delay:n=0,type:s="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:o="loop",keyframes:a,name:u,motionValue:l,element:c,...d}){var g;super(),this.stop=()=>{var y,v;this._animation&&(this._animation.stop(),(y=this.stopTimeline)==null||y.call(this)),(v=this.keyframeResolver)==null||v.cancel()},this.createdAt=k.now();const f={autoplay:t,delay:n,type:s,repeat:r,repeatDelay:i,repeatType:o,name:u,motionValue:l,element:c,...d},h=(c==null?void 0:c.KeyframeResolver)||At;this.keyframeResolver=new h(a,(y,v,m)=>this.onKeyframesResolved(y,v,f,!m),u,l,c),(g=this.keyframeResolver)==null||g.scheduleResolve()}onKeyframesResolved(t,n,s,r){this.keyframeResolver=void 0;const{name:i,type:o,velocity:a,delay:u,isHandoff:l,onUpdate:c}=s;this.resolvedAt=k.now(),Vi(t,i,o,a)||((K.instantAnimations||!u)&&(c==null||c(St(t,s,n))),t[0]=t[t.length-1],s.duration=0,s.repeat=0);const f={startTime:r?this.resolvedAt?this.resolvedAt-this.createdAt>Pi?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:t},h=!l&&Mi(f)?new wi({...f,element:f.motionValue.owner.current}):new Ct(f);h.finished.then(()=>this.notifyFinished()).catch(ae),this.pendingTimeline&&(this.stopTimeline=h.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=h}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),fi()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}const Fi=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Di(e){const t=Fi.exec(e);if(!t)return[,];const[,n,s,r]=t;return[`--${n??s}`,r]}const Oi=4;function is(e,t,n=1){J(n<=Oi,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[s,r]=Di(e);if(!s)return;const i=window.getComputedStyle(t).getPropertyValue(s);if(i){const o=i.trim();return Vn(o)?parseFloat(o):o}return bt(r)?is(r,t,n+1):r}function os(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const as=new Set(["width","height","top","left","right","bottom",...le]),Ei={test:e=>e==="auto",parse:e=>e},cs=e=>t=>t.test(e),us=[ce,T,re,$,Sr,wr,Ei],nn=e=>us.find(cs(e));function Ii(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Cn(e):!0}const ki=new Set(["brightness","contrast","saturate","opacity"]);function ji(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[s]=n.match(vt)||[];if(!s)return e;const r=n.replace(s,"");let i=ki.has(t)?1:0;return s!==n&&(i*=100),t+"("+i+r+")"}const Bi=/\b([a-z-]*)\(.*?\)/gu,ot={...ue,getAnimatableNone:e=>{const t=e.match(Bi);return t?t.map(ji).join(" "):e}},sn={...ce,transform:Math.round},Li={rotate:$,rotateX:$,rotateY:$,rotateZ:$,scale:Se,scaleX:Se,scaleY:Se,scaleZ:Se,skew:$,skewX:$,skewY:$,distance:T,translateX:T,translateY:T,translateZ:T,x:T,y:T,z:T,perspective:T,transformPerspective:T,opacity:me,originX:Ht,originY:Ht,originZ:T},Mt={borderWidth:T,borderTopWidth:T,borderRightWidth:T,borderBottomWidth:T,borderLeftWidth:T,borderRadius:T,radius:T,borderTopLeftRadius:T,borderTopRightRadius:T,borderBottomRightRadius:T,borderBottomLeftRadius:T,width:T,maxWidth:T,height:T,maxHeight:T,top:T,right:T,bottom:T,left:T,padding:T,paddingTop:T,paddingRight:T,paddingBottom:T,paddingLeft:T,margin:T,marginTop:T,marginRight:T,marginBottom:T,marginLeft:T,backgroundPositionX:T,backgroundPositionY:T,...Li,zIndex:sn,fillOpacity:me,strokeOpacity:me,numOctaves:sn},Ni={...Mt,color:R,backgroundColor:R,outlineColor:R,fill:R,stroke:R,borderColor:R,borderTopColor:R,borderRightColor:R,borderBottomColor:R,borderLeftColor:R,filter:ot,WebkitFilter:ot},ls=e=>Ni[e];function fs(e,t){let n=ls(e);return n!==ot&&(n=ue),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Ki=new Set(["auto","none","0"]);function $i(e,t,n){let s=0,r;for(;s<e.length&&!r;){const i=e[s];typeof i=="string"&&!Ki.has(i)&&ge(i).values.length&&(r=e[s]),s++}if(r&&n)for(const i of t)e[i]=fs(n,r)}class Wi extends At{constructor(t,n,s,r,i){super(t,n,s,r,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let u=0;u<t.length;u++){let l=t[u];if(typeof l=="string"&&(l=l.trim(),bt(l))){const c=is(l,n.current);c!==void 0&&(t[u]=c),u===t.length-1&&(this.finalKeyframe=l)}}if(this.resolveNoneKeyframes(),!as.has(s)||t.length!==2)return;const[r,i]=t,o=nn(r),a=nn(i);if(o!==a)if(Zt(o)&&Zt(a))for(let u=0;u<t.length;u++){const l=t[u];typeof l=="string"&&(t[u]=parseFloat(l))}else Y[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,s=[];for(let r=0;r<t.length;r++)(t[r]===null||Ii(t[r]))&&s.push(r);s.length&&$i(t,s,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:s}=this;if(!t||!t.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Y[s](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const r=n[n.length-1];r!==void 0&&t.getValue(s,r).jump(r,!1)}measureEndState(){var a;const{element:t,name:n,unresolvedKeyframes:s}=this;if(!t||!t.current)return;const r=t.getValue(n);r&&r.jump(this.measuredOrigin,!1);const i=s.length-1,o=s[i];s[i]=Y[n](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([u,l])=>{t.getValue(u).set(l)}),this.resolveNoneKeyframes()}}function _i(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let s=document;const r=(n==null?void 0:n[e])??s.querySelectorAll(e);return r?Array.from(r):[]}return Array.from(e)}const ds=(e,t)=>t&&typeof e=="number"?t.transform(e):e,rn=30,Hi=e=>!isNaN(parseFloat(e));class qi{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=(s,r=!0)=>{var o,a;const i=k.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&((o=this.events.change)==null||o.notify(this.current),this.dependents))for(const u of this.dependents)u.dirty();r&&((a=this.events.renderRequest)==null||a.notify(this.current))},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=k.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Hi(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&Rn(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Mn);const s=this.events[t].add(n);return t==="change"?()=>{s(),j.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=k.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>rn)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,rn);return Pn(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function De(e,t){return new qi(e,t)}const{schedule:Gi}=Nn(queueMicrotask,!1),Ui={y:!1};function zi(){return Ui.y}function hs(e,t){const n=_i(e),s=new AbortController,r={passive:!0,...t,signal:s.signal};return[n,r,()=>s.abort()]}function on(e){return!(e.pointerType==="touch"||zi())}function Yi(e,t,n={}){const[s,r,i]=hs(e,n),o=a=>{if(!on(a))return;const{target:u}=a,l=t(u,a);if(typeof l!="function"||!u)return;const c=d=>{on(d)&&(l(d),u.removeEventListener("pointerleave",c))};u.addEventListener("pointerleave",c,r)};return s.forEach(a=>{a.addEventListener("pointerenter",o,r)}),i}const ps=(e,t)=>t?e===t?!0:ps(e,t.parentElement):!1,Xi=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Qi=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Zi(e){return Qi.has(e.tagName)||e.tabIndex!==-1}const Ce=new WeakSet;function an(e){return t=>{t.key==="Enter"&&e(t)}}function qe(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const Ji=(e,t)=>{const n=e.currentTarget;if(!n)return;const s=an(()=>{if(Ce.has(n))return;qe(n,"down");const r=an(()=>{qe(n,"up")}),i=()=>qe(n,"cancel");n.addEventListener("keyup",r,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",s,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),t)};function cn(e){return Xi(e)&&!0}function eo(e,t,n={}){const[s,r,i]=hs(e,n),o=a=>{const u=a.currentTarget;if(!cn(a))return;Ce.add(u);const l=t(u,a),c=(h,g)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",f),Ce.has(u)&&Ce.delete(u),cn(h)&&typeof l=="function"&&l(h,{success:g})},d=h=>{c(h,u===window||u===document||n.useGlobalTarget||ps(u,h.target))},f=h=>{c(h,!1)};window.addEventListener("pointerup",d,r),window.addEventListener("pointercancel",f,r)};return s.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,r),rs(a)&&(a.addEventListener("focus",l=>Ji(l,r)),!Zi(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),i}const E=e=>!!(e&&e.getVelocity),to=[...us,R,ue],no=e=>to.find(cs(e)),ms=p.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),Pt=p.createContext({strict:!1}),un={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"]},ie={};for(const e in un)ie[e]={isEnabled:t=>un[e].some(n=>!!t[n])};function ln(e){for(const t in e)ie[t]={...ie[t],...e[t]}}function so({children:e,features:t,strict:n=!1}){const[,s]=p.useState(!Ge(t)),r=p.useRef(void 0);if(!Ge(t)){const{renderer:i,...o}=t;r.current=i,ln(o)}return p.useEffect(()=>{Ge(t)&&t().then(({renderer:i,...o})=>{ln(o),r.current=i,s(!0)})},[]),b.jsx(Pt.Provider,{value:{renderer:r.current,strict:n},children:e})}function Ge(e){return typeof e=="function"}const ro=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 Oe(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||ro.has(e)}let gs=e=>!Oe(e);function io(e){typeof e=="function"&&(gs=t=>t.startsWith("on")?!Oe(t):e(t))}try{io(require("@emotion/is-prop-valid").default)}catch{}function oo(e,t,n){const s={};for(const r in e)r==="values"&&typeof e.values=="object"||(gs(r)||n===!0&&Oe(r)||!t&&!Oe(r)||e.draggable&&r.startsWith("onDrag"))&&(s[r]=e[r]);return s}const je=p.createContext({});function Be(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function ye(e){return typeof e=="string"||Array.isArray(e)}const Rt=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ft=["initial",...Rt];function Le(e){return Be(e.animate)||Ft.some(t=>ye(e[t]))}function ys(e){return!!(Le(e)||e.variants)}function ao(e,t){if(Le(e)){const{initial:n,animate:s}=e;return{initial:n===!1||ye(n)?n:void 0,animate:ye(s)?s:void 0}}return e.inherit!==!1?t:{}}function co(e){const{initial:t,animate:n}=ao(e,p.useContext(je));return p.useMemo(()=>({initial:t,animate:n}),[fn(t),fn(n)])}function fn(e){return Array.isArray(e)?e.join(" "):e}const uo=Symbol.for("motionComponentSymbol");function bs(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function lo(e,t,n){return p.useCallback(s=>{s&&e.onMount&&e.onMount(s),t&&(s?t.mount(s):t.unmount()),n&&(typeof n=="function"?n(s):bs(n)&&(n.current=s))},[t])}const Dt=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),fo="framerAppearId",vs="data-"+Dt(fo),ho=p.createContext({});function po(e,t,n,s,r){var y,v;const{visualElement:i}=p.useContext(je),o=p.useContext(Pt),a=p.useContext(Sn),u=p.useContext(ms).reducedMotion,l=p.useRef(null);s=s||o.renderer,!l.current&&s&&(l.current=s(e,{visualState:t,parent:i,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:u}));const c=l.current,d=p.useContext(ho);c&&!c.projection&&r&&(c.type==="html"||c.type==="svg")&&mo(l.current,n,r,d);const f=p.useRef(!1);p.useInsertionEffect(()=>{c&&f.current&&c.update(n,a)});const h=n[vs],g=p.useRef(!!h&&!((y=window.MotionHandoffIsComplete)!=null&&y.call(window,h))&&((v=window.MotionHasOptimisedAnimation)==null?void 0:v.call(window,h)));return er(()=>{c&&(f.current=!0,window.MotionIsMounted=!0,c.updateFeatures(),Gi.render(c.render),g.current&&c.animationState&&c.animationState.animateChanges())}),p.useEffect(()=>{c&&(!g.current&&c.animationState&&c.animationState.animateChanges(),g.current&&(queueMicrotask(()=>{var m;(m=window.MotionHandoffMarkAsComplete)==null||m.call(window,h)}),g.current=!1))}),c}function mo(e,t,n,s){const{layoutId:r,layout:i,drag:o,dragConstraints:a,layoutScroll:u,layoutRoot:l,layoutCrossfade:c}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:xs(e.parent)),e.projection.setOptions({layoutId:r,layout:i,alwaysMeasureLayout:!!o||a&&bs(a),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:s,crossfade:c,layoutScroll:u,layoutRoot:l})}function xs(e){if(e)return e.options.allowProjection!==!1?e.projection:xs(e.parent)}function go({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:s,Component:r}){function i(a,u){let l;const c={...p.useContext(ms),...a,layoutId:yo(a)},{isStatic:d}=c,f=co(a),h=s(a,d);if(!d&&pt){bo(c,e);const g=vo(c);l=g.MeasureLayout,f.visualElement=po(r,h,c,t,g.ProjectionNode)}return b.jsxs(je.Provider,{value:f,children:[l&&f.visualElement?b.jsx(l,{visualElement:f.visualElement,...c}):null,n(r,a,lo(h,f.visualElement,u),h,d,f.visualElement)]})}i.displayName=`motion.${typeof r=="string"?r:`create(${r.displayName??r.name??""})`}`;const o=p.forwardRef(i);return o[uo]=r,o}function yo({layoutId:e}){const t=p.useContext(Zs).id;return t&&e!==void 0?t+"-"+e:e}function bo(e,t){p.useContext(Pt).strict,process.env.NODE_ENV}function vo(e){const{drag:t,layout:n}=ie;if(!t&&!n)return{};const s={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}const xo={};function Ts(e,{layout:t,layoutId:n}){return fe.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!xo[e]||e==="opacity")}const To={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},wo=le.length;function So(e,t,n){let s="",r=!0;for(let i=0;i<wo;i++){const o=le[i],a=e[o];if(a===void 0)continue;let u=!0;if(typeof a=="number"?u=a===(o.startsWith("scale")?1:0):u=parseFloat(a)===0,!u||n){const l=ds(a,Mt[o]);if(!u){r=!1;const c=To[o]||o;s+=`${c}(${l}) `}n&&(t[o]=l)}}return s=s.trim(),n?s=n(t,r?"":s):r&&(s="none"),s}function Ot(e,t,n){const{style:s,vars:r,transformOrigin:i}=e;let o=!1,a=!1;for(const u in t){const l=t[u];if(fe.has(u)){o=!0;continue}else if($n(u)){r[u]=l;continue}else{const c=ds(l,Mt[u]);u.startsWith("origin")?(a=!0,i[u]=c):s[u]=c}}if(t.transform||(o||n?s.transform=So(t,e.transform,n):s.transform&&(s.transform="none")),a){const{originX:u="50%",originY:l="50%",originZ:c=0}=i;s.transformOrigin=`${u} ${l} ${c}`}}const Et=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function ws(e,t,n){for(const s in t)!E(t[s])&&!Ts(s,n)&&(e[s]=t[s])}function Vo({transformTemplate:e},t){return p.useMemo(()=>{const n=Et();return Ot(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Co(e,t){const n=e.style||{},s={};return ws(s,n,e),Object.assign(s,Vo(e,t)),s}function Ao(e,t){const n={},s=Co(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=s,n}const Mo={offset:"stroke-dashoffset",array:"stroke-dasharray"},Po={offset:"strokeDashoffset",array:"strokeDasharray"};function Ro(e,t,n=1,s=0,r=!0){e.pathLength=1;const i=r?Mo:Po;e[i.offset]=T.transform(-s);const o=T.transform(t),a=T.transform(n);e[i.array]=`${o} ${a}`}function Ss(e,{attrX:t,attrY:n,attrScale:s,pathLength:r,pathSpacing:i=1,pathOffset:o=0,...a},u,l,c){if(Ot(e,a,l),u){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??"50% 50%",delete d.transformOrigin),f.transform&&(f.transformBox=(c==null?void 0:c.transformBox)??"fill-box",delete d.transformBox),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),s!==void 0&&(d.scale=s),r!==void 0&&Ro(d,r,i,o,!1)}const Vs=()=>({...Et(),attrs:{}}),Cs=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Fo(e,t,n,s){const r=p.useMemo(()=>{const i=Vs();return Ss(i,t,Cs(s),e.transformTemplate,e.style),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};ws(i,e.style,e),r.style={...i,...r.style}}return r}const Do=["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 It(e){return typeof e!="string"||e.includes("-")?!1:!!(Do.indexOf(e)>-1||/[A-Z]/u.test(e))}function Oo(e=!1){return(n,s,r,{latestValues:i},o)=>{const u=(It(n)?Fo:Ao)(s,i,o,n),l=oo(s,typeof n=="string",e),c=n!==p.Fragment?{...l,...u,ref:r}:{},{children:d}=s,f=p.useMemo(()=>E(d)?d.get():d,[d]);return p.createElement(n,{...c,children:f})}}function dn(e){const t=[{},{}];return e==null||e.values.forEach((n,s)=>{t[0][s]=n.get(),t[1][s]=n.getVelocity()}),t}function kt(e,t,n,s){if(typeof t=="function"){const[r,i]=dn(s);t=t(n!==void 0?n:e.custom,r,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[r,i]=dn(s);t=t(n!==void 0?n:e.custom,r,i)}return t}function Eo(e){return E(e)?e.get():e}function Io({scrapeMotionValuesFromProps:e,createRenderState:t},n,s,r){return{latestValues:ko(n,s,r,e),renderState:t()}}const As=e=>(t,n)=>{const s=p.useContext(je),r=p.useContext(Sn),i=()=>Io(e,t,s,r);return n?i():Js(i)};function ko(e,t,n,s){const r={},i=s(e,{});for(const f in i)r[f]=Eo(i[f]);let{initial:o,animate:a}=e;const u=Le(e),l=ys(e);t&&l&&!u&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let c=n?n.initial===!1:!1;c=c||o===!1;const d=c?a:o;if(d&&typeof d!="boolean"&&!Be(d)){const f=Array.isArray(d)?d:[d];for(let h=0;h<f.length;h++){const g=kt(e,f[h]);if(g){const{transitionEnd:y,transition:v,...m}=g;for(const w in m){let x=m[w];if(Array.isArray(x)){const A=c?x.length-1:0;x=x[A]}x!==null&&(r[w]=x)}for(const w in y)r[w]=y[w]}}}return r}function jt(e,t,n){var i;const{style:s}=e,r={};for(const o in s)(E(s[o])||t.style&&E(t.style[o])||Ts(o,e)||((i=n==null?void 0:n.getValue(o))==null?void 0:i.liveStyle)!==void 0)&&(r[o]=s[o]);return r}const jo={useVisualState:As({scrapeMotionValuesFromProps:jt,createRenderState:Et})};function Ms(e,t,n){const s=jt(e,t,n);for(const r in e)if(E(e[r])||E(t[r])){const i=le.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;s[i]=e[r]}return s}const Bo={useVisualState:As({scrapeMotionValuesFromProps:Ms,createRenderState:Vs})};function Lo(e,t){return function(s,{forwardMotionProps:r}={forwardMotionProps:!1}){const o={...It(s)?Bo:jo,preloadedFeatures:e,useRender:Oo(r),createVisualElement:t,Component:s};return go(o)}}const Ps=Lo();function be(e,t,n){const s=e.getProps();return kt(s,t,n!==void 0?n:s.custom,e)}const at=e=>Array.isArray(e);function No(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,De(n))}function Ko(e){return at(e)?e[e.length-1]||0:e}function $o(e,t){const n=be(e,t);let{transitionEnd:s={},transition:r={},...i}=n||{};i={...i,...s};for(const o in i){const a=Ko(i[o]);No(e,o,a)}}function Wo(e){return!!(E(e)&&e.add)}function _o(e,t){const n=e.getValue("willChange");if(Wo(n))return n.add(t);if(!n&&K.WillChange){const s=new K.WillChange("auto");e.addValue("willChange",s),s.add(t)}}function Ho(e){return e.props[vs]}const qo=e=>e!==null;function Go(e,{repeat:t,repeatType:n="loop"},s){const r=e.filter(qo),i=t&&n!=="loop"&&t%2===1?0:r.length-1;return r[i]}const Uo={type:"spring",stiffness:500,damping:25,restSpeed:10},zo=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Yo={type:"keyframes",duration:.8},Xo={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Qo=(e,{keyframes:t})=>t.length>2?Yo:fe.has(e)?e.startsWith("scale")?zo(t[1]):Uo:Xo;function Zo({when:e,delay:t,delayChildren:n,staggerChildren:s,staggerDirection:r,repeat:i,repeatType:o,repeatDelay:a,from:u,elapsed:l,...c}){return!!Object.keys(c).length}const Jo=(e,t,n,s={},r,i)=>o=>{const a=os(s,e)||{},u=a.delay||s.delay||0;let{elapsed:l=0}=s;l=l-B(u);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-l,onUpdate:f=>{t.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:i?void 0:r};Zo(a)||Object.assign(c,Qo(e,c)),c.duration&&(c.duration=B(c.duration)),c.repeatDelay&&(c.repeatDelay=B(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let d=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(c.duration=0,c.delay===0&&(d=!0)),(K.instantAnimations||K.skipAnimations)&&(d=!0,c.duration=0,c.delay=0),c.allowFlatten=!a.type&&!a.ease,d&&!i&&t.get()!==void 0){const f=Go(c.keyframes,a);if(f!==void 0){j.update(()=>{c.onUpdate(f),c.onComplete()});return}}return a.isSync?new Ct(c):new Ri(c)};function ea({protectedKeys:e,needsAnimating:t},n){const s=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,s}function Rs(e,t,{delay:n=0,transitionOverride:s,type:r}={}){let{transition:i=e.getDefaultTransition(),transitionEnd:o,...a}=t;s&&(i=s);const u=[],l=r&&e.animationState&&e.animationState.getState()[r];for(const c in a){const d=e.getValue(c,e.latestValues[c]??null),f=a[c];if(f===void 0||l&&ea(l,c))continue;const h={delay:n,...os(i||{},c)},g=d.get();if(g!==void 0&&!d.isAnimating&&!Array.isArray(f)&&f===g&&!h.velocity)continue;let y=!1;if(window.MotionHandoffAnimation){const m=Ho(e);if(m){const w=window.MotionHandoffAnimation(m,c,j);w!==null&&(h.startTime=w,y=!0)}}_o(e,c),d.start(Jo(c,d,f,e.shouldReduceMotion&&as.has(c)?{type:!1}:h,e,y));const v=d.animation;v&&u.push(v)}return o&&Promise.all(u).then(()=>{j.update(()=>{o&&$o(e,o)})}),u}function ct(e,t,n={}){var u;const s=be(e,t,n.type==="exit"?(u=e.presenceContext)==null?void 0:u.custom:void 0);let{transition:r=e.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(r=n.transitionOverride);const i=s?()=>Promise.all(Rs(e,s,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:c=0,staggerChildren:d,staggerDirection:f}=r;return ta(e,t,l,c,d,f,n)}:()=>Promise.resolve(),{when:a}=r;if(a){const[l,c]=a==="beforeChildren"?[i,o]:[o,i];return l().then(()=>c())}else return Promise.all([i(),o(n.delay)])}function ta(e,t,n=0,s=0,r=0,i=1,o){const a=[],u=e.variantChildren.size,l=(u-1)*r,c=typeof s=="function",d=c?f=>s(f,u):i===1?(f=0)=>f*r:(f=0)=>l-f*r;return Array.from(e.variantChildren).sort(na).forEach((f,h)=>{f.notify("AnimationStart",t),a.push(ct(f,t,{...o,delay:n+(c?0:s)+d(h)}).then(()=>f.notify("AnimationComplete",t)))}),Promise.all(a)}function na(e,t){return e.sortNodePosition(t)}function sa(e,t,n={}){e.notify("AnimationStart",t);let s;if(Array.isArray(t)){const r=t.map(i=>ct(e,i,n));s=Promise.all(r)}else if(typeof t=="string")s=ct(e,t,n);else{const r=typeof t=="function"?be(e,t,n.custom):t;s=Promise.all(Rs(e,r,n))}return s.then(()=>{e.notify("AnimationComplete",t)})}function Fs(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let s=0;s<n;s++)if(t[s]!==e[s])return!1;return!0}const ra=Ft.length;function Ds(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Ds(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<ra;n++){const s=Ft[n],r=e.props[s];(ye(r)||r===!1)&&(t[s]=r)}return t}const ia=[...Rt].reverse(),oa=Rt.length;function aa(e){return t=>Promise.all(t.map(({animation:n,options:s})=>sa(e,n,s)))}function ca(e){let t=aa(e),n=hn(),s=!0;const r=u=>(l,c)=>{var f;const d=be(e,c,u==="exit"?(f=e.presenceContext)==null?void 0:f.custom:void 0);if(d){const{transition:h,transitionEnd:g,...y}=d;l={...l,...y,...g}}return l};function i(u){t=u(e)}function o(u){const{props:l}=e,c=Ds(e.parent)||{},d=[],f=new Set;let h={},g=1/0;for(let v=0;v<oa;v++){const m=ia[v],w=n[m],x=l[m]!==void 0?l[m]:c[m],A=ye(x),S=m===u?w.isActive:null;S===!1&&(g=v);let C=x===c[m]&&x!==l[m]&&A;if(C&&s&&e.manuallyAnimateOnMount&&(C=!1),w.protectedKeys={...h},!w.isActive&&S===null||!x&&!w.prevProp||Be(x)||typeof x=="boolean")continue;const M=ua(w.prevProp,x);let V=M||m===u&&w.isActive&&!C&&A||v>g&&A,F=!1;const I=Array.isArray(x)?x:[x];let te=I.reduce(r(m),{});S===!1&&(te={});const{prevResolvedValues:Nt={}}=w,Ws={...Nt,...te},Kt=O=>{V=!0,f.has(O)&&(F=!0,f.delete(O)),w.needsAnimating[O]=!0;const L=e.getValue(O);L&&(L.liveStyle=!1)};for(const O in Ws){const L=te[O],Ne=Nt[O];if(h.hasOwnProperty(O))continue;let Ke=!1;at(L)&&at(Ne)?Ke=!Fs(L,Ne):Ke=L!==Ne,Ke?L!=null?Kt(O):f.add(O):L!==void 0&&f.has(O)?Kt(O):w.protectedKeys[O]=!0}w.prevProp=x,w.prevResolvedValues=te,w.isActive&&(h={...h,...te}),s&&e.blockInitialAnimation&&(V=!1),V&&(!(C&&M)||F)&&d.push(...I.map(O=>({animation:O,options:{type:m}})))}if(f.size){const v={};if(typeof l.initial!="boolean"){const m=be(e,Array.isArray(l.initial)?l.initial[0]:l.initial);m&&m.transition&&(v.transition=m.transition)}f.forEach(m=>{const w=e.getBaseTarget(m),x=e.getValue(m);x&&(x.liveStyle=!0),v[m]=w??null}),d.push({animation:v})}let y=!!d.length;return s&&(l.initial===!1||l.initial===l.animate)&&!e.manuallyAnimateOnMount&&(y=!1),s=!1,y?t(d):Promise.resolve()}function a(u,l){var d;if(n[u].isActive===l)return Promise.resolve();(d=e.variantChildren)==null||d.forEach(f=>{var h;return(h=f.animationState)==null?void 0:h.setActive(u,l)}),n[u].isActive=l;const c=o(u);for(const f in n)n[f].protectedKeys={};return c}return{animateChanges:o,setActive:a,setAnimateFunction:i,getState:()=>n,reset:()=>{n=hn(),s=!0}}}function ua(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Fs(t,e):!1}function G(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function hn(){return{animate:G(!0),whileInView:G(),whileHover:G(),whileTap:G(),whileDrag:G(),whileFocus:G(),exit:G()}}class de{constructor(t){this.isMounted=!1,this.node=t}update(){}}class la extends de{constructor(t){super(t),t.animationState||(t.animationState=ca(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Be(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let fa=0;class da extends de{constructor(){super(...arguments),this.id=fa++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===s)return;const r=this.node.animationState.setActive("exit",!t);n&&!t&&r.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const ha={animation:{Feature:la},exit:{Feature:da}};function pn(e,t,n,s={passive:!0}){return e.addEventListener(t,n,s),()=>e.removeEventListener(t,n)}function Os(e){return{point:{x:e.pageX,y:e.pageY}}}function pa({top:e,left:t,right:n,bottom:s}){return{x:{min:t,max:n},y:{min:e,max:s}}}function ma(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),s=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}const mn=()=>({min:0,max:0}),Es=()=>({x:mn(),y:mn()});function ga(e,t){return pa(ma(e.getBoundingClientRect(),t))}function gn(e,t,n){const{props:s}=e;e.animationState&&s.whileHover&&e.animationState.setActive("whileHover",n==="Start");const r="onHover"+n,i=s[r];i&&j.postRender(()=>i(t,Os(t)))}class ya extends de{mount(){const{current:t}=this.node;t&&(this.unmount=Yi(t,(n,s)=>(gn(this.node,s,"Start"),r=>gn(this.node,r,"End"))))}unmount(){}}class ba extends de{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!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=Ie(pn(this.node.current,"focus",()=>this.onFocus()),pn(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function yn(e,t,n){const{props:s}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&s.whileTap&&e.animationState.setActive("whileTap",n==="Start");const r="onTap"+(n==="End"?"":n),i=s[r];i&&j.postRender(()=>i(t,Os(t)))}class va extends de{mount(){const{current:t}=this.node;t&&(this.unmount=eo(t,(n,s)=>(yn(this.node,s,"Start"),(r,{success:i})=>yn(this.node,r,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const ut=new WeakMap,Ue=new WeakMap,xa=e=>{const t=ut.get(e.target);t&&t(e)},Ta=e=>{e.forEach(xa)};function wa({root:e,...t}){const n=e||document;Ue.has(n)||Ue.set(n,{});const s=Ue.get(n),r=JSON.stringify(t);return s[r]||(s[r]=new IntersectionObserver(Ta,{root:e,...t})),s[r]}function Sa(e,t,n){const s=wa(t);return ut.set(e,n),s.observe(e),()=>{ut.delete(e),s.unobserve(e)}}const Va={some:0,all:1};class Ca extends de{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:s,amount:r="some",once:i}=t,o={root:n?n.current:void 0,rootMargin:s,threshold:typeof r=="number"?r:Va[r]},a=u=>{const{isIntersecting:l}=u;if(this.isInView===l||(this.isInView=l,i&&!l&&this.hasEnteredView))return;l&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",l);const{onViewportEnter:c,onViewportLeave:d}=this.node.getProps(),f=l?c:d;f&&f(u)};return Sa(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Aa(t,n))&&this.startObserver()}unmount(){}}function Aa({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Ma={inView:{Feature:Ca},tap:{Feature:va},focus:{Feature:ba},hover:{Feature:ya}},lt={current:null},Is={current:!1};function Pa(){if(Is.current=!0,!!pt)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>lt.current=e.matches;e.addEventListener("change",t),t()}else lt.current=!1}const Ra=new WeakMap;function Fa(e,t,n){for(const s in t){const r=t[s],i=n[s];if(E(r))e.addValue(s,r);else if(E(i))e.addValue(s,De(r,{owner:e}));else if(i!==r)if(e.hasValue(s)){const o=e.getValue(s);o.liveStyle===!0?o.jump(r):o.hasAnimated||o.set(r)}else{const o=e.getStaticValue(s);e.addValue(s,De(o!==void 0?o:r,{owner:e}))}}for(const s in n)t[s]===void 0&&e.removeValue(s);return t}const bn=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Da{scrapeMotionValuesFromProps(t,n,s){return{}}constructor({parent:t,props:n,presenceContext:s,reducedMotionConfig:r,blockInitialAnimation:i,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=At,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 f=k.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,j.render(this.render,!1,!0))};const{latestValues:u,renderState:l}=o;this.latestValues=u,this.baseTarget={...u},this.initialValues=n.initial?{...u}:{},this.renderState=l,this.parent=t,this.props=n,this.presenceContext=s,this.depth=t?t.depth+1:0,this.reducedMotionConfig=r,this.options=a,this.blockInitialAnimation=!!i,this.isControllingVariants=Le(n),this.isVariantNode=ys(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:c,...d}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in d){const h=d[f];u[f]!==void 0&&E(h)&&h.set(u[f],!1)}}mount(t){this.current=t,Ra.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,s)=>this.bindToMotionValue(s,n)),Is.current||Pa(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:lt.current,process.env.NODE_ENV!=="production"&&Rn(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),ze(this.notifyUpdate),ze(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const s=fe.has(t);s&&this.onBindTransform&&this.onBindTransform();const r=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&j.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0)}),i=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{r(),i(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in ie){const n=ie[t];if(!n)continue;const{isEnabled:s,Feature:r}=n;if(!this.features[t]&&r&&s(this.props)&&(this.features[t]=new r(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Es()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<bn.length;s++){const r=bn[s];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const i="on"+r,o=t[i];o&&(this.propEventSubscriptions[r]=this.on(r,o))}this.prevMotionValues=Fa(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]: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(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const s=this.values.get(t);n!==s&&(s&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let s=this.values.get(t);return s===void 0&&n!==void 0&&(s=De(n===null?void 0:n,{owner:this}),this.addValue(t,s)),s}readValue(t,n){let s=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return s!=null&&(typeof s=="string"&&(Vn(s)||Cn(s))?s=parseFloat(s):!no(s)&&ue.test(n)&&(s=fs(t,n)),this.setBaseTarget(t,E(s)?s.get():s)),E(s)?s.get():s}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var i;const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const o=kt(this.props,n,(i=this.presenceContext)==null?void 0:i.custom);o&&(s=o[t])}if(n&&s!==void 0)return s;const r=this.getBaseTargetFromProps(this.props,t);return r!==void 0&&!E(r)?r:this.initialValues[t]!==void 0&&s===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Mn),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class ks extends Da{constructor(){super(...arguments),this.KeyframeResolver=Wi}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:s}){delete n[t],delete s[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;E(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function js(e,{style:t,vars:n},s,r){const i=e.style;let o;for(o in t)i[o]=t[o];r==null||r.applyProjectionStyles(i,s);for(o in n)i.setProperty(o,n[o])}function Oa(e){return window.getComputedStyle(e)}class Ea extends ks{constructor(){super(...arguments),this.type="html",this.renderInstance=js}readValueFromInstance(t,n){var s;if(fe.has(n))return(s=this.projection)!=null&&s.isProjecting?tt(n):oi(t,n);{const r=Oa(t),i=($n(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return ga(t,n)}build(t,n,s){Ot(t,n,s.transformTemplate)}scrapeMotionValuesFromProps(t,n,s){return jt(t,n,s)}}const Bs=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 Ia(e,t,n,s){js(e,t,void 0,s);for(const r in t.attrs)e.setAttribute(Bs.has(r)?r:Dt(r),t.attrs[r])}class ka extends ks{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Es}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(fe.has(n)){const s=ls(n);return s&&s.default||0}return n=Bs.has(n)?n:Dt(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,s){return Ms(t,n,s)}build(t,n,s){Ss(t,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(t,n,s,r){Ia(t,n,s,r)}mount(t){this.isSVGTag=Cs(t.tagName),super.mount(t)}}const ja=(e,t)=>It(e)?new ka(t):new Ea(t,{allowProjection:e!==p.Fragment}),Ba={renderer:ja,...ha,...Ma},La={0:"5",1:"6",2:"8",3:"10"},q=e=>Array.isArray(e),ee=e=>typeof e=="object"&&!Array.isArray(e)||typeof e=="string"||!e,Na=e=>{const t=(r,i=[])=>(p.Children.toArray(r).forEach(a=>{p.isValidElement(a)&&(a.props.value?i.push(a):a.props.children&&t(a.props.children,i))}),i);return t(e).map(r=>{var o;const i=r;return{value:i.props.value,label:((o=i.props)==null?void 0:o.label)||i.props.children||i.props.value}})},H=(e,t)=>{if(e)return t===!0?e==null?void 0:e.value:e},ft=(e,t,n)=>{if(!e||!t||t.length===0)return;const s=t.find(r=>r.value===H(e,n));if(s)return s},Ka=({children:e,value:t,searchQuery:n})=>{const s=Ls(e);return(t==null?void 0:t.toLowerCase().includes(n.toLowerCase()))||s.some(r=>r.toLowerCase().includes(n.toLowerCase()))},Ls=e=>{const t=p.Children.toArray(e),n=[];return t.forEach(s=>{typeof s=="string"&&n.push(s),p.isValidElement(s)&&s.props.children&&n.push(...Ls(s.props.children))}),n},$a=Ps("div"),Bt=Ps("span"),Wa=({icon:e=Q.ChevronDown,"aria-hidden":t=!0,...n})=>{const s=p.useContext(D);return b.jsx(oe.Button.Icon,{as:Bt,animate:{rotate:s.open?180:0},transition:{duration:.15,type:"spring",bounce:0},icon:e,"aria-hidden":t,...n})},_a=({tooltipProps:e,...t})=>{const n=p.useContext(D),s=()=>{var i,o;if(q(n.value)){const a=n.onValueChange;a==null||a([])}if(ee(n.value)){const a=n.onValueChange;a==null||a(void 0)}(o=(i=n.triggerRef)==null?void 0:i.current)==null||o.focus()};return p.useMemo(()=>{var i;if(ee(n.value))return n.clearable&&n.value;if(q(n.value))return n.clearable&&((i=n.value)==null?void 0:i.length)>0},[n.clearable,n.value])?b.jsx(Ys.Tooltip,{label:"Clear field",...e,children:b.jsx(oe.Button,{type:"button",icon:{icon:Q.X,alt:"Clear field"},size:"1",variant:"ghost",onClick:i=>{n.value&&(i.stopPropagation(),s())},onKeyDown:i=>{(i.key==="Enter"||i.key===" ")&&(i.stopPropagation(),s())},"data-tgph-combobox-clear":!0,style:{marginTop:"calc(-1 * var(--tgph-spacing-1)",marginBottom:"calc(-1 * var(--tgph-spacing-1)"},...t})}):null},Ha=({children:e,...t})=>{const n=p.useContext(D),s=p.useMemo(()=>{var a;if(!ee(n.value))return;const r=ft(n.value,n.options,n.legacyBehavior),i=(r==null?void 0:r.label)||(r==null?void 0:r.value)||n.placeholder,o=n.legacyBehavior&&((a=n==null?void 0:n.value)==null?void 0:a.label);return o||i},[n.value,n.options,n.legacyBehavior,n.placeholder]);return b.jsx(Tn.TooltipIfTruncated,{children:b.jsx(oe.Button.Text,{color:n.value?"default":"gray",textOverflow:"ellipsis",overflow:"hidden",...t,children:e||s})})},qa=({children:e,...t})=>{const n=p.useContext(D);return b.jsx(Tn.TooltipIfTruncated,{children:b.jsx(oe.Button.Text,{color:"gray",textOverflow:"ellipsis",overflow:"hidden",...t,children:e||n.placeholder})})},Ga=({children:e})=>{const t=p.useContext(D);if(!q(t.value))return null;const n=t.layout||"truncate",r=(t.value.length-2).toString().split("");return b.jsxs(_.Stack,{gap:"1",w:"full",wrap:n==="wrap"?"wrap":"nowrap",align:"center",style:{position:"relative",flexGrow:1},children:[e,n==="truncate"&&t.value.length>2&&b.jsx(_.Stack,{as:$a,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1,type:"spring",bounce:0},h:"full",pr:"1",pl:"8",align:"center","aria-label":`${t.value.length-2} more selected`,position:"absolute",right:"0",style:{backgroundImage:"linear-gradient(to left, var(--tgph-surface-1) 0 60%, transparent 90% 100%)"},children:b.jsxs(dt.Text,{as:"span",size:"1",style:{whiteSpace:"nowrap"},children:["+",r.map(i=>b.jsx(_.Box,{as:Bt,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1,type:"spring",bounce:0},w:"2",display:"inline-block",children:i},i))," ","more"]})})]})},Lt=p.createContext({value:""}),Ua=({value:e,children:t,...n})=>b.jsx(Lt.Provider,{value:{value:e},children:b.jsx(ht.Tag.Root,{as:Bt,initial:{opacity:0,scale:.5},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.5},transition:{duration:.1,type:"spring",bounce:0},size:"1",layout:"position",...n,children:t})}),za=({children:e,...t})=>{const n=p.useContext(D),s=p.useContext(Lt),r=p.useMemo(()=>{const i=n.options.find(u=>u.value===s.value);if(i)return i.label||i.value;if(!n.value)return;const a=n.value.find(u=>H(u,n.legacyBehavior)===s.value);if(a)return a},[n.options,n.value,s.value,n.legacyBehavior]);return b.jsx(ht.Tag.Text,{...t,children:e||r})},Ya=({children:e,...t})=>{const n=p.useContext(D),s=p.useContext(Lt);return b.jsx(ht.Tag.Button,{icon:{icon:Q.X,alt:`Remove ${s.value}`},onClick:r=>{if(!n.onValueChange)return;const i=n.onValueChange,a=n.value.filter(u=>H(u,n.legacyBehavior)!==s.value);i==null||i(a),r.stopPropagation(),r.preventDefault()},...t,children:e})},Xa=({value:e,children:t,...n})=>b.jsxs(Ae.Root,{value:e,...n,children:[b.jsx(Ae.Text,{children:t}),b.jsx(Ae.Button,{})]}),Ae={Root:Ua,Text:za,Button:Ya,Default:Xa},W={TriggerIndicator:Wa,TriggerClear:_a,TriggerText:Ha,TriggerPlaceholder:qa,TriggerTagsContainer:Ga,TriggerTag:Ae},Qa=["ArrowDown","PageUp","Home"],Za=["ArrowUp","PageDown","End"],Ns=["Enter"," "],D=p.createContext({value:void 0,onValueChange:()=>{},contentId:"",triggerId:"",open:!1,setOpen:()=>{},onOpenToggle:()=>{},clearable:!1,disabled:!1,options:[],legacyBehavior:!1}),Ja=({modal:e=!0,closeOnSelect:t=!0,clearable:n=!1,disabled:s=!1,legacyBehavior:r=!1,open:i,onOpenChange:o,defaultOpen:a,value:u,onValueChange:l,errored:c,placeholder:d,layout:f,children:h,...g})=>{const y=p.useId(),v=p.useId(),m=p.useRef(null),w=p.useRef(null),x=p.useRef(null),A=p.useMemo(()=>Na(h),[h]),[S,C]=p.useState(""),[M=!1,V]=qs.useControllableState({prop:i,defaultProp:a??!1,onChange:o}),F=p.useCallback(()=>{V(I=>!I)},[V]);return p.useEffect(()=>{M||C("")},[M]),b.jsx(D.Provider,{value:{contentId:y,triggerId:v,value:u,onValueChange:l,placeholder:d,open:M,setOpen:V,onOpenToggle:F,closeOnSelect:t,clearable:n,disabled:s,searchQuery:S,setSearchQuery:C,triggerRef:m,searchRef:w,contentRef:x,errored:c,layout:f,options:A,legacyBehavior:r},children:b.jsx(Ee.Menu.Root,{open:M,onOpenChange:V,modal:e,...g,children:h})})},ec=()=>{const e=p.useContext(D);if(e.value&&q(e.value)){const t=e.layout||"truncate";return e.value.length===0?b.jsx(W.TriggerPlaceholder,{}):b.jsx(so,{features:Ba,children:b.jsx(W.TriggerTagsContainer,{children:e.value.map((n,s)=>{const r=H(n,e.legacyBehavior);if(r&&(t==="truncate"&&s<=1||t==="wrap"))return b.jsx(Us.RefToTgphRef,{children:b.jsx(W.TriggerTag.Default,{value:r})},r)})})})}if(e&&ee(e.value))return e.value?b.jsx(W.TriggerText,{}):b.jsx(W.TriggerPlaceholder,{})},tc=({size:e="2",children:t,...n})=>{const s=p.useContext(D),r=p.useMemo(()=>{if(s.value){if(ee(s.value))return ft(s.value,s.options,s.legacyBehavior);if(q(s.value))return s.value.map(o=>ft(o,s.options,s.legacyBehavior))}},[s.value,s.options,s.legacyBehavior]),i=p.useCallback(()=>r?ee(r)?(r==null?void 0:r.label)||(r==null?void 0:r.value)||s.placeholder:q(r)&&r.map(o=>(o==null?void 0:o.label)||(o==null?void 0:o.value)).join(", ")||s.placeholder:s.placeholder,[r,s.placeholder]);return b.jsx(Ee.Menu.Trigger,{...n,asChild:!0,onClick:o=>{var a,u;o.preventDefault(),s.onOpenToggle(),(u=(a=s.triggerRef)==null?void 0:a.current)==null||u.focus()},onKeyDown:o=>{if(o.key==="Tab"){o.stopPropagation();return}if(Ns.includes(o.key)){o.preventDefault();return}if(o.key==="ArrowDown"){o.stopPropagation(),o.preventDefault(),s.onOpenToggle();return}},tgphRef:s.triggerRef,children:b.jsxs(oe.Button.Root,{id:s.triggerId,type:"button",bg:"surface-1",variant:"outline",align:"center",minH:La[e],h:"full",w:"full",py:"1",size:e,color:s.errored?"red":"gray",justify:"space-between",role:"combobox","aria-label":i(),"aria-controls":s.contentId,"aria-expanded":s.open,"aria-haspopup":"listbox","data-tgph-combobox-trigger":!0,"data-tgph-combobox-trigger-open":s.open,disabled:s.disabled,...n,children:[t?typeof t=="function"?t({value:r}):t:b.jsx(ec,{}),b.jsxs(_.Stack,{align:"center",gap:"1",children:[b.jsx(W.TriggerClear,{}),b.jsx(W.TriggerIndicator,{})]})]})})},nc=({style:e,children:t,tgphRef:n,...s})=>{const r=p.useContext(D),i=p.useRef(!1),o=vn.useComposedRefs(n,r.contentRef),a=p.useRef(null),[u,l]=p.useState(0),[c,d]=p.useState(!1),f=p.useCallback(h=>{const g=h==null?void 0:h.getBoundingClientRect();g&&l(g.height),c||d(!0)},[c]);return p.useEffect(()=>{const h=new ResizeObserver(g=>{for(const y of g){const v=y.target;f(v)}});return a.current&&c&&h.observe(a.current),()=>h.disconnect()},[c,f]),p.useEffect(()=>{c===!0&&r.open===!1&&d(!1)},[r.open,c]),p.useEffect(()=>{let h;return r.open&&(h=setTimeout(()=>{f(a.current)},10)),()=>h&&clearTimeout(h)},[r.open,f]),b.jsx(Xs.Root,{asChild:!0,children:b.jsx(_s.DismissableLayer,{onEscapeKeyDown:h=>{r.open&&(h.stopPropagation(),h.preventDefault(),r.setOpen(!1))},children:b.jsx(Ee.Menu.Content,{className:"tgph",mt:"1",onCloseAutoFocus:h=>{var g,y;i.current||(y=(g=r.triggerRef)==null?void 0:g.current)==null||y.focus(),i.current=!1,h.preventDefault()},bg:"surface-1",style:{width:"var(--tgph-combobox-trigger-width)",transition:"min-height 200ms ease-in-out",minHeight:u?`${u}px`:"0",...e,"--tgph-combobox-content-transform-origin":"var(--radix-popper-transform-origin)","--tgph-combobox-content-available-width":"var(--radix-popper-available-width)","--tgph-combobox-content-available-height":"calc(var(--radix-popper-available-height) - var(--tgph-spacing-8))","--tgph-combobox-trigger-width":"var(--radix-popper-anchor-width)","--tgph-combobox-trigger-height":"var(--radix-popper-anchor-height)"},...s,tgphRef:o,"data-tgph-combobox-content":!0,"data-tgph-combobox-content-open":r.open,role:void 0,"aria-orientation":void 0,onKeyDown:h=>{var y,v,m,w;h.stopPropagation();const g=(v=(y=r.contentRef)==null?void 0:y.current)==null?void 0:v.querySelectorAll("[data-tgph-combobox-option]");document.activeElement===(g==null?void 0:g[0])&&Za.includes(h.key)&&((w=(m=r.searchRef)==null?void 0:m.current)==null||w.focus())},children:b.jsx(_.Stack,{direction:"column",gap:"1",tgphRef:a,children:t})})})})},sc=({...e})=>{const t=p.useContext(D);return b.jsx(_.Stack,{id:t.contentId,direction:"column",gap:"1",style:{overflowY:"auto","--max-height":e.maxHeight?void 0:"calc(var(--tgph-combobox-content-available-height) - var(--tgph-spacing-12))"},role:"listbox",...e})},Ks=({value:e,label:t,selected:n,onSelect:s,children:r,...i})=>{const o=p.useContext(D),[a,u]=p.useState(!1),l=o.value,c=!o.searchQuery||Ka({children:t||r,value:e,searchQuery:o.searchQuery}),d=q(l)?l.some(h=>H(h,o.legacyBehavior)===e):H(l,o.legacyBehavior)===e,f=h=>{var y,v;h.stopPropagation();const g=h;if(!(g.key&&!Ns.includes(g.key))){if(h.preventDefault(),o.closeOnSelect===!0&&o.setOpen(!1),s)return s(h);if(ee(l)){const m=o.onValueChange;o.legacyBehavior===!0?m==null||m({value:e,label:t}):m==null||m(e)}else if(q(l)){const m=o.onValueChange,w=o.value,x=d?w.filter(A=>H(A,o.legacyBehavior)!==e):[...w,o.legacyBehavior===!0?{value:e,label:t}:e];m==null||m(x)}(v=(y=o.triggerRef)==null?void 0:y.current)==null||v.focus()}};if(c)return b.jsx(Ee.Menu.Button,{type:"button",onSelect:f,onKeyDown:f,selected:n===null?null:n??d,onFocus:()=>u(!0),onBlur:()=>u(!1),role:"option","aria-selected":d?"true":"false","data-tgph-combobox-option":!0,"data-tgph-combobox-option-focused":a,"data-tgph-combobox-option-value":e,"data-tgph-combobox-option-label":t,...i,children:t||r||e})},rc=({label:e="Search",placeholder:t="Search",tgphRef:n,value:s,onValueChange:r,...i})=>{var d;const o=p.useId(),a=p.useContext(D),u=vn.useComposedRefs(n,a.searchRef),l=s??a.searchQuery,c=r??a.setSearchQuery;return p.useEffect(()=>{var g;const f=y=>{var v,m;Qa.includes(y.key)&&((m=(v=a.contentRef)==null?void 0:v.current)==null||m.focus({preventScroll:!0})),y.key==="Escape"&&a.setOpen(!1),y.stopPropagation()},h=(g=a.searchRef)==null?void 0:g.current;if(h)return h.addEventListener("keydown",f),()=>{h.removeEventListener("keydown",f)}},[a]),b.jsxs(_.Box,{borderBottom:"px",px:"1",pb:"1",children:[b.jsx(Qs.Root,{children:b.jsx(dt.Text,{as:"label",htmlFor:o,children:e})}),b.jsx(zs.Input,{id:o,variant:"ghost",placeholder:t,value:l,onChange:f=>{c(f.target.value)},LeadingComponent:b.jsx(xn.Icon,{icon:Q.Search,alt:"Search Icon"}),TrailingComponent:a!=null&&a.searchQuery&&((d=a==null?void 0:a.searchQuery)==null?void 0:d.length)>0?b.jsx(oe.Button,{variant:"ghost",color:"gray",icon:{icon:Q.X,alt:"Clear Search Query"},onClick:()=>{var f;return(f=a.setSearchQuery)==null?void 0:f.call(a,"")}}):null,autoFocus:!0,"data-tgph-combobox-search":!0,"aria-controls":a.contentId,...i,tgphRef:u})]})},ic=({icon:e={icon:Q.Search,alt:"Search Icon"},message:t="No results found",children:n,...s})=>{const r=p.useContext(D),[i,o]=p.useState(!1);if(p.useEffect(()=>{var u,l;const a=(l=(u=r.contentRef)==null?void 0:u.current)==null?void 0:l.querySelectorAll("[data-tgph-combobox-option]");(a==null?void 0:a.length)===0?o(!0):o(!1)},[r.searchQuery,r.contentRef,n]),i)return b.jsxs(_.Stack,{gap:"1",align:"center",justify:"center",w:"full",my:"8","data-tgph-combobox-empty":!0,...s,children:[e===null?b.jsx(b.Fragment,{}):b.jsx(xn.Icon,{...e}),t===null?b.jsx(b.Fragment,{}):b.jsx(dt.Text,{as:"span",children:t})]})},oc=({leadingText:e="Create",values:t,onCreate:n,selected:s=null,legacyBehavior:r=!1,...i})=>{const o=p.useContext(D),a=p.useCallback(u=>!t||(t==null?void 0:t.length)===0?!1:t.some(l=>H(l,r)===u),[t,r]);if(o.searchQuery&&!a(o.searchQuery))return b.jsx(Ks,{leadingIcon:{icon:Q.Plus,"aria-hidden":!0},mx:"1",value:o.searchQuery,label:`${e} "${o.searchQuery}"`,selected:s,onSelect:()=>{var u;if(n&&o.searchQuery){const l=r===!0?{value:o.searchQuery}:o.searchQuery;n(l),(u=o.setSearchQuery)==null||u.call(o,"")}},...i})},$s={};Object.assign($s,{Root:Ja,Trigger:tc,Content:nc,Options:sc,Option:Ks,Search:rc,Empty:ic,Create:oc,Primitives:W});exports.Combobox=$s;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("react/jsx-runtime"),Ws=require("@radix-ui/react-dismissable-layer"),Hs=require("@radix-ui/react-portal"),qs=require("@radix-ui/react-use-controllable-state"),Gs=require("@radix-ui/react-visually-hidden"),oe=require("@telegraph/button"),vn=require("@telegraph/compose-refs"),Us=require("@telegraph/helpers"),xn=require("@telegraph/icon"),zs=require("@telegraph/input"),H=require("@telegraph/layout"),Ee=require("@telegraph/menu"),dt=require("@telegraph/typography"),Q=require("lucide-react"),p=require("react"),ht=require("@telegraph/tag"),Ys=require("@telegraph/tooltip"),Tn=require("@telegraph/truncate");function wn(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const Xs=wn(Hs),Qs=wn(Gs),Zs=p.createContext({});function Js(e){const t=p.useRef(null);return t.current===null&&(t.current=e()),t.current}const pt=typeof window<"u",er=pt?p.useLayoutEffect:p.useEffect,Sn=p.createContext(null);function tr(e,t){e.indexOf(t)===-1&&e.push(t)}function nr(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Z=(e,t,n)=>n>t?t:n<e?e:n;let ve=()=>{},J=()=>{};process.env.NODE_ENV!=="production"&&(ve=(e,t)=>{!e&&typeof console<"u"&&console.warn(t)},J=(e,t)=>{if(!e)throw new Error(t)});const _={},Vn=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function sr(e){return typeof e=="object"&&e!==null}const Cn=e=>/^0[^.\s]+$/u.test(e);function mt(e){let t;return()=>(t===void 0&&(t=e()),t)}const ae=e=>e,rr=(e,t)=>n=>t(e(n)),Ie=(...e)=>e.reduce(rr),An=(e,t,n)=>{const s=t-e;return s===0?1:(n-e)/s};class Mn{constructor(){this.subscriptions=[]}add(t){return tr(this.subscriptions,t),()=>nr(this.subscriptions,t)}notify(t,n,s){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](t,n,s);else for(let i=0;i<r;i++){const o=this.subscriptions[i];o&&o(t,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const B=e=>e*1e3,N=e=>e/1e3;function Pn(e,t){return t?e*(1e3/t):0}const _t=new Set;function Rn(e,t,n){e||_t.has(t)||(console.warn(t),_t.add(t))}const Fn=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,ir=1e-7,or=12;function ar(e,t,n,s,r){let i,o,a=0;do o=t+(n-t)/2,i=Fn(o,s,r)-e,i>0?n=o:t=o;while(Math.abs(i)>ir&&++a<or);return o}function xe(e,t,n,s){if(e===t&&n===s)return ae;const r=i=>ar(i,0,1,e,n);return i=>i===0||i===1?i:Fn(r(i),t,s)}const Dn=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,On=e=>t=>1-e(1-t),En=xe(.33,1.53,.69,.99),gt=On(En),In=Dn(gt),kn=e=>(e*=2)<1?.5*gt(e):.5*(2-Math.pow(2,-10*(e-1))),yt=e=>1-Math.sin(Math.acos(e)),cr=On(yt),jn=Dn(yt),ur=xe(.42,0,1,1),lr=xe(0,0,.58,1),Bn=xe(.42,0,.58,1),fr=e=>Array.isArray(e)&&typeof e[0]!="number",Ln=e=>Array.isArray(e)&&typeof e[0]=="number",$t={linear:ae,easeIn:ur,easeInOut:Bn,easeOut:lr,circIn:yt,circInOut:jn,circOut:cr,backIn:gt,backInOut:In,backOut:En,anticipate:kn},dr=e=>typeof e=="string",Wt=e=>{if(Ln(e)){J(e.length===4,"Cubic bezier arrays must contain four numerical values.");const[t,n,s,r]=e;return xe(t,n,s,r)}else if(dr(e))return J($t[e]!==void 0,`Invalid easing type '${e}'`),$t[e];return e},we=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function hr(e,t){let n=new Set,s=new Set,r=!1,i=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function u(c){o.has(c)&&(l.schedule(c),e()),c(a)}const l={schedule:(c,d=!1,f=!1)=>{const g=f&&r?n:s;return d&&o.add(c),g.has(c)||g.add(c),c},cancel:c=>{s.delete(c),o.delete(c)},process:c=>{if(a=c,r){i=!0;return}r=!0,[n,s]=[s,n],n.forEach(u),n.clear(),r=!1,i&&(i=!1,l.process(c))}};return l}const pr=40;function Nn(e,t){let n=!1,s=!0;const r={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=we.reduce((x,A)=>(x[A]=hr(i),x),{}),{setup:a,read:u,resolveKeyframes:l,preUpdate:c,update:d,preRender:f,render:h,postRender:g}=o,y=()=>{const x=_.useManualTiming?r.timestamp:performance.now();n=!1,_.useManualTiming||(r.delta=s?1e3/60:Math.max(Math.min(x-r.timestamp,pr),1)),r.timestamp=x,r.isProcessing=!0,a.process(r),u.process(r),l.process(r),c.process(r),d.process(r),f.process(r),h.process(r),g.process(r),r.isProcessing=!1,n&&t&&(s=!1,e(y))},v=()=>{n=!0,s=!0,r.isProcessing||e(y)};return{schedule:we.reduce((x,A)=>{const S=o[A];return x[A]=(C,M=!1,V=!1)=>(n||v(),S.schedule(C,M,V)),x},{}),cancel:x=>{for(let A=0;A<we.length;A++)o[we[A]].cancel(x)},state:r,steps:o}}const{schedule:j,cancel:ze,state:Me}=Nn(typeof requestAnimationFrame<"u"?requestAnimationFrame:ae,!0);let Ve;function mr(){Ve=void 0}const k={now:()=>(Ve===void 0&&k.set(Me.isProcessing||_.useManualTiming?Me.timestamp:performance.now()),Ve),set:e=>{Ve=e,queueMicrotask(mr)}},Kn=e=>t=>typeof t=="string"&&t.startsWith(e),_n=Kn("--"),gr=Kn("var(--"),bt=e=>gr(e)?yr.test(e.split("/*")[0].trim()):!1,yr=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,ce={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},me={...ce,transform:e=>Z(0,1,e)},Se={...ce,default:1},pe=e=>Math.round(e*1e5)/1e5,vt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function br(e){return e==null}const vr=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,xt=(e,t)=>n=>!!(typeof n=="string"&&vr.test(n)&&n.startsWith(e)||t&&!br(n)&&Object.prototype.hasOwnProperty.call(n,t)),$n=(e,t,n)=>s=>{if(typeof s!="string")return s;const[r,i,o,a]=s.match(vt);return{[e]:parseFloat(r),[t]:parseFloat(i),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},xr=e=>Z(0,255,e),_e={...ce,transform:e=>Math.round(xr(e))},U={test:xt("rgb","red"),parse:$n("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:s=1})=>"rgba("+_e.transform(e)+", "+_e.transform(t)+", "+_e.transform(n)+", "+pe(me.transform(s))+")"};function Tr(e){let t="",n="",s="",r="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),s=e.substring(5,7),r=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),s=e.substring(3,4),r=e.substring(4,5),t+=t,n+=n,s+=s,r+=r),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:r?parseInt(r,16)/255:1}}const Ye={test:xt("#"),parse:Tr,transform:U.transform},Te=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),$=Te("deg"),re=Te("%"),T=Te("px"),wr=Te("vh"),Sr=Te("vw"),Ht={...re,parse:e=>re.parse(e)/100,transform:e=>re.transform(e*100)},ne={test:xt("hsl","hue"),parse:$n("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:s=1})=>"hsla("+Math.round(e)+", "+re.transform(pe(t))+", "+re.transform(pe(n))+", "+pe(me.transform(s))+")"},R={test:e=>U.test(e)||Ye.test(e)||ne.test(e),parse:e=>U.test(e)?U.parse(e):ne.test(e)?ne.parse(e):Ye.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?U.transform(e):ne.transform(e),getAnimatableNone:e=>{const t=R.parse(e);return t.alpha=0,R.transform(t)}},Vr=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Cr(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(vt))==null?void 0:t.length)||0)+(((n=e.match(Vr))==null?void 0:n.length)||0)>0}const Wn="number",Hn="color",Ar="var",Mr="var(",qt="${}",Pr=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function ge(e){const t=e.toString(),n=[],s={color:[],number:[],var:[]},r=[];let i=0;const a=t.replace(Pr,u=>(R.test(u)?(s.color.push(i),r.push(Hn),n.push(R.parse(u))):u.startsWith(Mr)?(s.var.push(i),r.push(Ar),n.push(u)):(s.number.push(i),r.push(Wn),n.push(parseFloat(u))),++i,qt)).split(qt);return{values:n,split:a,indexes:s,types:r}}function qn(e){return ge(e).values}function Gn(e){const{split:t,types:n}=ge(e),s=t.length;return r=>{let i="";for(let o=0;o<s;o++)if(i+=t[o],r[o]!==void 0){const a=n[o];a===Wn?i+=pe(r[o]):a===Hn?i+=R.transform(r[o]):i+=r[o]}return i}}const Rr=e=>typeof e=="number"?0:R.test(e)?R.getAnimatableNone(e):e;function Fr(e){const t=qn(e);return Gn(e)(t.map(Rr))}const ue={test:Cr,parse:qn,createTransformer:Gn,getAnimatableNone:Fr};function $e(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Dr({hue:e,saturation:t,lightness:n,alpha:s}){e/=360,t/=100,n/=100;let r=0,i=0,o=0;if(!t)r=i=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,u=2*n-a;r=$e(u,a,e+1/3),i=$e(u,a,e),o=$e(u,a,e-1/3)}return{red:Math.round(r*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:s}}function Pe(e,t){return n=>n>0?t:e}const ke=(e,t,n)=>e+(t-e)*n,We=(e,t,n)=>{const s=e*e,r=n*(t*t-s)+s;return r<0?0:Math.sqrt(r)},Or=[Ye,U,ne],Er=e=>Or.find(t=>t.test(e));function Gt(e){const t=Er(e);if(ve(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`),!t)return!1;let n=t.parse(e);return t===ne&&(n=Dr(n)),n}const Ut=(e,t)=>{const n=Gt(e),s=Gt(t);if(!n||!s)return Pe(e,t);const r={...n};return i=>(r.red=We(n.red,s.red,i),r.green=We(n.green,s.green,i),r.blue=We(n.blue,s.blue,i),r.alpha=ke(n.alpha,s.alpha,i),U.transform(r))},Xe=new Set(["none","hidden"]);function Ir(e,t){return Xe.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function kr(e,t){return n=>ke(e,t,n)}function Tt(e){return typeof e=="number"?kr:typeof e=="string"?bt(e)?Pe:R.test(e)?Ut:Lr:Array.isArray(e)?Un:typeof e=="object"?R.test(e)?Ut:jr:Pe}function Un(e,t){const n=[...e],s=n.length,r=e.map((i,o)=>Tt(i)(i,t[o]));return i=>{for(let o=0;o<s;o++)n[o]=r[o](i);return n}}function jr(e,t){const n={...e,...t},s={};for(const r in n)e[r]!==void 0&&t[r]!==void 0&&(s[r]=Tt(e[r])(e[r],t[r]));return r=>{for(const i in s)n[i]=s[i](r);return n}}function Br(e,t){const n=[],s={color:0,var:0,number:0};for(let r=0;r<t.values.length;r++){const i=t.types[r],o=e.indexes[i][s[i]],a=e.values[o]??0;n[r]=a,s[i]++}return n}const Lr=(e,t)=>{const n=ue.createTransformer(t),s=ge(e),r=ge(t);return s.indexes.var.length===r.indexes.var.length&&s.indexes.color.length===r.indexes.color.length&&s.indexes.number.length>=r.indexes.number.length?Xe.has(e)&&!r.values.length||Xe.has(t)&&!s.values.length?Ir(e,t):Ie(Un(Br(s,r),r.values),n):(ve(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),Pe(e,t))};function zn(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?ke(e,t,n):Tt(e)(e,t)}const Nr=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>j.update(t,n),stop:()=>ze(t),now:()=>Me.isProcessing?Me.timestamp:k.now()}},Yn=(e,t,n=10)=>{let s="";const r=Math.max(Math.round(t/n),2);for(let i=0;i<r;i++)s+=Math.round(e(i/(r-1))*1e4)/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},Re=2e4;function wt(e){let t=0;const n=50;let s=e.next(t);for(;!s.done&&t<Re;)t+=n,s=e.next(t);return t>=Re?1/0:t}function Kr(e,t=100,n){const s=n({...e,keyframes:[0,t]}),r=Math.min(wt(s),Re);return{type:"keyframes",ease:i=>s.next(r*i).value/t,duration:N(r)}}const _r=5;function Xn(e,t,n){const s=Math.max(t-_r,0);return Pn(n-e(s),t-s)}const P={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},He=.001;function $r({duration:e=P.duration,bounce:t=P.bounce,velocity:n=P.velocity,mass:s=P.mass}){let r,i;ve(e<=B(P.maxDuration),"Spring duration must be 10 seconds or less");let o=1-t;o=Z(P.minDamping,P.maxDamping,o),e=Z(P.minDuration,P.maxDuration,N(e)),o<1?(r=l=>{const c=l*o,d=c*e,f=c-n,h=Qe(l,o),g=Math.exp(-d);return He-f/h*g},i=l=>{const d=l*o*e,f=d*n+n,h=Math.pow(o,2)*Math.pow(l,2)*e,g=Math.exp(-d),y=Qe(Math.pow(l,2),o);return(-r(l)+He>0?-1:1)*((f-h)*g)/y}):(r=l=>{const c=Math.exp(-l*e),d=(l-n)*e+1;return-He+c*d},i=l=>{const c=Math.exp(-l*e),d=(n-l)*(e*e);return c*d});const a=5/e,u=Hr(r,i,a);if(e=B(e),isNaN(u))return{stiffness:P.stiffness,damping:P.damping,duration:e};{const l=Math.pow(u,2)*s;return{stiffness:l,damping:o*2*Math.sqrt(s*l),duration:e}}}const Wr=12;function Hr(e,t,n){let s=n;for(let r=1;r<Wr;r++)s=s-e(s)/t(s);return s}function Qe(e,t){return e*Math.sqrt(1-t*t)}const qr=["duration","bounce"],Gr=["stiffness","damping","mass"];function zt(e,t){return t.some(n=>e[n]!==void 0)}function Ur(e){let t={velocity:P.velocity,stiffness:P.stiffness,damping:P.damping,mass:P.mass,isResolvedFromDuration:!1,...e};if(!zt(e,Gr)&&zt(e,qr))if(e.visualDuration){const n=e.visualDuration,s=2*Math.PI/(n*1.2),r=s*s,i=2*Z(.05,1,1-(e.bounce||0))*Math.sqrt(r);t={...t,mass:P.mass,stiffness:r,damping:i}}else{const n=$r(e);t={...t,...n,mass:P.mass},t.isResolvedFromDuration=!0}return t}function Fe(e=P.visualDuration,t=P.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:s,restDelta:r}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:i},{stiffness:u,damping:l,mass:c,duration:d,velocity:f,isResolvedFromDuration:h}=Ur({...n,velocity:-N(n.velocity||0)}),g=f||0,y=l/(2*Math.sqrt(u*c)),v=o-i,m=N(Math.sqrt(u/c)),w=Math.abs(v)<5;s||(s=w?P.restSpeed.granular:P.restSpeed.default),r||(r=w?P.restDelta.granular:P.restDelta.default);let x;if(y<1){const S=Qe(m,y);x=C=>{const M=Math.exp(-y*m*C);return o-M*((g+y*m*v)/S*Math.sin(S*C)+v*Math.cos(S*C))}}else if(y===1)x=S=>o-Math.exp(-m*S)*(v+(g+m*v)*S);else{const S=m*Math.sqrt(y*y-1);x=C=>{const M=Math.exp(-y*m*C),V=Math.min(S*C,300);return o-M*((g+y*m*v)*Math.sinh(V)+S*v*Math.cosh(V))/S}}const A={calculatedDuration:h&&d||null,next:S=>{const C=x(S);if(h)a.done=S>=d;else{let M=S===0?g:0;y<1&&(M=S===0?B(g):Xn(x,S,C));const V=Math.abs(M)<=s,F=Math.abs(o-C)<=r;a.done=V&&F}return a.value=a.done?o:C,a},toString:()=>{const S=Math.min(wt(A),Re),C=Yn(M=>A.next(S*M).value,S,30);return S+"ms "+C},toTransition:()=>{}};return A}Fe.applyToOptions=e=>{const t=Kr(e,100,Fe);return e.ease=t.ease,e.duration=B(t.duration),e.type="keyframes",e};function Ze({keyframes:e,velocity:t=0,power:n=.8,timeConstant:s=325,bounceDamping:r=10,bounceStiffness:i=500,modifyTarget:o,min:a,max:u,restDelta:l=.5,restSpeed:c}){const d=e[0],f={done:!1,value:d},h=V=>a!==void 0&&V<a||u!==void 0&&V>u,g=V=>a===void 0?u:u===void 0||Math.abs(a-V)<Math.abs(u-V)?a:u;let y=n*t;const v=d+y,m=o===void 0?v:o(v);m!==v&&(y=m-d);const w=V=>-y*Math.exp(-V/s),x=V=>m+w(V),A=V=>{const F=w(V),I=x(V);f.done=Math.abs(F)<=l,f.value=f.done?m:I};let S,C;const M=V=>{h(f.value)&&(S=V,C=Fe({keyframes:[f.value,g(f.value)],velocity:Xn(x,V,f.value),damping:r,stiffness:i,restDelta:l,restSpeed:c}))};return M(0),{calculatedDuration:null,next:V=>{let F=!1;return!C&&S===void 0&&(F=!0,A(V),M(V)),S!==void 0&&V>=S?C.next(V-S):(!F&&A(V),f)}}}function zr(e,t,n){const s=[],r=n||_.mix||zn,i=e.length-1;for(let o=0;o<i;o++){let a=r(e[o],e[o+1]);if(t){const u=Array.isArray(t)?t[o]||ae:t;a=Ie(u,a)}s.push(a)}return s}function Yr(e,t,{clamp:n=!0,ease:s,mixer:r}={}){const i=e.length;if(J(i===t.length,"Both input and output ranges must be the same length"),i===1)return()=>t[0];if(i===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=zr(t,s,r),u=a.length,l=c=>{if(o&&c<e[0])return t[0];let d=0;if(u>1)for(;d<e.length-2&&!(c<e[d+1]);d++);const f=An(e[d],e[d+1],c);return a[d](f)};return n?c=>l(Z(e[0],e[i-1],c)):l}function Xr(e,t){const n=e[e.length-1];for(let s=1;s<=t;s++){const r=An(0,t,s);e.push(ke(n,1,r))}}function Qr(e){const t=[0];return Xr(t,e.length-1),t}function Zr(e,t){return e.map(n=>n*t)}function Jr(e,t){return e.map(()=>t||Bn).splice(0,e.length-1)}function se({duration:e=300,keyframes:t,times:n,ease:s="easeInOut"}){const r=fr(s)?s.map(Wt):Wt(s),i={done:!1,value:t[0]},o=Zr(n&&n.length===t.length?n:Qr(t),e),a=Yr(o,t,{ease:Array.isArray(r)?r:Jr(t,r)});return{calculatedDuration:e,next:u=>(i.value=a(u),i.done=u>=e,i)}}const ei=e=>e!==null;function St(e,{repeat:t,repeatType:n="loop"},s,r=1){const i=e.filter(ei),a=r<0||t&&n!=="loop"&&t%2===1?0:i.length-1;return!a||s===void 0?i[a]:s}const ti={decay:Ze,inertia:Ze,tween:se,keyframes:se,spring:Fe};function Qn(e){typeof e.type=="string"&&(e.type=ti[e.type])}class Vt{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const ni=e=>e/100;class Ct extends Vt{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var s,r;const{motionValue:n}=this.options;n&&n.updatedAt!==k.now()&&this.tick(k.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(r=(s=this.options).onStop)==null||r.call(s))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;Qn(t);const{type:n=se,repeat:s=0,repeatDelay:r=0,repeatType:i,velocity:o=0}=t;let{keyframes:a}=t;const u=n||se;process.env.NODE_ENV!=="production"&&u!==se&&J(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`),u!==se&&typeof a[0]!="number"&&(this.mixKeyframes=Ie(ni,zn(a[0],a[1])),a=[0,100]);const l=u({...t,keyframes:a});i==="mirror"&&(this.mirroredGenerator=u({...t,keyframes:[...a].reverse(),velocity:-o})),l.calculatedDuration===null&&(l.calculatedDuration=wt(l));const{calculatedDuration:c}=l;this.calculatedDuration=c,this.resolvedDuration=c+r,this.totalDuration=this.resolvedDuration*(s+1)-r,this.generator=l}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:s,totalDuration:r,mixKeyframes:i,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:u}=this;if(this.startTime===null)return s.next(0);const{delay:l=0,keyframes:c,repeat:d,repeatType:f,repeatDelay:h,type:g,onUpdate:y,finalKeyframe:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-r/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const m=this.currentTime-l*(this.playbackSpeed>=0?1:-1),w=this.playbackSpeed>=0?m<0:m>r;this.currentTime=Math.max(m,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=r);let x=this.currentTime,A=s;if(d){const V=Math.min(this.currentTime,r)/a;let F=Math.floor(V),I=V%1;!I&&V>=1&&(I=1),I===1&&F--,F=Math.min(F,d+1),!!(F%2)&&(f==="reverse"?(I=1-I,h&&(I-=h/a)):f==="mirror"&&(A=o)),x=Z(0,1,I)*a}const S=w?{done:!1,value:c[0]}:A.next(x);i&&(S.value=i(S.value));let{done:C}=S;!w&&u!==null&&(C=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);const M=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&C);return M&&g!==Ze&&(S.value=St(c,this.options,v,this.speed)),y&&y(S.value),M&&this.finish(),S}then(t,n){return this.finished.then(t,n)}get duration(){return N(this.calculatedDuration)}get time(){return N(this.currentTime)}set time(t){var n;t=B(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(k.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=N(this.currentTime))}play(){var r,i;if(this.isStopped)return;const{driver:t=Nr,startTime:n}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),(i=(r=this.options).onPlay)==null||i.call(r);const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=n??s),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(k.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function si(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const z=e=>e*180/Math.PI,Je=e=>{const t=z(Math.atan2(e[1],e[0]));return et(t)},ri={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Je,rotateZ:Je,skewX:e=>z(Math.atan(e[1])),skewY:e=>z(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},et=e=>(e=e%360,e<0&&(e+=360),e),Yt=Je,Xt=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Qt=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),ii={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Xt,scaleY:Qt,scale:e=>(Xt(e)+Qt(e))/2,rotateX:e=>et(z(Math.atan2(e[6],e[5]))),rotateY:e=>et(z(Math.atan2(-e[2],e[0]))),rotateZ:Yt,rotate:Yt,skewX:e=>z(Math.atan(e[4])),skewY:e=>z(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function tt(e){return e.includes("scale")?1:0}function nt(e,t){if(!e||e==="none")return tt(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,r;if(n)s=ii,r=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=ri,r=a}if(!r)return tt(t);const i=s[t],o=r[1].split(",").map(ai);return typeof i=="function"?i(o):o[i]}const oi=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return nt(n,t)};function ai(e){return parseFloat(e.trim())}const le=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],fe=new Set(le),Zt=e=>e===ce||e===T,ci=new Set(["x","y","z"]),ui=le.filter(e=>!ci.has(e));function li(e){const t=[];return ui.forEach(n=>{const s=e.getValue(n);s!==void 0&&(t.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),t}const Y={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>nt(t,"x"),y:(e,{transform:t})=>nt(t,"y")};Y.translateX=Y.x;Y.translateY=Y.y;const X=new Set;let st=!1,rt=!1,it=!1;function Zn(){if(rt){const e=Array.from(X).filter(s=>s.needsMeasurement),t=new Set(e.map(s=>s.element)),n=new Map;t.forEach(s=>{const r=li(s);r.length&&(n.set(s,r),s.render())}),e.forEach(s=>s.measureInitialState()),t.forEach(s=>{s.render();const r=n.get(s);r&&r.forEach(([i,o])=>{var a;(a=s.getValue(i))==null||a.set(o)})}),e.forEach(s=>s.measureEndState()),e.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}rt=!1,st=!1,X.forEach(e=>e.complete(it)),X.clear()}function Jn(){X.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(rt=!0)})}function fi(){it=!0,Jn(),Zn(),it=!1}class At{constructor(t,n,s,r,i,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=s,this.motionValue=r,this.element=i,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(X.add(this),st||(st=!0,j.read(Jn),j.resolveKeyframes(Zn))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:s,motionValue:r}=this;if(t[0]===null){const i=r==null?void 0:r.get(),o=t[t.length-1];if(i!==void 0)t[0]=i;else if(s&&n){const a=s.readValue(n,o);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=o),r&&i===void 0&&r.set(t[0])}si(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),X.delete(this)}cancel(){this.state==="scheduled"&&(X.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const di=e=>e.startsWith("--");function hi(e,t,n){di(t)?e.style.setProperty(t,n):e.style[t]=n}const pi=mt(()=>window.ScrollTimeline!==void 0),mi={};function gi(e,t){const n=mt(e);return()=>mi[t]??n()}const es=gi(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),he=([e,t,n,s])=>`cubic-bezier(${e}, ${t}, ${n}, ${s})`,Jt={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:he([0,.65,.55,1]),circOut:he([.55,0,1,.45]),backIn:he([.31,.01,.66,-.59]),backOut:he([.33,1.53,.69,.99])};function ts(e,t){if(e)return typeof e=="function"?es()?Yn(e,t):"ease-out":Ln(e)?he(e):Array.isArray(e)?e.map(n=>ts(n,t)||Jt.easeOut):Jt[e]}function yi(e,t,n,{delay:s=0,duration:r=300,repeat:i=0,repeatType:o="loop",ease:a="easeOut",times:u}={},l=void 0){const c={[t]:n};u&&(c.offset=u);const d=ts(a,r);Array.isArray(d)&&(c.easing=d);const f={delay:s,duration:r,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"};return l&&(f.pseudoElement=l),e.animate(c,f)}function ns(e){return typeof e=="function"&&"applyToOptions"in e}function bi({type:e,...t}){return ns(e)&&es()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class vi extends Vt{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:n,name:s,keyframes:r,pseudoElement:i,allowFlatten:o=!1,finalKeyframe:a,onComplete:u}=t;this.isPseudoElement=!!i,this.allowFlatten=o,this.options=t,J(typeof t.type!="string",`animateMini doesn't support "type" as a string. Did you mean to import { spring } from "motion"?`);const l=bi(t);this.animation=yi(n,s,r,l,i),l.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const c=St(r,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(c):hi(n,s,c),this.animation.cancel()}u==null||u(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var t,n;this.isPseudoElement||(n=(t=this.animation).commitStyles)==null||n.call(t)}get duration(){var n,s;const t=((s=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:s.call(n).duration)||0;return N(Number(t))}get time(){return N(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=B(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){var s;return this.allowFlatten&&((s=this.animation.effect)==null||s.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&pi()?(this.animation.timeline=t,ae):n(this)}}const ss={anticipate:kn,backInOut:In,circInOut:jn};function xi(e){return e in ss}function Ti(e){typeof e.ease=="string"&&xi(e.ease)&&(e.ease=ss[e.ease])}const en=10;class wi extends vi{constructor(t){Ti(t),Qn(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:s,onComplete:r,element:i,...o}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const a=new Ct({...o,autoplay:!1}),u=B(this.finishedTime??this.time);n.setWithVelocity(a.sample(u-en).value,a.sample(u).value,en),a.stop()}}const tn=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(ue.test(e)||e==="0")&&!e.startsWith("url("));function Si(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function Vi(e,t,n,s){const r=e[0];if(r===null)return!1;if(t==="display"||t==="visibility")return!0;const i=e[e.length-1],o=tn(r,t),a=tn(i,t);return ve(o===a,`You are trying to animate ${t} from "${r}" to "${i}". ${r} is not an animatable value - to enable this animation set ${r} to a value animatable to ${i} via the \`style\` property.`),!o||!a?!1:Si(e)||(n==="spring"||ns(n))&&s}function rs(e){return sr(e)&&"offsetHeight"in e}const Ci=new Set(["opacity","clipPath","filter","transform"]),Ai=mt(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Mi(e){var l;const{motionValue:t,name:n,repeatDelay:s,repeatType:r,damping:i,type:o}=e;if(!rs((l=t==null?void 0:t.owner)==null?void 0:l.current))return!1;const{onUpdate:a,transformTemplate:u}=t.owner.getProps();return Ai()&&n&&Ci.has(n)&&(n!=="transform"||!u)&&!a&&!s&&r!=="mirror"&&i!==0&&o!=="inertia"}const Pi=40;class Ri extends Vt{constructor({autoplay:t=!0,delay:n=0,type:s="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:o="loop",keyframes:a,name:u,motionValue:l,element:c,...d}){var g;super(),this.stop=()=>{var y,v;this._animation&&(this._animation.stop(),(y=this.stopTimeline)==null||y.call(this)),(v=this.keyframeResolver)==null||v.cancel()},this.createdAt=k.now();const f={autoplay:t,delay:n,type:s,repeat:r,repeatDelay:i,repeatType:o,name:u,motionValue:l,element:c,...d},h=(c==null?void 0:c.KeyframeResolver)||At;this.keyframeResolver=new h(a,(y,v,m)=>this.onKeyframesResolved(y,v,f,!m),u,l,c),(g=this.keyframeResolver)==null||g.scheduleResolve()}onKeyframesResolved(t,n,s,r){this.keyframeResolver=void 0;const{name:i,type:o,velocity:a,delay:u,isHandoff:l,onUpdate:c}=s;this.resolvedAt=k.now(),Vi(t,i,o,a)||((_.instantAnimations||!u)&&(c==null||c(St(t,s,n))),t[0]=t[t.length-1],s.duration=0,s.repeat=0);const f={startTime:r?this.resolvedAt?this.resolvedAt-this.createdAt>Pi?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:t},h=!l&&Mi(f)?new wi({...f,element:f.motionValue.owner.current}):new Ct(f);h.finished.then(()=>this.notifyFinished()).catch(ae),this.pendingTimeline&&(this.stopTimeline=h.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=h}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),fi()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}const Fi=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Di(e){const t=Fi.exec(e);if(!t)return[,];const[,n,s,r]=t;return[`--${n??s}`,r]}const Oi=4;function is(e,t,n=1){J(n<=Oi,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[s,r]=Di(e);if(!s)return;const i=window.getComputedStyle(t).getPropertyValue(s);if(i){const o=i.trim();return Vn(o)?parseFloat(o):o}return bt(r)?is(r,t,n+1):r}function os(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const as=new Set(["width","height","top","left","right","bottom",...le]),Ei={test:e=>e==="auto",parse:e=>e},cs=e=>t=>t.test(e),us=[ce,T,re,$,Sr,wr,Ei],nn=e=>us.find(cs(e));function Ii(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Cn(e):!0}const ki=new Set(["brightness","contrast","saturate","opacity"]);function ji(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[s]=n.match(vt)||[];if(!s)return e;const r=n.replace(s,"");let i=ki.has(t)?1:0;return s!==n&&(i*=100),t+"("+i+r+")"}const Bi=/\b([a-z-]*)\(.*?\)/gu,ot={...ue,getAnimatableNone:e=>{const t=e.match(Bi);return t?t.map(ji).join(" "):e}},sn={...ce,transform:Math.round},Li={rotate:$,rotateX:$,rotateY:$,rotateZ:$,scale:Se,scaleX:Se,scaleY:Se,scaleZ:Se,skew:$,skewX:$,skewY:$,distance:T,translateX:T,translateY:T,translateZ:T,x:T,y:T,z:T,perspective:T,transformPerspective:T,opacity:me,originX:Ht,originY:Ht,originZ:T},Mt={borderWidth:T,borderTopWidth:T,borderRightWidth:T,borderBottomWidth:T,borderLeftWidth:T,borderRadius:T,radius:T,borderTopLeftRadius:T,borderTopRightRadius:T,borderBottomRightRadius:T,borderBottomLeftRadius:T,width:T,maxWidth:T,height:T,maxHeight:T,top:T,right:T,bottom:T,left:T,padding:T,paddingTop:T,paddingRight:T,paddingBottom:T,paddingLeft:T,margin:T,marginTop:T,marginRight:T,marginBottom:T,marginLeft:T,backgroundPositionX:T,backgroundPositionY:T,...Li,zIndex:sn,fillOpacity:me,strokeOpacity:me,numOctaves:sn},Ni={...Mt,color:R,backgroundColor:R,outlineColor:R,fill:R,stroke:R,borderColor:R,borderTopColor:R,borderRightColor:R,borderBottomColor:R,borderLeftColor:R,filter:ot,WebkitFilter:ot},ls=e=>Ni[e];function fs(e,t){let n=ls(e);return n!==ot&&(n=ue),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Ki=new Set(["auto","none","0"]);function _i(e,t,n){let s=0,r;for(;s<e.length&&!r;){const i=e[s];typeof i=="string"&&!Ki.has(i)&&ge(i).values.length&&(r=e[s]),s++}if(r&&n)for(const i of t)e[i]=fs(n,r)}class $i extends At{constructor(t,n,s,r,i){super(t,n,s,r,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let u=0;u<t.length;u++){let l=t[u];if(typeof l=="string"&&(l=l.trim(),bt(l))){const c=is(l,n.current);c!==void 0&&(t[u]=c),u===t.length-1&&(this.finalKeyframe=l)}}if(this.resolveNoneKeyframes(),!as.has(s)||t.length!==2)return;const[r,i]=t,o=nn(r),a=nn(i);if(o!==a)if(Zt(o)&&Zt(a))for(let u=0;u<t.length;u++){const l=t[u];typeof l=="string"&&(t[u]=parseFloat(l))}else Y[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,s=[];for(let r=0;r<t.length;r++)(t[r]===null||Ii(t[r]))&&s.push(r);s.length&&_i(t,s,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:s}=this;if(!t||!t.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Y[s](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const r=n[n.length-1];r!==void 0&&t.getValue(s,r).jump(r,!1)}measureEndState(){var a;const{element:t,name:n,unresolvedKeyframes:s}=this;if(!t||!t.current)return;const r=t.getValue(n);r&&r.jump(this.measuredOrigin,!1);const i=s.length-1,o=s[i];s[i]=Y[n](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([u,l])=>{t.getValue(u).set(l)}),this.resolveNoneKeyframes()}}function Wi(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let s=document;const r=(n==null?void 0:n[e])??s.querySelectorAll(e);return r?Array.from(r):[]}return Array.from(e)}const ds=(e,t)=>t&&typeof e=="number"?t.transform(e):e,rn=30,Hi=e=>!isNaN(parseFloat(e));class qi{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=(s,r=!0)=>{var o,a;const i=k.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&((o=this.events.change)==null||o.notify(this.current),this.dependents))for(const u of this.dependents)u.dirty();r&&((a=this.events.renderRequest)==null||a.notify(this.current))},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=k.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Hi(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&Rn(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Mn);const s=this.events[t].add(n);return t==="change"?()=>{s(),j.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=k.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>rn)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,rn);return Pn(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function De(e,t){return new qi(e,t)}const{schedule:Gi}=Nn(queueMicrotask,!1),Ui={y:!1};function zi(){return Ui.y}function hs(e,t){const n=Wi(e),s=new AbortController,r={passive:!0,...t,signal:s.signal};return[n,r,()=>s.abort()]}function on(e){return!(e.pointerType==="touch"||zi())}function Yi(e,t,n={}){const[s,r,i]=hs(e,n),o=a=>{if(!on(a))return;const{target:u}=a,l=t(u,a);if(typeof l!="function"||!u)return;const c=d=>{on(d)&&(l(d),u.removeEventListener("pointerleave",c))};u.addEventListener("pointerleave",c,r)};return s.forEach(a=>{a.addEventListener("pointerenter",o,r)}),i}const ps=(e,t)=>t?e===t?!0:ps(e,t.parentElement):!1,Xi=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Qi=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Zi(e){return Qi.has(e.tagName)||e.tabIndex!==-1}const Ce=new WeakSet;function an(e){return t=>{t.key==="Enter"&&e(t)}}function qe(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const Ji=(e,t)=>{const n=e.currentTarget;if(!n)return;const s=an(()=>{if(Ce.has(n))return;qe(n,"down");const r=an(()=>{qe(n,"up")}),i=()=>qe(n,"cancel");n.addEventListener("keyup",r,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",s,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),t)};function cn(e){return Xi(e)&&!0}function eo(e,t,n={}){const[s,r,i]=hs(e,n),o=a=>{const u=a.currentTarget;if(!cn(a))return;Ce.add(u);const l=t(u,a),c=(h,g)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",f),Ce.has(u)&&Ce.delete(u),cn(h)&&typeof l=="function"&&l(h,{success:g})},d=h=>{c(h,u===window||u===document||n.useGlobalTarget||ps(u,h.target))},f=h=>{c(h,!1)};window.addEventListener("pointerup",d,r),window.addEventListener("pointercancel",f,r)};return s.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,r),rs(a)&&(a.addEventListener("focus",l=>Ji(l,r)),!Zi(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),i}const E=e=>!!(e&&e.getVelocity),to=[...us,R,ue],no=e=>to.find(cs(e)),ms=p.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),Pt=p.createContext({strict:!1}),un={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"]},ie={};for(const e in un)ie[e]={isEnabled:t=>un[e].some(n=>!!t[n])};function ln(e){for(const t in e)ie[t]={...ie[t],...e[t]}}function so({children:e,features:t,strict:n=!1}){const[,s]=p.useState(!Ge(t)),r=p.useRef(void 0);if(!Ge(t)){const{renderer:i,...o}=t;r.current=i,ln(o)}return p.useEffect(()=>{Ge(t)&&t().then(({renderer:i,...o})=>{ln(o),r.current=i,s(!0)})},[]),b.jsx(Pt.Provider,{value:{renderer:r.current,strict:n},children:e})}function Ge(e){return typeof e=="function"}const ro=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 Oe(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||ro.has(e)}let gs=e=>!Oe(e);function io(e){typeof e=="function"&&(gs=t=>t.startsWith("on")?!Oe(t):e(t))}try{io(require("@emotion/is-prop-valid").default)}catch{}function oo(e,t,n){const s={};for(const r in e)r==="values"&&typeof e.values=="object"||(gs(r)||n===!0&&Oe(r)||!t&&!Oe(r)||e.draggable&&r.startsWith("onDrag"))&&(s[r]=e[r]);return s}const je=p.createContext({});function Be(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function ye(e){return typeof e=="string"||Array.isArray(e)}const Rt=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ft=["initial",...Rt];function Le(e){return Be(e.animate)||Ft.some(t=>ye(e[t]))}function ys(e){return!!(Le(e)||e.variants)}function ao(e,t){if(Le(e)){const{initial:n,animate:s}=e;return{initial:n===!1||ye(n)?n:void 0,animate:ye(s)?s:void 0}}return e.inherit!==!1?t:{}}function co(e){const{initial:t,animate:n}=ao(e,p.useContext(je));return p.useMemo(()=>({initial:t,animate:n}),[fn(t),fn(n)])}function fn(e){return Array.isArray(e)?e.join(" "):e}const uo=Symbol.for("motionComponentSymbol");function bs(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function lo(e,t,n){return p.useCallback(s=>{s&&e.onMount&&e.onMount(s),t&&(s?t.mount(s):t.unmount()),n&&(typeof n=="function"?n(s):bs(n)&&(n.current=s))},[t])}const Dt=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),fo="framerAppearId",vs="data-"+Dt(fo),ho=p.createContext({});function po(e,t,n,s,r){var y,v;const{visualElement:i}=p.useContext(je),o=p.useContext(Pt),a=p.useContext(Sn),u=p.useContext(ms).reducedMotion,l=p.useRef(null);s=s||o.renderer,!l.current&&s&&(l.current=s(e,{visualState:t,parent:i,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:u}));const c=l.current,d=p.useContext(ho);c&&!c.projection&&r&&(c.type==="html"||c.type==="svg")&&mo(l.current,n,r,d);const f=p.useRef(!1);p.useInsertionEffect(()=>{c&&f.current&&c.update(n,a)});const h=n[vs],g=p.useRef(!!h&&!((y=window.MotionHandoffIsComplete)!=null&&y.call(window,h))&&((v=window.MotionHasOptimisedAnimation)==null?void 0:v.call(window,h)));return er(()=>{c&&(f.current=!0,window.MotionIsMounted=!0,c.updateFeatures(),Gi.render(c.render),g.current&&c.animationState&&c.animationState.animateChanges())}),p.useEffect(()=>{c&&(!g.current&&c.animationState&&c.animationState.animateChanges(),g.current&&(queueMicrotask(()=>{var m;(m=window.MotionHandoffMarkAsComplete)==null||m.call(window,h)}),g.current=!1))}),c}function mo(e,t,n,s){const{layoutId:r,layout:i,drag:o,dragConstraints:a,layoutScroll:u,layoutRoot:l,layoutCrossfade:c}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:xs(e.parent)),e.projection.setOptions({layoutId:r,layout:i,alwaysMeasureLayout:!!o||a&&bs(a),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:s,crossfade:c,layoutScroll:u,layoutRoot:l})}function xs(e){if(e)return e.options.allowProjection!==!1?e.projection:xs(e.parent)}function go({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:s,Component:r}){function i(a,u){let l;const c={...p.useContext(ms),...a,layoutId:yo(a)},{isStatic:d}=c,f=co(a),h=s(a,d);if(!d&&pt){bo(c,e);const g=vo(c);l=g.MeasureLayout,f.visualElement=po(r,h,c,t,g.ProjectionNode)}return b.jsxs(je.Provider,{value:f,children:[l&&f.visualElement?b.jsx(l,{visualElement:f.visualElement,...c}):null,n(r,a,lo(h,f.visualElement,u),h,d,f.visualElement)]})}i.displayName=`motion.${typeof r=="string"?r:`create(${r.displayName??r.name??""})`}`;const o=p.forwardRef(i);return o[uo]=r,o}function yo({layoutId:e}){const t=p.useContext(Zs).id;return t&&e!==void 0?t+"-"+e:e}function bo(e,t){p.useContext(Pt).strict,process.env.NODE_ENV}function vo(e){const{drag:t,layout:n}=ie;if(!t&&!n)return{};const s={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}const xo={};function Ts(e,{layout:t,layoutId:n}){return fe.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!xo[e]||e==="opacity")}const To={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},wo=le.length;function So(e,t,n){let s="",r=!0;for(let i=0;i<wo;i++){const o=le[i],a=e[o];if(a===void 0)continue;let u=!0;if(typeof a=="number"?u=a===(o.startsWith("scale")?1:0):u=parseFloat(a)===0,!u||n){const l=ds(a,Mt[o]);if(!u){r=!1;const c=To[o]||o;s+=`${c}(${l}) `}n&&(t[o]=l)}}return s=s.trim(),n?s=n(t,r?"":s):r&&(s="none"),s}function Ot(e,t,n){const{style:s,vars:r,transformOrigin:i}=e;let o=!1,a=!1;for(const u in t){const l=t[u];if(fe.has(u)){o=!0;continue}else if(_n(u)){r[u]=l;continue}else{const c=ds(l,Mt[u]);u.startsWith("origin")?(a=!0,i[u]=c):s[u]=c}}if(t.transform||(o||n?s.transform=So(t,e.transform,n):s.transform&&(s.transform="none")),a){const{originX:u="50%",originY:l="50%",originZ:c=0}=i;s.transformOrigin=`${u} ${l} ${c}`}}const Et=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function ws(e,t,n){for(const s in t)!E(t[s])&&!Ts(s,n)&&(e[s]=t[s])}function Vo({transformTemplate:e},t){return p.useMemo(()=>{const n=Et();return Ot(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Co(e,t){const n=e.style||{},s={};return ws(s,n,e),Object.assign(s,Vo(e,t)),s}function Ao(e,t){const n={},s=Co(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=s,n}const Mo={offset:"stroke-dashoffset",array:"stroke-dasharray"},Po={offset:"strokeDashoffset",array:"strokeDasharray"};function Ro(e,t,n=1,s=0,r=!0){e.pathLength=1;const i=r?Mo:Po;e[i.offset]=T.transform(-s);const o=T.transform(t),a=T.transform(n);e[i.array]=`${o} ${a}`}function Ss(e,{attrX:t,attrY:n,attrScale:s,pathLength:r,pathSpacing:i=1,pathOffset:o=0,...a},u,l,c){if(Ot(e,a,l),u){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??"50% 50%",delete d.transformOrigin),f.transform&&(f.transformBox=(c==null?void 0:c.transformBox)??"fill-box",delete d.transformBox),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),s!==void 0&&(d.scale=s),r!==void 0&&Ro(d,r,i,o,!1)}const Vs=()=>({...Et(),attrs:{}}),Cs=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Fo(e,t,n,s){const r=p.useMemo(()=>{const i=Vs();return Ss(i,t,Cs(s),e.transformTemplate,e.style),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};ws(i,e.style,e),r.style={...i,...r.style}}return r}const Do=["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 It(e){return typeof e!="string"||e.includes("-")?!1:!!(Do.indexOf(e)>-1||/[A-Z]/u.test(e))}function Oo(e=!1){return(n,s,r,{latestValues:i},o)=>{const u=(It(n)?Fo:Ao)(s,i,o,n),l=oo(s,typeof n=="string",e),c=n!==p.Fragment?{...l,...u,ref:r}:{},{children:d}=s,f=p.useMemo(()=>E(d)?d.get():d,[d]);return p.createElement(n,{...c,children:f})}}function dn(e){const t=[{},{}];return e==null||e.values.forEach((n,s)=>{t[0][s]=n.get(),t[1][s]=n.getVelocity()}),t}function kt(e,t,n,s){if(typeof t=="function"){const[r,i]=dn(s);t=t(n!==void 0?n:e.custom,r,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[r,i]=dn(s);t=t(n!==void 0?n:e.custom,r,i)}return t}function Eo(e){return E(e)?e.get():e}function Io({scrapeMotionValuesFromProps:e,createRenderState:t},n,s,r){return{latestValues:ko(n,s,r,e),renderState:t()}}const As=e=>(t,n)=>{const s=p.useContext(je),r=p.useContext(Sn),i=()=>Io(e,t,s,r);return n?i():Js(i)};function ko(e,t,n,s){const r={},i=s(e,{});for(const f in i)r[f]=Eo(i[f]);let{initial:o,animate:a}=e;const u=Le(e),l=ys(e);t&&l&&!u&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let c=n?n.initial===!1:!1;c=c||o===!1;const d=c?a:o;if(d&&typeof d!="boolean"&&!Be(d)){const f=Array.isArray(d)?d:[d];for(let h=0;h<f.length;h++){const g=kt(e,f[h]);if(g){const{transitionEnd:y,transition:v,...m}=g;for(const w in m){let x=m[w];if(Array.isArray(x)){const A=c?x.length-1:0;x=x[A]}x!==null&&(r[w]=x)}for(const w in y)r[w]=y[w]}}}return r}function jt(e,t,n){var i;const{style:s}=e,r={};for(const o in s)(E(s[o])||t.style&&E(t.style[o])||Ts(o,e)||((i=n==null?void 0:n.getValue(o))==null?void 0:i.liveStyle)!==void 0)&&(r[o]=s[o]);return r}const jo={useVisualState:As({scrapeMotionValuesFromProps:jt,createRenderState:Et})};function Ms(e,t,n){const s=jt(e,t,n);for(const r in e)if(E(e[r])||E(t[r])){const i=le.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;s[i]=e[r]}return s}const Bo={useVisualState:As({scrapeMotionValuesFromProps:Ms,createRenderState:Vs})};function Lo(e,t){return function(s,{forwardMotionProps:r}={forwardMotionProps:!1}){const o={...It(s)?Bo:jo,preloadedFeatures:e,useRender:Oo(r),createVisualElement:t,Component:s};return go(o)}}const Ps=Lo();function be(e,t,n){const s=e.getProps();return kt(s,t,n!==void 0?n:s.custom,e)}const at=e=>Array.isArray(e);function No(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,De(n))}function Ko(e){return at(e)?e[e.length-1]||0:e}function _o(e,t){const n=be(e,t);let{transitionEnd:s={},transition:r={},...i}=n||{};i={...i,...s};for(const o in i){const a=Ko(i[o]);No(e,o,a)}}function $o(e){return!!(E(e)&&e.add)}function Wo(e,t){const n=e.getValue("willChange");if($o(n))return n.add(t);if(!n&&_.WillChange){const s=new _.WillChange("auto");e.addValue("willChange",s),s.add(t)}}function Ho(e){return e.props[vs]}const qo=e=>e!==null;function Go(e,{repeat:t,repeatType:n="loop"},s){const r=e.filter(qo),i=t&&n!=="loop"&&t%2===1?0:r.length-1;return r[i]}const Uo={type:"spring",stiffness:500,damping:25,restSpeed:10},zo=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Yo={type:"keyframes",duration:.8},Xo={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Qo=(e,{keyframes:t})=>t.length>2?Yo:fe.has(e)?e.startsWith("scale")?zo(t[1]):Uo:Xo;function Zo({when:e,delay:t,delayChildren:n,staggerChildren:s,staggerDirection:r,repeat:i,repeatType:o,repeatDelay:a,from:u,elapsed:l,...c}){return!!Object.keys(c).length}const Jo=(e,t,n,s={},r,i)=>o=>{const a=os(s,e)||{},u=a.delay||s.delay||0;let{elapsed:l=0}=s;l=l-B(u);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-l,onUpdate:f=>{t.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:i?void 0:r};Zo(a)||Object.assign(c,Qo(e,c)),c.duration&&(c.duration=B(c.duration)),c.repeatDelay&&(c.repeatDelay=B(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let d=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(c.duration=0,c.delay===0&&(d=!0)),(_.instantAnimations||_.skipAnimations)&&(d=!0,c.duration=0,c.delay=0),c.allowFlatten=!a.type&&!a.ease,d&&!i&&t.get()!==void 0){const f=Go(c.keyframes,a);if(f!==void 0){j.update(()=>{c.onUpdate(f),c.onComplete()});return}}return a.isSync?new Ct(c):new Ri(c)};function ea({protectedKeys:e,needsAnimating:t},n){const s=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,s}function Rs(e,t,{delay:n=0,transitionOverride:s,type:r}={}){let{transition:i=e.getDefaultTransition(),transitionEnd:o,...a}=t;s&&(i=s);const u=[],l=r&&e.animationState&&e.animationState.getState()[r];for(const c in a){const d=e.getValue(c,e.latestValues[c]??null),f=a[c];if(f===void 0||l&&ea(l,c))continue;const h={delay:n,...os(i||{},c)},g=d.get();if(g!==void 0&&!d.isAnimating&&!Array.isArray(f)&&f===g&&!h.velocity)continue;let y=!1;if(window.MotionHandoffAnimation){const m=Ho(e);if(m){const w=window.MotionHandoffAnimation(m,c,j);w!==null&&(h.startTime=w,y=!0)}}Wo(e,c),d.start(Jo(c,d,f,e.shouldReduceMotion&&as.has(c)?{type:!1}:h,e,y));const v=d.animation;v&&u.push(v)}return o&&Promise.all(u).then(()=>{j.update(()=>{o&&_o(e,o)})}),u}function ct(e,t,n={}){var u;const s=be(e,t,n.type==="exit"?(u=e.presenceContext)==null?void 0:u.custom:void 0);let{transition:r=e.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(r=n.transitionOverride);const i=s?()=>Promise.all(Rs(e,s,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:c=0,staggerChildren:d,staggerDirection:f}=r;return ta(e,t,l,c,d,f,n)}:()=>Promise.resolve(),{when:a}=r;if(a){const[l,c]=a==="beforeChildren"?[i,o]:[o,i];return l().then(()=>c())}else return Promise.all([i(),o(n.delay)])}function ta(e,t,n=0,s=0,r=0,i=1,o){const a=[],u=e.variantChildren.size,l=(u-1)*r,c=typeof s=="function",d=c?f=>s(f,u):i===1?(f=0)=>f*r:(f=0)=>l-f*r;return Array.from(e.variantChildren).sort(na).forEach((f,h)=>{f.notify("AnimationStart",t),a.push(ct(f,t,{...o,delay:n+(c?0:s)+d(h)}).then(()=>f.notify("AnimationComplete",t)))}),Promise.all(a)}function na(e,t){return e.sortNodePosition(t)}function sa(e,t,n={}){e.notify("AnimationStart",t);let s;if(Array.isArray(t)){const r=t.map(i=>ct(e,i,n));s=Promise.all(r)}else if(typeof t=="string")s=ct(e,t,n);else{const r=typeof t=="function"?be(e,t,n.custom):t;s=Promise.all(Rs(e,r,n))}return s.then(()=>{e.notify("AnimationComplete",t)})}function Fs(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let s=0;s<n;s++)if(t[s]!==e[s])return!1;return!0}const ra=Ft.length;function Ds(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Ds(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<ra;n++){const s=Ft[n],r=e.props[s];(ye(r)||r===!1)&&(t[s]=r)}return t}const ia=[...Rt].reverse(),oa=Rt.length;function aa(e){return t=>Promise.all(t.map(({animation:n,options:s})=>sa(e,n,s)))}function ca(e){let t=aa(e),n=hn(),s=!0;const r=u=>(l,c)=>{var f;const d=be(e,c,u==="exit"?(f=e.presenceContext)==null?void 0:f.custom:void 0);if(d){const{transition:h,transitionEnd:g,...y}=d;l={...l,...y,...g}}return l};function i(u){t=u(e)}function o(u){const{props:l}=e,c=Ds(e.parent)||{},d=[],f=new Set;let h={},g=1/0;for(let v=0;v<oa;v++){const m=ia[v],w=n[m],x=l[m]!==void 0?l[m]:c[m],A=ye(x),S=m===u?w.isActive:null;S===!1&&(g=v);let C=x===c[m]&&x!==l[m]&&A;if(C&&s&&e.manuallyAnimateOnMount&&(C=!1),w.protectedKeys={...h},!w.isActive&&S===null||!x&&!w.prevProp||Be(x)||typeof x=="boolean")continue;const M=ua(w.prevProp,x);let V=M||m===u&&w.isActive&&!C&&A||v>g&&A,F=!1;const I=Array.isArray(x)?x:[x];let te=I.reduce(r(m),{});S===!1&&(te={});const{prevResolvedValues:Nt={}}=w,$s={...Nt,...te},Kt=O=>{V=!0,f.has(O)&&(F=!0,f.delete(O)),w.needsAnimating[O]=!0;const L=e.getValue(O);L&&(L.liveStyle=!1)};for(const O in $s){const L=te[O],Ne=Nt[O];if(h.hasOwnProperty(O))continue;let Ke=!1;at(L)&&at(Ne)?Ke=!Fs(L,Ne):Ke=L!==Ne,Ke?L!=null?Kt(O):f.add(O):L!==void 0&&f.has(O)?Kt(O):w.protectedKeys[O]=!0}w.prevProp=x,w.prevResolvedValues=te,w.isActive&&(h={...h,...te}),s&&e.blockInitialAnimation&&(V=!1),V&&(!(C&&M)||F)&&d.push(...I.map(O=>({animation:O,options:{type:m}})))}if(f.size){const v={};if(typeof l.initial!="boolean"){const m=be(e,Array.isArray(l.initial)?l.initial[0]:l.initial);m&&m.transition&&(v.transition=m.transition)}f.forEach(m=>{const w=e.getBaseTarget(m),x=e.getValue(m);x&&(x.liveStyle=!0),v[m]=w??null}),d.push({animation:v})}let y=!!d.length;return s&&(l.initial===!1||l.initial===l.animate)&&!e.manuallyAnimateOnMount&&(y=!1),s=!1,y?t(d):Promise.resolve()}function a(u,l){var d;if(n[u].isActive===l)return Promise.resolve();(d=e.variantChildren)==null||d.forEach(f=>{var h;return(h=f.animationState)==null?void 0:h.setActive(u,l)}),n[u].isActive=l;const c=o(u);for(const f in n)n[f].protectedKeys={};return c}return{animateChanges:o,setActive:a,setAnimateFunction:i,getState:()=>n,reset:()=>{n=hn(),s=!0}}}function ua(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Fs(t,e):!1}function G(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function hn(){return{animate:G(!0),whileInView:G(),whileHover:G(),whileTap:G(),whileDrag:G(),whileFocus:G(),exit:G()}}class de{constructor(t){this.isMounted=!1,this.node=t}update(){}}class la extends de{constructor(t){super(t),t.animationState||(t.animationState=ca(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Be(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let fa=0;class da extends de{constructor(){super(...arguments),this.id=fa++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===s)return;const r=this.node.animationState.setActive("exit",!t);n&&!t&&r.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const ha={animation:{Feature:la},exit:{Feature:da}};function pn(e,t,n,s={passive:!0}){return e.addEventListener(t,n,s),()=>e.removeEventListener(t,n)}function Os(e){return{point:{x:e.pageX,y:e.pageY}}}function pa({top:e,left:t,right:n,bottom:s}){return{x:{min:t,max:n},y:{min:e,max:s}}}function ma(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),s=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}const mn=()=>({min:0,max:0}),Es=()=>({x:mn(),y:mn()});function ga(e,t){return pa(ma(e.getBoundingClientRect(),t))}function gn(e,t,n){const{props:s}=e;e.animationState&&s.whileHover&&e.animationState.setActive("whileHover",n==="Start");const r="onHover"+n,i=s[r];i&&j.postRender(()=>i(t,Os(t)))}class ya extends de{mount(){const{current:t}=this.node;t&&(this.unmount=Yi(t,(n,s)=>(gn(this.node,s,"Start"),r=>gn(this.node,r,"End"))))}unmount(){}}class ba extends de{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!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=Ie(pn(this.node.current,"focus",()=>this.onFocus()),pn(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function yn(e,t,n){const{props:s}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&s.whileTap&&e.animationState.setActive("whileTap",n==="Start");const r="onTap"+(n==="End"?"":n),i=s[r];i&&j.postRender(()=>i(t,Os(t)))}class va extends de{mount(){const{current:t}=this.node;t&&(this.unmount=eo(t,(n,s)=>(yn(this.node,s,"Start"),(r,{success:i})=>yn(this.node,r,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const ut=new WeakMap,Ue=new WeakMap,xa=e=>{const t=ut.get(e.target);t&&t(e)},Ta=e=>{e.forEach(xa)};function wa({root:e,...t}){const n=e||document;Ue.has(n)||Ue.set(n,{});const s=Ue.get(n),r=JSON.stringify(t);return s[r]||(s[r]=new IntersectionObserver(Ta,{root:e,...t})),s[r]}function Sa(e,t,n){const s=wa(t);return ut.set(e,n),s.observe(e),()=>{ut.delete(e),s.unobserve(e)}}const Va={some:0,all:1};class Ca extends de{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:s,amount:r="some",once:i}=t,o={root:n?n.current:void 0,rootMargin:s,threshold:typeof r=="number"?r:Va[r]},a=u=>{const{isIntersecting:l}=u;if(this.isInView===l||(this.isInView=l,i&&!l&&this.hasEnteredView))return;l&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",l);const{onViewportEnter:c,onViewportLeave:d}=this.node.getProps(),f=l?c:d;f&&f(u)};return Sa(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Aa(t,n))&&this.startObserver()}unmount(){}}function Aa({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Ma={inView:{Feature:Ca},tap:{Feature:va},focus:{Feature:ba},hover:{Feature:ya}},lt={current:null},Is={current:!1};function Pa(){if(Is.current=!0,!!pt)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>lt.current=e.matches;e.addEventListener("change",t),t()}else lt.current=!1}const Ra=new WeakMap;function Fa(e,t,n){for(const s in t){const r=t[s],i=n[s];if(E(r))e.addValue(s,r);else if(E(i))e.addValue(s,De(r,{owner:e}));else if(i!==r)if(e.hasValue(s)){const o=e.getValue(s);o.liveStyle===!0?o.jump(r):o.hasAnimated||o.set(r)}else{const o=e.getStaticValue(s);e.addValue(s,De(o!==void 0?o:r,{owner:e}))}}for(const s in n)t[s]===void 0&&e.removeValue(s);return t}const bn=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Da{scrapeMotionValuesFromProps(t,n,s){return{}}constructor({parent:t,props:n,presenceContext:s,reducedMotionConfig:r,blockInitialAnimation:i,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=At,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 f=k.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,j.render(this.render,!1,!0))};const{latestValues:u,renderState:l}=o;this.latestValues=u,this.baseTarget={...u},this.initialValues=n.initial?{...u}:{},this.renderState=l,this.parent=t,this.props=n,this.presenceContext=s,this.depth=t?t.depth+1:0,this.reducedMotionConfig=r,this.options=a,this.blockInitialAnimation=!!i,this.isControllingVariants=Le(n),this.isVariantNode=ys(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:c,...d}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in d){const h=d[f];u[f]!==void 0&&E(h)&&h.set(u[f],!1)}}mount(t){this.current=t,Ra.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,s)=>this.bindToMotionValue(s,n)),Is.current||Pa(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:lt.current,process.env.NODE_ENV!=="production"&&Rn(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),ze(this.notifyUpdate),ze(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const s=fe.has(t);s&&this.onBindTransform&&this.onBindTransform();const r=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&j.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0)}),i=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{r(),i(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in ie){const n=ie[t];if(!n)continue;const{isEnabled:s,Feature:r}=n;if(!this.features[t]&&r&&s(this.props)&&(this.features[t]=new r(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Es()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<bn.length;s++){const r=bn[s];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const i="on"+r,o=t[i];o&&(this.propEventSubscriptions[r]=this.on(r,o))}this.prevMotionValues=Fa(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]: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(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const s=this.values.get(t);n!==s&&(s&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let s=this.values.get(t);return s===void 0&&n!==void 0&&(s=De(n===null?void 0:n,{owner:this}),this.addValue(t,s)),s}readValue(t,n){let s=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return s!=null&&(typeof s=="string"&&(Vn(s)||Cn(s))?s=parseFloat(s):!no(s)&&ue.test(n)&&(s=fs(t,n)),this.setBaseTarget(t,E(s)?s.get():s)),E(s)?s.get():s}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var i;const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const o=kt(this.props,n,(i=this.presenceContext)==null?void 0:i.custom);o&&(s=o[t])}if(n&&s!==void 0)return s;const r=this.getBaseTargetFromProps(this.props,t);return r!==void 0&&!E(r)?r:this.initialValues[t]!==void 0&&s===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Mn),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class ks extends Da{constructor(){super(...arguments),this.KeyframeResolver=$i}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:s}){delete n[t],delete s[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;E(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function js(e,{style:t,vars:n},s,r){const i=e.style;let o;for(o in t)i[o]=t[o];r==null||r.applyProjectionStyles(i,s);for(o in n)i.setProperty(o,n[o])}function Oa(e){return window.getComputedStyle(e)}class Ea extends ks{constructor(){super(...arguments),this.type="html",this.renderInstance=js}readValueFromInstance(t,n){var s;if(fe.has(n))return(s=this.projection)!=null&&s.isProjecting?tt(n):oi(t,n);{const r=Oa(t),i=(_n(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return ga(t,n)}build(t,n,s){Ot(t,n,s.transformTemplate)}scrapeMotionValuesFromProps(t,n,s){return jt(t,n,s)}}const Bs=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 Ia(e,t,n,s){js(e,t,void 0,s);for(const r in t.attrs)e.setAttribute(Bs.has(r)?r:Dt(r),t.attrs[r])}class ka extends ks{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Es}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(fe.has(n)){const s=ls(n);return s&&s.default||0}return n=Bs.has(n)?n:Dt(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,s){return Ms(t,n,s)}build(t,n,s){Ss(t,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(t,n,s,r){Ia(t,n,s,r)}mount(t){this.isSVGTag=Cs(t.tagName),super.mount(t)}}const ja=(e,t)=>It(e)?new ka(t):new Ea(t,{allowProjection:e!==p.Fragment}),Ba={renderer:ja,...ha,...Ma},La={0:"5",1:"6",2:"8",3:"10"},K=e=>Array.isArray(e),ee=e=>typeof e=="object"&&!Array.isArray(e)||typeof e=="string"||!e,Na=e=>{const t=(r,i=[])=>(p.Children.toArray(r).forEach(a=>{p.isValidElement(a)&&(a.props.value?i.push(a):a.props.children&&t(a.props.children,i))}),i);return t(e).map(r=>{var o;const i=r;return{value:i.props.value,label:((o=i.props)==null?void 0:o.label)||i.props.children||i.props.value}})},q=(e,t)=>{if(e)return t===!0?e==null?void 0:e.value:e},ft=(e,t,n)=>{if(!e||!t||t.length===0)return;const s=t.find(r=>r.value===q(e,n));if(s)return s},Ka=({children:e,value:t,searchQuery:n})=>{const s=Ls(e);return(t==null?void 0:t.toLowerCase().includes(n.toLowerCase()))||s.some(r=>r.toLowerCase().includes(n.toLowerCase()))},Ls=e=>{const t=p.Children.toArray(e),n=[];return t.forEach(s=>{typeof s=="string"&&n.push(s),p.isValidElement(s)&&s.props.children&&n.push(...Ls(s.props.children))}),n},_a=Ps("div"),Bt=Ps("span"),$a=({icon:e=Q.ChevronsUpDown,"aria-hidden":t=!0,...n})=>{const s=p.useContext(D);return b.jsx(oe.Button.Icon,{as:Bt,animate:{rotate:s.open?180:0},transition:{duration:.15,type:"spring",bounce:0},icon:e,"aria-hidden":t,...n})},Wa=({tooltipProps:e,...t})=>{const n=p.useContext(D),s=()=>{var i,o;if(K(n.value)){const a=n.onValueChange;a==null||a([])}if(ee(n.value)){const a=n.onValueChange;a==null||a(void 0)}(o=(i=n.triggerRef)==null?void 0:i.current)==null||o.focus()};return p.useMemo(()=>{var i;if(ee(n.value))return n.clearable&&n.value;if(K(n.value))return n.clearable&&((i=n.value)==null?void 0:i.length)>0},[n.clearable,n.value])?b.jsx(Ys.Tooltip,{label:"Clear field",...e,children:b.jsx(oe.Button,{type:"button",icon:{icon:Q.X,alt:"Clear field"},size:"0",variant:"ghost",onClick:i=>{n.value&&(i.stopPropagation(),s())},onKeyDown:i=>{(i.key==="Enter"||i.key===" ")&&(i.stopPropagation(),s())},"data-tgph-combobox-clear":!0,style:{marginTop:"calc(-1 * var(--tgph-spacing-1)",marginBottom:"calc(-1 * var(--tgph-spacing-1)"},...t})}):null},Ha=({children:e,...t})=>{const n=p.useContext(D),s=p.useMemo(()=>{var a;if(!ee(n.value))return;const r=ft(n.value,n.options,n.legacyBehavior),i=(r==null?void 0:r.label)||(r==null?void 0:r.value)||n.placeholder,o=n.legacyBehavior&&((a=n==null?void 0:n.value)==null?void 0:a.label);return o||i},[n.value,n.options,n.legacyBehavior,n.placeholder]);return b.jsx(Tn.TooltipIfTruncated,{children:b.jsx(oe.Button.Text,{color:n.value?"default":"gray",textOverflow:"ellipsis",overflow:"hidden",...t,children:e||s})})},qa=({children:e,...t})=>{const n=p.useContext(D);return b.jsx(Tn.TooltipIfTruncated,{children:b.jsx(oe.Button.Text,{color:"gray",textOverflow:"ellipsis",overflow:"hidden",...t,children:e||n.placeholder})})},Ga=({children:e})=>{const t=p.useContext(D);if(!K(t.value))return null;const n=t.layout||"truncate",r=(t.value.length-2).toString().split("");return b.jsxs(H.Stack,{gap:"0_5",w:"full",wrap:n==="wrap"?"wrap":"nowrap",align:"center",style:{position:"relative",flexGrow:1},children:[e,n==="truncate"&&t.value.length>2&&b.jsx(H.Stack,{as:_a,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1,type:"spring",bounce:0},h:"full",pr:"1",pl:"8",align:"center","aria-label":`${t.value.length-2} more selected`,position:"absolute",right:"0",style:{backgroundImage:"linear-gradient(to left, var(--tgph-surface-1) 0 60%, transparent 90% 100%)"},children:b.jsxs(dt.Text,{as:"span",size:"1",style:{whiteSpace:"nowrap"},children:["+",r.map(i=>b.jsx(H.Box,{as:Bt,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1,type:"spring",bounce:0},w:"2",display:"inline-block",children:i},i))," ","more"]})})]})},Lt=p.createContext({value:""}),Ua=({value:e,children:t,...n})=>b.jsx(Lt.Provider,{value:{value:e},children:b.jsx(ht.Tag.Root,{as:Bt,initial:{opacity:0,scale:.5},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.5},transition:{duration:.1,type:"spring",bounce:0},size:"1",maxH:"5",rounded:"1",layout:"position",...n,children:t})}),za=({children:e,...t})=>{const n=p.useContext(D),s=p.useContext(Lt),r=p.useMemo(()=>{const i=n.options.find(u=>u.value===s.value);if(i)return i.label||i.value;if(!n.value)return;const a=n.value.find(u=>q(u,n.legacyBehavior)===s.value);if(a)return a},[n.options,n.value,s.value,n.legacyBehavior]);return b.jsx(ht.Tag.Text,{...t,children:e||r})},Ya=({children:e,...t})=>{const n=p.useContext(D),s=p.useContext(Lt);return b.jsx(ht.Tag.Button,{icon:{icon:Q.X,alt:`Remove ${s.value}`},height:"full",onClick:r=>{if(!n.onValueChange)return;const i=n.onValueChange,a=n.value.filter(u=>q(u,n.legacyBehavior)!==s.value);i==null||i(a),r.stopPropagation(),r.preventDefault()},...t,children:e})},Xa=({value:e,children:t,...n})=>b.jsxs(Ae.Root,{value:e,...n,children:[b.jsx(Ae.Text,{children:t}),b.jsx(Ae.Button,{})]}),Ae={Root:Ua,Text:za,Button:Ya,Default:Xa},W={TriggerIndicator:$a,TriggerClear:Wa,TriggerText:Ha,TriggerPlaceholder:qa,TriggerTagsContainer:Ga,TriggerTag:Ae},Qa=["ArrowDown","PageUp","Home"],Za=["ArrowUp","PageDown","End"],Ns=["Enter"," "],D=p.createContext({value:void 0,onValueChange:()=>{},contentId:"",triggerId:"",open:!1,setOpen:()=>{},onOpenToggle:()=>{},clearable:!1,disabled:!1,options:[],legacyBehavior:!1}),Ja=({modal:e=!0,closeOnSelect:t=!0,clearable:n=!1,disabled:s=!1,legacyBehavior:r=!1,open:i,onOpenChange:o,defaultOpen:a,value:u,onValueChange:l,errored:c,placeholder:d,layout:f,children:h,...g})=>{const y=p.useId(),v=p.useId(),m=p.useRef(null),w=p.useRef(null),x=p.useRef(null),A=p.useMemo(()=>Na(h),[h]),[S,C]=p.useState(""),[M=!1,V]=qs.useControllableState({prop:i,defaultProp:a??!1,onChange:o}),F=p.useCallback(()=>{V(I=>!I)},[V]);return p.useEffect(()=>{M||C("")},[M]),b.jsx(D.Provider,{value:{contentId:y,triggerId:v,value:u,onValueChange:l,placeholder:d,open:M,setOpen:V,onOpenToggle:F,closeOnSelect:t,clearable:n,disabled:s,searchQuery:S,setSearchQuery:C,triggerRef:m,searchRef:w,contentRef:x,errored:c,layout:f,options:A,legacyBehavior:r},children:b.jsx(Ee.Menu.Root,{open:M,onOpenChange:V,modal:e,...g,children:h})})},ec=()=>{const e=p.useContext(D);if(e.value&&K(e.value)){const t=e.layout||"truncate";return e.value.length===0?b.jsx(W.TriggerPlaceholder,{}):b.jsx(so,{features:Ba,children:b.jsx(W.TriggerTagsContainer,{children:e.value.map((n,s)=>{const r=q(n,e.legacyBehavior);if(r&&(t==="truncate"&&s<=1||t==="wrap"))return b.jsx(Us.RefToTgphRef,{children:b.jsx(W.TriggerTag.Default,{value:r})},r)})})})}if(e&&ee(e.value))return e.value?b.jsx(W.TriggerText,{}):b.jsx(W.TriggerPlaceholder,{})},tc=({size:e="1",children:t,...n})=>{const s=p.useContext(D),r=K(s.value)&&s.value.length>0,i=p.useMemo(()=>{if(s.value){if(ee(s.value))return ft(s.value,s.options,s.legacyBehavior);if(K(s.value))return s.value.map(a=>ft(a,s.options,s.legacyBehavior))}},[s.value,s.options,s.legacyBehavior]),o=p.useCallback(()=>i?ee(i)?(i==null?void 0:i.label)||(i==null?void 0:i.value)||s.placeholder:K(i)&&i.map(a=>(a==null?void 0:a.label)||(a==null?void 0:a.value)).join(", ")||s.placeholder:s.placeholder,[i,s.placeholder]);return b.jsx(Ee.Menu.Trigger,{...n,asChild:!0,onClick:a=>{var u,l;a.preventDefault(),s.onOpenToggle(),(l=(u=s.triggerRef)==null?void 0:u.current)==null||l.focus()},onKeyDown:a=>{if(a.key==="Tab"){a.stopPropagation();return}if(Ns.includes(a.key)){a.preventDefault();return}if(a.key==="ArrowDown"){a.stopPropagation(),a.preventDefault(),s.onOpenToggle();return}},tgphRef:s.triggerRef,children:b.jsxs(oe.Button.Root,{id:s.triggerId,type:"button",bg:"surface-1",variant:"outline",align:"center",minH:La[e],h:"full",w:"full",py:"0_5",pr:"1_5",pl:r?"0_5":"1_5",size:e,color:s.errored?"red":"gray",justify:"space-between",role:"combobox","aria-label":o(),"aria-controls":s.contentId,"aria-expanded":s.open,"aria-haspopup":"listbox","data-tgph-combobox-trigger":!0,"data-tgph-combobox-trigger-open":s.open,disabled:s.disabled,...n,children:[t?typeof t=="function"?t({value:i}):t:b.jsx(ec,{}),b.jsxs(H.Stack,{align:"center",gap:"1",children:[b.jsx(W.TriggerClear,{}),b.jsx(W.TriggerIndicator,{})]})]})})},nc=({style:e,children:t,tgphRef:n,...s})=>{const r=p.useContext(D),i=p.useRef(!1),o=vn.useComposedRefs(n,r.contentRef),a=p.useRef(null),[u,l]=p.useState(0),[c,d]=p.useState(!1),f=p.useCallback(h=>{const g=h==null?void 0:h.getBoundingClientRect();g&&l(g.height),c||d(!0)},[c]);return p.useEffect(()=>{const h=new ResizeObserver(g=>{for(const y of g){const v=y.target;f(v)}});return a.current&&c&&h.observe(a.current),()=>h.disconnect()},[c,f]),p.useEffect(()=>{c===!0&&r.open===!1&&d(!1)},[r.open,c]),p.useEffect(()=>{let h;return r.open&&(h=setTimeout(()=>{f(a.current)},10)),()=>h&&clearTimeout(h)},[r.open,f]),b.jsx(Xs.Root,{asChild:!0,children:b.jsx(Ws.DismissableLayer,{onEscapeKeyDown:h=>{r.open&&(h.stopPropagation(),h.preventDefault(),r.setOpen(!1))},children:b.jsx(Ee.Menu.Content,{className:"tgph",mt:"1",onCloseAutoFocus:h=>{var g,y;i.current||(y=(g=r.triggerRef)==null?void 0:g.current)==null||y.focus(),i.current=!1,h.preventDefault()},bg:"surface-1",style:{width:"var(--tgph-combobox-trigger-width)",transition:"min-height 200ms ease-in-out",minHeight:u?`${u}px`:"0",...e,"--tgph-combobox-content-transform-origin":"var(--radix-popper-transform-origin)","--tgph-combobox-content-available-width":"var(--radix-popper-available-width)","--tgph-combobox-content-available-height":"calc(var(--radix-popper-available-height) - var(--tgph-spacing-8))","--tgph-combobox-trigger-width":"var(--radix-popper-anchor-width)","--tgph-combobox-trigger-height":"var(--radix-popper-anchor-height)"},...s,tgphRef:o,"data-tgph-combobox-content":!0,"data-tgph-combobox-content-open":r.open,role:void 0,"aria-orientation":void 0,onKeyDown:h=>{var y,v,m,w;h.stopPropagation();const g=(v=(y=r.contentRef)==null?void 0:y.current)==null?void 0:v.querySelectorAll("[data-tgph-combobox-option]");document.activeElement===(g==null?void 0:g[0])&&Za.includes(h.key)&&((w=(m=r.searchRef)==null?void 0:m.current)==null||w.focus())},children:b.jsx(H.Stack,{direction:"column",gap:"1",tgphRef:a,children:t})})})})},sc=({...e})=>{const t=p.useContext(D);return b.jsx(H.Stack,{id:t.contentId,direction:"column",gap:"1",style:{overflowY:"auto","--max-height":e.maxHeight?void 0:"calc(var(--tgph-combobox-content-available-height) - var(--tgph-spacing-12))"},role:"listbox",...e})},Ks=({value:e,label:t,selected:n,onSelect:s,children:r,...i})=>{const o=p.useContext(D),[a,u]=p.useState(!1),l=o.value,c=!o.searchQuery||Ka({children:t||r,value:e,searchQuery:o.searchQuery}),d=K(l)?l.some(h=>q(h,o.legacyBehavior)===e):q(l,o.legacyBehavior)===e,f=h=>{var y,v;h.stopPropagation();const g=h;if(!(g.key&&!Ns.includes(g.key))){if(h.preventDefault(),o.closeOnSelect===!0&&o.setOpen(!1),s)return s(h);if(ee(l)){const m=o.onValueChange;o.legacyBehavior===!0?m==null||m({value:e,label:t}):m==null||m(e)}else if(K(l)){const m=o.onValueChange,w=o.value,x=d?w.filter(A=>q(A,o.legacyBehavior)!==e):[...w,o.legacyBehavior===!0?{value:e,label:t}:e];m==null||m(x)}(v=(y=o.triggerRef)==null?void 0:y.current)==null||v.focus()}};if(c)return b.jsx(Ee.Menu.Button,{type:"button",onSelect:f,onKeyDown:f,selected:n===null?null:n??d,onFocus:()=>u(!0),onBlur:()=>u(!1),role:"option","aria-selected":d?"true":"false","data-tgph-combobox-option":!0,"data-tgph-combobox-option-focused":a,"data-tgph-combobox-option-value":e,"data-tgph-combobox-option-label":t,...i,children:t||r||e})},rc=({label:e="Search",placeholder:t="Search",tgphRef:n,value:s,onValueChange:r,...i})=>{var d;const o=p.useId(),a=p.useContext(D),u=vn.useComposedRefs(n,a.searchRef),l=s??a.searchQuery,c=r??a.setSearchQuery;return p.useEffect(()=>{var g;const f=y=>{var v,m;Qa.includes(y.key)&&((m=(v=a.contentRef)==null?void 0:v.current)==null||m.focus({preventScroll:!0})),y.key==="Escape"&&a.setOpen(!1),y.stopPropagation()},h=(g=a.searchRef)==null?void 0:g.current;if(h)return h.addEventListener("keydown",f),()=>{h.removeEventListener("keydown",f)}},[a]),b.jsxs(H.Box,{borderBottom:"px",px:"1",pb:"1",children:[b.jsx(Qs.Root,{children:b.jsx(dt.Text,{as:"label",htmlFor:o,children:e})}),b.jsx(zs.Input,{id:o,variant:"ghost",placeholder:t,value:l,onChange:f=>{c(f.target.value)},LeadingComponent:b.jsx(xn.Icon,{icon:Q.Search,alt:"Search Icon"}),TrailingComponent:a!=null&&a.searchQuery&&((d=a==null?void 0:a.searchQuery)==null?void 0:d.length)>0?b.jsx(oe.Button,{variant:"ghost",color:"gray",icon:{icon:Q.X,alt:"Clear Search Query"},onClick:()=>{var f;return(f=a.setSearchQuery)==null?void 0:f.call(a,"")}}):null,autoFocus:!0,"data-tgph-combobox-search":!0,"aria-controls":a.contentId,...i,tgphRef:u})]})},ic=({icon:e={icon:Q.Search,alt:"Search Icon"},message:t="No results found",children:n,...s})=>{const r=p.useContext(D),[i,o]=p.useState(!1);if(p.useEffect(()=>{var u,l;const a=(l=(u=r.contentRef)==null?void 0:u.current)==null?void 0:l.querySelectorAll("[data-tgph-combobox-option]");(a==null?void 0:a.length)===0?o(!0):o(!1)},[r.searchQuery,r.contentRef,n]),i)return b.jsxs(H.Stack,{gap:"1",align:"center",justify:"center",w:"full",my:"8","data-tgph-combobox-empty":!0,...s,children:[e===null?b.jsx(b.Fragment,{}):b.jsx(xn.Icon,{...e}),t===null?b.jsx(b.Fragment,{}):b.jsx(dt.Text,{as:"span",children:t})]})},oc=({leadingText:e="Create",values:t,onCreate:n,selected:s=null,legacyBehavior:r=!1,...i})=>{const o=p.useContext(D),a=p.useCallback(u=>!t||(t==null?void 0:t.length)===0?!1:t.some(l=>q(l,r)===u),[t,r]);if(o.searchQuery&&!a(o.searchQuery))return b.jsx(Ks,{leadingIcon:{icon:Q.Plus,"aria-hidden":!0},mx:"1",value:o.searchQuery,label:`${e} "${o.searchQuery}"`,selected:s,onSelect:()=>{var u;if(n&&o.searchQuery){const l=r===!0?{value:o.searchQuery}:o.searchQuery;n(l),(u=o.setSearchQuery)==null||u.call(o,"")}},...i})},_s={};Object.assign(_s,{Root:Ja,Trigger:tc,Content:nc,Options:sc,Option:Ks,Search:rc,Empty:ic,Create:oc,Primitives:W});exports.Combobox=_s;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|