canny-ui-react 2.0.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Accordion/Accordion.d.ts +32 -0
- package/dist/components/Accordion/index.d.ts +2 -0
- package/dist/components/Autocomplete/Autocomplete.d.ts +19 -0
- package/dist/components/Autocomplete/Autocomplete.types.d.ts +71 -0
- package/dist/components/Autocomplete/index.d.ts +2 -0
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +14 -0
- package/dist/components/Breadcrumb/index.d.ts +2 -0
- package/dist/components/Chip/Chip.d.ts +37 -0
- package/dist/components/Chip/index.d.ts +2 -0
- package/dist/components/Dialog/Dialog.d.ts +34 -0
- package/dist/components/Dialog/index.d.ts +2 -0
- package/dist/components/Drawer/Drawer.d.ts +35 -0
- package/dist/components/Drawer/index.d.ts +2 -0
- package/dist/components/Layout/AspectRatio.d.ts +11 -0
- package/dist/components/Layout/Center.d.ts +7 -0
- package/dist/components/Layout/Grid.d.ts +7 -1
- package/dist/components/Layout/Group.d.ts +10 -0
- package/dist/components/Layout/index.d.ts +6 -0
- package/dist/components/List/List.d.ts +42 -0
- package/dist/components/List/index.d.ts +2 -0
- package/dist/components/Menu/Menu.d.ts +51 -0
- package/dist/components/Menu/index.d.ts +2 -0
- package/dist/components/Pagination/Pagination.d.ts +22 -0
- package/dist/components/Pagination/index.d.ts +2 -0
- package/dist/components/Popover/Popover.d.ts +24 -0
- package/dist/components/Popover/index.d.ts +2 -0
- package/dist/components/Slider/Slider.d.ts +15 -0
- package/dist/components/Slider/index.d.ts +2 -0
- package/dist/components/Stepper/Stepper.d.ts +16 -0
- package/dist/components/Stepper/index.d.ts +2 -0
- package/dist/components/Tabs/Tabs.d.ts +34 -0
- package/dist/components/Tabs/index.d.ts +2 -0
- package/dist/components/Tooltip/Tooltip.d.ts +46 -0
- package/dist/components/Tooltip/index.d.ts +2 -0
- package/dist/index.cjs +55 -40
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +14 -0
- package/dist/index.js +7421 -4713
- package/dist/index.js.map +1 -1
- package/package.json +20 -17
package/dist/index.cjs
CHANGED
|
@@ -1,137 +1,152 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("react/jsx-runtime"),b=require("react"),$r=require("react-dom");function ol(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const m=ol(b),Wr=ol($r);function $(...e){return e.filter(Boolean).join(" ")}const zs=b.createContext({});function Ys(e){const t=b.useRef(null);return t.current===null&&(t.current=e()),t.current}const ip=typeof window<"u",sl=ip?b.useLayoutEffect:b.useEffect,Ur=b.createContext(null);function Xs(e,t){e.indexOf(t)===-1&&e.push(t)}function Cr(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const rt=(e,t,n)=>n>t?t:n<e?e:n;function as(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let dn=()=>{},st=()=>{};var rl;typeof process<"u"&&((rl=process.env)==null?void 0:rl.NODE_ENV)!=="production"&&(dn=(e,t,n)=>{!e&&typeof console<"u"&&console.warn(as(t,n))},st=(e,t,n)=>{if(!e)throw new Error(as(t,n))});const gt={},il=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function al(e){return typeof e=="object"&&e!==null}const cl=e=>/^0[^.\s]+$/u.test(e);function ll(e){let t;return()=>(t===void 0&&(t=e()),t)}const _e=e=>e,ap=(e,t)=>n=>t(e(n)),Nn=(...e)=>e.reduce(ap),En=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class qs{constructor(){this.subscriptions=[]}add(t){return Xs(this.subscriptions,t),()=>Cr(this.subscriptions,t)}notify(t,n,r){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,n,r);else for(let s=0;s<o;s++){const i=this.subscriptions[s];i&&i(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const De=e=>e*1e3,Fe=e=>e/1e3;function ul(e,t){return t?e*(1e3/t):0}const ta=new Set;function Zs(e,t,n){e||ta.has(t)||(console.warn(as(t,n)),ta.add(t))}const dl=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,cp=1e-7,lp=12;function up(e,t,n,r,o){let s,i,a=0;do i=t+(n-t)/2,s=dl(i,r,o)-e,s>0?n=i:t=i;while(Math.abs(s)>cp&&++a<lp);return i}function In(e,t,n,r){if(e===t&&n===r)return _e;const o=s=>up(s,0,1,e,n);return s=>s===0||s===1?s:dl(o(s),t,r)}const fl=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,hl=e=>t=>1-e(1-t),pl=In(.33,1.53,.69,.99),Qs=hl(pl),ml=fl(Qs),gl=e=>e>=1?1:(e*=2)<1?.5*Qs(e):.5*(2-Math.pow(2,-10*(e-1))),Js=e=>1-Math.sin(Math.acos(e)),yl=hl(Js),vl=fl(Js),dp=In(.42,0,1,1),fp=In(0,0,.58,1),xl=In(.42,0,.58,1),hp=e=>Array.isArray(e)&&typeof e[0]!="number",wl=e=>Array.isArray(e)&&typeof e[0]=="number",na={linear:_e,easeIn:dp,easeInOut:xl,easeOut:fp,circIn:Js,circInOut:vl,circOut:yl,backIn:Qs,backInOut:ml,backOut:pl,anticipate:gl},pp=e=>typeof e=="string",ra=e=>{if(wl(e)){st(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,r,o]=e;return In(t,n,r,o)}else if(pp(e))return st(na[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),na[e];return e},Yn=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function mp(e,t){let n=new Set,r=new Set,o=!1,s=!1;const i=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function c(u){i.has(u)&&(l.schedule(u),e()),u(a)}const l={schedule:(u,d=!1,f=!1)=>{const x=f&&o?n:r;return d&&i.add(u),x.add(u),u},cancel:u=>{r.delete(u),i.delete(u)},process:u=>{if(a=u,o){s=!0;return}o=!0;const d=n;n=r,r=d,n.forEach(c),n.clear(),o=!1,s&&(s=!1,l.process(u))}};return l}const gp=40;function bl(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,i=Yn.reduce((S,C)=>(S[C]=mp(s),S),{}),{setup:a,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:x}=i,g=()=>{const S=gt.useManualTiming,C=S?o.timestamp:performance.now();n=!1,S||(o.delta=r?1e3/60:Math.max(Math.min(C-o.timestamp,gp),1)),o.timestamp=C,o.isProcessing=!0,a.process(o),c.process(o),l.process(o),u.process(o),d.process(o),f.process(o),p.process(o),x.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(g))},y=()=>{n=!0,r=!0,o.isProcessing||e(g)};return{schedule:Yn.reduce((S,C)=>{const T=i[C];return S[C]=(E,P=!1,A=!1)=>(n||y(),T.schedule(E,P,A)),S},{}),cancel:S=>{for(let C=0;C<Yn.length;C++)i[Yn[C]].cancel(S)},state:o,steps:i}}const{schedule:le,cancel:yt,state:xe,steps:Po}=bl(typeof requestAnimationFrame<"u"?requestAnimationFrame:_e,!0);let dr;function yp(){dr=void 0}const Ee={now:()=>(dr===void 0&&Ee.set(xe.isProcessing||gt.useManualTiming?xe.timestamp:performance.now()),dr),set:e=>{dr=e,queueMicrotask(yp)}},Sl=e=>t=>typeof t=="string"&&t.startsWith(e),Cl=Sl("--"),vp=Sl("var(--"),ei=e=>vp(e)?xp.test(e.split("/*")[0].trim()):!1,xp=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function oa(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const fn={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},An={...fn,transform:e=>rt(0,1,e)},Xn={...fn,default:1},Tn=e=>Math.round(e*1e5)/1e5,ti=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function wp(e){return e==null}const bp=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,ni=(e,t)=>n=>!!(typeof n=="string"&&bp.test(n)&&n.startsWith(e)||t&&!wp(n)&&Object.prototype.hasOwnProperty.call(n,t)),Tl=(e,t,n)=>r=>{if(typeof r!="string")return r;const[o,s,i,a]=r.match(ti);return{[e]:parseFloat(o),[t]:parseFloat(s),[n]:parseFloat(i),alpha:a!==void 0?parseFloat(a):1}},Sp=e=>rt(0,255,e),Ro={...fn,transform:e=>Math.round(Sp(e))},jt={test:ni("rgb","red"),parse:Tl("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Ro.transform(e)+", "+Ro.transform(t)+", "+Ro.transform(n)+", "+Tn(An.transform(r))+")"};function Cp(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}const cs={test:ni("#"),parse:Cp,transform:jt.transform},jn=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),dt=jn("deg"),tt=jn("%"),B=jn("px"),Tp=jn("vh"),Pp=jn("vw"),sa={...tt,parse:e=>tt.parse(e)/100,transform:e=>tt.transform(e*100)},Jt={test:ni("hsl","hue"),parse:Tl("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+tt.transform(Tn(t))+", "+tt.transform(Tn(n))+", "+Tn(An.transform(r))+")"},pe={test:e=>jt.test(e)||cs.test(e)||Jt.test(e),parse:e=>jt.test(e)?jt.parse(e):Jt.test(e)?Jt.parse(e):cs.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?jt.transform(e):Jt.transform(e),getAnimatableNone:e=>{const t=pe.parse(e);return t.alpha=0,pe.transform(t)}},Rp=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Ep(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(ti))==null?void 0:t.length)||0)+(((n=e.match(Rp))==null?void 0:n.length)||0)>0}const Pl="number",Rl="color",Ap="var",Dp="var(",ia="${}",Mp=/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 sn(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let s=0;const a=t.replace(Mp,c=>(pe.test(c)?(r.color.push(s),o.push(Rl),n.push(pe.parse(c))):c.startsWith(Dp)?(r.var.push(s),o.push(Ap),n.push(c)):(r.number.push(s),o.push(Pl),n.push(parseFloat(c))),++s,ia)).split(ia);return{values:n,split:a,indexes:r,types:o}}function kp(e){return sn(e).values}function El({split:e,types:t}){const n=e.length;return r=>{let o="";for(let s=0;s<n;s++)if(o+=e[s],r[s]!==void 0){const i=t[s];i===Pl?o+=Tn(r[s]):i===Rl?o+=pe.transform(r[s]):o+=r[s]}return o}}function Np(e){return El(sn(e))}const Ip=e=>typeof e=="number"?0:pe.test(e)?pe.getAnimatableNone(e):e,jp=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:Ip(e);function Op(e){const t=sn(e);return El(t)(t.values.map((r,o)=>jp(r,t.split[o])))}const Ue={test:Ep,parse:kp,createTransformer:Np,getAnimatableNone:Op};function Eo(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 Lp({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let o=0,s=0,i=0;if(!t)o=s=i=n;else{const a=n<.5?n*(1+t):n+t-n*t,c=2*n-a;o=Eo(c,a,e+1/3),s=Eo(c,a,e),i=Eo(c,a,e-1/3)}return{red:Math.round(o*255),green:Math.round(s*255),blue:Math.round(i*255),alpha:r}}function Tr(e,t){return n=>n>0?t:e}const ue=(e,t,n)=>e+(t-e)*n,Ao=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},Vp=[cs,jt,Jt],Fp=e=>Vp.find(t=>t.test(e));function aa(e){const t=Fp(e);if(dn(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let n=t.parse(e);return t===Jt&&(n=Lp(n)),n}const ca=(e,t)=>{const n=aa(e),r=aa(t);if(!n||!r)return Tr(e,t);const o={...n};return s=>(o.red=Ao(n.red,r.red,s),o.green=Ao(n.green,r.green,s),o.blue=Ao(n.blue,r.blue,s),o.alpha=ue(n.alpha,r.alpha,s),jt.transform(o))},ls=new Set(["none","hidden"]);function _p(e,t){return ls.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Bp(e,t){return n=>ue(e,t,n)}function ri(e){return typeof e=="number"?Bp:typeof e=="string"?ei(e)?Tr:pe.test(e)?ca:Up:Array.isArray(e)?Al:typeof e=="object"?pe.test(e)?ca:$p:Tr}function Al(e,t){const n=[...e],r=n.length,o=e.map((s,i)=>ri(s)(s,t[i]));return s=>{for(let i=0;i<r;i++)n[i]=o[i](s);return n}}function $p(e,t){const n={...e,...t},r={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(r[o]=ri(e[o])(e[o],t[o]));return o=>{for(const s in r)n[s]=r[s](o);return n}}function Wp(e,t){const n=[],r={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const s=t.types[o],i=e.indexes[s][r[s]],a=e.values[i]??0;n[o]=a,r[s]++}return n}const Up=(e,t)=>{const n=Ue.createTransformer(t),r=sn(e),o=sn(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?ls.has(e)&&!o.values.length||ls.has(t)&&!r.values.length?_p(e,t):Nn(Al(Wp(r,o),o.values),n):(dn(!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.`,"complex-values-different"),Tr(e,t))};function Dl(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?ue(e,t,n):ri(e)(e,t)}const Hp=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>le.update(t,n),stop:()=>yt(t),now:()=>xe.isProcessing?xe.timestamp:Ee.now()}},Ml=(e,t,n=10)=>{let r="";const o=Math.max(Math.round(t/n),2);for(let s=0;s<o;s++)r+=Math.round(e(s/(o-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},Pr=2e4;function oi(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Pr;)t+=n,r=e.next(t);return t>=Pr?1/0:t}function Gp(e,t=100,n){const r=n({...e,keyframes:[0,t]}),o=Math.min(oi(r),Pr);return{type:"keyframes",ease:s=>r.next(o*s).value/t,duration:Fe(o)}}const de={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};function us(e,t){return e*Math.sqrt(1-t*t)}const Kp=12;function zp(e,t,n){let r=n;for(let o=1;o<Kp;o++)r=r-e(r)/t(r);return r}const Do=.001;function Yp({duration:e=de.duration,bounce:t=de.bounce,velocity:n=de.velocity,mass:r=de.mass}){let o,s;dn(e<=De(de.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let i=1-t;i=rt(de.minDamping,de.maxDamping,i),e=rt(de.minDuration,de.maxDuration,Fe(e)),i<1?(o=l=>{const u=l*i,d=u*e,f=u-n,p=us(l,i),x=Math.exp(-d);return Do-f/p*x},s=l=>{const d=l*i*e,f=d*n+n,p=Math.pow(i,2)*Math.pow(l,2)*e,x=Math.exp(-d),g=us(Math.pow(l,2),i);return(-o(l)+Do>0?-1:1)*((f-p)*x)/g}):(o=l=>{const u=Math.exp(-l*e),d=(l-n)*e+1;return-Do+u*d},s=l=>{const u=Math.exp(-l*e),d=(n-l)*(e*e);return u*d});const a=5/e,c=zp(o,s,a);if(e=De(e),isNaN(c))return{stiffness:de.stiffness,damping:de.damping,duration:e};{const l=Math.pow(c,2)*r;return{stiffness:l,damping:i*2*Math.sqrt(r*l),duration:e}}}const Xp=["duration","bounce"],qp=["stiffness","damping","mass"];function la(e,t){return t.some(n=>e[n]!==void 0)}function Zp(e){let t={velocity:de.velocity,stiffness:de.stiffness,damping:de.damping,mass:de.mass,isResolvedFromDuration:!1,...e};if(!la(e,qp)&&la(e,Xp))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),o=r*r,s=2*rt(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:de.mass,stiffness:o,damping:s}}else{const n=Yp({...e,velocity:0});t={...t,...n,mass:de.mass},t.isResolvedFromDuration=!0}return t}function Rr(e=de.visualDuration,t=de.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:o}=n;const s=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:s},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=Zp({...n,velocity:-Fe(n.velocity||0)}),x=f||0,g=l/(2*Math.sqrt(c*u)),y=i-s,v=Fe(Math.sqrt(c/u)),w=Math.abs(y)<5;r||(r=w?de.restSpeed.granular:de.restSpeed.default),o||(o=w?de.restDelta.granular:de.restDelta.default);let S,C,T,E,P,A;if(g<1)T=us(v,g),E=(x+g*v*y)/T,S=k=>{const V=Math.exp(-g*v*k);return i-V*(E*Math.sin(T*k)+y*Math.cos(T*k))},P=g*v*E+y*T,A=g*v*y-E*T,C=k=>Math.exp(-g*v*k)*(P*Math.sin(T*k)+A*Math.cos(T*k));else if(g===1){S=V=>i-Math.exp(-v*V)*(y+(x+v*y)*V);const k=x+v*y;C=V=>Math.exp(-v*V)*(v*k*V-x)}else{const k=v*Math.sqrt(g*g-1);S=G=>{const K=Math.exp(-g*v*G),D=Math.min(k*G,300);return i-K*((x+g*v*y)*Math.sinh(D)+k*y*Math.cosh(D))/k};const V=(x+g*v*y)/k,H=g*v*V-y*k,Y=g*v*y-V*k;C=G=>{const K=Math.exp(-g*v*G),D=Math.min(k*G,300);return K*(H*Math.sinh(D)+Y*Math.cosh(D))}}const j={calculatedDuration:p&&d||null,velocity:k=>De(C(k)),next:k=>{if(!p&&g<1){const H=Math.exp(-g*v*k),Y=Math.sin(T*k),G=Math.cos(T*k),K=i-H*(E*Y+y*G),D=De(H*(P*Y+A*G));return a.done=Math.abs(D)<=r&&Math.abs(i-K)<=o,a.value=a.done?i:K,a}const V=S(k);if(p)a.done=k>=d;else{const H=De(C(k));a.done=Math.abs(H)<=r&&Math.abs(i-V)<=o}return a.value=a.done?i:V,a},toString:()=>{const k=Math.min(oi(j),Pr),V=Ml(H=>j.next(k*H).value,k,30);return k+"ms "+V},toTransition:()=>{}};return j}Rr.applyToOptions=e=>{const t=Gp(e,100,Rr);return e.ease=t.ease,e.duration=De(t.duration),e.type="keyframes",e};const Qp=5;function kl(e,t,n){const r=Math.max(t-Qp,0);return ul(n-e(r),t-r)}function ds({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:s=500,modifyTarget:i,min:a,max:c,restDelta:l=.5,restSpeed:u}){const d=e[0],f={done:!1,value:d},p=A=>a!==void 0&&A<a||c!==void 0&&A>c,x=A=>a===void 0?c:c===void 0||Math.abs(a-A)<Math.abs(c-A)?a:c;let g=n*t;const y=d+g,v=i===void 0?y:i(y);v!==y&&(g=v-d);const w=A=>-g*Math.exp(-A/r),S=A=>v+w(A),C=A=>{const j=w(A),k=S(A);f.done=Math.abs(j)<=l,f.value=f.done?v:k};let T,E;const P=A=>{p(f.value)&&(T=A,E=Rr({keyframes:[f.value,x(f.value)],velocity:kl(S,A,f.value),damping:o,stiffness:s,restDelta:l,restSpeed:u}))};return P(0),{calculatedDuration:null,next:A=>{let j=!1;return!E&&T===void 0&&(j=!0,C(A),P(A)),T!==void 0&&A>=T?E.next(A-T):(!j&&C(A),f)}}}function Jp(e,t,n){const r=[],o=n||gt.mix||Dl,s=e.length-1;for(let i=0;i<s;i++){let a=o(e[i],e[i+1]);if(t){const c=Array.isArray(t)?t[i]||_e:t;a=Nn(c,a)}r.push(a)}return r}function em(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const s=e.length;if(st(s===t.length,"Both input and output ranges must be the same length","range-length"),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];const i=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=Jp(t,r,o),c=a.length,l=u=>{if(i&&u<e[0])return t[0];let d=0;if(c>1)for(;d<e.length-2&&!(u<e[d+1]);d++);const f=En(e[d],e[d+1],u);return a[d](f)};return n?u=>l(rt(e[0],e[s-1],u)):l}function tm(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=En(0,t,r);e.push(ue(n,1,o))}}function nm(e){const t=[0];return tm(t,e.length-1),t}function rm(e,t){return e.map(n=>n*t)}function om(e,t){return e.map(()=>t||xl).splice(0,e.length-1)}function en({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=hp(r)?r.map(ra):ra(r),s={done:!1,value:t[0]},i=rm(n&&n.length===t.length?n:nm(t),e),a=em(i,t,{ease:Array.isArray(o)?o:om(t,o)});return{calculatedDuration:e,next:c=>(s.value=a(c),s.done=c>=e,s)}}const sm=e=>e!==null;function Hr(e,{repeat:t,repeatType:n="loop"},r,o=1){const s=e.filter(sm),a=o<0||t&&n!=="loop"&&t%2===1?0:s.length-1;return!a||r===void 0?s[a]:r}const im={decay:ds,inertia:ds,tween:en,keyframes:en,spring:Rr};function Nl(e){typeof e.type=="string"&&(e.type=im[e.type])}class si{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 am=e=>e/100;class Er extends si{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var r,o;const{motionValue:n}=this.options;n&&n.updatedAt!==Ee.now()&&this.tick(Ee.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(o=(r=this.options).onStop)==null||o.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;Nl(t);const{type:n=en,repeat:r=0,repeatDelay:o=0,repeatType:s,velocity:i=0}=t;let{keyframes:a}=t;const c=n||en;process.env.NODE_ENV!=="production"&&c!==en&&st(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),c!==en&&typeof a[0]!="number"&&(this.mixKeyframes=Nn(am,Dl(a[0],a[1])),a=[0,100]);const l=c({...t,keyframes:a});s==="mirror"&&(this.mirroredGenerator=c({...t,keyframes:[...a].reverse(),velocity:-i})),l.calculatedDuration===null&&(l.calculatedDuration=oi(l));const{calculatedDuration:u}=l;this.calculatedDuration=u,this.resolvedDuration=u+o,this.totalDuration=this.resolvedDuration*(r+1)-o,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:r,totalDuration:o,mixKeyframes:s,mirroredGenerator:i,resolvedDuration:a,calculatedDuration:c}=this;if(this.startTime===null)return r.next(0);const{delay:l=0,keyframes:u,repeat:d,repeatType:f,repeatDelay:p,type:x,onUpdate:g,finalKeyframe:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-o/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const v=this.currentTime-l*(this.playbackSpeed>=0?1:-1),w=this.playbackSpeed>=0?v<0:v>o;this.currentTime=Math.max(v,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let S=this.currentTime,C=r;if(d){const A=Math.min(this.currentTime,o)/a;let j=Math.floor(A),k=A%1;!k&&A>=1&&(k=1),k===1&&j--,j=Math.min(j,d+1),!!(j%2)&&(f==="reverse"?(k=1-k,p&&(k-=p/a)):f==="mirror"&&(C=i)),S=rt(0,1,k)*a}let T;w?(this.delayState.value=u[0],T=this.delayState):T=C.next(S),s&&!w&&(T.value=s(T.value));let{done:E}=T;!w&&c!==null&&(E=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);const P=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&E);return P&&x!==ds&&(T.value=Hr(u,this.options,y,this.speed)),g&&g(T.value),P&&this.finish(),T}then(t,n){return this.finished.then(t,n)}get duration(){return Fe(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Fe(t)}get time(){return Fe(this.currentTime)}set time(t){t=De(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),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const n=this.generator.next(t).value;return kl(r=>this.generator.next(r).value,t,n)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(Ee.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=Fe(this.currentTime))}play(){var o,s;if(this.isStopped)return;const{driver:t=Hp,startTime:n}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),(s=(o=this.options).onPlay)==null||s.call(o);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),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(Ee.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 cm(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Ot=e=>e*180/Math.PI,fs=e=>{const t=Ot(Math.atan2(e[1],e[0]));return hs(t)},lm={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:fs,rotateZ:fs,skewX:e=>Ot(Math.atan(e[1])),skewY:e=>Ot(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},hs=e=>(e=e%360,e<0&&(e+=360),e),ua=fs,da=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),fa=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),um={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:da,scaleY:fa,scale:e=>(da(e)+fa(e))/2,rotateX:e=>hs(Ot(Math.atan2(e[6],e[5]))),rotateY:e=>hs(Ot(Math.atan2(-e[2],e[0]))),rotateZ:ua,rotate:ua,skewX:e=>Ot(Math.atan(e[4])),skewY:e=>Ot(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function ps(e){return e.includes("scale")?1:0}function ms(e,t){if(!e||e==="none")return ps(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,o;if(n)r=um,o=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=lm,o=a}if(!o)return ps(t);const s=r[t],i=o[1].split(",").map(fm);return typeof s=="function"?s(i):i[s]}const dm=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return ms(n,t)};function fm(e){return parseFloat(e.trim())}const hn=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],pn=new Set(hn),ha=e=>e===fn||e===B,hm=new Set(["x","y","z"]),pm=hn.filter(e=>!hm.has(e));function mm(e){const t=[];return pm.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const pt={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:r})=>{const o=e.max-e.min;return r==="border-box"?o:o-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:r})=>{const o=e.max-e.min;return r==="border-box"?o:o-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})=>ms(t,"x"),y:(e,{transform:t})=>ms(t,"y")};pt.translateX=pt.x;pt.translateY=pt.y;const Lt=new Set;let gs=!1,ys=!1,vs=!1;function Il(){if(ys){const e=Array.from(Lt).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const o=mm(r);o.length&&(n.set(r,o),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const o=n.get(r);o&&o.forEach(([s,i])=>{var a;(a=r.getValue(s))==null||a.set(i)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}ys=!1,gs=!1,Lt.forEach(e=>e.complete(vs)),Lt.clear()}function jl(){Lt.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(ys=!0)})}function gm(){vs=!0,jl(),Il(),vs=!1}class ii{constructor(t,n,r,o,s,i=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=o,this.element=s,this.isAsync=i}scheduleResolve(){this.state="scheduled",this.isAsync?(Lt.add(this),gs||(gs=!0,le.read(jl),le.resolveKeyframes(Il))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:o}=this;if(t[0]===null){const s=o==null?void 0:o.get(),i=t[t.length-1];if(s!==void 0)t[0]=s;else if(r&&n){const a=r.readValue(n,i);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=i),o&&s===void 0&&o.set(t[0])}cm(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Lt.delete(this)}cancel(){this.state==="scheduled"&&(Lt.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const ym=e=>e.startsWith("--");function Ol(e,t,n){ym(t)?e.style.setProperty(t,n):e.style[t]=n}const vm={};function Ll(e,t){const n=ll(e);return()=>vm[t]??n()}const xm=Ll(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Vl=Ll(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Sn=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,pa={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Sn([0,.65,.55,1]),circOut:Sn([.55,0,1,.45]),backIn:Sn([.31,.01,.66,-.59]),backOut:Sn([.33,1.53,.69,.99])};function Fl(e,t){if(e)return typeof e=="function"?Vl()?Ml(e,t):"ease-out":wl(e)?Sn(e):Array.isArray(e)?e.map(n=>Fl(n,t)||pa.easeOut):pa[e]}function wm(e,t,n,{delay:r=0,duration:o=300,repeat:s=0,repeatType:i="loop",ease:a="easeOut",times:c}={},l=void 0){const u={[t]:n};c&&(u.offset=c);const d=Fl(a,o);Array.isArray(d)&&(u.easing=d);const f={delay:r,duration:o,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:s+1,direction:i==="reverse"?"alternate":"normal"};return l&&(f.pseudoElement=l),e.animate(u,f)}function _l(e){return typeof e=="function"&&"applyToOptions"in e}function bm({type:e,...t}){return _l(e)&&Vl()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class Bl extends si{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:r,keyframes:o,pseudoElement:s,allowFlatten:i=!1,finalKeyframe:a,onComplete:c}=t;this.isPseudoElement=!!s,this.allowFlatten=i,this.options=t,st(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const l=bm(t);this.animation=wm(n,r,o,l,s),l.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const u=Hr(o,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(u),Ol(n,r,u),this.animation.cancel()}c==null||c(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,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 n,r,o;const t=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((o=(r=this.animation).commitStyles)==null||o.call(r))}get duration(){var n,r;const t=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return Fe(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Fe(t)}get time(){return Fe(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=De(t),n&&this.animation.pause()}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 this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:n,rangeEnd:r,observe:o}){var s;return this.allowFlatten&&((s=this.animation.effect)==null||s.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&xm()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),_e):o(this)}}const $l={anticipate:gl,backInOut:ml,circInOut:vl};function Sm(e){return e in $l}function Cm(e){typeof e.ease=="string"&&Sm(e.ease)&&(e.ease=$l[e.ease])}const Mo=10;class Tm extends Bl{constructor(t){Cm(t),Nl(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:o,element:s,...i}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const a=new Er({...i,autoplay:!1}),c=Math.max(Mo,Ee.now()-this.startTime),l=rt(0,Mo,c-Mo),u=a.sample(c).value,{name:d}=this.options;s&&d&&Ol(s,d,u),n.setWithVelocity(a.sample(Math.max(0,c-l)).value,u,l),a.stop()}}const ma=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Ue.test(e)||e==="0")&&!e.startsWith("url("));function Pm(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 Rm(e,t,n,r){const o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;const s=e[e.length-1],i=ma(o,t),a=ma(s,t);return dn(i===a,`You are trying to animate ${t} from "${o}" to "${s}". "${i?s:o}" is not an animatable value.`,"value-not-animatable"),!i||!a?!1:Pm(e)||(n==="spring"||_l(n))&&r}function xs(e){e.duration=0,e.type="keyframes"}const Wl=new Set(["opacity","clipPath","filter","transform"]),Em=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function Am(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&Em.test(e[t]))return!0;return!1}const Dm=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Mm=ll(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function km(e){var d;const{motionValue:t,name:n,repeatDelay:r,repeatType:o,damping:s,type:i,keyframes:a}=e;if(!(((d=t==null?void 0:t.owner)==null?void 0:d.current)instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=t.owner.getProps();return Mm()&&n&&(Wl.has(n)||Dm.has(n)&&Am(a))&&(n!=="transform"||!u)&&!l&&!r&&o!=="mirror"&&s!==0&&i!=="inertia"}const Nm=40;class Im extends si{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:o=0,repeatDelay:s=0,repeatType:i="loop",keyframes:a,name:c,motionValue:l,element:u,...d}){var x;super(),this.stop=()=>{var g,y;this._animation&&(this._animation.stop(),(g=this.stopTimeline)==null||g.call(this)),(y=this.keyframeResolver)==null||y.cancel()},this.createdAt=Ee.now();const f={autoplay:t,delay:n,type:r,repeat:o,repeatDelay:s,repeatType:i,name:c,motionValue:l,element:u,...d},p=(u==null?void 0:u.KeyframeResolver)||ii;this.keyframeResolver=new p(a,(g,y,v)=>this.onKeyframesResolved(g,y,f,!v),c,l,u),(x=this.keyframeResolver)==null||x.scheduleResolve()}onKeyframesResolved(t,n,r,o){var v,w;this.keyframeResolver=void 0;const{name:s,type:i,velocity:a,delay:c,isHandoff:l,onUpdate:u}=r;this.resolvedAt=Ee.now();let d=!0;Rm(t,s,i,a)||(d=!1,(gt.instantAnimations||!c)&&(u==null||u(Hr(t,r,n))),t[0]=t[t.length-1],xs(r),r.repeat=0);const p={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>Nm?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},x=d&&!l&&km(p),g=(w=(v=p.motionValue)==null?void 0:v.owner)==null?void 0:w.current;let y;if(x)try{y=new Tm({...p,element:g})}catch{y=new Er(p)}else y=new Er(p);y.finished.then(()=>{this.notifyFinished()}).catch(_e),this.pendingTimeline&&(this.stopTimeline=y.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=y}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(),gm()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}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()}}function Ul(e,t,n,r=0,o=1){const s=Array.from(e).sort((l,u)=>l.sortNodePosition(u)).indexOf(t),i=e.size,a=(i-1)*r;return typeof n=="function"?n(s,i):o===1?s*r:a-s*r}const jm=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Om(e){const t=jm.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${n??r}`,o]}const Lm=4;function Hl(e,t,n=1){st(n<=Lm,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,o]=Om(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const i=s.trim();return il(i)?parseFloat(i):i}return ei(o)?Hl(o,t,n+1):o}const Vm={type:"spring",stiffness:500,damping:25,restSpeed:10},Fm=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),_m={type:"keyframes",duration:.8},Bm={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},$m=(e,{keyframes:t})=>t.length>2?_m:pn.has(e)?e.startsWith("scale")?Fm(t[1]):Vm:Bm;function Gl(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function ai(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?Gl(n,e):n}const Wm=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function Um(e){for(const t in e)if(!Wm.has(t))return!0;return!1}const ci=(e,t,n,r={},o,s)=>i=>{const a=ai(r,e)||{},c=a.delay||r.delay||0;let{elapsed:l=0}=r;l=l-De(c);const u={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:()=>{i(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:s?void 0:o};Um(a)||Object.assign(u,$m(e,u)),u.duration&&(u.duration=De(u.duration)),u.repeatDelay&&(u.repeatDelay=De(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(xs(u),u.delay===0&&(d=!0)),(gt.instantAnimations||gt.skipAnimations||o!=null&&o.shouldSkipAnimations)&&(d=!0,xs(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,d&&!s&&t.get()!==void 0){const f=Hr(u.keyframes,a);if(f!==void 0){le.update(()=>{u.onUpdate(f),u.onComplete()});return}}return a.isSync?new Er(u):new Im(u)};function ga(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function li(e,t,n,r){if(typeof t=="function"){const[o,s]=ga(r);t=t(n!==void 0?n:e.custom,o,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[o,s]=ga(r);t=t(n!==void 0?n:e.custom,o,s)}return t}function Vt(e,t,n){const r=e.getProps();return li(r,t,n!==void 0?n:r.custom,e)}const Kl=new Set(["width","height","top","left","right","bottom",...hn]),ya=30,Hm=e=>!isNaN(parseFloat(e));class Gm{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var s;const o=Ee.now();if(this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((s=this.events.change)==null||s.notify(this.current),this.dependents))for(const i of this.dependents)i.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Ee.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Hm(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&Zs(!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 qs);const r=this.events[t].add(n);return t==="change"?()=>{r(),le.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}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=Ee.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>ya)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,ya);return ul(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 an(e,t){return new Gm(e,t)}const ws=e=>Array.isArray(e);function Km(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,an(n))}function zm(e){return ws(e)?e[e.length-1]||0:e}function Ym(e,t){const n=Vt(e,t);let{transitionEnd:r={},transition:o={},...s}=n||{};s={...s,...r};for(const i in s){const a=zm(s[i]);Km(e,i,a)}}const we=e=>!!(e&&e.getVelocity);function Xm(e){return!!(we(e)&&e.add)}function bs(e,t){const n=e.getValue("willChange");if(Xm(n))return n.add(t);if(!n&>.WillChange){const r=new gt.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function ui(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const qm="framerAppearId",zl="data-"+ui(qm);function Yl(e){return e.props[zl]}function Zm({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Xl(e,t,{delay:n=0,transitionOverride:r,type:o}={}){let{transition:s,transitionEnd:i,...a}=t;const c=e.getDefaultTransition();s=s?Gl(s,c):c;const l=s==null?void 0:s.reduceMotion;r&&(s=r);const u=[],d=o&&e.animationState&&e.animationState.getState()[o];for(const f in a){const p=e.getValue(f,e.latestValues[f]??null),x=a[f];if(x===void 0||d&&Zm(d,f))continue;const g={delay:n,...ai(s||{},f)},y=p.get();if(y!==void 0&&!p.isAnimating()&&!Array.isArray(x)&&x===y&&!g.velocity){le.update(()=>p.set(x));continue}let v=!1;if(window.MotionHandoffAnimation){const C=Yl(e);if(C){const T=window.MotionHandoffAnimation(C,f,le);T!==null&&(g.startTime=T,v=!0)}}bs(e,f);const w=l??e.shouldReduceMotion;p.start(ci(f,p,x,w&&Kl.has(f)?{type:!1}:g,e,v));const S=p.animation;S&&u.push(S)}if(i){const f=()=>le.update(()=>{i&&Ym(e,i)});u.length?Promise.all(u).then(f):f()}return u}function Ss(e,t,n={}){var c;const r=Vt(e,t,n.type==="exit"?(c=e.presenceContext)==null?void 0:c.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(o=n.transitionOverride);const s=r?()=>Promise.all(Xl(e,r,n)):()=>Promise.resolve(),i=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:u=0,staggerChildren:d,staggerDirection:f}=o;return Qm(e,t,l,u,d,f,n)}:()=>Promise.resolve(),{when:a}=o;if(a){const[l,u]=a==="beforeChildren"?[s,i]:[i,s];return l().then(()=>u())}else return Promise.all([s(),i(n.delay)])}function Qm(e,t,n=0,r=0,o=0,s=1,i){const a=[];for(const c of e.variantChildren)c.notify("AnimationStart",t),a.push(Ss(c,t,{...i,delay:n+(typeof r=="function"?0:r)+Ul(e.variantChildren,c,r,o,s)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(a)}function Jm(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const o=t.map(s=>Ss(e,s,n));r=Promise.all(o)}else if(typeof t=="string")r=Ss(e,t,n);else{const o=typeof t=="function"?Vt(e,t,n.custom):t;r=Promise.all(Xl(e,o,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const eg={test:e=>e==="auto",parse:e=>e},ql=e=>t=>t.test(e),Zl=[fn,B,tt,dt,Pp,Tp,eg],va=e=>Zl.find(ql(e));function tg(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||cl(e):!0}const ng=new Set(["brightness","contrast","saturate","opacity"]);function rg(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(ti)||[];if(!r)return e;const o=n.replace(r,"");let s=ng.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+o+")"}const og=/\b([a-z-]*)\(.*?\)/gu,Cs={...Ue,getAnimatableNone:e=>{const t=e.match(og);return t?t.map(rg).join(" "):e}},Ts={...Ue,getAnimatableNone:e=>{const t=Ue.parse(e);return Ue.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},xa={...fn,transform:Math.round},sg={rotate:dt,rotateX:dt,rotateY:dt,rotateZ:dt,scale:Xn,scaleX:Xn,scaleY:Xn,scaleZ:Xn,skew:dt,skewX:dt,skewY:dt,distance:B,translateX:B,translateY:B,translateZ:B,x:B,y:B,z:B,perspective:B,transformPerspective:B,opacity:An,originX:sa,originY:sa,originZ:B},di={borderWidth:B,borderTopWidth:B,borderRightWidth:B,borderBottomWidth:B,borderLeftWidth:B,borderRadius:B,borderTopLeftRadius:B,borderTopRightRadius:B,borderBottomRightRadius:B,borderBottomLeftRadius:B,width:B,maxWidth:B,height:B,maxHeight:B,top:B,right:B,bottom:B,left:B,inset:B,insetBlock:B,insetBlockStart:B,insetBlockEnd:B,insetInline:B,insetInlineStart:B,insetInlineEnd:B,padding:B,paddingTop:B,paddingRight:B,paddingBottom:B,paddingLeft:B,paddingBlock:B,paddingBlockStart:B,paddingBlockEnd:B,paddingInline:B,paddingInlineStart:B,paddingInlineEnd:B,margin:B,marginTop:B,marginRight:B,marginBottom:B,marginLeft:B,marginBlock:B,marginBlockStart:B,marginBlockEnd:B,marginInline:B,marginInlineStart:B,marginInlineEnd:B,fontSize:B,backgroundPositionX:B,backgroundPositionY:B,...sg,zIndex:xa,fillOpacity:An,strokeOpacity:An,numOctaves:xa},ig={...di,color:pe,backgroundColor:pe,outlineColor:pe,fill:pe,stroke:pe,borderColor:pe,borderTopColor:pe,borderRightColor:pe,borderBottomColor:pe,borderLeftColor:pe,filter:Cs,WebkitFilter:Cs,mask:Ts,WebkitMask:Ts},Ql=e=>ig[e],ag=new Set([Cs,Ts]);function Jl(e,t){let n=Ql(e);return ag.has(n)||(n=Ue),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const cg=new Set(["auto","none","0"]);function lg(e,t,n){let r=0,o;for(;r<e.length&&!o;){const s=e[r];typeof s=="string"&&!cg.has(s)&&sn(s).values.length&&(o=e[r]),r++}if(o&&n)for(const s of t)e[s]=Jl(n,o)}class ug extends ii{constructor(t,n,r,o,s){super(t,n,r,o,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let u=0;u<t.length;u++){let d=t[u];if(typeof d=="string"&&(d=d.trim(),ei(d))){const f=Hl(d,n.current);f!==void 0&&(t[u]=f),u===t.length-1&&(this.finalKeyframe=d)}}if(this.resolveNoneKeyframes(),!Kl.has(r)||t.length!==2)return;const[o,s]=t,i=va(o),a=va(s),c=oa(o),l=oa(s);if(c!==l&&pt[r]){this.needsMeasurement=!0;return}if(i!==a)if(ha(i)&&ha(a))for(let u=0;u<t.length;u++){const d=t[u];typeof d=="string"&&(t[u]=parseFloat(d))}else pt[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let o=0;o<t.length;o++)(t[o]===null||tg(t[o]))&&r.push(o);r.length&&lg(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=pt[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const o=n[n.length-1];o!==void 0&&t.getValue(r,o).jump(o,!1)}measureEndState(){var a;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const o=t.getValue(n);o&&o.jump(this.measuredOrigin,!1);const s=r.length-1,i=r[s];r[s]=pt[n](t.measureViewportBox(),window.getComputedStyle(t.current)),i!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=i),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([c,l])=>{t.getValue(c).set(l)}),this.resolveNoneKeyframes()}}function eu(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const o=(n==null?void 0:n[e])??r.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e).filter(r=>r!=null)}const tu=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function fr(e){return al(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:fi}=bl(queueMicrotask,!1),$e={x:!1,y:!1};function nu(){return $e.x||$e.y}function dg(e){return e==="x"||e==="y"?$e[e]?null:($e[e]=!0,()=>{$e[e]=!1}):$e.x||$e.y?null:($e.x=$e.y=!0,()=>{$e.x=$e.y=!1})}function ru(e,t){const n=eu(e),r=new AbortController,o={passive:!0,...t,signal:r.signal};return[n,o,()=>r.abort()]}function fg(e){return!(e.pointerType==="touch"||nu())}function hg(e,t,n={}){const[r,o,s]=ru(e,n);return r.forEach(i=>{let a=!1,c=!1,l;const u=()=>{i.removeEventListener("pointerleave",x)},d=y=>{l&&(l(y),l=void 0),u()},f=y=>{a=!1,window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f),c&&(c=!1,d(y))},p=()=>{a=!0,window.addEventListener("pointerup",f,o),window.addEventListener("pointercancel",f,o)},x=y=>{if(y.pointerType!=="touch"){if(a){c=!0;return}d(y)}},g=y=>{if(!fg(y))return;c=!1;const v=t(i,y);typeof v=="function"&&(l=v,i.addEventListener("pointerleave",x,o))};i.addEventListener("pointerenter",g,o),i.addEventListener("pointerdown",p,o)}),s}const ou=(e,t)=>t?e===t?!0:ou(e,t.parentElement):!1,hi=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,pg=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function mg(e){return pg.has(e.tagName)||e.isContentEditable===!0}const gg=new Set(["INPUT","SELECT","TEXTAREA"]);function yg(e){return gg.has(e.tagName)||e.isContentEditable===!0}const hr=new WeakSet;function wa(e){return t=>{t.key==="Enter"&&e(t)}}function ko(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const vg=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=wa(()=>{if(hr.has(n))return;ko(n,"down");const o=wa(()=>{ko(n,"up")}),s=()=>ko(n,"cancel");n.addEventListener("keyup",o,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function ba(e){return hi(e)&&!nu()}const Sa=new WeakSet;function xg(e,t,n={}){const[r,o,s]=ru(e,n),i=a=>{const c=a.currentTarget;if(!ba(a)||Sa.has(a))return;hr.add(c),n.stopPropagation&&Sa.add(a);const l=t(c,a),u=(p,x)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",f),hr.has(c)&&hr.delete(c),ba(p)&&typeof l=="function"&&l(p,{success:x})},d=p=>{u(p,c===window||c===document||n.useGlobalTarget||ou(c,p.target))},f=p=>{u(p,!1)};window.addEventListener("pointerup",d,o),window.addEventListener("pointercancel",f,o)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",i,o),fr(a)&&(a.addEventListener("focus",l=>vg(l,o)),!mg(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),s}function pi(e){return al(e)&&"ownerSVGElement"in e}const pr=new WeakMap;let ft;const su=(e,t,n)=>(r,o)=>o&&o[0]?o[0][e+"Size"]:pi(r)&&"getBBox"in r?r.getBBox()[t]:r[n],wg=su("inline","width","offsetWidth"),bg=su("block","height","offsetHeight");function Sg({target:e,borderBoxSize:t}){var n;(n=pr.get(e))==null||n.forEach(r=>{r(e,{get width(){return wg(e,t)},get height(){return bg(e,t)}})})}function Cg(e){e.forEach(Sg)}function Tg(){typeof ResizeObserver>"u"||(ft=new ResizeObserver(Cg))}function Pg(e,t){ft||Tg();const n=eu(e);return n.forEach(r=>{let o=pr.get(r);o||(o=new Set,pr.set(r,o)),o.add(t),ft==null||ft.observe(r)}),()=>{n.forEach(r=>{const o=pr.get(r);o==null||o.delete(t),o!=null&&o.size||ft==null||ft.unobserve(r)})}}const mr=new Set;let tn;function Rg(){tn=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};mr.forEach(t=>t(e))},window.addEventListener("resize",tn)}function Eg(e){return mr.add(e),tn||Rg(),()=>{mr.delete(e),!mr.size&&typeof tn=="function"&&(window.removeEventListener("resize",tn),tn=void 0)}}function Ca(e,t){return typeof e=="function"?Eg(e):Pg(e,t)}function Ag(e){return pi(e)&&e.tagName==="svg"}const Dg=[...Zl,pe,Ue],Mg=e=>Dg.find(ql(e)),Ta=()=>({translate:0,scale:1,origin:0,originPoint:0}),nn=()=>({x:Ta(),y:Ta()}),Pa=()=>({min:0,max:0}),ge=()=>({x:Pa(),y:Pa()}),kg=new WeakMap;function Gr(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Dn(e){return typeof e=="string"||Array.isArray(e)}const mi=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],gi=["initial",...mi];function Kr(e){return Gr(e.animate)||gi.some(t=>Dn(e[t]))}function iu(e){return!!(Kr(e)||e.variants)}function Ng(e,t,n){for(const r in t){const o=t[r],s=n[r];if(we(o))e.addValue(r,o);else if(we(s))e.addValue(r,an(o,{owner:e}));else if(s!==o)if(e.hasValue(r)){const i=e.getValue(r);i.liveStyle===!0?i.jump(o):i.hasAnimated||i.set(o)}else{const i=e.getStaticValue(r);e.addValue(r,an(i!==void 0?i:o,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Ps={current:null},au={current:!1},Ig=typeof window<"u";function jg(){if(au.current=!0,!!Ig)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Ps.current=e.matches;e.addEventListener("change",t),t()}else Ps.current=!1}const Ra=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Ar={};function cu(e){Ar=e}function Og(){return Ar}class Lg{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:o,skipAnimations:s,blockInitialAnimation:i,visualState:a},c={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=ii,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,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 p=Ee.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,le.render(this.render,!1,!0))};const{latestValues:l,renderState:u}=a;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=u,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.skipAnimationsConfig=s,this.options=c,this.blockInitialAnimation=!!i,this.isControllingVariants=Kr(n),this.isVariantNode=iu(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:d,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const p in f){const x=f[p];l[p]!==void 0&&we(x)&&x.set(l[p])}}mount(t){var n,r;if(this.hasBeenMounted)for(const o in this.initialValues)(n=this.values.get(o))==null||n.jump(this.initialValues[o]),this.latestValues[o]=this.initialValues[o];this.current=t,kg.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((o,s)=>this.bindToMotionValue(s,o)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(au.current||jg(),this.shouldReduceMotion=Ps.current),process.env.NODE_ENV!=="production"&&Zs(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),yt(this.notifyUpdate),yt(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&Wl.has(t)&&this.current instanceof HTMLElement){const{factory:i,keyframes:a,times:c,ease:l,duration:u}=n.accelerate,d=new Bl({element:this.current,name:t,keyframes:a,times:c,ease:l,duration:De(u)}),f=i(d);this.valueSubscriptions.set(t,()=>{f(),d.cancel()});return}const r=pn.has(t);r&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",i=>{this.latestValues[t]=i,this.props.onUpdate&&le.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;typeof window<"u"&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{o(),s&&s(),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 Ar){const n=Ar[t];if(!n)continue;const{isEnabled:r,Feature:o}=n;if(!this.features[t]&&o&&r(this.props)&&(this.features[t]=new o(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ge()}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 r=0;r<Ra.length;r++){const o=Ra[r];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const s="on"+o,i=t[s];i&&(this.propEventSubscriptions[o]=this.on(o,i))}this.prevMotionValues=Ng(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 r=this.values.get(t);n!==r&&(r&&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 r=this.values.get(t);return r===void 0&&n!==void 0&&(r=an(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(il(r)||cl(r))?r=parseFloat(r):!Mg(r)&&Ue.test(n)&&(r=Jl(t,n)),this.setBaseTarget(t,we(r)?r.get():r)),we(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var s;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const i=li(this.props,n,(s=this.presenceContext)==null?void 0:s.custom);i&&(r=i[t])}if(n&&r!==void 0)return r;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!we(o)?o:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new qs),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){fi.render(this.render)}}class lu extends Lg{constructor(){super(...arguments),this.KeyframeResolver=ug}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const r=t.style;return r?r[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;we(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class St{constructor(t){this.isMounted=!1,this.node=t}update(){}}function uu({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Vg({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Fg(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function No(e){return e===void 0||e===1}function Rs({scale:e,scaleX:t,scaleY:n}){return!No(e)||!No(t)||!No(n)}function It(e){return Rs(e)||du(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function du(e){return Ea(e.x)||Ea(e.y)}function Ea(e){return e&&e!=="0%"}function Dr(e,t,n){const r=e-n,o=t*r;return n+o}function Aa(e,t,n,r,o){return o!==void 0&&(e=Dr(e,o,r)),Dr(e,n,r)+t}function Es(e,t=0,n=1,r,o){e.min=Aa(e.min,t,n,r,o),e.max=Aa(e.max,t,n,r,o)}function fu(e,{x:t,y:n}){Es(e.x,t.translate,t.scale,t.originPoint),Es(e.y,n.translate,n.scale,n.originPoint)}const Da=.999999999999,Ma=1.0000000000001;function _g(e,t,n,r=!1){var a;const o=n.length;if(!o)return;t.x=t.y=1;let s,i;for(let c=0;c<o;c++){s=n[c],i=s.projectionDelta;const{visualElement:l}=s.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&(Qe(e.x,-s.scroll.offset.x),Qe(e.y,-s.scroll.offset.y)),i&&(t.x*=i.x.scale,t.y*=i.y.scale,fu(e,i)),r&&It(s.latestValues)&&gr(e,s.latestValues,(a=s.layout)==null?void 0:a.layoutBox))}t.x<Ma&&t.x>Da&&(t.x=1),t.y<Ma&&t.y>Da&&(t.y=1)}function Qe(e,t){e.min+=t,e.max+=t}function ka(e,t,n,r,o=.5){const s=ue(e.min,e.max,o);Es(e,t,n,s,r)}function Na(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function gr(e,t,n){const r=n??e;ka(e.x,Na(t.x,r.x),t.scaleX,t.scale,t.originX),ka(e.y,Na(t.y,r.y),t.scaleY,t.scale,t.originY)}function hu(e,t){return uu(Fg(e.getBoundingClientRect(),t))}function Bg(e,t,n){const r=hu(e,n),{scroll:o}=t;return o&&(Qe(r.x,o.offset.x),Qe(r.y,o.offset.y)),r}const $g={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Wg=hn.length;function Ug(e,t,n){let r="",o=!0;for(let s=0;s<Wg;s++){const i=hn[s],a=e[i];if(a===void 0)continue;let c=!0;if(typeof a=="number")c=a===(i.startsWith("scale")?1:0);else{const l=parseFloat(a);c=i.startsWith("scale")?l===1:l===0}if(!c||n){const l=tu(a,di[i]);if(!c){o=!1;const u=$g[i]||i;r+=`${u}(${l}) `}n&&(t[i]=l)}}return r=r.trim(),n?r=n(t,o?"":r):o&&(r="none"),r}function yi(e,t,n){const{style:r,vars:o,transformOrigin:s}=e;let i=!1,a=!1;for(const c in t){const l=t[c];if(pn.has(c)){i=!0;continue}else if(Cl(c)){o[c]=l;continue}else{const u=tu(l,di[c]);c.startsWith("origin")?(a=!0,s[c]=u):r[c]=u}}if(t.transform||(i||n?r.transform=Ug(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:c="50%",originY:l="50%",originZ:u=0}=s;r.transformOrigin=`${c} ${l} ${u}`}}function pu(e,{style:t,vars:n},r,o){const s=e.style;let i;for(i in t)s[i]=t[i];o==null||o.applyProjectionStyles(s,r);for(i in n)s.setProperty(i,n[i])}function Ia(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const wn={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(B.test(e))e=parseFloat(e);else return e;const n=Ia(e,t.target.x),r=Ia(e,t.target.y);return`${n}% ${r}%`}},Hg={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=Ue.parse(e);if(o.length>5)return r;const s=Ue.createTransformer(e),i=typeof o[0]!="number"?1:0,a=n.x.scale*t.x,c=n.y.scale*t.y;o[0+i]/=a,o[1+i]/=c;const l=ue(a,c,.5);return typeof o[2+i]=="number"&&(o[2+i]/=l),typeof o[3+i]=="number"&&(o[3+i]/=l),s(o)}},As={borderRadius:{...wn,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:wn,borderTopRightRadius:wn,borderBottomLeftRadius:wn,borderBottomRightRadius:wn,boxShadow:Hg};function mu(e,{layout:t,layoutId:n}){return pn.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!As[e]||e==="opacity")}function vi(e,t,n){var i;const r=e.style,o=t==null?void 0:t.style,s={};if(!r)return s;for(const a in r)(we(r[a])||o&&we(o[a])||mu(a,e)||((i=n==null?void 0:n.getValue(a))==null?void 0:i.liveStyle)!==void 0)&&(s[a]=r[a]);return s}function Gg(e){return window.getComputedStyle(e)}class Kg extends lu{constructor(){super(...arguments),this.type="html",this.renderInstance=pu}readValueFromInstance(t,n){var r;if(pn.has(n))return(r=this.projection)!=null&&r.isProjecting?ps(n):dm(t,n);{const o=Gg(t),s=(Cl(n)?o.getPropertyValue(n):o[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return hu(t,n)}build(t,n,r){yi(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return vi(t,n,r)}}const zg={offset:"stroke-dashoffset",array:"stroke-dasharray"},Yg={offset:"strokeDashoffset",array:"strokeDasharray"};function Xg(e,t,n=1,r=0,o=!0){e.pathLength=1;const s=o?zg:Yg;e[s.offset]=`${-r}`,e[s.array]=`${t} ${n}`}const qg=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function gu(e,{attrX:t,attrY:n,attrScale:r,pathLength:o,pathSpacing:s=1,pathOffset:i=0,...a},c,l,u){if(yi(e,a,l),c){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=(u==null?void 0:u.transformBox)??"fill-box",delete d.transformBox);for(const p of qg)d[p]!==void 0&&(f[p]=d[p],delete d[p]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),o!==void 0&&Xg(d,o,s,i,!1)}const yu=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"]),vu=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Zg(e,t,n,r){pu(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(yu.has(o)?o:ui(o),t.attrs[o])}function xu(e,t,n){const r=vi(e,t,n);for(const o in e)if(we(e[o])||we(t[o])){const s=hn.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[s]=e[o]}return r}class Qg extends lu{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ge}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(pn.has(n)){const r=Ql(n);return r&&r.default||0}return n=yu.has(n)?n:ui(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return xu(t,n,r)}build(t,n,r){gu(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,o){Zg(t,n,r,o)}mount(t){this.isSVGTag=vu(t.tagName),super.mount(t)}}const Jg=gi.length;function wu(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?wu(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Jg;n++){const r=gi[n],o=e.props[r];(Dn(o)||o===!1)&&(t[r]=o)}return t}function bu(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const ey=[...mi].reverse(),ty=mi.length;function ny(e){return t=>Promise.all(t.map(({animation:n,options:r})=>Jm(e,n,r)))}function ry(e){let t=ny(e),n=ja(),r=!0,o=!1;const s=l=>(u,d)=>{var p;const f=Vt(e,d,l==="exit"?(p=e.presenceContext)==null?void 0:p.custom:void 0);if(f){const{transition:x,transitionEnd:g,...y}=f;u={...u,...y,...g}}return u};function i(l){t=l(e)}function a(l){const{props:u}=e,d=wu(e.parent)||{},f=[],p=new Set;let x={},g=1/0;for(let v=0;v<ty;v++){const w=ey[v],S=n[w],C=u[w]!==void 0?u[w]:d[w],T=Dn(C),E=w===l?S.isActive:null;E===!1&&(g=v);let P=C===d[w]&&C!==u[w]&&T;if(P&&(r||o)&&e.manuallyAnimateOnMount&&(P=!1),S.protectedKeys={...x},!S.isActive&&E===null||!C&&!S.prevProp||Gr(C)||typeof C=="boolean")continue;if(w==="exit"&&S.isActive&&E!==!0){S.prevResolvedValues&&(x={...x,...S.prevResolvedValues});continue}const A=oy(S.prevProp,C);let j=A||w===l&&S.isActive&&!P&&T||v>g&&T,k=!1;const V=Array.isArray(C)?C:[C];let H=V.reduce(s(w),{});E===!1&&(H={});const{prevResolvedValues:Y={}}=S,G={...Y,...H},K=I=>{j=!0,p.has(I)&&(k=!0,p.delete(I)),S.needsAnimating[I]=!0;const q=e.getValue(I);q&&(q.liveStyle=!1)};for(const I in G){const q=H[I],se=Y[I];if(x.hasOwnProperty(I))continue;let ae=!1;ws(q)&&ws(se)?ae=!bu(q,se):ae=q!==se,ae?q!=null?K(I):p.add(I):q!==void 0&&p.has(I)?K(I):S.protectedKeys[I]=!0}S.prevProp=C,S.prevResolvedValues=H,S.isActive&&(x={...x,...H}),(r||o)&&e.blockInitialAnimation&&(j=!1);const D=P&&A;j&&(!D||k)&&f.push(...V.map(I=>{const q={type:w};if(typeof I=="string"&&(r||o)&&!D&&e.manuallyAnimateOnMount&&e.parent){const{parent:se}=e,ae=Vt(se,I);if(se.enteringChildren&&ae){const{delayChildren:M}=ae.transition||{};q.delay=Ul(se.enteringChildren,e,M)}}return{animation:I,options:q}}))}if(p.size){const v={};if(typeof u.initial!="boolean"){const w=Vt(e,Array.isArray(u.initial)?u.initial[0]:u.initial);w&&w.transition&&(v.transition=w.transition)}p.forEach(w=>{const S=e.getBaseTarget(w),C=e.getValue(w);C&&(C.liveStyle=!0),v[w]=S??null}),f.push({animation:v})}let y=!!f.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(y=!1),r=!1,o=!1,y?t(f):Promise.resolve()}function c(l,u){var f;if(n[l].isActive===u)return Promise.resolve();(f=e.variantChildren)==null||f.forEach(p=>{var x;return(x=p.animationState)==null?void 0:x.setActive(l,u)}),n[l].isActive=u;const d=a(l);for(const p in n)n[p].protectedKeys={};return d}return{animateChanges:a,setActive:c,setAnimateFunction:i,getState:()=>n,reset:()=>{n=ja(),o=!0}}}function oy(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!bu(t,e):!1}function kt(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function ja(){return{animate:kt(!0),whileInView:kt(),whileHover:kt(),whileTap:kt(),whileDrag:kt(),whileFocus:kt(),exit:kt()}}function Ds(e,t){e.min=t.min,e.max=t.max}function Be(e,t){Ds(e.x,t.x),Ds(e.y,t.y)}function Oa(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const Su=1e-4,sy=1-Su,iy=1+Su,Cu=.01,ay=0-Cu,cy=0+Cu;function Ae(e){return e.max-e.min}function ly(e,t,n){return Math.abs(e-t)<=n}function La(e,t,n,r=.5){e.origin=r,e.originPoint=ue(t.min,t.max,e.origin),e.scale=Ae(n)/Ae(t),e.translate=ue(n.min,n.max,e.origin)-e.originPoint,(e.scale>=sy&&e.scale<=iy||isNaN(e.scale))&&(e.scale=1),(e.translate>=ay&&e.translate<=cy||isNaN(e.translate))&&(e.translate=0)}function Pn(e,t,n,r){La(e.x,t.x,n.x,r?r.originX:void 0),La(e.y,t.y,n.y,r?r.originY:void 0)}function Va(e,t,n,r=0){const o=r?ue(n.min,n.max,r):n.min;e.min=o+t.min,e.max=e.min+Ae(t)}function uy(e,t,n,r){Va(e.x,t.x,n.x,r==null?void 0:r.x),Va(e.y,t.y,n.y,r==null?void 0:r.y)}function Fa(e,t,n,r=0){const o=r?ue(n.min,n.max,r):n.min;e.min=t.min-o,e.max=e.min+Ae(t)}function Mr(e,t,n,r){Fa(e.x,t.x,n.x,r==null?void 0:r.x),Fa(e.y,t.y,n.y,r==null?void 0:r.y)}function _a(e,t,n,r,o){return e-=t,e=Dr(e,1/n,r),o!==void 0&&(e=Dr(e,1/o,r)),e}function dy(e,t=0,n=1,r=.5,o,s=e,i=e){if(tt.test(t)&&(t=parseFloat(t),t=ue(i.min,i.max,t/100)-i.min),typeof t!="number")return;let a=ue(s.min,s.max,r);e===s&&(a-=t),e.min=_a(e.min,t,n,a,o),e.max=_a(e.max,t,n,a,o)}function Ba(e,t,[n,r,o],s,i){dy(e,t[n],t[r],t[o],t.scale,s,i)}const fy=["x","scaleX","originX"],hy=["y","scaleY","originY"];function $a(e,t,n,r){Ba(e.x,t,fy,n?n.x:void 0,r?r.x:void 0),Ba(e.y,t,hy,n?n.y:void 0,r?r.y:void 0)}function Wa(e){return e.translate===0&&e.scale===1}function Tu(e){return Wa(e.x)&&Wa(e.y)}function Ua(e,t){return e.min===t.min&&e.max===t.max}function py(e,t){return Ua(e.x,t.x)&&Ua(e.y,t.y)}function Ha(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Pu(e,t){return Ha(e.x,t.x)&&Ha(e.y,t.y)}function Ga(e){return Ae(e.x)/Ae(e.y)}function Ka(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function qe(e){return[e("x"),e("y")]}function my(e,t,n){let r="";const o=e.x.translate/t.x,s=e.y.translate/t.y,i=(n==null?void 0:n.z)||0;if((o||s||i)&&(r=`translate3d(${o}px, ${s}px, ${i}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:l,rotate:u,rotateX:d,rotateY:f,skewX:p,skewY:x}=n;l&&(r=`perspective(${l}px) ${r}`),u&&(r+=`rotate(${u}deg) `),d&&(r+=`rotateX(${d}deg) `),f&&(r+=`rotateY(${f}deg) `),p&&(r+=`skewX(${p}deg) `),x&&(r+=`skewY(${x}deg) `)}const a=e.x.scale*t.x,c=e.y.scale*t.y;return(a!==1||c!==1)&&(r+=`scale(${a}, ${c})`),r||"none"}const Ru=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],gy=Ru.length,za=e=>typeof e=="string"?parseFloat(e):e,Ya=e=>typeof e=="number"||B.test(e);function yy(e,t,n,r,o,s){o?(e.opacity=ue(0,n.opacity??1,vy(r)),e.opacityExit=ue(t.opacity??1,0,xy(r))):s&&(e.opacity=ue(t.opacity??1,n.opacity??1,r));for(let i=0;i<gy;i++){const a=Ru[i];let c=Xa(t,a),l=Xa(n,a);if(c===void 0&&l===void 0)continue;c||(c=0),l||(l=0),c===0||l===0||Ya(c)===Ya(l)?(e[a]=Math.max(ue(za(c),za(l),r),0),(tt.test(l)||tt.test(c))&&(e[a]+="%")):e[a]=l}(t.rotate||n.rotate)&&(e.rotate=ue(t.rotate||0,n.rotate||0,r))}function Xa(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const vy=Eu(0,.5,yl),xy=Eu(.5,.95,_e);function Eu(e,t,n){return r=>r<e?0:r>t?1:n(En(e,t,r))}function wy(e,t,n){const r=we(e)?e:an(e);return r.start(ci("",r,t,n)),r.animation}function Mn(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const by=(e,t)=>e.depth-t.depth;class Sy{constructor(){this.children=[],this.isDirty=!1}add(t){Xs(this.children,t),this.isDirty=!0}remove(t){Cr(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(by),this.isDirty=!1,this.children.forEach(t)}}function Cy(e,t){const n=Ee.now(),r=({timestamp:o})=>{const s=o-n;s>=t&&(yt(r),e(s-t))};return le.setup(r,!0),()=>yt(r)}function yr(e){return we(e)?e.get():e}class Ty{constructor(){this.members=[]}add(t){Xs(this.members,t);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===t||r===this.lead||r===this.prevLead)continue;const o=r.instance;(!o||o.isConnected===!1)&&!r.snapshot&&(Cr(this.members,r),r.unmount())}t.scheduleRender()}remove(t){if(Cr(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){var n;for(let r=this.members.indexOf(t)-1;r>=0;r--){const o=this.members[r];if(o.isPresent!==!1&&((n=o.instance)==null?void 0:n.isConnected)!==!1)return this.promote(o),!0}return!1}promote(t,n){var o;const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.updateSnapshot(),t.scheduleRender();const{layoutDependency:s}=r.options,{layoutDependency:i}=t.options;(s===void 0||s!==i)&&(t.resumeFrom=r,n&&(r.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),(o=t.root)!=null&&o.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var n,r,o,s,i;(r=(n=t.options).onExitComplete)==null||r.call(n),(i=(o=t.resumingFrom)==null?void 0:(s=o.options).onExitComplete)==null||i.call(s)})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){var t;(t=this.lead)!=null&&t.snapshot&&(this.lead.snapshot=void 0)}}const vr={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Io=["","X","Y","Z"],Py=1e3;let Ry=0;function jo(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Au(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Yl(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",le,!(o||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Au(r)}function Du({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(i={},a=t==null?void 0:t()){this.id=Ry++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Dy),this.nodes.forEach(Oy),this.nodes.forEach(Ly),this.nodes.forEach(My)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=i,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new Sy)}addEventListener(i,a){return this.eventHandlers.has(i)||this.eventHandlers.set(i,new qs),this.eventHandlers.get(i).add(a)}notifyListeners(i,...a){const c=this.eventHandlers.get(i);c&&c.notify(...a)}hasListeners(i){return this.eventHandlers.has(i)}mount(i){if(this.instance)return;this.isSVG=pi(i)&&!Ag(i),this.instance=i;const{layoutId:a,layout:c,visualElement:l}=this.options;if(l&&!l.current&&l.mount(i),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||a)&&(this.isLayoutDirty=!0),e){let u,d=0;const f=()=>this.root.updateBlockedByResize=!1;le.read(()=>{d=window.innerWidth}),e(i,()=>{const p=window.innerWidth;p!==d&&(d=p,this.root.updateBlockedByResize=!0,u&&u(),u=Cy(f,250),vr.hasAnimatedSinceResize&&(vr.hasAnimatedSinceResize=!1,this.nodes.forEach(Qa)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&l&&(a||c)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:d,hasRelativeLayoutChanged:f,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const x=this.options.transition||l.getDefaultTransition()||$y,{onLayoutAnimationStart:g,onLayoutAnimationComplete:y}=l.getProps(),v=!this.targetLayout||!Pu(this.targetLayout,p),w=!d&&f;if(this.options.layoutRoot||this.resumeFrom||w||d&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const S={...ai(x,"layout"),onPlay:g,onComplete:y};(l.shouldReduceMotion||this.options.layoutRoot)&&(S.delay=0,S.type=!1),this.startAnimation(S),this.setAnimationOrigin(u,w)}else d||Qa(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const i=this.getStack();i&&i.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),yt(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Vy),this.animationId++)}getTransformTemplate(){const{visualElement:i}=this.options;return i&&i.getProps().transformTemplate}willUpdate(i=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Au(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const d=this.path[u];d.shouldResetTransform=!0,(typeof d.latestValues.x=="string"||typeof d.latestValues.y=="string")&&(d.isLayoutDirty=!0),d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:a,layout:c}=this.options;if(a===void 0&&!c)return;const l=this.getTransformTemplate();this.prevTransformTemplateValue=l?l(this.latestValues,""):void 0,this.updateSnapshot(),i&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const c=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),c&&this.nodes.forEach(Ny),this.nodes.forEach(qa);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Za);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Iy),this.nodes.forEach(jy),this.nodes.forEach(Ey),this.nodes.forEach(Ay)):this.nodes.forEach(Za),this.clearAllSnapshots();const a=Ee.now();xe.delta=rt(0,1e3/60,a-xe.timestamp),xe.timestamp=a,xe.isProcessing=!0,Po.update.process(xe),Po.preRender.process(xe),Po.render.process(xe),xe.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,fi.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(ky),this.sharedNodes.forEach(Fy)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,le.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){le.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Ae(this.snapshot.measuredBox.x)&&!Ae(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const i=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=ge()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,i?i.layoutBox:void 0)}updateScroll(i="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===i&&(a=!1),a&&this.instance){const c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:i,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!o)return;const i=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Tu(this.projectionDelta),c=this.getTransformTemplate(),l=c?c(this.latestValues,""):void 0,u=l!==this.prevTransformTemplateValue;i&&this.instance&&(a||It(this.latestValues)||u)&&(o(this.instance,l),this.shouldResetTransform=!1,this.scheduleRender())}measure(i=!0){const a=this.measurePageBox();let c=this.removeElementScroll(a);return i&&(c=this.removeTransform(c)),Wy(c),{animationId:this.root.animationId,measuredBox:a,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var l;const{visualElement:i}=this.options;if(!i)return ge();const a=i.measureViewportBox();if(!(((l=this.scroll)==null?void 0:l.wasRoot)||this.path.some(Uy))){const{scroll:u}=this.root;u&&(Qe(a.x,u.offset.x),Qe(a.y,u.offset.y))}return a}removeElementScroll(i){var c;const a=ge();if(Be(a,i),(c=this.scroll)!=null&&c.wasRoot)return a;for(let l=0;l<this.path.length;l++){const u=this.path[l],{scroll:d,options:f}=u;u!==this.root&&d&&f.layoutScroll&&(d.wasRoot&&Be(a,i),Qe(a.x,d.offset.x),Qe(a.y,d.offset.y))}return a}applyTransform(i,a=!1,c){var u,d;const l=c||ge();Be(l,i);for(let f=0;f<this.path.length;f++){const p=this.path[f];!a&&p.options.layoutScroll&&p.scroll&&p!==p.root&&(Qe(l.x,-p.scroll.offset.x),Qe(l.y,-p.scroll.offset.y)),It(p.latestValues)&&gr(l,p.latestValues,(u=p.layout)==null?void 0:u.layoutBox)}return It(this.latestValues)&&gr(l,this.latestValues,(d=this.layout)==null?void 0:d.layoutBox),l}removeTransform(i){var c;const a=ge();Be(a,i);for(let l=0;l<this.path.length;l++){const u=this.path[l];if(!It(u.latestValues))continue;let d;u.instance&&(Rs(u.latestValues)&&u.updateSnapshot(),d=ge(),Be(d,u.measurePageBox())),$a(a,u.latestValues,(c=u.snapshot)==null?void 0:c.layoutBox,d)}return It(this.latestValues)&&$a(a,this.latestValues),a}setTargetDelta(i){this.targetDelta=i,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(i){this.options={...this.options,...i,crossfade:i.crossfade!==void 0?i.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==xe.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(i=!1){var p;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==a;if(!(i||c&&this.isSharedProjectionDirty||this.isProjectionDirty||(p=this.parent)!=null&&p.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:d}=this.options;if(!this.layout||!(u||d))return;this.resolvedRelativeTargetAt=xe.timestamp;const f=this.getClosestProjectingParent();f&&this.linkedParentVersion!==f.layoutVersion&&!f.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&f&&f.layout?this.createRelativeTarget(f,this.layout.layoutBox,f.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=ge(),this.targetWithTransforms=ge()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),uy(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Be(this.target,this.layout.layoutBox),fu(this.target,this.targetDelta)):Be(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?this.createRelativeTarget(f,this.target,f.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Rs(this.parent.latestValues)||du(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(i,a,c){this.relativeParent=i,this.linkedParentVersion=i.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ge(),this.relativeTargetOrigin=ge(),Mr(this.relativeTargetOrigin,a,c,this.options.layoutAnchor||void 0),Be(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var x;const i=this.getLead(),a=!!this.resumingFrom||this!==i;let c=!0;if((this.isProjectionDirty||(x=this.parent)!=null&&x.isProjectionDirty)&&(c=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===xe.timestamp&&(c=!1),c)return;const{layout:l,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(l||u))return;Be(this.layoutCorrected,this.layout.layoutBox);const d=this.treeScale.x,f=this.treeScale.y;_g(this.layoutCorrected,this.treeScale,this.path,a),i.layout&&!i.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(i.target=i.layout.layoutBox,i.targetWithTransforms=ge());const{target:p}=i;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Oa(this.prevProjectionDelta.x,this.projectionDelta.x),Oa(this.prevProjectionDelta.y,this.projectionDelta.y)),Pn(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==d||this.treeScale.y!==f||!Ka(this.projectionDelta.x,this.prevProjectionDelta.x)||!Ka(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(i=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),i){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=nn(),this.projectionDelta=nn(),this.projectionDeltaWithTransform=nn()}setAnimationOrigin(i,a=!1){const c=this.snapshot,l=c?c.latestValues:{},u={...this.latestValues},d=nn();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=ge(),p=c?c.source:void 0,x=this.layout?this.layout.source:void 0,g=p!==x,y=this.getStack(),v=!y||y.members.length<=1,w=!!(g&&!v&&this.options.crossfade===!0&&!this.path.some(By));this.animationProgress=0;let S;this.mixTargetDelta=C=>{const T=C/1e3;Ja(d.x,i.x,T),Ja(d.y,i.y,T),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Mr(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),_y(this.relativeTarget,this.relativeTargetOrigin,f,T),S&&py(this.relativeTarget,S)&&(this.isProjectionDirty=!1),S||(S=ge()),Be(S,this.relativeTarget)),g&&(this.animationValues=u,yy(u,l,this.latestValues,T,w,v)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=T},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(i){var a,c,l;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(l=(c=this.resumingFrom)==null?void 0:c.currentAnimation)==null||l.stop(),this.pendingAnimation&&(yt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=le.update(()=>{vr.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=an(0)),this.motionValue.jump(0,!1),this.currentAnimation=wy(this.motionValue,[0,1e3],{...i,velocity:0,isSync:!0,onUpdate:u=>{this.mixTargetDelta(u),i.onUpdate&&i.onUpdate(u)},onStop:()=>{},onComplete:()=>{i.onComplete&&i.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const i=this.getStack();i&&i.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Py),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const i=this.getLead();let{targetWithTransforms:a,target:c,layout:l,latestValues:u}=i;if(!(!a||!c||!l)){if(this!==i&&this.layout&&l&&Mu(this.options.animationType,this.layout.layoutBox,l.layoutBox)){c=this.target||ge();const d=Ae(this.layout.layoutBox.x);c.x.min=i.target.x.min,c.x.max=c.x.min+d;const f=Ae(this.layout.layoutBox.y);c.y.min=i.target.y.min,c.y.max=c.y.min+f}Be(a,c),gr(a,u),Pn(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(i,a){this.sharedNodes.has(i)||this.sharedNodes.set(i,new Ty),this.sharedNodes.get(i).add(a);const l=a.options.initialPromotionConfig;a.promote({transition:l?l.transition:void 0,preserveFollowOpacity:l&&l.shouldPreserveFollowOpacity?l.shouldPreserveFollowOpacity(a):void 0})}isLead(){const i=this.getStack();return i?i.lead===this:!0}getLead(){var a;const{layoutId:i}=this.options;return i?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:i}=this.options;return i?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:i}=this.options;if(i)return this.root.sharedNodes.get(i)}promote({needsReset:i,transition:a,preserveFollowOpacity:c}={}){const l=this.getStack();l&&l.promote(this,c),i&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const i=this.getStack();return i?i.relegate(this):!1}resetSkewAndRotation(){const{visualElement:i}=this.options;if(!i)return;let a=!1;const{latestValues:c}=i;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(a=!0),!a)return;const l={};c.z&&jo("z",i,l,this.animationValues);for(let u=0;u<Io.length;u++)jo(`rotate${Io[u]}`,i,l,this.animationValues),jo(`skew${Io[u]}`,i,l,this.animationValues);i.render();for(const u in l)i.setStaticValue(u,l[u]),this.animationValues&&(this.animationValues[u]=l[u]);i.scheduleRender()}applyProjectionStyles(i,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){i.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,i.visibility="",i.opacity="",i.pointerEvents=yr(a==null?void 0:a.pointerEvents)||"",i.transform=c?c(this.latestValues,""):"none";return}const l=this.getLead();if(!this.projectionDelta||!this.layout||!l.target){this.options.layoutId&&(i.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,i.pointerEvents=yr(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!It(this.latestValues)&&(i.transform=c?c({},""):"none",this.hasProjected=!1);return}i.visibility="";const u=l.animationValues||l.latestValues;this.applyTransformsToTarget();let d=my(this.projectionDeltaWithTransform,this.treeScale,u);c&&(d=c(u,d)),i.transform=d;const{x:f,y:p}=this.projectionDelta;i.transformOrigin=`${f.origin*100}% ${p.origin*100}% 0`,l.animationValues?i.opacity=l===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:i.opacity=l===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const x in As){if(u[x]===void 0)continue;const{correct:g,applyTo:y,isCSSVariable:v}=As[x],w=d==="none"?u[x]:g(u[x],l);if(y){const S=y.length;for(let C=0;C<S;C++)i[y[C]]=w}else v?this.options.visualElement.renderState.vars[x]=w:i[x]=w}this.options.layoutId&&(i.pointerEvents=l===this?yr(a==null?void 0:a.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(i=>{var a;return(a=i.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(qa),this.root.sharedNodes.clear()}}}function Ey(e){e.updateLayout()}function Ay(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:o}=e.layout,{animationType:s}=e.options,i=t.source!==e.layout.source;if(s==="size")qe(d=>{const f=i?t.measuredBox[d]:t.layoutBox[d],p=Ae(f);f.min=r[d].min,f.max=f.min+p});else if(s==="x"||s==="y"){const d=s==="x"?"y":"x";Ds(i?t.measuredBox[d]:t.layoutBox[d],r[d])}else Mu(s,t.layoutBox,r)&&qe(d=>{const f=i?t.measuredBox[d]:t.layoutBox[d],p=Ae(r[d]);f.max=f.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+p)});const a=nn();Pn(a,r,t.layoutBox);const c=nn();i?Pn(c,e.applyTransform(o,!0),t.measuredBox):Pn(c,r,t.layoutBox);const l=!Tu(a);let u=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:f,layout:p}=d;if(f&&p){const x=e.options.layoutAnchor||void 0,g=ge();Mr(g,t.layoutBox,f.layoutBox,x);const y=ge();Mr(y,r,p.layoutBox,x),Pu(g,y)||(u=!0),d.options.layoutRoot&&(e.relativeTarget=y,e.relativeTargetOrigin=g,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:c,layoutDelta:a,hasLayoutChanged:l,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function Dy(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function My(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function ky(e){e.clearSnapshot()}function qa(e){e.clearMeasurements()}function Ny(e){e.isLayoutDirty=!0,e.updateLayout()}function Za(e){e.isLayoutDirty=!1}function Iy(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function jy(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Qa(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Oy(e){e.resolveTargetDelta()}function Ly(e){e.calcProjection()}function Vy(e){e.resetSkewAndRotation()}function Fy(e){e.removeLeadSnapshot()}function Ja(e,t,n){e.translate=ue(t.translate,0,n),e.scale=ue(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function ec(e,t,n,r){e.min=ue(t.min,n.min,r),e.max=ue(t.max,n.max,r)}function _y(e,t,n,r){ec(e.x,t.x,n.x,r),ec(e.y,t.y,n.y,r)}function By(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const $y={duration:.45,ease:[.4,0,.1,1]},tc=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),nc=tc("applewebkit/")&&!tc("chrome/")?Math.round:_e;function rc(e){e.min=nc(e.min),e.max=nc(e.max)}function Wy(e){rc(e.x),rc(e.y)}function Mu(e,t,n){return e==="position"||e==="preserve-aspect"&&!ly(Ga(t),Ga(n),.2)}function Uy(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const Hy=Du({attachResizeListener:(e,t)=>Mn(e,"resize",t),measureScroll:()=>{var e,t;return{x:document.documentElement.scrollLeft||((e=document.body)==null?void 0:e.scrollLeft)||0,y:document.documentElement.scrollTop||((t=document.body)==null?void 0:t.scrollTop)||0}},checkIsScrollRoot:()=>!0}),Oo={current:void 0},ku=Du({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Oo.current){const e=new Hy({});e.mount(window),e.setOptions({layoutScroll:!0}),Oo.current=e}return Oo.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),xi=b.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function oc(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Gy(...e){return t=>{let n=!1;const r=e.map(o=>{const s=oc(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():oc(e[o],null)}}}}function Ky(...e){return m.useCallback(Gy(...e),e)}class zy extends m.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(fr(n)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,o=fr(r)&&r.offsetWidth||0,s=fr(r)&&r.offsetHeight||0,i=getComputedStyle(n),a=this.props.sizeRef.current;a.height=parseFloat(i.height),a.width=parseFloat(i.width),a.top=n.offsetTop,a.left=n.offsetLeft,a.right=o-a.width-a.left,a.bottom=s-a.height-a.top}return null}componentDidUpdate(){}render(){return this.props.children}}function Yy({children:e,isPresent:t,anchorX:n,anchorY:r,root:o,pop:s}){var f;const i=b.useId(),a=b.useRef(null),c=b.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:l}=b.useContext(xi),u=((f=e.props)==null?void 0:f.ref)??(e==null?void 0:e.ref),d=Ky(a,u);return b.useInsertionEffect(()=>{const{width:p,height:x,top:g,left:y,right:v,bottom:w}=c.current;if(t||s===!1||!a.current||!p||!x)return;const S=n==="left"?`left: ${y}`:`right: ${v}`,C=r==="bottom"?`bottom: ${w}`:`top: ${g}`;a.current.dataset.motionPopId=i;const T=document.createElement("style");l&&(T.nonce=l);const E=o??document.head;return E.appendChild(T),T.sheet&&T.sheet.insertRule(`
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),w=require("react"),Co=require("react-dom");function wu(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const p=wu(w),So=wu(Co);function _(...e){return e.filter(Boolean).join(" ")}const Fi=w.createContext({});function $i(e){const t=w.useRef(null);return t.current===null&&(t.current=e()),t.current}const hv=typeof window<"u",Cu=hv?w.useLayoutEffect:w.useEffect,Ro=w.createContext(null);function Bi(e,t){e.indexOf(t)===-1&&e.push(t)}function eo(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const ct=(e,t,n)=>n>t?t:n<e?e:n;function Hs(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let Rn=()=>{},ut=()=>{};var bu;typeof process<"u"&&((bu=process.env)==null?void 0:bu.NODE_ENV)!=="production"&&(Rn=(e,t,n)=>{!e&&typeof console<"u"&&console.warn(Hs(t,n))},ut=(e,t,n)=>{if(!e)throw new Error(Hs(t,n))});const Ct={},Su=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function Ru(e){return typeof e=="object"&&e!==null}const Tu=e=>/^0[^.\s]+$/u.test(e);function Pu(e){let t;return()=>(t===void 0&&(t=e()),t)}const Ge=e=>e,pv=(e,t)=>n=>t(e(n)),Qn=(...e)=>e.reduce(pv),Un=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class Wi{constructor(){this.subscriptions=[]}add(t){return Bi(this.subscriptions,t),()=>eo(this.subscriptions,t)}notify(t,n,r){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,n,r);else for(let s=0;s<o;s++){const i=this.subscriptions[s];i&&i(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const _e=e=>e*1e3,We=e=>e/1e3;function Eu(e,t){return t?e*(1e3/t):0}const yc=new Set;function Gi(e,t,n){e||yc.has(t)||(console.warn(Hs(t,n)),yc.add(t))}const Mu=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,mv=1e-7,gv=12;function vv(e,t,n,r,o){let s,i,a=0;do i=t+(n-t)/2,s=Mu(i,r,o)-e,s>0?n=i:t=i;while(Math.abs(s)>mv&&++a<gv);return i}function Jn(e,t,n,r){if(e===t&&n===r)return Ge;const o=s=>vv(s,0,1,e,n);return s=>s===0||s===1?s:Mu(o(s),t,r)}const Au=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Du=e=>t=>1-e(1-t),Nu=Jn(.33,1.53,.69,.99),Ui=Du(Nu),ju=Au(Ui),ku=e=>e>=1?1:(e*=2)<1?.5*Ui(e):.5*(2-Math.pow(2,-10*(e-1))),Ki=e=>1-Math.sin(Math.acos(e)),Iu=Du(Ki),_u=Au(Ki),yv=Jn(.42,0,1,1),xv=Jn(0,0,.58,1),Ou=Jn(.42,0,.58,1),bv=e=>Array.isArray(e)&&typeof e[0]!="number",Lu=e=>Array.isArray(e)&&typeof e[0]=="number",xc={linear:Ge,easeIn:yv,easeInOut:Ou,easeOut:xv,circIn:Ki,circInOut:_u,circOut:Iu,backIn:Ui,backInOut:ju,backOut:Nu,anticipate:ku},wv=e=>typeof e=="string",bc=e=>{if(Lu(e)){ut(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,r,o]=e;return Jn(t,n,r,o)}else if(wv(e))return ut(xc[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),xc[e];return e},Rr=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Cv(e,t){let n=new Set,r=new Set,o=!1,s=!1;const i=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function c(d){i.has(d)&&(u.schedule(d),e()),d(a)}const u={schedule:(d,f=!1,h=!1)=>{const y=h&&o?n:r;return f&&i.add(d),y.add(d),d},cancel:d=>{r.delete(d),i.delete(d)},process:d=>{if(a=d,o){s=!0;return}o=!0;const f=n;n=r,r=f,n.forEach(c),n.clear(),o=!1,s&&(s=!1,u.process(d))}};return u}const Sv=40;function Vu(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,i=Rr.reduce((C,S)=>(C[S]=Cv(s),C),{}),{setup:a,read:c,resolveKeyframes:u,preUpdate:d,update:f,preRender:h,render:m,postRender:y}=i,g=()=>{const C=Ct.useManualTiming,S=C?o.timestamp:performance.now();n=!1,C||(o.delta=r?1e3/60:Math.max(Math.min(S-o.timestamp,Sv),1)),o.timestamp=S,o.isProcessing=!0,a.process(o),c.process(o),u.process(o),d.process(o),f.process(o),h.process(o),m.process(o),y.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(g))},v=()=>{n=!0,r=!0,o.isProcessing||e(g)};return{schedule:Rr.reduce((C,S)=>{const R=i[S];return C[S]=(P,T=!1,A=!1)=>(n||v(),R.schedule(P,T,A)),C},{}),cancel:C=>{for(let S=0;S<Rr.length;S++)i[Rr[S]].cancel(C)},state:o,steps:i}}const{schedule:le,cancel:St,state:Re,steps:fs}=Vu(typeof requestAnimationFrame<"u"?requestAnimationFrame:Ge,!0);let Br;function Rv(){Br=void 0}const ke={now:()=>(Br===void 0&&ke.set(Re.isProcessing||Ct.useManualTiming?Re.timestamp:performance.now()),Br),set:e=>{Br=e,queueMicrotask(Rv)}},Fu=e=>t=>typeof t=="string"&&t.startsWith(e),$u=Fu("--"),Tv=Fu("var(--"),Hi=e=>Tv(e)?Pv.test(e.split("/*")[0].trim()):!1,Pv=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function wc(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const Tn={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Kn={...Tn,transform:e=>ct(0,1,e)},Tr={...Tn,default:1},Bn=e=>Math.round(e*1e5)/1e5,zi=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Ev(e){return e==null}const Mv=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Yi=(e,t)=>n=>!!(typeof n=="string"&&Mv.test(n)&&n.startsWith(e)||t&&!Ev(n)&&Object.prototype.hasOwnProperty.call(n,t)),Bu=(e,t,n)=>r=>{if(typeof r!="string")return r;const[o,s,i,a]=r.match(zi);return{[e]:parseFloat(o),[t]:parseFloat(s),[n]:parseFloat(i),alpha:a!==void 0?parseFloat(a):1}},Av=e=>ct(0,255,e),hs={...Tn,transform:e=>Math.round(Av(e))},Ut={test:Yi("rgb","red"),parse:Bu("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+hs.transform(e)+", "+hs.transform(t)+", "+hs.transform(n)+", "+Bn(Kn.transform(r))+")"};function Dv(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}const zs={test:Yi("#"),parse:Dv,transform:Ut.transform},er=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),vt=er("deg"),it=er("%"),Q=er("px"),Nv=er("vh"),jv=er("vw"),Cc={...it,parse:e=>it.parse(e)/100,transform:e=>it.transform(e*100)},fn={test:Yi("hsl","hue"),parse:Bu("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+it.transform(Bn(t))+", "+it.transform(Bn(n))+", "+Bn(Kn.transform(r))+")"},me={test:e=>Ut.test(e)||zs.test(e)||fn.test(e),parse:e=>Ut.test(e)?Ut.parse(e):fn.test(e)?fn.parse(e):zs.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ut.transform(e):fn.transform(e),getAnimatableNone:e=>{const t=me.parse(e);return t.alpha=0,me.transform(t)}},kv=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Iv(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(zi))==null?void 0:t.length)||0)+(((n=e.match(kv))==null?void 0:n.length)||0)>0}const Wu="number",Gu="color",_v="var",Ov="var(",Sc="${}",Lv=/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 xn(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let s=0;const a=t.replace(Lv,c=>(me.test(c)?(r.color.push(s),o.push(Gu),n.push(me.parse(c))):c.startsWith(Ov)?(r.var.push(s),o.push(_v),n.push(c)):(r.number.push(s),o.push(Wu),n.push(parseFloat(c))),++s,Sc)).split(Sc);return{values:n,split:a,indexes:r,types:o}}function Vv(e){return xn(e).values}function Uu({split:e,types:t}){const n=e.length;return r=>{let o="";for(let s=0;s<n;s++)if(o+=e[s],r[s]!==void 0){const i=t[s];i===Wu?o+=Bn(r[s]):i===Gu?o+=me.transform(r[s]):o+=r[s]}return o}}function Fv(e){return Uu(xn(e))}const $v=e=>typeof e=="number"?0:me.test(e)?me.getAnimatableNone(e):e,Bv=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:$v(e);function Wv(e){const t=xn(e);return Uu(t)(t.values.map((r,o)=>Bv(r,t.split[o])))}const Ye={test:Iv,parse:Vv,createTransformer:Fv,getAnimatableNone:Wv};function ps(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 Gv({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let o=0,s=0,i=0;if(!t)o=s=i=n;else{const a=n<.5?n*(1+t):n+t-n*t,c=2*n-a;o=ps(c,a,e+1/3),s=ps(c,a,e),i=ps(c,a,e-1/3)}return{red:Math.round(o*255),green:Math.round(s*255),blue:Math.round(i*255),alpha:r}}function to(e,t){return n=>n>0?t:e}const ue=(e,t,n)=>e+(t-e)*n,ms=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},Uv=[zs,Ut,fn],Kv=e=>Uv.find(t=>t.test(e));function Rc(e){const t=Kv(e);if(Rn(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let n=t.parse(e);return t===fn&&(n=Gv(n)),n}const Tc=(e,t)=>{const n=Rc(e),r=Rc(t);if(!n||!r)return to(e,t);const o={...n};return s=>(o.red=ms(n.red,r.red,s),o.green=ms(n.green,r.green,s),o.blue=ms(n.blue,r.blue,s),o.alpha=ue(n.alpha,r.alpha,s),Ut.transform(o))},Ys=new Set(["none","hidden"]);function Hv(e,t){return Ys.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function zv(e,t){return n=>ue(e,t,n)}function Xi(e){return typeof e=="number"?zv:typeof e=="string"?Hi(e)?to:me.test(e)?Tc:qv:Array.isArray(e)?Ku:typeof e=="object"?me.test(e)?Tc:Yv:to}function Ku(e,t){const n=[...e],r=n.length,o=e.map((s,i)=>Xi(s)(s,t[i]));return s=>{for(let i=0;i<r;i++)n[i]=o[i](s);return n}}function Yv(e,t){const n={...e,...t},r={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(r[o]=Xi(e[o])(e[o],t[o]));return o=>{for(const s in r)n[s]=r[s](o);return n}}function Xv(e,t){const n=[],r={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const s=t.types[o],i=e.indexes[s][r[s]],a=e.values[i]??0;n[o]=a,r[s]++}return n}const qv=(e,t)=>{const n=Ye.createTransformer(t),r=xn(e),o=xn(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?Ys.has(e)&&!o.values.length||Ys.has(t)&&!r.values.length?Hv(e,t):Qn(Ku(Xv(r,o),o.values),n):(Rn(!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.`,"complex-values-different"),to(e,t))};function Hu(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?ue(e,t,n):Xi(e)(e,t)}const Zv=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>le.update(t,n),stop:()=>St(t),now:()=>Re.isProcessing?Re.timestamp:ke.now()}},zu=(e,t,n=10)=>{let r="";const o=Math.max(Math.round(t/n),2);for(let s=0;s<o;s++)r+=Math.round(e(s/(o-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},no=2e4;function qi(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<no;)t+=n,r=e.next(t);return t>=no?1/0:t}function Qv(e,t=100,n){const r=n({...e,keyframes:[0,t]}),o=Math.min(qi(r),no);return{type:"keyframes",ease:s=>r.next(o*s).value/t,duration:We(o)}}const de={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};function Xs(e,t){return e*Math.sqrt(1-t*t)}const Jv=12;function ey(e,t,n){let r=n;for(let o=1;o<Jv;o++)r=r-e(r)/t(r);return r}const gs=.001;function ty({duration:e=de.duration,bounce:t=de.bounce,velocity:n=de.velocity,mass:r=de.mass}){let o,s;Rn(e<=_e(de.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let i=1-t;i=ct(de.minDamping,de.maxDamping,i),e=ct(de.minDuration,de.maxDuration,We(e)),i<1?(o=u=>{const d=u*i,f=d*e,h=d-n,m=Xs(u,i),y=Math.exp(-f);return gs-h/m*y},s=u=>{const f=u*i*e,h=f*n+n,m=Math.pow(i,2)*Math.pow(u,2)*e,y=Math.exp(-f),g=Xs(Math.pow(u,2),i);return(-o(u)+gs>0?-1:1)*((h-m)*y)/g}):(o=u=>{const d=Math.exp(-u*e),f=(u-n)*e+1;return-gs+d*f},s=u=>{const d=Math.exp(-u*e),f=(n-u)*(e*e);return d*f});const a=5/e,c=ey(o,s,a);if(e=_e(e),isNaN(c))return{stiffness:de.stiffness,damping:de.damping,duration:e};{const u=Math.pow(c,2)*r;return{stiffness:u,damping:i*2*Math.sqrt(r*u),duration:e}}}const ny=["duration","bounce"],ry=["stiffness","damping","mass"];function Pc(e,t){return t.some(n=>e[n]!==void 0)}function oy(e){let t={velocity:de.velocity,stiffness:de.stiffness,damping:de.damping,mass:de.mass,isResolvedFromDuration:!1,...e};if(!Pc(e,ry)&&Pc(e,ny))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),o=r*r,s=2*ct(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:de.mass,stiffness:o,damping:s}}else{const n=ty({...e,velocity:0});t={...t,...n,mass:de.mass},t.isResolvedFromDuration=!0}return t}function ro(e=de.visualDuration,t=de.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:o}=n;const s=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:s},{stiffness:c,damping:u,mass:d,duration:f,velocity:h,isResolvedFromDuration:m}=oy({...n,velocity:-We(n.velocity||0)}),y=h||0,g=u/(2*Math.sqrt(c*d)),v=i-s,x=We(Math.sqrt(c/d)),b=Math.abs(v)<5;r||(r=b?de.restSpeed.granular:de.restSpeed.default),o||(o=b?de.restDelta.granular:de.restDelta.default);let C,S,R,P,T,A;if(g<1)R=Xs(x,g),P=(y+g*x*v)/R,C=N=>{const L=Math.exp(-g*x*N);return i-L*(P*Math.sin(R*N)+v*Math.cos(R*N))},T=g*x*P+v*R,A=g*x*v-P*R,S=N=>Math.exp(-g*x*N)*(T*Math.sin(R*N)+A*Math.cos(R*N));else if(g===1){C=L=>i-Math.exp(-x*L)*(v+(y+x*v)*L);const N=y+x*v;S=L=>Math.exp(-x*L)*(x*N*L-y)}else{const N=x*Math.sqrt(g*g-1);C=F=>{const Z=Math.exp(-g*x*F),D=Math.min(N*F,300);return i-Z*((y+g*x*v)*Math.sinh(D)+N*v*Math.cosh(D))/N};const L=(y+g*x*v)/N,G=g*x*L-v*N,J=g*x*v-L*N;S=F=>{const Z=Math.exp(-g*x*F),D=Math.min(N*F,300);return Z*(G*Math.sinh(D)+J*Math.cosh(D))}}const k={calculatedDuration:m&&f||null,velocity:N=>_e(S(N)),next:N=>{if(!m&&g<1){const G=Math.exp(-g*x*N),J=Math.sin(R*N),F=Math.cos(R*N),Z=i-G*(P*J+v*F),D=_e(G*(T*J+A*F));return a.done=Math.abs(D)<=r&&Math.abs(i-Z)<=o,a.value=a.done?i:Z,a}const L=C(N);if(m)a.done=N>=f;else{const G=_e(S(N));a.done=Math.abs(G)<=r&&Math.abs(i-L)<=o}return a.value=a.done?i:L,a},toString:()=>{const N=Math.min(qi(k),no),L=zu(G=>k.next(N*G).value,N,30);return N+"ms "+L},toTransition:()=>{}};return k}ro.applyToOptions=e=>{const t=Qv(e,100,ro);return e.ease=t.ease,e.duration=_e(t.duration),e.type="keyframes",e};const sy=5;function Yu(e,t,n){const r=Math.max(t-sy,0);return Eu(n-e(r),t-r)}function qs({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:s=500,modifyTarget:i,min:a,max:c,restDelta:u=.5,restSpeed:d}){const f=e[0],h={done:!1,value:f},m=A=>a!==void 0&&A<a||c!==void 0&&A>c,y=A=>a===void 0?c:c===void 0||Math.abs(a-A)<Math.abs(c-A)?a:c;let g=n*t;const v=f+g,x=i===void 0?v:i(v);x!==v&&(g=x-f);const b=A=>-g*Math.exp(-A/r),C=A=>x+b(A),S=A=>{const k=b(A),N=C(A);h.done=Math.abs(k)<=u,h.value=h.done?x:N};let R,P;const T=A=>{m(h.value)&&(R=A,P=ro({keyframes:[h.value,y(h.value)],velocity:Yu(C,A,h.value),damping:o,stiffness:s,restDelta:u,restSpeed:d}))};return T(0),{calculatedDuration:null,next:A=>{let k=!1;return!P&&R===void 0&&(k=!0,S(A),T(A)),R!==void 0&&A>=R?P.next(A-R):(!k&&S(A),h)}}}function iy(e,t,n){const r=[],o=n||Ct.mix||Hu,s=e.length-1;for(let i=0;i<s;i++){let a=o(e[i],e[i+1]);if(t){const c=Array.isArray(t)?t[i]||Ge:t;a=Qn(c,a)}r.push(a)}return r}function ay(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const s=e.length;if(ut(s===t.length,"Both input and output ranges must be the same length","range-length"),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];const i=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=iy(t,r,o),c=a.length,u=d=>{if(i&&d<e[0])return t[0];let f=0;if(c>1)for(;f<e.length-2&&!(d<e[f+1]);f++);const h=Un(e[f],e[f+1],d);return a[f](h)};return n?d=>u(ct(e[0],e[s-1],d)):u}function cy(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=Un(0,t,r);e.push(ue(n,1,o))}}function ly(e){const t=[0];return cy(t,e.length-1),t}function uy(e,t){return e.map(n=>n*t)}function dy(e,t){return e.map(()=>t||Ou).splice(0,e.length-1)}function hn({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=bv(r)?r.map(bc):bc(r),s={done:!1,value:t[0]},i=uy(n&&n.length===t.length?n:ly(t),e),a=ay(i,t,{ease:Array.isArray(o)?o:dy(t,o)});return{calculatedDuration:e,next:c=>(s.value=a(c),s.done=c>=e,s)}}const fy=e=>e!==null;function To(e,{repeat:t,repeatType:n="loop"},r,o=1){const s=e.filter(fy),a=o<0||t&&n!=="loop"&&t%2===1?0:s.length-1;return!a||r===void 0?s[a]:r}const hy={decay:qs,inertia:qs,tween:hn,keyframes:hn,spring:ro};function Xu(e){typeof e.type=="string"&&(e.type=hy[e.type])}class Zi{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 py=e=>e/100;class oo extends Zi{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var r,o;const{motionValue:n}=this.options;n&&n.updatedAt!==ke.now()&&this.tick(ke.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(o=(r=this.options).onStop)==null||o.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;Xu(t);const{type:n=hn,repeat:r=0,repeatDelay:o=0,repeatType:s,velocity:i=0}=t;let{keyframes:a}=t;const c=n||hn;process.env.NODE_ENV!=="production"&&c!==hn&&ut(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),c!==hn&&typeof a[0]!="number"&&(this.mixKeyframes=Qn(py,Hu(a[0],a[1])),a=[0,100]);const u=c({...t,keyframes:a});s==="mirror"&&(this.mirroredGenerator=c({...t,keyframes:[...a].reverse(),velocity:-i})),u.calculatedDuration===null&&(u.calculatedDuration=qi(u));const{calculatedDuration:d}=u;this.calculatedDuration=d,this.resolvedDuration=d+o,this.totalDuration=this.resolvedDuration*(r+1)-o,this.generator=u}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:r,totalDuration:o,mixKeyframes:s,mirroredGenerator:i,resolvedDuration:a,calculatedDuration:c}=this;if(this.startTime===null)return r.next(0);const{delay:u=0,keyframes:d,repeat:f,repeatType:h,repeatDelay:m,type:y,onUpdate:g,finalKeyframe:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-o/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const x=this.currentTime-u*(this.playbackSpeed>=0?1:-1),b=this.playbackSpeed>=0?x<0:x>o;this.currentTime=Math.max(x,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let C=this.currentTime,S=r;if(f){const A=Math.min(this.currentTime,o)/a;let k=Math.floor(A),N=A%1;!N&&A>=1&&(N=1),N===1&&k--,k=Math.min(k,f+1),!!(k%2)&&(h==="reverse"?(N=1-N,m&&(N-=m/a)):h==="mirror"&&(S=i)),C=ct(0,1,N)*a}let R;b?(this.delayState.value=d[0],R=this.delayState):R=S.next(C),s&&!b&&(R.value=s(R.value));let{done:P}=R;!b&&c!==null&&(P=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);const T=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&P);return T&&y!==qs&&(R.value=To(d,this.options,v,this.speed)),g&&g(R.value),T&&this.finish(),R}then(t,n){return this.finished.then(t,n)}get duration(){return We(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+We(t)}get time(){return We(this.currentTime)}set time(t){t=_e(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),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const n=this.generator.next(t).value;return Yu(r=>this.generator.next(r).value,t,n)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(ke.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=We(this.currentTime))}play(){var o,s;if(this.isStopped)return;const{driver:t=Zv,startTime:n}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),(s=(o=this.options).onPlay)==null||s.call(o);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),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(ke.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 my(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Kt=e=>e*180/Math.PI,Zs=e=>{const t=Kt(Math.atan2(e[1],e[0]));return Qs(t)},gy={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Zs,rotateZ:Zs,skewX:e=>Kt(Math.atan(e[1])),skewY:e=>Kt(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Qs=e=>(e=e%360,e<0&&(e+=360),e),Ec=Zs,Mc=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Ac=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),vy={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Mc,scaleY:Ac,scale:e=>(Mc(e)+Ac(e))/2,rotateX:e=>Qs(Kt(Math.atan2(e[6],e[5]))),rotateY:e=>Qs(Kt(Math.atan2(-e[2],e[0]))),rotateZ:Ec,rotate:Ec,skewX:e=>Kt(Math.atan(e[4])),skewY:e=>Kt(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Js(e){return e.includes("scale")?1:0}function ei(e,t){if(!e||e==="none")return Js(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,o;if(n)r=vy,o=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=gy,o=a}if(!o)return Js(t);const s=r[t],i=o[1].split(",").map(xy);return typeof s=="function"?s(i):i[s]}const yy=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return ei(n,t)};function xy(e){return parseFloat(e.trim())}const Pn=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],En=new Set(Pn),Dc=e=>e===Tn||e===Q,by=new Set(["x","y","z"]),wy=Pn.filter(e=>!by.has(e));function Cy(e){const t=[];return wy.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const bt={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:r})=>{const o=e.max-e.min;return r==="border-box"?o:o-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:r})=>{const o=e.max-e.min;return r==="border-box"?o:o-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})=>ei(t,"x"),y:(e,{transform:t})=>ei(t,"y")};bt.translateX=bt.x;bt.translateY=bt.y;const Ht=new Set;let ti=!1,ni=!1,ri=!1;function qu(){if(ni){const e=Array.from(Ht).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const o=Cy(r);o.length&&(n.set(r,o),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const o=n.get(r);o&&o.forEach(([s,i])=>{var a;(a=r.getValue(s))==null||a.set(i)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}ni=!1,ti=!1,Ht.forEach(e=>e.complete(ri)),Ht.clear()}function Zu(){Ht.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(ni=!0)})}function Sy(){ri=!0,Zu(),qu(),ri=!1}class Qi{constructor(t,n,r,o,s,i=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=o,this.element=s,this.isAsync=i}scheduleResolve(){this.state="scheduled",this.isAsync?(Ht.add(this),ti||(ti=!0,le.read(Zu),le.resolveKeyframes(qu))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:o}=this;if(t[0]===null){const s=o==null?void 0:o.get(),i=t[t.length-1];if(s!==void 0)t[0]=s;else if(r&&n){const a=r.readValue(n,i);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=i),o&&s===void 0&&o.set(t[0])}my(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Ht.delete(this)}cancel(){this.state==="scheduled"&&(Ht.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Ry=e=>e.startsWith("--");function Qu(e,t,n){Ry(t)?e.style.setProperty(t,n):e.style[t]=n}const Ty={};function Ju(e,t){const n=Pu(e);return()=>Ty[t]??n()}const Py=Ju(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),ed=Ju(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Vn=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Nc={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Vn([0,.65,.55,1]),circOut:Vn([.55,0,1,.45]),backIn:Vn([.31,.01,.66,-.59]),backOut:Vn([.33,1.53,.69,.99])};function td(e,t){if(e)return typeof e=="function"?ed()?zu(e,t):"ease-out":Lu(e)?Vn(e):Array.isArray(e)?e.map(n=>td(n,t)||Nc.easeOut):Nc[e]}function Ey(e,t,n,{delay:r=0,duration:o=300,repeat:s=0,repeatType:i="loop",ease:a="easeOut",times:c}={},u=void 0){const d={[t]:n};c&&(d.offset=c);const f=td(a,o);Array.isArray(f)&&(d.easing=f);const h={delay:r,duration:o,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:s+1,direction:i==="reverse"?"alternate":"normal"};return u&&(h.pseudoElement=u),e.animate(d,h)}function nd(e){return typeof e=="function"&&"applyToOptions"in e}function My({type:e,...t}){return nd(e)&&ed()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class rd extends Zi{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:r,keyframes:o,pseudoElement:s,allowFlatten:i=!1,finalKeyframe:a,onComplete:c}=t;this.isPseudoElement=!!s,this.allowFlatten=i,this.options=t,ut(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const u=My(t);this.animation=Ey(n,r,o,u,s),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const d=To(o,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(d),Qu(n,r,d),this.animation.cancel()}c==null||c(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,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 n,r,o;const t=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((o=(r=this.animation).commitStyles)==null||o.call(r))}get duration(){var n,r;const t=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return We(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+We(t)}get time(){return We(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=_e(t),n&&this.animation.pause()}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 this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:n,rangeEnd:r,observe:o}){var s;return this.allowFlatten&&((s=this.animation.effect)==null||s.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&Py()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),Ge):o(this)}}const od={anticipate:ku,backInOut:ju,circInOut:_u};function Ay(e){return e in od}function Dy(e){typeof e.ease=="string"&&Ay(e.ease)&&(e.ease=od[e.ease])}const vs=10;class Ny extends rd{constructor(t){Dy(t),Xu(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:o,element:s,...i}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const a=new oo({...i,autoplay:!1}),c=Math.max(vs,ke.now()-this.startTime),u=ct(0,vs,c-vs),d=a.sample(c).value,{name:f}=this.options;s&&f&&Qu(s,f,d),n.setWithVelocity(a.sample(Math.max(0,c-u)).value,d,u),a.stop()}}const jc=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Ye.test(e)||e==="0")&&!e.startsWith("url("));function jy(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 ky(e,t,n,r){const o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;const s=e[e.length-1],i=jc(o,t),a=jc(s,t);return Rn(i===a,`You are trying to animate ${t} from "${o}" to "${s}". "${i?s:o}" is not an animatable value.`,"value-not-animatable"),!i||!a?!1:jy(e)||(n==="spring"||nd(n))&&r}function oi(e){e.duration=0,e.type="keyframes"}const sd=new Set(["opacity","clipPath","filter","transform"]),Iy=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function _y(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&Iy.test(e[t]))return!0;return!1}const Oy=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Ly=Pu(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Vy(e){var f;const{motionValue:t,name:n,repeatDelay:r,repeatType:o,damping:s,type:i,keyframes:a}=e;if(!(((f=t==null?void 0:t.owner)==null?void 0:f.current)instanceof HTMLElement))return!1;const{onUpdate:u,transformTemplate:d}=t.owner.getProps();return Ly()&&n&&(sd.has(n)||Oy.has(n)&&_y(a))&&(n!=="transform"||!d)&&!u&&!r&&o!=="mirror"&&s!==0&&i!=="inertia"}const Fy=40;class $y extends Zi{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:o=0,repeatDelay:s=0,repeatType:i="loop",keyframes:a,name:c,motionValue:u,element:d,...f}){var y;super(),this.stop=()=>{var g,v;this._animation&&(this._animation.stop(),(g=this.stopTimeline)==null||g.call(this)),(v=this.keyframeResolver)==null||v.cancel()},this.createdAt=ke.now();const h={autoplay:t,delay:n,type:r,repeat:o,repeatDelay:s,repeatType:i,name:c,motionValue:u,element:d,...f},m=(d==null?void 0:d.KeyframeResolver)||Qi;this.keyframeResolver=new m(a,(g,v,x)=>this.onKeyframesResolved(g,v,h,!x),c,u,d),(y=this.keyframeResolver)==null||y.scheduleResolve()}onKeyframesResolved(t,n,r,o){var x,b;this.keyframeResolver=void 0;const{name:s,type:i,velocity:a,delay:c,isHandoff:u,onUpdate:d}=r;this.resolvedAt=ke.now();let f=!0;ky(t,s,i,a)||(f=!1,(Ct.instantAnimations||!c)&&(d==null||d(To(t,r,n))),t[0]=t[t.length-1],oi(r),r.repeat=0);const m={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>Fy?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},y=f&&!u&&Vy(m),g=(b=(x=m.motionValue)==null?void 0:x.owner)==null?void 0:b.current;let v;if(y)try{v=new Ny({...m,element:g})}catch{v=new oo(m)}else v=new oo(m);v.finished.then(()=>{this.notifyFinished()}).catch(Ge),this.pendingTimeline&&(this.stopTimeline=v.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=v}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(),Sy()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}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()}}function id(e,t,n,r=0,o=1){const s=Array.from(e).sort((u,d)=>u.sortNodePosition(d)).indexOf(t),i=e.size,a=(i-1)*r;return typeof n=="function"?n(s,i):o===1?s*r:a-s*r}const By=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Wy(e){const t=By.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${n??r}`,o]}const Gy=4;function ad(e,t,n=1){ut(n<=Gy,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,o]=Wy(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const i=s.trim();return Su(i)?parseFloat(i):i}return Hi(o)?ad(o,t,n+1):o}const Uy={type:"spring",stiffness:500,damping:25,restSpeed:10},Ky=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Hy={type:"keyframes",duration:.8},zy={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Yy=(e,{keyframes:t})=>t.length>2?Hy:En.has(e)?e.startsWith("scale")?Ky(t[1]):Uy:zy;function cd(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function Ji(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?cd(n,e):n}const Xy=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function qy(e){for(const t in e)if(!Xy.has(t))return!0;return!1}const ea=(e,t,n,r={},o,s)=>i=>{const a=Ji(r,e)||{},c=a.delay||r.delay||0;let{elapsed:u=0}=r;u=u-_e(c);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-u,onUpdate:h=>{t.set(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{i(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:s?void 0:o};qy(a)||Object.assign(d,Yy(e,d)),d.duration&&(d.duration=_e(d.duration)),d.repeatDelay&&(d.repeatDelay=_e(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let f=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(oi(d),d.delay===0&&(f=!0)),(Ct.instantAnimations||Ct.skipAnimations||o!=null&&o.shouldSkipAnimations)&&(f=!0,oi(d),d.delay=0),d.allowFlatten=!a.type&&!a.ease,f&&!s&&t.get()!==void 0){const h=To(d.keyframes,a);if(h!==void 0){le.update(()=>{d.onUpdate(h),d.onComplete()});return}}return a.isSync?new oo(d):new $y(d)};function kc(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function ta(e,t,n,r){if(typeof t=="function"){const[o,s]=kc(r);t=t(n!==void 0?n:e.custom,o,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[o,s]=kc(r);t=t(n!==void 0?n:e.custom,o,s)}return t}function zt(e,t,n){const r=e.getProps();return ta(r,t,n!==void 0?n:r.custom,e)}const ld=new Set(["width","height","top","left","right","bottom",...Pn]),Ic=30,Zy=e=>!isNaN(parseFloat(e));class Qy{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var s;const o=ke.now();if(this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((s=this.events.change)==null||s.notify(this.current),this.dependents))for(const i of this.dependents)i.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=ke.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Zy(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&Gi(!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 Wi);const r=this.events[t].add(n);return t==="change"?()=>{r(),le.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}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=ke.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Ic)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Ic);return Eu(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 bn(e,t){return new Qy(e,t)}const si=e=>Array.isArray(e);function Jy(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,bn(n))}function ex(e){return si(e)?e[e.length-1]||0:e}function tx(e,t){const n=zt(e,t);let{transitionEnd:r={},transition:o={},...s}=n||{};s={...s,...r};for(const i in s){const a=ex(s[i]);Jy(e,i,a)}}const Te=e=>!!(e&&e.getVelocity);function nx(e){return!!(Te(e)&&e.add)}function ii(e,t){const n=e.getValue("willChange");if(nx(n))return n.add(t);if(!n&&Ct.WillChange){const r=new Ct.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function na(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const rx="framerAppearId",ud="data-"+na(rx);function dd(e){return e.props[ud]}function ox({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function fd(e,t,{delay:n=0,transitionOverride:r,type:o}={}){let{transition:s,transitionEnd:i,...a}=t;const c=e.getDefaultTransition();s=s?cd(s,c):c;const u=s==null?void 0:s.reduceMotion;r&&(s=r);const d=[],f=o&&e.animationState&&e.animationState.getState()[o];for(const h in a){const m=e.getValue(h,e.latestValues[h]??null),y=a[h];if(y===void 0||f&&ox(f,h))continue;const g={delay:n,...Ji(s||{},h)},v=m.get();if(v!==void 0&&!m.isAnimating()&&!Array.isArray(y)&&y===v&&!g.velocity){le.update(()=>m.set(y));continue}let x=!1;if(window.MotionHandoffAnimation){const S=dd(e);if(S){const R=window.MotionHandoffAnimation(S,h,le);R!==null&&(g.startTime=R,x=!0)}}ii(e,h);const b=u??e.shouldReduceMotion;m.start(ea(h,m,y,b&&ld.has(h)?{type:!1}:g,e,x));const C=m.animation;C&&d.push(C)}if(i){const h=()=>le.update(()=>{i&&tx(e,i)});d.length?Promise.all(d).then(h):h()}return d}function ai(e,t,n={}){var c;const r=zt(e,t,n.type==="exit"?(c=e.presenceContext)==null?void 0:c.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(o=n.transitionOverride);const s=r?()=>Promise.all(fd(e,r,n)):()=>Promise.resolve(),i=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:h}=o;return sx(e,t,u,d,f,h,n)}:()=>Promise.resolve(),{when:a}=o;if(a){const[u,d]=a==="beforeChildren"?[s,i]:[i,s];return u().then(()=>d())}else return Promise.all([s(),i(n.delay)])}function sx(e,t,n=0,r=0,o=0,s=1,i){const a=[];for(const c of e.variantChildren)c.notify("AnimationStart",t),a.push(ai(c,t,{...i,delay:n+(typeof r=="function"?0:r)+id(e.variantChildren,c,r,o,s)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(a)}function ix(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const o=t.map(s=>ai(e,s,n));r=Promise.all(o)}else if(typeof t=="string")r=ai(e,t,n);else{const o=typeof t=="function"?zt(e,t,n.custom):t;r=Promise.all(fd(e,o,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const ax={test:e=>e==="auto",parse:e=>e},hd=e=>t=>t.test(e),pd=[Tn,Q,it,vt,jv,Nv,ax],_c=e=>pd.find(hd(e));function cx(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Tu(e):!0}const lx=new Set(["brightness","contrast","saturate","opacity"]);function ux(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(zi)||[];if(!r)return e;const o=n.replace(r,"");let s=lx.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+o+")"}const dx=/\b([a-z-]*)\(.*?\)/gu,ci={...Ye,getAnimatableNone:e=>{const t=e.match(dx);return t?t.map(ux).join(" "):e}},li={...Ye,getAnimatableNone:e=>{const t=Ye.parse(e);return Ye.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},Oc={...Tn,transform:Math.round},fx={rotate:vt,rotateX:vt,rotateY:vt,rotateZ:vt,scale:Tr,scaleX:Tr,scaleY:Tr,scaleZ:Tr,skew:vt,skewX:vt,skewY:vt,distance:Q,translateX:Q,translateY:Q,translateZ:Q,x:Q,y:Q,z:Q,perspective:Q,transformPerspective:Q,opacity:Kn,originX:Cc,originY:Cc,originZ:Q},ra={borderWidth:Q,borderTopWidth:Q,borderRightWidth:Q,borderBottomWidth:Q,borderLeftWidth:Q,borderRadius:Q,borderTopLeftRadius:Q,borderTopRightRadius:Q,borderBottomRightRadius:Q,borderBottomLeftRadius:Q,width:Q,maxWidth:Q,height:Q,maxHeight:Q,top:Q,right:Q,bottom:Q,left:Q,inset:Q,insetBlock:Q,insetBlockStart:Q,insetBlockEnd:Q,insetInline:Q,insetInlineStart:Q,insetInlineEnd:Q,padding:Q,paddingTop:Q,paddingRight:Q,paddingBottom:Q,paddingLeft:Q,paddingBlock:Q,paddingBlockStart:Q,paddingBlockEnd:Q,paddingInline:Q,paddingInlineStart:Q,paddingInlineEnd:Q,margin:Q,marginTop:Q,marginRight:Q,marginBottom:Q,marginLeft:Q,marginBlock:Q,marginBlockStart:Q,marginBlockEnd:Q,marginInline:Q,marginInlineStart:Q,marginInlineEnd:Q,fontSize:Q,backgroundPositionX:Q,backgroundPositionY:Q,...fx,zIndex:Oc,fillOpacity:Kn,strokeOpacity:Kn,numOctaves:Oc},hx={...ra,color:me,backgroundColor:me,outlineColor:me,fill:me,stroke:me,borderColor:me,borderTopColor:me,borderRightColor:me,borderBottomColor:me,borderLeftColor:me,filter:ci,WebkitFilter:ci,mask:li,WebkitMask:li},md=e=>hx[e],px=new Set([ci,li]);function gd(e,t){let n=md(e);return px.has(n)||(n=Ye),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const mx=new Set(["auto","none","0"]);function gx(e,t,n){let r=0,o;for(;r<e.length&&!o;){const s=e[r];typeof s=="string"&&!mx.has(s)&&xn(s).values.length&&(o=e[r]),r++}if(o&&n)for(const s of t)e[s]=gd(n,o)}class vx extends Qi{constructor(t,n,r,o,s){super(t,n,r,o,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let d=0;d<t.length;d++){let f=t[d];if(typeof f=="string"&&(f=f.trim(),Hi(f))){const h=ad(f,n.current);h!==void 0&&(t[d]=h),d===t.length-1&&(this.finalKeyframe=f)}}if(this.resolveNoneKeyframes(),!ld.has(r)||t.length!==2)return;const[o,s]=t,i=_c(o),a=_c(s),c=wc(o),u=wc(s);if(c!==u&&bt[r]){this.needsMeasurement=!0;return}if(i!==a)if(Dc(i)&&Dc(a))for(let d=0;d<t.length;d++){const f=t[d];typeof f=="string"&&(t[d]=parseFloat(f))}else bt[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let o=0;o<t.length;o++)(t[o]===null||cx(t[o]))&&r.push(o);r.length&&gx(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=bt[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const o=n[n.length-1];o!==void 0&&t.getValue(r,o).jump(o,!1)}measureEndState(){var a;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const o=t.getValue(n);o&&o.jump(this.measuredOrigin,!1);const s=r.length-1,i=r[s];r[s]=bt[n](t.measureViewportBox(),window.getComputedStyle(t.current)),i!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=i),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([c,u])=>{t.getValue(c).set(u)}),this.resolveNoneKeyframes()}}function vd(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const o=(n==null?void 0:n[e])??r.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e).filter(r=>r!=null)}const yd=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Wr(e){return Ru(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:oa}=Vu(queueMicrotask,!1),He={x:!1,y:!1};function xd(){return He.x||He.y}function yx(e){return e==="x"||e==="y"?He[e]?null:(He[e]=!0,()=>{He[e]=!1}):He.x||He.y?null:(He.x=He.y=!0,()=>{He.x=He.y=!1})}function bd(e,t){const n=vd(e),r=new AbortController,o={passive:!0,...t,signal:r.signal};return[n,o,()=>r.abort()]}function xx(e){return!(e.pointerType==="touch"||xd())}function bx(e,t,n={}){const[r,o,s]=bd(e,n);return r.forEach(i=>{let a=!1,c=!1,u;const d=()=>{i.removeEventListener("pointerleave",y)},f=v=>{u&&(u(v),u=void 0),d()},h=v=>{a=!1,window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",h),c&&(c=!1,f(v))},m=()=>{a=!0,window.addEventListener("pointerup",h,o),window.addEventListener("pointercancel",h,o)},y=v=>{if(v.pointerType!=="touch"){if(a){c=!0;return}f(v)}},g=v=>{if(!xx(v))return;c=!1;const x=t(i,v);typeof x=="function"&&(u=x,i.addEventListener("pointerleave",y,o))};i.addEventListener("pointerenter",g,o),i.addEventListener("pointerdown",m,o)}),s}const wd=(e,t)=>t?e===t?!0:wd(e,t.parentElement):!1,sa=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,wx=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Cx(e){return wx.has(e.tagName)||e.isContentEditable===!0}const Sx=new Set(["INPUT","SELECT","TEXTAREA"]);function Rx(e){return Sx.has(e.tagName)||e.isContentEditable===!0}const Gr=new WeakSet;function Lc(e){return t=>{t.key==="Enter"&&e(t)}}function ys(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const Tx=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Lc(()=>{if(Gr.has(n))return;ys(n,"down");const o=Lc(()=>{ys(n,"up")}),s=()=>ys(n,"cancel");n.addEventListener("keyup",o,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function Vc(e){return sa(e)&&!xd()}const Fc=new WeakSet;function Px(e,t,n={}){const[r,o,s]=bd(e,n),i=a=>{const c=a.currentTarget;if(!Vc(a)||Fc.has(a))return;Gr.add(c),n.stopPropagation&&Fc.add(a);const u=t(c,a),d=(m,y)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),Gr.has(c)&&Gr.delete(c),Vc(m)&&typeof u=="function"&&u(m,{success:y})},f=m=>{d(m,c===window||c===document||n.useGlobalTarget||wd(c,m.target))},h=m=>{d(m,!1)};window.addEventListener("pointerup",f,o),window.addEventListener("pointercancel",h,o)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",i,o),Wr(a)&&(a.addEventListener("focus",u=>Tx(u,o)),!Cx(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),s}function ia(e){return Ru(e)&&"ownerSVGElement"in e}const Ur=new WeakMap;let yt;const Cd=(e,t,n)=>(r,o)=>o&&o[0]?o[0][e+"Size"]:ia(r)&&"getBBox"in r?r.getBBox()[t]:r[n],Ex=Cd("inline","width","offsetWidth"),Mx=Cd("block","height","offsetHeight");function Ax({target:e,borderBoxSize:t}){var n;(n=Ur.get(e))==null||n.forEach(r=>{r(e,{get width(){return Ex(e,t)},get height(){return Mx(e,t)}})})}function Dx(e){e.forEach(Ax)}function Nx(){typeof ResizeObserver>"u"||(yt=new ResizeObserver(Dx))}function jx(e,t){yt||Nx();const n=vd(e);return n.forEach(r=>{let o=Ur.get(r);o||(o=new Set,Ur.set(r,o)),o.add(t),yt==null||yt.observe(r)}),()=>{n.forEach(r=>{const o=Ur.get(r);o==null||o.delete(t),o!=null&&o.size||yt==null||yt.unobserve(r)})}}const Kr=new Set;let pn;function kx(){pn=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Kr.forEach(t=>t(e))},window.addEventListener("resize",pn)}function Ix(e){return Kr.add(e),pn||kx(),()=>{Kr.delete(e),!Kr.size&&typeof pn=="function"&&(window.removeEventListener("resize",pn),pn=void 0)}}function $c(e,t){return typeof e=="function"?Ix(e):jx(e,t)}function _x(e){return ia(e)&&e.tagName==="svg"}const Ox=[...pd,me,Ye],Lx=e=>Ox.find(hd(e)),Bc=()=>({translate:0,scale:1,origin:0,originPoint:0}),mn=()=>({x:Bc(),y:Bc()}),Wc=()=>({min:0,max:0}),ye=()=>({x:Wc(),y:Wc()}),Vx=new WeakMap;function Po(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Hn(e){return typeof e=="string"||Array.isArray(e)}const aa=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ca=["initial",...aa];function Eo(e){return Po(e.animate)||ca.some(t=>Hn(e[t]))}function Sd(e){return!!(Eo(e)||e.variants)}function Fx(e,t,n){for(const r in t){const o=t[r],s=n[r];if(Te(o))e.addValue(r,o);else if(Te(s))e.addValue(r,bn(o,{owner:e}));else if(s!==o)if(e.hasValue(r)){const i=e.getValue(r);i.liveStyle===!0?i.jump(o):i.hasAnimated||i.set(o)}else{const i=e.getStaticValue(r);e.addValue(r,bn(i!==void 0?i:o,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const ui={current:null},Rd={current:!1},$x=typeof window<"u";function Bx(){if(Rd.current=!0,!!$x)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>ui.current=e.matches;e.addEventListener("change",t),t()}else ui.current=!1}const Gc=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let so={};function Td(e){so=e}function Wx(){return so}class Gx{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:o,skipAnimations:s,blockInitialAnimation:i,visualState:a},c={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Qi,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,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 m=ke.now();this.renderScheduledAt<m&&(this.renderScheduledAt=m,le.render(this.render,!1,!0))};const{latestValues:u,renderState:d}=a;this.latestValues=u,this.baseTarget={...u},this.initialValues=n.initial?{...u}:{},this.renderState=d,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.skipAnimationsConfig=s,this.options=c,this.blockInitialAnimation=!!i,this.isControllingVariants=Eo(n),this.isVariantNode=Sd(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:f,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const m in h){const y=h[m];u[m]!==void 0&&Te(y)&&y.set(u[m])}}mount(t){var n,r;if(this.hasBeenMounted)for(const o in this.initialValues)(n=this.values.get(o))==null||n.jump(this.initialValues[o]),this.latestValues[o]=this.initialValues[o];this.current=t,Vx.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((o,s)=>this.bindToMotionValue(s,o)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Rd.current||Bx(),this.shouldReduceMotion=ui.current),process.env.NODE_ENV!=="production"&&Gi(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),St(this.notifyUpdate),St(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&sd.has(t)&&this.current instanceof HTMLElement){const{factory:i,keyframes:a,times:c,ease:u,duration:d}=n.accelerate,f=new rd({element:this.current,name:t,keyframes:a,times:c,ease:u,duration:_e(d)}),h=i(f);this.valueSubscriptions.set(t,()=>{h(),f.cancel()});return}const r=En.has(t);r&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",i=>{this.latestValues[t]=i,this.props.onUpdate&&le.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;typeof window<"u"&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{o(),s&&s(),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 so){const n=so[t];if(!n)continue;const{isEnabled:r,Feature:o}=n;if(!this.features[t]&&o&&r(this.props)&&(this.features[t]=new o(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ye()}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 r=0;r<Gc.length;r++){const o=Gc[r];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const s="on"+o,i=t[s];i&&(this.propEventSubscriptions[o]=this.on(o,i))}this.prevMotionValues=Fx(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 r=this.values.get(t);n!==r&&(r&&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 r=this.values.get(t);return r===void 0&&n!==void 0&&(r=bn(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(Su(r)||Tu(r))?r=parseFloat(r):!Lx(r)&&Ye.test(n)&&(r=gd(t,n)),this.setBaseTarget(t,Te(r)?r.get():r)),Te(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var s;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const i=ta(this.props,n,(s=this.presenceContext)==null?void 0:s.custom);i&&(r=i[t])}if(n&&r!==void 0)return r;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!Te(o)?o:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Wi),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){oa.render(this.render)}}class Pd extends Gx{constructor(){super(...arguments),this.KeyframeResolver=vx}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const r=t.style;return r?r[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Te(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Mt{constructor(t){this.isMounted=!1,this.node=t}update(){}}function Ed({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Ux({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Kx(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function xs(e){return e===void 0||e===1}function di({scale:e,scaleX:t,scaleY:n}){return!xs(e)||!xs(t)||!xs(n)}function Gt(e){return di(e)||Md(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Md(e){return Uc(e.x)||Uc(e.y)}function Uc(e){return e&&e!=="0%"}function io(e,t,n){const r=e-n,o=t*r;return n+o}function Kc(e,t,n,r,o){return o!==void 0&&(e=io(e,o,r)),io(e,n,r)+t}function fi(e,t=0,n=1,r,o){e.min=Kc(e.min,t,n,r,o),e.max=Kc(e.max,t,n,r,o)}function Ad(e,{x:t,y:n}){fi(e.x,t.translate,t.scale,t.originPoint),fi(e.y,n.translate,n.scale,n.originPoint)}const Hc=.999999999999,zc=1.0000000000001;function Hx(e,t,n,r=!1){var a;const o=n.length;if(!o)return;t.x=t.y=1;let s,i;for(let c=0;c<o;c++){s=n[c],i=s.projectionDelta;const{visualElement:u}=s.options;u&&u.props.style&&u.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&(rt(e.x,-s.scroll.offset.x),rt(e.y,-s.scroll.offset.y)),i&&(t.x*=i.x.scale,t.y*=i.y.scale,Ad(e,i)),r&&Gt(s.latestValues)&&Hr(e,s.latestValues,(a=s.layout)==null?void 0:a.layoutBox))}t.x<zc&&t.x>Hc&&(t.x=1),t.y<zc&&t.y>Hc&&(t.y=1)}function rt(e,t){e.min+=t,e.max+=t}function Yc(e,t,n,r,o=.5){const s=ue(e.min,e.max,o);fi(e,t,n,s,r)}function Xc(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function Hr(e,t,n){const r=n??e;Yc(e.x,Xc(t.x,r.x),t.scaleX,t.scale,t.originX),Yc(e.y,Xc(t.y,r.y),t.scaleY,t.scale,t.originY)}function Dd(e,t){return Ed(Kx(e.getBoundingClientRect(),t))}function zx(e,t,n){const r=Dd(e,n),{scroll:o}=t;return o&&(rt(r.x,o.offset.x),rt(r.y,o.offset.y)),r}const Yx={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Xx=Pn.length;function qx(e,t,n){let r="",o=!0;for(let s=0;s<Xx;s++){const i=Pn[s],a=e[i];if(a===void 0)continue;let c=!0;if(typeof a=="number")c=a===(i.startsWith("scale")?1:0);else{const u=parseFloat(a);c=i.startsWith("scale")?u===1:u===0}if(!c||n){const u=yd(a,ra[i]);if(!c){o=!1;const d=Yx[i]||i;r+=`${d}(${u}) `}n&&(t[i]=u)}}return r=r.trim(),n?r=n(t,o?"":r):o&&(r="none"),r}function la(e,t,n){const{style:r,vars:o,transformOrigin:s}=e;let i=!1,a=!1;for(const c in t){const u=t[c];if(En.has(c)){i=!0;continue}else if($u(c)){o[c]=u;continue}else{const d=yd(u,ra[c]);c.startsWith("origin")?(a=!0,s[c]=d):r[c]=d}}if(t.transform||(i||n?r.transform=qx(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:c="50%",originY:u="50%",originZ:d=0}=s;r.transformOrigin=`${c} ${u} ${d}`}}function Nd(e,{style:t,vars:n},r,o){const s=e.style;let i;for(i in t)s[i]=t[i];o==null||o.applyProjectionStyles(s,r);for(i in n)s.setProperty(i,n[i])}function qc(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const On={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Q.test(e))e=parseFloat(e);else return e;const n=qc(e,t.target.x),r=qc(e,t.target.y);return`${n}% ${r}%`}},Zx={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=Ye.parse(e);if(o.length>5)return r;const s=Ye.createTransformer(e),i=typeof o[0]!="number"?1:0,a=n.x.scale*t.x,c=n.y.scale*t.y;o[0+i]/=a,o[1+i]/=c;const u=ue(a,c,.5);return typeof o[2+i]=="number"&&(o[2+i]/=u),typeof o[3+i]=="number"&&(o[3+i]/=u),s(o)}},hi={borderRadius:{...On,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:On,borderTopRightRadius:On,borderBottomLeftRadius:On,borderBottomRightRadius:On,boxShadow:Zx};function jd(e,{layout:t,layoutId:n}){return En.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!hi[e]||e==="opacity")}function ua(e,t,n){var i;const r=e.style,o=t==null?void 0:t.style,s={};if(!r)return s;for(const a in r)(Te(r[a])||o&&Te(o[a])||jd(a,e)||((i=n==null?void 0:n.getValue(a))==null?void 0:i.liveStyle)!==void 0)&&(s[a]=r[a]);return s}function Qx(e){return window.getComputedStyle(e)}class Jx extends Pd{constructor(){super(...arguments),this.type="html",this.renderInstance=Nd}readValueFromInstance(t,n){var r;if(En.has(n))return(r=this.projection)!=null&&r.isProjecting?Js(n):yy(t,n);{const o=Qx(t),s=($u(n)?o.getPropertyValue(n):o[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Dd(t,n)}build(t,n,r){la(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return ua(t,n,r)}}const eb={offset:"stroke-dashoffset",array:"stroke-dasharray"},tb={offset:"strokeDashoffset",array:"strokeDasharray"};function nb(e,t,n=1,r=0,o=!0){e.pathLength=1;const s=o?eb:tb;e[s.offset]=`${-r}`,e[s.array]=`${t} ${n}`}const rb=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function kd(e,{attrX:t,attrY:n,attrScale:r,pathLength:o,pathSpacing:s=1,pathOffset:i=0,...a},c,u,d){if(la(e,a,u),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:h}=e;f.transform&&(h.transform=f.transform,delete f.transform),(h.transform||f.transformOrigin)&&(h.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),h.transform&&(h.transformBox=(d==null?void 0:d.transformBox)??"fill-box",delete f.transformBox);for(const m of rb)f[m]!==void 0&&(h[m]=f[m],delete f[m]);t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),o!==void 0&&nb(f,o,s,i,!1)}const Id=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"]),_d=e=>typeof e=="string"&&e.toLowerCase()==="svg";function ob(e,t,n,r){Nd(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(Id.has(o)?o:na(o),t.attrs[o])}function Od(e,t,n){const r=ua(e,t,n);for(const o in e)if(Te(e[o])||Te(t[o])){const s=Pn.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[s]=e[o]}return r}class sb extends Pd{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ye}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(En.has(n)){const r=md(n);return r&&r.default||0}return n=Id.has(n)?n:na(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return Od(t,n,r)}build(t,n,r){kd(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,o){ob(t,n,r,o)}mount(t){this.isSVGTag=_d(t.tagName),super.mount(t)}}const ib=ca.length;function Ld(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Ld(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<ib;n++){const r=ca[n],o=e.props[r];(Hn(o)||o===!1)&&(t[r]=o)}return t}function Vd(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const ab=[...aa].reverse(),cb=aa.length;function lb(e){return t=>Promise.all(t.map(({animation:n,options:r})=>ix(e,n,r)))}function ub(e){let t=lb(e),n=Zc(),r=!0,o=!1;const s=u=>(d,f)=>{var m;const h=zt(e,f,u==="exit"?(m=e.presenceContext)==null?void 0:m.custom:void 0);if(h){const{transition:y,transitionEnd:g,...v}=h;d={...d,...v,...g}}return d};function i(u){t=u(e)}function a(u){const{props:d}=e,f=Ld(e.parent)||{},h=[],m=new Set;let y={},g=1/0;for(let x=0;x<cb;x++){const b=ab[x],C=n[b],S=d[b]!==void 0?d[b]:f[b],R=Hn(S),P=b===u?C.isActive:null;P===!1&&(g=x);let T=S===f[b]&&S!==d[b]&&R;if(T&&(r||o)&&e.manuallyAnimateOnMount&&(T=!1),C.protectedKeys={...y},!C.isActive&&P===null||!S&&!C.prevProp||Po(S)||typeof S=="boolean")continue;if(b==="exit"&&C.isActive&&P!==!0){C.prevResolvedValues&&(y={...y,...C.prevResolvedValues});continue}const A=db(C.prevProp,S);let k=A||b===u&&C.isActive&&!T&&R||x>g&&R,N=!1;const L=Array.isArray(S)?S:[S];let G=L.reduce(s(b),{});P===!1&&(G={});const{prevResolvedValues:J={}}=C,F={...J,...G},Z=j=>{k=!0,m.has(j)&&(N=!0,m.delete(j)),C.needsAnimating[j]=!0;const O=e.getValue(j);O&&(O.liveStyle=!1)};for(const j in F){const O=G[j],ne=J[j];if(y.hasOwnProperty(j))continue;let W=!1;si(O)&&si(ne)?W=!Vd(O,ne):W=O!==ne,W?O!=null?Z(j):m.add(j):O!==void 0&&m.has(j)?Z(j):C.protectedKeys[j]=!0}C.prevProp=S,C.prevResolvedValues=G,C.isActive&&(y={...y,...G}),(r||o)&&e.blockInitialAnimation&&(k=!1);const D=T&&A;k&&(!D||N)&&h.push(...L.map(j=>{const O={type:b};if(typeof j=="string"&&(r||o)&&!D&&e.manuallyAnimateOnMount&&e.parent){const{parent:ne}=e,W=zt(ne,j);if(ne.enteringChildren&&W){const{delayChildren:M}=W.transition||{};O.delay=id(ne.enteringChildren,e,M)}}return{animation:j,options:O}}))}if(m.size){const x={};if(typeof d.initial!="boolean"){const b=zt(e,Array.isArray(d.initial)?d.initial[0]:d.initial);b&&b.transition&&(x.transition=b.transition)}m.forEach(b=>{const C=e.getBaseTarget(b),S=e.getValue(b);S&&(S.liveStyle=!0),x[b]=C??null}),h.push({animation:x})}let v=!!h.length;return r&&(d.initial===!1||d.initial===d.animate)&&!e.manuallyAnimateOnMount&&(v=!1),r=!1,o=!1,v?t(h):Promise.resolve()}function c(u,d){var h;if(n[u].isActive===d)return Promise.resolve();(h=e.variantChildren)==null||h.forEach(m=>{var y;return(y=m.animationState)==null?void 0:y.setActive(u,d)}),n[u].isActive=d;const f=a(u);for(const m in n)n[m].protectedKeys={};return f}return{animateChanges:a,setActive:c,setAnimateFunction:i,getState:()=>n,reset:()=>{n=Zc(),o=!0}}}function db(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Vd(t,e):!1}function Bt(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Zc(){return{animate:Bt(!0),whileInView:Bt(),whileHover:Bt(),whileTap:Bt(),whileDrag:Bt(),whileFocus:Bt(),exit:Bt()}}function pi(e,t){e.min=t.min,e.max=t.max}function Ke(e,t){pi(e.x,t.x),pi(e.y,t.y)}function Qc(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const Fd=1e-4,fb=1-Fd,hb=1+Fd,$d=.01,pb=0-$d,mb=0+$d;function Ie(e){return e.max-e.min}function gb(e,t,n){return Math.abs(e-t)<=n}function Jc(e,t,n,r=.5){e.origin=r,e.originPoint=ue(t.min,t.max,e.origin),e.scale=Ie(n)/Ie(t),e.translate=ue(n.min,n.max,e.origin)-e.originPoint,(e.scale>=fb&&e.scale<=hb||isNaN(e.scale))&&(e.scale=1),(e.translate>=pb&&e.translate<=mb||isNaN(e.translate))&&(e.translate=0)}function Wn(e,t,n,r){Jc(e.x,t.x,n.x,r?r.originX:void 0),Jc(e.y,t.y,n.y,r?r.originY:void 0)}function el(e,t,n,r=0){const o=r?ue(n.min,n.max,r):n.min;e.min=o+t.min,e.max=e.min+Ie(t)}function vb(e,t,n,r){el(e.x,t.x,n.x,r==null?void 0:r.x),el(e.y,t.y,n.y,r==null?void 0:r.y)}function tl(e,t,n,r=0){const o=r?ue(n.min,n.max,r):n.min;e.min=t.min-o,e.max=e.min+Ie(t)}function ao(e,t,n,r){tl(e.x,t.x,n.x,r==null?void 0:r.x),tl(e.y,t.y,n.y,r==null?void 0:r.y)}function nl(e,t,n,r,o){return e-=t,e=io(e,1/n,r),o!==void 0&&(e=io(e,1/o,r)),e}function yb(e,t=0,n=1,r=.5,o,s=e,i=e){if(it.test(t)&&(t=parseFloat(t),t=ue(i.min,i.max,t/100)-i.min),typeof t!="number")return;let a=ue(s.min,s.max,r);e===s&&(a-=t),e.min=nl(e.min,t,n,a,o),e.max=nl(e.max,t,n,a,o)}function rl(e,t,[n,r,o],s,i){yb(e,t[n],t[r],t[o],t.scale,s,i)}const xb=["x","scaleX","originX"],bb=["y","scaleY","originY"];function ol(e,t,n,r){rl(e.x,t,xb,n?n.x:void 0,r?r.x:void 0),rl(e.y,t,bb,n?n.y:void 0,r?r.y:void 0)}function sl(e){return e.translate===0&&e.scale===1}function Bd(e){return sl(e.x)&&sl(e.y)}function il(e,t){return e.min===t.min&&e.max===t.max}function wb(e,t){return il(e.x,t.x)&&il(e.y,t.y)}function al(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Wd(e,t){return al(e.x,t.x)&&al(e.y,t.y)}function cl(e){return Ie(e.x)/Ie(e.y)}function ll(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function tt(e){return[e("x"),e("y")]}function Cb(e,t,n){let r="";const o=e.x.translate/t.x,s=e.y.translate/t.y,i=(n==null?void 0:n.z)||0;if((o||s||i)&&(r=`translate3d(${o}px, ${s}px, ${i}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:f,rotateY:h,skewX:m,skewY:y}=n;u&&(r=`perspective(${u}px) ${r}`),d&&(r+=`rotate(${d}deg) `),f&&(r+=`rotateX(${f}deg) `),h&&(r+=`rotateY(${h}deg) `),m&&(r+=`skewX(${m}deg) `),y&&(r+=`skewY(${y}deg) `)}const a=e.x.scale*t.x,c=e.y.scale*t.y;return(a!==1||c!==1)&&(r+=`scale(${a}, ${c})`),r||"none"}const Gd=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],Sb=Gd.length,ul=e=>typeof e=="string"?parseFloat(e):e,dl=e=>typeof e=="number"||Q.test(e);function Rb(e,t,n,r,o,s){o?(e.opacity=ue(0,n.opacity??1,Tb(r)),e.opacityExit=ue(t.opacity??1,0,Pb(r))):s&&(e.opacity=ue(t.opacity??1,n.opacity??1,r));for(let i=0;i<Sb;i++){const a=Gd[i];let c=fl(t,a),u=fl(n,a);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||dl(c)===dl(u)?(e[a]=Math.max(ue(ul(c),ul(u),r),0),(it.test(u)||it.test(c))&&(e[a]+="%")):e[a]=u}(t.rotate||n.rotate)&&(e.rotate=ue(t.rotate||0,n.rotate||0,r))}function fl(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const Tb=Ud(0,.5,Iu),Pb=Ud(.5,.95,Ge);function Ud(e,t,n){return r=>r<e?0:r>t?1:n(Un(e,t,r))}function Eb(e,t,n){const r=Te(e)?e:bn(e);return r.start(ea("",r,t,n)),r.animation}function zn(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const Mb=(e,t)=>e.depth-t.depth;class Ab{constructor(){this.children=[],this.isDirty=!1}add(t){Bi(this.children,t),this.isDirty=!0}remove(t){eo(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Mb),this.isDirty=!1,this.children.forEach(t)}}function Db(e,t){const n=ke.now(),r=({timestamp:o})=>{const s=o-n;s>=t&&(St(r),e(s-t))};return le.setup(r,!0),()=>St(r)}function zr(e){return Te(e)?e.get():e}class Nb{constructor(){this.members=[]}add(t){Bi(this.members,t);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===t||r===this.lead||r===this.prevLead)continue;const o=r.instance;(!o||o.isConnected===!1)&&!r.snapshot&&(eo(this.members,r),r.unmount())}t.scheduleRender()}remove(t){if(eo(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){var n;for(let r=this.members.indexOf(t)-1;r>=0;r--){const o=this.members[r];if(o.isPresent!==!1&&((n=o.instance)==null?void 0:n.isConnected)!==!1)return this.promote(o),!0}return!1}promote(t,n){var o;const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.updateSnapshot(),t.scheduleRender();const{layoutDependency:s}=r.options,{layoutDependency:i}=t.options;(s===void 0||s!==i)&&(t.resumeFrom=r,n&&(r.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),(o=t.root)!=null&&o.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var n,r,o,s,i;(r=(n=t.options).onExitComplete)==null||r.call(n),(i=(o=t.resumingFrom)==null?void 0:(s=o.options).onExitComplete)==null||i.call(s)})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){var t;(t=this.lead)!=null&&t.snapshot&&(this.lead.snapshot=void 0)}}const Yr={hasAnimatedSinceResize:!0,hasEverUpdated:!1},bs=["","X","Y","Z"],jb=1e3;let kb=0;function ws(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Kd(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=dd(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",le,!(o||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Kd(r)}function Hd({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(i={},a=t==null?void 0:t()){this.id=kb++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Ob),this.nodes.forEach(Wb),this.nodes.forEach(Gb),this.nodes.forEach(Lb)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=i,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new Ab)}addEventListener(i,a){return this.eventHandlers.has(i)||this.eventHandlers.set(i,new Wi),this.eventHandlers.get(i).add(a)}notifyListeners(i,...a){const c=this.eventHandlers.get(i);c&&c.notify(...a)}hasListeners(i){return this.eventHandlers.has(i)}mount(i){if(this.instance)return;this.isSVG=ia(i)&&!_x(i),this.instance=i;const{layoutId:a,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(i),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||a)&&(this.isLayoutDirty=!0),e){let d,f=0;const h=()=>this.root.updateBlockedByResize=!1;le.read(()=>{f=window.innerWidth}),e(i,()=>{const m=window.innerWidth;m!==f&&(f=m,this.root.updateBlockedByResize=!0,d&&d(),d=Db(h,250),Yr.hasAnimatedSinceResize&&(Yr.hasAnimatedSinceResize=!1,this.nodes.forEach(ml)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&u&&(a||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeLayoutChanged:h,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||u.getDefaultTransition()||Yb,{onLayoutAnimationStart:g,onLayoutAnimationComplete:v}=u.getProps(),x=!this.targetLayout||!Wd(this.targetLayout,m),b=!f&&h;if(this.options.layoutRoot||this.resumeFrom||b||f&&(x||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const C={...Ji(y,"layout"),onPlay:g,onComplete:v};(u.shouldReduceMotion||this.options.layoutRoot)&&(C.delay=0,C.type=!1),this.startAnimation(C),this.setAnimationOrigin(d,b)}else f||ml(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=m})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const i=this.getStack();i&&i.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),St(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Ub),this.animationId++)}getTransformTemplate(){const{visualElement:i}=this.options;return i&&i.getProps().transformTemplate}willUpdate(i=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Kd(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const f=this.path[d];f.shouldResetTransform=!0,(typeof f.latestValues.x=="string"||typeof f.latestValues.y=="string")&&(f.isLayoutDirty=!0),f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:a,layout:c}=this.options;if(a===void 0&&!c)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),i&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const c=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),c&&this.nodes.forEach(Fb),this.nodes.forEach(hl);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(pl);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach($b),this.nodes.forEach(Bb),this.nodes.forEach(Ib),this.nodes.forEach(_b)):this.nodes.forEach(pl),this.clearAllSnapshots();const a=ke.now();Re.delta=ct(0,1e3/60,a-Re.timestamp),Re.timestamp=a,Re.isProcessing=!0,fs.update.process(Re),fs.preRender.process(Re),fs.render.process(Re),Re.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,oa.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Vb),this.sharedNodes.forEach(Kb)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,le.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){le.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Ie(this.snapshot.measuredBox.x)&&!Ie(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const i=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=ye()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,i?i.layoutBox:void 0)}updateScroll(i="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===i&&(a=!1),a&&this.instance){const c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:i,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!o)return;const i=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Bd(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;i&&this.instance&&(a||Gt(this.latestValues)||d)&&(o(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(i=!0){const a=this.measurePageBox();let c=this.removeElementScroll(a);return i&&(c=this.removeTransform(c)),Xb(c),{animationId:this.root.animationId,measuredBox:a,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:i}=this.options;if(!i)return ye();const a=i.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(qb))){const{scroll:d}=this.root;d&&(rt(a.x,d.offset.x),rt(a.y,d.offset.y))}return a}removeElementScroll(i){var c;const a=ye();if(Ke(a,i),(c=this.scroll)!=null&&c.wasRoot)return a;for(let u=0;u<this.path.length;u++){const d=this.path[u],{scroll:f,options:h}=d;d!==this.root&&f&&h.layoutScroll&&(f.wasRoot&&Ke(a,i),rt(a.x,f.offset.x),rt(a.y,f.offset.y))}return a}applyTransform(i,a=!1,c){var d,f;const u=c||ye();Ke(u,i);for(let h=0;h<this.path.length;h++){const m=this.path[h];!a&&m.options.layoutScroll&&m.scroll&&m!==m.root&&(rt(u.x,-m.scroll.offset.x),rt(u.y,-m.scroll.offset.y)),Gt(m.latestValues)&&Hr(u,m.latestValues,(d=m.layout)==null?void 0:d.layoutBox)}return Gt(this.latestValues)&&Hr(u,this.latestValues,(f=this.layout)==null?void 0:f.layoutBox),u}removeTransform(i){var c;const a=ye();Ke(a,i);for(let u=0;u<this.path.length;u++){const d=this.path[u];if(!Gt(d.latestValues))continue;let f;d.instance&&(di(d.latestValues)&&d.updateSnapshot(),f=ye(),Ke(f,d.measurePageBox())),ol(a,d.latestValues,(c=d.snapshot)==null?void 0:c.layoutBox,f)}return Gt(this.latestValues)&&ol(a,this.latestValues),a}setTargetDelta(i){this.targetDelta=i,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(i){this.options={...this.options,...i,crossfade:i.crossfade!==void 0?i.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Re.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(i=!1){var m;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==a;if(!(i||c&&this.isSharedProjectionDirty||this.isProjectionDirty||(m=this.parent)!=null&&m.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:f}=this.options;if(!this.layout||!(d||f))return;this.resolvedRelativeTargetAt=Re.timestamp;const h=this.getClosestProjectingParent();h&&this.linkedParentVersion!==h.layoutVersion&&!h.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&h&&h.layout?this.createRelativeTarget(h,this.layout.layoutBox,h.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=ye(),this.targetWithTransforms=ye()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),vb(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Ke(this.target,this.layout.layoutBox),Ad(this.target,this.targetDelta)):Ke(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&h&&!!h.resumingFrom==!!this.resumingFrom&&!h.options.layoutScroll&&h.target&&this.animationProgress!==1?this.createRelativeTarget(h,this.target,h.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||di(this.parent.latestValues)||Md(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(i,a,c){this.relativeParent=i,this.linkedParentVersion=i.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ye(),this.relativeTargetOrigin=ye(),ao(this.relativeTargetOrigin,a,c,this.options.layoutAnchor||void 0),Ke(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var y;const i=this.getLead(),a=!!this.resumingFrom||this!==i;let c=!0;if((this.isProjectionDirty||(y=this.parent)!=null&&y.isProjectionDirty)&&(c=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===Re.timestamp&&(c=!1),c)return;const{layout:u,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||d))return;Ke(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,h=this.treeScale.y;Hx(this.layoutCorrected,this.treeScale,this.path,a),i.layout&&!i.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(i.target=i.layout.layoutBox,i.targetWithTransforms=ye());const{target:m}=i;if(!m){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Qc(this.prevProjectionDelta.x,this.projectionDelta.x),Qc(this.prevProjectionDelta.y,this.projectionDelta.y)),Wn(this.projectionDelta,this.layoutCorrected,m,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==h||!ll(this.projectionDelta.x,this.prevProjectionDelta.x)||!ll(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",m))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(i=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),i){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=mn(),this.projectionDelta=mn(),this.projectionDeltaWithTransform=mn()}setAnimationOrigin(i,a=!1){const c=this.snapshot,u=c?c.latestValues:{},d={...this.latestValues},f=mn();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const h=ye(),m=c?c.source:void 0,y=this.layout?this.layout.source:void 0,g=m!==y,v=this.getStack(),x=!v||v.members.length<=1,b=!!(g&&!x&&this.options.crossfade===!0&&!this.path.some(zb));this.animationProgress=0;let C;this.mixTargetDelta=S=>{const R=S/1e3;gl(f.x,i.x,R),gl(f.y,i.y,R),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ao(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Hb(this.relativeTarget,this.relativeTargetOrigin,h,R),C&&wb(this.relativeTarget,C)&&(this.isProjectionDirty=!1),C||(C=ye()),Ke(C,this.relativeTarget)),g&&(this.animationValues=d,Rb(d,u,this.latestValues,R,b,x)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=R},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(i){var a,c,u;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(u=(c=this.resumingFrom)==null?void 0:c.currentAnimation)==null||u.stop(),this.pendingAnimation&&(St(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=le.update(()=>{Yr.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=bn(0)),this.motionValue.jump(0,!1),this.currentAnimation=Eb(this.motionValue,[0,1e3],{...i,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),i.onUpdate&&i.onUpdate(d)},onStop:()=>{},onComplete:()=>{i.onComplete&&i.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const i=this.getStack();i&&i.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(jb),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const i=this.getLead();let{targetWithTransforms:a,target:c,layout:u,latestValues:d}=i;if(!(!a||!c||!u)){if(this!==i&&this.layout&&u&&zd(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||ye();const f=Ie(this.layout.layoutBox.x);c.x.min=i.target.x.min,c.x.max=c.x.min+f;const h=Ie(this.layout.layoutBox.y);c.y.min=i.target.y.min,c.y.max=c.y.min+h}Ke(a,c),Hr(a,d),Wn(this.projectionDeltaWithTransform,this.layoutCorrected,a,d)}}registerSharedNode(i,a){this.sharedNodes.has(i)||this.sharedNodes.set(i,new Nb),this.sharedNodes.get(i).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const i=this.getStack();return i?i.lead===this:!0}getLead(){var a;const{layoutId:i}=this.options;return i?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:i}=this.options;return i?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:i}=this.options;if(i)return this.root.sharedNodes.get(i)}promote({needsReset:i,transition:a,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),i&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const i=this.getStack();return i?i.relegate(this):!1}resetSkewAndRotation(){const{visualElement:i}=this.options;if(!i)return;let a=!1;const{latestValues:c}=i;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(a=!0),!a)return;const u={};c.z&&ws("z",i,u,this.animationValues);for(let d=0;d<bs.length;d++)ws(`rotate${bs[d]}`,i,u,this.animationValues),ws(`skew${bs[d]}`,i,u,this.animationValues);i.render();for(const d in u)i.setStaticValue(d,u[d]),this.animationValues&&(this.animationValues[d]=u[d]);i.scheduleRender()}applyProjectionStyles(i,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){i.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,i.visibility="",i.opacity="",i.pointerEvents=zr(a==null?void 0:a.pointerEvents)||"",i.transform=c?c(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(i.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,i.pointerEvents=zr(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!Gt(this.latestValues)&&(i.transform=c?c({},""):"none",this.hasProjected=!1);return}i.visibility="";const d=u.animationValues||u.latestValues;this.applyTransformsToTarget();let f=Cb(this.projectionDeltaWithTransform,this.treeScale,d);c&&(f=c(d,f)),i.transform=f;const{x:h,y:m}=this.projectionDelta;i.transformOrigin=`${h.origin*100}% ${m.origin*100}% 0`,u.animationValues?i.opacity=u===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:i.opacity=u===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const y in hi){if(d[y]===void 0)continue;const{correct:g,applyTo:v,isCSSVariable:x}=hi[y],b=f==="none"?d[y]:g(d[y],u);if(v){const C=v.length;for(let S=0;S<C;S++)i[v[S]]=b}else x?this.options.visualElement.renderState.vars[y]=b:i[y]=b}this.options.layoutId&&(i.pointerEvents=u===this?zr(a==null?void 0:a.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(i=>{var a;return(a=i.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(hl),this.root.sharedNodes.clear()}}}function Ib(e){e.updateLayout()}function _b(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:o}=e.layout,{animationType:s}=e.options,i=t.source!==e.layout.source;if(s==="size")tt(f=>{const h=i?t.measuredBox[f]:t.layoutBox[f],m=Ie(h);h.min=r[f].min,h.max=h.min+m});else if(s==="x"||s==="y"){const f=s==="x"?"y":"x";pi(i?t.measuredBox[f]:t.layoutBox[f],r[f])}else zd(s,t.layoutBox,r)&&tt(f=>{const h=i?t.measuredBox[f]:t.layoutBox[f],m=Ie(r[f]);h.max=h.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+m)});const a=mn();Wn(a,r,t.layoutBox);const c=mn();i?Wn(c,e.applyTransform(o,!0),t.measuredBox):Wn(c,r,t.layoutBox);const u=!Bd(a);let d=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:m}=f;if(h&&m){const y=e.options.layoutAnchor||void 0,g=ye();ao(g,t.layoutBox,h.layoutBox,y);const v=ye();ao(v,r,m.layoutBox,y),Wd(g,v)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=v,e.relativeTargetOrigin=g,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:c,layoutDelta:a,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function Ob(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Lb(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Vb(e){e.clearSnapshot()}function hl(e){e.clearMeasurements()}function Fb(e){e.isLayoutDirty=!0,e.updateLayout()}function pl(e){e.isLayoutDirty=!1}function $b(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function Bb(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function ml(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Wb(e){e.resolveTargetDelta()}function Gb(e){e.calcProjection()}function Ub(e){e.resetSkewAndRotation()}function Kb(e){e.removeLeadSnapshot()}function gl(e,t,n){e.translate=ue(t.translate,0,n),e.scale=ue(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function vl(e,t,n,r){e.min=ue(t.min,n.min,r),e.max=ue(t.max,n.max,r)}function Hb(e,t,n,r){vl(e.x,t.x,n.x,r),vl(e.y,t.y,n.y,r)}function zb(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Yb={duration:.45,ease:[.4,0,.1,1]},yl=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),xl=yl("applewebkit/")&&!yl("chrome/")?Math.round:Ge;function bl(e){e.min=xl(e.min),e.max=xl(e.max)}function Xb(e){bl(e.x),bl(e.y)}function zd(e,t,n){return e==="position"||e==="preserve-aspect"&&!gb(cl(t),cl(n),.2)}function qb(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const Zb=Hd({attachResizeListener:(e,t)=>zn(e,"resize",t),measureScroll:()=>{var e,t;return{x:document.documentElement.scrollLeft||((e=document.body)==null?void 0:e.scrollLeft)||0,y:document.documentElement.scrollTop||((t=document.body)==null?void 0:t.scrollTop)||0}},checkIsScrollRoot:()=>!0}),Cs={current:void 0},Yd=Hd({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Cs.current){const e=new Zb({});e.mount(window),e.setOptions({layoutScroll:!0}),Cs.current=e}return Cs.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),da=w.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function wl(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Qb(...e){return t=>{let n=!1;const r=e.map(o=>{const s=wl(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():wl(e[o],null)}}}}function Jb(...e){return p.useCallback(Qb(...e),e)}class ew extends p.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(Wr(n)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,o=Wr(r)&&r.offsetWidth||0,s=Wr(r)&&r.offsetHeight||0,i=getComputedStyle(n),a=this.props.sizeRef.current;a.height=parseFloat(i.height),a.width=parseFloat(i.width),a.top=n.offsetTop,a.left=n.offsetLeft,a.right=o-a.width-a.left,a.bottom=s-a.height-a.top}return null}componentDidUpdate(){}render(){return this.props.children}}function tw({children:e,isPresent:t,anchorX:n,anchorY:r,root:o,pop:s}){var h;const i=w.useId(),a=w.useRef(null),c=w.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:u}=w.useContext(da),d=((h=e.props)==null?void 0:h.ref)??(e==null?void 0:e.ref),f=Jb(a,d);return w.useInsertionEffect(()=>{const{width:m,height:y,top:g,left:v,right:x,bottom:b}=c.current;if(t||s===!1||!a.current||!m||!y)return;const C=n==="left"?`left: ${v}`:`right: ${x}`,S=r==="bottom"?`bottom: ${b}`:`top: ${g}`;a.current.dataset.motionPopId=i;const R=document.createElement("style");u&&(R.nonce=u);const P=o??document.head;return P.appendChild(R),R.sheet&&R.sheet.insertRule(`
|
|
2
2
|
[data-motion-pop-id="${i}"] {
|
|
3
3
|
position: absolute !important;
|
|
4
|
-
width: ${
|
|
5
|
-
height: ${
|
|
6
|
-
${S}px !important;
|
|
4
|
+
width: ${m}px !important;
|
|
5
|
+
height: ${y}px !important;
|
|
7
6
|
${C}px !important;
|
|
7
|
+
${S}px !important;
|
|
8
8
|
}
|
|
9
|
-
`),()=>{var P;(P=a.current)==null||P.removeAttribute("data-motion-pop-id"),E.contains(T)&&E.removeChild(T)}},[t]),h.jsx(zy,{isPresent:t,childRef:a,sizeRef:c,pop:s,children:s===!1?e:m.cloneElement(e,{ref:d})})}const Xy=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:s,mode:i,anchorX:a,anchorY:c,root:l})=>{const u=Ys(qy),d=b.useId();let f=!0,p=b.useMemo(()=>(f=!1,{id:d,initial:t,isPresent:n,custom:o,onExitComplete:x=>{u.set(x,!0);for(const g of u.values())if(!g)return;r&&r()},register:x=>(u.set(x,!1),()=>u.delete(x))}),[n,u,r]);return s&&f&&(p={...p}),b.useMemo(()=>{u.forEach((x,g)=>u.set(g,!1))},[n]),m.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=h.jsx(Yy,{pop:i==="popLayout",isPresent:n,anchorX:a,anchorY:c,root:l,children:e}),h.jsx(Ur.Provider,{value:p,children:e})};function qy(){return new Map}function Nu(e=!0){const t=b.useContext(Ur);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=t,s=b.useId();b.useEffect(()=>{if(e)return o(s)},[e]);const i=b.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,i]:[!0]}const qn=e=>e.key||"";function sc(e){const t=[];return b.Children.forEach(e,n=>{b.isValidElement(n)&&t.push(n)}),t}const Iu=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:s="sync",propagate:i=!1,anchorX:a="left",anchorY:c="top",root:l})=>{const[u,d]=Nu(i),f=b.useMemo(()=>sc(e),[e]),p=i&&!u?[]:f.map(qn),x=b.useRef(!0),g=b.useRef(f),y=Ys(()=>new Map),v=b.useRef(new Set),[w,S]=b.useState(f),[C,T]=b.useState(f);sl(()=>{x.current=!1,g.current=f;for(let A=0;A<C.length;A++){const j=qn(C[A]);p.includes(j)?(y.delete(j),v.current.delete(j)):y.get(j)!==!0&&y.set(j,!1)}},[C,p.length,p.join("-")]);const E=[];if(f!==w){let A=[...f];for(let j=0;j<C.length;j++){const k=C[j],V=qn(k);p.includes(V)||(A.splice(j,0,k),E.push(k))}return s==="wait"&&E.length&&(A=E),T(sc(A)),S(f),null}process.env.NODE_ENV!=="production"&&s==="wait"&&C.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:P}=b.useContext(zs);return h.jsx(h.Fragment,{children:C.map(A=>{const j=qn(A),k=i&&!u?!1:f===C||p.includes(j),V=()=>{if(v.current.has(j))return;if(y.has(j))v.current.add(j),y.set(j,!0);else return;let H=!0;y.forEach(Y=>{Y||(H=!1)}),H&&(P==null||P(),T(g.current),i&&(d==null||d()),r&&r())};return h.jsx(Xy,{isPresent:k,initial:!x.current||n?void 0:!1,custom:t,presenceAffectsLayout:o,mode:s,root:l,onExitComplete:k?void 0:V,anchorX:a,anchorY:c,children:A},j)})})},ju=b.createContext({strict:!1}),ic={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"]};let ac=!1;function Zy(){if(ac)return;const e={};for(const t in ic)e[t]={isEnabled:n=>ic[t].some(r=>!!n[r])};cu(e),ac=!0}function Ou(){return Zy(),Og()}function Qy(e){const t=Ou();for(const n in e)t[n]={...t[n],...e[n]};cu(t)}const Jy=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","propagate","ignoreStrict","viewport"]);function kr(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Jy.has(e)}let Lu=e=>!kr(e);function ev(e){typeof e=="function"&&(Lu=t=>t.startsWith("on")?!kr(t):e(t))}try{ev(require("@emotion/is-prop-valid").default)}catch{}function tv(e,t,n){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||we(e[o])||(Lu(o)||n===!0&&kr(o)||!t&&!kr(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}const zr=b.createContext({});function nv(e,t){if(Kr(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Dn(n)?n:void 0,animate:Dn(r)?r:void 0}}return e.inherit!==!1?t:{}}function rv(e){const{initial:t,animate:n}=nv(e,b.useContext(zr));return b.useMemo(()=>({initial:t,animate:n}),[cc(t),cc(n)])}function cc(e){return Array.isArray(e)?e.join(" "):e}const wi=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Vu(e,t,n){for(const r in t)!we(t[r])&&!mu(r,n)&&(e[r]=t[r])}function ov({transformTemplate:e},t){return b.useMemo(()=>{const n=wi();return yi(n,t,e),Object.assign({},n.vars,n.style)},[t])}function sv(e,t){const n=e.style||{},r={};return Vu(r,n,e),Object.assign(r,ov(e,t)),r}function iv(e,t){const n={},r=sv(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.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=r,n}const Fu=()=>({...wi(),attrs:{}});function av(e,t,n,r){const o=b.useMemo(()=>{const s=Fu();return gu(s,t,vu(r),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};Vu(s,e.style,e),o.style={...s,...o.style}}return o}const cv=["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 bi(e){return typeof e!="string"||e.includes("-")?!1:!!(cv.indexOf(e)>-1||/[A-Z]/u.test(e))}function lv(e,t,n,{latestValues:r},o,s=!1,i){const c=(i??bi(e)?av:iv)(t,r,o,e),l=tv(t,typeof e=="string",s),u=e!==b.Fragment?{...l,...c,ref:n}:{},{children:d}=t,f=b.useMemo(()=>we(d)?d.get():d,[d]);return b.createElement(e,{...u,children:f})}function uv({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,o){return{latestValues:dv(n,r,o,e),renderState:t()}}function dv(e,t,n,r){const o={},s=r(e,{});for(const f in s)o[f]=yr(s[f]);let{initial:i,animate:a}=e;const c=Kr(e),l=iu(e);t&&l&&!c&&e.inherit!==!1&&(i===void 0&&(i=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||i===!1;const d=u?a:i;if(d&&typeof d!="boolean"&&!Gr(d)){const f=Array.isArray(d)?d:[d];for(let p=0;p<f.length;p++){const x=li(e,f[p]);if(x){const{transitionEnd:g,transition:y,...v}=x;for(const w in v){let S=v[w];if(Array.isArray(S)){const C=u?S.length-1:0;S=S[C]}S!==null&&(o[w]=S)}for(const w in g)o[w]=g[w]}}}return o}const _u=e=>(t,n)=>{const r=b.useContext(zr),o=b.useContext(Ur),s=()=>uv(e,t,r,o);return n?s():Ys(s)},fv=_u({scrapeMotionValuesFromProps:vi,createRenderState:wi}),hv=_u({scrapeMotionValuesFromProps:xu,createRenderState:Fu}),pv=Symbol.for("motionComponentSymbol");function mv(e,t,n){const r=b.useRef(n);b.useInsertionEffect(()=>{r.current=n});const o=b.useRef(null);return b.useCallback(s=>{var a;s&&((a=e.onMount)==null||a.call(e,s));const i=r.current;if(typeof i=="function")if(s){const c=i(s);typeof c=="function"&&(o.current=c)}else o.current?(o.current(),o.current=null):i(s);else i&&(i.current=s);t&&(s?t.mount(s):t.unmount())},[t])}const Bu=b.createContext({});function qt(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function gv(e,t,n,r,o,s){var S,C;const{visualElement:i}=b.useContext(zr),a=b.useContext(ju),c=b.useContext(Ur),l=b.useContext(xi),u=l.reducedMotion,d=l.skipAnimations,f=b.useRef(null),p=b.useRef(!1);r=r||a.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:i,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:s}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));const x=f.current,g=b.useContext(Bu);x&&!x.projection&&o&&(x.type==="html"||x.type==="svg")&&yv(f.current,n,o,g);const y=b.useRef(!1);b.useInsertionEffect(()=>{x&&y.current&&x.update(n,c)});const v=n[zl],w=b.useRef(!!v&&typeof window<"u"&&!((S=window.MotionHandoffIsComplete)!=null&&S.call(window,v))&&((C=window.MotionHasOptimisedAnimation)==null?void 0:C.call(window,v)));return sl(()=>{p.current=!0,x&&(y.current=!0,window.MotionIsMounted=!0,x.updateFeatures(),x.scheduleRenderMicrotask(),w.current&&x.animationState&&x.animationState.animateChanges())}),b.useEffect(()=>{x&&(!w.current&&x.animationState&&x.animationState.animateChanges(),w.current&&(queueMicrotask(()=>{var T;(T=window.MotionHandoffMarkAsComplete)==null||T.call(window,v)}),w.current=!1),x.enteringChildren=void 0)}),x}function yv(e,t,n,r){const{layoutId:o,layout:s,drag:i,dragConstraints:a,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:$u(e.parent)),e.projection.setOptions({layoutId:o,layout:s,alwaysMeasureLayout:!!i||a&&qt(a),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function $u(e){if(e)return e.options.allowProjection!==!1?e.projection:$u(e.parent)}function Lo(e,{forwardMotionProps:t=!1,type:n}={},r,o){r&&Qy(r);const s=n?n==="svg":bi(e),i=s?hv:fv;function a(l,u){let d;const f={...b.useContext(xi),...l,layoutId:vv(l)},{isStatic:p}=f,x=rv(l),g=i(l,p);if(!p&&typeof window<"u"){xv(f,r);const y=wv(f);d=y.MeasureLayout,x.visualElement=gv(e,g,f,o,y.ProjectionNode,s)}return h.jsxs(zr.Provider,{value:x,children:[d&&x.visualElement?h.jsx(d,{visualElement:x.visualElement,...f}):null,lv(e,l,mv(g,x.visualElement,u),g,p,t,s)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const c=b.forwardRef(a);return c[pv]=e,c}function vv({layoutId:e}){const t=b.useContext(zs).id;return t&&e!==void 0?t+"-"+e:e}function xv(e,t){const n=b.useContext(ju).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?dn(!1,r,"lazy-strict-mode"):st(!1,r,"lazy-strict-mode")}}function wv(e){const t=Ou(),{drag:n,layout:r}=t;if(!n&&!r)return{};const o={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(e)||r!=null&&r.isEnabled(e)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}function bv(e,t){if(typeof Proxy>"u")return Lo;const n=new Map,r=(s,i)=>Lo(s,i,e,t),o=(s,i)=>(process.env.NODE_ENV!=="production"&&Zs(!1,"motion() is deprecated. Use motion.create() instead."),r(s,i));return new Proxy(o,{get:(s,i)=>i==="create"?r:(n.has(i)||n.set(i,Lo(i,void 0,e,t)),n.get(i))})}const Sv=(e,t)=>t.isSVG??bi(e)?new Qg(t):new Kg(t,{allowProjection:e!==b.Fragment});class Cv extends St{constructor(t){super(t),t.animationState||(t.animationState=ry(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Gr(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 Tv=0;class Pv extends St{constructor(){super(...arguments),this.id=Tv++,this.isExitComplete=!1}update(){var s;if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;if(t&&r===!1){if(this.isExitComplete){const{initial:i,custom:a}=this.node.getProps();if(typeof i=="string"){const c=Vt(this.node,i,a);if(c){const{transition:l,transitionEnd:u,...d}=c;for(const f in d)(s=this.node.getValue(f))==null||s.jump(d[f])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const o=this.node.animationState.setActive("exit",!t);n&&!t&&o.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const Rv={animation:{Feature:Cv},exit:{Feature:Pv}};function On(e){return{point:{x:e.pageX,y:e.pageY}}}const Ev=e=>t=>hi(t)&&e(t,On(t));function Rn(e,t,n,r){return Mn(e,t,Ev(n),r)}const Wu=({current:e})=>e?e.ownerDocument.defaultView:null,lc=(e,t)=>Math.abs(e-t);function Av(e,t){const n=lc(e.x,t.x),r=lc(e.y,t.y);return Math.sqrt(n**2+r**2)}const uc=new Set(["auto","scroll"]);class Uu{constructor(t,n,{transformPagePoint:r,contextWindow:o=window,dragSnapToOrigin:s=!1,distanceThreshold:i=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=p=>{this.handleScroll(p.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Zn(this.lastRawMoveEventInfo,this.transformPagePoint));const p=Vo(this.lastMoveEventInfo,this.history),x=this.startEvent!==null,g=Av(p.offset,{x:0,y:0})>=this.distanceThreshold;if(!x&&!g)return;const{point:y}=p,{timestamp:v}=xe;this.history.push({...y,timestamp:v});const{onStart:w,onMove:S}=this.handlers;x||(w&&w(this.lastMoveEvent,p),this.startEvent=this.lastMoveEvent),S&&S(this.lastMoveEvent,p)},this.handlePointerMove=(p,x)=>{this.lastMoveEvent=p,this.lastRawMoveEventInfo=x,this.lastMoveEventInfo=Zn(x,this.transformPagePoint),le.update(this.updatePoint,!0)},this.handlePointerUp=(p,x)=>{this.end();const{onEnd:g,onSessionEnd:y,resumeAnimation:v}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&v&&v(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const w=Vo(p.type==="pointercancel"?this.lastMoveEventInfo:Zn(x,this.transformPagePoint),this.history);this.startEvent&&g&&g(p,w),y&&y(p,w)},!hi(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=i,this.contextWindow=o||window;const c=On(t),l=Zn(c,this.transformPagePoint),{point:u}=l,{timestamp:d}=xe;this.history=[{...u,timestamp:d}];const{onSessionStart:f}=n;f&&f(t,Vo(l,this.history)),this.removeListeners=Nn(Rn(this.contextWindow,"pointermove",this.handlePointerMove),Rn(this.contextWindow,"pointerup",this.handlePointerUp),Rn(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(uc.has(r.overflowX)||uc.has(r.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const r=t===window,o=r?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},s={x:o.x-n.x,y:o.y-n.y};s.x===0&&s.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s.x,this.lastMoveEventInfo.point.y+=s.y):this.history.length>0&&(this.history[0].x-=s.x,this.history[0].y-=s.y),this.scrollPositions.set(t,o),le.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),yt(this.updatePoint)}}function Zn(e,t){return t?{point:t(e.point)}:e}function dc(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Vo({point:e},t){return{point:e,delta:dc(e,Hu(t)),offset:dc(e,Dv(t)),velocity:Mv(t,.1)}}function Dv(e){return e[0]}function Hu(e){return e[e.length-1]}function Mv(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=Hu(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>De(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&o.timestamp-r.timestamp>De(t)*2&&(r=e[1]);const s=Fe(o.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const i={x:(o.x-r.x)/s,y:(o.y-r.y)/s};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function kv(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?ue(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?ue(n,e,r.max):Math.min(e,n)),e}function fc(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function Nv(e,{top:t,left:n,bottom:r,right:o}){return{x:fc(e.x,n,o),y:fc(e.y,t,r)}}function hc(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function Iv(e,t){return{x:hc(e.x,t.x),y:hc(e.y,t.y)}}function jv(e,t){let n=.5;const r=Ae(e),o=Ae(t);return o>r?n=En(t.min,t.max-r,e.min):r>o&&(n=En(e.min,e.max-o,t.min)),rt(0,1,n)}function Ov(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Ms=.35;function Lv(e=Ms){return e===!1?e=0:e===!0&&(e=Ms),{x:pc(e,"left","right"),y:pc(e,"top","bottom")}}function pc(e,t,n){return{min:mc(e,t),max:mc(e,n)}}function mc(e,t){return typeof e=="number"?e:e[t]||0}const Vv=new WeakMap;class Fv{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ge(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const s=d=>{n&&this.snapToCursor(On(d).point),this.stopAnimation()},i=(d,f)=>{const{drag:p,dragPropagation:x,onDragStart:g}=this.getProps();if(p&&!x&&(this.openDragLock&&this.openDragLock(),this.openDragLock=dg(p),!this.openDragLock))return;this.latestPointerEvent=d,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),qe(v=>{let w=this.getAxisMotionValue(v).get()||0;if(tt.test(w)){const{projection:S}=this.visualElement;if(S&&S.layout){const C=S.layout.layoutBox[v];C&&(w=Ae(C)*(parseFloat(w)/100))}}this.originPoint[v]=w}),g&&le.update(()=>g(d,f),!1,!0),bs(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},a=(d,f)=>{this.latestPointerEvent=d,this.latestPanInfo=f;const{dragPropagation:p,dragDirectionLock:x,onDirectionLock:g,onDrag:y}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:v}=f;if(x&&this.currentDirection===null){this.currentDirection=Bv(v),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",f.point,v),this.updateAxis("y",f.point,v),this.visualElement.render(),y&&le.update(()=>y(d,f),!1,!0)},c=(d,f)=>{this.latestPointerEvent=d,this.latestPanInfo=f,this.stop(d,f),this.latestPointerEvent=null,this.latestPanInfo=null},l=()=>{const{dragSnapToOrigin:d}=this.getProps();(d||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:u}=this.getProps();this.panSession=new Uu(t,{onSessionStart:s,onStart:i,onMove:a,onSessionEnd:c,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:r,contextWindow:Wu(this.visualElement),element:this.visualElement.current})}stop(t,n){const r=t||this.latestPointerEvent,o=n||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!o||!r)return;const{velocity:i}=o;this.startAnimation(i);const{onDragEnd:a}=this.getProps();a&&le.postRender(()=>a(r,o))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,r){const{drag:o}=this.getProps();if(!r||!Qn(t,o,this.currentDirection))return;const s=this.getAxisMotionValue(t);let i=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(i=kv(i,this.constraints[t],this.elastic[t])),s.set(i)}resolveConstraints(){var s;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(s=this.visualElement.projection)==null?void 0:s.layout,o=this.constraints;t&&qt(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=Nv(r.layoutBox,t):this.constraints=!1,this.elastic=Lv(n),o!==this.constraints&&!qt(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&qe(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=Ov(r.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!qt(t))return!1;const r=t.current;st(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const s=Bg(r,o.root,this.visualElement.getTransformPagePoint());let i=Iv(o.layout.layoutBox,s);if(n){const a=n(Vg(i));this.hasMutatedConstraints=!!a,a&&(i=uu(a))}return i}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:s,dragSnapToOrigin:i,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},l=qe(u=>{if(!Qn(u,n,this.currentDirection))return;let d=c&&c[u]||{};(i===!0||i===u)&&(d={min:0,max:0});const f=o?200:1e6,p=o?40:1e7,x={type:"inertia",velocity:r?t[u]:0,bounceStiffness:f,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...s,...d};return this.startAxisValueAnimation(u,x)});return Promise.all(l).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return bs(this.visualElement,t),r.start(ci(t,r,0,n,this.visualElement,!1))}stopAnimation(){qe(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),o=r[n];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){qe(n=>{const{drag:r}=this.getProps();if(!Qn(n,r,this.currentDirection))return;const{projection:o}=this.visualElement,s=this.getAxisMotionValue(n);if(o&&o.layout){const{min:i,max:a}=o.layout.layoutBox[n],c=s.get()||0;s.set(t[n]-ue(i,a,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!qt(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};qe(i=>{const a=this.getAxisMotionValue(i);if(a&&this.constraints!==!1){const c=a.get();o[i]=jv({min:c,max:c},this.constraints[i])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),qe(i=>{if(!Qn(i,t,null))return;const a=this.getAxisMotionValue(i),{min:c,max:l}=this.constraints[i];a.set(ue(c,l,o[i]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Vv.set(this.visualElement,this);const t=this.visualElement.current,n=Rn(t,"pointerdown",l=>{const{drag:u,dragListener:d=!0}=this.getProps(),f=l.target,p=f!==t&&yg(f);u&&d&&!p&&this.start(l)});let r;const o=()=>{const{dragConstraints:l}=this.getProps();qt(l)&&l.current&&(this.constraints=this.resolveRefConstraints(),r||(r=_v(t,l.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,i=s.addEventListener("measure",o);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),le.read(o);const a=Mn(window,"resize",()=>this.scalePositionWithinConstraints()),c=s.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(qe(d=>{const f=this.getAxisMotionValue(d);f&&(this.originPoint[d]+=l[d].translate,f.set(f.get()+l[d].translate))}),this.visualElement.render())}));return()=>{a(),n(),i(),c&&c(),r&&r()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:s=!1,dragElastic:i=Ms,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:s,dragElastic:i,dragMomentum:a}}}function gc(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function _v(e,t,n){const r=Ca(e,gc(n)),o=Ca(t,gc(n));return()=>{r(),o()}}function Qn(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Bv(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class $v extends St{constructor(t){super(t),this.removeGroupControls=_e,this.removeListeners=_e,this.controls=new Fv(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||_e}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Fo=e=>(t,n)=>{e&&le.update(()=>e(t,n),!1,!0)};class Wv extends St{constructor(){super(...arguments),this.removePointerDownListener=_e}onPointerDown(t){this.session=new Uu(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Wu(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:Fo(t),onStart:Fo(n),onMove:Fo(r),onEnd:(s,i)=>{delete this.session,o&&le.postRender(()=>o(s,i))}}}mount(){this.removePointerDownListener=Rn(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let _o=!1;class Uv extends b.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:s}=t;s&&(n.group&&n.group.add(s),r&&r.register&&o&&r.register(s),_o&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),vr.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:o,isPresent:s}=this.props,{projection:i}=r;return i&&(i.isPresent=s,t.layoutDependency!==n&&i.setOptions({...i.options,layoutDependency:n}),_o=!0,o||t.layoutDependency!==n||n===void 0||t.isPresent!==s?i.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?i.promote():i.relegate()||le.postRender(()=>{const a=i.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:n}=this.props,{projection:r}=t;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),fi.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=t;_o=!0,o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Gu(e){const[t,n]=Nu(),r=b.useContext(zs);return h.jsx(Uv,{...e,layoutGroup:r,switchLayoutGroup:b.useContext(Bu),isPresent:t,safeToRemove:n})}const Hv={pan:{Feature:Wv},drag:{Feature:$v,ProjectionNode:ku,MeasureLayout:Gu}};function yc(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,s=r[o];s&&le.postRender(()=>s(t,On(t)))}class Gv extends St{mount(){const{current:t}=this.node;t&&(this.unmount=hg(t,(n,r)=>(yc(this.node,r,"Start"),o=>yc(this.node,o,"End"))))}unmount(){}}class Kv extends St{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=Nn(Mn(this.node.current,"focus",()=>this.onFocus()),Mn(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function vc(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const o="onTap"+(n==="End"?"":n),s=r[o];s&&le.postRender(()=>s(t,On(t)))}class zv extends St{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=xg(t,(o,s)=>(vc(this.node,s,"Start"),(i,{success:a})=>vc(this.node,i,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const ks=new WeakMap,Bo=new WeakMap,Yv=e=>{const t=ks.get(e.target);t&&t(e)},Xv=e=>{e.forEach(Yv)};function qv({root:e,...t}){const n=e||document;Bo.has(n)||Bo.set(n,{});const r=Bo.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(Xv,{root:e,...t})),r[o]}function Zv(e,t,n){const r=qv(t);return ks.set(e,n),r.observe(e),()=>{ks.delete(e),r.unobserve(e)}}const Qv={some:0,all:1};class Jv extends St{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var c;(c=this.stopObserver)==null||c.call(this);const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:o="some",once:s}=t,i={root:n?n.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:Qv[o]},a=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,s&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:f}=this.node.getProps(),p=u?d:f;p&&p(l)};this.stopObserver=Zv(this.node.current,i,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(ex(t,n))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function ex({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const tx={inView:{Feature:Jv},tap:{Feature:zv},focus:{Feature:Kv},hover:{Feature:Gv}},nx={layout:{ProjectionNode:ku,MeasureLayout:Gu}},rx={...Rv,...tx,...Hv,...nx},Ku=bv(rx,Sv);function zu(){const[e,t]=b.useState([]),n=b.useRef(0),r=b.useCallback(s=>{const a=s.currentTarget.getBoundingClientRect(),c=Math.max(a.width,a.height)*2.2,l=s.clientX-a.left-c/2,u=s.clientY-a.top-c/2,d=n.current++;t(f=>[...f,{id:d,x:l,y:u,size:c}])},[]),o=b.useCallback(s=>{t(i=>i.filter(a=>a.id!==s))},[]);return{ripples:e,add:r,remove:o}}function Yu({ripples:e,onDone:t}){return h.jsx(Iu,{children:e.map(n=>h.jsx(Ku.span,{className:"btn-ripple",style:{left:n.x,top:n.y,width:n.size,height:n.size},initial:{scale:0,opacity:1},animate:{scale:1,opacity:[1,1,0]},transition:{scale:{duration:1,ease:[.4,0,.2,1]},opacity:{duration:1.2,times:[0,.6,1],ease:"easeOut"}},onAnimationComplete:()=>t(n.id)},n.id))})}const ox=()=>h.jsx("span",{className:"btn-spinner","aria-hidden":"true"}),Xu=b.forwardRef(function({variant:t="solid",color:n="primary",size:r,shape:o,block:s=!1,loading:i=!1,icon:a,iconPosition:c="start",disableRipple:l=!1,disabled:u,className:d,children:f,onClick:p,...x},g){const{ripples:y,add:v,remove:w}=zu(),S=u||i,C=A=>{S||(!l&&t!=="link"&&v(A),p==null||p(A))},T=$("btn",t,n!=="primary"&&n,r==="sm"||r==="lg"?r:null,o&&o!=="default"&&o,s&&"block",i&&"loading",d),E=i?h.jsx(ox,{}):c==="start"?a:null,P=!i&&c==="end"?a:null;return h.jsxs("button",{ref:g,className:T,onClick:C,disabled:S,"aria-busy":i||void 0,...x,children:[h.jsxs("span",{className:"btn-content",children:[E,f,P]}),!l&&t!=="link"&&h.jsx(Yu,{ripples:y,onDone:w})]})}),sx=b.forwardRef(function({orientation:t="horizontal",layout:n="attached",round:r=!1,className:o,children:s,...i},a){const c=$("btn-group",t==="vertical"&&"vertical",n==="spaced"&&"spaced",r&&"round",o);return h.jsx("div",{ref:a,className:c,role:"group",...i,children:s})}),ix=b.forwardRef(function({variant:t="solid",color:n="primary",size:r,position:o="static",disableRipple:s=!1,icon:i,label:a,open:c=!0,className:l,onClick:u,disabled:d,...f},p){const{ripples:x,add:g,remove:y}=zu(),v=C=>{d||(s||g(C),u==null||u(C))},w=a!=null,S=$("btn",t,n!=="primary"&&n,r==="sm"||r==="lg"?r:null,"fab",w&&"extended",o!=="static"&&`fixed-${o}`,l);return h.jsx(Iu,{children:c&&h.jsxs(Ku.button,{ref:p,type:"button",className:S,onClick:v,disabled:d,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:{type:"spring",stiffness:380,damping:26,mass:.9},...f,children:[h.jsxs("span",{className:"btn-content",children:[i,w&&a]}),!s&&h.jsx(Yu,{ripples:x,onDone:y})]})})}),ax=b.forwardRef(function({icon:t,shape:n="circle",variant:r="ghost",...o},s){return h.jsx(Xu,{ref:s,shape:n,variant:r,icon:t,...o})});function J(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}var Ce=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},cx=m[" useInsertionEffect ".trim().toString()]||Ce;function He({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,i]=lx({defaultProp:t,onChange:n}),a=e!==void 0,c=a?e:o;{const u=m.useRef(e!==void 0);m.useEffect(()=>{const d=u.current;d!==a&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=a},[a,r])}const l=m.useCallback(u=>{var d;if(a){const f=ux(u)?u(e):u;f!==e&&((d=i.current)==null||d.call(i,f))}else s(u)},[a,e,s,i]);return[c,l]}function lx({defaultProp:e,onChange:t}){const[n,r]=m.useState(e),o=m.useRef(n),s=m.useRef(t);return cx(()=>{s.current=t},[t]),m.useEffect(()=>{var i;o.current!==n&&((i=s.current)==null||i.call(s,n),o.current=n)},[n,o]),[n,r,s]}function ux(e){return typeof e=="function"}function xc(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ft(...e){return t=>{let n=!1;const r=e.map(o=>{const s=xc(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():xc(e[o],null)}}}}function re(...e){return m.useCallback(Ft(...e),e)}function cn(e){const t=dx(e),n=m.forwardRef((r,o)=>{const{children:s,...i}=r,a=m.Children.toArray(s),c=a.find(hx);if(c){const l=c.props.children,u=a.map(d=>d===c?m.Children.count(l)>1?m.Children.only(null):m.isValidElement(l)?l.props.children:null:d);return h.jsx(t,{...i,ref:o,children:m.isValidElement(l)?m.cloneElement(l,void 0,u):null})}return h.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function dx(e){const t=m.forwardRef((n,r)=>{const{children:o,...s}=n;if(m.isValidElement(o)){const i=mx(o),a=px(s,o.props);return o.type!==m.Fragment&&(a.ref=r?Ft(r,i):i),m.cloneElement(o,a)}return m.Children.count(o)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var fx=Symbol("radix.slottable");function hx(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===fx}function px(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function mx(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var gx=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],z=gx.reduce((e,t)=>{const n=cn(`Primitive.${t}`),r=m.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(c,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function yx(e,t){e&&Wr.flushSync(()=>e.dispatchEvent(t))}var qu="Toggle",Si=m.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r,onPressedChange:o,...s}=e,[i,a]=He({prop:n,onChange:o,defaultProp:r??!1,caller:qu});return h.jsx(z.button,{type:"button","aria-pressed":i,"data-state":i?"on":"off","data-disabled":e.disabled?"":void 0,...s,ref:t,onClick:J(e.onClick,()=>{e.disabled||a(!i)})})});Si.displayName=qu;var vx=Si;const xx=b.forwardRef(function({variant:t="ghost",color:n="primary",size:r,shape:o,icon:s,className:i,children:a,...c},l){const u=$("btn",t,n!=="primary"&&n,r==="sm"||r==="lg"?r:null,o&&o!=="default"&&o,i);return h.jsx(vx,{ref:l,className:u,...c,children:h.jsxs("span",{className:"btn-content",children:[s,a]})})});function wx(e,t){const n=m.createContext(t),r=s=>{const{children:i,...a}=s,c=m.useMemo(()=>a,Object.values(a));return h.jsx(n.Provider,{value:c,children:i})};r.displayName=e+"Provider";function o(s){const i=m.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,o]}function ze(e,t=[]){let n=[];function r(s,i){const a=m.createContext(i),c=n.length;n=[...n,i];const l=d=>{var v;const{scope:f,children:p,...x}=d,g=((v=f==null?void 0:f[e])==null?void 0:v[c])||a,y=m.useMemo(()=>x,Object.values(x));return h.jsx(g.Provider,{value:y,children:p})};l.displayName=s+"Provider";function u(d,f){var g;const p=((g=f==null?void 0:f[e])==null?void 0:g[c])||a,x=m.useContext(p);if(x)return x;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[l,u]}const o=()=>{const s=n.map(i=>m.createContext(i));return function(a){const c=(a==null?void 0:a[e])||s;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return o.scopeName=e,[r,bx(o,...t)]}function bx(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:c,scopeName:l})=>{const d=c(s)[`__scope${l}`];return{...a,...d}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function Zu(e){const t=e+"CollectionProvider",[n,r]=ze(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=g=>{const{scope:y,children:v}=g,w=b.useRef(null),S=b.useRef(new Map).current;return h.jsx(o,{scope:y,itemMap:S,collectionRef:w,children:v})};i.displayName=t;const a=e+"CollectionSlot",c=cn(a),l=b.forwardRef((g,y)=>{const{scope:v,children:w}=g,S=s(a,v),C=re(y,S.collectionRef);return h.jsx(c,{ref:C,children:w})});l.displayName=a;const u=e+"CollectionItemSlot",d="data-radix-collection-item",f=cn(u),p=b.forwardRef((g,y)=>{const{scope:v,children:w,...S}=g,C=b.useRef(null),T=re(y,C),E=s(u,v);return b.useEffect(()=>(E.itemMap.set(C,{ref:C,...S}),()=>void E.itemMap.delete(C))),h.jsx(f,{[d]:"",ref:T,children:w})});p.displayName=u;function x(g){const y=s(e+"CollectionConsumer",g);return b.useCallback(()=>{const w=y.collectionRef.current;if(!w)return[];const S=Array.from(w.querySelectorAll(`[${d}]`));return Array.from(y.itemMap.values()).sort((E,P)=>S.indexOf(E.ref.current)-S.indexOf(P.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:i,Slot:l,ItemSlot:p},x,r]}var Sx=m[" useId ".trim().toString()]||(()=>{}),Cx=0;function Me(e){const[t,n]=m.useState(Sx());return Ce(()=>{n(r=>r??String(Cx++))},[e]),e||(t?`radix-${t}`:"")}function vt(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var Tx=m.createContext(void 0);function Yr(e){const t=m.useContext(Tx);return e||t||"ltr"}var $o="rovingFocusGroup.onEntryFocus",Px={bubbles:!1,cancelable:!0},Ln="RovingFocusGroup",[Ns,Qu,Rx]=Zu(Ln),[Ex,Xr]=ze(Ln,[Rx]),[Ax,Dx]=Ex(Ln),Ju=m.forwardRef((e,t)=>h.jsx(Ns.Provider,{scope:e.__scopeRovingFocusGroup,children:h.jsx(Ns.Slot,{scope:e.__scopeRovingFocusGroup,children:h.jsx(Mx,{...e,ref:t})})}));Ju.displayName=Ln;var Mx=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=m.useRef(null),p=re(t,f),x=Yr(s),[g,y]=He({prop:i,defaultProp:a??null,onChange:c,caller:Ln}),[v,w]=m.useState(!1),S=vt(l),C=Qu(n),T=m.useRef(!1),[E,P]=m.useState(0);return m.useEffect(()=>{const A=f.current;if(A)return A.addEventListener($o,S),()=>A.removeEventListener($o,S)},[S]),h.jsx(Ax,{scope:n,orientation:r,dir:x,loop:o,currentTabStopId:g,onItemFocus:m.useCallback(A=>y(A),[y]),onItemShiftTab:m.useCallback(()=>w(!0),[]),onFocusableItemAdd:m.useCallback(()=>P(A=>A+1),[]),onFocusableItemRemove:m.useCallback(()=>P(A=>A-1),[]),children:h.jsx(z.div,{tabIndex:v||E===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:"none",...e.style},onMouseDown:J(e.onMouseDown,()=>{T.current=!0}),onFocus:J(e.onFocus,A=>{const j=!T.current;if(A.target===A.currentTarget&&j&&!v){const k=new CustomEvent($o,Px);if(A.currentTarget.dispatchEvent(k),!k.defaultPrevented){const V=C().filter(D=>D.focusable),H=V.find(D=>D.active),Y=V.find(D=>D.id===g),K=[H,Y,...V].filter(Boolean).map(D=>D.ref.current);nd(K,u)}}T.current=!1}),onBlur:J(e.onBlur,()=>w(!1))})})}),ed="RovingFocusGroupItem",td=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,children:i,...a}=e,c=Me(),l=s||c,u=Dx(ed,n),d=u.currentTabStopId===l,f=Qu(n),{onFocusableItemAdd:p,onFocusableItemRemove:x,currentTabStopId:g}=u;return m.useEffect(()=>{if(r)return p(),()=>x()},[r,p,x]),h.jsx(Ns.ItemSlot,{scope:n,id:l,focusable:r,active:o,children:h.jsx(z.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...a,ref:t,onMouseDown:J(e.onMouseDown,y=>{r?u.onItemFocus(l):y.preventDefault()}),onFocus:J(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:J(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){u.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const v=Ix(y,u.orientation,u.dir);if(v!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let S=f().filter(C=>C.focusable).map(C=>C.ref.current);if(v==="last")S.reverse();else if(v==="prev"||v==="next"){v==="prev"&&S.reverse();const C=S.indexOf(y.currentTarget);S=u.loop?jx(S,C+1):S.slice(C+1)}setTimeout(()=>nd(S))}}),children:typeof i=="function"?i({isCurrentTabStop:d,hasTabStop:g!=null}):i})})});td.displayName=ed;var kx={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Nx(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Ix(e,t,n){const r=Nx(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return kx[r]}function nd(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function jx(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var rd=Ju,od=td,Ct="ToggleGroup",[sd]=ze(Ct,[Xr]),id=Xr(),Ci=b.forwardRef((e,t)=>{const{type:n,...r}=e;if(n==="single"){const o=r;return h.jsx(Ox,{...o,ref:t})}if(n==="multiple"){const o=r;return h.jsx(Lx,{...o,ref:t})}throw new Error(`Missing prop \`type\` expected on \`${Ct}\``)});Ci.displayName=Ct;var[ad,cd]=sd(Ct),Ox=b.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...s}=e,[i,a]=He({prop:n,defaultProp:r??"",onChange:o,caller:Ct});return h.jsx(ad,{scope:e.__scopeToggleGroup,type:"single",value:b.useMemo(()=>i?[i]:[],[i]),onItemActivate:a,onItemDeactivate:b.useCallback(()=>a(""),[a]),children:h.jsx(ld,{...s,ref:t})})}),Lx=b.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...s}=e,[i,a]=He({prop:n,defaultProp:r??[],onChange:o,caller:Ct}),c=b.useCallback(u=>a((d=[])=>[...d,u]),[a]),l=b.useCallback(u=>a((d=[])=>d.filter(f=>f!==u)),[a]);return h.jsx(ad,{scope:e.__scopeToggleGroup,type:"multiple",value:i,onItemActivate:c,onItemDeactivate:l,children:h.jsx(ld,{...s,ref:t})})});Ci.displayName=Ct;var[Vx,Fx]=sd(Ct),ld=b.forwardRef((e,t)=>{const{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:o=!0,orientation:s,dir:i,loop:a=!0,...c}=e,l=id(n),u=Yr(i),d={role:"group",dir:u,...c};return h.jsx(Vx,{scope:n,rovingFocus:o,disabled:r,children:o?h.jsx(rd,{asChild:!0,...l,orientation:s,dir:u,loop:a,children:h.jsx(z.div,{...d,ref:t})}):h.jsx(z.div,{...d,ref:t})})}),Nr="ToggleGroupItem",ud=b.forwardRef((e,t)=>{const n=cd(Nr,e.__scopeToggleGroup),r=Fx(Nr,e.__scopeToggleGroup),o=id(e.__scopeToggleGroup),s=n.value.includes(e.value),i=r.disabled||e.disabled,a={...e,pressed:s,disabled:i},c=b.useRef(null);return r.rovingFocus?h.jsx(od,{asChild:!0,...o,focusable:!i,active:s,ref:c,children:h.jsx(wc,{...a,ref:t})}):h.jsx(wc,{...a,ref:t})});ud.displayName=Nr;var wc=b.forwardRef((e,t)=>{const{__scopeToggleGroup:n,value:r,...o}=e,s=cd(Nr,n),i={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},a=s.type==="single"?i:void 0;return h.jsx(Si,{...a,...o,ref:t,onPressedChange:c=>{c?s.onItemActivate(r):s.onItemDeactivate(r)}})}),_x=Ci,Bx=ud;const dd=b.createContext({variant:"outline",color:"primary"}),$x=b.forwardRef(function({variant:t="outline",color:n="primary",size:r,layout:o="attached",round:s=!1,className:i,children:a,...c},l){const u=$("btn-group",o==="spaced"&&"spaced",s&&"round",i);return h.jsx(dd.Provider,{value:{variant:t,color:n,size:r},children:h.jsx(_x,{ref:l,className:u,...c,children:a})})}),Wx=b.forwardRef(function({icon:t,shape:n,className:r,children:o,...s},i){const{variant:a,color:c,size:l}=b.useContext(dd),u=$("btn",a,c!=="primary"&&c,l==="sm"||l==="lg"?l:null,n&&n!=="default"&&n,r);return h.jsx(Bx,{ref:i,className:u,...s,children:h.jsxs("span",{className:"btn-content",children:[t,o]})})});/**
|
|
9
|
+
`),()=>{var T;(T=a.current)==null||T.removeAttribute("data-motion-pop-id"),P.contains(R)&&P.removeChild(R)}},[t]),l.jsx(ew,{isPresent:t,childRef:a,sizeRef:c,pop:s,children:s===!1?e:p.cloneElement(e,{ref:f})})}const nw=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:s,mode:i,anchorX:a,anchorY:c,root:u})=>{const d=$i(rw),f=w.useId();let h=!0,m=w.useMemo(()=>(h=!1,{id:f,initial:t,isPresent:n,custom:o,onExitComplete:y=>{d.set(y,!0);for(const g of d.values())if(!g)return;r&&r()},register:y=>(d.set(y,!1),()=>d.delete(y))}),[n,d,r]);return s&&h&&(m={...m}),w.useMemo(()=>{d.forEach((y,g)=>d.set(g,!1))},[n]),p.useEffect(()=>{!n&&!d.size&&r&&r()},[n]),e=l.jsx(tw,{pop:i==="popLayout",isPresent:n,anchorX:a,anchorY:c,root:u,children:e}),l.jsx(Ro.Provider,{value:m,children:e})};function rw(){return new Map}function Xd(e=!0){const t=w.useContext(Ro);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=t,s=w.useId();w.useEffect(()=>{if(e)return o(s)},[e]);const i=w.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,i]:[!0]}const Pr=e=>e.key||"";function Cl(e){const t=[];return w.Children.forEach(e,n=>{w.isValidElement(n)&&t.push(n)}),t}const qd=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:s="sync",propagate:i=!1,anchorX:a="left",anchorY:c="top",root:u})=>{const[d,f]=Xd(i),h=w.useMemo(()=>Cl(e),[e]),m=i&&!d?[]:h.map(Pr),y=w.useRef(!0),g=w.useRef(h),v=$i(()=>new Map),x=w.useRef(new Set),[b,C]=w.useState(h),[S,R]=w.useState(h);Cu(()=>{y.current=!1,g.current=h;for(let A=0;A<S.length;A++){const k=Pr(S[A]);m.includes(k)?(v.delete(k),x.current.delete(k)):v.get(k)!==!0&&v.set(k,!1)}},[S,m.length,m.join("-")]);const P=[];if(h!==b){let A=[...h];for(let k=0;k<S.length;k++){const N=S[k],L=Pr(N);m.includes(L)||(A.splice(k,0,N),P.push(N))}return s==="wait"&&P.length&&(A=P),R(Cl(A)),C(h),null}process.env.NODE_ENV!=="production"&&s==="wait"&&S.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:T}=w.useContext(Fi);return l.jsx(l.Fragment,{children:S.map(A=>{const k=Pr(A),N=i&&!d?!1:h===S||m.includes(k),L=()=>{if(x.current.has(k))return;if(v.has(k))x.current.add(k),v.set(k,!0);else return;let G=!0;v.forEach(J=>{J||(G=!1)}),G&&(T==null||T(),R(g.current),i&&(f==null||f()),r&&r())};return l.jsx(nw,{isPresent:N,initial:!y.current||n?void 0:!1,custom:t,presenceAffectsLayout:o,mode:s,root:u,onExitComplete:N?void 0:L,anchorX:a,anchorY:c,children:A},k)})})},Zd=w.createContext({strict:!1}),Sl={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"]};let Rl=!1;function ow(){if(Rl)return;const e={};for(const t in Sl)e[t]={isEnabled:n=>Sl[t].some(r=>!!n[r])};Td(e),Rl=!0}function Qd(){return ow(),Wx()}function sw(e){const t=Qd();for(const n in e)t[n]={...t[n],...e[n]};Td(t)}const iw=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","propagate","ignoreStrict","viewport"]);function co(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||iw.has(e)}let Jd=e=>!co(e);function aw(e){typeof e=="function"&&(Jd=t=>t.startsWith("on")?!co(t):e(t))}try{aw(require("@emotion/is-prop-valid").default)}catch{}function cw(e,t,n){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||Te(e[o])||(Jd(o)||n===!0&&co(o)||!t&&!co(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}const Mo=w.createContext({});function lw(e,t){if(Eo(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Hn(n)?n:void 0,animate:Hn(r)?r:void 0}}return e.inherit!==!1?t:{}}function uw(e){const{initial:t,animate:n}=lw(e,w.useContext(Mo));return w.useMemo(()=>({initial:t,animate:n}),[Tl(t),Tl(n)])}function Tl(e){return Array.isArray(e)?e.join(" "):e}const fa=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function ef(e,t,n){for(const r in t)!Te(t[r])&&!jd(r,n)&&(e[r]=t[r])}function dw({transformTemplate:e},t){return w.useMemo(()=>{const n=fa();return la(n,t,e),Object.assign({},n.vars,n.style)},[t])}function fw(e,t){const n=e.style||{},r={};return ef(r,n,e),Object.assign(r,dw(e,t)),r}function hw(e,t){const n={},r=fw(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.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=r,n}const tf=()=>({...fa(),attrs:{}});function pw(e,t,n,r){const o=w.useMemo(()=>{const s=tf();return kd(s,t,_d(r),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};ef(s,e.style,e),o.style={...s,...o.style}}return o}const mw=["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 ha(e){return typeof e!="string"||e.includes("-")?!1:!!(mw.indexOf(e)>-1||/[A-Z]/u.test(e))}function gw(e,t,n,{latestValues:r},o,s=!1,i){const c=(i??ha(e)?pw:hw)(t,r,o,e),u=cw(t,typeof e=="string",s),d=e!==w.Fragment?{...u,...c,ref:n}:{},{children:f}=t,h=w.useMemo(()=>Te(f)?f.get():f,[f]);return w.createElement(e,{...d,children:h})}function vw({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,o){return{latestValues:yw(n,r,o,e),renderState:t()}}function yw(e,t,n,r){const o={},s=r(e,{});for(const h in s)o[h]=zr(s[h]);let{initial:i,animate:a}=e;const c=Eo(e),u=Sd(e);t&&u&&!c&&e.inherit!==!1&&(i===void 0&&(i=t.initial),a===void 0&&(a=t.animate));let d=n?n.initial===!1:!1;d=d||i===!1;const f=d?a:i;if(f&&typeof f!="boolean"&&!Po(f)){const h=Array.isArray(f)?f:[f];for(let m=0;m<h.length;m++){const y=ta(e,h[m]);if(y){const{transitionEnd:g,transition:v,...x}=y;for(const b in x){let C=x[b];if(Array.isArray(C)){const S=d?C.length-1:0;C=C[S]}C!==null&&(o[b]=C)}for(const b in g)o[b]=g[b]}}}return o}const nf=e=>(t,n)=>{const r=w.useContext(Mo),o=w.useContext(Ro),s=()=>vw(e,t,r,o);return n?s():$i(s)},xw=nf({scrapeMotionValuesFromProps:ua,createRenderState:fa}),bw=nf({scrapeMotionValuesFromProps:Od,createRenderState:tf}),ww=Symbol.for("motionComponentSymbol");function Cw(e,t,n){const r=w.useRef(n);w.useInsertionEffect(()=>{r.current=n});const o=w.useRef(null);return w.useCallback(s=>{var a;s&&((a=e.onMount)==null||a.call(e,s));const i=r.current;if(typeof i=="function")if(s){const c=i(s);typeof c=="function"&&(o.current=c)}else o.current?(o.current(),o.current=null):i(s);else i&&(i.current=s);t&&(s?t.mount(s):t.unmount())},[t])}const rf=w.createContext({});function ln(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Sw(e,t,n,r,o,s){var C,S;const{visualElement:i}=w.useContext(Mo),a=w.useContext(Zd),c=w.useContext(Ro),u=w.useContext(da),d=u.reducedMotion,f=u.skipAnimations,h=w.useRef(null),m=w.useRef(!1);r=r||a.renderer,!h.current&&r&&(h.current=r(e,{visualState:t,parent:i,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:d,skipAnimations:f,isSVG:s}),m.current&&h.current&&(h.current.manuallyAnimateOnMount=!0));const y=h.current,g=w.useContext(rf);y&&!y.projection&&o&&(y.type==="html"||y.type==="svg")&&Rw(h.current,n,o,g);const v=w.useRef(!1);w.useInsertionEffect(()=>{y&&v.current&&y.update(n,c)});const x=n[ud],b=w.useRef(!!x&&typeof window<"u"&&!((C=window.MotionHandoffIsComplete)!=null&&C.call(window,x))&&((S=window.MotionHasOptimisedAnimation)==null?void 0:S.call(window,x)));return Cu(()=>{m.current=!0,y&&(v.current=!0,window.MotionIsMounted=!0,y.updateFeatures(),y.scheduleRenderMicrotask(),b.current&&y.animationState&&y.animationState.animateChanges())}),w.useEffect(()=>{y&&(!b.current&&y.animationState&&y.animationState.animateChanges(),b.current&&(queueMicrotask(()=>{var R;(R=window.MotionHandoffMarkAsComplete)==null||R.call(window,x)}),b.current=!1),y.enteringChildren=void 0)}),y}function Rw(e,t,n,r){const{layoutId:o,layout:s,drag:i,dragConstraints:a,layoutScroll:c,layoutRoot:u,layoutAnchor:d,layoutCrossfade:f}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:of(e.parent)),e.projection.setOptions({layoutId:o,layout:s,alwaysMeasureLayout:!!i||a&&ln(a),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:f,layoutScroll:c,layoutRoot:u,layoutAnchor:d})}function of(e){if(e)return e.options.allowProjection!==!1?e.projection:of(e.parent)}function Ss(e,{forwardMotionProps:t=!1,type:n}={},r,o){r&&sw(r);const s=n?n==="svg":ha(e),i=s?bw:xw;function a(u,d){let f;const h={...w.useContext(da),...u,layoutId:Tw(u)},{isStatic:m}=h,y=uw(u),g=i(u,m);if(!m&&typeof window<"u"){Pw(h,r);const v=Ew(h);f=v.MeasureLayout,y.visualElement=Sw(e,g,h,o,v.ProjectionNode,s)}return l.jsxs(Mo.Provider,{value:y,children:[f&&y.visualElement?l.jsx(f,{visualElement:y.visualElement,...h}):null,gw(e,u,Cw(g,y.visualElement,d),g,m,t,s)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const c=w.forwardRef(a);return c[ww]=e,c}function Tw({layoutId:e}){const t=w.useContext(Fi).id;return t&&e!==void 0?t+"-"+e:e}function Pw(e,t){const n=w.useContext(Zd).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?Rn(!1,r,"lazy-strict-mode"):ut(!1,r,"lazy-strict-mode")}}function Ew(e){const t=Qd(),{drag:n,layout:r}=t;if(!n&&!r)return{};const o={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(e)||r!=null&&r.isEnabled(e)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}function Mw(e,t){if(typeof Proxy>"u")return Ss;const n=new Map,r=(s,i)=>Ss(s,i,e,t),o=(s,i)=>(process.env.NODE_ENV!=="production"&&Gi(!1,"motion() is deprecated. Use motion.create() instead."),r(s,i));return new Proxy(o,{get:(s,i)=>i==="create"?r:(n.has(i)||n.set(i,Ss(i,void 0,e,t)),n.get(i))})}const Aw=(e,t)=>t.isSVG??ha(e)?new sb(t):new Jx(t,{allowProjection:e!==w.Fragment});class Dw extends Mt{constructor(t){super(t),t.animationState||(t.animationState=ub(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Po(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 Nw=0;class jw extends Mt{constructor(){super(...arguments),this.id=Nw++,this.isExitComplete=!1}update(){var s;if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;if(t&&r===!1){if(this.isExitComplete){const{initial:i,custom:a}=this.node.getProps();if(typeof i=="string"){const c=zt(this.node,i,a);if(c){const{transition:u,transitionEnd:d,...f}=c;for(const h in f)(s=this.node.getValue(h))==null||s.jump(f[h])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const o=this.node.animationState.setActive("exit",!t);n&&!t&&o.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const kw={animation:{Feature:Dw},exit:{Feature:jw}};function tr(e){return{point:{x:e.pageX,y:e.pageY}}}const Iw=e=>t=>sa(t)&&e(t,tr(t));function Gn(e,t,n,r){return zn(e,t,Iw(n),r)}const sf=({current:e})=>e?e.ownerDocument.defaultView:null,Pl=(e,t)=>Math.abs(e-t);function _w(e,t){const n=Pl(e.x,t.x),r=Pl(e.y,t.y);return Math.sqrt(n**2+r**2)}const El=new Set(["auto","scroll"]);class af{constructor(t,n,{transformPagePoint:r,contextWindow:o=window,dragSnapToOrigin:s=!1,distanceThreshold:i=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=m=>{this.handleScroll(m.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Er(this.lastRawMoveEventInfo,this.transformPagePoint));const m=Rs(this.lastMoveEventInfo,this.history),y=this.startEvent!==null,g=_w(m.offset,{x:0,y:0})>=this.distanceThreshold;if(!y&&!g)return;const{point:v}=m,{timestamp:x}=Re;this.history.push({...v,timestamp:x});const{onStart:b,onMove:C}=this.handlers;y||(b&&b(this.lastMoveEvent,m),this.startEvent=this.lastMoveEvent),C&&C(this.lastMoveEvent,m)},this.handlePointerMove=(m,y)=>{this.lastMoveEvent=m,this.lastRawMoveEventInfo=y,this.lastMoveEventInfo=Er(y,this.transformPagePoint),le.update(this.updatePoint,!0)},this.handlePointerUp=(m,y)=>{this.end();const{onEnd:g,onSessionEnd:v,resumeAnimation:x}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=Rs(m.type==="pointercancel"?this.lastMoveEventInfo:Er(y,this.transformPagePoint),this.history);this.startEvent&&g&&g(m,b),v&&v(m,b)},!sa(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=i,this.contextWindow=o||window;const c=tr(t),u=Er(c,this.transformPagePoint),{point:d}=u,{timestamp:f}=Re;this.history=[{...d,timestamp:f}];const{onSessionStart:h}=n;h&&h(t,Rs(u,this.history)),this.removeListeners=Qn(Gn(this.contextWindow,"pointermove",this.handlePointerMove),Gn(this.contextWindow,"pointerup",this.handlePointerUp),Gn(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(El.has(r.overflowX)||El.has(r.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const r=t===window,o=r?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},s={x:o.x-n.x,y:o.y-n.y};s.x===0&&s.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s.x,this.lastMoveEventInfo.point.y+=s.y):this.history.length>0&&(this.history[0].x-=s.x,this.history[0].y-=s.y),this.scrollPositions.set(t,o),le.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),St(this.updatePoint)}}function Er(e,t){return t?{point:t(e.point)}:e}function Ml(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Rs({point:e},t){return{point:e,delta:Ml(e,cf(t)),offset:Ml(e,Ow(t)),velocity:Lw(t,.1)}}function Ow(e){return e[0]}function cf(e){return e[e.length-1]}function Lw(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=cf(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>_e(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&o.timestamp-r.timestamp>_e(t)*2&&(r=e[1]);const s=We(o.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const i={x:(o.x-r.x)/s,y:(o.y-r.y)/s};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function Vw(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?ue(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?ue(n,e,r.max):Math.min(e,n)),e}function Al(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function Fw(e,{top:t,left:n,bottom:r,right:o}){return{x:Al(e.x,n,o),y:Al(e.y,t,r)}}function Dl(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function $w(e,t){return{x:Dl(e.x,t.x),y:Dl(e.y,t.y)}}function Bw(e,t){let n=.5;const r=Ie(e),o=Ie(t);return o>r?n=Un(t.min,t.max-r,e.min):r>o&&(n=Un(e.min,e.max-o,t.min)),ct(0,1,n)}function Ww(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const mi=.35;function Gw(e=mi){return e===!1?e=0:e===!0&&(e=mi),{x:Nl(e,"left","right"),y:Nl(e,"top","bottom")}}function Nl(e,t,n){return{min:jl(e,t),max:jl(e,n)}}function jl(e,t){return typeof e=="number"?e:e[t]||0}const Uw=new WeakMap;class Kw{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ye(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const s=f=>{n&&this.snapToCursor(tr(f).point),this.stopAnimation()},i=(f,h)=>{const{drag:m,dragPropagation:y,onDragStart:g}=this.getProps();if(m&&!y&&(this.openDragLock&&this.openDragLock(),this.openDragLock=yx(m),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=h,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),tt(x=>{let b=this.getAxisMotionValue(x).get()||0;if(it.test(b)){const{projection:C}=this.visualElement;if(C&&C.layout){const S=C.layout.layoutBox[x];S&&(b=Ie(S)*(parseFloat(b)/100))}}this.originPoint[x]=b}),g&&le.update(()=>g(f,h),!1,!0),ii(this.visualElement,"transform");const{animationState:v}=this.visualElement;v&&v.setActive("whileDrag",!0)},a=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h;const{dragPropagation:m,dragDirectionLock:y,onDirectionLock:g,onDrag:v}=this.getProps();if(!m&&!this.openDragLock)return;const{offset:x}=h;if(y&&this.currentDirection===null){this.currentDirection=zw(x),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",h.point,x),this.updateAxis("y",h.point,x),this.visualElement.render(),v&&le.update(()=>v(f,h),!1,!0)},c=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h,this.stop(f,h),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>{const{dragSnapToOrigin:f}=this.getProps();(f||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:d}=this.getProps();this.panSession=new af(t,{onSessionStart:s,onStart:i,onMove:a,onSessionEnd:c,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:r,contextWindow:sf(this.visualElement),element:this.visualElement.current})}stop(t,n){const r=t||this.latestPointerEvent,o=n||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!o||!r)return;const{velocity:i}=o;this.startAnimation(i);const{onDragEnd:a}=this.getProps();a&&le.postRender(()=>a(r,o))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,r){const{drag:o}=this.getProps();if(!r||!Mr(t,o,this.currentDirection))return;const s=this.getAxisMotionValue(t);let i=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(i=Vw(i,this.constraints[t],this.elastic[t])),s.set(i)}resolveConstraints(){var s;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(s=this.visualElement.projection)==null?void 0:s.layout,o=this.constraints;t&&ln(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=Fw(r.layoutBox,t):this.constraints=!1,this.elastic=Gw(n),o!==this.constraints&&!ln(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&tt(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=Ww(r.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!ln(t))return!1;const r=t.current;ut(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const s=zx(r,o.root,this.visualElement.getTransformPagePoint());let i=$w(o.layout.layoutBox,s);if(n){const a=n(Ux(i));this.hasMutatedConstraints=!!a,a&&(i=Ed(a))}return i}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:s,dragSnapToOrigin:i,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},u=tt(d=>{if(!Mr(d,n,this.currentDirection))return;let f=c&&c[d]||{};(i===!0||i===d)&&(f={min:0,max:0});const h=o?200:1e6,m=o?40:1e7,y={type:"inertia",velocity:r?t[d]:0,bounceStiffness:h,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...s,...f};return this.startAxisValueAnimation(d,y)});return Promise.all(u).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return ii(this.visualElement,t),r.start(ea(t,r,0,n,this.visualElement,!1))}stopAnimation(){tt(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),o=r[n];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){tt(n=>{const{drag:r}=this.getProps();if(!Mr(n,r,this.currentDirection))return;const{projection:o}=this.visualElement,s=this.getAxisMotionValue(n);if(o&&o.layout){const{min:i,max:a}=o.layout.layoutBox[n],c=s.get()||0;s.set(t[n]-ue(i,a,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!ln(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};tt(i=>{const a=this.getAxisMotionValue(i);if(a&&this.constraints!==!1){const c=a.get();o[i]=Bw({min:c,max:c},this.constraints[i])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),tt(i=>{if(!Mr(i,t,null))return;const a=this.getAxisMotionValue(i),{min:c,max:u}=this.constraints[i];a.set(ue(c,u,o[i]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Uw.set(this.visualElement,this);const t=this.visualElement.current,n=Gn(t,"pointerdown",u=>{const{drag:d,dragListener:f=!0}=this.getProps(),h=u.target,m=h!==t&&Rx(h);d&&f&&!m&&this.start(u)});let r;const o=()=>{const{dragConstraints:u}=this.getProps();ln(u)&&u.current&&(this.constraints=this.resolveRefConstraints(),r||(r=Hw(t,u.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,i=s.addEventListener("measure",o);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),le.read(o);const a=zn(window,"resize",()=>this.scalePositionWithinConstraints()),c=s.addEventListener("didUpdate",(({delta:u,hasLayoutChanged:d})=>{this.isDragging&&d&&(tt(f=>{const h=this.getAxisMotionValue(f);h&&(this.originPoint[f]+=u[f].translate,h.set(h.get()+u[f].translate))}),this.visualElement.render())}));return()=>{a(),n(),i(),c&&c(),r&&r()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:s=!1,dragElastic:i=mi,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:s,dragElastic:i,dragMomentum:a}}}function kl(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function Hw(e,t,n){const r=$c(e,kl(n)),o=$c(t,kl(n));return()=>{r(),o()}}function Mr(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function zw(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class Yw extends Mt{constructor(t){super(t),this.removeGroupControls=Ge,this.removeListeners=Ge,this.controls=new Kw(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Ge}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Ts=e=>(t,n)=>{e&&le.update(()=>e(t,n),!1,!0)};class Xw extends Mt{constructor(){super(...arguments),this.removePointerDownListener=Ge}onPointerDown(t){this.session=new af(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:sf(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:Ts(t),onStart:Ts(n),onMove:Ts(r),onEnd:(s,i)=>{delete this.session,o&&le.postRender(()=>o(s,i))}}}mount(){this.removePointerDownListener=Gn(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Ps=!1;class qw extends w.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:s}=t;s&&(n.group&&n.group.add(s),r&&r.register&&o&&r.register(s),Ps&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Yr.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:o,isPresent:s}=this.props,{projection:i}=r;return i&&(i.isPresent=s,t.layoutDependency!==n&&i.setOptions({...i.options,layoutDependency:n}),Ps=!0,o||t.layoutDependency!==n||n===void 0||t.isPresent!==s?i.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?i.promote():i.relegate()||le.postRender(()=>{const a=i.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:n}=this.props,{projection:r}=t;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),oa.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=t;Ps=!0,o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function lf(e){const[t,n]=Xd(),r=w.useContext(Fi);return l.jsx(qw,{...e,layoutGroup:r,switchLayoutGroup:w.useContext(rf),isPresent:t,safeToRemove:n})}const Zw={pan:{Feature:Xw},drag:{Feature:Yw,ProjectionNode:Yd,MeasureLayout:lf}};function Il(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,s=r[o];s&&le.postRender(()=>s(t,tr(t)))}class Qw extends Mt{mount(){const{current:t}=this.node;t&&(this.unmount=bx(t,(n,r)=>(Il(this.node,r,"Start"),o=>Il(this.node,o,"End"))))}unmount(){}}class Jw extends Mt{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=Qn(zn(this.node.current,"focus",()=>this.onFocus()),zn(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function _l(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const o="onTap"+(n==="End"?"":n),s=r[o];s&&le.postRender(()=>s(t,tr(t)))}class eC extends Mt{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=Px(t,(o,s)=>(_l(this.node,s,"Start"),(i,{success:a})=>_l(this.node,i,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const gi=new WeakMap,Es=new WeakMap,tC=e=>{const t=gi.get(e.target);t&&t(e)},nC=e=>{e.forEach(tC)};function rC({root:e,...t}){const n=e||document;Es.has(n)||Es.set(n,{});const r=Es.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(nC,{root:e,...t})),r[o]}function oC(e,t,n){const r=rC(t);return gi.set(e,n),r.observe(e),()=>{gi.delete(e),r.unobserve(e)}}const sC={some:0,all:1};class iC extends Mt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var c;(c=this.stopObserver)==null||c.call(this);const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:o="some",once:s}=t,i={root:n?n.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:sC[o]},a=u=>{const{isIntersecting:d}=u;if(this.isInView===d||(this.isInView=d,s&&!d&&this.hasEnteredView))return;d&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",d);const{onViewportEnter:f,onViewportLeave:h}=this.node.getProps(),m=d?f:h;m&&m(u)};this.stopObserver=oC(this.node.current,i,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(aC(t,n))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function aC({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const cC={inView:{Feature:iC},tap:{Feature:eC},focus:{Feature:Jw},hover:{Feature:Qw}},lC={layout:{ProjectionNode:Yd,MeasureLayout:lf}},uC={...kw,...cC,...Zw,...lC},uf=Mw(uC,Aw);function df(){const[e,t]=w.useState([]),n=w.useRef(0),r=w.useCallback(s=>{const a=s.currentTarget.getBoundingClientRect(),c=Math.max(a.width,a.height)*2.2,u=s.clientX-a.left-c/2,d=s.clientY-a.top-c/2,f=n.current++;t(h=>[...h,{id:f,x:u,y:d,size:c}])},[]),o=w.useCallback(s=>{t(i=>i.filter(a=>a.id!==s))},[]);return{ripples:e,add:r,remove:o}}function ff({ripples:e,onDone:t}){return l.jsx(qd,{children:e.map(n=>l.jsx(uf.span,{className:"btn-ripple",style:{left:n.x,top:n.y,width:n.size,height:n.size},initial:{scale:0,opacity:1},animate:{scale:1,opacity:[1,1,0]},transition:{scale:{duration:1,ease:[.4,0,.2,1]},opacity:{duration:1.2,times:[0,.6,1],ease:"easeOut"}},onAnimationComplete:()=>t(n.id)},n.id))})}const dC=()=>l.jsx("span",{className:"btn-spinner","aria-hidden":"true"}),hf=w.forwardRef(function({variant:t="solid",color:n="primary",size:r,shape:o,block:s=!1,loading:i=!1,icon:a,iconPosition:c="start",disableRipple:u=!1,disabled:d,className:f,children:h,onClick:m,...y},g){const{ripples:v,add:x,remove:b}=df(),C=d||i,S=A=>{C||(!u&&t!=="link"&&x(A),m==null||m(A))},R=_("btn",t,n!=="primary"&&n,r==="sm"||r==="lg"?r:null,o&&o!=="default"&&o,s&&"block",i&&"loading",f),P=i?l.jsx(dC,{}):c==="start"?a:null,T=!i&&c==="end"?a:null;return l.jsxs("button",{ref:g,className:R,onClick:S,disabled:C,"aria-busy":i||void 0,...y,children:[l.jsxs("span",{className:"btn-content",children:[P,h,T]}),!u&&t!=="link"&&l.jsx(ff,{ripples:v,onDone:b})]})}),fC=w.forwardRef(function({orientation:t="horizontal",layout:n="attached",round:r=!1,className:o,children:s,...i},a){const c=_("btn-group",t==="vertical"&&"vertical",n==="spaced"&&"spaced",r&&"round",o);return l.jsx("div",{ref:a,className:c,role:"group",...i,children:s})}),hC=w.forwardRef(function({variant:t="solid",color:n="primary",size:r,position:o="static",disableRipple:s=!1,icon:i,label:a,open:c=!0,className:u,onClick:d,disabled:f,...h},m){const{ripples:y,add:g,remove:v}=df(),x=S=>{f||(s||g(S),d==null||d(S))},b=a!=null,C=_("btn",t,n!=="primary"&&n,r==="sm"||r==="lg"?r:null,"fab",b&&"extended",o!=="static"&&`fixed-${o}`,u);return l.jsx(qd,{children:c&&l.jsxs(uf.button,{ref:m,type:"button",className:C,onClick:x,disabled:f,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:{type:"spring",stiffness:380,damping:26,mass:.9},...h,children:[l.jsxs("span",{className:"btn-content",children:[i,b&&a]}),!s&&l.jsx(ff,{ripples:y,onDone:v})]})})}),pC=w.forwardRef(function({icon:t,shape:n="circle",variant:r="ghost",...o},s){return l.jsx(hf,{ref:s,shape:n,variant:r,icon:t,...o})});function V(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}var Pe=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},mC=p[" useInsertionEffect ".trim().toString()]||Pe;function be({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,i]=gC({defaultProp:t,onChange:n}),a=e!==void 0,c=a?e:o;{const d=p.useRef(e!==void 0);p.useEffect(()=>{const f=d.current;f!==a&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=a},[a,r])}const u=p.useCallback(d=>{var f;if(a){const h=vC(d)?d(e):d;h!==e&&((f=i.current)==null||f.call(i,h))}else s(d)},[a,e,s,i]);return[c,u]}function gC({defaultProp:e,onChange:t}){const[n,r]=p.useState(e),o=p.useRef(n),s=p.useRef(t);return mC(()=>{s.current=t},[t]),p.useEffect(()=>{var i;o.current!==n&&((i=s.current)==null||i.call(s,n),o.current=n)},[n,o]),[n,r,s]}function vC(e){return typeof e=="function"}function Ol(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function dt(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Ol(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Ol(e[o],null)}}}}function te(...e){return p.useCallback(dt(...e),e)}function Yt(e){const t=yC(e),n=p.forwardRef((r,o)=>{const{children:s,...i}=r,a=p.Children.toArray(s),c=a.find(bC);if(c){const u=c.props.children,d=a.map(f=>f===c?p.Children.count(u)>1?p.Children.only(null):p.isValidElement(u)?u.props.children:null:f);return l.jsx(t,{...i,ref:o,children:p.isValidElement(u)?p.cloneElement(u,void 0,d):null})}return l.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function yC(e){const t=p.forwardRef((n,r)=>{const{children:o,...s}=n;if(p.isValidElement(o)){const i=CC(o),a=wC(s,o.props);return o.type!==p.Fragment&&(a.ref=r?dt(r,i):i),p.cloneElement(o,a)}return p.Children.count(o)>1?p.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var pf=Symbol("radix.slottable");function xC(e){const t=({children:n})=>l.jsx(l.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=pf,t}function bC(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===pf}function wC(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function CC(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var SC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],K=SC.reduce((e,t)=>{const n=Yt(`Primitive.${t}`),r=p.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function mf(e,t){e&&So.flushSync(()=>e.dispatchEvent(t))}var gf="Toggle",pa=p.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r,onPressedChange:o,...s}=e,[i,a]=be({prop:n,onChange:o,defaultProp:r??!1,caller:gf});return l.jsx(K.button,{type:"button","aria-pressed":i,"data-state":i?"on":"off","data-disabled":e.disabled?"":void 0,...s,ref:t,onClick:V(e.onClick,()=>{e.disabled||a(!i)})})});pa.displayName=gf;var RC=pa;const TC=w.forwardRef(function({variant:t="ghost",color:n="primary",size:r,shape:o,icon:s,className:i,children:a,...c},u){const d=_("btn",t,n!=="primary"&&n,r==="sm"||r==="lg"?r:null,o&&o!=="default"&&o,i);return l.jsx(RC,{ref:u,className:d,...c,children:l.jsxs("span",{className:"btn-content",children:[s,a]})})});function PC(e,t){const n=p.createContext(t),r=s=>{const{children:i,...a}=s,c=p.useMemo(()=>a,Object.values(a));return l.jsx(n.Provider,{value:c,children:i})};r.displayName=e+"Provider";function o(s){const i=p.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,o]}function Ce(e,t=[]){let n=[];function r(s,i){const a=p.createContext(i),c=n.length;n=[...n,i];const u=f=>{var x;const{scope:h,children:m,...y}=f,g=((x=h==null?void 0:h[e])==null?void 0:x[c])||a,v=p.useMemo(()=>y,Object.values(y));return l.jsx(g.Provider,{value:v,children:m})};u.displayName=s+"Provider";function d(f,h){var g;const m=((g=h==null?void 0:h[e])==null?void 0:g[c])||a,y=p.useContext(m);if(y)return y;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[u,d]}const o=()=>{const s=n.map(i=>p.createContext(i));return function(a){const c=(a==null?void 0:a[e])||s;return p.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return o.scopeName=e,[r,EC(o,...t)]}function EC(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:c,scopeName:u})=>{const f=c(s)[`__scope${u}`];return{...a,...f}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function nr(e){const t=e+"CollectionProvider",[n,r]=Ce(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=g=>{const{scope:v,children:x}=g,b=w.useRef(null),C=w.useRef(new Map).current;return l.jsx(o,{scope:v,itemMap:C,collectionRef:b,children:x})};i.displayName=t;const a=e+"CollectionSlot",c=Yt(a),u=w.forwardRef((g,v)=>{const{scope:x,children:b}=g,C=s(a,x),S=te(v,C.collectionRef);return l.jsx(c,{ref:S,children:b})});u.displayName=a;const d=e+"CollectionItemSlot",f="data-radix-collection-item",h=Yt(d),m=w.forwardRef((g,v)=>{const{scope:x,children:b,...C}=g,S=w.useRef(null),R=te(v,S),P=s(d,x);return w.useEffect(()=>(P.itemMap.set(S,{ref:S,...C}),()=>void P.itemMap.delete(S))),l.jsx(h,{[f]:"",ref:R,children:b})});m.displayName=d;function y(g){const v=s(e+"CollectionConsumer",g);return w.useCallback(()=>{const b=v.collectionRef.current;if(!b)return[];const C=Array.from(b.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((P,T)=>C.indexOf(P.ref.current)-C.indexOf(T.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:i,Slot:u,ItemSlot:m},y,r]}var MC=p[" useId ".trim().toString()]||(()=>{}),AC=0;function he(e){const[t,n]=p.useState(MC());return Pe(()=>{n(r=>r??String(AC++))},[e]),e||(t?`radix-${t}`:"")}function Xe(e){const t=p.useRef(e);return p.useEffect(()=>{t.current=e}),p.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var DC=p.createContext(void 0);function At(e){const t=p.useContext(DC);return e||t||"ltr"}var Ms="rovingFocusGroup.onEntryFocus",NC={bubbles:!1,cancelable:!0},rr="RovingFocusGroup",[vi,vf,jC]=nr(rr),[kC,Dt]=Ce(rr,[jC]),[IC,_C]=kC(rr),yf=p.forwardRef((e,t)=>l.jsx(vi.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx(vi.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(OC,{...e,ref:t})})}));yf.displayName=rr;var OC=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...f}=e,h=p.useRef(null),m=te(t,h),y=At(s),[g,v]=be({prop:i,defaultProp:a??null,onChange:c,caller:rr}),[x,b]=p.useState(!1),C=Xe(u),S=vf(n),R=p.useRef(!1),[P,T]=p.useState(0);return p.useEffect(()=>{const A=h.current;if(A)return A.addEventListener(Ms,C),()=>A.removeEventListener(Ms,C)},[C]),l.jsx(IC,{scope:n,orientation:r,dir:y,loop:o,currentTabStopId:g,onItemFocus:p.useCallback(A=>v(A),[v]),onItemShiftTab:p.useCallback(()=>b(!0),[]),onFocusableItemAdd:p.useCallback(()=>T(A=>A+1),[]),onFocusableItemRemove:p.useCallback(()=>T(A=>A-1),[]),children:l.jsx(K.div,{tabIndex:x||P===0?-1:0,"data-orientation":r,...f,ref:m,style:{outline:"none",...e.style},onMouseDown:V(e.onMouseDown,()=>{R.current=!0}),onFocus:V(e.onFocus,A=>{const k=!R.current;if(A.target===A.currentTarget&&k&&!x){const N=new CustomEvent(Ms,NC);if(A.currentTarget.dispatchEvent(N),!N.defaultPrevented){const L=S().filter(D=>D.focusable),G=L.find(D=>D.active),J=L.find(D=>D.id===g),Z=[G,J,...L].filter(Boolean).map(D=>D.ref.current);wf(Z,d)}}R.current=!1}),onBlur:V(e.onBlur,()=>b(!1))})})}),xf="RovingFocusGroupItem",bf=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,children:i,...a}=e,c=he(),u=s||c,d=_C(xf,n),f=d.currentTabStopId===u,h=vf(n),{onFocusableItemAdd:m,onFocusableItemRemove:y,currentTabStopId:g}=d;return p.useEffect(()=>{if(r)return m(),()=>y()},[r,m,y]),l.jsx(vi.ItemSlot,{scope:n,id:u,focusable:r,active:o,children:l.jsx(K.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...a,ref:t,onMouseDown:V(e.onMouseDown,v=>{r?d.onItemFocus(u):v.preventDefault()}),onFocus:V(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:V(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){d.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const x=FC(v,d.orientation,d.dir);if(x!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let C=h().filter(S=>S.focusable).map(S=>S.ref.current);if(x==="last")C.reverse();else if(x==="prev"||x==="next"){x==="prev"&&C.reverse();const S=C.indexOf(v.currentTarget);C=d.loop?$C(C,S+1):C.slice(S+1)}setTimeout(()=>wf(C))}}),children:typeof i=="function"?i({isCurrentTabStop:f,hasTabStop:g!=null}):i})})});bf.displayName=xf;var LC={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function VC(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function FC(e,t,n){const r=VC(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return LC[r]}function wf(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function $C(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Ao=yf,Do=bf,Nt="ToggleGroup",[Cf]=Ce(Nt,[Dt]),Sf=Dt(),ma=w.forwardRef((e,t)=>{const{type:n,...r}=e;if(n==="single"){const o=r;return l.jsx(BC,{...o,ref:t})}if(n==="multiple"){const o=r;return l.jsx(WC,{...o,ref:t})}throw new Error(`Missing prop \`type\` expected on \`${Nt}\``)});ma.displayName=Nt;var[Rf,Tf]=Cf(Nt),BC=w.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...s}=e,[i,a]=be({prop:n,defaultProp:r??"",onChange:o,caller:Nt});return l.jsx(Rf,{scope:e.__scopeToggleGroup,type:"single",value:w.useMemo(()=>i?[i]:[],[i]),onItemActivate:a,onItemDeactivate:w.useCallback(()=>a(""),[a]),children:l.jsx(Pf,{...s,ref:t})})}),WC=w.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...s}=e,[i,a]=be({prop:n,defaultProp:r??[],onChange:o,caller:Nt}),c=w.useCallback(d=>a((f=[])=>[...f,d]),[a]),u=w.useCallback(d=>a((f=[])=>f.filter(h=>h!==d)),[a]);return l.jsx(Rf,{scope:e.__scopeToggleGroup,type:"multiple",value:i,onItemActivate:c,onItemDeactivate:u,children:l.jsx(Pf,{...s,ref:t})})});ma.displayName=Nt;var[GC,UC]=Cf(Nt),Pf=w.forwardRef((e,t)=>{const{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:o=!0,orientation:s,dir:i,loop:a=!0,...c}=e,u=Sf(n),d=At(i),f={role:"group",dir:d,...c};return l.jsx(GC,{scope:n,rovingFocus:o,disabled:r,children:o?l.jsx(Ao,{asChild:!0,...u,orientation:s,dir:d,loop:a,children:l.jsx(K.div,{...f,ref:t})}):l.jsx(K.div,{...f,ref:t})})}),lo="ToggleGroupItem",Ef=w.forwardRef((e,t)=>{const n=Tf(lo,e.__scopeToggleGroup),r=UC(lo,e.__scopeToggleGroup),o=Sf(e.__scopeToggleGroup),s=n.value.includes(e.value),i=r.disabled||e.disabled,a={...e,pressed:s,disabled:i},c=w.useRef(null);return r.rovingFocus?l.jsx(Do,{asChild:!0,...o,focusable:!i,active:s,ref:c,children:l.jsx(Ll,{...a,ref:t})}):l.jsx(Ll,{...a,ref:t})});Ef.displayName=lo;var Ll=w.forwardRef((e,t)=>{const{__scopeToggleGroup:n,value:r,...o}=e,s=Tf(lo,n),i={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},a=s.type==="single"?i:void 0;return l.jsx(pa,{...a,...o,ref:t,onPressedChange:c=>{c?s.onItemActivate(r):s.onItemDeactivate(r)}})}),KC=ma,HC=Ef;const Mf=w.createContext({variant:"outline",color:"primary"}),zC=w.forwardRef(function({variant:t="outline",color:n="primary",size:r,layout:o="attached",round:s=!1,className:i,children:a,...c},u){const d=_("btn-group",o==="spaced"&&"spaced",s&&"round",i);return l.jsx(Mf.Provider,{value:{variant:t,color:n,size:r},children:l.jsx(KC,{ref:u,className:d,...c,children:a})})}),YC=w.forwardRef(function({icon:t,shape:n,className:r,children:o,...s},i){const{variant:a,color:c,size:u}=w.useContext(Mf),d=_("btn",a,c!=="primary"&&c,u==="sm"||u==="lg"?u:null,n&&n!=="default"&&n,r);return l.jsx(HC,{ref:i,className:d,...s,children:l.jsxs("span",{className:"btn-content",children:[t,o]})})});/**
|
|
10
|
+
* @license lucide-react v1.8.0 - ISC
|
|
11
|
+
*
|
|
12
|
+
* This source code is licensed under the ISC license.
|
|
13
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
14
|
+
*/const Af=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
|
15
|
+
* @license lucide-react v1.8.0 - ISC
|
|
16
|
+
*
|
|
17
|
+
* This source code is licensed under the ISC license.
|
|
18
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
19
|
+
*/const XC=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
20
|
+
* @license lucide-react v1.8.0 - ISC
|
|
21
|
+
*
|
|
22
|
+
* This source code is licensed under the ISC license.
|
|
23
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
24
|
+
*/const qC=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
|
|
10
25
|
* @license lucide-react v1.8.0 - ISC
|
|
11
26
|
*
|
|
12
27
|
* This source code is licensed under the ISC license.
|
|
13
28
|
* See the LICENSE file in the root directory of this source tree.
|
|
14
|
-
*/const
|
|
29
|
+
*/const Vl=e=>{const t=qC(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
|
|
15
30
|
* @license lucide-react v1.8.0 - ISC
|
|
16
31
|
*
|
|
17
32
|
* This source code is licensed under the ISC license.
|
|
18
33
|
* See the LICENSE file in the root directory of this source tree.
|
|
19
|
-
*/
|
|
34
|
+
*/var As={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
20
35
|
* @license lucide-react v1.8.0 - ISC
|
|
21
36
|
*
|
|
22
37
|
* This source code is licensed under the ISC license.
|
|
23
38
|
* See the LICENSE file in the root directory of this source tree.
|
|
24
|
-
*/const
|
|
39
|
+
*/const ZC=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},QC=w.createContext({}),JC=()=>w.useContext(QC),eS=w.forwardRef(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...a},c)=>{const{size:u=24,strokeWidth:d=2,absoluteStrokeWidth:f=!1,color:h="currentColor",className:m=""}=JC()??{},y=r??f?Number(n??d)*24/Number(t??u):n??d;return w.createElement("svg",{ref:c,...As,width:t??u??As.width,height:t??u??As.height,stroke:e??h,strokeWidth:y,className:Af("lucide",m,o),...!s&&!ZC(a)&&{"aria-hidden":"true"},...a},[...i.map(([g,v])=>w.createElement(g,v)),...Array.isArray(s)?s:[s]])});/**
|
|
25
40
|
* @license lucide-react v1.8.0 - ISC
|
|
26
41
|
*
|
|
27
42
|
* This source code is licensed under the ISC license.
|
|
28
43
|
* See the LICENSE file in the root directory of this source tree.
|
|
29
|
-
*/const
|
|
44
|
+
*/const ge=(e,t)=>{const n=w.forwardRef(({className:r,...o},s)=>w.createElement(eS,{ref:s,iconNode:t,className:Af(`lucide-${XC(Vl(e))}`,`lucide-${e}`,r),...o}));return n.displayName=Vl(e),n};/**
|
|
30
45
|
* @license lucide-react v1.8.0 - ISC
|
|
31
46
|
*
|
|
32
47
|
* This source code is licensed under the ISC license.
|
|
33
48
|
* See the LICENSE file in the root directory of this source tree.
|
|
34
|
-
*/
|
|
49
|
+
*/const tS=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],nS=ge("calendar",tS);/**
|
|
35
50
|
* @license lucide-react v1.8.0 - ISC
|
|
36
51
|
*
|
|
37
52
|
* This source code is licensed under the ISC license.
|
|
38
53
|
* See the LICENSE file in the root directory of this source tree.
|
|
39
|
-
*/const
|
|
54
|
+
*/const rS=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Rt=ge("check",rS);/**
|
|
40
55
|
* @license lucide-react v1.8.0 - ISC
|
|
41
56
|
*
|
|
42
57
|
* This source code is licensed under the ISC license.
|
|
43
58
|
* See the LICENSE file in the root directory of this source tree.
|
|
44
|
-
*/const
|
|
59
|
+
*/const oS=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],No=ge("chevron-down",oS);/**
|
|
45
60
|
* @license lucide-react v1.8.0 - ISC
|
|
46
61
|
*
|
|
47
62
|
* This source code is licensed under the ISC license.
|
|
48
63
|
* See the LICENSE file in the root directory of this source tree.
|
|
49
|
-
*/const
|
|
64
|
+
*/const sS=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Xr=ge("chevron-left",sS);/**
|
|
50
65
|
* @license lucide-react v1.8.0 - ISC
|
|
51
66
|
*
|
|
52
67
|
* This source code is licensed under the ISC license.
|
|
53
68
|
* See the LICENSE file in the root directory of this source tree.
|
|
54
|
-
*/const
|
|
69
|
+
*/const iS=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],gn=ge("chevron-right",iS);/**
|
|
55
70
|
* @license lucide-react v1.8.0 - ISC
|
|
56
71
|
*
|
|
57
72
|
* This source code is licensed under the ISC license.
|
|
58
73
|
* See the LICENSE file in the root directory of this source tree.
|
|
59
|
-
*/const
|
|
74
|
+
*/const aS=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],cS=ge("chevron-up",aS);/**
|
|
60
75
|
* @license lucide-react v1.8.0 - ISC
|
|
61
76
|
*
|
|
62
77
|
* This source code is licensed under the ISC license.
|
|
63
78
|
* See the LICENSE file in the root directory of this source tree.
|
|
64
|
-
*/const
|
|
79
|
+
*/const lS=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],uS=ge("chevrons-up-down",lS);/**
|
|
65
80
|
* @license lucide-react v1.8.0 - ISC
|
|
66
81
|
*
|
|
67
82
|
* This source code is licensed under the ISC license.
|
|
68
83
|
* See the LICENSE file in the root directory of this source tree.
|
|
69
|
-
*/const
|
|
84
|
+
*/const dS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],fS=ge("circle-alert",dS);/**
|
|
70
85
|
* @license lucide-react v1.8.0 - ISC
|
|
71
86
|
*
|
|
72
87
|
* This source code is licensed under the ISC license.
|
|
73
88
|
* See the LICENSE file in the root directory of this source tree.
|
|
74
|
-
*/const
|
|
89
|
+
*/const hS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],pS=ge("circle-check",hS);/**
|
|
75
90
|
* @license lucide-react v1.8.0 - ISC
|
|
76
91
|
*
|
|
77
92
|
* This source code is licensed under the ISC license.
|
|
78
93
|
* See the LICENSE file in the root directory of this source tree.
|
|
79
|
-
*/const
|
|
94
|
+
*/const mS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],gS=ge("circle",mS);/**
|
|
80
95
|
* @license lucide-react v1.8.0 - ISC
|
|
81
96
|
*
|
|
82
97
|
* This source code is licensed under the ISC license.
|
|
83
98
|
* See the LICENSE file in the root directory of this source tree.
|
|
84
|
-
*/const
|
|
99
|
+
*/const vS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],yS=ge("clock",vS);/**
|
|
85
100
|
* @license lucide-react v1.8.0 - ISC
|
|
86
101
|
*
|
|
87
102
|
* This source code is licensed under the ISC license.
|
|
88
103
|
* See the LICENSE file in the root directory of this source tree.
|
|
89
|
-
*/const
|
|
104
|
+
*/const xS=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],bS=ge("ellipsis",xS);/**
|
|
90
105
|
* @license lucide-react v1.8.0 - ISC
|
|
91
106
|
*
|
|
92
107
|
* This source code is licensed under the ISC license.
|
|
93
108
|
* See the LICENSE file in the root directory of this source tree.
|
|
94
|
-
*/const
|
|
109
|
+
*/const wS=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],CS=ge("eye-off",wS);/**
|
|
95
110
|
* @license lucide-react v1.8.0 - ISC
|
|
96
111
|
*
|
|
97
112
|
* This source code is licensed under the ISC license.
|
|
98
113
|
* See the LICENSE file in the root directory of this source tree.
|
|
99
|
-
*/const
|
|
114
|
+
*/const SS=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],RS=ge("eye",SS);/**
|
|
100
115
|
* @license lucide-react v1.8.0 - ISC
|
|
101
116
|
*
|
|
102
117
|
* This source code is licensed under the ISC license.
|
|
103
118
|
* See the LICENSE file in the root directory of this source tree.
|
|
104
|
-
*/const
|
|
119
|
+
*/const TS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],PS=ge("info",TS);/**
|
|
105
120
|
* @license lucide-react v1.8.0 - ISC
|
|
106
121
|
*
|
|
107
122
|
* This source code is licensed under the ISC license.
|
|
108
123
|
* See the LICENSE file in the root directory of this source tree.
|
|
109
|
-
*/const
|
|
124
|
+
*/const ES=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Df=ge("loader-circle",ES);/**
|
|
110
125
|
* @license lucide-react v1.8.0 - ISC
|
|
111
126
|
*
|
|
112
127
|
* This source code is licensed under the ISC license.
|
|
113
128
|
* See the LICENSE file in the root directory of this source tree.
|
|
114
|
-
*/const
|
|
129
|
+
*/const MS=[["path",{d:"M5 12h14",key:"1ays0h"}]],Fl=ge("minus",MS);/**
|
|
115
130
|
* @license lucide-react v1.8.0 - ISC
|
|
116
131
|
*
|
|
117
132
|
* This source code is licensed under the ISC license.
|
|
118
133
|
* See the LICENSE file in the root directory of this source tree.
|
|
119
|
-
*/const
|
|
134
|
+
*/const AS=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Nf=ge("search",AS);/**
|
|
120
135
|
* @license lucide-react v1.8.0 - ISC
|
|
121
136
|
*
|
|
122
137
|
* This source code is licensed under the ISC license.
|
|
123
138
|
* See the LICENSE file in the root directory of this source tree.
|
|
124
|
-
*/const
|
|
139
|
+
*/const DS=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],NS=ge("triangle-alert",DS);/**
|
|
125
140
|
* @license lucide-react v1.8.0 - ISC
|
|
126
141
|
*
|
|
127
142
|
* This source code is licensed under the ISC license.
|
|
128
143
|
* See the LICENSE file in the root directory of this source tree.
|
|
129
|
-
*/const bw=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],qr=be("x",bw),Sw=b.forwardRef(function({color:t="primary",size:n,prefix:r,suffix:o,clearable:s=!1,onClear:i,showPasswordToggle:a=!1,type:c="text",disabled:l,className:u,value:d,defaultValue:f,onChange:p,...x},g){const y=d!==void 0,[v,w]=b.useState(f!=null?String(f):""),S=y?String(d??""):v,C=b.useRef(null);b.useImperativeHandle(g,()=>C.current,[]);const[T,E]=b.useState(!1),P=a&&T&&c==="password"?"text":c,A=s&&!l&&S!=="",j=A||a,k=r!=null||o!=null||j,V=K=>{y||w(K.target.value),p==null||p(K)},H=K=>{var W;K.preventDefault(),y||w("");const D=C.current;if(D){const I=(W=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value"))==null?void 0:W.set;I==null||I.call(D,""),D.dispatchEvent(new Event("input",{bubbles:!0}))}i==null||i()},Y=$("input",t!=="primary"&&t,n==="sm"||n==="lg"?n:null,u),G=h.jsx("input",{ref:C,type:P,className:Y,disabled:l,value:y?d:void 0,defaultValue:y?void 0:f,onChange:V,...x});return k?h.jsxs("span",{className:$("cny-input-affix",r!=null&&"has-prefix",o!=null&&!j&&"has-suffix",j&&"has-action"),children:[r!=null&&h.jsx("span",{className:"cny-input-prefix",children:r}),G,o!=null&&!j&&h.jsx("span",{className:"cny-input-suffix",children:o}),A&&h.jsx("button",{type:"button",className:"cny-input-action",onClick:H,"aria-label":"Clear",tabIndex:-1,children:h.jsx(qr,{size:14,"aria-hidden":"true"})}),a&&c==="password"&&h.jsx("button",{type:"button",className:"cny-input-action",onClick:()=>E(K=>!K),"aria-label":T?"Hide password":"Show password","aria-pressed":T,style:A?{right:36}:void 0,children:T?h.jsx(uw,{size:14,"aria-hidden":"true"}):h.jsx(fw,{size:14,"aria-hidden":"true"})})]}):G}),Cw=b.forwardRef(function({color:t="default",className:n,children:r,...o},s){const i=$("card",t!=="default"&&t,n);return h.jsx("div",{ref:s,className:i,...o,children:r})}),Tw={info:h.jsxs(h.Fragment,{children:[h.jsx("circle",{cx:"12",cy:"12",r:"9"}),h.jsx("path",{d:"M12 11v5"}),h.jsx("path",{d:"M12 8h.01"})]}),success:h.jsxs(h.Fragment,{children:[h.jsx("circle",{cx:"12",cy:"12",r:"9"}),h.jsx("path",{d:"m8.5 12.5 2.5 2.5 4.5-5"})]}),warning:h.jsxs(h.Fragment,{children:[h.jsx("path",{d:"M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0Z"}),h.jsx("path",{d:"M12 9v4"}),h.jsx("path",{d:"M12 17h.01"})]}),danger:h.jsxs(h.Fragment,{children:[h.jsx("circle",{cx:"12",cy:"12",r:"9"}),h.jsx("path",{d:"m9 9 6 6"}),h.jsx("path",{d:"m15 9-6 6"})]})};function Pw({color:e}){return h.jsx("svg",{className:"alert-icon-glyph",viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:Tw[e]})}const Rw=b.forwardRef(function({color:t="info",solid:n=!1,title:r,className:o,children:s,icon:i,action:a,onDismiss:c,dismissLabel:l="Dismiss",...u},d){const f=i!==!1,p=i&&i!==!0?i:h.jsx(Pw,{color:t}),x=$("alert",t,n&&"solid",o),g=t==="danger"?"alert":"status";return h.jsxs("div",{ref:d,role:g,className:x,...u,children:[f&&h.jsx("span",{className:"alert-icon","aria-hidden":"true",children:p}),h.jsxs("div",{className:"alert-content",children:[r&&h.jsx("p",{className:"alert-title",children:r}),s&&h.jsx("p",{className:"alert-body",children:s})]}),a&&h.jsx("div",{className:"alert-action",children:a}),c&&h.jsx("button",{type:"button",className:"alert-close",onClick:c,"aria-label":l,children:h.jsxs("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:[h.jsx("path",{d:"M18 6 6 18"}),h.jsx("path",{d:"m6 6 12 12"})]})})]})}),Ew=b.forwardRef(function({size:t="md",status:n,src:r,alt:o,className:s,children:i,...a},c){const l=$("avatar",t!=="md"&&t,n,s);return h.jsx("span",{ref:c,className:l,...a,children:r?h.jsx("img",{src:r,alt:o??""}):i})}),Aw=b.forwardRef(function({className:t,children:n,...r},o){return h.jsx("div",{ref:o,className:$("avatar-stack",t),...r,children:n})}),Dw=b.forwardRef(function({value:t=0,color:n="primary",indeterminate:r=!1,className:o,style:s,...i},a){const c=$("progress",r&&"indeterminate",n!=="primary"&&n,o),l=Math.max(0,Math.min(100,t)),u=r?s??{}:{...s??{},"--value":`${l}%`};return h.jsx("div",{ref:a,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":r?void 0:l,className:c,style:u,...i,children:h.jsx("span",{className:"progress-bar"})})}),Mw=b.forwardRef(function({value:t,size:n="md",showLabel:r=!0,className:o,style:s,...i},a){const c=Math.max(0,Math.min(100,t)),l=$("progress-ring",n==="lg"&&"lg",o),u={...s??{},"--value":c};return h.jsx("span",{ref:a,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":c,className:l,style:u,...i,children:r&&h.jsxs("span",{children:[c,"%"]})})}),kw={both:{overflowX:"auto",overflowY:"auto"},x:{overflowX:"auto",overflowY:"hidden"},y:{overflowX:"hidden",overflowY:"auto"}},pd=b.forwardRef(function({variant:t="default",tone:n="neutral",axis:r="both",maxHeight:o,maxWidth:s,region:i=!1,className:a,style:c,children:l,...u},d){const f=$(i?"cny-scroll-region":"cny-scroll",t!=="default"&&t,n==="primary"&&"primary",a);return h.jsx("div",{ref:d,className:f,style:{...kw[r],maxHeight:o,maxWidth:s,...c??{}},...u,children:l})}),Nw=b.forwardRef(function(t,n){return h.jsx(pd,{ref:n,region:!0,...t})}),Iw=b.forwardRef(function({shape:t="text",width:n,height:r,className:o,style:s,...i},a){return h.jsx("span",{ref:a,"aria-hidden":"true",className:$("skeleton",t,o),style:{...s??{},width:n,height:r},...i})}),jw=b.forwardRef(function({solid:t=!1,className:n,children:r,...o},s){return h.jsx("header",{ref:s,className:$("cny-navbar",t&&"solid",n),...o,children:r})}),Ow=b.forwardRef(function({mark:t=!0,className:n,children:r,...o},s){return h.jsxs("a",{ref:s,className:$("cny-navbar-brand",n),...o,children:[t&&h.jsx("span",{className:"brand-mark","aria-hidden":"true"}),r]})}),Lw=b.forwardRef(function({className:t,children:n,...r},o){return h.jsx("nav",{ref:o,className:$("cny-navbar-nav",t),...r,children:n})}),Vw=b.forwardRef(function({active:t=!1,className:n,children:r,...o},s){return h.jsx("a",{ref:s,"aria-current":t?"page":void 0,className:$("cny-navbar-item",t&&"active",n),...o,children:r})}),Fw=b.forwardRef(function({className:t,children:n,...r},o){return h.jsx("div",{ref:o,className:$("cny-navbar-actions",t),...r,children:n})}),_w=b.forwardRef(function({width:t="default",sticky:n=!1,collapsed:r=!1,responsive:o=!1,className:s,children:i,...a},c){return h.jsx("aside",{ref:c,className:$("cny-sidebar",t!=="default"&&t,n&&"sticky",r&&"collapsed",o&&"responsive",s),...a,children:i})}),Bw=b.forwardRef(function({title:t,className:n,children:r,...o},s){return h.jsxs("div",{ref:s,className:$("cny-sidebar-section",n),...o,children:[t&&h.jsx("div",{className:"cny-sidebar-title",children:t}),h.jsx("nav",{className:"cny-sidebar-nav",children:r})]})}),$w=b.forwardRef(function({active:t=!1,disabled:n=!1,icon:r,badge:o,className:s,children:i,...a},c){return h.jsxs("a",{ref:c,"aria-current":t?"page":void 0,"aria-disabled":n||void 0,className:$("cny-sidebar-item",t&&"active",n&&"disabled",s),...a,children:[r&&h.jsx("span",{className:"cny-sidebar-item-icon","aria-hidden":"true",children:r}),h.jsx("span",{children:i}),o&&h.jsx("span",{className:"cny-sidebar-item-badge",children:o})]})});function Ww(e){const t=[];return e.display&&t.push(e.display),e.direction==="row"?t.push("flex-row"):e.direction==="column"?t.push("flex-col"):e.direction==="row-reverse"?t.push("flex-row-reverse"):e.direction==="column-reverse"&&t.push("flex-col-reverse"),e.align&&t.push(`items-${e.align==="start"||e.align==="end",e.align}`),e.justify&&t.push(`justify-${e.justify}`),e.wrap&&t.push("flex-wrap"),e.p!==void 0&&t.push(`p-${e.p}`),e.px!==void 0&&t.push(`px-${e.px}`),e.py!==void 0&&t.push(`py-${e.py}`),e.pt!==void 0&&t.push(`pt-${e.pt}`),e.pr!==void 0&&t.push(`pr-${e.pr}`),e.pb!==void 0&&t.push(`pb-${e.pb}`),e.pl!==void 0&&t.push(`pl-${e.pl}`),e.m!==void 0&&t.push(`m-${e.m}`),e.mx!==void 0&&t.push(`mx-${e.mx}`),e.my!==void 0&&t.push(`my-${e.my}`),e.mt!==void 0&&t.push(`mt-${e.mt}`),e.mr!==void 0&&t.push(`mr-${e.mr}`),e.mb!==void 0&&t.push(`mb-${e.mb}`),e.ml!==void 0&&t.push(`ml-${e.ml}`),e.gap!==void 0&&t.push(`gap-${e.gap}`),e.gapX!==void 0&&t.push(`gap-x-${e.gapX}`),e.gapY!==void 0&&t.push(`gap-y-${e.gapY}`),e.w&&t.push(`w-${e.w}`),e.h&&t.push(`h-${e.h}`),t}const Vn=b.forwardRef(function({as:t,className:n,children:r,...o},s){const i=t??"div",{layoutProps:a,domProps:c}=Uw(o),l=$(...Ww(a),n);return b.createElement(i,{ref:s,className:l||void 0,...c},r)});function Uw(e){const t=new Set(["p","px","py","pt","pr","pb","pl","m","mx","my","mt","mr","mb","ml","gap","gapX","gapY","display","direction","align","justify","wrap","w","h"]),n={},r={};for(const[o,s]of Object.entries(e))t.has(o)?n[o]=s:r[o]=s;return{layoutProps:n,domProps:r}}const Hw=b.forwardRef(function(t,n){return h.jsx(Vn,{ref:n,display:"flex",direction:"column",...t})}),Gw=b.forwardRef(function(t,n){const{align:r="center",...o}=t;return h.jsx(Vn,{ref:n,display:"flex",direction:"row",align:r,...o})}),Kw=b.forwardRef(function({cols:t,className:n,...r},o){return h.jsx(Vn,{ref:o,display:"grid",className:$(t&&`grid-cols-${t}`,n),...r})}),zw=b.forwardRef(function({size:t="lg",className:n,...r},o){return h.jsx(Vn,{ref:o,className:$("cny-container",t,n),...r})}),Yw=b.forwardRef(function({orientation:t="horizontal",className:n,...r},o){const s=$("cny-divider",t,n);return t==="vertical"?h.jsx("span",{ref:o,role:"separator","aria-orientation":"vertical",className:s,...r}):h.jsx("hr",{ref:o,className:s,...r})}),Xw=b.forwardRef(function({className:t,...n},r){return h.jsx("span",{ref:r,"aria-hidden":"true",className:$("cny-spacer",t),...n})}),qw={display:"h1",h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",lead:"p",body:"p",small:"small",caption:"span",code:"code",kbd:"kbd"},Zw=b.forwardRef(function({as:t,variant:n="body",weight:r,align:o,color:s,truncate:i=!1,className:a,children:c,...l},u){const d=t??qw[n],f=$("cny-text",`cny-text-${n}`,r&&`cny-weight-${r}`,o&&`cny-text-${o}`,s&&`text-${s}`,i&&"truncate",a);return b.createElement(d,{ref:u,className:f,...l},c)});function Qw({label:e,hint:t,error:n,required:r=!1,optional:o=!1,counter:s,maxLength:i,state:a,className:c,children:l,...u}){const d=b.useId(),f=b.Children.only(l),p=f.props.id??d,x=n!=null&&n!==!1,g=a??(x?"danger":"default"),y=t||n?`${p}-hint`:void 0,v=b.cloneElement(f,{id:p,"aria-invalid":x||f.props["aria-invalid"]||void 0,"aria-describedby":y??f.props["aria-describedby"],className:$(f.props.className,g!=="default"&&g)}),w=i!=null&&s!=null&&s>i?"danger":"default";return h.jsxs("div",{className:$("cny-field",c),...u,children:[(e!=null||s!=null)&&h.jsxs("div",{className:"cny-field-label-row",children:[e!=null?h.jsxs("label",{htmlFor:p,className:"cny-field-label",children:[e,r&&h.jsx("span",{className:"cny-field-required","aria-hidden":"true",children:"*"}),o&&!r&&h.jsx("span",{className:"cny-field-optional",children:"optional"})]}):h.jsx("span",{}),s!=null&&h.jsx("span",{className:$("cny-field-counter",w==="danger"&&"danger"),"aria-live":"polite",children:i!=null?`${s}/${i}`:s})]}),v,(n||t)&&h.jsx("span",{id:y,className:$("cny-field-hint",g!=="default"&&g),children:n??t})]})}const Jw=b.forwardRef(function({color:t="primary",size:n,autoGrow:r=!1,maxRows:o=12,className:s,onChange:i,...a},c){const l=b.useRef(null);b.useImperativeHandle(c,()=>l.current,[]);const u=b.useCallback(()=>{const p=l.current;if(!p||!r)return;p.style.height="auto";const g=parseFloat(getComputedStyle(p).lineHeight||"20")*o;p.style.height=`${Math.min(p.scrollHeight,g)}px`,p.style.overflowY=p.scrollHeight>g?"auto":"hidden"},[r,o]);b.useEffect(()=>{u()},[u,a.value,a.defaultValue]);const d=p=>{i==null||i(p),r&&u()},f=$("input",t!=="primary"&&t,n==="sm"||n==="lg"?n:null,r&&"cny-textarea-autogrow",s);return h.jsx("textarea",{ref:l,className:f,onChange:d,...a})});function Cc(e,[t,n]){return Math.min(n,Math.max(t,e))}function eb(e,t=globalThis==null?void 0:globalThis.document){const n=vt(e);m.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var tb="DismissableLayer",Is="dismissableLayer.update",nb="dismissableLayer.pointerDownOutside",rb="dismissableLayer.focusOutside",Tc,md=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Zr=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...c}=e,l=m.useContext(md),[u,d]=m.useState(null),f=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=m.useState({}),x=re(t,P=>d(P)),g=Array.from(l.layers),[y]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),v=g.indexOf(y),w=u?g.indexOf(u):-1,S=l.layersWithOutsidePointerEventsDisabled.size>0,C=w>=v,T=ib(P=>{const A=P.target,j=[...l.branches].some(k=>k.contains(A));!C||j||(o==null||o(P),i==null||i(P),P.defaultPrevented||a==null||a())},f),E=ab(P=>{const A=P.target;[...l.branches].some(k=>k.contains(A))||(s==null||s(P),i==null||i(P),P.defaultPrevented||a==null||a())},f);return eb(P=>{w===l.layers.size-1&&(r==null||r(P),!P.defaultPrevented&&a&&(P.preventDefault(),a()))},f),m.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(Tc=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),Pc(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=Tc)}},[u,f,n,l]),m.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),Pc())},[u,l]),m.useEffect(()=>{const P=()=>p({});return document.addEventListener(Is,P),()=>document.removeEventListener(Is,P)},[]),h.jsx(z.div,{...c,ref:x,style:{pointerEvents:S?C?"auto":"none":void 0,...e.style},onFocusCapture:J(e.onFocusCapture,E.onFocusCapture),onBlurCapture:J(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:J(e.onPointerDownCapture,T.onPointerDownCapture)})});Zr.displayName=tb;var ob="DismissableLayerBranch",sb=m.forwardRef((e,t)=>{const n=m.useContext(md),r=m.useRef(null),o=re(t,r);return m.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),h.jsx(z.div,{...e,ref:o})});sb.displayName=ob;function ib(e,t=globalThis==null?void 0:globalThis.document){const n=vt(e),r=m.useRef(!1),o=m.useRef(()=>{});return m.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let c=function(){gd(nb,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function ab(e,t=globalThis==null?void 0:globalThis.document){const n=vt(e),r=m.useRef(!1);return m.useEffect(()=>{const o=s=>{s.target&&!r.current&&gd(rb,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Pc(){const e=new CustomEvent(Is);document.dispatchEvent(e)}function gd(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?yx(o,s):o.dispatchEvent(s)}var Go=0;function Pi(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Rc()),document.body.insertAdjacentElement("beforeend",e[1]??Rc()),Go++,()=>{Go===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Go--}},[])}function Rc(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Ko="focusScope.autoFocusOnMount",zo="focusScope.autoFocusOnUnmount",Ec={bubbles:!1,cancelable:!0},cb="FocusScope",Qr=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,c]=m.useState(null),l=vt(o),u=vt(s),d=m.useRef(null),f=re(t,g=>c(g)),p=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let g=function(S){if(p.paused||!a)return;const C=S.target;a.contains(C)?d.current=C:ht(d.current,{select:!0})},y=function(S){if(p.paused||!a)return;const C=S.relatedTarget;C!==null&&(a.contains(C)||ht(d.current,{select:!0}))},v=function(S){if(document.activeElement===document.body)for(const T of S)T.removedNodes.length>0&&ht(a)};document.addEventListener("focusin",g),document.addEventListener("focusout",y);const w=new MutationObserver(v);return a&&w.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",y),w.disconnect()}}},[r,a,p.paused]),m.useEffect(()=>{if(a){Dc.add(p);const g=document.activeElement;if(!a.contains(g)){const v=new CustomEvent(Ko,Ec);a.addEventListener(Ko,l),a.dispatchEvent(v),v.defaultPrevented||(lb(pb(yd(a)),{select:!0}),document.activeElement===g&&ht(a))}return()=>{a.removeEventListener(Ko,l),setTimeout(()=>{const v=new CustomEvent(zo,Ec);a.addEventListener(zo,u),a.dispatchEvent(v),v.defaultPrevented||ht(g??document.body,{select:!0}),a.removeEventListener(zo,u),Dc.remove(p)},0)}}},[a,l,u,p]);const x=m.useCallback(g=>{if(!n&&!r||p.paused)return;const y=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,v=document.activeElement;if(y&&v){const w=g.currentTarget,[S,C]=ub(w);S&&C?!g.shiftKey&&v===C?(g.preventDefault(),n&&ht(S,{select:!0})):g.shiftKey&&v===S&&(g.preventDefault(),n&&ht(C,{select:!0})):v===w&&g.preventDefault()}},[n,r,p.paused]);return h.jsx(z.div,{tabIndex:-1,...i,ref:f,onKeyDown:x})});Qr.displayName=cb;function lb(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ht(r,{select:t}),document.activeElement!==n)return}function ub(e){const t=yd(e),n=Ac(t,e),r=Ac(t.reverse(),e);return[n,r]}function yd(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Ac(e,t){for(const n of e)if(!db(n,{upTo:t}))return n}function db(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function fb(e){return e instanceof HTMLInputElement&&"select"in e}function ht(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&fb(e)&&t&&e.select()}}var Dc=hb();function hb(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Mc(e,t),e.unshift(t)},remove(t){var n;e=Mc(e,t),(n=e[0])==null||n.resume()}}}function Mc(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function pb(e){return e.filter(t=>t.tagName!=="A")}const mb=["top","right","bottom","left"],xt=Math.min,je=Math.max,jr=Math.round,Jn=Math.floor,nt=e=>({x:e,y:e}),gb={left:"right",right:"left",bottom:"top",top:"bottom"};function js(e,t,n){return je(e,xt(t,n))}function it(e,t){return typeof e=="function"?e(t):e}function at(e){return e.split("-")[0]}function mn(e){return e.split("-")[1]}function Ri(e){return e==="x"?"y":"x"}function Ei(e){return e==="y"?"height":"width"}function et(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Ai(e){return Ri(et(e))}function yb(e,t,n){n===void 0&&(n=!1);const r=mn(e),o=Ai(e),s=Ei(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Or(i)),[i,Or(i)]}function vb(e){const t=Or(e);return[Os(e),t,Os(t)]}function Os(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const kc=["left","right"],Nc=["right","left"],xb=["top","bottom"],wb=["bottom","top"];function bb(e,t,n){switch(e){case"top":case"bottom":return n?t?Nc:kc:t?kc:Nc;case"left":case"right":return t?xb:wb;default:return[]}}function Sb(e,t,n,r){const o=mn(e);let s=bb(at(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(Os)))),s}function Or(e){const t=at(e);return gb[t]+e.slice(t.length)}function Cb(e){return{top:0,right:0,bottom:0,left:0,...e}}function vd(e){return typeof e!="number"?Cb(e):{top:e,right:e,bottom:e,left:e}}function Lr(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Ic(e,t,n){let{reference:r,floating:o}=e;const s=et(t),i=Ai(t),a=Ei(i),c=at(t),l=s==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[a]/2-o[a]/2;let p;switch(c){case"top":p={x:u,y:r.y-o.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-o.width,y:d};break;default:p={x:r.x,y:r.y}}switch(mn(t)){case"start":p[i]-=f*(n&&l?-1:1);break;case"end":p[i]+=f*(n&&l?-1:1);break}return p}async function Tb(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=it(t,e),x=vd(p),y=a[f?d==="floating"?"reference":"floating":d],v=Lr(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(y)))==null||n?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),w=d==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),C=await(s.isElement==null?void 0:s.isElement(S))?await(s.getScale==null?void 0:s.getScale(S))||{x:1,y:1}:{x:1,y:1},T=Lr(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:S,strategy:c}):w);return{top:(v.top-T.top+x.top)/C.y,bottom:(T.bottom-v.bottom+x.bottom)/C.y,left:(v.left-T.left+x.left)/C.x,right:(T.right-v.right+x.right)/C.x}}const Pb=50,Rb=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=i.detectOverflow?i:{...i,detectOverflow:Tb},c=await(i.isRTL==null?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=Ic(l,r,c),f=r,p=0;const x={};for(let g=0;g<s.length;g++){const y=s[g];if(!y)continue;const{name:v,fn:w}=y,{x:S,y:C,data:T,reset:E}=await w({x:u,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:x,rects:l,platform:a,elements:{reference:e,floating:t}});u=S??u,d=C??d,x[v]={...x[v],...T},E&&p<Pb&&(p++,typeof E=="object"&&(E.placement&&(f=E.placement),E.rects&&(l=E.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):E.rects),{x:u,y:d}=Ic(l,f,c)),g=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:x}},Eb=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:c}=t,{element:l,padding:u=0}=it(e,t)||{};if(l==null)return{};const d=vd(u),f={x:n,y:r},p=Ai(o),x=Ei(p),g=await i.getDimensions(l),y=p==="y",v=y?"top":"left",w=y?"bottom":"right",S=y?"clientHeight":"clientWidth",C=s.reference[x]+s.reference[p]-f[p]-s.floating[x],T=f[p]-s.reference[p],E=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l));let P=E?E[S]:0;(!P||!await(i.isElement==null?void 0:i.isElement(E)))&&(P=a.floating[S]||s.floating[x]);const A=C/2-T/2,j=P/2-g[x]/2-1,k=xt(d[v],j),V=xt(d[w],j),H=k,Y=P-g[x]-V,G=P/2-g[x]/2+A,K=js(H,G,Y),D=!c.arrow&&mn(o)!=null&&G!==K&&s.reference[x]/2-(G<H?k:V)-g[x]/2<0,W=D?G<H?G-H:G-Y:0;return{[p]:f[p]+W,data:{[p]:K,centerOffset:G-K-W,...D&&{alignmentOffset:W}},reset:D}}}),Ab=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:g=!0,...y}=it(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const v=at(o),w=et(a),S=at(a)===a,C=await(c.isRTL==null?void 0:c.isRTL(l.floating)),T=f||(S||!g?[Or(a)]:vb(a)),E=x!=="none";!f&&E&&T.push(...Sb(a,g,x,C));const P=[a,...T],A=await c.detectOverflow(t,y),j=[];let k=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&j.push(A[v]),d){const G=yb(o,i,C);j.push(A[G[0]],A[G[1]])}if(k=[...k,{placement:o,overflows:j}],!j.every(G=>G<=0)){var V,H;const G=(((V=s.flip)==null?void 0:V.index)||0)+1,K=P[G];if(K&&(!(d==="alignment"?w!==et(K):!1)||k.every(I=>et(I.placement)===w?I.overflows[0]>0:!0)))return{data:{index:G,overflows:k},reset:{placement:K}};let D=(H=k.filter(W=>W.overflows[0]<=0).sort((W,I)=>W.overflows[1]-I.overflows[1])[0])==null?void 0:H.placement;if(!D)switch(p){case"bestFit":{var Y;const W=(Y=k.filter(I=>{if(E){const q=et(I.placement);return q===w||q==="y"}return!0}).map(I=>[I.placement,I.overflows.filter(q=>q>0).reduce((q,se)=>q+se,0)]).sort((I,q)=>I[1]-q[1])[0])==null?void 0:Y[0];W&&(D=W);break}case"initialPlacement":D=a;break}if(o!==D)return{reset:{placement:D}}}return{}}}};function jc(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Oc(e){return mb.some(t=>e[t]>=0)}const Db=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...s}=it(e,t);switch(o){case"referenceHidden":{const i=await r.detectOverflow(t,{...s,elementContext:"reference"}),a=jc(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Oc(a)}}}case"escaped":{const i=await r.detectOverflow(t,{...s,altBoundary:!0}),a=jc(i,n.floating);return{data:{escapedOffsets:a,escaped:Oc(a)}}}default:return{}}}}},xd=new Set(["left","top"]);async function Mb(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=at(n),a=mn(n),c=et(n)==="y",l=xd.has(i)?-1:1,u=s&&c?-1:1,d=it(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:x}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof x=="number"&&(p=a==="end"?x*-1:x),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}const kb=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,c=await Mb(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:s+c.y,data:{...c,placement:i}}}}},Nb=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:s}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:c={fn:v=>{let{x:w,y:S}=v;return{x:w,y:S}}},...l}=it(e,t),u={x:n,y:r},d=await s.detectOverflow(t,l),f=et(at(o)),p=Ri(f);let x=u[p],g=u[f];if(i){const v=p==="y"?"top":"left",w=p==="y"?"bottom":"right",S=x+d[v],C=x-d[w];x=js(S,x,C)}if(a){const v=f==="y"?"top":"left",w=f==="y"?"bottom":"right",S=g+d[v],C=g-d[w];g=js(S,g,C)}const y=c.fn({...t,[p]:x,[f]:g});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[p]:i,[f]:a}}}}}},Ib=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=it(e,t),u={x:n,y:r},d=et(o),f=Ri(d);let p=u[f],x=u[d];const g=it(a,t),y=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){const S=f==="y"?"height":"width",C=s.reference[f]-s.floating[S]+y.mainAxis,T=s.reference[f]+s.reference[S]-y.mainAxis;p<C?p=C:p>T&&(p=T)}if(l){var v,w;const S=f==="y"?"width":"height",C=xd.has(at(o)),T=s.reference[d]-s.floating[S]+(C&&((v=i.offset)==null?void 0:v[d])||0)+(C?0:y.crossAxis),E=s.reference[d]+s.reference[S]+(C?0:((w=i.offset)==null?void 0:w[d])||0)-(C?y.crossAxis:0);x<T?x=T:x>E&&(x=E)}return{[f]:p,[d]:x}}}},jb=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:c=()=>{},...l}=it(e,t),u=await i.detectOverflow(t,l),d=at(o),f=mn(o),p=et(o)==="y",{width:x,height:g}=s.floating;let y,v;d==="top"||d==="bottom"?(y=d,v=f===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(v=d,y=f==="end"?"top":"bottom");const w=g-u.top-u.bottom,S=x-u.left-u.right,C=xt(g-u[y],w),T=xt(x-u[v],S),E=!t.middlewareData.shift;let P=C,A=T;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(A=S),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(P=w),E&&!f){const k=je(u.left,0),V=je(u.right,0),H=je(u.top,0),Y=je(u.bottom,0);p?A=x-2*(k!==0||V!==0?k+V:je(u.left,u.right)):P=g-2*(H!==0||Y!==0?H+Y:je(u.top,u.bottom))}await c({...t,availableWidth:A,availableHeight:P});const j=await i.getDimensions(a.floating);return x!==j.width||g!==j.height?{reset:{rects:!0}}:{}}}};function Jr(){return typeof window<"u"}function gn(e){return wd(e)?(e.nodeName||"").toLowerCase():"#document"}function Oe(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ot(e){var t;return(t=(wd(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function wd(e){return Jr()?e instanceof Node||e instanceof Oe(e).Node:!1}function Ge(e){return Jr()?e instanceof Element||e instanceof Oe(e).Element:!1}function ct(e){return Jr()?e instanceof HTMLElement||e instanceof Oe(e).HTMLElement:!1}function Lc(e){return!Jr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Oe(e).ShadowRoot}function Fn(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Ke(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function Ob(e){return/^(table|td|th)$/.test(gn(e))}function eo(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const Lb=/transform|translate|scale|rotate|perspective|filter/,Vb=/paint|layout|strict|content/,Nt=e=>!!e&&e!=="none";let Yo;function Di(e){const t=Ge(e)?Ke(e):e;return Nt(t.transform)||Nt(t.translate)||Nt(t.scale)||Nt(t.rotate)||Nt(t.perspective)||!Mi()&&(Nt(t.backdropFilter)||Nt(t.filter))||Lb.test(t.willChange||"")||Vb.test(t.contain||"")}function Fb(e){let t=wt(e);for(;ct(t)&&!ln(t);){if(Di(t))return t;if(eo(t))return null;t=wt(t)}return null}function Mi(){return Yo==null&&(Yo=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Yo}function ln(e){return/^(html|body|#document)$/.test(gn(e))}function Ke(e){return Oe(e).getComputedStyle(e)}function to(e){return Ge(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function wt(e){if(gn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Lc(e)&&e.host||ot(e);return Lc(t)?t.host:t}function bd(e){const t=wt(e);return ln(t)?e.ownerDocument?e.ownerDocument.body:e.body:ct(t)&&Fn(t)?t:bd(t)}function kn(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=bd(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=Oe(o);if(s){const a=Ls(i);return t.concat(i,i.visualViewport||[],Fn(o)?o:[],a&&n?kn(a):[])}else return t.concat(o,kn(o,[],n))}function Ls(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Sd(e){const t=Ke(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ct(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=jr(n)!==s||jr(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function ki(e){return Ge(e)?e:e.contextElement}function rn(e){const t=ki(e);if(!ct(t))return nt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Sd(t);let i=(s?jr(n.width):n.width)/r,a=(s?jr(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const _b=nt(0);function Cd(e){const t=Oe(e);return!Mi()||!t.visualViewport?_b:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Bb(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Oe(e)?!1:t}function _t(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=ki(e);let i=nt(1);t&&(r?Ge(r)&&(i=rn(r)):i=rn(e));const a=Bb(s,n,r)?Cd(s):nt(0);let c=(o.left+a.x)/i.x,l=(o.top+a.y)/i.y,u=o.width/i.x,d=o.height/i.y;if(s){const f=Oe(s),p=r&&Ge(r)?Oe(r):r;let x=f,g=Ls(x);for(;g&&r&&p!==x;){const y=rn(g),v=g.getBoundingClientRect(),w=Ke(g),S=v.left+(g.clientLeft+parseFloat(w.paddingLeft))*y.x,C=v.top+(g.clientTop+parseFloat(w.paddingTop))*y.y;c*=y.x,l*=y.y,u*=y.x,d*=y.y,c+=S,l+=C,x=Oe(g),g=Ls(x)}}return Lr({width:u,height:d,x:c,y:l})}function no(e,t){const n=to(e).scrollLeft;return t?t.left+n:_t(ot(e)).left+n}function Td(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-no(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function $b(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=ot(r),a=t?eo(t.floating):!1;if(r===i||a&&s)return n;let c={scrollLeft:0,scrollTop:0},l=nt(1);const u=nt(0),d=ct(r);if((d||!d&&!s)&&((gn(r)!=="body"||Fn(i))&&(c=to(r)),d)){const p=_t(r);l=rn(r),u.x=p.x+r.clientLeft,u.y=p.y+r.clientTop}const f=i&&!d&&!s?Td(i,c):nt(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Wb(e){return Array.from(e.getClientRects())}function Ub(e){const t=ot(e),n=to(e),r=e.ownerDocument.body,o=je(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=je(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+no(e);const a=-n.scrollTop;return Ke(r).direction==="rtl"&&(i+=je(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}const Vc=25;function Hb(e,t){const n=Oe(e),r=ot(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,c=0;if(o){s=o.width,i=o.height;const u=Mi();(!u||u&&t==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}const l=no(r);if(l<=0){const u=r.ownerDocument,d=u.body,f=getComputedStyle(d),p=u.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,x=Math.abs(r.clientWidth-d.clientWidth-p);x<=Vc&&(s-=x)}else l<=Vc&&(s+=l);return{width:s,height:i,x:a,y:c}}function Gb(e,t){const n=_t(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=ct(e)?rn(e):nt(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,c=o*s.x,l=r*s.y;return{width:i,height:a,x:c,y:l}}function Fc(e,t,n){let r;if(t==="viewport")r=Hb(e,n);else if(t==="document")r=Ub(ot(e));else if(Ge(t))r=Gb(t,n);else{const o=Cd(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Lr(r)}function Pd(e,t){const n=wt(e);return n===t||!Ge(n)||ln(n)?!1:Ke(n).position==="fixed"||Pd(n,t)}function Kb(e,t){const n=t.get(e);if(n)return n;let r=kn(e,[],!1).filter(a=>Ge(a)&&gn(a)!=="body"),o=null;const s=Ke(e).position==="fixed";let i=s?wt(e):e;for(;Ge(i)&&!ln(i);){const a=Ke(i),c=Di(i);!c&&a.position==="fixed"&&(o=null),(s?!c&&!o:!c&&a.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||Fn(i)&&!c&&Pd(e,i))?r=r.filter(u=>u!==i):o=a,i=wt(i)}return t.set(e,r),r}function zb(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?eo(t)?[]:Kb(t,this._c):[].concat(n),r],a=Fc(t,i[0],o);let c=a.top,l=a.right,u=a.bottom,d=a.left;for(let f=1;f<i.length;f++){const p=Fc(t,i[f],o);c=je(p.top,c),l=xt(p.right,l),u=xt(p.bottom,u),d=je(p.left,d)}return{width:l-d,height:u-c,x:d,y:c}}function Yb(e){const{width:t,height:n}=Sd(e);return{width:t,height:n}}function Xb(e,t,n){const r=ct(t),o=ot(t),s=n==="fixed",i=_t(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const c=nt(0);function l(){c.x=no(o)}if(r||!r&&!s)if((gn(t)!=="body"||Fn(o))&&(a=to(t)),r){const p=_t(t,!0,s,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}else o&&l();s&&!r&&o&&l();const u=o&&!r&&!s?Td(o,a):nt(0),d=i.left+a.scrollLeft-c.x-u.x,f=i.top+a.scrollTop-c.y-u.y;return{x:d,y:f,width:i.width,height:i.height}}function Xo(e){return Ke(e).position==="static"}function _c(e,t){if(!ct(e)||Ke(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ot(e)===n&&(n=n.ownerDocument.body),n}function Rd(e,t){const n=Oe(e);if(eo(e))return n;if(!ct(e)){let o=wt(e);for(;o&&!ln(o);){if(Ge(o)&&!Xo(o))return o;o=wt(o)}return n}let r=_c(e,t);for(;r&&Ob(r)&&Xo(r);)r=_c(r,t);return r&&ln(r)&&Xo(r)&&!Di(r)?n:r||Fb(e)||n}const qb=async function(e){const t=this.getOffsetParent||Rd,n=this.getDimensions,r=await n(e.floating);return{reference:Xb(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Zb(e){return Ke(e).direction==="rtl"}const Qb={convertOffsetParentRelativeRectToViewportRelativeRect:$b,getDocumentElement:ot,getClippingRect:zb,getOffsetParent:Rd,getElementRects:qb,getClientRects:Wb,getDimensions:Yb,getScale:rn,isElement:Ge,isRTL:Zb};function Ed(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Jb(e,t){let n=null,r;const o=ot(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(a||t(),!f||!p)return;const x=Jn(d),g=Jn(o.clientWidth-(u+f)),y=Jn(o.clientHeight-(d+p)),v=Jn(u),S={rootMargin:-x+"px "+-g+"px "+-y+"px "+-v+"px",threshold:je(0,xt(1,c))||1};let C=!0;function T(E){const P=E[0].intersectionRatio;if(P!==c){if(!C)return i();P?i(!1,P):r=setTimeout(()=>{i(!1,1e-7)},1e3)}P===1&&!Ed(l,e.getBoundingClientRect())&&i(),C=!1}try{n=new IntersectionObserver(T,{...S,root:o.ownerDocument})}catch{n=new IntersectionObserver(T,S)}n.observe(e)}return i(!0),s}function e0(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,l=ki(e),u=o||s?[...l?kn(l):[],...t?kn(t):[]]:[];u.forEach(v=>{o&&v.addEventListener("scroll",n,{passive:!0}),s&&v.addEventListener("resize",n)});const d=l&&a?Jb(l,n):null;let f=-1,p=null;i&&(p=new ResizeObserver(v=>{let[w]=v;w&&w.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var S;(S=p)==null||S.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let x,g=c?_t(e):null;c&&y();function y(){const v=_t(e);g&&!Ed(g,v)&&n(),g=v,x=requestAnimationFrame(y)}return n(),()=>{var v;u.forEach(w=>{o&&w.removeEventListener("scroll",n),s&&w.removeEventListener("resize",n)}),d==null||d(),(v=p)==null||v.disconnect(),p=null,c&&cancelAnimationFrame(x)}}const t0=kb,n0=Nb,r0=Ab,o0=jb,s0=Db,Bc=Eb,i0=Ib,a0=(e,t,n)=>{const r=new Map,o={platform:Qb,...n},s={...o.platform,_c:r};return Rb(e,t,{...o,platform:s})};var c0=typeof document<"u",l0=function(){},xr=c0?b.useLayoutEffect:l0;function Vr(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Vr(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Vr(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Ad(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function $c(e,t){const n=Ad(e);return Math.round(t*n)/n}function qo(e){const t=m.useRef(e);return xr(()=>{t.current=e}),t}function u0(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:c,open:l}=e,[u,d]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=m.useState(r);Vr(f,r)||p(r);const[x,g]=m.useState(null),[y,v]=m.useState(null),w=m.useCallback(I=>{I!==E.current&&(E.current=I,g(I))},[]),S=m.useCallback(I=>{I!==P.current&&(P.current=I,v(I))},[]),C=s||x,T=i||y,E=m.useRef(null),P=m.useRef(null),A=m.useRef(u),j=c!=null,k=qo(c),V=qo(o),H=qo(l),Y=m.useCallback(()=>{if(!E.current||!P.current)return;const I={placement:t,strategy:n,middleware:f};V.current&&(I.platform=V.current),a0(E.current,P.current,I).then(q=>{const se={...q,isPositioned:H.current!==!1};G.current&&!Vr(A.current,se)&&(A.current=se,Wr.flushSync(()=>{d(se)}))})},[f,t,n,V,H]);xr(()=>{l===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,d(I=>({...I,isPositioned:!1})))},[l]);const G=m.useRef(!1);xr(()=>(G.current=!0,()=>{G.current=!1}),[]),xr(()=>{if(C&&(E.current=C),T&&(P.current=T),C&&T){if(k.current)return k.current(C,T,Y);Y()}},[C,T,Y,k,j]);const K=m.useMemo(()=>({reference:E,floating:P,setReference:w,setFloating:S}),[w,S]),D=m.useMemo(()=>({reference:C,floating:T}),[C,T]),W=m.useMemo(()=>{const I={position:n,left:0,top:0};if(!D.floating)return I;const q=$c(D.floating,u.x),se=$c(D.floating,u.y);return a?{...I,transform:"translate("+q+"px, "+se+"px)",...Ad(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:q,top:se}},[n,a,D.floating,u.x,u.y]);return m.useMemo(()=>({...u,update:Y,refs:K,elements:D,floatingStyles:W}),[u,Y,K,D,W])}const d0=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Bc({element:r.current,padding:o}).fn(n):{}:r?Bc({element:r,padding:o}).fn(n):{}}}},f0=(e,t)=>{const n=t0(e);return{name:n.name,fn:n.fn,options:[e,t]}},h0=(e,t)=>{const n=n0(e);return{name:n.name,fn:n.fn,options:[e,t]}},p0=(e,t)=>({fn:i0(e).fn,options:[e,t]}),m0=(e,t)=>{const n=r0(e);return{name:n.name,fn:n.fn,options:[e,t]}},g0=(e,t)=>{const n=o0(e);return{name:n.name,fn:n.fn,options:[e,t]}},y0=(e,t)=>{const n=s0(e);return{name:n.name,fn:n.fn,options:[e,t]}},v0=(e,t)=>{const n=d0(e);return{name:n.name,fn:n.fn,options:[e,t]}};var x0="Arrow",Dd=m.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return h.jsx(z.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:h.jsx("polygon",{points:"0,0 30,0 15,10"})})});Dd.displayName=x0;var w0=Dd;function ro(e){const[t,n]=m.useState(void 0);return Ce(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const c=s.borderBoxSize,l=Array.isArray(c)?c[0]:c;i=l.inlineSize,a=l.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Ni="Popper",[Md,oo]=ze(Ni),[b0,kd]=Md(Ni),Nd=e=>{const{__scopePopper:t,children:n}=e,[r,o]=m.useState(null);return h.jsx(b0,{scope:t,anchor:r,onAnchorChange:o,children:n})};Nd.displayName=Ni;var Id="PopperAnchor",jd=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=kd(Id,n),i=m.useRef(null),a=re(t,i),c=m.useRef(null);return m.useEffect(()=>{const l=c.current;c.current=(r==null?void 0:r.current)||i.current,l!==c.current&&s.onAnchorChange(c.current)}),r?null:h.jsx(z.div,{...o,ref:a})});jd.displayName=Id;var Ii="PopperContent",[S0,C0]=Md(Ii),Od=m.forwardRef((e,t)=>{var N,L,te,ne,oe,F;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:p="optimized",onPlaced:x,...g}=e,y=kd(Ii,n),[v,w]=m.useState(null),S=re(t,ve=>w(ve)),[C,T]=m.useState(null),E=ro(C),P=(E==null?void 0:E.width)??0,A=(E==null?void 0:E.height)??0,j=r+(s!=="center"?"-"+s:""),k=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},V=Array.isArray(l)?l:[l],H=V.length>0,Y={padding:k,boundary:V.filter(P0),altBoundary:H},{refs:G,floatingStyles:K,placement:D,isPositioned:W,middlewareData:I}=u0({strategy:"fixed",placement:j,whileElementsMounted:(...ve)=>e0(...ve,{animationFrame:p==="always"}),elements:{reference:y.anchor},middleware:[f0({mainAxis:o+A,alignmentAxis:i}),c&&h0({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?p0():void 0,...Y}),c&&m0({...Y}),g0({...Y,apply:({elements:ve,rects:Le,availableWidth:At,availableHeight:he})=>{const{width:Te,height:$n}=Le.reference,ie=ve.floating.style;ie.setProperty("--radix-popper-available-width",`${At}px`),ie.setProperty("--radix-popper-available-height",`${he}px`),ie.setProperty("--radix-popper-anchor-width",`${Te}px`),ie.setProperty("--radix-popper-anchor-height",`${$n}px`)}}),C&&v0({element:C,padding:a}),R0({arrowWidth:P,arrowHeight:A}),f&&y0({strategy:"referenceHidden",...Y})]}),[q,se]=Fd(D),ae=vt(x);Ce(()=>{W&&(ae==null||ae())},[W,ae]);const M=(N=I.arrow)==null?void 0:N.x,X=(L=I.arrow)==null?void 0:L.y,Z=((te=I.arrow)==null?void 0:te.centerOffset)!==0,[U,ee]=m.useState();return Ce(()=>{v&&ee(window.getComputedStyle(v).zIndex)},[v]),h.jsx("div",{ref:G.setFloating,"data-radix-popper-content-wrapper":"",style:{...K,transform:W?K.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:U,"--radix-popper-transform-origin":[(ne=I.transformOrigin)==null?void 0:ne.x,(oe=I.transformOrigin)==null?void 0:oe.y].join(" "),...((F=I.hide)==null?void 0:F.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:h.jsx(S0,{scope:n,placedSide:q,onArrowChange:T,arrowX:M,arrowY:X,shouldHideArrow:Z,children:h.jsx(z.div,{"data-side":q,"data-align":se,...g,ref:S,style:{...g.style,animation:W?void 0:"none"}})})})});Od.displayName=Ii;var Ld="PopperArrow",T0={top:"bottom",right:"left",bottom:"top",left:"right"},Vd=m.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=C0(Ld,r),i=T0[s.placedSide];return h.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:h.jsx(w0,{...o,ref:n,style:{...o.style,display:"block"}})})});Vd.displayName=Ld;function P0(e){return e!==null}var R0=e=>({name:"transformOrigin",options:e,fn(t){var y,v,w;const{placement:n,rects:r,middlewareData:o}=t,i=((y=o.arrow)==null?void 0:y.centerOffset)!==0,a=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[l,u]=Fd(n),d={start:"0%",center:"50%",end:"100%"}[u],f=(((v=o.arrow)==null?void 0:v.x)??0)+a/2,p=(((w=o.arrow)==null?void 0:w.y)??0)+c/2;let x="",g="";return l==="bottom"?(x=i?d:`${f}px`,g=`${-c}px`):l==="top"?(x=i?d:`${f}px`,g=`${r.floating.height+c}px`):l==="right"?(x=`${-c}px`,g=i?d:`${p}px`):l==="left"&&(x=`${r.floating.width+c}px`,g=i?d:`${p}px`),{data:{x,y:g}}}});function Fd(e){const[t,n="center"]=e.split("-");return[t,n]}var _d=Nd,ji=jd,Bd=Od,$d=Vd,E0="Portal",so=m.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,s]=m.useState(!1);Ce(()=>s(!0),[]);const i=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?$r.createPortal(h.jsx(z.div,{...r,ref:t}),i):null});so.displayName=E0;function io(e){const t=m.useRef({value:e,previous:e});return m.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Wd=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),A0="VisuallyHidden",Ud=m.forwardRef((e,t)=>h.jsx(z.span,{...e,ref:t,style:{...Wd,...e.style}}));Ud.displayName=A0;var D0=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},zt=new WeakMap,er=new WeakMap,tr={},Zo=0,Hd=function(e){return e&&(e.host||Hd(e.parentNode))},M0=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Hd(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},k0=function(e,t,n,r){var o=M0(t,Array.isArray(e)?e:[e]);tr[n]||(tr[n]=new WeakMap);var s=tr[n],i=[],a=new Set,c=new Set(o),l=function(d){!d||a.has(d)||(a.add(d),l(d.parentNode))};o.forEach(l);var u=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(f){if(a.has(f))u(f);else try{var p=f.getAttribute(r),x=p!==null&&p!=="false",g=(zt.get(f)||0)+1,y=(s.get(f)||0)+1;zt.set(f,g),s.set(f,y),i.push(f),g===1&&x&&er.set(f,!0),y===1&&f.setAttribute(n,"true"),x||f.setAttribute(r,"true")}catch(v){console.error("aria-hidden: cannot operate on ",f,v)}})};return u(t),a.clear(),Zo++,function(){i.forEach(function(d){var f=zt.get(d)-1,p=s.get(d)-1;zt.set(d,f),s.set(d,p),f||(er.has(d)||d.removeAttribute(r),er.delete(d)),p||d.removeAttribute(n)}),Zo--,Zo||(zt=new WeakMap,zt=new WeakMap,er=new WeakMap,tr={})}},Oi=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=D0(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),k0(r,o,n,"aria-hidden")):function(){return null}},Je=function(){return Je=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},Je.apply(this,arguments)};function Gd(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function N0(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var wr="right-scroll-bar-position",br="width-before-scroll-bar",I0="with-scroll-bars-hidden",j0="--removed-body-scroll-bar-size";function Qo(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function O0(e,t){var n=b.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var L0=typeof window<"u"?m.useLayoutEffect:m.useEffect,Wc=new WeakMap;function V0(e,t){var n=O0(null,function(r){return e.forEach(function(o){return Qo(o,r)})});return L0(function(){var r=Wc.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||Qo(a,null)}),s.forEach(function(a){o.has(a)||Qo(a,i)})}Wc.set(n,e)},[e]),n}function F0(e){return e}function _0(e,t){t===void 0&&(t=F0);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(s),i=n}var c=function(){var u=i;i=[],u.forEach(s)},l=function(){return Promise.resolve().then(c)};l(),n={push:function(u){i.push(u),l()},filter:function(u){return i=i.filter(u),n}}}};return o}function B0(e){e===void 0&&(e={});var t=_0(null);return t.options=Je({async:!0,ssr:!1},e),t}var Kd=function(e){var t=e.sideCar,n=Gd(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return m.createElement(r,Je({},n))};Kd.isSideCarExport=!0;function $0(e,t){return e.useMedium(t),Kd}var zd=B0(),Jo=function(){},ao=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:Jo,onWheelCapture:Jo,onTouchMoveCapture:Jo}),o=r[0],s=r[1],i=e.forwardProps,a=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,x=e.noIsolation,g=e.inert,y=e.allowPinchZoom,v=e.as,w=v===void 0?"div":v,S=e.gapMode,C=Gd(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=f,E=V0([n,t]),P=Je(Je({},C),o);return m.createElement(m.Fragment,null,u&&m.createElement(T,{sideCar:zd,removeScrollBar:l,shards:d,noRelative:p,noIsolation:x,inert:g,setCallbacks:s,allowPinchZoom:!!y,lockRef:n,gapMode:S}),i?m.cloneElement(m.Children.only(a),Je(Je({},P),{ref:E})):m.createElement(w,Je({},P,{className:c,ref:E}),a))});ao.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ao.classNames={fullWidth:br,zeroRight:wr};var W0=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function U0(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=W0();return t&&e.setAttribute("nonce",t),e}function H0(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function G0(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var K0=function(){var e=0,t=null;return{add:function(n){e==0&&(t=U0())&&(H0(t,n),G0(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},z0=function(){var e=K0();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Yd=function(){var e=z0(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Y0={left:0,top:0,right:0,gap:0},es=function(e){return parseInt(e||"",10)||0},X0=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[es(n),es(r),es(o)]},q0=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Y0;var t=X0(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Z0=Yd(),on="data-scroll-locked",Q0=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
130
|
-
.`.concat(
|
|
144
|
+
*/const jS=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],jt=ge("x",jS),kS=w.forwardRef(function({color:t="primary",size:n,prefix:r,suffix:o,clearable:s=!1,onClear:i,showPasswordToggle:a=!1,type:c="text",disabled:u,className:d,value:f,defaultValue:h,onChange:m,...y},g){const v=f!==void 0,[x,b]=w.useState(h!=null?String(h):""),C=v?String(f??""):x,S=w.useRef(null);w.useImperativeHandle(g,()=>S.current,[]);const[R,P]=w.useState(!1),T=a&&R&&c==="password"?"text":c,A=s&&!u&&C!=="",k=A||a,N=r!=null||o!=null||k,L=Z=>{v||b(Z.target.value),m==null||m(Z)},G=Z=>{var U;Z.preventDefault(),v||b("");const D=S.current;if(D){const j=(U=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value"))==null?void 0:U.set;j==null||j.call(D,""),D.dispatchEvent(new Event("input",{bubbles:!0}))}i==null||i()},J=_("input",t!=="primary"&&t,n==="sm"||n==="lg"?n:null,d),F=l.jsx("input",{ref:S,type:T,className:J,disabled:u,value:v?f:void 0,defaultValue:v?void 0:h,onChange:L,...y});return N?l.jsxs("span",{className:_("cny-input-affix",r!=null&&"has-prefix",o!=null&&!k&&"has-suffix",k&&"has-action"),children:[r!=null&&l.jsx("span",{className:"cny-input-prefix",children:r}),F,o!=null&&!k&&l.jsx("span",{className:"cny-input-suffix",children:o}),A&&l.jsx("button",{type:"button",className:"cny-input-action",onClick:G,"aria-label":"Clear",tabIndex:-1,children:l.jsx(jt,{size:14,"aria-hidden":"true"})}),a&&c==="password"&&l.jsx("button",{type:"button",className:"cny-input-action",onClick:()=>P(Z=>!Z),"aria-label":R?"Hide password":"Show password","aria-pressed":R,style:A?{right:36}:void 0,children:R?l.jsx(CS,{size:14,"aria-hidden":"true"}):l.jsx(RS,{size:14,"aria-hidden":"true"})})]}):F}),IS=w.forwardRef(function({color:t="default",className:n,children:r,...o},s){const i=_("card",t!=="default"&&t,n);return l.jsx("div",{ref:s,className:i,...o,children:r})}),_S={info:l.jsxs(l.Fragment,{children:[l.jsx("circle",{cx:"12",cy:"12",r:"9"}),l.jsx("path",{d:"M12 11v5"}),l.jsx("path",{d:"M12 8h.01"})]}),success:l.jsxs(l.Fragment,{children:[l.jsx("circle",{cx:"12",cy:"12",r:"9"}),l.jsx("path",{d:"m8.5 12.5 2.5 2.5 4.5-5"})]}),warning:l.jsxs(l.Fragment,{children:[l.jsx("path",{d:"M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0Z"}),l.jsx("path",{d:"M12 9v4"}),l.jsx("path",{d:"M12 17h.01"})]}),danger:l.jsxs(l.Fragment,{children:[l.jsx("circle",{cx:"12",cy:"12",r:"9"}),l.jsx("path",{d:"m9 9 6 6"}),l.jsx("path",{d:"m15 9-6 6"})]})};function OS({color:e}){return l.jsx("svg",{className:"alert-icon-glyph",viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:_S[e]})}const LS=w.forwardRef(function({color:t="info",solid:n=!1,title:r,className:o,children:s,icon:i,action:a,onDismiss:c,dismissLabel:u="Dismiss",...d},f){const h=i!==!1,m=i&&i!==!0?i:l.jsx(OS,{color:t}),y=_("alert",t,n&&"solid",o),g=t==="danger"?"alert":"status";return l.jsxs("div",{ref:f,role:g,className:y,...d,children:[h&&l.jsx("span",{className:"alert-icon","aria-hidden":"true",children:m}),l.jsxs("div",{className:"alert-content",children:[r&&l.jsx("p",{className:"alert-title",children:r}),s&&l.jsx("p",{className:"alert-body",children:s})]}),a&&l.jsx("div",{className:"alert-action",children:a}),c&&l.jsx("button",{type:"button",className:"alert-close",onClick:c,"aria-label":u,children:l.jsxs("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:[l.jsx("path",{d:"M18 6 6 18"}),l.jsx("path",{d:"m6 6 12 12"})]})})]})}),VS=w.forwardRef(function({size:t="md",status:n,src:r,alt:o,className:s,children:i,...a},c){const u=_("avatar",t!=="md"&&t,n,s);return l.jsx("span",{ref:c,className:u,...a,children:r?l.jsx("img",{src:r,alt:o??""}):i})}),FS=w.forwardRef(function({className:t,children:n,...r},o){return l.jsx("div",{ref:o,className:_("avatar-stack",t),...r,children:n})}),$S=w.forwardRef(function({value:t=0,color:n="primary",indeterminate:r=!1,className:o,style:s,...i},a){const c=_("progress",r&&"indeterminate",n!=="primary"&&n,o),u=Math.max(0,Math.min(100,t)),d=r?s??{}:{...s??{},"--value":`${u}%`};return l.jsx("div",{ref:a,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":r?void 0:u,className:c,style:d,...i,children:l.jsx("span",{className:"progress-bar"})})}),BS=w.forwardRef(function({value:t,size:n="md",showLabel:r=!0,className:o,style:s,...i},a){const c=Math.max(0,Math.min(100,t)),u=_("progress-ring",n==="lg"&&"lg",o),d={...s??{},"--value":c};return l.jsx("span",{ref:a,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":c,className:u,style:d,...i,children:r&&l.jsxs("span",{children:[c,"%"]})})}),WS={both:{overflowX:"auto",overflowY:"auto"},x:{overflowX:"auto",overflowY:"hidden"},y:{overflowX:"hidden",overflowY:"auto"}},jf=w.forwardRef(function({variant:t="default",tone:n="neutral",axis:r="both",maxHeight:o,maxWidth:s,region:i=!1,className:a,style:c,children:u,...d},f){const h=_(i?"cny-scroll-region":"cny-scroll",t!=="default"&&t,n==="primary"&&"primary",a);return l.jsx("div",{ref:f,className:h,style:{...WS[r],maxHeight:o,maxWidth:s,...c??{}},...d,children:u})}),GS=w.forwardRef(function(t,n){return l.jsx(jf,{ref:n,region:!0,...t})}),US=w.forwardRef(function({shape:t="text",width:n,height:r,className:o,style:s,...i},a){return l.jsx("span",{ref:a,"aria-hidden":"true",className:_("skeleton",t,o),style:{...s??{},width:n,height:r},...i})}),KS=w.forwardRef(function({solid:t=!1,className:n,children:r,...o},s){return l.jsx("header",{ref:s,className:_("cny-navbar",t&&"solid",n),...o,children:r})}),HS=w.forwardRef(function({mark:t=!0,className:n,children:r,...o},s){return l.jsxs("a",{ref:s,className:_("cny-navbar-brand",n),...o,children:[t&&l.jsx("span",{className:"brand-mark","aria-hidden":"true"}),r]})}),zS=w.forwardRef(function({className:t,children:n,...r},o){return l.jsx("nav",{ref:o,className:_("cny-navbar-nav",t),...r,children:n})}),YS=w.forwardRef(function({active:t=!1,className:n,children:r,...o},s){return l.jsx("a",{ref:s,"aria-current":t?"page":void 0,className:_("cny-navbar-item",t&&"active",n),...o,children:r})}),XS=w.forwardRef(function({className:t,children:n,...r},o){return l.jsx("div",{ref:o,className:_("cny-navbar-actions",t),...r,children:n})}),qS=w.forwardRef(function({width:t="default",sticky:n=!1,collapsed:r=!1,responsive:o=!1,className:s,children:i,...a},c){return l.jsx("aside",{ref:c,className:_("cny-sidebar",t!=="default"&&t,n&&"sticky",r&&"collapsed",o&&"responsive",s),...a,children:i})}),ZS=w.forwardRef(function({title:t,className:n,children:r,...o},s){return l.jsxs("div",{ref:s,className:_("cny-sidebar-section",n),...o,children:[t&&l.jsx("div",{className:"cny-sidebar-title",children:t}),l.jsx("nav",{className:"cny-sidebar-nav",children:r})]})}),QS=w.forwardRef(function({active:t=!1,disabled:n=!1,icon:r,badge:o,className:s,children:i,...a},c){return l.jsxs("a",{ref:c,"aria-current":t?"page":void 0,"aria-disabled":n||void 0,className:_("cny-sidebar-item",t&&"active",n&&"disabled",s),...a,children:[r&&l.jsx("span",{className:"cny-sidebar-item-icon","aria-hidden":"true",children:r}),l.jsx("span",{children:i}),o&&l.jsx("span",{className:"cny-sidebar-item-badge",children:o})]})});function JS(e){const t=[];return e.display&&t.push(e.display),e.direction==="row"?t.push("flex-row"):e.direction==="column"?t.push("flex-col"):e.direction==="row-reverse"?t.push("flex-row-reverse"):e.direction==="column-reverse"&&t.push("flex-col-reverse"),e.align&&t.push(`items-${e.align==="start"||e.align==="end",e.align}`),e.justify&&t.push(`justify-${e.justify}`),e.wrap&&t.push("flex-wrap"),e.p!==void 0&&t.push(`p-${e.p}`),e.px!==void 0&&t.push(`px-${e.px}`),e.py!==void 0&&t.push(`py-${e.py}`),e.pt!==void 0&&t.push(`pt-${e.pt}`),e.pr!==void 0&&t.push(`pr-${e.pr}`),e.pb!==void 0&&t.push(`pb-${e.pb}`),e.pl!==void 0&&t.push(`pl-${e.pl}`),e.m!==void 0&&t.push(`m-${e.m}`),e.mx!==void 0&&t.push(`mx-${e.mx}`),e.my!==void 0&&t.push(`my-${e.my}`),e.mt!==void 0&&t.push(`mt-${e.mt}`),e.mr!==void 0&&t.push(`mr-${e.mr}`),e.mb!==void 0&&t.push(`mb-${e.mb}`),e.ml!==void 0&&t.push(`ml-${e.ml}`),e.gap!==void 0&&t.push(`gap-${e.gap}`),e.gapX!==void 0&&t.push(`gap-x-${e.gapX}`),e.gapY!==void 0&&t.push(`gap-y-${e.gapY}`),e.w&&t.push(`w-${e.w}`),e.h&&t.push(`h-${e.h}`),t}const en=w.forwardRef(function({as:t,className:n,children:r,...o},s){const i=t??"div",{layoutProps:a,domProps:c}=e0(o),u=_(...JS(a),n);return w.createElement(i,{ref:s,className:u||void 0,...c},r)});function e0(e){const t=new Set(["p","px","py","pt","pr","pb","pl","m","mx","my","mt","mr","mb","ml","gap","gapX","gapY","display","direction","align","justify","wrap","w","h"]),n={},r={};for(const[o,s]of Object.entries(e))t.has(o)?n[o]=s:r[o]=s;return{layoutProps:n,domProps:r}}const t0=w.forwardRef(function(t,n){return l.jsx(en,{ref:n,display:"flex",direction:"column",...t})}),n0=w.forwardRef(function(t,n){const{align:r="center",...o}=t;return l.jsx(en,{ref:n,display:"flex",direction:"row",align:r,...o})}),r0=w.forwardRef(function({cols:t,minColWidth:n,className:r,style:o,...s},i){const a=n?{gridTemplateColumns:`repeat(auto-fit, minmax(${n}, 1fr))`,...o}:o;return l.jsx(en,{ref:i,display:"grid",className:_(!n&&t&&`grid-cols-${t}`,r),style:a,...s})}),o0=w.forwardRef(function({size:t="lg",className:n,...r},o){return l.jsx(en,{ref:o,className:_("cny-container",t,n),...r})}),s0=w.forwardRef(function({orientation:t="horizontal",className:n,...r},o){const s=_("cny-divider",t,n);return t==="vertical"?l.jsx("span",{ref:o,role:"separator","aria-orientation":"vertical",className:s,...r}):l.jsx("hr",{ref:o,className:s,...r})}),i0=w.forwardRef(function({className:t,...n},r){return l.jsx("span",{ref:r,"aria-hidden":"true",className:_("cny-spacer",t),...n})}),a0=w.forwardRef(function({ratio:t=16/9,className:n,style:r,children:o,...s},i){const a={aspectRatio:String(t),...r};return l.jsx("div",{ref:i,className:_("aspect-ratio",n),style:a,...s,children:o})}),c0=w.forwardRef(function(t,n){return l.jsx(en,{ref:n,display:"flex",align:"center",justify:"center",...t})}),l0=w.forwardRef(function(t,n){const{align:r="center",gap:o=2,wrap:s=!0,...i}=t;return l.jsx(en,{ref:n,display:"flex",direction:"row",align:r,gap:o,wrap:s,...i})}),u0={display:"h1",h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",lead:"p",body:"p",small:"small",caption:"span",code:"code",kbd:"kbd"},d0=w.forwardRef(function({as:t,variant:n="body",weight:r,align:o,color:s,truncate:i=!1,className:a,children:c,...u},d){const f=t??u0[n],h=_("cny-text",`cny-text-${n}`,r&&`cny-weight-${r}`,o&&`cny-text-${o}`,s&&`text-${s}`,i&&"truncate",a);return w.createElement(f,{ref:d,className:h,...u},c)});function f0({label:e,hint:t,error:n,required:r=!1,optional:o=!1,counter:s,maxLength:i,state:a,className:c,children:u,...d}){const f=w.useId(),h=w.Children.only(u),m=h.props.id??f,y=n!=null&&n!==!1,g=a??(y?"danger":"default"),v=t||n?`${m}-hint`:void 0,x=w.cloneElement(h,{id:m,"aria-invalid":y||h.props["aria-invalid"]||void 0,"aria-describedby":v??h.props["aria-describedby"],className:_(h.props.className,g!=="default"&&g)}),b=i!=null&&s!=null&&s>i?"danger":"default";return l.jsxs("div",{className:_("cny-field",c),...d,children:[(e!=null||s!=null)&&l.jsxs("div",{className:"cny-field-label-row",children:[e!=null?l.jsxs("label",{htmlFor:m,className:"cny-field-label",children:[e,r&&l.jsx("span",{className:"cny-field-required","aria-hidden":"true",children:"*"}),o&&!r&&l.jsx("span",{className:"cny-field-optional",children:"optional"})]}):l.jsx("span",{}),s!=null&&l.jsx("span",{className:_("cny-field-counter",b==="danger"&&"danger"),"aria-live":"polite",children:i!=null?`${s}/${i}`:s})]}),x,(n||t)&&l.jsx("span",{id:v,className:_("cny-field-hint",g!=="default"&&g),children:n??t})]})}const h0=w.forwardRef(function({color:t="primary",size:n,autoGrow:r=!1,maxRows:o=12,className:s,onChange:i,...a},c){const u=w.useRef(null);w.useImperativeHandle(c,()=>u.current,[]);const d=w.useCallback(()=>{const m=u.current;if(!m||!r)return;m.style.height="auto";const g=parseFloat(getComputedStyle(m).lineHeight||"20")*o;m.style.height=`${Math.min(m.scrollHeight,g)}px`,m.style.overflowY=m.scrollHeight>g?"auto":"hidden"},[r,o]);w.useEffect(()=>{d()},[d,a.value,a.defaultValue]);const f=m=>{i==null||i(m),r&&d()},h=_("input",t!=="primary"&&t,n==="sm"||n==="lg"?n:null,r&&"cny-textarea-autogrow",s);return l.jsx("textarea",{ref:u,className:h,onChange:f,...a})});function uo(e,[t,n]){return Math.min(n,Math.max(t,e))}function p0(e,t=globalThis==null?void 0:globalThis.document){const n=Xe(e);p.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var m0="DismissableLayer",yi="dismissableLayer.update",g0="dismissableLayer.pointerDownOutside",v0="dismissableLayer.focusOutside",$l,kf=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Mn=p.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...c}=e,u=p.useContext(kf),[d,f]=p.useState(null),h=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=p.useState({}),y=te(t,T=>f(T)),g=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),x=g.indexOf(v),b=d?g.indexOf(d):-1,C=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=x,R=b0(T=>{const A=T.target,k=[...u.branches].some(N=>N.contains(A));!S||k||(o==null||o(T),i==null||i(T),T.defaultPrevented||a==null||a())},h),P=w0(T=>{const A=T.target;[...u.branches].some(N=>N.contains(A))||(s==null||s(T),i==null||i(T),T.defaultPrevented||a==null||a())},h);return p0(T=>{b===u.layers.size-1&&(r==null||r(T),!T.defaultPrevented&&a&&(T.preventDefault(),a()))},h),p.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&($l=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Bl(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=$l)}},[d,h,n,u]),p.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Bl())},[d,u]),p.useEffect(()=>{const T=()=>m({});return document.addEventListener(yi,T),()=>document.removeEventListener(yi,T)},[]),l.jsx(K.div,{...c,ref:y,style:{pointerEvents:C?S?"auto":"none":void 0,...e.style},onFocusCapture:V(e.onFocusCapture,P.onFocusCapture),onBlurCapture:V(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:V(e.onPointerDownCapture,R.onPointerDownCapture)})});Mn.displayName=m0;var y0="DismissableLayerBranch",x0=p.forwardRef((e,t)=>{const n=p.useContext(kf),r=p.useRef(null),o=te(t,r);return p.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),l.jsx(K.div,{...e,ref:o})});x0.displayName=y0;function b0(e,t=globalThis==null?void 0:globalThis.document){const n=Xe(e),r=p.useRef(!1),o=p.useRef(()=>{});return p.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let c=function(){If(g0,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function w0(e,t=globalThis==null?void 0:globalThis.document){const n=Xe(e),r=p.useRef(!1);return p.useEffect(()=>{const o=s=>{s.target&&!r.current&&If(v0,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Bl(){const e=new CustomEvent(yi);document.dispatchEvent(e)}function If(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?mf(o,s):o.dispatchEvent(s)}var Ds=0;function jo(){p.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Wl()),document.body.insertAdjacentElement("beforeend",e[1]??Wl()),Ds++,()=>{Ds===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ds--}},[])}function Wl(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Ns="focusScope.autoFocusOnMount",js="focusScope.autoFocusOnUnmount",Gl={bubbles:!1,cancelable:!0},C0="FocusScope",or=p.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,c]=p.useState(null),u=Xe(o),d=Xe(s),f=p.useRef(null),h=te(t,g=>c(g)),m=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(r){let g=function(C){if(m.paused||!a)return;const S=C.target;a.contains(S)?f.current=S:xt(f.current,{select:!0})},v=function(C){if(m.paused||!a)return;const S=C.relatedTarget;S!==null&&(a.contains(S)||xt(f.current,{select:!0}))},x=function(C){if(document.activeElement===document.body)for(const R of C)R.removedNodes.length>0&&xt(a)};document.addEventListener("focusin",g),document.addEventListener("focusout",v);const b=new MutationObserver(x);return a&&b.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",v),b.disconnect()}}},[r,a,m.paused]),p.useEffect(()=>{if(a){Kl.add(m);const g=document.activeElement;if(!a.contains(g)){const x=new CustomEvent(Ns,Gl);a.addEventListener(Ns,u),a.dispatchEvent(x),x.defaultPrevented||(S0(M0(_f(a)),{select:!0}),document.activeElement===g&&xt(a))}return()=>{a.removeEventListener(Ns,u),setTimeout(()=>{const x=new CustomEvent(js,Gl);a.addEventListener(js,d),a.dispatchEvent(x),x.defaultPrevented||xt(g??document.body,{select:!0}),a.removeEventListener(js,d),Kl.remove(m)},0)}}},[a,u,d,m]);const y=p.useCallback(g=>{if(!n&&!r||m.paused)return;const v=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,x=document.activeElement;if(v&&x){const b=g.currentTarget,[C,S]=R0(b);C&&S?!g.shiftKey&&x===S?(g.preventDefault(),n&&xt(C,{select:!0})):g.shiftKey&&x===C&&(g.preventDefault(),n&&xt(S,{select:!0})):x===b&&g.preventDefault()}},[n,r,m.paused]);return l.jsx(K.div,{tabIndex:-1,...i,ref:h,onKeyDown:y})});or.displayName=C0;function S0(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(xt(r,{select:t}),document.activeElement!==n)return}function R0(e){const t=_f(e),n=Ul(t,e),r=Ul(t.reverse(),e);return[n,r]}function _f(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Ul(e,t){for(const n of e)if(!T0(n,{upTo:t}))return n}function T0(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function P0(e){return e instanceof HTMLInputElement&&"select"in e}function xt(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&P0(e)&&t&&e.select()}}var Kl=E0();function E0(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Hl(e,t),e.unshift(t)},remove(t){var n;e=Hl(e,t),(n=e[0])==null||n.resume()}}}function Hl(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function M0(e){return e.filter(t=>t.tagName!=="A")}const A0=["top","right","bottom","left"],Tt=Math.min,Fe=Math.max,fo=Math.round,Ar=Math.floor,at=e=>({x:e,y:e}),D0={left:"right",right:"left",bottom:"top",top:"bottom"};function xi(e,t,n){return Fe(e,Tt(t,n))}function ft(e,t){return typeof e=="function"?e(t):e}function ht(e){return e.split("-")[0]}function An(e){return e.split("-")[1]}function ga(e){return e==="x"?"y":"x"}function va(e){return e==="y"?"height":"width"}function st(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function ya(e){return ga(st(e))}function N0(e,t,n){n===void 0&&(n=!1);const r=An(e),o=ya(e),s=va(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=ho(i)),[i,ho(i)]}function j0(e){const t=ho(e);return[bi(e),t,bi(t)]}function bi(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const zl=["left","right"],Yl=["right","left"],k0=["top","bottom"],I0=["bottom","top"];function _0(e,t,n){switch(e){case"top":case"bottom":return n?t?Yl:zl:t?zl:Yl;case"left":case"right":return t?k0:I0;default:return[]}}function O0(e,t,n,r){const o=An(e);let s=_0(ht(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(bi)))),s}function ho(e){const t=ht(e);return D0[t]+e.slice(t.length)}function L0(e){return{top:0,right:0,bottom:0,left:0,...e}}function Of(e){return typeof e!="number"?L0(e):{top:e,right:e,bottom:e,left:e}}function po(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Xl(e,t,n){let{reference:r,floating:o}=e;const s=st(t),i=ya(t),a=va(i),c=ht(t),u=s==="y",d=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,h=r[a]/2-o[a]/2;let m;switch(c){case"top":m={x:d,y:r.y-o.height};break;case"bottom":m={x:d,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:f};break;case"left":m={x:r.x-o.width,y:f};break;default:m={x:r.x,y:r.y}}switch(An(t)){case"start":m[i]-=h*(n&&u?-1:1);break;case"end":m[i]+=h*(n&&u?-1:1);break}return m}async function V0(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:h=!1,padding:m=0}=ft(t,e),y=Of(m),v=a[h?f==="floating"?"reference":"floating":f],x=po(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(v)))==null||n?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:d,strategy:c})),b=f==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),S=await(s.isElement==null?void 0:s.isElement(C))?await(s.getScale==null?void 0:s.getScale(C))||{x:1,y:1}:{x:1,y:1},R=po(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:C,strategy:c}):b);return{top:(x.top-R.top+y.top)/S.y,bottom:(R.bottom-x.bottom+y.bottom)/S.y,left:(x.left-R.left+y.left)/S.x,right:(R.right-x.right+y.right)/S.x}}const F0=50,$0=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=i.detectOverflow?i:{...i,detectOverflow:V0},c=await(i.isRTL==null?void 0:i.isRTL(t));let u=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:f}=Xl(u,r,c),h=r,m=0;const y={};for(let g=0;g<s.length;g++){const v=s[g];if(!v)continue;const{name:x,fn:b}=v,{x:C,y:S,data:R,reset:P}=await b({x:d,y:f,initialPlacement:r,placement:h,strategy:o,middlewareData:y,rects:u,platform:a,elements:{reference:e,floating:t}});d=C??d,f=S??f,y[x]={...y[x],...R},P&&m<F0&&(m++,typeof P=="object"&&(P.placement&&(h=P.placement),P.rects&&(u=P.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):P.rects),{x:d,y:f}=Xl(u,h,c)),g=-1)}return{x:d,y:f,placement:h,strategy:o,middlewareData:y}},B0=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:c}=t,{element:u,padding:d=0}=ft(e,t)||{};if(u==null)return{};const f=Of(d),h={x:n,y:r},m=ya(o),y=va(m),g=await i.getDimensions(u),v=m==="y",x=v?"top":"left",b=v?"bottom":"right",C=v?"clientHeight":"clientWidth",S=s.reference[y]+s.reference[m]-h[m]-s.floating[y],R=h[m]-s.reference[m],P=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let T=P?P[C]:0;(!T||!await(i.isElement==null?void 0:i.isElement(P)))&&(T=a.floating[C]||s.floating[y]);const A=S/2-R/2,k=T/2-g[y]/2-1,N=Tt(f[x],k),L=Tt(f[b],k),G=N,J=T-g[y]-L,F=T/2-g[y]/2+A,Z=xi(G,F,J),D=!c.arrow&&An(o)!=null&&F!==Z&&s.reference[y]/2-(F<G?N:L)-g[y]/2<0,U=D?F<G?F-G:F-J:0;return{[m]:h[m]+U,data:{[m]:Z,centerOffset:F-Z-U,...D&&{alignmentOffset:U}},reset:D}}}),W0=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:c,elements:u}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:g=!0,...v}=ft(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const x=ht(o),b=st(a),C=ht(a)===a,S=await(c.isRTL==null?void 0:c.isRTL(u.floating)),R=h||(C||!g?[ho(a)]:j0(a)),P=y!=="none";!h&&P&&R.push(...O0(a,g,y,S));const T=[a,...R],A=await c.detectOverflow(t,v),k=[];let N=((r=s.flip)==null?void 0:r.overflows)||[];if(d&&k.push(A[x]),f){const F=N0(o,i,S);k.push(A[F[0]],A[F[1]])}if(N=[...N,{placement:o,overflows:k}],!k.every(F=>F<=0)){var L,G;const F=(((L=s.flip)==null?void 0:L.index)||0)+1,Z=T[F];if(Z&&(!(f==="alignment"?b!==st(Z):!1)||N.every(j=>st(j.placement)===b?j.overflows[0]>0:!0)))return{data:{index:F,overflows:N},reset:{placement:Z}};let D=(G=N.filter(U=>U.overflows[0]<=0).sort((U,j)=>U.overflows[1]-j.overflows[1])[0])==null?void 0:G.placement;if(!D)switch(m){case"bestFit":{var J;const U=(J=N.filter(j=>{if(P){const O=st(j.placement);return O===b||O==="y"}return!0}).map(j=>[j.placement,j.overflows.filter(O=>O>0).reduce((O,ne)=>O+ne,0)]).sort((j,O)=>j[1]-O[1])[0])==null?void 0:J[0];U&&(D=U);break}case"initialPlacement":D=a;break}if(o!==D)return{reset:{placement:D}}}return{}}}};function ql(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Zl(e){return A0.some(t=>e[t]>=0)}const G0=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...s}=ft(e,t);switch(o){case"referenceHidden":{const i=await r.detectOverflow(t,{...s,elementContext:"reference"}),a=ql(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Zl(a)}}}case"escaped":{const i=await r.detectOverflow(t,{...s,altBoundary:!0}),a=ql(i,n.floating);return{data:{escapedOffsets:a,escaped:Zl(a)}}}default:return{}}}}},Lf=new Set(["left","top"]);async function U0(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=ht(n),a=An(n),c=st(n)==="y",u=Lf.has(i)?-1:1,d=s&&c?-1:1,f=ft(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:y}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof y=="number"&&(m=a==="end"?y*-1:y),c?{x:m*d,y:h*u}:{x:h*u,y:m*d}}const K0=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,c=await U0(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:s+c.y,data:{...c,placement:i}}}}},H0=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:s}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:c={fn:x=>{let{x:b,y:C}=x;return{x:b,y:C}}},...u}=ft(e,t),d={x:n,y:r},f=await s.detectOverflow(t,u),h=st(ht(o)),m=ga(h);let y=d[m],g=d[h];if(i){const x=m==="y"?"top":"left",b=m==="y"?"bottom":"right",C=y+f[x],S=y-f[b];y=xi(C,y,S)}if(a){const x=h==="y"?"top":"left",b=h==="y"?"bottom":"right",C=g+f[x],S=g-f[b];g=xi(C,g,S)}const v=c.fn({...t,[m]:y,[h]:g});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[m]:i,[h]:a}}}}}},z0=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:c=!0,crossAxis:u=!0}=ft(e,t),d={x:n,y:r},f=st(o),h=ga(f);let m=d[h],y=d[f];const g=ft(a,t),v=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){const C=h==="y"?"height":"width",S=s.reference[h]-s.floating[C]+v.mainAxis,R=s.reference[h]+s.reference[C]-v.mainAxis;m<S?m=S:m>R&&(m=R)}if(u){var x,b;const C=h==="y"?"width":"height",S=Lf.has(ht(o)),R=s.reference[f]-s.floating[C]+(S&&((x=i.offset)==null?void 0:x[f])||0)+(S?0:v.crossAxis),P=s.reference[f]+s.reference[C]+(S?0:((b=i.offset)==null?void 0:b[f])||0)-(S?v.crossAxis:0);y<R?y=R:y>P&&(y=P)}return{[h]:m,[f]:y}}}},Y0=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:c=()=>{},...u}=ft(e,t),d=await i.detectOverflow(t,u),f=ht(o),h=An(o),m=st(o)==="y",{width:y,height:g}=s.floating;let v,x;f==="top"||f==="bottom"?(v=f,x=h===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(x=f,v=h==="end"?"top":"bottom");const b=g-d.top-d.bottom,C=y-d.left-d.right,S=Tt(g-d[v],b),R=Tt(y-d[x],C),P=!t.middlewareData.shift;let T=S,A=R;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(A=C),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=b),P&&!h){const N=Fe(d.left,0),L=Fe(d.right,0),G=Fe(d.top,0),J=Fe(d.bottom,0);m?A=y-2*(N!==0||L!==0?N+L:Fe(d.left,d.right)):T=g-2*(G!==0||J!==0?G+J:Fe(d.top,d.bottom))}await c({...t,availableWidth:A,availableHeight:T});const k=await i.getDimensions(a.floating);return y!==k.width||g!==k.height?{reset:{rects:!0}}:{}}}};function ko(){return typeof window<"u"}function Dn(e){return Vf(e)?(e.nodeName||"").toLowerCase():"#document"}function $e(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function lt(e){var t;return(t=(Vf(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Vf(e){return ko()?e instanceof Node||e instanceof $e(e).Node:!1}function qe(e){return ko()?e instanceof Element||e instanceof $e(e).Element:!1}function pt(e){return ko()?e instanceof HTMLElement||e instanceof $e(e).HTMLElement:!1}function Ql(e){return!ko()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof $e(e).ShadowRoot}function sr(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Ze(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function X0(e){return/^(table|td|th)$/.test(Dn(e))}function Io(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const q0=/transform|translate|scale|rotate|perspective|filter/,Z0=/paint|layout|strict|content/,Wt=e=>!!e&&e!=="none";let ks;function xa(e){const t=qe(e)?Ze(e):e;return Wt(t.transform)||Wt(t.translate)||Wt(t.scale)||Wt(t.rotate)||Wt(t.perspective)||!ba()&&(Wt(t.backdropFilter)||Wt(t.filter))||q0.test(t.willChange||"")||Z0.test(t.contain||"")}function Q0(e){let t=Pt(e);for(;pt(t)&&!wn(t);){if(xa(t))return t;if(Io(t))return null;t=Pt(t)}return null}function ba(){return ks==null&&(ks=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),ks}function wn(e){return/^(html|body|#document)$/.test(Dn(e))}function Ze(e){return $e(e).getComputedStyle(e)}function _o(e){return qe(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Pt(e){if(Dn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ql(e)&&e.host||lt(e);return Ql(t)?t.host:t}function Ff(e){const t=Pt(e);return wn(t)?e.ownerDocument?e.ownerDocument.body:e.body:pt(t)&&sr(t)?t:Ff(t)}function Yn(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Ff(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=$e(o);if(s){const a=wi(i);return t.concat(i,i.visualViewport||[],sr(o)?o:[],a&&n?Yn(a):[])}else return t.concat(o,Yn(o,[],n))}function wi(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function $f(e){const t=Ze(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=pt(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=fo(n)!==s||fo(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function wa(e){return qe(e)?e:e.contextElement}function vn(e){const t=wa(e);if(!pt(t))return at(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=$f(t);let i=(s?fo(n.width):n.width)/r,a=(s?fo(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const J0=at(0);function Bf(e){const t=$e(e);return!ba()||!t.visualViewport?J0:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function eR(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==$e(e)?!1:t}function Xt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=wa(e);let i=at(1);t&&(r?qe(r)&&(i=vn(r)):i=vn(e));const a=eR(s,n,r)?Bf(s):at(0);let c=(o.left+a.x)/i.x,u=(o.top+a.y)/i.y,d=o.width/i.x,f=o.height/i.y;if(s){const h=$e(s),m=r&&qe(r)?$e(r):r;let y=h,g=wi(y);for(;g&&r&&m!==y;){const v=vn(g),x=g.getBoundingClientRect(),b=Ze(g),C=x.left+(g.clientLeft+parseFloat(b.paddingLeft))*v.x,S=x.top+(g.clientTop+parseFloat(b.paddingTop))*v.y;c*=v.x,u*=v.y,d*=v.x,f*=v.y,c+=C,u+=S,y=$e(g),g=wi(y)}}return po({width:d,height:f,x:c,y:u})}function Oo(e,t){const n=_o(e).scrollLeft;return t?t.left+n:Xt(lt(e)).left+n}function Wf(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Oo(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function tR(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=lt(r),a=t?Io(t.floating):!1;if(r===i||a&&s)return n;let c={scrollLeft:0,scrollTop:0},u=at(1);const d=at(0),f=pt(r);if((f||!f&&!s)&&((Dn(r)!=="body"||sr(i))&&(c=_o(r)),f)){const m=Xt(r);u=vn(r),d.x=m.x+r.clientLeft,d.y=m.y+r.clientTop}const h=i&&!f&&!s?Wf(i,c):at(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+d.x+h.x,y:n.y*u.y-c.scrollTop*u.y+d.y+h.y}}function nR(e){return Array.from(e.getClientRects())}function rR(e){const t=lt(e),n=_o(e),r=e.ownerDocument.body,o=Fe(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Fe(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Oo(e);const a=-n.scrollTop;return Ze(r).direction==="rtl"&&(i+=Fe(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}const Jl=25;function oR(e,t){const n=$e(e),r=lt(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,c=0;if(o){s=o.width,i=o.height;const d=ba();(!d||d&&t==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}const u=Oo(r);if(u<=0){const d=r.ownerDocument,f=d.body,h=getComputedStyle(f),m=d.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,y=Math.abs(r.clientWidth-f.clientWidth-m);y<=Jl&&(s-=y)}else u<=Jl&&(s+=u);return{width:s,height:i,x:a,y:c}}function sR(e,t){const n=Xt(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=pt(e)?vn(e):at(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,c=o*s.x,u=r*s.y;return{width:i,height:a,x:c,y:u}}function eu(e,t,n){let r;if(t==="viewport")r=oR(e,n);else if(t==="document")r=rR(lt(e));else if(qe(t))r=sR(t,n);else{const o=Bf(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return po(r)}function Gf(e,t){const n=Pt(e);return n===t||!qe(n)||wn(n)?!1:Ze(n).position==="fixed"||Gf(n,t)}function iR(e,t){const n=t.get(e);if(n)return n;let r=Yn(e,[],!1).filter(a=>qe(a)&&Dn(a)!=="body"),o=null;const s=Ze(e).position==="fixed";let i=s?Pt(e):e;for(;qe(i)&&!wn(i);){const a=Ze(i),c=xa(i);!c&&a.position==="fixed"&&(o=null),(s?!c&&!o:!c&&a.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||sr(i)&&!c&&Gf(e,i))?r=r.filter(d=>d!==i):o=a,i=Pt(i)}return t.set(e,r),r}function aR(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?Io(t)?[]:iR(t,this._c):[].concat(n),r],a=eu(t,i[0],o);let c=a.top,u=a.right,d=a.bottom,f=a.left;for(let h=1;h<i.length;h++){const m=eu(t,i[h],o);c=Fe(m.top,c),u=Tt(m.right,u),d=Tt(m.bottom,d),f=Fe(m.left,f)}return{width:u-f,height:d-c,x:f,y:c}}function cR(e){const{width:t,height:n}=$f(e);return{width:t,height:n}}function lR(e,t,n){const r=pt(t),o=lt(t),s=n==="fixed",i=Xt(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const c=at(0);function u(){c.x=Oo(o)}if(r||!r&&!s)if((Dn(t)!=="body"||sr(o))&&(a=_o(t)),r){const m=Xt(t,!0,s,t);c.x=m.x+t.clientLeft,c.y=m.y+t.clientTop}else o&&u();s&&!r&&o&&u();const d=o&&!r&&!s?Wf(o,a):at(0),f=i.left+a.scrollLeft-c.x-d.x,h=i.top+a.scrollTop-c.y-d.y;return{x:f,y:h,width:i.width,height:i.height}}function Is(e){return Ze(e).position==="static"}function tu(e,t){if(!pt(e)||Ze(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return lt(e)===n&&(n=n.ownerDocument.body),n}function Uf(e,t){const n=$e(e);if(Io(e))return n;if(!pt(e)){let o=Pt(e);for(;o&&!wn(o);){if(qe(o)&&!Is(o))return o;o=Pt(o)}return n}let r=tu(e,t);for(;r&&X0(r)&&Is(r);)r=tu(r,t);return r&&wn(r)&&Is(r)&&!xa(r)?n:r||Q0(e)||n}const uR=async function(e){const t=this.getOffsetParent||Uf,n=this.getDimensions,r=await n(e.floating);return{reference:lR(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function dR(e){return Ze(e).direction==="rtl"}const fR={convertOffsetParentRelativeRectToViewportRelativeRect:tR,getDocumentElement:lt,getClippingRect:aR,getOffsetParent:Uf,getElementRects:uR,getClientRects:nR,getDimensions:cR,getScale:vn,isElement:qe,isRTL:dR};function Kf(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function hR(e,t){let n=null,r;const o=lt(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const u=e.getBoundingClientRect(),{left:d,top:f,width:h,height:m}=u;if(a||t(),!h||!m)return;const y=Ar(f),g=Ar(o.clientWidth-(d+h)),v=Ar(o.clientHeight-(f+m)),x=Ar(d),C={rootMargin:-y+"px "+-g+"px "+-v+"px "+-x+"px",threshold:Fe(0,Tt(1,c))||1};let S=!0;function R(P){const T=P[0].intersectionRatio;if(T!==c){if(!S)return i();T?i(!1,T):r=setTimeout(()=>{i(!1,1e-7)},1e3)}T===1&&!Kf(u,e.getBoundingClientRect())&&i(),S=!1}try{n=new IntersectionObserver(R,{...C,root:o.ownerDocument})}catch{n=new IntersectionObserver(R,C)}n.observe(e)}return i(!0),s}function pR(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=wa(e),d=o||s?[...u?Yn(u):[],...t?Yn(t):[]]:[];d.forEach(x=>{o&&x.addEventListener("scroll",n,{passive:!0}),s&&x.addEventListener("resize",n)});const f=u&&a?hR(u,n):null;let h=-1,m=null;i&&(m=new ResizeObserver(x=>{let[b]=x;b&&b.target===u&&m&&t&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var C;(C=m)==null||C.observe(t)})),n()}),u&&!c&&m.observe(u),t&&m.observe(t));let y,g=c?Xt(e):null;c&&v();function v(){const x=Xt(e);g&&!Kf(g,x)&&n(),g=x,y=requestAnimationFrame(v)}return n(),()=>{var x;d.forEach(b=>{o&&b.removeEventListener("scroll",n),s&&b.removeEventListener("resize",n)}),f==null||f(),(x=m)==null||x.disconnect(),m=null,c&&cancelAnimationFrame(y)}}const mR=K0,gR=H0,vR=W0,yR=Y0,xR=G0,nu=B0,bR=z0,wR=(e,t,n)=>{const r=new Map,o={platform:fR,...n},s={...o.platform,_c:r};return $0(e,t,{...o,platform:s})};var CR=typeof document<"u",SR=function(){},qr=CR?w.useLayoutEffect:SR;function mo(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!mo(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!mo(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Hf(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ru(e,t){const n=Hf(e);return Math.round(t*n)/n}function _s(e){const t=p.useRef(e);return qr(()=>{t.current=e}),t}function RR(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:c,open:u}=e,[d,f]=p.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=p.useState(r);mo(h,r)||m(r);const[y,g]=p.useState(null),[v,x]=p.useState(null),b=p.useCallback(j=>{j!==P.current&&(P.current=j,g(j))},[]),C=p.useCallback(j=>{j!==T.current&&(T.current=j,x(j))},[]),S=s||y,R=i||v,P=p.useRef(null),T=p.useRef(null),A=p.useRef(d),k=c!=null,N=_s(c),L=_s(o),G=_s(u),J=p.useCallback(()=>{if(!P.current||!T.current)return;const j={placement:t,strategy:n,middleware:h};L.current&&(j.platform=L.current),wR(P.current,T.current,j).then(O=>{const ne={...O,isPositioned:G.current!==!1};F.current&&!mo(A.current,ne)&&(A.current=ne,So.flushSync(()=>{f(ne)}))})},[h,t,n,L,G]);qr(()=>{u===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,f(j=>({...j,isPositioned:!1})))},[u]);const F=p.useRef(!1);qr(()=>(F.current=!0,()=>{F.current=!1}),[]),qr(()=>{if(S&&(P.current=S),R&&(T.current=R),S&&R){if(N.current)return N.current(S,R,J);J()}},[S,R,J,N,k]);const Z=p.useMemo(()=>({reference:P,floating:T,setReference:b,setFloating:C}),[b,C]),D=p.useMemo(()=>({reference:S,floating:R}),[S,R]),U=p.useMemo(()=>{const j={position:n,left:0,top:0};if(!D.floating)return j;const O=ru(D.floating,d.x),ne=ru(D.floating,d.y);return a?{...j,transform:"translate("+O+"px, "+ne+"px)",...Hf(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:O,top:ne}},[n,a,D.floating,d.x,d.y]);return p.useMemo(()=>({...d,update:J,refs:Z,elements:D,floatingStyles:U}),[d,J,Z,D,U])}const TR=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?nu({element:r.current,padding:o}).fn(n):{}:r?nu({element:r,padding:o}).fn(n):{}}}},PR=(e,t)=>{const n=mR(e);return{name:n.name,fn:n.fn,options:[e,t]}},ER=(e,t)=>{const n=gR(e);return{name:n.name,fn:n.fn,options:[e,t]}},MR=(e,t)=>({fn:bR(e).fn,options:[e,t]}),AR=(e,t)=>{const n=vR(e);return{name:n.name,fn:n.fn,options:[e,t]}},DR=(e,t)=>{const n=yR(e);return{name:n.name,fn:n.fn,options:[e,t]}},NR=(e,t)=>{const n=xR(e);return{name:n.name,fn:n.fn,options:[e,t]}},jR=(e,t)=>{const n=TR(e);return{name:n.name,fn:n.fn,options:[e,t]}};var kR="Arrow",zf=p.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return l.jsx(K.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:l.jsx("polygon",{points:"0,0 30,0 15,10"})})});zf.displayName=kR;var IR=zf;function ir(e){const[t,n]=p.useState(void 0);return Pe(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const c=s.borderBoxSize,u=Array.isArray(c)?c[0]:c;i=u.inlineSize,a=u.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Ca="Popper",[Yf,kt]=Ce(Ca),[_R,Xf]=Yf(Ca),qf=e=>{const{__scopePopper:t,children:n}=e,[r,o]=p.useState(null);return l.jsx(_R,{scope:t,anchor:r,onAnchorChange:o,children:n})};qf.displayName=Ca;var Zf="PopperAnchor",Qf=p.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=Xf(Zf,n),i=p.useRef(null),a=te(t,i),c=p.useRef(null);return p.useEffect(()=>{const u=c.current;c.current=(r==null?void 0:r.current)||i.current,u!==c.current&&s.onAnchorChange(c.current)}),r?null:l.jsx(K.div,{...o,ref:a})});Qf.displayName=Zf;var Sa="PopperContent",[OR,LR]=Yf(Sa),Jf=p.forwardRef((e,t)=>{var I,B,ee,se,ie,X;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:m="optimized",onPlaced:y,...g}=e,v=Xf(Sa,n),[x,b]=p.useState(null),C=te(t,Se=>b(Se)),[S,R]=p.useState(null),P=ir(S),T=(P==null?void 0:P.width)??0,A=(P==null?void 0:P.height)??0,k=r+(s!=="center"?"-"+s:""),N=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},L=Array.isArray(u)?u:[u],G=L.length>0,J={padding:N,boundary:L.filter(FR),altBoundary:G},{refs:F,floatingStyles:Z,placement:D,isPositioned:U,middlewareData:j}=RR({strategy:"fixed",placement:k,whileElementsMounted:(...Se)=>pR(...Se,{animationFrame:m==="always"}),elements:{reference:v.anchor},middleware:[PR({mainAxis:o+A,alignmentAxis:i}),c&&ER({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?MR():void 0,...J}),c&&AR({...J}),DR({...J,apply:({elements:Se,rects:Be,availableWidth:Vt,availableHeight:pe})=>{const{width:De,height:vr}=Be.reference,ae=Se.floating.style;ae.setProperty("--radix-popper-available-width",`${Vt}px`),ae.setProperty("--radix-popper-available-height",`${pe}px`),ae.setProperty("--radix-popper-anchor-width",`${De}px`),ae.setProperty("--radix-popper-anchor-height",`${vr}px`)}}),S&&jR({element:S,padding:a}),$R({arrowWidth:T,arrowHeight:A}),h&&NR({strategy:"referenceHidden",...J})]}),[O,ne]=nh(D),W=Xe(y);Pe(()=>{U&&(W==null||W())},[U,W]);const M=(I=j.arrow)==null?void 0:I.x,Y=(B=j.arrow)==null?void 0:B.y,z=((ee=j.arrow)==null?void 0:ee.centerOffset)!==0,[H,re]=p.useState();return Pe(()=>{x&&re(window.getComputedStyle(x).zIndex)},[x]),l.jsx("div",{ref:F.setFloating,"data-radix-popper-content-wrapper":"",style:{...Z,transform:U?Z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:H,"--radix-popper-transform-origin":[(se=j.transformOrigin)==null?void 0:se.x,(ie=j.transformOrigin)==null?void 0:ie.y].join(" "),...((X=j.hide)==null?void 0:X.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(OR,{scope:n,placedSide:O,onArrowChange:R,arrowX:M,arrowY:Y,shouldHideArrow:z,children:l.jsx(K.div,{"data-side":O,"data-align":ne,...g,ref:C,style:{...g.style,animation:U?void 0:"none"}})})})});Jf.displayName=Sa;var eh="PopperArrow",VR={top:"bottom",right:"left",bottom:"top",left:"right"},th=p.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=LR(eh,r),i=VR[s.placedSide];return l.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:l.jsx(IR,{...o,ref:n,style:{...o.style,display:"block"}})})});th.displayName=eh;function FR(e){return e!==null}var $R=e=>({name:"transformOrigin",options:e,fn(t){var v,x,b;const{placement:n,rects:r,middlewareData:o}=t,i=((v=o.arrow)==null?void 0:v.centerOffset)!==0,a=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[u,d]=nh(n),f={start:"0%",center:"50%",end:"100%"}[d],h=(((x=o.arrow)==null?void 0:x.x)??0)+a/2,m=(((b=o.arrow)==null?void 0:b.y)??0)+c/2;let y="",g="";return u==="bottom"?(y=i?f:`${h}px`,g=`${-c}px`):u==="top"?(y=i?f:`${h}px`,g=`${r.floating.height+c}px`):u==="right"?(y=`${-c}px`,g=i?f:`${m}px`):u==="left"&&(y=`${r.floating.width+c}px`,g=i?f:`${m}px`),{data:{x:y,y:g}}}});function nh(e){const[t,n="center"]=e.split("-");return[t,n]}var ar=qf,cr=Qf,Lo=Jf,Vo=th,BR="Portal",Nn=p.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,s]=p.useState(!1);Pe(()=>s(!0),[]);const i=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?Co.createPortal(l.jsx(K.div,{...r,ref:t}),i):null});Nn.displayName=BR;function lr(e){const t=p.useRef({value:e,previous:e});return p.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var rh=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),WR="VisuallyHidden",Ra=p.forwardRef((e,t)=>l.jsx(K.span,{...e,ref:t,style:{...rh,...e.style}}));Ra.displayName=WR;var GR=Ra,UR=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},sn=new WeakMap,Dr=new WeakMap,Nr={},Os=0,oh=function(e){return e&&(e.host||oh(e.parentNode))},KR=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=oh(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},HR=function(e,t,n,r){var o=KR(t,Array.isArray(e)?e:[e]);Nr[n]||(Nr[n]=new WeakMap);var s=Nr[n],i=[],a=new Set,c=new Set(o),u=function(f){!f||a.has(f)||(a.add(f),u(f.parentNode))};o.forEach(u);var d=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(h){if(a.has(h))d(h);else try{var m=h.getAttribute(r),y=m!==null&&m!=="false",g=(sn.get(h)||0)+1,v=(s.get(h)||0)+1;sn.set(h,g),s.set(h,v),i.push(h),g===1&&y&&Dr.set(h,!0),v===1&&h.setAttribute(n,"true"),y||h.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",h,x)}})};return d(t),a.clear(),Os++,function(){i.forEach(function(f){var h=sn.get(f)-1,m=s.get(f)-1;sn.set(f,h),s.set(f,m),h||(Dr.has(f)||f.removeAttribute(r),Dr.delete(f)),m||f.removeAttribute(n)}),Os--,Os||(sn=new WeakMap,sn=new WeakMap,Dr=new WeakMap,Nr={})}},Fo=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=UR(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),HR(r,o,n,"aria-hidden")):function(){return null}},ot=function(){return ot=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},ot.apply(this,arguments)};function sh(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function zR(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var Zr="right-scroll-bar-position",Qr="width-before-scroll-bar",YR="with-scroll-bars-hidden",XR="--removed-body-scroll-bar-size";function Ls(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function qR(e,t){var n=w.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var ZR=typeof window<"u"?p.useLayoutEffect:p.useEffect,ou=new WeakMap;function QR(e,t){var n=qR(null,function(r){return e.forEach(function(o){return Ls(o,r)})});return ZR(function(){var r=ou.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||Ls(a,null)}),s.forEach(function(a){o.has(a)||Ls(a,i)})}ou.set(n,e)},[e]),n}function JR(e){return e}function eT(e,t){t===void 0&&(t=JR);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(s),i=n}var c=function(){var d=i;i=[],d.forEach(s)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(d){i.push(d),u()},filter:function(d){return i=i.filter(d),n}}}};return o}function tT(e){e===void 0&&(e={});var t=eT(null);return t.options=ot({async:!0,ssr:!1},e),t}var ih=function(e){var t=e.sideCar,n=sh(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return p.createElement(r,ot({},n))};ih.isSideCarExport=!0;function nT(e,t){return e.useMedium(t),ih}var ah=tT(),Vs=function(){},$o=p.forwardRef(function(e,t){var n=p.useRef(null),r=p.useState({onScrollCapture:Vs,onWheelCapture:Vs,onTouchMoveCapture:Vs}),o=r[0],s=r[1],i=e.forwardProps,a=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,h=e.sideCar,m=e.noRelative,y=e.noIsolation,g=e.inert,v=e.allowPinchZoom,x=e.as,b=x===void 0?"div":x,C=e.gapMode,S=sh(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=h,P=QR([n,t]),T=ot(ot({},S),o);return p.createElement(p.Fragment,null,d&&p.createElement(R,{sideCar:ah,removeScrollBar:u,shards:f,noRelative:m,noIsolation:y,inert:g,setCallbacks:s,allowPinchZoom:!!v,lockRef:n,gapMode:C}),i?p.cloneElement(p.Children.only(a),ot(ot({},T),{ref:P})):p.createElement(b,ot({},T,{className:c,ref:P}),a))});$o.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};$o.classNames={fullWidth:Qr,zeroRight:Zr};var rT=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function oT(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=rT();return t&&e.setAttribute("nonce",t),e}function sT(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function iT(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var aT=function(){var e=0,t=null;return{add:function(n){e==0&&(t=oT())&&(sT(t,n),iT(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},cT=function(){var e=aT();return function(t,n){p.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},ch=function(){var e=cT(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},lT={left:0,top:0,right:0,gap:0},Fs=function(e){return parseInt(e||"",10)||0},uT=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Fs(n),Fs(r),Fs(o)]},dT=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return lT;var t=uT(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},fT=ch(),yn="data-scroll-locked",hT=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
145
|
+
.`.concat(YR,` {
|
|
131
146
|
overflow: hidden `).concat(r,`;
|
|
132
147
|
padding-right: `).concat(a,"px ").concat(r,`;
|
|
133
148
|
}
|
|
134
|
-
body[`).concat(
|
|
149
|
+
body[`).concat(yn,`] {
|
|
135
150
|
overflow: hidden `).concat(r,`;
|
|
136
151
|
overscroll-behavior: contain;
|
|
137
152
|
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
@@ -144,31 +159,31 @@
|
|
|
144
159
|
`),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
145
160
|
}
|
|
146
161
|
|
|
147
|
-
.`).concat(
|
|
162
|
+
.`).concat(Zr,` {
|
|
148
163
|
right: `).concat(a,"px ").concat(r,`;
|
|
149
164
|
}
|
|
150
165
|
|
|
151
|
-
.`).concat(
|
|
166
|
+
.`).concat(Qr,` {
|
|
152
167
|
margin-right: `).concat(a,"px ").concat(r,`;
|
|
153
168
|
}
|
|
154
169
|
|
|
155
|
-
.`).concat(
|
|
170
|
+
.`).concat(Zr," .").concat(Zr,` {
|
|
156
171
|
right: 0 `).concat(r,`;
|
|
157
172
|
}
|
|
158
173
|
|
|
159
|
-
.`).concat(
|
|
174
|
+
.`).concat(Qr," .").concat(Qr,` {
|
|
160
175
|
margin-right: 0 `).concat(r,`;
|
|
161
176
|
}
|
|
162
177
|
|
|
163
|
-
body[`).concat(
|
|
164
|
-
`).concat(
|
|
178
|
+
body[`).concat(yn,`] {
|
|
179
|
+
`).concat(XR,": ").concat(a,`px;
|
|
165
180
|
}
|
|
166
|
-
`)},
|
|
181
|
+
`)},su=function(){var e=parseInt(document.body.getAttribute(yn)||"0",10);return isFinite(e)?e:0},pT=function(){p.useEffect(function(){return document.body.setAttribute(yn,(su()+1).toString()),function(){var e=su()-1;e<=0?document.body.removeAttribute(yn):document.body.setAttribute(yn,e.toString())}},[])},mT=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;pT();var s=p.useMemo(function(){return dT(o)},[o]);return p.createElement(fT,{styles:hT(s,!t,o,n?"":"!important")})},Ci=!1;if(typeof window<"u")try{var jr=Object.defineProperty({},"passive",{get:function(){return Ci=!0,!0}});window.addEventListener("test",jr,jr),window.removeEventListener("test",jr,jr)}catch{Ci=!1}var an=Ci?{passive:!1}:!1,gT=function(e){return e.tagName==="TEXTAREA"},lh=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!gT(e)&&n[t]==="visible")},vT=function(e){return lh(e,"overflowY")},yT=function(e){return lh(e,"overflowX")},iu=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=uh(e,r);if(o){var s=dh(e,r),i=s[1],a=s[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},xT=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},bT=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},uh=function(e,t){return e==="v"?vT(t):yT(t)},dh=function(e,t){return e==="v"?xT(t):bT(t)},wT=function(e,t){return e==="h"&&t==="rtl"?-1:1},CT=function(e,t,n,r,o){var s=wT(e,window.getComputedStyle(t).direction),i=s*r,a=n.target,c=t.contains(a),u=!1,d=i>0,f=0,h=0;do{if(!a)break;var m=dh(e,a),y=m[0],g=m[1],v=m[2],x=g-v-s*y;(y||x)&&uh(e,a)&&(f+=x,h+=y);var b=a.parentNode;a=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!c&&a!==document.body||c&&(t.contains(a)||t===a));return(d&&Math.abs(f)<1||!d&&Math.abs(h)<1)&&(u=!0),u},kr=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},au=function(e){return[e.deltaX,e.deltaY]},cu=function(e){return e&&"current"in e?e.current:e},ST=function(e,t){return e[0]===t[0]&&e[1]===t[1]},RT=function(e){return`
|
|
167
182
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
168
183
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
169
|
-
`)},uS=0,Xt=[];function dS(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),o=m.useState(uS++)[0],s=m.useState(Yd)[0],i=m.useRef(e);m.useEffect(function(){i.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var g=N0([e.lockRef.current],(e.shards||[]).map(Kc),!0).filter(Boolean);return g.forEach(function(y){return y.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),g.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=m.useCallback(function(g,y){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!i.current.allowPinchZoom;var v=rr(g),w=n.current,S="deltaX"in g?g.deltaX:w[0]-v[0],C="deltaY"in g?g.deltaY:w[1]-v[1],T,E=g.target,P=Math.abs(S)>Math.abs(C)?"h":"v";if("touches"in g&&P==="h"&&E.type==="range")return!1;var A=window.getSelection(),j=A&&A.anchorNode,k=j?j===E||j.contains(E):!1;if(k)return!1;var V=Hc(P,E);if(!V)return!0;if(V?T=P:(T=P==="v"?"h":"v",V=Hc(P,E)),!V)return!1;if(!r.current&&"changedTouches"in g&&(S||C)&&(r.current=T),!T)return!0;var H=r.current||T;return aS(H,y,g,H==="h"?S:C)},[]),c=m.useCallback(function(g){var y=g;if(!(!Xt.length||Xt[Xt.length-1]!==s)){var v="deltaY"in y?Gc(y):rr(y),w=t.current.filter(function(T){return T.name===y.type&&(T.target===y.target||y.target===T.shadowParent)&&cS(T.delta,v)})[0];if(w&&w.should){y.cancelable&&y.preventDefault();return}if(!w){var S=(i.current.shards||[]).map(Kc).filter(Boolean).filter(function(T){return T.contains(y.target)}),C=S.length>0?a(y,S[0]):!i.current.noIsolation;C&&y.cancelable&&y.preventDefault()}}},[]),l=m.useCallback(function(g,y,v,w){var S={name:g,delta:y,target:v,should:w,shadowParent:fS(v)};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(C){return C!==S})},1)},[]),u=m.useCallback(function(g){n.current=rr(g),r.current=void 0},[]),d=m.useCallback(function(g){l(g.type,Gc(g),g.target,a(g,e.lockRef.current))},[]),f=m.useCallback(function(g){l(g.type,rr(g),g.target,a(g,e.lockRef.current))},[]);m.useEffect(function(){return Xt.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",c,Yt),document.addEventListener("touchmove",c,Yt),document.addEventListener("touchstart",u,Yt),function(){Xt=Xt.filter(function(g){return g!==s}),document.removeEventListener("wheel",c,Yt),document.removeEventListener("touchmove",c,Yt),document.removeEventListener("touchstart",u,Yt)}},[]);var p=e.removeScrollBar,x=e.inert;return m.createElement(m.Fragment,null,x?m.createElement(s,{styles:lS(o)}):null,p?m.createElement(eS,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function fS(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const hS=$0(zd,dS);var co=m.forwardRef(function(e,t){return m.createElement(ao,Je({},e,{ref:t,sideCar:hS}))});co.classNames=ao.classNames;var pS=[" ","Enter","ArrowUp","ArrowDown"],mS=[" ","Enter"],Bt="Select",[lo,uo,gS]=Zu(Bt),[yn]=ze(Bt,[gS,oo]),fo=oo(),[yS,Tt]=yn(Bt),[vS,xS]=yn(Bt),Qd=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:s,value:i,defaultValue:a,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:x}=e,g=fo(t),[y,v]=m.useState(null),[w,S]=m.useState(null),[C,T]=m.useState(!1),E=Yr(l),[P,A]=He({prop:r,defaultProp:o??!1,onChange:s,caller:Bt}),[j,k]=He({prop:i,defaultProp:a,onChange:c,caller:Bt}),V=m.useRef(null),H=y?x||!!y.closest("form"):!0,[Y,G]=m.useState(new Set),K=Array.from(Y).map(D=>D.props.value).join(";");return h.jsx(_d,{...g,children:h.jsxs(yS,{required:p,scope:t,trigger:y,onTriggerChange:v,valueNode:w,onValueNodeChange:S,valueNodeHasChildren:C,onValueNodeHasChildrenChange:T,contentId:Me(),value:j,onValueChange:k,open:P,onOpenChange:A,dir:E,triggerPointerDownPosRef:V,disabled:f,children:[h.jsx(lo.Provider,{scope:t,children:h.jsx(vS,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback(D=>{G(W=>new Set(W).add(D))},[]),onNativeOptionRemove:m.useCallback(D=>{G(W=>{const I=new Set(W);return I.delete(D),I})},[]),children:n})}),H?h.jsxs(Sf,{"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:d,value:j,onChange:D=>k(D.target.value),disabled:f,form:x,children:[j===void 0?h.jsx("option",{value:""}):null,Array.from(Y)]},K):null]})})};Qd.displayName=Bt;var Jd="SelectTrigger",ef=m.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,s=fo(n),i=Tt(Jd,n),a=i.disabled||r,c=re(t,i.onTriggerChange),l=uo(n),u=m.useRef("touch"),[d,f,p]=Tf(g=>{const y=l().filter(S=>!S.disabled),v=y.find(S=>S.value===i.value),w=Pf(y,g,v);w!==void 0&&i.onValueChange(w.value)}),x=g=>{a||(i.onOpenChange(!0),p()),g&&(i.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})};return h.jsx(ji,{asChild:!0,...s,children:h.jsx(z.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":Cf(i.value)?"":void 0,...o,ref:c,onClick:J(o.onClick,g=>{g.currentTarget.focus(),u.current!=="mouse"&&x(g)}),onPointerDown:J(o.onPointerDown,g=>{u.current=g.pointerType;const y=g.target;y.hasPointerCapture(g.pointerId)&&y.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(x(g),g.preventDefault())}),onKeyDown:J(o.onKeyDown,g=>{const y=d.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&f(g.key),!(y&&g.key===" ")&&pS.includes(g.key)&&(x(),g.preventDefault())})})})});ef.displayName=Jd;var tf="SelectValue",nf=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:s,placeholder:i="",...a}=e,c=Tt(tf,n),{onValueNodeHasChildrenChange:l}=c,u=s!==void 0,d=re(t,c.onValueNodeChange);return Ce(()=>{l(u)},[l,u]),h.jsx(z.span,{...a,ref:d,style:{pointerEvents:"none"},children:Cf(c.value)?h.jsx(h.Fragment,{children:i}):s})});nf.displayName=tf;var wS="SelectIcon",rf=m.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return h.jsx(z.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});rf.displayName=wS;var bS="SelectPortal",of=e=>h.jsx(so,{asChild:!0,...e});of.displayName=bS;var $t="SelectContent",sf=m.forwardRef((e,t)=>{const n=Tt($t,e.__scopeSelect),[r,o]=m.useState();if(Ce(()=>{o(new DocumentFragment)},[]),!n.open){const s=r;return s?Wr.createPortal(h.jsx(af,{scope:e.__scopeSelect,children:h.jsx(lo.Slot,{scope:e.__scopeSelect,children:h.jsx("div",{children:e.children})})}),s):null}return h.jsx(cf,{...e,ref:t})});sf.displayName=$t;var We=10,[af,Pt]=yn($t),SS="SelectContentImpl",CS=cn("SelectContent.RemoveScroll"),cf=m.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:i,side:a,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:x,hideWhenDetached:g,avoidCollisions:y,...v}=e,w=Tt($t,n),[S,C]=m.useState(null),[T,E]=m.useState(null),P=re(t,N=>C(N)),[A,j]=m.useState(null),[k,V]=m.useState(null),H=uo(n),[Y,G]=m.useState(!1),K=m.useRef(!1);m.useEffect(()=>{if(S)return Oi(S)},[S]),Pi();const D=m.useCallback(N=>{const[L,...te]=H().map(F=>F.ref.current),[ne]=te.slice(-1),oe=document.activeElement;for(const F of N)if(F===oe||(F==null||F.scrollIntoView({block:"nearest"}),F===L&&T&&(T.scrollTop=0),F===ne&&T&&(T.scrollTop=T.scrollHeight),F==null||F.focus(),document.activeElement!==oe))return},[H,T]),W=m.useCallback(()=>D([A,S]),[D,A,S]);m.useEffect(()=>{Y&&W()},[Y,W]);const{onOpenChange:I,triggerPointerDownPosRef:q}=w;m.useEffect(()=>{if(S){let N={x:0,y:0};const L=ne=>{var oe,F;N={x:Math.abs(Math.round(ne.pageX)-(((oe=q.current)==null?void 0:oe.x)??0)),y:Math.abs(Math.round(ne.pageY)-(((F=q.current)==null?void 0:F.y)??0))}},te=ne=>{N.x<=10&&N.y<=10?ne.preventDefault():S.contains(ne.target)||I(!1),document.removeEventListener("pointermove",L),q.current=null};return q.current!==null&&(document.addEventListener("pointermove",L),document.addEventListener("pointerup",te,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",L),document.removeEventListener("pointerup",te,{capture:!0})}}},[S,I,q]),m.useEffect(()=>{const N=()=>I(!1);return window.addEventListener("blur",N),window.addEventListener("resize",N),()=>{window.removeEventListener("blur",N),window.removeEventListener("resize",N)}},[I]);const[se,ae]=Tf(N=>{const L=H().filter(oe=>!oe.disabled),te=L.find(oe=>oe.ref.current===document.activeElement),ne=Pf(L,N,te);ne&&setTimeout(()=>ne.ref.current.focus())}),M=m.useCallback((N,L,te)=>{const ne=!K.current&&!te;(w.value!==void 0&&w.value===L||ne)&&(j(N),ne&&(K.current=!0))},[w.value]),X=m.useCallback(()=>S==null?void 0:S.focus(),[S]),Z=m.useCallback((N,L,te)=>{const ne=!K.current&&!te;(w.value!==void 0&&w.value===L||ne)&&V(N)},[w.value]),U=r==="popper"?Fs:lf,ee=U===Fs?{side:a,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:x,hideWhenDetached:g,avoidCollisions:y}:{};return h.jsx(af,{scope:n,content:S,viewport:T,onViewportChange:E,itemRefCallback:M,selectedItem:A,onItemLeave:X,itemTextRefCallback:Z,focusSelectedItem:W,selectedItemText:k,position:r,isPositioned:Y,searchRef:se,children:h.jsx(co,{as:CS,allowPinchZoom:!0,children:h.jsx(Qr,{asChild:!0,trapped:w.open,onMountAutoFocus:N=>{N.preventDefault()},onUnmountAutoFocus:J(o,N=>{var L;(L=w.trigger)==null||L.focus({preventScroll:!0}),N.preventDefault()}),children:h.jsx(Zr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:N=>N.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:h.jsx(U,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:N=>N.preventDefault(),...v,...ee,onPlaced:()=>G(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:J(v.onKeyDown,N=>{const L=N.ctrlKey||N.altKey||N.metaKey;if(N.key==="Tab"&&N.preventDefault(),!L&&N.key.length===1&&ae(N.key),["ArrowUp","ArrowDown","Home","End"].includes(N.key)){let ne=H().filter(oe=>!oe.disabled).map(oe=>oe.ref.current);if(["ArrowUp","End"].includes(N.key)&&(ne=ne.slice().reverse()),["ArrowUp","ArrowDown"].includes(N.key)){const oe=N.target,F=ne.indexOf(oe);ne=ne.slice(F+1)}setTimeout(()=>D(ne)),N.preventDefault()}})})})})})})});cf.displayName=SS;var TS="SelectItemAlignedPosition",lf=m.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,s=Tt($t,n),i=Pt($t,n),[a,c]=m.useState(null),[l,u]=m.useState(null),d=re(t,P=>u(P)),f=uo(n),p=m.useRef(!1),x=m.useRef(!0),{viewport:g,selectedItem:y,selectedItemText:v,focusSelectedItem:w}=i,S=m.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&l&&g&&y&&v){const P=s.trigger.getBoundingClientRect(),A=l.getBoundingClientRect(),j=s.valueNode.getBoundingClientRect(),k=v.getBoundingClientRect();if(s.dir!=="rtl"){const oe=k.left-A.left,F=j.left-oe,ve=P.left-F,Le=P.width+ve,At=Math.max(Le,A.width),he=window.innerWidth-We,Te=Cc(F,[We,Math.max(We,he-At)]);a.style.minWidth=Le+"px",a.style.left=Te+"px"}else{const oe=A.right-k.right,F=window.innerWidth-j.right-oe,ve=window.innerWidth-P.right-F,Le=P.width+ve,At=Math.max(Le,A.width),he=window.innerWidth-We,Te=Cc(F,[We,Math.max(We,he-At)]);a.style.minWidth=Le+"px",a.style.right=Te+"px"}const V=f(),H=window.innerHeight-We*2,Y=g.scrollHeight,G=window.getComputedStyle(l),K=parseInt(G.borderTopWidth,10),D=parseInt(G.paddingTop,10),W=parseInt(G.borderBottomWidth,10),I=parseInt(G.paddingBottom,10),q=K+D+Y+I+W,se=Math.min(y.offsetHeight*5,q),ae=window.getComputedStyle(g),M=parseInt(ae.paddingTop,10),X=parseInt(ae.paddingBottom,10),Z=P.top+P.height/2-We,U=H-Z,ee=y.offsetHeight/2,N=y.offsetTop+ee,L=K+D+N,te=q-L;if(L<=Z){const oe=V.length>0&&y===V[V.length-1].ref.current;a.style.bottom="0px";const F=l.clientHeight-g.offsetTop-g.offsetHeight,ve=Math.max(U,ee+(oe?X:0)+F+W),Le=L+ve;a.style.height=Le+"px"}else{const oe=V.length>0&&y===V[0].ref.current;a.style.top="0px";const ve=Math.max(Z,K+g.offsetTop+(oe?M:0)+ee)+te;a.style.height=ve+"px",g.scrollTop=L-Z+g.offsetTop}a.style.margin=`${We}px 0`,a.style.minHeight=se+"px",a.style.maxHeight=H+"px",r==null||r(),requestAnimationFrame(()=>p.current=!0)}},[f,s.trigger,s.valueNode,a,l,g,y,v,s.dir,r]);Ce(()=>S(),[S]);const[C,T]=m.useState();Ce(()=>{l&&T(window.getComputedStyle(l).zIndex)},[l]);const E=m.useCallback(P=>{P&&x.current===!0&&(S(),w==null||w(),x.current=!1)},[S,w]);return h.jsx(RS,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:p,onScrollButtonChange:E,children:h.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:h.jsx(z.div,{...o,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});lf.displayName=TS;var PS="SelectPopperPosition",Fs=m.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=We,...s}=e,i=fo(n);return h.jsx(Bd,{...i,...s,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Fs.displayName=PS;var[RS,Li]=yn($t,{}),_s="SelectViewport",uf=m.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,s=Pt(_s,n),i=Li(_s,n),a=re(t,s.onViewportChange),c=m.useRef(0);return h.jsxs(h.Fragment,{children:[h.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),h.jsx(lo.Slot,{scope:n,children:h.jsx(z.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:J(o.onScroll,l=>{const u=l.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:f}=i;if(f!=null&&f.current&&d){const p=Math.abs(c.current-u.scrollTop);if(p>0){const x=window.innerHeight-We*2,g=parseFloat(d.style.minHeight),y=parseFloat(d.style.height),v=Math.max(g,y);if(v<x){const w=v+p,S=Math.min(x,w),C=w-S;d.style.height=S+"px",d.style.bottom==="0px"&&(u.scrollTop=C>0?C:0,d.style.justifyContent="flex-end")}}}c.current=u.scrollTop})})})]})});uf.displayName=_s;var df="SelectGroup",[ES,AS]=yn(df),ff=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Me();return h.jsx(ES,{scope:n,id:o,children:h.jsx(z.div,{role:"group","aria-labelledby":o,...r,ref:t})})});ff.displayName=df;var hf="SelectLabel",pf=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=AS(hf,n);return h.jsx(z.div,{id:o.id,...r,ref:t})});pf.displayName=hf;var Fr="SelectItem",[DS,mf]=yn(Fr),gf=m.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:s,...i}=e,a=Tt(Fr,n),c=Pt(Fr,n),l=a.value===r,[u,d]=m.useState(s??""),[f,p]=m.useState(!1),x=re(t,w=>{var S;return(S=c.itemRefCallback)==null?void 0:S.call(c,w,r,o)}),g=Me(),y=m.useRef("touch"),v=()=>{o||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return h.jsx(DS,{scope:n,value:r,disabled:o,textId:g,isSelected:l,onItemTextChange:m.useCallback(w=>{d(S=>S||((w==null?void 0:w.textContent)??"").trim())},[]),children:h.jsx(lo.ItemSlot,{scope:n,value:r,disabled:o,textValue:u,children:h.jsx(z.div,{role:"option","aria-labelledby":g,"data-highlighted":f?"":void 0,"aria-selected":l&&f,"data-state":l?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...i,ref:x,onFocus:J(i.onFocus,()=>p(!0)),onBlur:J(i.onBlur,()=>p(!1)),onClick:J(i.onClick,()=>{y.current!=="mouse"&&v()}),onPointerUp:J(i.onPointerUp,()=>{y.current==="mouse"&&v()}),onPointerDown:J(i.onPointerDown,w=>{y.current=w.pointerType}),onPointerMove:J(i.onPointerMove,w=>{var S;y.current=w.pointerType,o?(S=c.onItemLeave)==null||S.call(c):y.current==="mouse"&&w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:J(i.onPointerLeave,w=>{var S;w.currentTarget===document.activeElement&&((S=c.onItemLeave)==null||S.call(c))}),onKeyDown:J(i.onKeyDown,w=>{var C;((C=c.searchRef)==null?void 0:C.current)!==""&&w.key===" "||(mS.includes(w.key)&&v(),w.key===" "&&w.preventDefault())})})})})});gf.displayName=Fr;var Cn="SelectItemText",yf=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...s}=e,i=Tt(Cn,n),a=Pt(Cn,n),c=mf(Cn,n),l=xS(Cn,n),[u,d]=m.useState(null),f=re(t,v=>d(v),c.onItemTextChange,v=>{var w;return(w=a.itemTextRefCallback)==null?void 0:w.call(a,v,c.value,c.disabled)}),p=u==null?void 0:u.textContent,x=m.useMemo(()=>h.jsx("option",{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:g,onNativeOptionRemove:y}=l;return Ce(()=>(g(x),()=>y(x)),[g,y,x]),h.jsxs(h.Fragment,{children:[h.jsx(z.span,{id:c.textId,...s,ref:f}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?Wr.createPortal(s.children,i.valueNode):null]})});yf.displayName=Cn;var vf="SelectItemIndicator",xf=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return mf(vf,n).isSelected?h.jsx(z.span,{"aria-hidden":!0,...r,ref:t}):null});xf.displayName=vf;var Bs="SelectScrollUpButton",MS=m.forwardRef((e,t)=>{const n=Pt(Bs,e.__scopeSelect),r=Li(Bs,e.__scopeSelect),[o,s]=m.useState(!1),i=re(t,r.onScrollButtonChange);return Ce(()=>{if(n.viewport&&n.isPositioned){let a=function(){const l=c.scrollTop>0;s(l)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?h.jsx(wf,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});MS.displayName=Bs;var $s="SelectScrollDownButton",kS=m.forwardRef((e,t)=>{const n=Pt($s,e.__scopeSelect),r=Li($s,e.__scopeSelect),[o,s]=m.useState(!1),i=re(t,r.onScrollButtonChange);return Ce(()=>{if(n.viewport&&n.isPositioned){let a=function(){const l=c.scrollHeight-c.clientHeight,u=Math.ceil(c.scrollTop)<l;s(u)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?h.jsx(wf,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});kS.displayName=$s;var wf=m.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,s=Pt("SelectScrollButton",n),i=m.useRef(null),a=uo(n),c=m.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return m.useEffect(()=>()=>c(),[c]),Ce(()=>{var u;const l=a().find(d=>d.ref.current===document.activeElement);(u=l==null?void 0:l.ref.current)==null||u.scrollIntoView({block:"nearest"})},[a]),h.jsx(z.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:J(o.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:J(o.onPointerMove,()=>{var l;(l=s.onItemLeave)==null||l.call(s),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:J(o.onPointerLeave,()=>{c()})})}),NS="SelectSeparator",bf=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return h.jsx(z.div,{"aria-hidden":!0,...r,ref:t})});bf.displayName=NS;var Ws="SelectArrow",IS=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=fo(n),s=Tt(Ws,n),i=Pt(Ws,n);return s.open&&i.position==="popper"?h.jsx($d,{...o,...r,ref:t}):null});IS.displayName=Ws;var jS="SelectBubbleInput",Sf=m.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=m.useRef(null),s=re(r,o),i=io(t);return m.useEffect(()=>{const a=o.current;if(!a)return;const c=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==t&&u){const d=new Event("change",{bubbles:!0});u.call(a,t),a.dispatchEvent(d)}},[i,t]),h.jsx(z.select,{...n,style:{...Wd,...n.style},ref:s,defaultValue:t})});Sf.displayName=jS;function Cf(e){return e===""||e===void 0}function Tf(e){const t=vt(e),n=m.useRef(""),r=m.useRef(0),o=m.useCallback(i=>{const a=n.current+i;t(a),(function c(l){n.current=l,window.clearTimeout(r.current),l!==""&&(r.current=window.setTimeout(()=>c(""),1e3))})(a)},[t]),s=m.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}function Pf(e,t,n){const o=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=OS(e,Math.max(s,0));o.length===1&&(i=i.filter(l=>l!==n));const c=i.find(l=>l.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}function OS(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var LS=Qd,VS=ef,FS=nf,_S=rf,BS=of,$S=sf,WS=uf,US=ff,HS=pf,GS=gf,KS=yf,zS=xf,YS=bf;function XS({placeholder:e,size:t,color:n="primary",triggerIcon:r,triggerClassName:o,contentClassName:s,id:i,className:a,disabled:c,children:l,"aria-invalid":u,"aria-describedby":d,...f}){const p=$("cny-select-trigger",t==="sm"||t==="lg"?t:null,n!=="primary"&&n,a,o);return h.jsxs(LS,{disabled:c,...f,children:[h.jsxs(VS,{id:i,"aria-invalid":u,"aria-describedby":d,className:p,children:[r&&h.jsx("span",{style:{display:"inline-flex"},children:r}),h.jsx(FS,{placeholder:e}),h.jsx(_S,{className:"cny-select-chevron",asChild:!0,children:h.jsx(Ti,{size:14,"aria-hidden":"true"})})]}),h.jsx(BS,{children:h.jsx($S,{position:"popper",sideOffset:4,className:$("cny-select-content",s),children:h.jsx(WS,{className:"cny-select-viewport",children:l})})})]})}const qS=b.forwardRef(function({className:t,children:n,...r},o){return h.jsxs(GS,{ref:o,className:$("cny-select-item",t),...r,children:[h.jsx(KS,{children:n}),h.jsx(zS,{className:"cny-select-indicator",children:h.jsx(Ir,{size:14,"aria-hidden":"true"})})]})}),ZS=b.forwardRef(function(t,n){return h.jsx(US,{ref:n,...t})}),QS=b.forwardRef(function({className:t,...n},r){return h.jsx(HS,{ref:r,className:$("cny-select-group-label",t),...n})}),JS=b.forwardRef(function({className:t,...n},r){return h.jsx(YS,{ref:r,className:$("cny-select-separator",t),...n})});function eC(e,t){return m.useReducer((n,r)=>t[n][r]??n,e)}var Rt=e=>{const{present:t,children:n}=e,r=tC(t),o=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),s=re(r.ref,nC(o));return typeof n=="function"||r.isPresent?m.cloneElement(o,{ref:s}):null};Rt.displayName="Presence";function tC(e){const[t,n]=m.useState(),r=m.useRef(null),o=m.useRef(e),s=m.useRef("none"),i=e?"mounted":"unmounted",[a,c]=eC(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const l=or(r.current);s.current=a==="mounted"?l:"none"},[a]),Ce(()=>{const l=r.current,u=o.current;if(u!==e){const f=s.current,p=or(l);e?c("MOUNT"):p==="none"||(l==null?void 0:l.display)==="none"?c("UNMOUNT"):c(u&&f!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),Ce(()=>{if(t){let l;const u=t.ownerDocument.defaultView??window,d=p=>{const g=or(r.current).includes(CSS.escape(p.animationName));if(p.target===t&&g&&(c("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",l=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},f=p=>{p.target===t&&(s.current=or(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(l),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:m.useCallback(l=>{r.current=l?getComputedStyle(l):null,n(l)},[])}}function or(e){return(e==null?void 0:e.animationName)||"none"}function nC(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ho="Popover",[Rf]=ze(ho,[oo]),_n=oo(),[rC,Et]=Rf(ho),Ef=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!1}=e,a=_n(t),c=m.useRef(null),[l,u]=m.useState(!1),[d,f]=He({prop:r,defaultProp:o??!1,onChange:s,caller:ho});return h.jsx(_d,{...a,children:h.jsx(rC,{scope:t,contentId:Me(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(p=>!p),[f]),hasCustomAnchor:l,onCustomAnchorAdd:m.useCallback(()=>u(!0),[]),onCustomAnchorRemove:m.useCallback(()=>u(!1),[]),modal:i,children:n})})};Ef.displayName=ho;var Af="PopoverAnchor",oC=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Et(Af,n),s=_n(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:a}=o;return m.useEffect(()=>(i(),()=>a()),[i,a]),h.jsx(ji,{...s,...r,ref:t})});oC.displayName=Af;var Df="PopoverTrigger",Mf=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Et(Df,n),s=_n(n),i=re(t,o.triggerRef),a=h.jsx(z.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Of(o.open),...r,ref:i,onClick:J(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?a:h.jsx(ji,{asChild:!0,...s,children:a})});Mf.displayName=Df;var Vi="PopoverPortal",[sC,iC]=Rf(Vi,{forceMount:void 0}),kf=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,s=Et(Vi,t);return h.jsx(sC,{scope:t,forceMount:n,children:h.jsx(Rt,{present:n||s.open,children:h.jsx(so,{asChild:!0,container:o,children:r})})})};kf.displayName=Vi;var un="PopoverContent",Nf=m.forwardRef((e,t)=>{const n=iC(un,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,s=Et(un,e.__scopePopover);return h.jsx(Rt,{present:r||s.open,children:s.modal?h.jsx(cC,{...o,ref:t}):h.jsx(lC,{...o,ref:t})})});Nf.displayName=un;var aC=cn("PopoverContent.RemoveScroll"),cC=m.forwardRef((e,t)=>{const n=Et(un,e.__scopePopover),r=m.useRef(null),o=re(t,r),s=m.useRef(!1);return m.useEffect(()=>{const i=r.current;if(i)return Oi(i)},[]),h.jsx(co,{as:aC,allowPinchZoom:!0,children:h.jsx(If,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:J(e.onCloseAutoFocus,i=>{var a;i.preventDefault(),s.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:J(e.onPointerDownOutside,i=>{const a=i.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0,l=a.button===2||c;s.current=l},{checkForDefaultPrevented:!1}),onFocusOutside:J(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),lC=m.forwardRef((e,t)=>{const n=Et(un,e.__scopePopover),r=m.useRef(!1),o=m.useRef(!1);return h.jsx(If,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var i,a;(i=e.onCloseAutoFocus)==null||i.call(e,s),s.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{var c,l;(c=e.onInteractOutside)==null||c.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;((l=n.triggerRef.current)==null?void 0:l.contains(i))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),If=m.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:i,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=Et(un,n),p=_n(n);return Pi(),h.jsx(Qr,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:h.jsx(Zr,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),children:h.jsx(Bd,{"data-state":Of(f.open),role:"dialog",id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),jf="PopoverClose",uC=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Et(jf,n);return h.jsx(z.button,{type:"button",...r,ref:t,onClick:J(e.onClick,()=>o.onOpenChange(!1))})});uC.displayName=jf;var dC="PopoverArrow",fC=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=_n(n);return h.jsx($d,{...o,...r,ref:t})});fC.displayName=dC;function Of(e){return e?"open":"closed"}var hC=Ef,pC=Mf,mC=kf,gC=Nf,zc=1,yC=.9,vC=.8,xC=.17,ts=.1,ns=.999,wC=.9999,bC=.99,SC=/[\\\/_+.#"@\[\(\{&]/,CC=/[\\\/_+.#"@\[\(\{&]/g,TC=/[\s-]/,Lf=/[\s-]/g;function Us(e,t,n,r,o,s,i){if(s===t.length)return o===e.length?zc:bC;var a=`${o},${s}`;if(i[a]!==void 0)return i[a];for(var c=r.charAt(s),l=n.indexOf(c,o),u=0,d,f,p,x;l>=0;)d=Us(e,t,n,r,l+1,s+1,i),d>u&&(l===o?d*=zc:SC.test(e.charAt(l-1))?(d*=vC,p=e.slice(o,l-1).match(CC),p&&o>0&&(d*=Math.pow(ns,p.length))):TC.test(e.charAt(l-1))?(d*=yC,x=e.slice(o,l-1).match(Lf),x&&o>0&&(d*=Math.pow(ns,x.length))):(d*=xC,o>0&&(d*=Math.pow(ns,l-o))),e.charAt(l)!==t.charAt(s)&&(d*=wC)),(d<ts&&n.charAt(l-1)===r.charAt(s+1)||r.charAt(s+1)===r.charAt(s)&&n.charAt(l-1)!==r.charAt(s))&&(f=Us(e,t,n,r,l+1,s+2,i),f*ts>d&&(d=f*ts)),d>u&&(u=d),l=n.indexOf(c,l+1);return i[a]=u,u}function Yc(e){return e.toLowerCase().replace(Lf," ")}function PC(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Us(e,t,Yc(e),Yc(t),0,0,{})}var po="Dialog",[Vf]=ze(po),[RC,Ye]=Vf(po),Ff=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!0}=e,a=m.useRef(null),c=m.useRef(null),[l,u]=He({prop:r,defaultProp:o??!1,onChange:s,caller:po});return h.jsx(RC,{scope:t,triggerRef:a,contentRef:c,contentId:Me(),titleId:Me(),descriptionId:Me(),open:l,onOpenChange:u,onOpenToggle:m.useCallback(()=>u(d=>!d),[u]),modal:i,children:n})};Ff.displayName=po;var _f="DialogTrigger",EC=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ye(_f,n),s=re(t,o.triggerRef);return h.jsx(z.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Bi(o.open),...r,ref:s,onClick:J(e.onClick,o.onOpenToggle)})});EC.displayName=_f;var Fi="DialogPortal",[AC,Bf]=Vf(Fi,{forceMount:void 0}),$f=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=Ye(Fi,t);return h.jsx(AC,{scope:t,forceMount:n,children:m.Children.map(r,i=>h.jsx(Rt,{present:n||s.open,children:h.jsx(so,{asChild:!0,container:o,children:i})}))})};$f.displayName=Fi;var _r="DialogOverlay",Wf=m.forwardRef((e,t)=>{const n=Bf(_r,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=Ye(_r,e.__scopeDialog);return s.modal?h.jsx(Rt,{present:r||s.open,children:h.jsx(MC,{...o,ref:t})}):null});Wf.displayName=_r;var DC=cn("DialogOverlay.RemoveScroll"),MC=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ye(_r,n);return h.jsx(co,{as:DC,allowPinchZoom:!0,shards:[o.contentRef],children:h.jsx(z.div,{"data-state":Bi(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Wt="DialogContent",Uf=m.forwardRef((e,t)=>{const n=Bf(Wt,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=Ye(Wt,e.__scopeDialog);return h.jsx(Rt,{present:r||s.open,children:s.modal?h.jsx(kC,{...o,ref:t}):h.jsx(NC,{...o,ref:t})})});Uf.displayName=Wt;var kC=m.forwardRef((e,t)=>{const n=Ye(Wt,e.__scopeDialog),r=m.useRef(null),o=re(t,n.contentRef,r);return m.useEffect(()=>{const s=r.current;if(s)return Oi(s)},[]),h.jsx(Hf,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:J(e.onCloseAutoFocus,s=>{var i;s.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:J(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&s.preventDefault()}),onFocusOutside:J(e.onFocusOutside,s=>s.preventDefault())})}),NC=m.forwardRef((e,t)=>{const n=Ye(Wt,e.__scopeDialog),r=m.useRef(!1),o=m.useRef(!1);return h.jsx(Hf,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var i,a;(i=e.onCloseAutoFocus)==null||i.call(e,s),s.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{var c,l;(c=e.onInteractOutside)==null||c.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;((l=n.triggerRef.current)==null?void 0:l.contains(i))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),Hf=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,...i}=e,a=Ye(Wt,n),c=m.useRef(null),l=re(t,c);return Pi(),h.jsxs(h.Fragment,{children:[h.jsx(Qr,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:h.jsx(Zr,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Bi(a.open),...i,ref:l,onDismiss:()=>a.onOpenChange(!1)})}),h.jsxs(h.Fragment,{children:[h.jsx(jC,{titleId:a.titleId}),h.jsx(LC,{contentRef:c,descriptionId:a.descriptionId})]})]})}),_i="DialogTitle",Gf=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ye(_i,n);return h.jsx(z.h2,{id:o.titleId,...r,ref:t})});Gf.displayName=_i;var Kf="DialogDescription",zf=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ye(Kf,n);return h.jsx(z.p,{id:o.descriptionId,...r,ref:t})});zf.displayName=Kf;var Yf="DialogClose",IC=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ye(Yf,n);return h.jsx(z.button,{type:"button",...r,ref:t,onClick:J(e.onClick,()=>o.onOpenChange(!1))})});IC.displayName=Yf;function Bi(e){return e?"open":"closed"}var Xf="DialogTitleWarning",[ZT,qf]=wx(Xf,{contentName:Wt,titleName:_i,docsSlug:"dialog"}),jC=({titleId:e})=>{const t=qf(Xf),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
184
|
+
`)},TT=0,cn=[];function PT(e){var t=p.useRef([]),n=p.useRef([0,0]),r=p.useRef(),o=p.useState(TT++)[0],s=p.useState(ch)[0],i=p.useRef(e);p.useEffect(function(){i.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var g=zR([e.lockRef.current],(e.shards||[]).map(cu),!0).filter(Boolean);return g.forEach(function(v){return v.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),g.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=p.useCallback(function(g,v){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!i.current.allowPinchZoom;var x=kr(g),b=n.current,C="deltaX"in g?g.deltaX:b[0]-x[0],S="deltaY"in g?g.deltaY:b[1]-x[1],R,P=g.target,T=Math.abs(C)>Math.abs(S)?"h":"v";if("touches"in g&&T==="h"&&P.type==="range")return!1;var A=window.getSelection(),k=A&&A.anchorNode,N=k?k===P||k.contains(P):!1;if(N)return!1;var L=iu(T,P);if(!L)return!0;if(L?R=T:(R=T==="v"?"h":"v",L=iu(T,P)),!L)return!1;if(!r.current&&"changedTouches"in g&&(C||S)&&(r.current=R),!R)return!0;var G=r.current||R;return CT(G,v,g,G==="h"?C:S)},[]),c=p.useCallback(function(g){var v=g;if(!(!cn.length||cn[cn.length-1]!==s)){var x="deltaY"in v?au(v):kr(v),b=t.current.filter(function(R){return R.name===v.type&&(R.target===v.target||v.target===R.shadowParent)&&ST(R.delta,x)})[0];if(b&&b.should){v.cancelable&&v.preventDefault();return}if(!b){var C=(i.current.shards||[]).map(cu).filter(Boolean).filter(function(R){return R.contains(v.target)}),S=C.length>0?a(v,C[0]):!i.current.noIsolation;S&&v.cancelable&&v.preventDefault()}}},[]),u=p.useCallback(function(g,v,x,b){var C={name:g,delta:v,target:x,should:b,shadowParent:ET(x)};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(S){return S!==C})},1)},[]),d=p.useCallback(function(g){n.current=kr(g),r.current=void 0},[]),f=p.useCallback(function(g){u(g.type,au(g),g.target,a(g,e.lockRef.current))},[]),h=p.useCallback(function(g){u(g.type,kr(g),g.target,a(g,e.lockRef.current))},[]);p.useEffect(function(){return cn.push(s),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",c,an),document.addEventListener("touchmove",c,an),document.addEventListener("touchstart",d,an),function(){cn=cn.filter(function(g){return g!==s}),document.removeEventListener("wheel",c,an),document.removeEventListener("touchmove",c,an),document.removeEventListener("touchstart",d,an)}},[]);var m=e.removeScrollBar,y=e.inert;return p.createElement(p.Fragment,null,y?p.createElement(s,{styles:RT(o)}):null,m?p.createElement(mT,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function ET(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const MT=nT(ah,PT);var ur=p.forwardRef(function(e,t){return p.createElement($o,ot({},e,{ref:t,sideCar:MT}))});ur.classNames=$o.classNames;var AT=[" ","Enter","ArrowUp","ArrowDown"],DT=[" ","Enter"],qt="Select",[Bo,Wo,NT]=nr(qt),[jn]=Ce(qt,[NT,kt]),Go=kt(),[jT,It]=jn(qt),[kT,IT]=jn(qt),fh=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:s,value:i,defaultValue:a,onValueChange:c,dir:u,name:d,autoComplete:f,disabled:h,required:m,form:y}=e,g=Go(t),[v,x]=p.useState(null),[b,C]=p.useState(null),[S,R]=p.useState(!1),P=At(u),[T,A]=be({prop:r,defaultProp:o??!1,onChange:s,caller:qt}),[k,N]=be({prop:i,defaultProp:a,onChange:c,caller:qt}),L=p.useRef(null),G=v?y||!!v.closest("form"):!0,[J,F]=p.useState(new Set),Z=Array.from(J).map(D=>D.props.value).join(";");return l.jsx(ar,{...g,children:l.jsxs(jT,{required:m,scope:t,trigger:v,onTriggerChange:x,valueNode:b,onValueNodeChange:C,valueNodeHasChildren:S,onValueNodeHasChildrenChange:R,contentId:he(),value:k,onValueChange:N,open:T,onOpenChange:A,dir:P,triggerPointerDownPosRef:L,disabled:h,children:[l.jsx(Bo.Provider,{scope:t,children:l.jsx(kT,{scope:e.__scopeSelect,onNativeOptionAdd:p.useCallback(D=>{F(U=>new Set(U).add(D))},[]),onNativeOptionRemove:p.useCallback(D=>{F(U=>{const j=new Set(U);return j.delete(D),j})},[]),children:n})}),G?l.jsxs(_h,{"aria-hidden":!0,required:m,tabIndex:-1,name:d,autoComplete:f,value:k,onChange:D=>N(D.target.value),disabled:h,form:y,children:[k===void 0?l.jsx("option",{value:""}):null,Array.from(J)]},Z):null]})})};fh.displayName=qt;var hh="SelectTrigger",ph=p.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,s=Go(n),i=It(hh,n),a=i.disabled||r,c=te(t,i.onTriggerChange),u=Wo(n),d=p.useRef("touch"),[f,h,m]=Lh(g=>{const v=u().filter(C=>!C.disabled),x=v.find(C=>C.value===i.value),b=Vh(v,g,x);b!==void 0&&i.onValueChange(b.value)}),y=g=>{a||(i.onOpenChange(!0),m()),g&&(i.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})};return l.jsx(cr,{asChild:!0,...s,children:l.jsx(K.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":Oh(i.value)?"":void 0,...o,ref:c,onClick:V(o.onClick,g=>{g.currentTarget.focus(),d.current!=="mouse"&&y(g)}),onPointerDown:V(o.onPointerDown,g=>{d.current=g.pointerType;const v=g.target;v.hasPointerCapture(g.pointerId)&&v.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(y(g),g.preventDefault())}),onKeyDown:V(o.onKeyDown,g=>{const v=f.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&h(g.key),!(v&&g.key===" ")&&AT.includes(g.key)&&(y(),g.preventDefault())})})})});ph.displayName=hh;var mh="SelectValue",gh=p.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:s,placeholder:i="",...a}=e,c=It(mh,n),{onValueNodeHasChildrenChange:u}=c,d=s!==void 0,f=te(t,c.onValueNodeChange);return Pe(()=>{u(d)},[u,d]),l.jsx(K.span,{...a,ref:f,style:{pointerEvents:"none"},children:Oh(c.value)?l.jsx(l.Fragment,{children:i}):s})});gh.displayName=mh;var _T="SelectIcon",vh=p.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return l.jsx(K.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});vh.displayName=_T;var OT="SelectPortal",yh=e=>l.jsx(Nn,{asChild:!0,...e});yh.displayName=OT;var Zt="SelectContent",xh=p.forwardRef((e,t)=>{const n=It(Zt,e.__scopeSelect),[r,o]=p.useState();if(Pe(()=>{o(new DocumentFragment)},[]),!n.open){const s=r;return s?So.createPortal(l.jsx(bh,{scope:e.__scopeSelect,children:l.jsx(Bo.Slot,{scope:e.__scopeSelect,children:l.jsx("div",{children:e.children})})}),s):null}return l.jsx(wh,{...e,ref:t})});xh.displayName=Zt;var ze=10,[bh,_t]=jn(Zt),LT="SelectContentImpl",VT=Yt("SelectContent.RemoveScroll"),wh=p.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:i,side:a,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:h,collisionPadding:m,sticky:y,hideWhenDetached:g,avoidCollisions:v,...x}=e,b=It(Zt,n),[C,S]=p.useState(null),[R,P]=p.useState(null),T=te(t,I=>S(I)),[A,k]=p.useState(null),[N,L]=p.useState(null),G=Wo(n),[J,F]=p.useState(!1),Z=p.useRef(!1);p.useEffect(()=>{if(C)return Fo(C)},[C]),jo();const D=p.useCallback(I=>{const[B,...ee]=G().map(X=>X.ref.current),[se]=ee.slice(-1),ie=document.activeElement;for(const X of I)if(X===ie||(X==null||X.scrollIntoView({block:"nearest"}),X===B&&R&&(R.scrollTop=0),X===se&&R&&(R.scrollTop=R.scrollHeight),X==null||X.focus(),document.activeElement!==ie))return},[G,R]),U=p.useCallback(()=>D([A,C]),[D,A,C]);p.useEffect(()=>{J&&U()},[J,U]);const{onOpenChange:j,triggerPointerDownPosRef:O}=b;p.useEffect(()=>{if(C){let I={x:0,y:0};const B=se=>{var ie,X;I={x:Math.abs(Math.round(se.pageX)-(((ie=O.current)==null?void 0:ie.x)??0)),y:Math.abs(Math.round(se.pageY)-(((X=O.current)==null?void 0:X.y)??0))}},ee=se=>{I.x<=10&&I.y<=10?se.preventDefault():C.contains(se.target)||j(!1),document.removeEventListener("pointermove",B),O.current=null};return O.current!==null&&(document.addEventListener("pointermove",B),document.addEventListener("pointerup",ee,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",B),document.removeEventListener("pointerup",ee,{capture:!0})}}},[C,j,O]),p.useEffect(()=>{const I=()=>j(!1);return window.addEventListener("blur",I),window.addEventListener("resize",I),()=>{window.removeEventListener("blur",I),window.removeEventListener("resize",I)}},[j]);const[ne,W]=Lh(I=>{const B=G().filter(ie=>!ie.disabled),ee=B.find(ie=>ie.ref.current===document.activeElement),se=Vh(B,I,ee);se&&setTimeout(()=>se.ref.current.focus())}),M=p.useCallback((I,B,ee)=>{const se=!Z.current&&!ee;(b.value!==void 0&&b.value===B||se)&&(k(I),se&&(Z.current=!0))},[b.value]),Y=p.useCallback(()=>C==null?void 0:C.focus(),[C]),z=p.useCallback((I,B,ee)=>{const se=!Z.current&&!ee;(b.value!==void 0&&b.value===B||se)&&L(I)},[b.value]),H=r==="popper"?Si:Ch,re=H===Si?{side:a,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:h,collisionPadding:m,sticky:y,hideWhenDetached:g,avoidCollisions:v}:{};return l.jsx(bh,{scope:n,content:C,viewport:R,onViewportChange:P,itemRefCallback:M,selectedItem:A,onItemLeave:Y,itemTextRefCallback:z,focusSelectedItem:U,selectedItemText:N,position:r,isPositioned:J,searchRef:ne,children:l.jsx(ur,{as:VT,allowPinchZoom:!0,children:l.jsx(or,{asChild:!0,trapped:b.open,onMountAutoFocus:I=>{I.preventDefault()},onUnmountAutoFocus:V(o,I=>{var B;(B=b.trigger)==null||B.focus({preventScroll:!0}),I.preventDefault()}),children:l.jsx(Mn,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:I=>I.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:l.jsx(H,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:I=>I.preventDefault(),...x,...re,onPlaced:()=>F(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:V(x.onKeyDown,I=>{const B=I.ctrlKey||I.altKey||I.metaKey;if(I.key==="Tab"&&I.preventDefault(),!B&&I.key.length===1&&W(I.key),["ArrowUp","ArrowDown","Home","End"].includes(I.key)){let se=G().filter(ie=>!ie.disabled).map(ie=>ie.ref.current);if(["ArrowUp","End"].includes(I.key)&&(se=se.slice().reverse()),["ArrowUp","ArrowDown"].includes(I.key)){const ie=I.target,X=se.indexOf(ie);se=se.slice(X+1)}setTimeout(()=>D(se)),I.preventDefault()}})})})})})})});wh.displayName=LT;var FT="SelectItemAlignedPosition",Ch=p.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,s=It(Zt,n),i=_t(Zt,n),[a,c]=p.useState(null),[u,d]=p.useState(null),f=te(t,T=>d(T)),h=Wo(n),m=p.useRef(!1),y=p.useRef(!0),{viewport:g,selectedItem:v,selectedItemText:x,focusSelectedItem:b}=i,C=p.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&u&&g&&v&&x){const T=s.trigger.getBoundingClientRect(),A=u.getBoundingClientRect(),k=s.valueNode.getBoundingClientRect(),N=x.getBoundingClientRect();if(s.dir!=="rtl"){const ie=N.left-A.left,X=k.left-ie,Se=T.left-X,Be=T.width+Se,Vt=Math.max(Be,A.width),pe=window.innerWidth-ze,De=uo(X,[ze,Math.max(ze,pe-Vt)]);a.style.minWidth=Be+"px",a.style.left=De+"px"}else{const ie=A.right-N.right,X=window.innerWidth-k.right-ie,Se=window.innerWidth-T.right-X,Be=T.width+Se,Vt=Math.max(Be,A.width),pe=window.innerWidth-ze,De=uo(X,[ze,Math.max(ze,pe-Vt)]);a.style.minWidth=Be+"px",a.style.right=De+"px"}const L=h(),G=window.innerHeight-ze*2,J=g.scrollHeight,F=window.getComputedStyle(u),Z=parseInt(F.borderTopWidth,10),D=parseInt(F.paddingTop,10),U=parseInt(F.borderBottomWidth,10),j=parseInt(F.paddingBottom,10),O=Z+D+J+j+U,ne=Math.min(v.offsetHeight*5,O),W=window.getComputedStyle(g),M=parseInt(W.paddingTop,10),Y=parseInt(W.paddingBottom,10),z=T.top+T.height/2-ze,H=G-z,re=v.offsetHeight/2,I=v.offsetTop+re,B=Z+D+I,ee=O-B;if(B<=z){const ie=L.length>0&&v===L[L.length-1].ref.current;a.style.bottom="0px";const X=u.clientHeight-g.offsetTop-g.offsetHeight,Se=Math.max(H,re+(ie?Y:0)+X+U),Be=B+Se;a.style.height=Be+"px"}else{const ie=L.length>0&&v===L[0].ref.current;a.style.top="0px";const Se=Math.max(z,Z+g.offsetTop+(ie?M:0)+re)+ee;a.style.height=Se+"px",g.scrollTop=B-z+g.offsetTop}a.style.margin=`${ze}px 0`,a.style.minHeight=ne+"px",a.style.maxHeight=G+"px",r==null||r(),requestAnimationFrame(()=>m.current=!0)}},[h,s.trigger,s.valueNode,a,u,g,v,x,s.dir,r]);Pe(()=>C(),[C]);const[S,R]=p.useState();Pe(()=>{u&&R(window.getComputedStyle(u).zIndex)},[u]);const P=p.useCallback(T=>{T&&y.current===!0&&(C(),b==null||b(),y.current=!1)},[C,b]);return l.jsx(BT,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:m,onScrollButtonChange:P,children:l.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:l.jsx(K.div,{...o,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Ch.displayName=FT;var $T="SelectPopperPosition",Si=p.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=ze,...s}=e,i=Go(n);return l.jsx(Lo,{...i,...s,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Si.displayName=$T;var[BT,Ta]=jn(Zt,{}),Ri="SelectViewport",Sh=p.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,s=_t(Ri,n),i=Ta(Ri,n),a=te(t,s.onViewportChange),c=p.useRef(0);return l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),l.jsx(Bo.Slot,{scope:n,children:l.jsx(K.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:V(o.onScroll,u=>{const d=u.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:h}=i;if(h!=null&&h.current&&f){const m=Math.abs(c.current-d.scrollTop);if(m>0){const y=window.innerHeight-ze*2,g=parseFloat(f.style.minHeight),v=parseFloat(f.style.height),x=Math.max(g,v);if(x<y){const b=x+m,C=Math.min(y,b),S=b-C;f.style.height=C+"px",f.style.bottom==="0px"&&(d.scrollTop=S>0?S:0,f.style.justifyContent="flex-end")}}}c.current=d.scrollTop})})})]})});Sh.displayName=Ri;var Rh="SelectGroup",[WT,GT]=jn(Rh),Th=p.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=he();return l.jsx(WT,{scope:n,id:o,children:l.jsx(K.div,{role:"group","aria-labelledby":o,...r,ref:t})})});Th.displayName=Rh;var Ph="SelectLabel",Eh=p.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=GT(Ph,n);return l.jsx(K.div,{id:o.id,...r,ref:t})});Eh.displayName=Ph;var go="SelectItem",[UT,Mh]=jn(go),Ah=p.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:s,...i}=e,a=It(go,n),c=_t(go,n),u=a.value===r,[d,f]=p.useState(s??""),[h,m]=p.useState(!1),y=te(t,b=>{var C;return(C=c.itemRefCallback)==null?void 0:C.call(c,b,r,o)}),g=he(),v=p.useRef("touch"),x=()=>{o||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return l.jsx(UT,{scope:n,value:r,disabled:o,textId:g,isSelected:u,onItemTextChange:p.useCallback(b=>{f(C=>C||((b==null?void 0:b.textContent)??"").trim())},[]),children:l.jsx(Bo.ItemSlot,{scope:n,value:r,disabled:o,textValue:d,children:l.jsx(K.div,{role:"option","aria-labelledby":g,"data-highlighted":h?"":void 0,"aria-selected":u&&h,"data-state":u?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...i,ref:y,onFocus:V(i.onFocus,()=>m(!0)),onBlur:V(i.onBlur,()=>m(!1)),onClick:V(i.onClick,()=>{v.current!=="mouse"&&x()}),onPointerUp:V(i.onPointerUp,()=>{v.current==="mouse"&&x()}),onPointerDown:V(i.onPointerDown,b=>{v.current=b.pointerType}),onPointerMove:V(i.onPointerMove,b=>{var C;v.current=b.pointerType,o?(C=c.onItemLeave)==null||C.call(c):v.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:V(i.onPointerLeave,b=>{var C;b.currentTarget===document.activeElement&&((C=c.onItemLeave)==null||C.call(c))}),onKeyDown:V(i.onKeyDown,b=>{var S;((S=c.searchRef)==null?void 0:S.current)!==""&&b.key===" "||(DT.includes(b.key)&&x(),b.key===" "&&b.preventDefault())})})})})});Ah.displayName=go;var Fn="SelectItemText",Dh=p.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...s}=e,i=It(Fn,n),a=_t(Fn,n),c=Mh(Fn,n),u=IT(Fn,n),[d,f]=p.useState(null),h=te(t,x=>f(x),c.onItemTextChange,x=>{var b;return(b=a.itemTextRefCallback)==null?void 0:b.call(a,x,c.value,c.disabled)}),m=d==null?void 0:d.textContent,y=p.useMemo(()=>l.jsx("option",{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:g,onNativeOptionRemove:v}=u;return Pe(()=>(g(y),()=>v(y)),[g,v,y]),l.jsxs(l.Fragment,{children:[l.jsx(K.span,{id:c.textId,...s,ref:h}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?So.createPortal(s.children,i.valueNode):null]})});Dh.displayName=Fn;var Nh="SelectItemIndicator",jh=p.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Mh(Nh,n).isSelected?l.jsx(K.span,{"aria-hidden":!0,...r,ref:t}):null});jh.displayName=Nh;var Ti="SelectScrollUpButton",KT=p.forwardRef((e,t)=>{const n=_t(Ti,e.__scopeSelect),r=Ta(Ti,e.__scopeSelect),[o,s]=p.useState(!1),i=te(t,r.onScrollButtonChange);return Pe(()=>{if(n.viewport&&n.isPositioned){let a=function(){const u=c.scrollTop>0;s(u)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?l.jsx(kh,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});KT.displayName=Ti;var Pi="SelectScrollDownButton",HT=p.forwardRef((e,t)=>{const n=_t(Pi,e.__scopeSelect),r=Ta(Pi,e.__scopeSelect),[o,s]=p.useState(!1),i=te(t,r.onScrollButtonChange);return Pe(()=>{if(n.viewport&&n.isPositioned){let a=function(){const u=c.scrollHeight-c.clientHeight,d=Math.ceil(c.scrollTop)<u;s(d)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?l.jsx(kh,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});HT.displayName=Pi;var kh=p.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,s=_t("SelectScrollButton",n),i=p.useRef(null),a=Wo(n),c=p.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return p.useEffect(()=>()=>c(),[c]),Pe(()=>{var d;const u=a().find(f=>f.ref.current===document.activeElement);(d=u==null?void 0:u.ref.current)==null||d.scrollIntoView({block:"nearest"})},[a]),l.jsx(K.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:V(o.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:V(o.onPointerMove,()=>{var u;(u=s.onItemLeave)==null||u.call(s),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:V(o.onPointerLeave,()=>{c()})})}),zT="SelectSeparator",Ih=p.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return l.jsx(K.div,{"aria-hidden":!0,...r,ref:t})});Ih.displayName=zT;var Ei="SelectArrow",YT=p.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Go(n),s=It(Ei,n),i=_t(Ei,n);return s.open&&i.position==="popper"?l.jsx(Vo,{...o,...r,ref:t}):null});YT.displayName=Ei;var XT="SelectBubbleInput",_h=p.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=p.useRef(null),s=te(r,o),i=lr(t);return p.useEffect(()=>{const a=o.current;if(!a)return;const c=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==t&&d){const f=new Event("change",{bubbles:!0});d.call(a,t),a.dispatchEvent(f)}},[i,t]),l.jsx(K.select,{...n,style:{...rh,...n.style},ref:s,defaultValue:t})});_h.displayName=XT;function Oh(e){return e===""||e===void 0}function Lh(e){const t=Xe(e),n=p.useRef(""),r=p.useRef(0),o=p.useCallback(i=>{const a=n.current+i;t(a),(function c(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>c(""),1e3))})(a)},[t]),s=p.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return p.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}function Vh(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=qT(e,Math.max(s,0));o.length===1&&(i=i.filter(u=>u!==n));const c=i.find(u=>u.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}function qT(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var ZT=fh,QT=ph,JT=gh,eP=vh,tP=yh,nP=xh,rP=Sh,oP=Th,sP=Eh,iP=Ah,aP=Dh,cP=jh,lP=Ih;function uP({placeholder:e,size:t,color:n="primary",triggerIcon:r,triggerClassName:o,contentClassName:s,id:i,className:a,disabled:c,children:u,"aria-invalid":d,"aria-describedby":f,...h}){const m=_("cny-select-trigger",t==="sm"||t==="lg"?t:null,n!=="primary"&&n,a,o);return l.jsxs(ZT,{disabled:c,...h,children:[l.jsxs(QT,{id:i,"aria-invalid":d,"aria-describedby":f,className:m,children:[r&&l.jsx("span",{style:{display:"inline-flex"},children:r}),l.jsx(JT,{placeholder:e}),l.jsx(eP,{className:"cny-select-chevron",asChild:!0,children:l.jsx(No,{size:14,"aria-hidden":"true"})})]}),l.jsx(tP,{children:l.jsx(nP,{position:"popper",sideOffset:4,className:_("cny-select-content",s),children:l.jsx(rP,{className:"cny-select-viewport",children:u})})})]})}const dP=w.forwardRef(function({className:t,children:n,...r},o){return l.jsxs(iP,{ref:o,className:_("cny-select-item",t),...r,children:[l.jsx(aP,{children:n}),l.jsx(cP,{className:"cny-select-indicator",children:l.jsx(Rt,{size:14,"aria-hidden":"true"})})]})}),fP=w.forwardRef(function(t,n){return l.jsx(oP,{ref:n,...t})}),hP=w.forwardRef(function({className:t,...n},r){return l.jsx(sP,{ref:r,className:_("cny-select-group-label",t),...n})}),pP=w.forwardRef(function({className:t,...n},r){return l.jsx(lP,{ref:r,className:_("cny-select-separator",t),...n})});function mP(e,t){return p.useReducer((n,r)=>t[n][r]??n,e)}var Me=e=>{const{present:t,children:n}=e,r=gP(t),o=typeof n=="function"?n({present:r.isPresent}):p.Children.only(n),s=te(r.ref,vP(o));return typeof n=="function"||r.isPresent?p.cloneElement(o,{ref:s}):null};Me.displayName="Presence";function gP(e){const[t,n]=p.useState(),r=p.useRef(null),o=p.useRef(e),s=p.useRef("none"),i=e?"mounted":"unmounted",[a,c]=mP(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const u=Ir(r.current);s.current=a==="mounted"?u:"none"},[a]),Pe(()=>{const u=r.current,d=o.current;if(d!==e){const h=s.current,m=Ir(u);e?c("MOUNT"):m==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&h!==m?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),Pe(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,f=m=>{const g=Ir(r.current).includes(CSS.escape(m.animationName));if(m.target===t&&g&&(c("ANIMATION_END"),!o.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},h=m=>{m.target===t&&(s.current=Ir(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:p.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function Ir(e){return(e==null?void 0:e.animationName)||"none"}function vP(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Uo="Popover",[Fh]=Ce(Uo,[kt]),dr=kt(),[yP,Ot]=Fh(Uo),$h=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!1}=e,a=dr(t),c=p.useRef(null),[u,d]=p.useState(!1),[f,h]=be({prop:r,defaultProp:o??!1,onChange:s,caller:Uo});return l.jsx(ar,{...a,children:l.jsx(yP,{scope:t,contentId:he(),triggerRef:c,open:f,onOpenChange:h,onOpenToggle:p.useCallback(()=>h(m=>!m),[h]),hasCustomAnchor:u,onCustomAnchorAdd:p.useCallback(()=>d(!0),[]),onCustomAnchorRemove:p.useCallback(()=>d(!1),[]),modal:i,children:n})})};$h.displayName=Uo;var Bh="PopoverAnchor",Wh=p.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Ot(Bh,n),s=dr(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:a}=o;return p.useEffect(()=>(i(),()=>a()),[i,a]),l.jsx(cr,{...s,...r,ref:t})});Wh.displayName=Bh;var Gh="PopoverTrigger",Uh=p.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Ot(Gh,n),s=dr(n),i=te(t,o.triggerRef),a=l.jsx(K.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Zh(o.open),...r,ref:i,onClick:V(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?a:l.jsx(cr,{asChild:!0,...s,children:a})});Uh.displayName=Gh;var Pa="PopoverPortal",[xP,bP]=Fh(Pa,{forceMount:void 0}),Kh=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,s=Ot(Pa,t);return l.jsx(xP,{scope:t,forceMount:n,children:l.jsx(Me,{present:n||s.open,children:l.jsx(Nn,{asChild:!0,container:o,children:r})})})};Kh.displayName=Pa;var Cn="PopoverContent",Hh=p.forwardRef((e,t)=>{const n=bP(Cn,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,s=Ot(Cn,e.__scopePopover);return l.jsx(Me,{present:r||s.open,children:s.modal?l.jsx(CP,{...o,ref:t}):l.jsx(SP,{...o,ref:t})})});Hh.displayName=Cn;var wP=Yt("PopoverContent.RemoveScroll"),CP=p.forwardRef((e,t)=>{const n=Ot(Cn,e.__scopePopover),r=p.useRef(null),o=te(t,r),s=p.useRef(!1);return p.useEffect(()=>{const i=r.current;if(i)return Fo(i)},[]),l.jsx(ur,{as:wP,allowPinchZoom:!0,children:l.jsx(zh,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:V(e.onCloseAutoFocus,i=>{var a;i.preventDefault(),s.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:V(e.onPointerDownOutside,i=>{const a=i.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0,u=a.button===2||c;s.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:V(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),SP=p.forwardRef((e,t)=>{const n=Ot(Cn,e.__scopePopover),r=p.useRef(!1),o=p.useRef(!1);return l.jsx(zh,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var i,a;(i=e.onCloseAutoFocus)==null||i.call(e,s),s.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;((u=n.triggerRef.current)==null?void 0:u.contains(i))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),zh=p.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:i,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:d,...f}=e,h=Ot(Cn,n),m=dr(n);return jo(),l.jsx(or,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:l.jsx(Mn,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:d,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>h.onOpenChange(!1),children:l.jsx(Lo,{"data-state":Zh(h.open),role:"dialog",id:h.contentId,...m,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Yh="PopoverClose",Xh=p.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Ot(Yh,n);return l.jsx(K.button,{type:"button",...r,ref:t,onClick:V(e.onClick,()=>o.onOpenChange(!1))})});Xh.displayName=Yh;var RP="PopoverArrow",qh=p.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=dr(n);return l.jsx(Vo,{...o,...r,ref:t})});qh.displayName=RP;function Zh(e){return e?"open":"closed"}var Ea=$h,TP=Wh,Ma=Uh,Aa=Kh,Da=Hh,PP=Xh,EP=qh,lu=1,MP=.9,AP=.8,DP=.17,$s=.1,Bs=.999,NP=.9999,jP=.99,kP=/[\\\/_+.#"@\[\(\{&]/,IP=/[\\\/_+.#"@\[\(\{&]/g,_P=/[\s-]/,Qh=/[\s-]/g;function Mi(e,t,n,r,o,s,i){if(s===t.length)return o===e.length?lu:jP;var a=`${o},${s}`;if(i[a]!==void 0)return i[a];for(var c=r.charAt(s),u=n.indexOf(c,o),d=0,f,h,m,y;u>=0;)f=Mi(e,t,n,r,u+1,s+1,i),f>d&&(u===o?f*=lu:kP.test(e.charAt(u-1))?(f*=AP,m=e.slice(o,u-1).match(IP),m&&o>0&&(f*=Math.pow(Bs,m.length))):_P.test(e.charAt(u-1))?(f*=MP,y=e.slice(o,u-1).match(Qh),y&&o>0&&(f*=Math.pow(Bs,y.length))):(f*=DP,o>0&&(f*=Math.pow(Bs,u-o))),e.charAt(u)!==t.charAt(s)&&(f*=NP)),(f<$s&&n.charAt(u-1)===r.charAt(s+1)||r.charAt(s+1)===r.charAt(s)&&n.charAt(u-1)!==r.charAt(s))&&(h=Mi(e,t,n,r,u+1,s+2,i),h*$s>f&&(f=h*$s)),f>d&&(d=f),u=n.indexOf(c,u+1);return i[a]=d,d}function uu(e){return e.toLowerCase().replace(Qh," ")}function OP(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Mi(e,t,uu(e),uu(t),0,0,{})}var Ko="Dialog",[Jh]=Ce(Ko),[LP,Qe]=Jh(Ko),ep=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!0}=e,a=p.useRef(null),c=p.useRef(null),[u,d]=be({prop:r,defaultProp:o??!1,onChange:s,caller:Ko});return l.jsx(LP,{scope:t,triggerRef:a,contentRef:c,contentId:he(),titleId:he(),descriptionId:he(),open:u,onOpenChange:d,onOpenToggle:p.useCallback(()=>d(f=>!f),[d]),modal:i,children:n})};ep.displayName=Ko;var tp="DialogTrigger",np=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Qe(tp,n),s=te(t,o.triggerRef);return l.jsx(K.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":ka(o.open),...r,ref:s,onClick:V(e.onClick,o.onOpenToggle)})});np.displayName=tp;var Na="DialogPortal",[VP,rp]=Jh(Na,{forceMount:void 0}),op=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=Qe(Na,t);return l.jsx(VP,{scope:t,forceMount:n,children:p.Children.map(r,i=>l.jsx(Me,{present:n||s.open,children:l.jsx(Nn,{asChild:!0,container:o,children:i})}))})};op.displayName=Na;var vo="DialogOverlay",sp=p.forwardRef((e,t)=>{const n=rp(vo,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=Qe(vo,e.__scopeDialog);return s.modal?l.jsx(Me,{present:r||s.open,children:l.jsx($P,{...o,ref:t})}):null});sp.displayName=vo;var FP=Yt("DialogOverlay.RemoveScroll"),$P=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Qe(vo,n);return l.jsx(ur,{as:FP,allowPinchZoom:!0,shards:[o.contentRef],children:l.jsx(K.div,{"data-state":ka(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Qt="DialogContent",ip=p.forwardRef((e,t)=>{const n=rp(Qt,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=Qe(Qt,e.__scopeDialog);return l.jsx(Me,{present:r||s.open,children:s.modal?l.jsx(BP,{...o,ref:t}):l.jsx(WP,{...o,ref:t})})});ip.displayName=Qt;var BP=p.forwardRef((e,t)=>{const n=Qe(Qt,e.__scopeDialog),r=p.useRef(null),o=te(t,n.contentRef,r);return p.useEffect(()=>{const s=r.current;if(s)return Fo(s)},[]),l.jsx(ap,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:V(e.onCloseAutoFocus,s=>{var i;s.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:V(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&s.preventDefault()}),onFocusOutside:V(e.onFocusOutside,s=>s.preventDefault())})}),WP=p.forwardRef((e,t)=>{const n=Qe(Qt,e.__scopeDialog),r=p.useRef(!1),o=p.useRef(!1);return l.jsx(ap,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var i,a;(i=e.onCloseAutoFocus)==null||i.call(e,s),s.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;((u=n.triggerRef.current)==null?void 0:u.contains(i))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),ap=p.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,...i}=e,a=Qe(Qt,n),c=p.useRef(null),u=te(t,c);return jo(),l.jsxs(l.Fragment,{children:[l.jsx(or,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:l.jsx(Mn,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":ka(a.open),...i,ref:u,onDismiss:()=>a.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(GP,{titleId:a.titleId}),l.jsx(KP,{contentRef:c,descriptionId:a.descriptionId})]})]})}),ja="DialogTitle",cp=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Qe(ja,n);return l.jsx(K.h2,{id:o.titleId,...r,ref:t})});cp.displayName=ja;var lp="DialogDescription",up=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Qe(lp,n);return l.jsx(K.p,{id:o.descriptionId,...r,ref:t})});up.displayName=lp;var dp="DialogClose",fp=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Qe(dp,n);return l.jsx(K.button,{type:"button",...r,ref:t,onClick:V(e.onClick,()=>o.onOpenChange(!1))})});fp.displayName=dp;function ka(e){return e?"open":"closed"}var hp="DialogTitleWarning",[b1,pp]=PC(hp,{contentName:Qt,titleName:ja,docsSlug:"dialog"}),GP=({titleId:e})=>{const t=pp(hp),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
170
185
|
|
|
171
186
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
172
187
|
|
|
173
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return m.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},OC="DialogDescriptionWarning",LC=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${qf(OC).contentName}}.`;return m.useEffect(()=>{var s;const o=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},VC=Ff,FC=$f,_C=Wf,BC=Uf,$C=Gf,WC=zf,bn='[cmdk-group=""]',rs='[cmdk-group-items=""]',UC='[cmdk-group-heading=""]',Zf='[cmdk-item=""]',Xc=`${Zf}:not([aria-disabled="true"])`,Hs="cmdk-item-select",Zt="data-value",HC=(e,t,n)=>PC(e,t,n),Qf=m.createContext(void 0),Bn=()=>m.useContext(Qf),Jf=m.createContext(void 0),$i=()=>m.useContext(Jf),eh=m.createContext(void 0),th=m.forwardRef((e,t)=>{let n=Qt(()=>{var M,X;return{search:"",value:(X=(M=e.value)!=null?M:e.defaultValue)!=null?X:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Qt(()=>new Set),o=Qt(()=>new Map),s=Qt(()=>new Map),i=Qt(()=>new Set),a=nh(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:x,disablePointerSelection:g=!1,vimBindings:y=!0,...v}=e,w=Me(),S=Me(),C=Me(),T=m.useRef(null),E=tT();Ut(()=>{if(u!==void 0){let M=u.trim();n.current.value=M,P.emit()}},[u]),Ut(()=>{E(6,Y)},[]);let P=m.useMemo(()=>({subscribe:M=>(i.current.add(M),()=>i.current.delete(M)),snapshot:()=>n.current,setState:(M,X,Z)=>{var U,ee,N,L;if(!Object.is(n.current[M],X)){if(n.current[M]=X,M==="search")H(),k(),E(1,V);else if(M==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let te=document.getElementById(C);te?te.focus():(U=document.getElementById(w))==null||U.focus()}if(E(7,()=>{var te;n.current.selectedItemId=(te=G())==null?void 0:te.id,P.emit()}),Z||E(5,Y),((ee=a.current)==null?void 0:ee.value)!==void 0){let te=X??"";(L=(N=a.current).onValueChange)==null||L.call(N,te);return}}P.emit()}},emit:()=>{i.current.forEach(M=>M())}}),[]),A=m.useMemo(()=>({value:(M,X,Z)=>{var U;X!==((U=s.current.get(M))==null?void 0:U.value)&&(s.current.set(M,{value:X,keywords:Z}),n.current.filtered.items.set(M,j(X,Z)),E(2,()=>{k(),P.emit()}))},item:(M,X)=>(r.current.add(M),X&&(o.current.has(X)?o.current.get(X).add(M):o.current.set(X,new Set([M]))),E(3,()=>{H(),k(),n.current.value||V(),P.emit()}),()=>{s.current.delete(M),r.current.delete(M),n.current.filtered.items.delete(M);let Z=G();E(4,()=>{H(),(Z==null?void 0:Z.getAttribute("id"))===M&&V(),P.emit()})}),group:M=>(o.current.has(M)||o.current.set(M,new Set),()=>{s.current.delete(M),o.current.delete(M)}),filter:()=>a.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>a.current.disablePointerSelection,listId:w,inputId:C,labelId:S,listInnerRef:T}),[]);function j(M,X){var Z,U;let ee=(U=(Z=a.current)==null?void 0:Z.filter)!=null?U:HC;return M?ee(M,n.current.search,X):0}function k(){if(!n.current.search||a.current.shouldFilter===!1)return;let M=n.current.filtered.items,X=[];n.current.filtered.groups.forEach(U=>{let ee=o.current.get(U),N=0;ee.forEach(L=>{let te=M.get(L);N=Math.max(te,N)}),X.push([U,N])});let Z=T.current;K().sort((U,ee)=>{var N,L;let te=U.getAttribute("id"),ne=ee.getAttribute("id");return((N=M.get(ne))!=null?N:0)-((L=M.get(te))!=null?L:0)}).forEach(U=>{let ee=U.closest(rs);ee?ee.appendChild(U.parentElement===ee?U:U.closest(`${rs} > *`)):Z.appendChild(U.parentElement===Z?U:U.closest(`${rs} > *`))}),X.sort((U,ee)=>ee[1]-U[1]).forEach(U=>{var ee;let N=(ee=T.current)==null?void 0:ee.querySelector(`${bn}[${Zt}="${encodeURIComponent(U[0])}"]`);N==null||N.parentElement.appendChild(N)})}function V(){let M=K().find(Z=>Z.getAttribute("aria-disabled")!=="true"),X=M==null?void 0:M.getAttribute(Zt);P.setState("value",X||void 0)}function H(){var M,X,Z,U;if(!n.current.search||a.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let ee=0;for(let N of r.current){let L=(X=(M=s.current.get(N))==null?void 0:M.value)!=null?X:"",te=(U=(Z=s.current.get(N))==null?void 0:Z.keywords)!=null?U:[],ne=j(L,te);n.current.filtered.items.set(N,ne),ne>0&&ee++}for(let[N,L]of o.current)for(let te of L)if(n.current.filtered.items.get(te)>0){n.current.filtered.groups.add(N);break}n.current.filtered.count=ee}function Y(){var M,X,Z;let U=G();U&&(((M=U.parentElement)==null?void 0:M.firstChild)===U&&((Z=(X=U.closest(bn))==null?void 0:X.querySelector(UC))==null||Z.scrollIntoView({block:"nearest"})),U.scrollIntoView({block:"nearest"}))}function G(){var M;return(M=T.current)==null?void 0:M.querySelector(`${Zf}[aria-selected="true"]`)}function K(){var M;return Array.from(((M=T.current)==null?void 0:M.querySelectorAll(Xc))||[])}function D(M){let X=K()[M];X&&P.setState("value",X.getAttribute(Zt))}function W(M){var X;let Z=G(),U=K(),ee=U.findIndex(L=>L===Z),N=U[ee+M];(X=a.current)!=null&&X.loop&&(N=ee+M<0?U[U.length-1]:ee+M===U.length?U[0]:U[ee+M]),N&&P.setState("value",N.getAttribute(Zt))}function I(M){let X=G(),Z=X==null?void 0:X.closest(bn),U;for(;Z&&!U;)Z=M>0?JC(Z,bn):eT(Z,bn),U=Z==null?void 0:Z.querySelector(Xc);U?P.setState("value",U.getAttribute(Zt)):W(M)}let q=()=>D(K().length-1),se=M=>{M.preventDefault(),M.metaKey?q():M.altKey?I(1):W(1)},ae=M=>{M.preventDefault(),M.metaKey?D(0):M.altKey?I(-1):W(-1)};return m.createElement(z.div,{ref:t,tabIndex:-1,...v,"cmdk-root":"",onKeyDown:M=>{var X;(X=v.onKeyDown)==null||X.call(v,M);let Z=M.nativeEvent.isComposing||M.keyCode===229;if(!(M.defaultPrevented||Z))switch(M.key){case"n":case"j":{y&&M.ctrlKey&&se(M);break}case"ArrowDown":{se(M);break}case"p":case"k":{y&&M.ctrlKey&&ae(M);break}case"ArrowUp":{ae(M);break}case"Home":{M.preventDefault(),D(0);break}case"End":{M.preventDefault(),q();break}case"Enter":{M.preventDefault();let U=G();if(U){let ee=new Event(Hs);U.dispatchEvent(ee)}}}}},m.createElement("label",{"cmdk-label":"",htmlFor:A.inputId,id:A.labelId,style:rT},c),mo(e,M=>m.createElement(Jf.Provider,{value:P},m.createElement(Qf.Provider,{value:A},M))))}),GC=m.forwardRef((e,t)=>{var n,r;let o=Me(),s=m.useRef(null),i=m.useContext(eh),a=Bn(),c=nh(e),l=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:i==null?void 0:i.forceMount;Ut(()=>{if(!l)return a.item(o,i==null?void 0:i.id)},[l]);let u=rh(o,s,[e.value,e.children,s],e.keywords),d=$i(),f=bt(E=>E.value&&E.value===u.current),p=bt(E=>l||a.filter()===!1?!0:E.search?E.filtered.items.get(o)>0:!0);m.useEffect(()=>{let E=s.current;if(!(!E||e.disabled))return E.addEventListener(Hs,x),()=>E.removeEventListener(Hs,x)},[p,e.onSelect,e.disabled]);function x(){var E,P;g(),(P=(E=c.current).onSelect)==null||P.call(E,u.current)}function g(){d.setState("value",u.current,!0)}if(!p)return null;let{disabled:y,value:v,onSelect:w,forceMount:S,keywords:C,...T}=e;return m.createElement(z.div,{ref:Ft(s,t),...T,id:o,"cmdk-item":"",role:"option","aria-disabled":!!y,"aria-selected":!!f,"data-disabled":!!y,"data-selected":!!f,onPointerMove:y||a.getDisablePointerSelection()?void 0:g,onClick:y?void 0:x},e.children)}),KC=m.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:o,...s}=e,i=Me(),a=m.useRef(null),c=m.useRef(null),l=Me(),u=Bn(),d=bt(p=>o||u.filter()===!1?!0:p.search?p.filtered.groups.has(i):!0);Ut(()=>u.group(i),[]),rh(i,a,[e.value,e.heading,c]);let f=m.useMemo(()=>({id:i,forceMount:o}),[o]);return m.createElement(z.div,{ref:Ft(a,t),...s,"cmdk-group":"",role:"presentation",hidden:d?void 0:!0},n&&m.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:l},n),mo(e,p=>m.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?l:void 0},m.createElement(eh.Provider,{value:f},p))))}),zC=m.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,o=m.useRef(null),s=bt(i=>!i.search);return!n&&!s?null:m.createElement(z.div,{ref:Ft(o,t),...r,"cmdk-separator":"",role:"separator"})}),YC=m.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,o=e.value!=null,s=$i(),i=bt(l=>l.search),a=bt(l=>l.selectedItemId),c=Bn();return m.useEffect(()=>{e.value!=null&&s.setState("search",e.value)},[e.value]),m.createElement(z.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":a,id:c.inputId,type:"text",value:o?e.value:i,onChange:l=>{o||s.setState("search",l.target.value),n==null||n(l.target.value)}})}),XC=m.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...o}=e,s=m.useRef(null),i=m.useRef(null),a=bt(l=>l.selectedItemId),c=Bn();return m.useEffect(()=>{if(i.current&&s.current){let l=i.current,u=s.current,d,f=new ResizeObserver(()=>{d=requestAnimationFrame(()=>{let p=l.offsetHeight;u.style.setProperty("--cmdk-list-height",p.toFixed(1)+"px")})});return f.observe(l),()=>{cancelAnimationFrame(d),f.unobserve(l)}}},[]),m.createElement(z.div,{ref:Ft(s,t),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":a,"aria-label":r,id:c.listId},mo(e,l=>m.createElement("div",{ref:Ft(i,c.listInnerRef),"cmdk-list-sizer":""},l)))}),qC=m.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:s,container:i,...a}=e;return m.createElement(VC,{open:n,onOpenChange:r},m.createElement(FC,{container:i},m.createElement(_C,{"cmdk-overlay":"",className:o}),m.createElement(BC,{"aria-label":e.label,"cmdk-dialog":"",className:s},m.createElement(th,{ref:t,...a}))))}),ZC=m.forwardRef((e,t)=>bt(n=>n.filtered.count===0)?m.createElement(z.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),QC=m.forwardRef((e,t)=>{let{progress:n,children:r,label:o="Loading...",...s}=e;return m.createElement(z.div,{ref:t,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},mo(e,i=>m.createElement("div",{"aria-hidden":!0},i)))}),Ve=Object.assign(th,{List:XC,Item:GC,Input:YC,Group:KC,Separator:zC,Dialog:qC,Empty:ZC,Loading:QC});function JC(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function eT(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function nh(e){let t=m.useRef(e);return Ut(()=>{t.current=e}),t}var Ut=typeof window>"u"?m.useEffect:m.useLayoutEffect;function Qt(e){let t=m.useRef();return t.current===void 0&&(t.current=e()),t}function bt(e){let t=$i(),n=()=>e(t.snapshot());return m.useSyncExternalStore(t.subscribe,n,n)}function rh(e,t,n,r=[]){let o=m.useRef(),s=Bn();return Ut(()=>{var i;let a=(()=>{var l;for(let u of n){if(typeof u=="string")return u.trim();if(typeof u=="object"&&"current"in u)return u.current?(l=u.current.textContent)==null?void 0:l.trim():o.current}})(),c=r.map(l=>l.trim());s.value(e,a,c),(i=t.current)==null||i.setAttribute(Zt,a),o.current=a}),o}var tT=()=>{let[e,t]=m.useState(),n=Qt(()=>new Map);return Ut(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,o)=>{n.current.set(r,o),t({})}};function nT(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function mo({asChild:e,children:t},n){return e&&m.isValidElement(t)?m.cloneElement(nT(t),{ref:t.ref},n(t.props.children)):n(t)}var rT={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function oT({options:e,value:t,defaultValue:n,onValueChange:r,placeholder:o="Select…",searchPlaceholder:s="Search…",emptyText:i="No matches.",maxItems:a,size:c,color:l="primary",disabled:u=!1,id:d,className:f,"aria-invalid":p,"aria-describedby":x,"aria-label":g}){const[y,v]=b.useState(!1),[w,S]=b.useState(n??[]),[C,T]=b.useState(""),E=b.useRef(null),P=t??w,A=b.useCallback(D=>{t===void 0&&S(D),r==null||r(D)},[t,r]),j=b.useCallback(D=>{P.includes(D)?A(P.filter(W=>W!==D)):(a==null||P.length<a)&&A([...P,D])},[P,A,a]),k=b.useCallback(D=>A(P.filter(W=>W!==D)),[P,A]),V=b.useMemo(()=>{const D=new Map;for(const W of e)D.set(W.value,W);return D},[e]),H=b.useMemo(()=>{const D=new Map;for(const W of e){const I=W.group??"";D.has(I)||D.set(I,[]),D.get(I).push(W)}return D},[e]),Y=D=>{D.key==="Backspace"&&C===""&&P.length>0&&(D.preventDefault(),k(P[P.length-1]))};b.useEffect(()=>{y&&queueMicrotask(()=>{var D;return(D=E.current)==null?void 0:D.focus()})},[y]);const G=$("cny-multiselect-trigger",c==="sm"||c==="lg"?c:null,l!=="primary"&&l,f),K=a!=null&&P.length>=a;return h.jsxs(hC,{open:y,onOpenChange:D=>!u&&v(D),children:[h.jsx(pC,{asChild:!0,children:h.jsxs("div",{role:"combobox","aria-expanded":y,"aria-haspopup":"listbox","aria-invalid":p,"aria-describedby":x,"aria-label":g,"data-state":y?"open":"closed","data-disabled":u||void 0,id:d,className:G,onClick:()=>!u&&v(D=>!D),tabIndex:u?-1:0,onKeyDown:D=>{(D.key==="Enter"||D.key===" "||D.key==="ArrowDown")&&!y&&(D.preventDefault(),v(!0))},children:[P.length===0&&h.jsx("span",{className:"cny-multiselect-placeholder",children:o}),P.map(D=>{const W=V.get(D);return h.jsxs("span",{className:"cny-chip",children:[h.jsx("span",{className:"cny-chip-label",children:(W==null?void 0:W.label)??D}),!u&&h.jsx("button",{type:"button",className:"cny-chip-remove","aria-label":`Remove ${(W==null?void 0:W.label)??D}`,onClick:I=>{I.stopPropagation(),k(D)},children:h.jsx(qr,{size:12,"aria-hidden":"true"})})]},D)}),h.jsx(Ti,{size:14,"aria-hidden":"true",className:"cny-multiselect-chevron"})]})}),h.jsx(mC,{children:h.jsx(gC,{className:"cny-popover",align:"start",sideOffset:4,onOpenAutoFocus:D=>D.preventDefault(),children:h.jsxs(Ve,{shouldFilter:!0,label:"Options",children:[h.jsx(Ve.Input,{ref:E,placeholder:s,value:C,onValueChange:T,onKeyDown:Y}),h.jsxs(Ve.List,{children:[h.jsx(Ve.Empty,{children:i}),Array.from(H.entries()).map(([D,W])=>h.jsx(Ve.Group,{heading:D||void 0,children:W.map(I=>{const q=P.includes(I.value),se=I.disabled||!q&&K;return h.jsxs(Ve.Item,{value:`${I.label} ${I.description??""} ${I.value}`,disabled:se,onSelect:()=>j(I.value),children:[I.icon&&h.jsx("span",{style:{display:"inline-flex"},children:I.icon}),h.jsx("span",{children:I.label}),I.description&&h.jsx("span",{style:{color:"var(--text-muted)",fontSize:"0.75rem"},children:I.description}),q&&h.jsx("span",{className:"cny-check",children:h.jsx(Ir,{size:14,"aria-hidden":"true"})})]},I.value)})},D||"default"))]})]})})})]})}var go="Checkbox",[sT]=ze(go),[iT,Wi]=sT(go);function aT(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:o,disabled:s,form:i,name:a,onCheckedChange:c,required:l,value:u="on",internal_do_not_use_render:d}=e,[f,p]=He({prop:n,defaultProp:o??!1,onChange:c,caller:go}),[x,g]=m.useState(null),[y,v]=m.useState(null),w=m.useRef(!1),S=x?!!i||!!x.closest("form"):!0,C={checked:f,disabled:s,setChecked:p,control:x,setControl:g,name:a,form:i,value:u,hasConsumerStoppedPropagationRef:w,required:l,defaultChecked:mt(o)?!1:o,isFormControl:S,bubbleInput:y,setBubbleInput:v};return h.jsx(iT,{scope:t,...C,children:cT(d)?d(C):r})}var oh="CheckboxTrigger",sh=m.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},o)=>{const{control:s,value:i,disabled:a,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,isFormControl:p,bubbleInput:x}=Wi(oh,e),g=re(o,u),y=m.useRef(c);return m.useEffect(()=>{const v=s==null?void 0:s.form;if(v){const w=()=>d(y.current);return v.addEventListener("reset",w),()=>v.removeEventListener("reset",w)}},[s,d]),h.jsx(z.button,{type:"button",role:"checkbox","aria-checked":mt(c)?"mixed":c,"aria-required":l,"data-state":lh(c),"data-disabled":a?"":void 0,disabled:a,value:i,...r,ref:g,onKeyDown:J(t,v=>{v.key==="Enter"&&v.preventDefault()}),onClick:J(n,v=>{d(w=>mt(w)?!0:!w),x&&p&&(f.current=v.isPropagationStopped(),f.current||v.stopPropagation())})})});sh.displayName=oh;var Gs=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:s,required:i,disabled:a,value:c,onCheckedChange:l,form:u,...d}=e;return h.jsx(aT,{__scopeCheckbox:n,checked:o,defaultChecked:s,disabled:a,required:i,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:f})=>h.jsxs(h.Fragment,{children:[h.jsx(sh,{...d,ref:t,__scopeCheckbox:n}),f&&h.jsx(ch,{__scopeCheckbox:n})]})})});Gs.displayName=go;var ih="CheckboxIndicator",Ks=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,s=Wi(ih,n);return h.jsx(Rt,{present:r||mt(s.checked)||s.checked===!0,children:h.jsx(z.span,{"data-state":lh(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});Ks.displayName=ih;var ah="CheckboxBubbleInput",ch=m.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:o,checked:s,defaultChecked:i,required:a,disabled:c,name:l,value:u,form:d,bubbleInput:f,setBubbleInput:p}=Wi(ah,e),x=re(n,p),g=io(s),y=ro(r);m.useEffect(()=>{const w=f;if(!w)return;const S=window.HTMLInputElement.prototype,T=Object.getOwnPropertyDescriptor(S,"checked").set,E=!o.current;if(g!==s&&T){const P=new Event("click",{bubbles:E});w.indeterminate=mt(s),T.call(w,mt(s)?!1:s),w.dispatchEvent(P)}},[f,g,s,o]);const v=m.useRef(mt(s)?!1:s);return h.jsx(z.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??v.current,required:a,disabled:c,name:l,value:u,form:d,...t,tabIndex:-1,ref:x,style:{...t.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});ch.displayName=ah;function cT(e){return typeof e=="function"}function mt(e){return e==="indeterminate"}function lh(e){return mt(e)?"indeterminate":e?"checked":"unchecked"}const lT=b.forwardRef(function({className:t,children:n,...r},o){return n?h.jsxs("label",{className:"control",children:[h.jsx(Gs,{ref:o,className:$("checkbox",t),...r,children:h.jsx(Ks,{children:r.checked==="indeterminate"?h.jsx(Sc,{size:12,"aria-hidden":"true"}):h.jsx(Ir,{size:12,"aria-hidden":"true"})})}),h.jsx("span",{children:n})]}):h.jsx(Gs,{ref:o,className:$("checkbox",t),...r,children:h.jsx(Ks,{children:r.checked==="indeterminate"?h.jsx(Sc,{size:12,"aria-hidden":"true"}):h.jsx(Ir,{size:12,"aria-hidden":"true"})})})});var Ui="Radio",[uT,uh]=ze(Ui),[dT,fT]=uT(Ui),dh=m.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:o=!1,required:s,disabled:i,value:a="on",onCheck:c,form:l,...u}=e,[d,f]=m.useState(null),p=re(t,y=>f(y)),x=m.useRef(!1),g=d?l||!!d.closest("form"):!0;return h.jsxs(dT,{scope:n,checked:o,disabled:i,children:[h.jsx(z.button,{type:"button",role:"radio","aria-checked":o,"data-state":mh(o),"data-disabled":i?"":void 0,disabled:i,value:a,...u,ref:p,onClick:J(e.onClick,y=>{o||c==null||c(),g&&(x.current=y.isPropagationStopped(),x.current||y.stopPropagation())})}),g&&h.jsx(ph,{control:d,bubbles:!x.current,name:r,value:a,checked:o,required:s,disabled:i,form:l,style:{transform:"translateX(-100%)"}})]})});dh.displayName=Ui;var fh="RadioIndicator",hh=m.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,s=fT(fh,n);return h.jsx(Rt,{present:r||s.checked,children:h.jsx(z.span,{"data-state":mh(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:t})})});hh.displayName=fh;var hT="RadioBubbleInput",ph=m.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:r=!0,...o},s)=>{const i=m.useRef(null),a=re(i,s),c=io(n),l=ro(t);return m.useEffect(()=>{const u=i.current;if(!u)return;const d=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(d,"checked").set;if(c!==n&&p){const x=new Event("click",{bubbles:r});p.call(u,n),u.dispatchEvent(x)}},[c,n,r]),h.jsx(z.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:a,style:{...o.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});ph.displayName=hT;function mh(e){return e?"checked":"unchecked"}var pT=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],yo="RadioGroup",[mT]=ze(yo,[Xr,uh]),gh=Xr(),yh=uh(),[gT,yT]=mT(yo),vh=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:o,value:s,required:i=!1,disabled:a=!1,orientation:c,dir:l,loop:u=!0,onValueChange:d,...f}=e,p=gh(n),x=Yr(l),[g,y]=He({prop:s,defaultProp:o??null,onChange:d,caller:yo});return h.jsx(gT,{scope:n,name:r,required:i,disabled:a,value:g,onValueChange:y,children:h.jsx(rd,{asChild:!0,...p,orientation:c,dir:x,loop:u,children:h.jsx(z.div,{role:"radiogroup","aria-required":i,"aria-orientation":c,"data-disabled":a?"":void 0,dir:x,...f,ref:t})})})});vh.displayName=yo;var xh="RadioGroupItem",wh=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...o}=e,s=yT(xh,n),i=s.disabled||r,a=gh(n),c=yh(n),l=m.useRef(null),u=re(t,l),d=s.value===o.value,f=m.useRef(!1);return m.useEffect(()=>{const p=g=>{pT.includes(g.key)&&(f.current=!0)},x=()=>f.current=!1;return document.addEventListener("keydown",p),document.addEventListener("keyup",x),()=>{document.removeEventListener("keydown",p),document.removeEventListener("keyup",x)}},[]),h.jsx(od,{asChild:!0,...a,focusable:!i,active:d,children:h.jsx(dh,{disabled:i,required:s.required,checked:d,...c,...o,name:s.name,ref:u,onCheck:()=>s.onValueChange(o.value),onKeyDown:J(p=>{p.key==="Enter"&&p.preventDefault()}),onFocus:J(o.onFocus,()=>{var p;f.current&&((p=l.current)==null||p.click())})})})});wh.displayName=xh;var vT="RadioGroupIndicator",bh=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=yh(n);return h.jsx(hh,{...o,...r,ref:t})});bh.displayName=vT;var xT=vh,qc=wh,Zc=bh;const wT=b.forwardRef(function({orientation:t="vertical",className:n,style:r,...o},s){return h.jsx(xT,{ref:s,className:n,style:{display:"flex",flexDirection:t==="horizontal"?"row":"column",gap:t==="horizontal"?16:8,...r},...o})}),bT=b.forwardRef(function({className:t,children:n,...r},o){return n?h.jsxs("label",{className:"control",children:[h.jsx(qc,{ref:o,className:$("radio",t),...r,children:h.jsx(Zc,{})}),h.jsx("span",{children:n})]}):h.jsx(qc,{ref:o,className:$("radio",t),...r,children:h.jsx(Zc,{})})});var vo="Switch",[ST]=ze(vo),[CT,TT]=ST(vo),Sh=m.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:s,required:i,disabled:a,value:c="on",onCheckedChange:l,form:u,...d}=e,[f,p]=m.useState(null),x=re(t,S=>p(S)),g=m.useRef(!1),y=f?u||!!f.closest("form"):!0,[v,w]=He({prop:o,defaultProp:s??!1,onChange:l,caller:vo});return h.jsxs(CT,{scope:n,checked:v,disabled:a,children:[h.jsx(z.button,{type:"button",role:"switch","aria-checked":v,"aria-required":i,"data-state":Rh(v),"data-disabled":a?"":void 0,disabled:a,value:c,...d,ref:x,onClick:J(e.onClick,S=>{w(C=>!C),y&&(g.current=S.isPropagationStopped(),g.current||S.stopPropagation())})}),y&&h.jsx(Ph,{control:f,bubbles:!g.current,name:r,value:c,checked:v,required:i,disabled:a,form:u,style:{transform:"translateX(-100%)"}})]})});Sh.displayName=vo;var Ch="SwitchThumb",Th=m.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=TT(Ch,n);return h.jsx(z.span,{"data-state":Rh(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})});Th.displayName=Ch;var PT="SwitchBubbleInput",Ph=m.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...o},s)=>{const i=m.useRef(null),a=re(i,s),c=io(n),l=ro(t);return m.useEffect(()=>{const u=i.current;if(!u)return;const d=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(d,"checked").set;if(c!==n&&p){const x=new Event("click",{bubbles:r});p.call(u,n),u.dispatchEvent(x)}},[c,n,r]),h.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:a,style:{...o.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Ph.displayName=PT;function Rh(e){return e?"checked":"unchecked"}var Qc=Sh,Jc=Th;const RT=b.forwardRef(function({className:t,children:n,...r},o){return n?h.jsxs("label",{className:"control",children:[h.jsx(Qc,{ref:o,className:$("switch",t),...r,children:h.jsx(Jc,{className:"switch-thumb"})}),h.jsx("span",{children:n})]}):h.jsx(Qc,{ref:o,className:$("switch",t),...r,children:h.jsx(Jc,{className:"switch-thumb"})})});function Sr(e){const t=new Date(e);return t.setHours(0,0,0,0),t}function el(e){const t=new Date(e);return t.setHours(23,59,59,999),t}function sr(e,t){return!e||!t?!1:e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function os(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()}function ET(e,t){return e.getFullYear()===t.getFullYear()}function Ze(e){return new Date(e.getFullYear(),e.getMonth(),1)}function AT(e){return new Date(e.getFullYear(),0,1)}function tl(e){return new Date(Math.floor(e.getFullYear()/10)*10,0,1)}function ir(e,t){const n=new Date(e);return n.setDate(1),n.setMonth(n.getMonth()+t),n}function Br(e,t){const n=new Date(e);return n.setDate(n.getDate()+t),n}function Xe(e,t){const n=new Date(e);return n.setFullYear(n.getFullYear()+t),n}function ss(e,t,n,r=0){const o=new Date(e);return o.setHours(t,n,r,0),o}function Re(e,t,n){return t&&e.getTime()<t.getTime()?new Date(t):n&&e.getTime()>n.getTime()?new Date(n):e}function DT(e,t){const n=Ze(e),r=(n.getDay()-t+7)%7,o=Br(n,-r);return Array.from({length:42},(s,i)=>Br(o,i))}function MT(e,t){const n=new Intl.DateTimeFormat(e,{weekday:"short"}),r=new Date(2024,0,7);return Array.from({length:7},(o,s)=>{const i=Br(r,(s+t)%7);return n.format(i)})}function kT(e,t="short"){const n=new Intl.DateTimeFormat(e,{month:t});return Array.from({length:12},(r,o)=>n.format(new Date(2024,o,1)))}function nl(e,t){return new Intl.DateTimeFormat(t,{month:"long",year:"numeric"}).format(e)}function NT(e,t){return new Intl.DateTimeFormat(t,{year:"numeric"}).format(e)}function IT(e,t){return new Intl.DateTimeFormat(t,{month:"long",year:"numeric"}).format(e)}function Eh(e,t){return new Intl.DateTimeFormat(t,{year:"numeric",month:"short",day:"numeric"}).format(e)}function Ah(e,t,n,r){return new Intl.DateTimeFormat(t,{hour:"2-digit",minute:"2-digit",second:r?"2-digit":void 0,hour12:n}).format(e)}function jT(e,t,n,r){return`${Eh(e,t)} · ${Ah(e,t,n,r)}`}function ar(e){if(e==null||e==="")return null;if(e instanceof Date)return Number.isNaN(e.getTime())?null:new Date(e);const t=new Date(e);return Number.isNaN(t.getTime())?null:t}function cr(e,t){return e.getTime()<t.getTime()}function lr(e,t){return e.getTime()>t.getTime()}function ur(e){return e<10?`0${e}`:String(e)}function OT(e){return e||(typeof navigator<"u"&&navigator.language?navigator.language:"en-US")}function LT(e){try{return new Intl.DateTimeFormat(e,{hour:"numeric"}).resolvedOptions().hour12??!1}catch{return!1}}function VT(e,t,n,r,o){switch(t){case"year":return NT(e,n);case"month":return IT(e,n);case"time":return Ah(e,n,r,o);case"datetime":return jT(e,n,r,o);case"date":default:return Eh(e,n)}}function FT(e,t){switch(t){case"year":return AT(e);case"month":return Ze(e);case"date":return Sr(e);default:return new Date(e)}}const _T=b.forwardRef(function({mode:t="date",value:n,defaultValue:r,onChange:o,min:s,max:i,allow:a="any",disabledDate:c,disabledTime:l,placeholder:u,size:d,color:f="primary",disabled:p=!1,clearable:x=!0,locale:g,weekStartsOn:y=0,hour12:v,showSeconds:w=!1,minuteStep:S=1,secondStep:C=1,format:T,icon:E,required:P=!1,validate:A,error:j,onValidate:k,id:V,className:H,"aria-invalid":Y,"aria-describedby":G,dialogLabel:K,name:D,open:W,onOpenChange:I,...q},se){const ae=OT(g),M=v??LT(ae),X=b.useId(),Z=V??`cny-dp-${X}`,U=`${Z}-dialog`,ee=`${Z}-hint`,N=b.useMemo(()=>{const R=ar(s),O=a==="future"||a==="current"?Sr(new Date):null;return R&&O?R.getTime()>O.getTime()?R:O:R??O},[s,a]),L=b.useMemo(()=>{const R=ar(i),O=a==="past"||a==="current"?el(new Date):null;return R&&O?R.getTime()<O.getTime()?R:O:R??O},[i,a]),te=n!==void 0,[ne,oe]=b.useState(()=>ar(r)),F=te?ar(n):ne,ve=W!==void 0,[Le,At]=b.useState(!1),he=ve?W:Le,Te=b.useCallback(R=>{ve||At(R),I==null||I(R)},[ve,I]),$n=b.useMemo(()=>F??Re(new Date,N,L),[F,N,L]),[ie,Pe]=b.useState(()=>Ze($n)),[fe,ye]=b.useState(()=>$n),xo=t==="month"?"month":t==="year"?"year":"date",[ke,Dt]=b.useState(xo),wo=b.useRef(null);b.useImperativeHandle(se,()=>wo.current,[]);const vn=b.useRef(null),bo=b.useRef(null),Hi=b.useRef(null),So=b.useRef(null),[Mh,kh]=b.useState({}),[Nh,Ih]=b.useState(!1);b.useEffect(()=>Ih(!0),[]);const Ht=b.useCallback(R=>N&&cr(R,N)||L&&lr(R,L)?!0:c?c(R):!1,[N,L,c]),Wn=b.useCallback(R=>l?l(R):!1,[l]),Gt=b.useMemo(()=>{if(j)return typeof j=="string"?j:"Invalid";if(P&&!F)return"Required";if(F){const O=Sr(new Date);if(a==="future"&&cr(F,O))return"Must be today or later";if(a==="past"&&lr(F,el(new Date)))return"Must be today or earlier";if(a==="current"&&!sr(F,O))return"Must be today";if(N&&cr(F,N))return"Too early";if(L&&lr(F,L))return"Too late";if(c&&c(F))return"Unavailable date";if(l&&l(F))return"Unavailable time"}const R=A==null?void 0:A(F);return R||null},[j,P,F,a,N,L,c,l,A]),Gi=b.useRef(null);b.useEffect(()=>{Gi.current!==Gt&&(Gi.current=Gt,k==null||k(Gt))},[Gt,k]);const Un=Gt!==null,Ki=Un?"danger":f,jh=F?T?T(F,t):VT(F,t,ae,M,w):"",Oh=u??{date:"Select date",month:"Select month",year:"Select year",time:"Select time",datetime:"Select date & time"}[t],Lh=K??{date:"Choose date",month:"Choose month",year:"Choose year",time:"Choose time",datetime:"Choose date and time"}[t],lt=b.useCallback(R=>{te||oe(R),o==null||o(R)},[te,o]),Hn=b.useCallback(()=>{var R;Te(!1),(R=vn.current)==null||R.focus()},[Te]),Vh=b.useCallback(R=>{var O;R.stopPropagation(),lt(null),(O=vn.current)==null||O.focus()},[lt]),zi=b.useCallback(()=>{if(p)return;const R=F??Re(new Date,N,L);Pe(Ze(R)),ye(R),Dt(xo),Te(!0)},[p,F,N,L,Te,xo]);b.useEffect(()=>{if(!he)return;const R=O=>{var ce,_;const Q=O.target;(ce=wo.current)!=null&&ce.contains(Q)||(_=bo.current)!=null&&_.contains(Q)||Te(!1)};return document.addEventListener("pointerdown",R,!0),()=>document.removeEventListener("pointerdown",R,!0)},[he,Te]);const Gn=b.useCallback(()=>{const R=vn.current,O=bo.current;if(!R||!O)return;const Q=R.getBoundingClientRect(),ce=O.offsetHeight||340,_=O.offsetWidth||264,Ne=window.innerHeight,Se=window.innerWidth,Ie=4,me=8,ut=Ne-Q.bottom,To=Q.top,op=ut<ce+Ie&&To>ut?Math.max(me,Q.top-Ie-ce):Math.min(Ne-ce-me,Q.bottom+Ie),sp=Math.max(me,Math.min(Q.left,Se-_-me));kh({position:"fixed",top:op,left:sp,width:_})},[]);b.useLayoutEffect(()=>{he&&Gn()},[he,t,Gn]),b.useEffect(()=>{if(!he)return;const R=()=>Gn();return window.addEventListener("scroll",R,!0),window.addEventListener("resize",R),()=>{window.removeEventListener("scroll",R,!0),window.removeEventListener("resize",R)}},[he,Gn]),b.useEffect(()=>{var R,O;he&&(ke==="date"&&(t==="date"||t==="datetime")?(R=Hi.current)==null||R.focus():(ke==="month"||ke==="year")&&((O=So.current)==null||O.focus()))},[he,fe,t,ke]);const Yi=b.useCallback(()=>{var R;ke==="year"&&t!=="year"?Dt("month"):ke==="month"&&t!=="month"?Dt("date"):(Te(!1),(R=vn.current)==null||R.focus())},[ke,t,Te]),Kn=b.useCallback(R=>{const O=Re(R,N,L);ye(O),Pe(Q=>os(Q,O)?Q:Ze(O))},[N,L]),xn=b.useCallback((R,O)=>{const Q=FT(R,t);if(t!=="time"&&Ht(Q))return;const ce=t==="time"||t==="datetime"?ss(Q,(F??R).getHours(),(F??R).getMinutes(),w?(F??R).getSeconds():0):Q;lt(ce),ye(ce),((O==null?void 0:O.close)??(t!=="datetime"&&t!=="time"))&&Hn()},[t,Ht,lt,F,w,Hn]),zn=b.useCallback((R,O)=>{const Q=F??Re(new Date,N,L),ce=R==="hour"?O:Q.getHours(),_=R==="minute"?O:Q.getMinutes(),Ne=R==="second"?O:w?Q.getSeconds():0,Se=ss(Q,ce,_,Ne);Wn(Se)||(lt(Se),ye(Se))},[F,N,L,w,Wn,lt]),Kt=b.useCallback(R=>Kn(Br(fe,R)),[Kn,fe]),Fh=R=>{switch(R.key){case"ArrowLeft":R.preventDefault(),Kt(-1);break;case"ArrowRight":R.preventDefault(),Kt(1);break;case"ArrowUp":R.preventDefault(),Kt(-7);break;case"ArrowDown":R.preventDefault(),Kt(7);break;case"Home":{R.preventDefault();const O=(fe.getDay()-y+7)%7;Kt(-O);break}case"End":{R.preventDefault();const O=(fe.getDay()-y+7)%7;Kt(6-O);break}case"PageUp":R.preventDefault(),Kn(R.shiftKey?Xe(fe,-1):ir(fe,-1));break;case"PageDown":R.preventDefault(),Kn(R.shiftKey?Xe(fe,1):ir(fe,1));break;case"Enter":case" ":R.preventDefault(),xn(fe);break;case"Escape":R.preventDefault(),Yi();break}},_h=b.useMemo(()=>DT(ie,y),[ie,y]),Bh=b.useMemo(()=>MT(ae,y),[ae,y]),$h=b.useMemo(()=>kT(ae,"short"),[ae]),Co=b.useMemo(()=>Sr(new Date),[]),Wh=!N||!cr(Ze(ie),Ze(N)),Uh=!L||!lr(Ze(ie),Ze(L)),Hh=!N||ie.getFullYear()-1>=N.getFullYear(),Gh=!L||ie.getFullYear()+1<=L.getFullYear(),Mt=tl(ie).getFullYear(),Kh=!N||Mt-10+9>=N.getFullYear(),zh=!L||Mt+10<=L.getFullYear(),Yh=t==="time"?!Wn(new Date):!Ht(Co),Xh=()=>{if(t==="time"){const R=new Date;if(Wn(R))return;const Q=ss(F??R,R.getHours(),R.getMinutes(),w?R.getSeconds():0);lt(Q),ye(Q);return}xn(Co,{close:t!=="datetime"})},qh=$("cny-datepicker-trigger","input",Ki!=="primary"&&Ki,d==="sm"||d==="lg"?d:null,F&&"has-value",he&&"is-open"),Zh=E??(t==="time"?h.jsx(cw,{size:15}):h.jsx(qx,{size:15})),Xi=(R,O)=>{let ce=!0;switch(R.key){case"ArrowLeft":ye(O==="month"?_=>Re(new Date(ie.getFullYear(),(_.getMonth()+11)%12,Math.min(_.getDate(),28)),N,L):_=>Re(new Date(_.getFullYear()-1,_.getMonth(),Math.min(_.getDate(),28)),N,L));break;case"ArrowRight":ye(O==="month"?_=>Re(new Date(ie.getFullYear(),(_.getMonth()+1)%12,Math.min(_.getDate(),28)),N,L):_=>Re(new Date(_.getFullYear()+1,_.getMonth(),Math.min(_.getDate(),28)),N,L));break;case"ArrowUp":ye(O==="month"?_=>Re(new Date(ie.getFullYear(),(_.getMonth()-3+12)%12,Math.min(_.getDate(),28)),N,L):_=>Re(new Date(_.getFullYear()-3,_.getMonth(),Math.min(_.getDate(),28)),N,L));break;case"ArrowDown":ye(O==="month"?_=>Re(new Date(ie.getFullYear(),(_.getMonth()+3)%12,Math.min(_.getDate(),28)),N,L):_=>Re(new Date(_.getFullYear()+3,_.getMonth(),Math.min(_.getDate(),28)),N,L));break;case"PageUp":Pe(O==="month"?_=>Xe(_,R.shiftKey?-10:-1):_=>Xe(_,R.shiftKey?-100:-10));break;case"PageDown":Pe(O==="month"?_=>Xe(_,R.shiftKey?10:1):_=>Xe(_,R.shiftKey?100:10));break;case"Enter":case" ":O==="month"?qi(new Date(ie.getFullYear(),fe.getMonth(),1)):Zi(fe.getFullYear());break;case"Escape":Yi();break;default:ce=!1}ce&&R.preventDefault()};b.useEffect(()=>{if(he&&ke==="year"){const R=tl(ie).getFullYear(),O=fe.getFullYear();(O<R-1||O>R+10)&&Pe(new Date(O,0,1))}},[he,ke,fe,ie]);const qi=R=>{t==="month"?xn(R):(Pe(Ze(R)),ye(Re(R,N,L)),Dt("date"))},Zi=R=>{if(t==="year")xn(new Date(R,0,1));else{const O=new Date(R,ie.getMonth(),1);Pe(O),ye(Re(new Date(R,fe.getMonth(),Math.min(fe.getDate(),28)),N,L)),Dt("month")}},Qh=()=>{const R=fe.getMonth();return $h.map((O,Q)=>{const ce=new Date(ie.getFullYear(),Q,1),_=!!F&&os(ce,F)&&ET(ce,F),Ne=ce.getMonth()===ie.getMonth()&&t!=="month",Se=Q===R,Ie=Ht(ce);return h.jsx("button",{ref:Se?So:void 0,type:"button",tabIndex:Se?0:-1,className:$("cny-datepicker-chip",_&&"is-selected",Ne&&!_&&"is-current"),disabled:Ie,onClick:()=>qi(ce),onFocus:()=>ye(new Date(ie.getFullYear(),Q,Math.min(fe.getDate(),28))),children:O},Q)})},Jh=()=>{const R=Mt-1,O=fe.getFullYear();return Array.from({length:12},(Q,ce)=>{const _=R+ce,Ne=new Date(_,0,1),Se=!!F&&F.getFullYear()===_,Ie=_===ie.getFullYear()&&t!=="year",me=_===O,ut=Ht(Ne),To=_<Mt||_>=Mt+10;return h.jsx("button",{ref:me?So:void 0,type:"button",tabIndex:me?0:-1,className:$("cny-datepicker-chip",Se&&"is-selected",Ie&&!Se&&"is-current",To&&"is-outside"),disabled:ut,onClick:()=>Zi(_),onFocus:()=>ye(new Date(_,fe.getMonth(),Math.min(fe.getDate(),28))),children:_},_)})},ep=b.useRef(null),Qi=b.useRef(null),Ji=b.useRef(null),ea=()=>{const R=F??Re(new Date,N,L),O=R.getHours(),Q=R.getMinutes(),ce=R.getSeconds(),_=O>=12,Ne=M?O%12===0?12:O%12:O,Se=me=>{const ut=M?_?me===12?12:me+12:me===12?0:me:me;zn("hour",ut)},Ie=me=>{const ut=me?O<12?O+12:O:O>=12?O-12:O;zn("hour",ut)};return h.jsx("div",{className:"cny-dp-time",children:h.jsxs("div",{className:"cny-dp-time-row",children:[h.jsx(is,{ref:ep,ariaLabel:"Hour",value:Ne,min:M?1:0,max:M?12:23,step:1,nextRef:Qi,onChange:Se}),h.jsx("span",{className:"cny-dp-time-sep","aria-hidden":"true",children:":"}),h.jsx(is,{ref:Qi,ariaLabel:"Minute",value:Q-Q%Math.max(1,S),min:0,max:59,step:Math.max(1,S),nextRef:w?Ji:void 0,onChange:me=>zn("minute",me)}),w&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"cny-dp-time-sep","aria-hidden":"true",children:":"}),h.jsx(is,{ref:Ji,ariaLabel:"Second",value:ce-ce%Math.max(1,C),min:0,max:59,step:Math.max(1,C),onChange:me=>zn("second",me)})]}),M&&h.jsxs("div",{className:"cny-dp-ampm",role:"radiogroup","aria-label":"AM or PM",children:[h.jsx("button",{type:"button",role:"radio","aria-checked":!_,className:$("cny-dp-ampm-btn",!_&&"is-active"),onClick:()=>Ie(!1),children:"AM"}),h.jsx("button",{type:"button",role:"radio","aria-checked":_,className:$("cny-dp-ampm-btn",_&&"is-active"),onClick:()=>Ie(!0),children:"PM"})]})]})})},tp=()=>h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"cny-datepicker-header",children:[h.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Previous month",disabled:!Wh,onClick:()=>Pe(R=>ir(R,-1)),children:h.jsx(Uo,{size:16,"aria-hidden":"true"})}),h.jsx("button",{type:"button",className:"cny-datepicker-title is-clickable","aria-label":`Switch to month picker (currently ${nl(ie,ae)})`,onClick:()=>Dt("month"),children:nl(ie,ae)}),h.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Next month",disabled:!Uh,onClick:()=>Pe(R=>ir(R,1)),children:h.jsx(Ho,{size:16,"aria-hidden":"true"})})]}),h.jsxs("div",{role:"grid",className:"cny-datepicker-grid",onKeyDown:Fh,children:[h.jsx("div",{role:"row",className:"cny-datepicker-weekdays",children:Bh.map((R,O)=>h.jsx("span",{role:"columnheader","aria-label":R,className:"cny-datepicker-weekday",children:R.slice(0,2)},O))}),Array.from({length:6},(R,O)=>h.jsx("div",{role:"row",className:"cny-datepicker-row",children:_h.slice(O*7,O*7+7).map(Q=>{const ce=!os(Q,ie),_=sr(Q,F),Ne=sr(Q,Co),Se=sr(Q,fe),Ie=Ht(Q);return h.jsx("button",{ref:Se?Hi:void 0,type:"button",role:"gridcell",tabIndex:Se?0:-1,"aria-selected":_,"aria-current":Ne?"date":void 0,"aria-disabled":Ie||void 0,disabled:Ie,className:$("cny-datepicker-cell",ce&&"is-outside",_&&"is-selected",Ne&&"is-today"),onClick:()=>xn(Q),onFocus:()=>ye(Q),children:Q.getDate()},Q.toISOString())})},O))]})]}),np=()=>h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"cny-datepicker-header",children:[h.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Previous year",disabled:!Hh,onClick:()=>Pe(R=>Xe(R,-1)),children:h.jsx(Uo,{size:16,"aria-hidden":"true"})}),h.jsx("button",{type:"button",className:"cny-datepicker-title is-clickable","aria-label":`Switch to year picker (currently ${ie.getFullYear()})`,onClick:()=>Dt("year"),children:ie.getFullYear()}),h.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Next year",disabled:!Gh,onClick:()=>Pe(R=>Xe(R,1)),children:h.jsx(Ho,{size:16,"aria-hidden":"true"})})]}),h.jsx("div",{role:"grid","aria-label":"Month picker",className:"cny-datepicker-chip-grid",onKeyDown:R=>Xi(R,"month"),children:Qh()})]}),rp=()=>h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"cny-datepicker-header",children:[h.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Previous decade",disabled:!Kh,onClick:()=>Pe(R=>Xe(R,-10)),children:h.jsx(Uo,{size:16,"aria-hidden":"true"})}),h.jsx("span",{className:"cny-datepicker-title",children:`${Mt} – ${Mt+9}`}),h.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Next decade",disabled:!zh,onClick:()=>Pe(R=>Xe(R,10)),children:h.jsx(Ho,{size:16,"aria-hidden":"true"})})]}),h.jsx("div",{role:"grid","aria-label":"Year picker",className:"cny-datepicker-chip-grid",onKeyDown:R=>Xi(R,"year"),children:Jh()})]});return h.jsxs("div",{ref:wo,className:$("cny-datepicker",`mode-${t}`,p&&"is-disabled",H),...q,children:[D&&h.jsx("input",{type:"hidden",name:D,value:F?F.toISOString():"",readOnly:!0}),h.jsxs("button",{ref:vn,type:"button",id:Z,className:qh,"aria-haspopup":"dialog","aria-expanded":he,"aria-controls":he?U:void 0,"aria-invalid":Y||Un,"aria-describedby":$(G,Un?ee:void 0)||void 0,"aria-required":P||void 0,disabled:p,onClick:zi,onKeyDown:R=>{R.key==="ArrowDown"||R.key==="Enter"||R.key===" "?(R.preventDefault(),zi()):R.key==="Escape"&&he&&(R.preventDefault(),Te(!1))},children:[h.jsx("span",{className:"cny-datepicker-icon","aria-hidden":"true",children:Zh}),h.jsx("span",{className:$("cny-datepicker-value",!F&&"is-placeholder"),children:jh||Oh}),x&&F&&!p&&h.jsx("span",{role:"button",tabIndex:-1,className:"cny-datepicker-clear","aria-label":"Clear",onClick:Vh,onPointerDown:R=>R.stopPropagation(),children:h.jsx(qr,{size:13,"aria-hidden":"true"})})]}),Un&&j!==!1&&h.jsx("span",{id:ee,className:"cny-datepicker-error",role:"alert",children:typeof j=="string"?j:j??Gt}),he&&Nh&&$r.createPortal(h.jsxs("div",{ref:bo,id:U,role:"dialog","aria-modal":"false","aria-label":Lh,className:$("cny-datepicker-panel",`is-${t}`),style:Mh,children:[h.jsxs("div",{className:"cny-datepicker-body",children:[(t==="date"||t==="datetime")&&ke==="date"&&tp(),(t==="date"||t==="datetime"||t==="month")&&ke==="month"&&np(),(t==="date"||t==="datetime"||t==="month"||t==="year")&&ke==="year"&&rp(),t==="time"&&ea(),t==="datetime"&&ke==="date"&&ea()]}),h.jsxs("div",{className:"cny-datepicker-footer",children:[h.jsx("button",{type:"button",className:"cny-datepicker-action",disabled:!Yh,onClick:Xh,children:t==="time"?"Now":t==="year"?"This year":t==="month"?"This month":"Today"}),h.jsx("div",{className:"cny-datepicker-footer-spacer"}),x&&F&&h.jsx("button",{type:"button",className:"cny-datepicker-action",onClick:()=>{lt(null),Hn()},children:"Clear"}),(t==="datetime"||t==="time")&&h.jsx("button",{type:"button",className:"cny-datepicker-action is-primary",onClick:Hn,children:"Done"})]})]}),document.body)]})}),is=b.forwardRef(function({value:t,min:n,max:r,step:o,ariaLabel:s,nextRef:i,onChange:a},c){const l=b.useRef(null);b.useImperativeHandle(c,()=>l.current,[]);const[u,d]=b.useState(()=>ur(t)),f=b.useRef(!1);b.useEffect(()=>{f.current||d(ur(t))},[t]);const p=b.useCallback(v=>{if(!Number.isFinite(v))return;let w=Math.max(n,Math.min(r,v));w=Math.round(w/o)*o,w>r&&(w=Math.floor(r/o)*o),a(w),d(ur(w))},[n,r,o,a]),x=()=>{const v=t+o;p(v>r?n:v)},g=()=>{const v=t-o;p(v<n?Math.floor(r/o)*o:v)},y=v=>{switch(v.key){case"ArrowUp":v.preventDefault(),x();break;case"ArrowDown":v.preventDefault(),g();break;case"PageUp":v.preventDefault(),p(t+o*5);break;case"PageDown":v.preventDefault(),p(t-o*5);break;case"Home":v.preventDefault(),p(n);break;case"End":v.preventDefault(),p(r);break;case"Enter":v.preventDefault(),p(parseInt(u,10));break}};return h.jsxs("div",{className:"cny-dp-timefield",onWheel:v=>{document.activeElement===l.current&&(v.preventDefault(),v.deltaY<0?x():v.deltaY>0&&g())},children:[h.jsx("input",{ref:l,type:"text",inputMode:"numeric",pattern:"[0-9]*",maxLength:2,className:"cny-dp-timefield-input",value:u,"aria-label":s,"aria-valuenow":t,"aria-valuemin":n,"aria-valuemax":r,onFocus:v=>{f.current=!0,v.target.select()},onChange:v=>{var S;const w=v.target.value.replace(/[^0-9]/g,"").slice(0,2);if(d(w),w.length===2){const C=parseInt(w,10);Number.isFinite(C)&&C>=n&&C<=r&&(p(C),(S=i==null?void 0:i.current)==null||S.focus())}},onBlur:()=>{f.current=!1;const v=parseInt(u,10);Number.isFinite(v)?p(v):d(ur(t))},onKeyDown:y}),h.jsxs("div",{className:"cny-dp-timefield-controls",children:[h.jsx("button",{type:"button",className:"cny-dp-timefield-btn","aria-label":`Increment ${s.toLowerCase()}`,tabIndex:-1,onClick:x,onMouseDown:v=>v.preventDefault(),children:h.jsx(nw,{size:10,"aria-hidden":"true"})}),h.jsx("button",{type:"button",className:"cny-dp-timefield-btn","aria-label":`Decrement ${s.toLowerCase()}`,tabIndex:-1,onClick:g,onMouseDown:v=>v.preventDefault(),children:h.jsx(Ti,{size:10,"aria-hidden":"true"})})]})]})});function BT({hotkey:e=!0}={}){const[t,n]=b.useState(!1);return b.useEffect(()=>{if(!e)return;const r=o=>{o.key==="k"&&(o.metaKey||o.ctrlKey)&&(o.preventDefault(),n(s=>!s))};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[e]),{open:t,setOpen:n,toggle:()=>n(r=>!r)}}function $T({open:e,onOpenChange:t,sections:n,placeholder:r="Search…",title:o="Command palette",description:s="Search and navigate. Use arrow keys to move, Enter to open, Escape to dismiss.",emptyText:i="No matches found.",footer:a,onItemSelect:c,contentClassName:l}){const u=d=>{var f;d.disabled||((f=d.onSelect)==null||f.call(d),c==null||c(d),t(!1))};return h.jsxs(Ve.Dialog,{open:e,onOpenChange:t,label:o,contentClassName:$("cny-cmdk-content",l),children:[h.jsxs(Ud,{children:[h.jsx($C,{children:o}),h.jsx(WC,{children:s})]}),h.jsxs("div",{className:"cny-cmdk-header",children:[h.jsx(hd,{size:16,"aria-hidden":"true"}),h.jsx(Ve.Input,{placeholder:r}),h.jsx("kbd",{className:"cny-cmdk-esc",children:"Esc"})]}),h.jsxs(Ve.List,{className:"cny-cmdk-list",children:[h.jsx(Ve.Empty,{className:"cny-cmdk-empty",children:i}),n.map(d=>h.jsx(Ve.Group,{heading:d.title,className:"cny-cmdk-group",children:d.items.map(f=>{var p;return h.jsxs(Ve.Item,{value:`${d.title} ${f.label} ${((p=f.keywords)==null?void 0:p.join(" "))??""}`,disabled:f.disabled,onSelect:()=>u(f),className:"cny-cmdk-item",children:[f.icon&&h.jsx("span",{className:"cny-cmdk-item-icon",children:f.icon}),h.jsx("span",{className:"cny-cmdk-item-label",children:f.label}),f.badge&&h.jsx("span",{className:"cny-cmdk-item-badge",children:f.badge}),f.hint&&h.jsx("span",{className:"cny-cmdk-item-hint",children:f.hint})]},f.id)})},d.title))]}),a!==!1&&h.jsx("div",{className:"cny-cmdk-footer",children:a??h.jsxs(h.Fragment,{children:[h.jsx("kbd",{children:"↑↓"})," navigate",h.jsx("kbd",{children:"↵"})," open",h.jsx("kbd",{children:"Esc"})," dismiss"]})})]})}function WT({onClick:e,label:t="Search…",shortcut:n="⌘K",className:r}){return h.jsxs("button",{type:"button",onClick:e,className:$("cny-cmdk-trigger",r),"aria-label":"Open command palette",children:[h.jsx(hd,{size:14,"aria-hidden":"true"}),h.jsx("span",{className:"cny-cmdk-trigger-label",children:t}),h.jsx("kbd",{className:"cny-cmdk-trigger-kbd",children:n})]})}let UT=0;const HT=()=>`cny-toast-${Date.now().toString(36)}-${++UT}`,Dh=b.createContext(null),GT={default:null,success:h.jsx(iw,{size:16,"aria-hidden":"true"}),info:h.jsx(pw,{size:16,"aria-hidden":"true"}),warning:h.jsx(ww,{size:16,"aria-hidden":"true"}),danger:h.jsx(ow,{size:16,"aria-hidden":"true"}),loading:h.jsx(gw,{size:16,"aria-hidden":"true",className:"cny-toast-spin"})};function KT({children:e,position:t="bottom-right",defaultDuration:n=5e3,maxToasts:r=5,offset:o="1rem"}){const[s,i]=b.useState([]),[a,c]=b.useState(!1);b.useEffect(()=>c(!0),[]);const l=b.useCallback(g=>{i(y=>y.map(v=>g==null||v.id===g?{...v,exiting:!0}:v)),window.setTimeout(()=>{i(y=>y.filter(v=>g==null?!1:v.id!==g||!v.exiting)),i(y=>(y.filter(v=>v.exiting&&(g==null||v.id===g)).forEach(v=>{var w;return(w=v.onDismiss)==null?void 0:w.call(v)}),y.filter(v=>!v.exiting||g!=null&&v.id!==g)))},200)},[]),u=b.useCallback(g=>{const y=g.id??HT(),v={id:y,title:g.title,description:g.description,action:g.action,icon:g.icon,variant:g.variant??"default",duration:g.duration??n,dismissible:g.dismissible??!0,onDismiss:g.onDismiss};return i(w=>{const C=[...w.filter(T=>T.id!==y),v];return C.length>r?C.slice(C.length-r):C}),y},[n,r]),d=b.useCallback((g,y)=>{i(v=>v.map(w=>w.id===g?{...w,...y,variant:y.variant??w.variant,duration:y.duration??w.duration,dismissible:y.dismissible??w.dismissible}:w))},[]),f=b.useMemo(()=>{const g=(y=>u(typeof y=="string"?{title:y}:y));return g.success=(y,v)=>u({...v,title:y,variant:"success"}),g.info=(y,v)=>u({...v,title:y,variant:"info"}),g.warning=(y,v)=>u({...v,title:y,variant:"warning"}),g.error=(y,v)=>u({...v,title:y,variant:"danger"}),g.loading=(y,v)=>u({...v,title:y,variant:"loading",duration:(v==null?void 0:v.duration)??1/0}),g},[u]),p=b.useMemo(()=>({toast:f,dismiss:l,update:d}),[f,l,d]),x=t.startsWith("top-");return h.jsxs(Dh.Provider,{value:p,children:[e,a&&$r.createPortal(h.jsx("ol",{className:$("cny-toast-viewport",`pos-${t}`),style:{"--cny-toast-offset":o},"aria-live":"polite","aria-relevant":"additions",tabIndex:-1,children:(x?[...s].reverse():s).map(g=>h.jsx(zT,{toast:g,onDismiss:()=>l(g.id)},g.id))}),document.body)]})}function zT({toast:e,onDismiss:t}){const{variant:n,title:r,description:o,action:s,icon:i,duration:a,dismissible:c}=e,[l,u]=b.useState(!1),d=b.useRef(null);b.useEffect(()=>{if(!e.exiting&&!(!Number.isFinite(a)||a<0)&&!l)return d.current=setTimeout(t,a),()=>{d.current&&clearTimeout(d.current)}},[l,a,t,e.exiting]);const f=n==="danger"||n==="warning"?"alert":"status",p=i!==!1,x=i!==void 0&&i!==!1?i:GT[n];return h.jsxs("li",{role:f,"aria-atomic":"true",className:$("cny-toast",n,e.exiting&&"is-exiting"),onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),onFocus:()=>u(!0),onBlur:()=>u(!1),children:[p&&x&&h.jsx("span",{className:"cny-toast-icon","aria-hidden":"true",children:x}),h.jsxs("div",{className:"cny-toast-body",children:[r!=null&&h.jsx("p",{className:"cny-toast-title",children:r}),o!=null&&h.jsx("p",{className:"cny-toast-description",children:o})]}),s!=null&&h.jsx("div",{className:"cny-toast-action",children:s}),c&&h.jsx("button",{type:"button",className:"cny-toast-close","aria-label":"Dismiss",onClick:t,children:h.jsx(qr,{size:14,"aria-hidden":"true"})})]})}function YT(){const e=b.useContext(Dh);if(!e)throw new Error("useToast() must be called inside a <ToastProvider>. Wrap your app at the root.");return e}exports.Alert=Rw;exports.Avatar=Ew;exports.AvatarStack=Aw;exports.Box=Vn;exports.Button=Xu;exports.ButtonGroup=sx;exports.Card=Cw;exports.Checkbox=lT;exports.CommandPalette=$T;exports.CommandPaletteTrigger=WT;exports.Container=zw;exports.DatePicker=_T;exports.Divider=Yw;exports.FAB=ix;exports.Field=Qw;exports.Grid=Kw;exports.IconButton=ax;exports.Input=Sw;exports.MultiSelect=oT;exports.Navbar=jw;exports.NavbarActions=Fw;exports.NavbarBrand=Ow;exports.NavbarItem=Vw;exports.NavbarNav=Lw;exports.Progress=Dw;exports.ProgressRing=Mw;exports.Radio=bT;exports.RadioGroup=wT;exports.Row=Gw;exports.Scroll=pd;exports.ScrollRegion=Nw;exports.Select=XS;exports.SelectGroup=ZS;exports.SelectItem=qS;exports.SelectLabel=QS;exports.SelectSeparator=JS;exports.Sidebar=_w;exports.SidebarItem=$w;exports.SidebarSection=Bw;exports.Skeleton=Iw;exports.Spacer=Xw;exports.Stack=Hw;exports.Switch=RT;exports.Text=Zw;exports.Textarea=Jw;exports.ToastProvider=KT;exports.ToggleButton=xx;exports.ToggleButtonGroup=$x;exports.ToggleButtonGroupItem=Wx;exports.useCommandPalette=BT;exports.useToast=YT;
|
|
188
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return p.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},UP="DialogDescriptionWarning",KP=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${pp(UP).contentName}}.`;return p.useEffect(()=>{var s;const o=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Ia=ep,mp=np,_a=op,Oa=sp,La=ip,Va=cp,Fa=up,Ho=fp,Ln='[cmdk-group=""]',Ws='[cmdk-group-items=""]',HP='[cmdk-group-heading=""]',gp='[cmdk-item=""]',du=`${gp}:not([aria-disabled="true"])`,Ai="cmdk-item-select",un="data-value",zP=(e,t,n)=>OP(e,t,n),vp=p.createContext(void 0),fr=()=>p.useContext(vp),yp=p.createContext(void 0),$a=()=>p.useContext(yp),xp=p.createContext(void 0),bp=p.forwardRef((e,t)=>{let n=dn(()=>{var M,Y;return{search:"",value:(Y=(M=e.value)!=null?M:e.defaultValue)!=null?Y:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=dn(()=>new Set),o=dn(()=>new Map),s=dn(()=>new Map),i=dn(()=>new Set),a=wp(e),{label:c,children:u,value:d,onValueChange:f,filter:h,shouldFilter:m,loop:y,disablePointerSelection:g=!1,vimBindings:v=!0,...x}=e,b=he(),C=he(),S=he(),R=p.useRef(null),P=oE();Jt(()=>{if(d!==void 0){let M=d.trim();n.current.value=M,T.emit()}},[d]),Jt(()=>{P(6,J)},[]);let T=p.useMemo(()=>({subscribe:M=>(i.current.add(M),()=>i.current.delete(M)),snapshot:()=>n.current,setState:(M,Y,z)=>{var H,re,I,B;if(!Object.is(n.current[M],Y)){if(n.current[M]=Y,M==="search")G(),N(),P(1,L);else if(M==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ee=document.getElementById(S);ee?ee.focus():(H=document.getElementById(b))==null||H.focus()}if(P(7,()=>{var ee;n.current.selectedItemId=(ee=F())==null?void 0:ee.id,T.emit()}),z||P(5,J),((re=a.current)==null?void 0:re.value)!==void 0){let ee=Y??"";(B=(I=a.current).onValueChange)==null||B.call(I,ee);return}}T.emit()}},emit:()=>{i.current.forEach(M=>M())}}),[]),A=p.useMemo(()=>({value:(M,Y,z)=>{var H;Y!==((H=s.current.get(M))==null?void 0:H.value)&&(s.current.set(M,{value:Y,keywords:z}),n.current.filtered.items.set(M,k(Y,z)),P(2,()=>{N(),T.emit()}))},item:(M,Y)=>(r.current.add(M),Y&&(o.current.has(Y)?o.current.get(Y).add(M):o.current.set(Y,new Set([M]))),P(3,()=>{G(),N(),n.current.value||L(),T.emit()}),()=>{s.current.delete(M),r.current.delete(M),n.current.filtered.items.delete(M);let z=F();P(4,()=>{G(),(z==null?void 0:z.getAttribute("id"))===M&&L(),T.emit()})}),group:M=>(o.current.has(M)||o.current.set(M,new Set),()=>{s.current.delete(M),o.current.delete(M)}),filter:()=>a.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>a.current.disablePointerSelection,listId:b,inputId:S,labelId:C,listInnerRef:R}),[]);function k(M,Y){var z,H;let re=(H=(z=a.current)==null?void 0:z.filter)!=null?H:zP;return M?re(M,n.current.search,Y):0}function N(){if(!n.current.search||a.current.shouldFilter===!1)return;let M=n.current.filtered.items,Y=[];n.current.filtered.groups.forEach(H=>{let re=o.current.get(H),I=0;re.forEach(B=>{let ee=M.get(B);I=Math.max(ee,I)}),Y.push([H,I])});let z=R.current;Z().sort((H,re)=>{var I,B;let ee=H.getAttribute("id"),se=re.getAttribute("id");return((I=M.get(se))!=null?I:0)-((B=M.get(ee))!=null?B:0)}).forEach(H=>{let re=H.closest(Ws);re?re.appendChild(H.parentElement===re?H:H.closest(`${Ws} > *`)):z.appendChild(H.parentElement===z?H:H.closest(`${Ws} > *`))}),Y.sort((H,re)=>re[1]-H[1]).forEach(H=>{var re;let I=(re=R.current)==null?void 0:re.querySelector(`${Ln}[${un}="${encodeURIComponent(H[0])}"]`);I==null||I.parentElement.appendChild(I)})}function L(){let M=Z().find(z=>z.getAttribute("aria-disabled")!=="true"),Y=M==null?void 0:M.getAttribute(un);T.setState("value",Y||void 0)}function G(){var M,Y,z,H;if(!n.current.search||a.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let re=0;for(let I of r.current){let B=(Y=(M=s.current.get(I))==null?void 0:M.value)!=null?Y:"",ee=(H=(z=s.current.get(I))==null?void 0:z.keywords)!=null?H:[],se=k(B,ee);n.current.filtered.items.set(I,se),se>0&&re++}for(let[I,B]of o.current)for(let ee of B)if(n.current.filtered.items.get(ee)>0){n.current.filtered.groups.add(I);break}n.current.filtered.count=re}function J(){var M,Y,z;let H=F();H&&(((M=H.parentElement)==null?void 0:M.firstChild)===H&&((z=(Y=H.closest(Ln))==null?void 0:Y.querySelector(HP))==null||z.scrollIntoView({block:"nearest"})),H.scrollIntoView({block:"nearest"}))}function F(){var M;return(M=R.current)==null?void 0:M.querySelector(`${gp}[aria-selected="true"]`)}function Z(){var M;return Array.from(((M=R.current)==null?void 0:M.querySelectorAll(du))||[])}function D(M){let Y=Z()[M];Y&&T.setState("value",Y.getAttribute(un))}function U(M){var Y;let z=F(),H=Z(),re=H.findIndex(B=>B===z),I=H[re+M];(Y=a.current)!=null&&Y.loop&&(I=re+M<0?H[H.length-1]:re+M===H.length?H[0]:H[re+M]),I&&T.setState("value",I.getAttribute(un))}function j(M){let Y=F(),z=Y==null?void 0:Y.closest(Ln),H;for(;z&&!H;)z=M>0?nE(z,Ln):rE(z,Ln),H=z==null?void 0:z.querySelector(du);H?T.setState("value",H.getAttribute(un)):U(M)}let O=()=>D(Z().length-1),ne=M=>{M.preventDefault(),M.metaKey?O():M.altKey?j(1):U(1)},W=M=>{M.preventDefault(),M.metaKey?D(0):M.altKey?j(-1):U(-1)};return p.createElement(K.div,{ref:t,tabIndex:-1,...x,"cmdk-root":"",onKeyDown:M=>{var Y;(Y=x.onKeyDown)==null||Y.call(x,M);let z=M.nativeEvent.isComposing||M.keyCode===229;if(!(M.defaultPrevented||z))switch(M.key){case"n":case"j":{v&&M.ctrlKey&&ne(M);break}case"ArrowDown":{ne(M);break}case"p":case"k":{v&&M.ctrlKey&&W(M);break}case"ArrowUp":{W(M);break}case"Home":{M.preventDefault(),D(0);break}case"End":{M.preventDefault(),O();break}case"Enter":{M.preventDefault();let H=F();if(H){let re=new Event(Ai);H.dispatchEvent(re)}}}}},p.createElement("label",{"cmdk-label":"",htmlFor:A.inputId,id:A.labelId,style:iE},c),zo(e,M=>p.createElement(yp.Provider,{value:T},p.createElement(vp.Provider,{value:A},M))))}),YP=p.forwardRef((e,t)=>{var n,r;let o=he(),s=p.useRef(null),i=p.useContext(xp),a=fr(),c=wp(e),u=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:i==null?void 0:i.forceMount;Jt(()=>{if(!u)return a.item(o,i==null?void 0:i.id)},[u]);let d=Cp(o,s,[e.value,e.children,s],e.keywords),f=$a(),h=Et(P=>P.value&&P.value===d.current),m=Et(P=>u||a.filter()===!1?!0:P.search?P.filtered.items.get(o)>0:!0);p.useEffect(()=>{let P=s.current;if(!(!P||e.disabled))return P.addEventListener(Ai,y),()=>P.removeEventListener(Ai,y)},[m,e.onSelect,e.disabled]);function y(){var P,T;g(),(T=(P=c.current).onSelect)==null||T.call(P,d.current)}function g(){f.setState("value",d.current,!0)}if(!m)return null;let{disabled:v,value:x,onSelect:b,forceMount:C,keywords:S,...R}=e;return p.createElement(K.div,{ref:dt(s,t),...R,id:o,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!h,"data-disabled":!!v,"data-selected":!!h,onPointerMove:v||a.getDisablePointerSelection()?void 0:g,onClick:v?void 0:y},e.children)}),XP=p.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:o,...s}=e,i=he(),a=p.useRef(null),c=p.useRef(null),u=he(),d=fr(),f=Et(m=>o||d.filter()===!1?!0:m.search?m.filtered.groups.has(i):!0);Jt(()=>d.group(i),[]),Cp(i,a,[e.value,e.heading,c]);let h=p.useMemo(()=>({id:i,forceMount:o}),[o]);return p.createElement(K.div,{ref:dt(a,t),...s,"cmdk-group":"",role:"presentation",hidden:f?void 0:!0},n&&p.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),zo(e,m=>p.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},p.createElement(xp.Provider,{value:h},m))))}),qP=p.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,o=p.useRef(null),s=Et(i=>!i.search);return!n&&!s?null:p.createElement(K.div,{ref:dt(o,t),...r,"cmdk-separator":"",role:"separator"})}),ZP=p.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,o=e.value!=null,s=$a(),i=Et(u=>u.search),a=Et(u=>u.selectedItemId),c=fr();return p.useEffect(()=>{e.value!=null&&s.setState("search",e.value)},[e.value]),p.createElement(K.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":a,id:c.inputId,type:"text",value:o?e.value:i,onChange:u=>{o||s.setState("search",u.target.value),n==null||n(u.target.value)}})}),QP=p.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...o}=e,s=p.useRef(null),i=p.useRef(null),a=Et(u=>u.selectedItemId),c=fr();return p.useEffect(()=>{if(i.current&&s.current){let u=i.current,d=s.current,f,h=new ResizeObserver(()=>{f=requestAnimationFrame(()=>{let m=u.offsetHeight;d.style.setProperty("--cmdk-list-height",m.toFixed(1)+"px")})});return h.observe(u),()=>{cancelAnimationFrame(f),h.unobserve(u)}}},[]),p.createElement(K.div,{ref:dt(s,t),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":a,"aria-label":r,id:c.listId},zo(e,u=>p.createElement("div",{ref:dt(i,c.listInnerRef),"cmdk-list-sizer":""},u)))}),JP=p.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:s,container:i,...a}=e;return p.createElement(Ia,{open:n,onOpenChange:r},p.createElement(_a,{container:i},p.createElement(Oa,{"cmdk-overlay":"",className:o}),p.createElement(La,{"aria-label":e.label,"cmdk-dialog":"",className:s},p.createElement(bp,{ref:t,...a}))))}),eE=p.forwardRef((e,t)=>Et(n=>n.filtered.count===0)?p.createElement(K.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),tE=p.forwardRef((e,t)=>{let{progress:n,children:r,label:o="Loading...",...s}=e;return p.createElement(K.div,{ref:t,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},zo(e,i=>p.createElement("div",{"aria-hidden":!0},i)))}),xe=Object.assign(bp,{List:QP,Item:YP,Input:ZP,Group:XP,Separator:qP,Dialog:JP,Empty:eE,Loading:tE});function nE(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function rE(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function wp(e){let t=p.useRef(e);return Jt(()=>{t.current=e}),t}var Jt=typeof window>"u"?p.useEffect:p.useLayoutEffect;function dn(e){let t=p.useRef();return t.current===void 0&&(t.current=e()),t}function Et(e){let t=$a(),n=()=>e(t.snapshot());return p.useSyncExternalStore(t.subscribe,n,n)}function Cp(e,t,n,r=[]){let o=p.useRef(),s=fr();return Jt(()=>{var i;let a=(()=>{var u;for(let d of n){if(typeof d=="string")return d.trim();if(typeof d=="object"&&"current"in d)return d.current?(u=d.current.textContent)==null?void 0:u.trim():o.current}})(),c=r.map(u=>u.trim());s.value(e,a,c),(i=t.current)==null||i.setAttribute(un,a),o.current=a}),o}var oE=()=>{let[e,t]=p.useState(),n=dn(()=>new Map);return Jt(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,o)=>{n.current.set(r,o),t({})}};function sE(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function zo({asChild:e,children:t},n){return e&&p.isValidElement(t)?p.cloneElement(sE(t),{ref:t.ref},n(t.props.children)):n(t)}var iE={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function aE({options:e,value:t,defaultValue:n,onValueChange:r,placeholder:o="Select…",searchPlaceholder:s="Search…",emptyText:i="No matches.",maxItems:a,size:c,color:u="primary",disabled:d=!1,id:f,className:h,"aria-invalid":m,"aria-describedby":y,"aria-label":g}){const[v,x]=w.useState(!1),[b,C]=w.useState(n??[]),[S,R]=w.useState(""),P=w.useRef(null),T=t??b,A=w.useCallback(D=>{t===void 0&&C(D),r==null||r(D)},[t,r]),k=w.useCallback(D=>{T.includes(D)?A(T.filter(U=>U!==D)):(a==null||T.length<a)&&A([...T,D])},[T,A,a]),N=w.useCallback(D=>A(T.filter(U=>U!==D)),[T,A]),L=w.useMemo(()=>{const D=new Map;for(const U of e)D.set(U.value,U);return D},[e]),G=w.useMemo(()=>{const D=new Map;for(const U of e){const j=U.group??"";D.has(j)||D.set(j,[]),D.get(j).push(U)}return D},[e]),J=D=>{D.key==="Backspace"&&S===""&&T.length>0&&(D.preventDefault(),N(T[T.length-1]))};w.useEffect(()=>{v&&queueMicrotask(()=>{var D;return(D=P.current)==null?void 0:D.focus()})},[v]);const F=_("cny-multiselect-trigger",c==="sm"||c==="lg"?c:null,u!=="primary"&&u,h),Z=a!=null&&T.length>=a;return l.jsxs(Ea,{open:v,onOpenChange:D=>!d&&x(D),children:[l.jsx(Ma,{asChild:!0,children:l.jsxs("div",{role:"combobox","aria-expanded":v,"aria-haspopup":"listbox","aria-invalid":m,"aria-describedby":y,"aria-label":g,"data-state":v?"open":"closed","data-disabled":d||void 0,id:f,className:F,onClick:()=>!d&&x(D=>!D),tabIndex:d?-1:0,onKeyDown:D=>{(D.key==="Enter"||D.key===" "||D.key==="ArrowDown")&&!v&&(D.preventDefault(),x(!0))},children:[T.length===0&&l.jsx("span",{className:"cny-multiselect-placeholder",children:o}),T.map(D=>{const U=L.get(D);return l.jsxs("span",{className:"cny-chip",children:[l.jsx("span",{className:"cny-chip-label",children:(U==null?void 0:U.label)??D}),!d&&l.jsx("button",{type:"button",className:"cny-chip-remove","aria-label":`Remove ${(U==null?void 0:U.label)??D}`,onClick:j=>{j.stopPropagation(),N(D)},children:l.jsx(jt,{size:12,"aria-hidden":"true"})})]},D)}),l.jsx(No,{size:14,"aria-hidden":"true",className:"cny-multiselect-chevron"})]})}),l.jsx(Aa,{children:l.jsx(Da,{className:"cny-popover",align:"start",sideOffset:4,onOpenAutoFocus:D=>D.preventDefault(),children:l.jsxs(xe,{shouldFilter:!0,label:"Options",children:[l.jsx(xe.Input,{ref:P,placeholder:s,value:S,onValueChange:R,onKeyDown:J}),l.jsxs(xe.List,{children:[l.jsx(xe.Empty,{children:i}),Array.from(G.entries()).map(([D,U])=>l.jsx(xe.Group,{heading:D||void 0,children:U.map(j=>{const O=T.includes(j.value),ne=j.disabled||!O&&Z;return l.jsxs(xe.Item,{value:`${j.label} ${j.description??""} ${j.value}`,disabled:ne,onSelect:()=>k(j.value),children:[j.icon&&l.jsx("span",{style:{display:"inline-flex"},children:j.icon}),l.jsx("span",{children:j.label}),j.description&&l.jsx("span",{style:{color:"var(--text-muted)",fontSize:"0.75rem"},children:j.description}),O&&l.jsx("span",{className:"cny-check",children:l.jsx(Rt,{size:14,"aria-hidden":"true"})})]},j.value)})},D||"default"))]})]})})})]})}var Yo="Checkbox",[cE]=Ce(Yo),[lE,Ba]=cE(Yo);function uE(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:o,disabled:s,form:i,name:a,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:f}=e,[h,m]=be({prop:n,defaultProp:o??!1,onChange:c,caller:Yo}),[y,g]=p.useState(null),[v,x]=p.useState(null),b=p.useRef(!1),C=y?!!i||!!y.closest("form"):!0,S={checked:h,disabled:s,setChecked:m,control:y,setControl:g,name:a,form:i,value:d,hasConsumerStoppedPropagationRef:b,required:u,defaultChecked:wt(o)?!1:o,isFormControl:C,bubbleInput:v,setBubbleInput:x};return l.jsx(lE,{scope:t,...S,children:dE(f)?f(S):r})}var Sp="CheckboxTrigger",Rp=p.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},o)=>{const{control:s,value:i,disabled:a,checked:c,required:u,setControl:d,setChecked:f,hasConsumerStoppedPropagationRef:h,isFormControl:m,bubbleInput:y}=Ba(Sp,e),g=te(o,d),v=p.useRef(c);return p.useEffect(()=>{const x=s==null?void 0:s.form;if(x){const b=()=>f(v.current);return x.addEventListener("reset",b),()=>x.removeEventListener("reset",b)}},[s,f]),l.jsx(K.button,{type:"button",role:"checkbox","aria-checked":wt(c)?"mixed":c,"aria-required":u,"data-state":Mp(c),"data-disabled":a?"":void 0,disabled:a,value:i,...r,ref:g,onKeyDown:V(t,x=>{x.key==="Enter"&&x.preventDefault()}),onClick:V(n,x=>{f(b=>wt(b)?!0:!b),y&&m&&(h.current=x.isPropagationStopped(),h.current||x.stopPropagation())})})});Rp.displayName=Sp;var Di=p.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:s,required:i,disabled:a,value:c,onCheckedChange:u,form:d,...f}=e;return l.jsx(uE,{__scopeCheckbox:n,checked:o,defaultChecked:s,disabled:a,required:i,onCheckedChange:u,name:r,form:d,value:c,internal_do_not_use_render:({isFormControl:h})=>l.jsxs(l.Fragment,{children:[l.jsx(Rp,{...f,ref:t,__scopeCheckbox:n}),h&&l.jsx(Ep,{__scopeCheckbox:n})]})})});Di.displayName=Yo;var Tp="CheckboxIndicator",Ni=p.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,s=Ba(Tp,n);return l.jsx(Me,{present:r||wt(s.checked)||s.checked===!0,children:l.jsx(K.span,{"data-state":Mp(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});Ni.displayName=Tp;var Pp="CheckboxBubbleInput",Ep=p.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:o,checked:s,defaultChecked:i,required:a,disabled:c,name:u,value:d,form:f,bubbleInput:h,setBubbleInput:m}=Ba(Pp,e),y=te(n,m),g=lr(s),v=ir(r);p.useEffect(()=>{const b=h;if(!b)return;const C=window.HTMLInputElement.prototype,R=Object.getOwnPropertyDescriptor(C,"checked").set,P=!o.current;if(g!==s&&R){const T=new Event("click",{bubbles:P});b.indeterminate=wt(s),R.call(b,wt(s)?!1:s),b.dispatchEvent(T)}},[h,g,s,o]);const x=p.useRef(wt(s)?!1:s);return l.jsx(K.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??x.current,required:a,disabled:c,name:u,value:d,form:f,...t,tabIndex:-1,ref:y,style:{...t.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Ep.displayName=Pp;function dE(e){return typeof e=="function"}function wt(e){return e==="indeterminate"}function Mp(e){return wt(e)?"indeterminate":e?"checked":"unchecked"}const fE=w.forwardRef(function({className:t,children:n,...r},o){return n?l.jsxs("label",{className:"control",children:[l.jsx(Di,{ref:o,className:_("checkbox",t),...r,children:l.jsx(Ni,{children:r.checked==="indeterminate"?l.jsx(Fl,{size:12,"aria-hidden":"true"}):l.jsx(Rt,{size:12,"aria-hidden":"true"})})}),l.jsx("span",{children:n})]}):l.jsx(Di,{ref:o,className:_("checkbox",t),...r,children:l.jsx(Ni,{children:r.checked==="indeterminate"?l.jsx(Fl,{size:12,"aria-hidden":"true"}):l.jsx(Rt,{size:12,"aria-hidden":"true"})})})});var Wa="Radio",[hE,Ap]=Ce(Wa),[pE,mE]=hE(Wa),Dp=p.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:o=!1,required:s,disabled:i,value:a="on",onCheck:c,form:u,...d}=e,[f,h]=p.useState(null),m=te(t,v=>h(v)),y=p.useRef(!1),g=f?u||!!f.closest("form"):!0;return l.jsxs(pE,{scope:n,checked:o,disabled:i,children:[l.jsx(K.button,{type:"button",role:"radio","aria-checked":o,"data-state":Ip(o),"data-disabled":i?"":void 0,disabled:i,value:a,...d,ref:m,onClick:V(e.onClick,v=>{o||c==null||c(),g&&(y.current=v.isPropagationStopped(),y.current||v.stopPropagation())})}),g&&l.jsx(kp,{control:f,bubbles:!y.current,name:r,value:a,checked:o,required:s,disabled:i,form:u,style:{transform:"translateX(-100%)"}})]})});Dp.displayName=Wa;var Np="RadioIndicator",jp=p.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,s=mE(Np,n);return l.jsx(Me,{present:r||s.checked,children:l.jsx(K.span,{"data-state":Ip(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:t})})});jp.displayName=Np;var gE="RadioBubbleInput",kp=p.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:r=!0,...o},s)=>{const i=p.useRef(null),a=te(i,s),c=lr(n),u=ir(t);return p.useEffect(()=>{const d=i.current;if(!d)return;const f=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(f,"checked").set;if(c!==n&&m){const y=new Event("click",{bubbles:r});m.call(d,n),d.dispatchEvent(y)}},[c,n,r]),l.jsx(K.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:a,style:{...o.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});kp.displayName=gE;function Ip(e){return e?"checked":"unchecked"}var vE=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Xo="RadioGroup",[yE]=Ce(Xo,[Dt,Ap]),_p=Dt(),Op=Ap(),[xE,bE]=yE(Xo),Lp=p.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:o,value:s,required:i=!1,disabled:a=!1,orientation:c,dir:u,loop:d=!0,onValueChange:f,...h}=e,m=_p(n),y=At(u),[g,v]=be({prop:s,defaultProp:o??null,onChange:f,caller:Xo});return l.jsx(xE,{scope:n,name:r,required:i,disabled:a,value:g,onValueChange:v,children:l.jsx(Ao,{asChild:!0,...m,orientation:c,dir:y,loop:d,children:l.jsx(K.div,{role:"radiogroup","aria-required":i,"aria-orientation":c,"data-disabled":a?"":void 0,dir:y,...h,ref:t})})})});Lp.displayName=Xo;var Vp="RadioGroupItem",Fp=p.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...o}=e,s=bE(Vp,n),i=s.disabled||r,a=_p(n),c=Op(n),u=p.useRef(null),d=te(t,u),f=s.value===o.value,h=p.useRef(!1);return p.useEffect(()=>{const m=g=>{vE.includes(g.key)&&(h.current=!0)},y=()=>h.current=!1;return document.addEventListener("keydown",m),document.addEventListener("keyup",y),()=>{document.removeEventListener("keydown",m),document.removeEventListener("keyup",y)}},[]),l.jsx(Do,{asChild:!0,...a,focusable:!i,active:f,children:l.jsx(Dp,{disabled:i,required:s.required,checked:f,...c,...o,name:s.name,ref:d,onCheck:()=>s.onValueChange(o.value),onKeyDown:V(m=>{m.key==="Enter"&&m.preventDefault()}),onFocus:V(o.onFocus,()=>{var m;h.current&&((m=u.current)==null||m.click())})})})});Fp.displayName=Vp;var wE="RadioGroupIndicator",$p=p.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=Op(n);return l.jsx(jp,{...o,...r,ref:t})});$p.displayName=wE;var CE=Lp,fu=Fp,hu=$p;const SE=w.forwardRef(function({orientation:t="vertical",className:n,style:r,...o},s){return l.jsx(CE,{ref:s,className:n,style:{display:"flex",flexDirection:t==="horizontal"?"row":"column",gap:t==="horizontal"?16:8,...r},...o})}),RE=w.forwardRef(function({className:t,children:n,...r},o){return n?l.jsxs("label",{className:"control",children:[l.jsx(fu,{ref:o,className:_("radio",t),...r,children:l.jsx(hu,{})}),l.jsx("span",{children:n})]}):l.jsx(fu,{ref:o,className:_("radio",t),...r,children:l.jsx(hu,{})})});var qo="Switch",[TE]=Ce(qo),[PE,EE]=TE(qo),Bp=p.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:s,required:i,disabled:a,value:c="on",onCheckedChange:u,form:d,...f}=e,[h,m]=p.useState(null),y=te(t,C=>m(C)),g=p.useRef(!1),v=h?d||!!h.closest("form"):!0,[x,b]=be({prop:o,defaultProp:s??!1,onChange:u,caller:qo});return l.jsxs(PE,{scope:n,checked:x,disabled:a,children:[l.jsx(K.button,{type:"button",role:"switch","aria-checked":x,"aria-required":i,"data-state":Kp(x),"data-disabled":a?"":void 0,disabled:a,value:c,...f,ref:y,onClick:V(e.onClick,C=>{b(S=>!S),v&&(g.current=C.isPropagationStopped(),g.current||C.stopPropagation())})}),v&&l.jsx(Up,{control:h,bubbles:!g.current,name:r,value:c,checked:x,required:i,disabled:a,form:d,style:{transform:"translateX(-100%)"}})]})});Bp.displayName=qo;var Wp="SwitchThumb",Gp=p.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=EE(Wp,n);return l.jsx(K.span,{"data-state":Kp(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})});Gp.displayName=Wp;var ME="SwitchBubbleInput",Up=p.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...o},s)=>{const i=p.useRef(null),a=te(i,s),c=lr(n),u=ir(t);return p.useEffect(()=>{const d=i.current;if(!d)return;const f=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(f,"checked").set;if(c!==n&&m){const y=new Event("click",{bubbles:r});m.call(d,n),d.dispatchEvent(y)}},[c,n,r]),l.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:a,style:{...o.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Up.displayName=ME;function Kp(e){return e?"checked":"unchecked"}var pu=Bp,mu=Gp;const AE=w.forwardRef(function({className:t,children:n,...r},o){return n?l.jsxs("label",{className:"control",children:[l.jsx(pu,{ref:o,className:_("switch",t),...r,children:l.jsx(mu,{className:"switch-thumb"})}),l.jsx("span",{children:n})]}):l.jsx(pu,{ref:o,className:_("switch",t),...r,children:l.jsx(mu,{className:"switch-thumb"})})});function Jr(e){const t=new Date(e);return t.setHours(0,0,0,0),t}function gu(e){const t=new Date(e);return t.setHours(23,59,59,999),t}function _r(e,t){return!e||!t?!1:e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function Gs(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()}function DE(e,t){return e.getFullYear()===t.getFullYear()}function nt(e){return new Date(e.getFullYear(),e.getMonth(),1)}function NE(e){return new Date(e.getFullYear(),0,1)}function vu(e){return new Date(Math.floor(e.getFullYear()/10)*10,0,1)}function Or(e,t){const n=new Date(e);return n.setDate(1),n.setMonth(n.getMonth()+t),n}function yo(e,t){const n=new Date(e);return n.setDate(n.getDate()+t),n}function et(e,t){const n=new Date(e);return n.setFullYear(n.getFullYear()+t),n}function Us(e,t,n,r=0){const o=new Date(e);return o.setHours(t,n,r,0),o}function je(e,t,n){return t&&e.getTime()<t.getTime()?new Date(t):n&&e.getTime()>n.getTime()?new Date(n):e}function jE(e,t){const n=nt(e),r=(n.getDay()-t+7)%7,o=yo(n,-r);return Array.from({length:42},(s,i)=>yo(o,i))}function kE(e,t){const n=new Intl.DateTimeFormat(e,{weekday:"short"}),r=new Date(2024,0,7);return Array.from({length:7},(o,s)=>{const i=yo(r,(s+t)%7);return n.format(i)})}function IE(e,t="short"){const n=new Intl.DateTimeFormat(e,{month:t});return Array.from({length:12},(r,o)=>n.format(new Date(2024,o,1)))}function yu(e,t){return new Intl.DateTimeFormat(t,{month:"long",year:"numeric"}).format(e)}function _E(e,t){return new Intl.DateTimeFormat(t,{year:"numeric"}).format(e)}function OE(e,t){return new Intl.DateTimeFormat(t,{month:"long",year:"numeric"}).format(e)}function Hp(e,t){return new Intl.DateTimeFormat(t,{year:"numeric",month:"short",day:"numeric"}).format(e)}function zp(e,t,n,r){return new Intl.DateTimeFormat(t,{hour:"2-digit",minute:"2-digit",second:r?"2-digit":void 0,hour12:n}).format(e)}function LE(e,t,n,r){return`${Hp(e,t)} · ${zp(e,t,n,r)}`}function Lr(e){if(e==null||e==="")return null;if(e instanceof Date)return Number.isNaN(e.getTime())?null:new Date(e);const t=new Date(e);return Number.isNaN(t.getTime())?null:t}function Vr(e,t){return e.getTime()<t.getTime()}function Fr(e,t){return e.getTime()>t.getTime()}function $r(e){return e<10?`0${e}`:String(e)}function VE(e){return e||(typeof navigator<"u"&&navigator.language?navigator.language:"en-US")}function FE(e){try{return new Intl.DateTimeFormat(e,{hour:"numeric"}).resolvedOptions().hour12??!1}catch{return!1}}function $E(e,t,n,r,o){switch(t){case"year":return _E(e,n);case"month":return OE(e,n);case"time":return zp(e,n,r,o);case"datetime":return LE(e,n,r,o);case"date":default:return Hp(e,n)}}function BE(e,t){switch(t){case"year":return NE(e);case"month":return nt(e);case"date":return Jr(e);default:return new Date(e)}}const WE=w.forwardRef(function({mode:t="date",value:n,defaultValue:r,onChange:o,min:s,max:i,allow:a="any",disabledDate:c,disabledTime:u,placeholder:d,size:f,color:h="primary",disabled:m=!1,clearable:y=!0,locale:g,weekStartsOn:v=0,hour12:x,showSeconds:b=!1,minuteStep:C=1,secondStep:S=1,format:R,icon:P,required:T=!1,validate:A,error:k,onValidate:N,id:L,className:G,"aria-invalid":J,"aria-describedby":F,dialogLabel:Z,name:D,open:U,onOpenChange:j,...O},ne){const W=VE(g),M=x??FE(W),Y=w.useId(),z=L??`cny-dp-${Y}`,H=`${z}-dialog`,re=`${z}-hint`,I=w.useMemo(()=>{const E=Lr(s),$=a==="future"||a==="current"?Jr(new Date):null;return E&&$?E.getTime()>$.getTime()?E:$:E??$},[s,a]),B=w.useMemo(()=>{const E=Lr(i),$=a==="past"||a==="current"?gu(new Date):null;return E&&$?E.getTime()<$.getTime()?E:$:E??$},[i,a]),ee=n!==void 0,[se,ie]=w.useState(()=>Lr(r)),X=ee?Lr(n):se,Se=U!==void 0,[Be,Vt]=w.useState(!1),pe=Se?U:Be,De=w.useCallback(E=>{Se||Vt(E),j==null||j(E)},[Se,j]),vr=w.useMemo(()=>X??je(new Date,I,B),[X,I,B]),[ae,Ne]=w.useState(()=>nt(vr)),[fe,we]=w.useState(()=>vr),is=t==="month"?"month":t==="year"?"year":"date",[Oe,Ft]=w.useState(is),as=w.useRef(null);w.useImperativeHandle(ne,()=>as.current,[]);const In=w.useRef(null),cs=w.useRef(null),ac=w.useRef(null),ls=w.useRef(null),[Lg,Vg]=w.useState({}),[Fg,$g]=w.useState(!1);w.useEffect(()=>$g(!0),[]);const nn=w.useCallback(E=>I&&Vr(E,I)||B&&Fr(E,B)?!0:c?c(E):!1,[I,B,c]),yr=w.useCallback(E=>u?u(E):!1,[u]),rn=w.useMemo(()=>{if(k)return typeof k=="string"?k:"Invalid";if(T&&!X)return"Required";if(X){const $=Jr(new Date);if(a==="future"&&Vr(X,$))return"Must be today or later";if(a==="past"&&Fr(X,gu(new Date)))return"Must be today or earlier";if(a==="current"&&!_r(X,$))return"Must be today";if(I&&Vr(X,I))return"Too early";if(B&&Fr(X,B))return"Too late";if(c&&c(X))return"Unavailable date";if(u&&u(X))return"Unavailable time"}const E=A==null?void 0:A(X);return E||null},[k,T,X,a,I,B,c,u,A]),cc=w.useRef(null);w.useEffect(()=>{cc.current!==rn&&(cc.current=rn,N==null||N(rn))},[rn,N]);const xr=rn!==null,lc=xr?"danger":h,Bg=X?R?R(X,t):$E(X,t,W,M,b):"",Wg=d??{date:"Select date",month:"Select month",year:"Select year",time:"Select time",datetime:"Select date & time"}[t],Gg=Z??{date:"Choose date",month:"Choose month",year:"Choose year",time:"Choose time",datetime:"Choose date and time"}[t],mt=w.useCallback(E=>{ee||ie(E),o==null||o(E)},[ee,o]),br=w.useCallback(()=>{var E;De(!1),(E=In.current)==null||E.focus()},[De]),Ug=w.useCallback(E=>{var $;E.stopPropagation(),mt(null),($=In.current)==null||$.focus()},[mt]),uc=w.useCallback(()=>{if(m)return;const E=X??je(new Date,I,B);Ne(nt(E)),we(E),Ft(is),De(!0)},[m,X,I,B,De,is]);w.useEffect(()=>{if(!pe)return;const E=$=>{var ce,q;const oe=$.target;(ce=as.current)!=null&&ce.contains(oe)||(q=cs.current)!=null&&q.contains(oe)||De(!1)};return document.addEventListener("pointerdown",E,!0),()=>document.removeEventListener("pointerdown",E,!0)},[pe,De]);const wr=w.useCallback(()=>{const E=In.current,$=cs.current;if(!E||!$)return;const oe=E.getBoundingClientRect(),ce=$.offsetHeight||340,q=$.offsetWidth||264,Le=window.innerHeight,Ee=window.innerWidth,Ve=4,ve=8,gt=Le-oe.bottom,ds=oe.top,dv=gt<ce+Ve&&ds>gt?Math.max(ve,oe.top-Ve-ce):Math.min(Le-ce-ve,oe.bottom+Ve),fv=Math.max(ve,Math.min(oe.left,Ee-q-ve));Vg({position:"fixed",top:dv,left:fv,width:q})},[]);w.useLayoutEffect(()=>{pe&&wr()},[pe,t,wr]),w.useEffect(()=>{if(!pe)return;const E=()=>wr();return window.addEventListener("scroll",E,!0),window.addEventListener("resize",E),()=>{window.removeEventListener("scroll",E,!0),window.removeEventListener("resize",E)}},[pe,wr]),w.useEffect(()=>{var E,$;pe&&(Oe==="date"&&(t==="date"||t==="datetime")?(E=ac.current)==null||E.focus():(Oe==="month"||Oe==="year")&&(($=ls.current)==null||$.focus()))},[pe,fe,t,Oe]);const dc=w.useCallback(()=>{var E;Oe==="year"&&t!=="year"?Ft("month"):Oe==="month"&&t!=="month"?Ft("date"):(De(!1),(E=In.current)==null||E.focus())},[Oe,t,De]),Cr=w.useCallback(E=>{const $=je(E,I,B);we($),Ne(oe=>Gs(oe,$)?oe:nt($))},[I,B]),_n=w.useCallback((E,$)=>{const oe=BE(E,t);if(t!=="time"&&nn(oe))return;const ce=t==="time"||t==="datetime"?Us(oe,(X??E).getHours(),(X??E).getMinutes(),b?(X??E).getSeconds():0):oe;mt(ce),we(ce),(($==null?void 0:$.close)??(t!=="datetime"&&t!=="time"))&&br()},[t,nn,mt,X,b,br]),Sr=w.useCallback((E,$)=>{const oe=X??je(new Date,I,B),ce=E==="hour"?$:oe.getHours(),q=E==="minute"?$:oe.getMinutes(),Le=E==="second"?$:b?oe.getSeconds():0,Ee=Us(oe,ce,q,Le);yr(Ee)||(mt(Ee),we(Ee))},[X,I,B,b,yr,mt]),on=w.useCallback(E=>Cr(yo(fe,E)),[Cr,fe]),Kg=E=>{switch(E.key){case"ArrowLeft":E.preventDefault(),on(-1);break;case"ArrowRight":E.preventDefault(),on(1);break;case"ArrowUp":E.preventDefault(),on(-7);break;case"ArrowDown":E.preventDefault(),on(7);break;case"Home":{E.preventDefault();const $=(fe.getDay()-v+7)%7;on(-$);break}case"End":{E.preventDefault();const $=(fe.getDay()-v+7)%7;on(6-$);break}case"PageUp":E.preventDefault(),Cr(E.shiftKey?et(fe,-1):Or(fe,-1));break;case"PageDown":E.preventDefault(),Cr(E.shiftKey?et(fe,1):Or(fe,1));break;case"Enter":case" ":E.preventDefault(),_n(fe);break;case"Escape":E.preventDefault(),dc();break}},Hg=w.useMemo(()=>jE(ae,v),[ae,v]),zg=w.useMemo(()=>kE(W,v),[W,v]),Yg=w.useMemo(()=>IE(W,"short"),[W]),us=w.useMemo(()=>Jr(new Date),[]),Xg=!I||!Vr(nt(ae),nt(I)),qg=!B||!Fr(nt(ae),nt(B)),Zg=!I||ae.getFullYear()-1>=I.getFullYear(),Qg=!B||ae.getFullYear()+1<=B.getFullYear(),$t=vu(ae).getFullYear(),Jg=!I||$t-10+9>=I.getFullYear(),ev=!B||$t+10<=B.getFullYear(),tv=t==="time"?!yr(new Date):!nn(us),nv=()=>{if(t==="time"){const E=new Date;if(yr(E))return;const oe=Us(X??E,E.getHours(),E.getMinutes(),b?E.getSeconds():0);mt(oe),we(oe);return}_n(us,{close:t!=="datetime"})},rv=_("cny-datepicker-trigger","input",lc!=="primary"&&lc,f==="sm"||f==="lg"?f:null,X&&"has-value",pe&&"is-open"),ov=P??(t==="time"?l.jsx(yS,{size:15}):l.jsx(nS,{size:15})),fc=(E,$)=>{let ce=!0;switch(E.key){case"ArrowLeft":we($==="month"?q=>je(new Date(ae.getFullYear(),(q.getMonth()+11)%12,Math.min(q.getDate(),28)),I,B):q=>je(new Date(q.getFullYear()-1,q.getMonth(),Math.min(q.getDate(),28)),I,B));break;case"ArrowRight":we($==="month"?q=>je(new Date(ae.getFullYear(),(q.getMonth()+1)%12,Math.min(q.getDate(),28)),I,B):q=>je(new Date(q.getFullYear()+1,q.getMonth(),Math.min(q.getDate(),28)),I,B));break;case"ArrowUp":we($==="month"?q=>je(new Date(ae.getFullYear(),(q.getMonth()-3+12)%12,Math.min(q.getDate(),28)),I,B):q=>je(new Date(q.getFullYear()-3,q.getMonth(),Math.min(q.getDate(),28)),I,B));break;case"ArrowDown":we($==="month"?q=>je(new Date(ae.getFullYear(),(q.getMonth()+3)%12,Math.min(q.getDate(),28)),I,B):q=>je(new Date(q.getFullYear()+3,q.getMonth(),Math.min(q.getDate(),28)),I,B));break;case"PageUp":Ne($==="month"?q=>et(q,E.shiftKey?-10:-1):q=>et(q,E.shiftKey?-100:-10));break;case"PageDown":Ne($==="month"?q=>et(q,E.shiftKey?10:1):q=>et(q,E.shiftKey?100:10));break;case"Enter":case" ":$==="month"?hc(new Date(ae.getFullYear(),fe.getMonth(),1)):pc(fe.getFullYear());break;case"Escape":dc();break;default:ce=!1}ce&&E.preventDefault()};w.useEffect(()=>{if(pe&&Oe==="year"){const E=vu(ae).getFullYear(),$=fe.getFullYear();($<E-1||$>E+10)&&Ne(new Date($,0,1))}},[pe,Oe,fe,ae]);const hc=E=>{t==="month"?_n(E):(Ne(nt(E)),we(je(E,I,B)),Ft("date"))},pc=E=>{if(t==="year")_n(new Date(E,0,1));else{const $=new Date(E,ae.getMonth(),1);Ne($),we(je(new Date(E,fe.getMonth(),Math.min(fe.getDate(),28)),I,B)),Ft("month")}},sv=()=>{const E=fe.getMonth();return Yg.map(($,oe)=>{const ce=new Date(ae.getFullYear(),oe,1),q=!!X&&Gs(ce,X)&&DE(ce,X),Le=ce.getMonth()===ae.getMonth()&&t!=="month",Ee=oe===E,Ve=nn(ce);return l.jsx("button",{ref:Ee?ls:void 0,type:"button",tabIndex:Ee?0:-1,className:_("cny-datepicker-chip",q&&"is-selected",Le&&!q&&"is-current"),disabled:Ve,onClick:()=>hc(ce),onFocus:()=>we(new Date(ae.getFullYear(),oe,Math.min(fe.getDate(),28))),children:$},oe)})},iv=()=>{const E=$t-1,$=fe.getFullYear();return Array.from({length:12},(oe,ce)=>{const q=E+ce,Le=new Date(q,0,1),Ee=!!X&&X.getFullYear()===q,Ve=q===ae.getFullYear()&&t!=="year",ve=q===$,gt=nn(Le),ds=q<$t||q>=$t+10;return l.jsx("button",{ref:ve?ls:void 0,type:"button",tabIndex:ve?0:-1,className:_("cny-datepicker-chip",Ee&&"is-selected",Ve&&!Ee&&"is-current",ds&&"is-outside"),disabled:gt,onClick:()=>pc(q),onFocus:()=>we(new Date(q,fe.getMonth(),Math.min(fe.getDate(),28))),children:q},q)})},av=w.useRef(null),mc=w.useRef(null),gc=w.useRef(null),vc=()=>{const E=X??je(new Date,I,B),$=E.getHours(),oe=E.getMinutes(),ce=E.getSeconds(),q=$>=12,Le=M?$%12===0?12:$%12:$,Ee=ve=>{const gt=M?q?ve===12?12:ve+12:ve===12?0:ve:ve;Sr("hour",gt)},Ve=ve=>{const gt=ve?$<12?$+12:$:$>=12?$-12:$;Sr("hour",gt)};return l.jsx("div",{className:"cny-dp-time",children:l.jsxs("div",{className:"cny-dp-time-row",children:[l.jsx(Ks,{ref:av,ariaLabel:"Hour",value:Le,min:M?1:0,max:M?12:23,step:1,nextRef:mc,onChange:Ee}),l.jsx("span",{className:"cny-dp-time-sep","aria-hidden":"true",children:":"}),l.jsx(Ks,{ref:mc,ariaLabel:"Minute",value:oe-oe%Math.max(1,C),min:0,max:59,step:Math.max(1,C),nextRef:b?gc:void 0,onChange:ve=>Sr("minute",ve)}),b&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"cny-dp-time-sep","aria-hidden":"true",children:":"}),l.jsx(Ks,{ref:gc,ariaLabel:"Second",value:ce-ce%Math.max(1,S),min:0,max:59,step:Math.max(1,S),onChange:ve=>Sr("second",ve)})]}),M&&l.jsxs("div",{className:"cny-dp-ampm",role:"radiogroup","aria-label":"AM or PM",children:[l.jsx("button",{type:"button",role:"radio","aria-checked":!q,className:_("cny-dp-ampm-btn",!q&&"is-active"),onClick:()=>Ve(!1),children:"AM"}),l.jsx("button",{type:"button",role:"radio","aria-checked":q,className:_("cny-dp-ampm-btn",q&&"is-active"),onClick:()=>Ve(!0),children:"PM"})]})]})})},cv=()=>l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"cny-datepicker-header",children:[l.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Previous month",disabled:!Xg,onClick:()=>Ne(E=>Or(E,-1)),children:l.jsx(Xr,{size:16,"aria-hidden":"true"})}),l.jsx("button",{type:"button",className:"cny-datepicker-title is-clickable","aria-label":`Switch to month picker (currently ${yu(ae,W)})`,onClick:()=>Ft("month"),children:yu(ae,W)}),l.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Next month",disabled:!qg,onClick:()=>Ne(E=>Or(E,1)),children:l.jsx(gn,{size:16,"aria-hidden":"true"})})]}),l.jsxs("div",{role:"grid",className:"cny-datepicker-grid",onKeyDown:Kg,children:[l.jsx("div",{role:"row",className:"cny-datepicker-weekdays",children:zg.map((E,$)=>l.jsx("span",{role:"columnheader","aria-label":E,className:"cny-datepicker-weekday",children:E.slice(0,2)},$))}),Array.from({length:6},(E,$)=>l.jsx("div",{role:"row",className:"cny-datepicker-row",children:Hg.slice($*7,$*7+7).map(oe=>{const ce=!Gs(oe,ae),q=_r(oe,X),Le=_r(oe,us),Ee=_r(oe,fe),Ve=nn(oe);return l.jsx("button",{ref:Ee?ac:void 0,type:"button",role:"gridcell",tabIndex:Ee?0:-1,"aria-selected":q,"aria-current":Le?"date":void 0,"aria-disabled":Ve||void 0,disabled:Ve,className:_("cny-datepicker-cell",ce&&"is-outside",q&&"is-selected",Le&&"is-today"),onClick:()=>_n(oe),onFocus:()=>we(oe),children:oe.getDate()},oe.toISOString())})},$))]})]}),lv=()=>l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"cny-datepicker-header",children:[l.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Previous year",disabled:!Zg,onClick:()=>Ne(E=>et(E,-1)),children:l.jsx(Xr,{size:16,"aria-hidden":"true"})}),l.jsx("button",{type:"button",className:"cny-datepicker-title is-clickable","aria-label":`Switch to year picker (currently ${ae.getFullYear()})`,onClick:()=>Ft("year"),children:ae.getFullYear()}),l.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Next year",disabled:!Qg,onClick:()=>Ne(E=>et(E,1)),children:l.jsx(gn,{size:16,"aria-hidden":"true"})})]}),l.jsx("div",{role:"grid","aria-label":"Month picker",className:"cny-datepicker-chip-grid",onKeyDown:E=>fc(E,"month"),children:sv()})]}),uv=()=>l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"cny-datepicker-header",children:[l.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Previous decade",disabled:!Jg,onClick:()=>Ne(E=>et(E,-10)),children:l.jsx(Xr,{size:16,"aria-hidden":"true"})}),l.jsx("span",{className:"cny-datepicker-title",children:`${$t} – ${$t+9}`}),l.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Next decade",disabled:!ev,onClick:()=>Ne(E=>et(E,10)),children:l.jsx(gn,{size:16,"aria-hidden":"true"})})]}),l.jsx("div",{role:"grid","aria-label":"Year picker",className:"cny-datepicker-chip-grid",onKeyDown:E=>fc(E,"year"),children:iv()})]});return l.jsxs("div",{ref:as,className:_("cny-datepicker",`mode-${t}`,m&&"is-disabled",G),...O,children:[D&&l.jsx("input",{type:"hidden",name:D,value:X?X.toISOString():"",readOnly:!0}),l.jsxs("button",{ref:In,type:"button",id:z,className:rv,"aria-haspopup":"dialog","aria-expanded":pe,"aria-controls":pe?H:void 0,"aria-invalid":J||xr,"aria-describedby":_(F,xr?re:void 0)||void 0,"aria-required":T||void 0,disabled:m,onClick:uc,onKeyDown:E=>{E.key==="ArrowDown"||E.key==="Enter"||E.key===" "?(E.preventDefault(),uc()):E.key==="Escape"&&pe&&(E.preventDefault(),De(!1))},children:[l.jsx("span",{className:"cny-datepicker-icon","aria-hidden":"true",children:ov}),l.jsx("span",{className:_("cny-datepicker-value",!X&&"is-placeholder"),children:Bg||Wg}),y&&X&&!m&&l.jsx("span",{role:"button",tabIndex:-1,className:"cny-datepicker-clear","aria-label":"Clear",onClick:Ug,onPointerDown:E=>E.stopPropagation(),children:l.jsx(jt,{size:13,"aria-hidden":"true"})})]}),xr&&k!==!1&&l.jsx("span",{id:re,className:"cny-datepicker-error",role:"alert",children:typeof k=="string"?k:k??rn}),pe&&Fg&&Co.createPortal(l.jsxs("div",{ref:cs,id:H,role:"dialog","aria-modal":"false","aria-label":Gg,className:_("cny-datepicker-panel",`is-${t}`),style:Lg,children:[l.jsxs("div",{className:"cny-datepicker-body",children:[(t==="date"||t==="datetime")&&Oe==="date"&&cv(),(t==="date"||t==="datetime"||t==="month")&&Oe==="month"&&lv(),(t==="date"||t==="datetime"||t==="month"||t==="year")&&Oe==="year"&&uv(),t==="time"&&vc(),t==="datetime"&&Oe==="date"&&vc()]}),l.jsxs("div",{className:"cny-datepicker-footer",children:[l.jsx("button",{type:"button",className:"cny-datepicker-action",disabled:!tv,onClick:nv,children:t==="time"?"Now":t==="year"?"This year":t==="month"?"This month":"Today"}),l.jsx("div",{className:"cny-datepicker-footer-spacer"}),y&&X&&l.jsx("button",{type:"button",className:"cny-datepicker-action",onClick:()=>{mt(null),br()},children:"Clear"}),(t==="datetime"||t==="time")&&l.jsx("button",{type:"button",className:"cny-datepicker-action is-primary",onClick:br,children:"Done"})]})]}),document.body)]})}),Ks=w.forwardRef(function({value:t,min:n,max:r,step:o,ariaLabel:s,nextRef:i,onChange:a},c){const u=w.useRef(null);w.useImperativeHandle(c,()=>u.current,[]);const[d,f]=w.useState(()=>$r(t)),h=w.useRef(!1);w.useEffect(()=>{h.current||f($r(t))},[t]);const m=w.useCallback(x=>{if(!Number.isFinite(x))return;let b=Math.max(n,Math.min(r,x));b=Math.round(b/o)*o,b>r&&(b=Math.floor(r/o)*o),a(b),f($r(b))},[n,r,o,a]),y=()=>{const x=t+o;m(x>r?n:x)},g=()=>{const x=t-o;m(x<n?Math.floor(r/o)*o:x)},v=x=>{switch(x.key){case"ArrowUp":x.preventDefault(),y();break;case"ArrowDown":x.preventDefault(),g();break;case"PageUp":x.preventDefault(),m(t+o*5);break;case"PageDown":x.preventDefault(),m(t-o*5);break;case"Home":x.preventDefault(),m(n);break;case"End":x.preventDefault(),m(r);break;case"Enter":x.preventDefault(),m(parseInt(d,10));break}};return l.jsxs("div",{className:"cny-dp-timefield",onWheel:x=>{document.activeElement===u.current&&(x.preventDefault(),x.deltaY<0?y():x.deltaY>0&&g())},children:[l.jsx("input",{ref:u,type:"text",inputMode:"numeric",pattern:"[0-9]*",maxLength:2,className:"cny-dp-timefield-input",value:d,"aria-label":s,"aria-valuenow":t,"aria-valuemin":n,"aria-valuemax":r,onFocus:x=>{h.current=!0,x.target.select()},onChange:x=>{var C;const b=x.target.value.replace(/[^0-9]/g,"").slice(0,2);if(f(b),b.length===2){const S=parseInt(b,10);Number.isFinite(S)&&S>=n&&S<=r&&(m(S),(C=i==null?void 0:i.current)==null||C.focus())}},onBlur:()=>{h.current=!1;const x=parseInt(d,10);Number.isFinite(x)?m(x):f($r(t))},onKeyDown:v}),l.jsxs("div",{className:"cny-dp-timefield-controls",children:[l.jsx("button",{type:"button",className:"cny-dp-timefield-btn","aria-label":`Increment ${s.toLowerCase()}`,tabIndex:-1,onClick:y,onMouseDown:x=>x.preventDefault(),children:l.jsx(cS,{size:10,"aria-hidden":"true"})}),l.jsx("button",{type:"button",className:"cny-dp-timefield-btn","aria-label":`Decrement ${s.toLowerCase()}`,tabIndex:-1,onClick:g,onMouseDown:x=>x.preventDefault(),children:l.jsx(No,{size:10,"aria-hidden":"true"})})]})]})});function GE({hotkey:e=!0}={}){const[t,n]=w.useState(!1);return w.useEffect(()=>{if(!e)return;const r=o=>{o.key==="k"&&(o.metaKey||o.ctrlKey)&&(o.preventDefault(),n(s=>!s))};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[e]),{open:t,setOpen:n,toggle:()=>n(r=>!r)}}function UE({open:e,onOpenChange:t,sections:n,placeholder:r="Search…",title:o="Command palette",description:s="Search and navigate. Use arrow keys to move, Enter to open, Escape to dismiss.",emptyText:i="No matches found.",footer:a,onItemSelect:c,contentClassName:u}){const d=f=>{var h;f.disabled||((h=f.onSelect)==null||h.call(f),c==null||c(f),t(!1))};return l.jsxs(xe.Dialog,{open:e,onOpenChange:t,label:o,contentClassName:_("cny-cmdk-content",u),children:[l.jsxs(Ra,{children:[l.jsx(Va,{children:o}),l.jsx(Fa,{children:s})]}),l.jsxs("div",{className:"cny-cmdk-header",children:[l.jsx(Nf,{size:16,"aria-hidden":"true"}),l.jsx(xe.Input,{placeholder:r}),l.jsx("kbd",{className:"cny-cmdk-esc",children:"Esc"})]}),l.jsxs(xe.List,{className:"cny-cmdk-list",children:[l.jsx(xe.Empty,{className:"cny-cmdk-empty",children:i}),n.map(f=>l.jsx(xe.Group,{heading:f.title,className:"cny-cmdk-group",children:f.items.map(h=>{var m;return l.jsxs(xe.Item,{value:`${f.title} ${h.label} ${((m=h.keywords)==null?void 0:m.join(" "))??""}`,disabled:h.disabled,onSelect:()=>d(h),className:"cny-cmdk-item",children:[h.icon&&l.jsx("span",{className:"cny-cmdk-item-icon",children:h.icon}),l.jsx("span",{className:"cny-cmdk-item-label",children:h.label}),h.badge&&l.jsx("span",{className:"cny-cmdk-item-badge",children:h.badge}),h.hint&&l.jsx("span",{className:"cny-cmdk-item-hint",children:h.hint})]},h.id)})},f.title))]}),a!==!1&&l.jsx("div",{className:"cny-cmdk-footer",children:a??l.jsxs(l.Fragment,{children:[l.jsx("kbd",{children:"↑↓"})," navigate",l.jsx("kbd",{children:"↵"})," open",l.jsx("kbd",{children:"Esc"})," dismiss"]})})]})}function KE({onClick:e,label:t="Search…",shortcut:n="⌘K",className:r}){return l.jsxs("button",{type:"button",onClick:e,className:_("cny-cmdk-trigger",r),"aria-label":"Open command palette",children:[l.jsx(Nf,{size:14,"aria-hidden":"true"}),l.jsx("span",{className:"cny-cmdk-trigger-label",children:t}),l.jsx("kbd",{className:"cny-cmdk-trigger-kbd",children:n})]})}let HE=0;const zE=()=>`cny-toast-${Date.now().toString(36)}-${++HE}`,Yp=w.createContext(null),YE={default:null,success:l.jsx(pS,{size:16,"aria-hidden":"true"}),info:l.jsx(PS,{size:16,"aria-hidden":"true"}),warning:l.jsx(NS,{size:16,"aria-hidden":"true"}),danger:l.jsx(fS,{size:16,"aria-hidden":"true"}),loading:l.jsx(Df,{size:16,"aria-hidden":"true",className:"cny-toast-spin"})};function XE({children:e,position:t="bottom-right",defaultDuration:n=5e3,maxToasts:r=5,offset:o="1rem"}){const[s,i]=w.useState([]),[a,c]=w.useState(!1);w.useEffect(()=>c(!0),[]);const u=w.useCallback(g=>{i(v=>v.map(x=>g==null||x.id===g?{...x,exiting:!0}:x)),window.setTimeout(()=>{i(v=>v.filter(x=>g==null?!1:x.id!==g||!x.exiting)),i(v=>(v.filter(x=>x.exiting&&(g==null||x.id===g)).forEach(x=>{var b;return(b=x.onDismiss)==null?void 0:b.call(x)}),v.filter(x=>!x.exiting||g!=null&&x.id!==g)))},200)},[]),d=w.useCallback(g=>{const v=g.id??zE(),x={id:v,title:g.title,description:g.description,action:g.action,icon:g.icon,variant:g.variant??"default",duration:g.duration??n,dismissible:g.dismissible??!0,onDismiss:g.onDismiss};return i(b=>{const S=[...b.filter(R=>R.id!==v),x];return S.length>r?S.slice(S.length-r):S}),v},[n,r]),f=w.useCallback((g,v)=>{i(x=>x.map(b=>b.id===g?{...b,...v,variant:v.variant??b.variant,duration:v.duration??b.duration,dismissible:v.dismissible??b.dismissible}:b))},[]),h=w.useMemo(()=>{const g=(v=>d(typeof v=="string"?{title:v}:v));return g.success=(v,x)=>d({...x,title:v,variant:"success"}),g.info=(v,x)=>d({...x,title:v,variant:"info"}),g.warning=(v,x)=>d({...x,title:v,variant:"warning"}),g.error=(v,x)=>d({...x,title:v,variant:"danger"}),g.loading=(v,x)=>d({...x,title:v,variant:"loading",duration:(x==null?void 0:x.duration)??1/0}),g},[d]),m=w.useMemo(()=>({toast:h,dismiss:u,update:f}),[h,u,f]),y=t.startsWith("top-");return l.jsxs(Yp.Provider,{value:m,children:[e,a&&Co.createPortal(l.jsx("ol",{className:_("cny-toast-viewport",`pos-${t}`),style:{"--cny-toast-offset":o},"aria-live":"polite","aria-relevant":"additions",tabIndex:-1,children:(y?[...s].reverse():s).map(g=>l.jsx(qE,{toast:g,onDismiss:()=>u(g.id)},g.id))}),document.body)]})}function qE({toast:e,onDismiss:t}){const{variant:n,title:r,description:o,action:s,icon:i,duration:a,dismissible:c}=e,[u,d]=w.useState(!1),f=w.useRef(null);w.useEffect(()=>{if(!e.exiting&&!(!Number.isFinite(a)||a<0)&&!u)return f.current=setTimeout(t,a),()=>{f.current&&clearTimeout(f.current)}},[u,a,t,e.exiting]);const h=n==="danger"||n==="warning"?"alert":"status",m=i!==!1,y=i!==void 0&&i!==!1?i:YE[n];return l.jsxs("li",{role:h,"aria-atomic":"true",className:_("cny-toast",n,e.exiting&&"is-exiting"),onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),onFocus:()=>d(!0),onBlur:()=>d(!1),children:[m&&y&&l.jsx("span",{className:"cny-toast-icon","aria-hidden":"true",children:y}),l.jsxs("div",{className:"cny-toast-body",children:[r!=null&&l.jsx("p",{className:"cny-toast-title",children:r}),o!=null&&l.jsx("p",{className:"cny-toast-description",children:o})]}),s!=null&&l.jsx("div",{className:"cny-toast-action",children:s}),c&&l.jsx("button",{type:"button",className:"cny-toast-close","aria-label":"Dismiss",onClick:t,children:l.jsx(jt,{size:14,"aria-hidden":"true"})})]})}function ZE(){const e=w.useContext(Yp);if(!e)throw new Error("useToast() must be called inside a <ToastProvider>. Wrap your app at the root.");return e}const QE=w.forwardRef(function({title:t,description:n,children:r,footer:o,size:s="md",hideClose:i,className:a,...c},u){return l.jsx(Ia,{...c,children:l.jsxs(_a,{children:[l.jsx(Oa,{className:"cny-dialog-overlay"}),l.jsxs(La,{ref:u,className:_("cny-dialog-content",`size-${s}`,a),children:[l.jsxs("header",{className:"cny-dialog-header",children:[l.jsxs("div",{className:"cny-dialog-titles",children:[l.jsx(Va,{className:"cny-dialog-title",children:t}),n&&l.jsx(Fa,{className:"cny-dialog-description",children:n})]}),!i&&l.jsx(Ho,{className:"cny-dialog-close","aria-label":"Close dialog",children:l.jsx(jt,{size:16,"aria-hidden":"true"})})]}),r!=null&&l.jsx("div",{className:"cny-dialog-body",children:r}),o!=null&&l.jsx("footer",{className:"cny-dialog-footer",children:o})]})]})})}),JE=mp,eM=Ho,tM=w.forwardRef(function({title:t,description:n,children:r,footer:o,side:s="right",size:i="md",hideClose:a,className:c,...u},d){return l.jsx(Ia,{...u,children:l.jsxs(_a,{children:[l.jsx(Oa,{className:"cny-drawer-overlay"}),l.jsxs(La,{ref:d,className:_("cny-drawer-content",`side-${s}`,`size-${i}`,c),children:[l.jsxs("header",{className:"cny-drawer-header",children:[l.jsxs("div",{className:"cny-drawer-titles",children:[l.jsx(Va,{className:"cny-drawer-title",children:t}),n&&l.jsx(Fa,{className:"cny-drawer-description",children:n})]}),!a&&l.jsx(Ho,{className:"cny-drawer-close","aria-label":"Close drawer",children:l.jsx(jt,{size:16,"aria-hidden":"true"})})]}),r!=null&&l.jsx("div",{className:"cny-drawer-body",children:r}),o!=null&&l.jsx("footer",{className:"cny-drawer-footer",children:o})]})]})})}),nM=mp,rM=Ho;var ji=["Enter"," "],oM=["ArrowDown","PageUp","Home"],Xp=["ArrowUp","PageDown","End"],sM=[...oM,...Xp],iM={ltr:[...ji,"ArrowRight"],rtl:[...ji,"ArrowLeft"]},aM={ltr:["ArrowLeft"],rtl:["ArrowRight"]},hr="Menu",[Xn,cM,lM]=nr(hr),[tn,qp]=Ce(hr,[lM,kt,Dt]),pr=kt(),Zp=Dt(),[Qp,Lt]=tn(hr),[uM,mr]=tn(hr),Jp=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:i=!0}=e,a=pr(t),[c,u]=p.useState(null),d=p.useRef(!1),f=Xe(s),h=At(o);return p.useEffect(()=>{const m=()=>{d.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},y=()=>d.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),l.jsx(ar,{...a,children:l.jsx(Qp,{scope:t,open:n,onOpenChange:f,content:c,onContentChange:u,children:l.jsx(uM,{scope:t,onClose:p.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:h,modal:i,children:r})})})};Jp.displayName=hr;var dM="MenuAnchor",Ga=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=pr(n);return l.jsx(cr,{...o,...r,ref:t})});Ga.displayName=dM;var Ua="MenuPortal",[fM,em]=tn(Ua,{forceMount:void 0}),tm=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=Lt(Ua,t);return l.jsx(fM,{scope:t,forceMount:n,children:l.jsx(Me,{present:n||s.open,children:l.jsx(Nn,{asChild:!0,container:o,children:r})})})};tm.displayName=Ua;var Ue="MenuContent",[hM,Ka]=tn(Ue),nm=p.forwardRef((e,t)=>{const n=em(Ue,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=Lt(Ue,e.__scopeMenu),i=mr(Ue,e.__scopeMenu);return l.jsx(Xn.Provider,{scope:e.__scopeMenu,children:l.jsx(Me,{present:r||s.open,children:l.jsx(Xn.Slot,{scope:e.__scopeMenu,children:i.modal?l.jsx(pM,{...o,ref:t}):l.jsx(mM,{...o,ref:t})})})})}),pM=p.forwardRef((e,t)=>{const n=Lt(Ue,e.__scopeMenu),r=p.useRef(null),o=te(t,r);return p.useEffect(()=>{const s=r.current;if(s)return Fo(s)},[]),l.jsx(Ha,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:V(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),mM=p.forwardRef((e,t)=>{const n=Lt(Ue,e.__scopeMenu);return l.jsx(Ha,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),gM=Yt("MenuContent.ScrollLock"),Ha=p.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,onDismiss:m,disableOutsideScroll:y,...g}=e,v=Lt(Ue,n),x=mr(Ue,n),b=pr(n),C=Zp(n),S=cM(n),[R,P]=p.useState(null),T=p.useRef(null),A=te(t,T,v.onContentChange),k=p.useRef(0),N=p.useRef(""),L=p.useRef(0),G=p.useRef(null),J=p.useRef("right"),F=p.useRef(0),Z=y?ur:p.Fragment,D=y?{as:gM,allowPinchZoom:!0}:void 0,U=O=>{var I,B;const ne=N.current+O,W=S().filter(ee=>!ee.disabled),M=document.activeElement,Y=(I=W.find(ee=>ee.ref.current===M))==null?void 0:I.textValue,z=W.map(ee=>ee.textValue),H=MM(z,ne,Y),re=(B=W.find(ee=>ee.textValue===H))==null?void 0:B.ref.current;(function ee(se){N.current=se,window.clearTimeout(k.current),se!==""&&(k.current=window.setTimeout(()=>ee(""),1e3))})(ne),re&&setTimeout(()=>re.focus())};p.useEffect(()=>()=>window.clearTimeout(k.current),[]),jo();const j=p.useCallback(O=>{var W,M;return J.current===((W=G.current)==null?void 0:W.side)&&DM(O,(M=G.current)==null?void 0:M.area)},[]);return l.jsx(hM,{scope:n,searchRef:N,onItemEnter:p.useCallback(O=>{j(O)&&O.preventDefault()},[j]),onItemLeave:p.useCallback(O=>{var ne;j(O)||((ne=T.current)==null||ne.focus(),P(null))},[j]),onTriggerLeave:p.useCallback(O=>{j(O)&&O.preventDefault()},[j]),pointerGraceTimerRef:L,onPointerGraceIntentChange:p.useCallback(O=>{G.current=O},[]),children:l.jsx(Z,{...D,children:l.jsx(or,{asChild:!0,trapped:o,onMountAutoFocus:V(s,O=>{var ne;O.preventDefault(),(ne=T.current)==null||ne.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:l.jsx(Mn,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,onDismiss:m,children:l.jsx(Ao,{asChild:!0,...C,dir:x.dir,orientation:"vertical",loop:r,currentTabStopId:R,onCurrentTabStopIdChange:P,onEntryFocus:V(c,O=>{x.isUsingKeyboardRef.current||O.preventDefault()}),preventScrollOnEntryFocus:!0,children:l.jsx(Lo,{role:"menu","aria-orientation":"vertical","data-state":xm(v.open),"data-radix-menu-content":"",dir:x.dir,...b,...g,ref:A,style:{outline:"none",...g.style},onKeyDown:V(g.onKeyDown,O=>{const W=O.target.closest("[data-radix-menu-content]")===O.currentTarget,M=O.ctrlKey||O.altKey||O.metaKey,Y=O.key.length===1;W&&(O.key==="Tab"&&O.preventDefault(),!M&&Y&&U(O.key));const z=T.current;if(O.target!==z||!sM.includes(O.key))return;O.preventDefault();const re=S().filter(I=>!I.disabled).map(I=>I.ref.current);Xp.includes(O.key)&&re.reverse(),PM(re)}),onBlur:V(e.onBlur,O=>{O.currentTarget.contains(O.target)||(window.clearTimeout(k.current),N.current="")}),onPointerMove:V(e.onPointerMove,qn(O=>{const ne=O.target,W=F.current!==O.clientX;if(O.currentTarget.contains(ne)&&W){const M=O.clientX>F.current?"right":"left";J.current=M,F.current=O.clientX}}))})})})})})})});nm.displayName=Ue;var vM="MenuGroup",za=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return l.jsx(K.div,{role:"group",...r,ref:t})});za.displayName=vM;var yM="MenuLabel",rm=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return l.jsx(K.div,{...r,ref:t})});rm.displayName=yM;var xo="MenuItem",xu="menu.itemSelect",Zo=p.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,s=p.useRef(null),i=mr(xo,e.__scopeMenu),a=Ka(xo,e.__scopeMenu),c=te(t,s),u=p.useRef(!1),d=()=>{const f=s.current;if(!n&&f){const h=new CustomEvent(xu,{bubbles:!0,cancelable:!0});f.addEventListener(xu,m=>r==null?void 0:r(m),{once:!0}),mf(f,h),h.defaultPrevented?u.current=!1:i.onClose()}};return l.jsx(om,{...o,ref:c,disabled:n,onClick:V(e.onClick,d),onPointerDown:f=>{var h;(h=e.onPointerDown)==null||h.call(e,f),u.current=!0},onPointerUp:V(e.onPointerUp,f=>{var h;u.current||(h=f.currentTarget)==null||h.click()}),onKeyDown:V(e.onKeyDown,f=>{const h=a.searchRef.current!=="";n||h&&f.key===" "||ji.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});Zo.displayName=xo;var om=p.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...s}=e,i=Ka(xo,n),a=Zp(n),c=p.useRef(null),u=te(t,c),[d,f]=p.useState(!1),[h,m]=p.useState("");return p.useEffect(()=>{const y=c.current;y&&m((y.textContent??"").trim())},[s.children]),l.jsx(Xn.ItemSlot,{scope:n,disabled:r,textValue:o??h,children:l.jsx(Do,{asChild:!0,...a,focusable:!r,children:l.jsx(K.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:u,onPointerMove:V(e.onPointerMove,qn(y=>{r?i.onItemLeave(y):(i.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:V(e.onPointerLeave,qn(y=>i.onItemLeave(y))),onFocus:V(e.onFocus,()=>f(!0)),onBlur:V(e.onBlur,()=>f(!1))})})})}),xM="MenuCheckboxItem",sm=p.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return l.jsx(um,{scope:e.__scopeMenu,checked:n,children:l.jsx(Zo,{role:"menuitemcheckbox","aria-checked":bo(n)?"mixed":n,...o,ref:t,"data-state":qa(n),onSelect:V(o.onSelect,()=>r==null?void 0:r(bo(n)?!0:!n),{checkForDefaultPrevented:!1})})})});sm.displayName=xM;var im="MenuRadioGroup",[bM,wM]=tn(im,{value:void 0,onValueChange:()=>{}}),am=p.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,s=Xe(r);return l.jsx(bM,{scope:e.__scopeMenu,value:n,onValueChange:s,children:l.jsx(za,{...o,ref:t})})});am.displayName=im;var cm="MenuRadioItem",lm=p.forwardRef((e,t)=>{const{value:n,...r}=e,o=wM(cm,e.__scopeMenu),s=n===o.value;return l.jsx(um,{scope:e.__scopeMenu,checked:s,children:l.jsx(Zo,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":qa(s),onSelect:V(r.onSelect,()=>{var i;return(i=o.onValueChange)==null?void 0:i.call(o,n)},{checkForDefaultPrevented:!1})})})});lm.displayName=cm;var Ya="MenuItemIndicator",[um,CM]=tn(Ya,{checked:!1}),dm=p.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,s=CM(Ya,n);return l.jsx(Me,{present:r||bo(s.checked)||s.checked===!0,children:l.jsx(K.span,{...o,ref:t,"data-state":qa(s.checked)})})});dm.displayName=Ya;var SM="MenuSeparator",fm=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return l.jsx(K.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});fm.displayName=SM;var RM="MenuArrow",hm=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=pr(n);return l.jsx(Vo,{...o,...r,ref:t})});hm.displayName=RM;var Xa="MenuSub",[TM,pm]=tn(Xa),mm=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:o}=e,s=Lt(Xa,t),i=pr(t),[a,c]=p.useState(null),[u,d]=p.useState(null),f=Xe(o);return p.useEffect(()=>(s.open===!1&&f(!1),()=>f(!1)),[s.open,f]),l.jsx(ar,{...i,children:l.jsx(Qp,{scope:t,open:r,onOpenChange:f,content:u,onContentChange:d,children:l.jsx(TM,{scope:t,contentId:he(),triggerId:he(),trigger:a,onTriggerChange:c,children:n})})})};mm.displayName=Xa;var $n="MenuSubTrigger",gm=p.forwardRef((e,t)=>{const n=Lt($n,e.__scopeMenu),r=mr($n,e.__scopeMenu),o=pm($n,e.__scopeMenu),s=Ka($n,e.__scopeMenu),i=p.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:c}=s,u={__scopeMenu:e.__scopeMenu},d=p.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return p.useEffect(()=>d,[d]),p.useEffect(()=>{const f=a.current;return()=>{window.clearTimeout(f),c(null)}},[a,c]),l.jsx(Ga,{asChild:!0,...u,children:l.jsx(om,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":xm(n.open),...e,ref:dt(t,o.onTriggerChange),onClick:f=>{var h;(h=e.onClick)==null||h.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:V(e.onPointerMove,qn(f=>{s.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(s.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:V(e.onPointerLeave,qn(f=>{var m,y;d();const h=(m=n.content)==null?void 0:m.getBoundingClientRect();if(h){const g=(y=n.content)==null?void 0:y.dataset.side,v=g==="right",x=v?-5:5,b=h[v?"left":"right"],C=h[v?"right":"left"];s.onPointerGraceIntentChange({area:[{x:f.clientX+x,y:f.clientY},{x:b,y:h.top},{x:C,y:h.top},{x:C,y:h.bottom},{x:b,y:h.bottom}],side:g}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(f),f.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:V(e.onKeyDown,f=>{var m;const h=s.searchRef.current!=="";e.disabled||h&&f.key===" "||iM[r.dir].includes(f.key)&&(n.onOpenChange(!0),(m=n.content)==null||m.focus(),f.preventDefault())})})})});gm.displayName=$n;var vm="MenuSubContent",ym=p.forwardRef((e,t)=>{const n=em(Ue,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=Lt(Ue,e.__scopeMenu),i=mr(Ue,e.__scopeMenu),a=pm(vm,e.__scopeMenu),c=p.useRef(null),u=te(t,c);return l.jsx(Xn.Provider,{scope:e.__scopeMenu,children:l.jsx(Me,{present:r||s.open,children:l.jsx(Xn.Slot,{scope:e.__scopeMenu,children:l.jsx(Ha,{id:a.contentId,"aria-labelledby":a.triggerId,...o,ref:u,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var f;i.isUsingKeyboardRef.current&&((f=c.current)==null||f.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:V(e.onFocusOutside,d=>{d.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:V(e.onEscapeKeyDown,d=>{i.onClose(),d.preventDefault()}),onKeyDown:V(e.onKeyDown,d=>{var m;const f=d.currentTarget.contains(d.target),h=aM[i.dir].includes(d.key);f&&h&&(s.onOpenChange(!1),(m=a.trigger)==null||m.focus(),d.preventDefault())})})})})})});ym.displayName=vm;function xm(e){return e?"open":"closed"}function bo(e){return e==="indeterminate"}function qa(e){return bo(e)?"indeterminate":e?"checked":"unchecked"}function PM(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function EM(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function MM(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=EM(e,Math.max(s,0));o.length===1&&(i=i.filter(u=>u!==n));const c=i.find(u=>u.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}function AM(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s],c=t[i],u=a.x,d=a.y,f=c.x,h=c.y;d>r!=h>r&&n<(f-u)*(r-d)/(h-d)+u&&(o=!o)}return o}function DM(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return AM(n,t)}function qn(e){return t=>t.pointerType==="mouse"?e(t):void 0}var NM=Jp,jM=Ga,kM=tm,IM=nm,_M=za,OM=rm,LM=Zo,VM=sm,FM=am,$M=lm,BM=dm,WM=fm,GM=hm,UM=mm,KM=gm,HM=ym,Qo="DropdownMenu",[zM]=Ce(Qo,[qp]),Ae=qp(),[YM,bm]=zM(Qo),wm=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:i,modal:a=!0}=e,c=Ae(t),u=p.useRef(null),[d,f]=be({prop:o,defaultProp:s??!1,onChange:i,caller:Qo});return l.jsx(YM,{scope:t,triggerId:he(),triggerRef:u,contentId:he(),open:d,onOpenChange:f,onOpenToggle:p.useCallback(()=>f(h=>!h),[f]),modal:a,children:l.jsx(NM,{...c,open:d,onOpenChange:f,dir:r,modal:a,children:n})})};wm.displayName=Qo;var Cm="DropdownMenuTrigger",Sm=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,s=bm(Cm,n),i=Ae(n);return l.jsx(jM,{asChild:!0,...i,children:l.jsx(K.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:dt(t,s.triggerRef),onPointerDown:V(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(s.onOpenToggle(),s.open||a.preventDefault())}),onKeyDown:V(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&s.onOpenToggle(),a.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});Sm.displayName=Cm;var XM="DropdownMenuPortal",Rm=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Ae(t);return l.jsx(kM,{...r,...n})};Rm.displayName=XM;var Tm="DropdownMenuContent",Pm=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=bm(Tm,n),s=Ae(n),i=p.useRef(!1);return l.jsx(IM,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...r,ref:t,onCloseAutoFocus:V(e.onCloseAutoFocus,a=>{var c;i.current||(c=o.triggerRef.current)==null||c.focus(),i.current=!1,a.preventDefault()}),onInteractOutside:V(e.onInteractOutside,a=>{const c=a.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,d=c.button===2||u;(!o.modal||d)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Pm.displayName=Tm;var qM="DropdownMenuGroup",ZM=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ae(n);return l.jsx(_M,{...o,...r,ref:t})});ZM.displayName=qM;var QM="DropdownMenuLabel",Em=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ae(n);return l.jsx(OM,{...o,...r,ref:t})});Em.displayName=QM;var JM="DropdownMenuItem",Mm=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ae(n);return l.jsx(LM,{...o,...r,ref:t})});Mm.displayName=JM;var eA="DropdownMenuCheckboxItem",Am=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ae(n);return l.jsx(VM,{...o,...r,ref:t})});Am.displayName=eA;var tA="DropdownMenuRadioGroup",Dm=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ae(n);return l.jsx(FM,{...o,...r,ref:t})});Dm.displayName=tA;var nA="DropdownMenuRadioItem",Nm=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ae(n);return l.jsx($M,{...o,...r,ref:t})});Nm.displayName=nA;var rA="DropdownMenuItemIndicator",jm=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ae(n);return l.jsx(BM,{...o,...r,ref:t})});jm.displayName=rA;var oA="DropdownMenuSeparator",km=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ae(n);return l.jsx(WM,{...o,...r,ref:t})});km.displayName=oA;var sA="DropdownMenuArrow",iA=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ae(n);return l.jsx(GM,{...o,...r,ref:t})});iA.displayName=sA;var aA=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:o,defaultOpen:s}=e,i=Ae(t),[a,c]=be({prop:r,defaultProp:s??!1,onChange:o,caller:"DropdownMenuSub"});return l.jsx(UM,{...i,open:a,onOpenChange:c,children:n})},cA="DropdownMenuSubTrigger",Im=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ae(n);return l.jsx(KM,{...o,...r,ref:t})});Im.displayName=cA;var lA="DropdownMenuSubContent",_m=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ae(n);return l.jsx(HM,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});_m.displayName=lA;var uA=wm,dA=Sm,Om=Rm,fA=Pm,hA=Em,pA=Mm,mA=Am,gA=Dm,vA=Nm,Lm=jm,yA=km,xA=aA,bA=Im,wA=_m;const CA=uA,SA=dA,RA=w.forwardRef(function({className:t,size:n="md",sideOffset:r=6,...o},s){return l.jsx(Om,{children:l.jsx(fA,{ref:s,sideOffset:r,className:_("cny-menu-content",`size-${n}`,t),...o})})}),TA=w.forwardRef(function({icon:t,shortcut:n,destructive:r,className:o,children:s,...i},a){return l.jsxs(pA,{ref:a,className:_("cny-menu-item",r&&"is-destructive",o),...i,children:[t&&l.jsx("span",{className:"cny-menu-item-icon",children:t}),l.jsx("span",{className:"cny-menu-item-label",children:s}),n&&l.jsx("span",{className:"cny-menu-item-shortcut",children:n})]})}),PA=w.forwardRef(function({shortcut:t,className:n,children:r,...o},s){return l.jsxs(mA,{ref:s,className:_("cny-menu-item is-check",n),...o,children:[l.jsx("span",{className:"cny-menu-item-icon",children:l.jsx(Lm,{children:l.jsx(Rt,{size:13,"aria-hidden":"true"})})}),l.jsx("span",{className:"cny-menu-item-label",children:r}),t&&l.jsx("span",{className:"cny-menu-item-shortcut",children:t})]})}),EA=gA,MA=w.forwardRef(function({shortcut:t,className:n,children:r,...o},s){return l.jsxs(vA,{ref:s,className:_("cny-menu-item is-radio",n),...o,children:[l.jsx("span",{className:"cny-menu-item-icon",children:l.jsx(Lm,{children:l.jsx(gS,{size:6,fill:"currentColor","aria-hidden":"true"})})}),l.jsx("span",{className:"cny-menu-item-label",children:r}),t&&l.jsx("span",{className:"cny-menu-item-shortcut",children:t})]})}),AA=w.forwardRef(function({className:t,...n},r){return l.jsx(hA,{ref:r,className:_("cny-menu-label",t),...n})}),DA=w.forwardRef(function({className:t,...n},r){return l.jsx(yA,{ref:r,className:_("cny-menu-separator",t),...n})}),NA=xA,jA=w.forwardRef(function({icon:t,className:n,children:r,...o},s){return l.jsxs(bA,{ref:s,className:_("cny-menu-item is-sub",n),...o,children:[t&&l.jsx("span",{className:"cny-menu-item-icon",children:t}),l.jsx("span",{className:"cny-menu-item-label",children:r}),l.jsx("span",{className:"cny-menu-item-chevron",children:l.jsx(gn,{size:13,"aria-hidden":"true"})})]})}),kA=w.forwardRef(function({className:t,...n},r){return l.jsx(Om,{children:l.jsx(wA,{ref:r,className:_("cny-menu-content",t),...n})})});var[Jo]=Ce("Tooltip",[kt]),es=kt(),Vm="TooltipProvider",IA=700,ki="tooltip.open",[_A,Za]=Jo(Vm),Fm=e=>{const{__scopeTooltip:t,delayDuration:n=IA,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=e,i=p.useRef(!0),a=p.useRef(!1),c=p.useRef(0);return p.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),l.jsx(_A,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:p.useCallback(()=>{window.clearTimeout(c.current),i.current=!1},[]),onClose:p.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:p.useCallback(u=>{a.current=u},[]),disableHoverableContent:o,children:s})};Fm.displayName=Vm;var Zn="Tooltip",[OA,gr]=Jo(Zn),$m=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:s,disableHoverableContent:i,delayDuration:a}=e,c=Za(Zn,e.__scopeTooltip),u=es(t),[d,f]=p.useState(null),h=he(),m=p.useRef(0),y=i??c.disableHoverableContent,g=a??c.delayDuration,v=p.useRef(!1),[x,b]=be({prop:r,defaultProp:o??!1,onChange:T=>{T?(c.onOpen(),document.dispatchEvent(new CustomEvent(ki))):c.onClose(),s==null||s(T)},caller:Zn}),C=p.useMemo(()=>x?v.current?"delayed-open":"instant-open":"closed",[x]),S=p.useCallback(()=>{window.clearTimeout(m.current),m.current=0,v.current=!1,b(!0)},[b]),R=p.useCallback(()=>{window.clearTimeout(m.current),m.current=0,b(!1)},[b]),P=p.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{v.current=!0,b(!0),m.current=0},g)},[g,b]);return p.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),l.jsx(ar,{...u,children:l.jsx(OA,{scope:t,contentId:h,open:x,stateAttribute:C,trigger:d,onTriggerChange:f,onTriggerEnter:p.useCallback(()=>{c.isOpenDelayedRef.current?P():S()},[c.isOpenDelayedRef,P,S]),onTriggerLeave:p.useCallback(()=>{y?R():(window.clearTimeout(m.current),m.current=0)},[R,y]),onOpen:S,onClose:R,disableHoverableContent:y,children:n})})};$m.displayName=Zn;var Ii="TooltipTrigger",Bm=p.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=gr(Ii,n),s=Za(Ii,n),i=es(n),a=p.useRef(null),c=te(t,a,o.onTriggerChange),u=p.useRef(!1),d=p.useRef(!1),f=p.useCallback(()=>u.current=!1,[]);return p.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),l.jsx(cr,{asChild:!0,...i,children:l.jsx(K.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:c,onPointerMove:V(e.onPointerMove,h=>{h.pointerType!=="touch"&&!d.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:V(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:V(e.onPointerDown,()=>{o.open&&o.onClose(),u.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:V(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:V(e.onBlur,o.onClose),onClick:V(e.onClick,o.onClose)})})});Bm.displayName=Ii;var Qa="TooltipPortal",[LA,VA]=Jo(Qa,{forceMount:void 0}),Wm=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,s=gr(Qa,t);return l.jsx(LA,{scope:t,forceMount:n,children:l.jsx(Me,{present:n||s.open,children:l.jsx(Nn,{asChild:!0,container:o,children:r})})})};Wm.displayName=Qa;var Sn="TooltipContent",Gm=p.forwardRef((e,t)=>{const n=VA(Sn,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...s}=e,i=gr(Sn,e.__scopeTooltip);return l.jsx(Me,{present:r||i.open,children:i.disableHoverableContent?l.jsx(Um,{side:o,...s,ref:t}):l.jsx(FA,{side:o,...s,ref:t})})}),FA=p.forwardRef((e,t)=>{const n=gr(Sn,e.__scopeTooltip),r=Za(Sn,e.__scopeTooltip),o=p.useRef(null),s=te(t,o),[i,a]=p.useState(null),{trigger:c,onClose:u}=n,d=o.current,{onPointerInTransitChange:f}=r,h=p.useCallback(()=>{a(null),f(!1)},[f]),m=p.useCallback((y,g)=>{const v=y.currentTarget,x={x:y.clientX,y:y.clientY},b=GA(x,v.getBoundingClientRect()),C=UA(x,b),S=KA(g.getBoundingClientRect()),R=zA([...C,...S]);a(R),f(!0)},[f]);return p.useEffect(()=>()=>h(),[h]),p.useEffect(()=>{if(c&&d){const y=v=>m(v,d),g=v=>m(v,c);return c.addEventListener("pointerleave",y),d.addEventListener("pointerleave",g),()=>{c.removeEventListener("pointerleave",y),d.removeEventListener("pointerleave",g)}}},[c,d,m,h]),p.useEffect(()=>{if(i){const y=g=>{const v=g.target,x={x:g.clientX,y:g.clientY},b=(c==null?void 0:c.contains(v))||(d==null?void 0:d.contains(v)),C=!HA(x,i);b?h():C&&(h(),u())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[c,d,i,u,h]),l.jsx(Um,{...e,ref:s})}),[$A,BA]=Jo(Zn,{isInside:!1}),WA=xC("TooltipContent"),Um=p.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:i,...a}=e,c=gr(Sn,n),u=es(n),{onClose:d}=c;return p.useEffect(()=>(document.addEventListener(ki,d),()=>document.removeEventListener(ki,d)),[d]),p.useEffect(()=>{if(c.trigger){const f=h=>{const m=h.target;m!=null&&m.contains(c.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[c.trigger,d]),l.jsx(Mn,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:l.jsxs(Lo,{"data-state":c.stateAttribute,...u,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[l.jsx(WA,{children:r}),l.jsx($A,{scope:n,isInside:!0,children:l.jsx(GR,{id:c.contentId,role:"tooltip",children:o||r})})]})})});Gm.displayName=Sn;var Km="TooltipArrow",Hm=p.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=es(n);return BA(Km,n).isInside?null:l.jsx(Vo,{...o,...r,ref:t})});Hm.displayName=Km;function GA(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,o,s)){case s:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function UA(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function KA(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function HA(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s],c=t[i],u=a.x,d=a.y,f=c.x,h=c.y;d>r!=h>r&&n<(f-u)*(r-d)/(h-d)+u&&(o=!o)}return o}function zA(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),YA(t)}function YA(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var XA=Fm,zm=$m,Ym=Bm,Xm=Wm,qm=Gm,qA=Hm;const ZA=XA,QA=w.forwardRef(function({children:t,content:n,side:r="top",align:o="center",sideOffset:s=6,delayDuration:i,open:a,disabled:c,contentClassName:u},d){return c?l.jsx(l.Fragment,{children:t}):l.jsxs(zm,{delayDuration:i,open:a,children:[l.jsx(Ym,{asChild:!0,children:t}),l.jsx(Xm,{children:l.jsxs(qm,{ref:d,side:r,align:o,sideOffset:s,className:_("cny-tooltip-content",u),children:[n,l.jsx(qA,{className:"cny-tooltip-arrow",width:10,height:5})]})})]})}),JA=zm,eD=Ym,tD=w.forwardRef(function({className:t,...n},r){return l.jsx(Xm,{children:l.jsx(qm,{ref:r,className:_("cny-tooltip-content",t),...n})})}),nD=Ea,rD=Ma,oD=TP,sD=PP,iD=w.forwardRef(function({className:t,withArrow:n=!1,sideOffset:r=8,children:o,...s},i){return l.jsx(Aa,{children:l.jsxs(Da,{ref:i,sideOffset:r,className:_("cny-popover-content",t),...s,children:[o,n&&l.jsx(EP,{className:"cny-popover-arrow",width:12,height:6})]})})}),aD=w.forwardRef(function({color:t="default",variant:n="soft",size:r="md",icon:o,avatar:s,onDelete:i,deleteLabel:a="Remove",onClick:c,disabled:u,className:d,children:f,...h},m){const y=!u&&c!=null;return l.jsxs("span",{ref:m,role:y?"button":void 0,tabIndex:y?0:void 0,"aria-disabled":u||void 0,onClick:u?void 0:c,className:_("cny-chip",t,n,r==="sm"&&"sm",y&&"is-interactive",u&&"is-disabled",d),...h,children:[s&&l.jsx("span",{className:"cny-chip-avatar",children:s}),o&&l.jsx("span",{className:"cny-chip-icon",children:o}),l.jsx("span",{className:"cny-chip-label",children:f}),i&&!u&&l.jsx("button",{type:"button",className:"cny-chip-delete","aria-label":a,onClick:g=>{g.stopPropagation(),i(g)},children:l.jsx(jt,{size:r==="sm"?11:13,"aria-hidden":"true"})})]})}),cD=w.forwardRef(function({variant:t="dividers",size:n="md",dense:r,className:o,children:s,...i},a){return l.jsx("ul",{ref:a,className:_("cny-list",t,`size-${n}`,r&&"is-dense",o),...i,children:s})}),lD=w.forwardRef(function({leading:t,trailing:n,primary:r,secondary:o,onClick:s,href:i,disabled:a,active:c,as:u,children:d,className:f,...h},m){const y=u??(i?"a":s?"button":"li"),g=!a&&(i!=null||s!=null),v=d??l.jsxs(l.Fragment,{children:[t&&l.jsx("span",{className:"cny-list-item-leading",children:t}),l.jsxs("span",{className:"cny-list-item-body",children:[r!=null&&l.jsx("span",{className:"cny-list-item-primary",children:r}),o!=null&&l.jsx("span",{className:"cny-list-item-secondary",children:o})]}),n&&l.jsx("span",{className:"cny-list-item-trailing",children:n})]}),x=l.jsx(y,{ref:m,href:i,onClick:a?void 0:s,"aria-disabled":a||void 0,"aria-current":c?"page":void 0,tabIndex:g&&y==="div"?0:void 0,className:_("cny-list-item",c&&"is-active",a&&"is-disabled",g&&"is-interactive",f),...h,children:v});return y==="li"?x:l.jsx("li",{className:"cny-list-item-wrap",children:x})}),uD=w.forwardRef(function({className:t,...n},r){return l.jsx("li",{ref:r,role:"separator",className:_("cny-list-separator",t),...n})}),dD=w.forwardRef(function({className:t,children:n,...r},o){return l.jsx("li",{ref:o,className:_("cny-list-subheader",t),...r,children:n})});var ts="Tabs",[fD]=Ce(ts,[Dt]),Zm=Dt(),[hD,Ja]=fD(ts),Qm=p.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:s,orientation:i="horizontal",dir:a,activationMode:c="automatic",...u}=e,d=At(a),[f,h]=be({prop:r,onChange:o,defaultProp:s??"",caller:ts});return l.jsx(hD,{scope:n,baseId:he(),value:f,onValueChange:h,orientation:i,dir:d,activationMode:c,children:l.jsx(K.div,{dir:d,"data-orientation":i,...u,ref:t})})});Qm.displayName=ts;var Jm="TabsList",eg=p.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,s=Ja(Jm,n),i=Zm(n);return l.jsx(Ao,{asChild:!0,...i,orientation:s.orientation,dir:s.dir,loop:r,children:l.jsx(K.div,{role:"tablist","aria-orientation":s.orientation,...o,ref:t})})});eg.displayName=Jm;var tg="TabsTrigger",ng=p.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...s}=e,i=Ja(tg,n),a=Zm(n),c=sg(i.baseId,r),u=ig(i.baseId,r),d=r===i.value;return l.jsx(Do,{asChild:!0,...a,focusable:!o,active:d,children:l.jsx(K.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:c,...s,ref:t,onMouseDown:V(e.onMouseDown,f=>{!o&&f.button===0&&f.ctrlKey===!1?i.onValueChange(r):f.preventDefault()}),onKeyDown:V(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&i.onValueChange(r)}),onFocus:V(e.onFocus,()=>{const f=i.activationMode!=="manual";!d&&!o&&f&&i.onValueChange(r)})})})});ng.displayName=tg;var rg="TabsContent",og=p.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:s,...i}=e,a=Ja(rg,n),c=sg(a.baseId,r),u=ig(a.baseId,r),d=r===a.value,f=p.useRef(d);return p.useEffect(()=>{const h=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(h)},[]),l.jsx(Me,{present:o||d,children:({present:h})=>l.jsx(K.div,{"data-state":d?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":c,hidden:!h,id:u,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:h&&s})})});og.displayName=rg;function sg(e,t){return`${e}-trigger-${t}`}function ig(e,t){return`${e}-content-${t}`}var pD=Qm,mD=eg,gD=ng,vD=og;const yD=w.forwardRef(function({variant:t="line",size:n="md",className:r,...o},s){return l.jsx(pD,{ref:s,className:_("cny-tabs",`variant-${t}`,`size-${n}`,r),...o})}),xD=w.forwardRef(function({className:t,...n},r){return l.jsx(mD,{ref:r,className:_("cny-tabs-list",t),...n})}),bD=w.forwardRef(function({icon:t,badge:n,className:r,children:o,...s},i){return l.jsxs(gD,{ref:i,className:_("cny-tabs-trigger",r),...s,children:[t&&l.jsx("span",{className:"cny-tabs-trigger-icon",children:t}),l.jsx("span",{className:"cny-tabs-trigger-label",children:o}),n&&l.jsx("span",{className:"cny-tabs-trigger-badge",children:n})]})}),wD=w.forwardRef(function({className:t,...n},r){return l.jsx(vD,{ref:r,className:_("cny-tabs-content",t),...n})});function CD(e){return e.multiple===!0}const SD=w.forwardRef(function(t,n){const{options:r,placeholder:o="Select…",searchPlaceholder:s="Search…",emptyText:i="No results.",loading:a=!1,loadingText:c="Loading…",size:u,color:d="primary",disabled:f=!1,clearable:h=!0,id:m,"aria-invalid":y,"aria-describedby":g,"aria-label":v,className:x}=t,b=w.useId(),C=m??`cny-ac-${b}`,[S,R]=w.useState(!1),[P,T]=w.useState(""),A=w.useRef(null),k=CD(t),[N,L]=w.useState(!k&&t.defaultValue!==void 0?t.defaultValue??null:null),[G,J]=w.useState(k&&t.defaultValue!==void 0?t.defaultValue??[]:[]),F=k?t.value!==void 0?t.value:G:(()=>{const W=t.value!==void 0?t.value:N;return W==null?[]:[W]})(),Z=w.useCallback(W=>{var M,Y;if(k)t.value===void 0&&J(W),(M=t.onValueChange)==null||M.call(t,W);else{const z=W[0]??null;t.value===void 0&&L(z),(Y=t.onValueChange)==null||Y.call(t,z)}},[k,t]),D=w.useCallback(W=>{if(!W.disabled)if(k){const M=t.maxItems,Y=F.includes(W.value);let z;if(Y)z=F.filter(H=>H!==W.value);else{if(M!=null&&F.length>=M)return;z=[...F,W.value]}Z(z)}else Z([W.value]),R(!1)},[Z,k,F,t]),U=w.useCallback(W=>{var M;W.stopPropagation(),Z([]),(M=A.current)==null||M.focus()},[Z]),j=w.useMemo(()=>{const W=new Map;for(const M of r){const Y=M.group??"";W.has(Y)||W.set(Y,[]),W.get(Y).push(M)}return Array.from(W.entries())},[r]),O=W=>{var M;return((M=r.find(Y=>Y.value===W))==null?void 0:M.label)??W},ne=F.length===0?o:k?F.length===1?O(F[0]):`${O(F[0])} +${F.length-1}`:O(F[0]);return l.jsxs(Ea,{open:S,onOpenChange:R,children:[l.jsx(Ma,{asChild:!0,children:l.jsxs("button",{ref:W=>{A.current=W,typeof n=="function"?n(W):n&&(n.current=W)},type:"button",id:C,className:_("cny-ac-trigger","input",d!=="primary"&&d,u==="sm"||u==="lg"?u:null,F.length>0&&"has-value",S&&"is-open",x),disabled:f,"aria-label":v,"aria-invalid":y,"aria-describedby":g,"aria-haspopup":"listbox","aria-expanded":S,children:[l.jsx("span",{className:_("cny-ac-value",F.length===0&&"is-placeholder"),children:ne}),h&&F.length>0&&!f&&l.jsx("span",{role:"button",tabIndex:-1,className:"cny-ac-clear","aria-label":"Clear",onClick:U,onPointerDown:W=>W.stopPropagation(),children:l.jsx(jt,{size:13,"aria-hidden":"true"})}),l.jsx(uS,{size:14,className:"cny-ac-chevron","aria-hidden":"true"})]})}),l.jsx(Aa,{children:l.jsx(Da,{className:"cny-ac-content",align:"start",sideOffset:4,style:{width:"var(--radix-popover-trigger-width)"},children:l.jsxs(xe,{className:"cny-ac-cmdk",shouldFilter:!a,children:[l.jsx("div",{className:"cny-ac-search",children:l.jsx(xe.Input,{value:P,onValueChange:T,placeholder:s})}),l.jsx(xe.List,{className:"cny-ac-list",children:a?l.jsxs("div",{className:"cny-ac-loading",children:[l.jsx(Df,{size:14,className:"cny-ac-loading-spinner","aria-hidden":"true"}),l.jsx("span",{children:c})]}):l.jsxs(l.Fragment,{children:[l.jsx(xe.Empty,{className:"cny-ac-empty",children:i}),j.map(([W,M])=>{const Y=M.map(z=>{const H=F.includes(z.value);return l.jsxs(xe.Item,{value:`${W} ${z.label} ${z.value}`,disabled:z.disabled,onSelect:()=>D(z),className:_("cny-ac-item",H&&"is-checked"),children:[k?l.jsx("span",{className:_("cny-ac-checkbox",H&&"is-checked"),children:H&&l.jsx(Rt,{size:12,"aria-hidden":"true"})}):l.jsxs("span",{className:"cny-ac-icon",children:[z.icon??null,!z.icon&&H&&l.jsx(Rt,{size:14,"aria-hidden":"true"})]}),l.jsx("span",{className:"cny-ac-item-label",children:z.label}),z.hint&&l.jsx("span",{className:"cny-ac-item-hint",children:z.hint})]},z.value)});return W===""?l.jsx(xe.Group,{children:Y},"__ungrouped"):l.jsx(xe.Group,{heading:W,children:Y},W)})]})})]})})})]})});function RD(e,t,n,r){if(t<=1)return[{type:"page",page:1}];const o=t,s=Math.max(1,e-n),i=Math.min(o,e+n),a=[],c=r&&s>1,u=r&&i<o,d=c&&s>2,f=u&&i<o-1;c&&a.push({type:"page",page:1}),d&&a.push({type:"ellipsis",key:"l"});for(let h=s;h<=i;h++)a.push({type:"page",page:h});return f&&a.push({type:"ellipsis",key:"r"}),u&&a.push({type:"page",page:o}),a.filter((h,m,y)=>h.type!=="page"?!0:y.findIndex(g=>g.type==="page"&&g.page===h.page)===m)}const TD=w.forwardRef(function({page:t,pageCount:n,onPageChange:r,siblingCount:o=1,showEdges:s=!0,hideControls:i=!1,size:a="md",className:c,"aria-label":u="Pagination"},d){const f=w.useMemo(()=>RD(t,n,o,s),[t,n,o,s]),h=m=>{m<1||m>n||m===t||r(m)};return l.jsxs("nav",{ref:d,role:"navigation","aria-label":u,className:_("cny-pagination",`cny-pagination-${a}`,c),children:[!i&&l.jsx("button",{type:"button",className:"cny-pagination-btn cny-pagination-control",onClick:()=>h(t-1),disabled:t<=1,"aria-label":"Previous page",children:l.jsx(Xr,{size:14,"aria-hidden":"true"})}),f.map(m=>m.type==="ellipsis"?l.jsx("span",{className:"cny-pagination-ellipsis","aria-hidden":"true",children:l.jsx(bS,{size:14})},`e-${m.key}`):l.jsx("button",{type:"button",className:_("cny-pagination-btn",m.page===t&&"is-active"),"aria-current":m.page===t?"page":void 0,onClick:()=>h(m.page),children:m.page},m.page)),!i&&l.jsx("button",{type:"button",className:"cny-pagination-btn cny-pagination-control",onClick:()=>h(t+1),disabled:t>=n,"aria-label":"Next page",children:l.jsx(gn,{size:14,"aria-hidden":"true"})})]})}),PD=w.forwardRef(function({items:t,separator:n,size:r="md",className:o,...s},i){const a=n??l.jsx(gn,{size:12,"aria-hidden":"true"});return l.jsx("nav",{ref:i,"aria-label":"Breadcrumb",className:_("cny-breadcrumb",`cny-breadcrumb-${r}`,o),...s,children:l.jsx("ol",{className:"cny-breadcrumb-list",children:t.map((c,u)=>{const d=u===t.length-1,f=l.jsx("span",{className:_("cny-breadcrumb-label",d&&"is-current"),children:c.label}),h=c.render?c.render(f):c.href&&!d?l.jsx("a",{href:c.href,className:"cny-breadcrumb-link",children:f}):f;return l.jsxs("li",{className:"cny-breadcrumb-item",children:[d?l.jsx("span",{"aria-current":"page",children:f}):h,!d&&l.jsx("span",{className:"cny-breadcrumb-sep","aria-hidden":"true",children:a})]},u)})})})});var ns="Collapsible",[ED,ag]=Ce(ns),[MD,ec]=ED(ns),cg=p.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:s,onOpenChange:i,...a}=e,[c,u]=be({prop:r,defaultProp:o??!1,onChange:i,caller:ns});return l.jsx(MD,{scope:n,disabled:s,contentId:he(),open:c,onOpenToggle:p.useCallback(()=>u(d=>!d),[u]),children:l.jsx(K.div,{"data-state":nc(c),"data-disabled":s?"":void 0,...a,ref:t})})});cg.displayName=ns;var lg="CollapsibleTrigger",ug=p.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=ec(lg,n);return l.jsx(K.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":nc(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:t,onClick:V(e.onClick,o.onOpenToggle)})});ug.displayName=lg;var tc="CollapsibleContent",dg=p.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ec(tc,e.__scopeCollapsible);return l.jsx(Me,{present:n||o.open,children:({present:s})=>l.jsx(AD,{...r,ref:t,present:s})})});dg.displayName=tc;var AD=p.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...s}=e,i=ec(tc,n),[a,c]=p.useState(r),u=p.useRef(null),d=te(t,u),f=p.useRef(0),h=f.current,m=p.useRef(0),y=m.current,g=i.open||a,v=p.useRef(g),x=p.useRef(void 0);return p.useEffect(()=>{const b=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(b)},[]),Pe(()=>{const b=u.current;if(b){x.current=x.current||{transitionDuration:b.style.transitionDuration,animationName:b.style.animationName},b.style.transitionDuration="0s",b.style.animationName="none";const C=b.getBoundingClientRect();f.current=C.height,m.current=C.width,v.current||(b.style.transitionDuration=x.current.transitionDuration,b.style.animationName=x.current.animationName),c(r)}},[i.open,r]),l.jsx(K.div,{"data-state":nc(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!g,...s,ref:d,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":y?`${y}px`:void 0,...e.style},children:g&&o})});function nc(e){return e?"open":"closed"}var DD=cg,ND=ug,jD=dg,Je="Accordion",kD=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[rc,ID,_D]=nr(Je),[rs]=Ce(Je,[_D,ag]),oc=ag(),fg=w.forwardRef((e,t)=>{const{type:n,...r}=e,o=r,s=r;return l.jsx(rc.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?l.jsx(FD,{...s,ref:t}):l.jsx(VD,{...o,ref:t})})});fg.displayName=Je;var[hg,OD]=rs(Je),[pg,LD]=rs(Je,{collapsible:!1}),VD=w.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},collapsible:s=!1,...i}=e,[a,c]=be({prop:n,defaultProp:r??"",onChange:o,caller:Je});return l.jsx(hg,{scope:e.__scopeAccordion,value:w.useMemo(()=>a?[a]:[],[a]),onItemOpen:c,onItemClose:w.useCallback(()=>s&&c(""),[s,c]),children:l.jsx(pg,{scope:e.__scopeAccordion,collapsible:s,children:l.jsx(mg,{...i,ref:t})})})}),FD=w.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...s}=e,[i,a]=be({prop:n,defaultProp:r??[],onChange:o,caller:Je}),c=w.useCallback(d=>a((f=[])=>[...f,d]),[a]),u=w.useCallback(d=>a((f=[])=>f.filter(h=>h!==d)),[a]);return l.jsx(hg,{scope:e.__scopeAccordion,value:i,onItemOpen:c,onItemClose:u,children:l.jsx(pg,{scope:e.__scopeAccordion,collapsible:!0,children:l.jsx(mg,{...s,ref:t})})})}),[$D,os]=rs(Je),mg=w.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:o,orientation:s="vertical",...i}=e,a=w.useRef(null),c=te(a,t),u=ID(n),f=At(o)==="ltr",h=V(e.onKeyDown,m=>{var A;if(!kD.includes(m.key))return;const y=m.target,g=u().filter(k=>{var N;return!((N=k.ref.current)!=null&&N.disabled)}),v=g.findIndex(k=>k.ref.current===y),x=g.length;if(v===-1)return;m.preventDefault();let b=v;const C=0,S=x-1,R=()=>{b=v+1,b>S&&(b=C)},P=()=>{b=v-1,b<C&&(b=S)};switch(m.key){case"Home":b=C;break;case"End":b=S;break;case"ArrowRight":s==="horizontal"&&(f?R():P());break;case"ArrowDown":s==="vertical"&&R();break;case"ArrowLeft":s==="horizontal"&&(f?P():R());break;case"ArrowUp":s==="vertical"&&P();break}const T=b%x;(A=g[T].ref.current)==null||A.focus()});return l.jsx($D,{scope:n,disabled:r,direction:o,orientation:s,children:l.jsx(rc.Slot,{scope:n,children:l.jsx(K.div,{...i,"data-orientation":s,ref:c,onKeyDown:r?void 0:h})})})}),wo="AccordionItem",[BD,sc]=rs(wo),gg=w.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...o}=e,s=os(wo,n),i=OD(wo,n),a=oc(n),c=he(),u=r&&i.value.includes(r)||!1,d=s.disabled||e.disabled;return l.jsx(BD,{scope:n,open:u,disabled:d,triggerId:c,children:l.jsx(DD,{"data-orientation":s.orientation,"data-state":Cg(u),...a,...o,ref:t,disabled:d,open:u,onOpenChange:f=>{f?i.onItemOpen(r):i.onItemClose(r)}})})});gg.displayName=wo;var vg="AccordionHeader",yg=w.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=os(Je,n),s=sc(vg,n);return l.jsx(K.h3,{"data-orientation":o.orientation,"data-state":Cg(s.open),"data-disabled":s.disabled?"":void 0,...r,ref:t})});yg.displayName=vg;var _i="AccordionTrigger",xg=w.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=os(Je,n),s=sc(_i,n),i=LD(_i,n),a=oc(n);return l.jsx(rc.ItemSlot,{scope:n,children:l.jsx(ND,{"aria-disabled":s.open&&!i.collapsible||void 0,"data-orientation":o.orientation,id:s.triggerId,...a,...r,ref:t})})});xg.displayName=_i;var bg="AccordionContent",wg=w.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=os(Je,n),s=sc(bg,n),i=oc(n);return l.jsx(jD,{role:"region","aria-labelledby":s.triggerId,"data-orientation":o.orientation,...i,...r,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});wg.displayName=bg;function Cg(e){return e?"open":"closed"}var WD=fg,GD=gg,UD=yg,KD=xg,HD=wg;const zD=w.forwardRef(function({variant:t="plain",className:n,...r},o){return l.jsx(WD,{ref:o,className:_("cny-accordion",`cny-accordion-${t}`,n),...r})}),YD=w.forwardRef(function({className:t,...n},r){return l.jsx(GD,{ref:r,className:_("cny-accordion-item",t),...n})}),XD=w.forwardRef(function({children:t,className:n,icon:r,hideIndicator:o,...s},i){return l.jsx(UD,{className:"cny-accordion-header",children:l.jsxs(KD,{ref:i,className:_("cny-accordion-trigger",n),...s,children:[r&&l.jsx("span",{className:"cny-accordion-trigger-icon",children:r}),l.jsx("span",{className:"cny-accordion-trigger-label",children:t}),!o&&l.jsx(No,{size:14,"aria-hidden":"true",className:"cny-accordion-trigger-chevron"})]})})}),qD=w.forwardRef(function({children:t,className:n,...r},o){return l.jsx(HD,{ref:o,className:_("cny-accordion-content",n),...r,children:l.jsx("div",{className:"cny-accordion-content-inner",children:t})})});var Sg=["PageUp","PageDown"],Rg=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Tg={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},kn="Slider",[Oi,ZD,QD]=nr(kn),[Pg]=Ce(kn,[QD]),[JD,ss]=Pg(kn),Eg=p.forwardRef((e,t)=>{const{name:n,min:r=0,max:o=100,step:s=1,orientation:i="horizontal",disabled:a=!1,minStepsBetweenThumbs:c=0,defaultValue:u=[r],value:d,onValueChange:f=()=>{},onValueCommit:h=()=>{},inverted:m=!1,form:y,...g}=e,v=p.useRef(new Set),x=p.useRef(0),C=i==="horizontal"?e1:t1,[S=[],R]=be({prop:d,defaultProp:u,onChange:L=>{var J;(J=[...v.current][x.current])==null||J.focus(),f(L)}}),P=p.useRef(S);function T(L){const G=i1(S,L);N(L,G)}function A(L){N(L,x.current)}function k(){const L=P.current[x.current];S[x.current]!==L&&h(S)}function N(L,G,{commit:J}={commit:!1}){const F=u1(s),Z=d1(Math.round((L-r)/s)*s+r,F),D=uo(Z,[r,o]);R((U=[])=>{const j=o1(U,D,G);if(l1(j,c*s)){x.current=j.indexOf(D);const O=String(j)!==String(U);return O&&J&&h(j),O?j:U}else return U})}return l.jsx(JD,{scope:e.__scopeSlider,name:n,disabled:a,min:r,max:o,valueIndexToChangeRef:x,thumbs:v.current,values:S,orientation:i,form:y,children:l.jsx(Oi.Provider,{scope:e.__scopeSlider,children:l.jsx(Oi.Slot,{scope:e.__scopeSlider,children:l.jsx(C,{"aria-disabled":a,"data-disabled":a?"":void 0,...g,ref:t,onPointerDown:V(g.onPointerDown,()=>{a||(P.current=S)}),min:r,max:o,inverted:m,onSlideStart:a?void 0:T,onSlideMove:a?void 0:A,onSlideEnd:a?void 0:k,onHomeKeyDown:()=>!a&&N(r,0,{commit:!0}),onEndKeyDown:()=>!a&&N(o,S.length-1,{commit:!0}),onStepKeyDown:({event:L,direction:G})=>{if(!a){const Z=Sg.includes(L.key)||L.shiftKey&&Rg.includes(L.key)?10:1,D=x.current,U=S[D],j=s*Z*G;N(U+j,D,{commit:!0})}}})})})})});Eg.displayName=kn;var[Mg,Ag]=Pg(kn,{startEdge:"left",endEdge:"right",size:"width",direction:1}),e1=p.forwardRef((e,t)=>{const{min:n,max:r,dir:o,inverted:s,onSlideStart:i,onSlideMove:a,onSlideEnd:c,onStepKeyDown:u,...d}=e,[f,h]=p.useState(null),m=te(t,C=>h(C)),y=p.useRef(void 0),g=At(o),v=g==="ltr",x=v&&!s||!v&&s;function b(C){const S=y.current||f.getBoundingClientRect(),R=[0,S.width],T=ic(R,x?[n,r]:[r,n]);return y.current=S,T(C-S.left)}return l.jsx(Mg,{scope:e.__scopeSlider,startEdge:x?"left":"right",endEdge:x?"right":"left",direction:x?1:-1,size:"width",children:l.jsx(Dg,{dir:g,"data-orientation":"horizontal",...d,ref:m,style:{...d.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:C=>{const S=b(C.clientX);i==null||i(S)},onSlideMove:C=>{const S=b(C.clientX);a==null||a(S)},onSlideEnd:()=>{y.current=void 0,c==null||c()},onStepKeyDown:C=>{const R=Tg[x?"from-left":"from-right"].includes(C.key);u==null||u({event:C,direction:R?-1:1})}})})}),t1=p.forwardRef((e,t)=>{const{min:n,max:r,inverted:o,onSlideStart:s,onSlideMove:i,onSlideEnd:a,onStepKeyDown:c,...u}=e,d=p.useRef(null),f=te(t,d),h=p.useRef(void 0),m=!o;function y(g){const v=h.current||d.current.getBoundingClientRect(),x=[0,v.height],C=ic(x,m?[r,n]:[n,r]);return h.current=v,C(g-v.top)}return l.jsx(Mg,{scope:e.__scopeSlider,startEdge:m?"bottom":"top",endEdge:m?"top":"bottom",size:"height",direction:m?1:-1,children:l.jsx(Dg,{"data-orientation":"vertical",...u,ref:f,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:g=>{const v=y(g.clientY);s==null||s(v)},onSlideMove:g=>{const v=y(g.clientY);i==null||i(v)},onSlideEnd:()=>{h.current=void 0,a==null||a()},onStepKeyDown:g=>{const x=Tg[m?"from-bottom":"from-top"].includes(g.key);c==null||c({event:g,direction:x?-1:1})}})})}),Dg=p.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:o,onSlideEnd:s,onHomeKeyDown:i,onEndKeyDown:a,onStepKeyDown:c,...u}=e,d=ss(kn,n);return l.jsx(K.span,{...u,ref:t,onKeyDown:V(e.onKeyDown,f=>{f.key==="Home"?(i(f),f.preventDefault()):f.key==="End"?(a(f),f.preventDefault()):Sg.concat(Rg).includes(f.key)&&(c(f),f.preventDefault())}),onPointerDown:V(e.onPointerDown,f=>{const h=f.target;h.setPointerCapture(f.pointerId),f.preventDefault(),d.thumbs.has(h)?h.focus():r(f)}),onPointerMove:V(e.onPointerMove,f=>{f.target.hasPointerCapture(f.pointerId)&&o(f)}),onPointerUp:V(e.onPointerUp,f=>{const h=f.target;h.hasPointerCapture(f.pointerId)&&(h.releasePointerCapture(f.pointerId),s(f))})})}),Ng="SliderTrack",jg=p.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,o=ss(Ng,n);return l.jsx(K.span,{"data-disabled":o.disabled?"":void 0,"data-orientation":o.orientation,...r,ref:t})});jg.displayName=Ng;var Li="SliderRange",kg=p.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,o=ss(Li,n),s=Ag(Li,n),i=p.useRef(null),a=te(t,i),c=o.values.length,u=o.values.map(h=>Og(h,o.min,o.max)),d=c>1?Math.min(...u):0,f=100-Math.max(...u);return l.jsx(K.span,{"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,...r,ref:a,style:{...e.style,[s.startEdge]:d+"%",[s.endEdge]:f+"%"}})});kg.displayName=Li;var Vi="SliderThumb",Ig=p.forwardRef((e,t)=>{const n=ZD(e.__scopeSlider),[r,o]=p.useState(null),s=te(t,a=>o(a)),i=p.useMemo(()=>r?n().findIndex(a=>a.ref.current===r):-1,[n,r]);return l.jsx(n1,{...e,ref:s,index:i})}),n1=p.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:o,...s}=e,i=ss(Vi,n),a=Ag(Vi,n),[c,u]=p.useState(null),d=te(t,b=>u(b)),f=c?i.form||!!c.closest("form"):!0,h=ir(c),m=i.values[r],y=m===void 0?0:Og(m,i.min,i.max),g=s1(r,i.values.length),v=h==null?void 0:h[a.size],x=v?a1(v,y,a.direction):0;return p.useEffect(()=>{if(c)return i.thumbs.add(c),()=>{i.thumbs.delete(c)}},[c,i.thumbs]),l.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[a.startEdge]:`calc(${y}% + ${x}px)`},children:[l.jsx(Oi.ItemSlot,{scope:e.__scopeSlider,children:l.jsx(K.span,{role:"slider","aria-label":e["aria-label"]||g,"aria-valuemin":i.min,"aria-valuenow":m,"aria-valuemax":i.max,"aria-orientation":i.orientation,"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,tabIndex:i.disabled?void 0:0,...s,ref:d,style:m===void 0?{display:"none"}:e.style,onFocus:V(e.onFocus,()=>{i.valueIndexToChangeRef.current=r})})}),f&&l.jsx(_g,{name:o??(i.name?i.name+(i.values.length>1?"[]":""):void 0),form:i.form,value:m},r)]})});Ig.displayName=Vi;var r1="RadioBubbleInput",_g=p.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const o=p.useRef(null),s=te(o,r),i=lr(t);return p.useEffect(()=>{const a=o.current;if(!a)return;const c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==t&&d){const f=new Event("input",{bubbles:!0});d.call(a,t),a.dispatchEvent(f)}},[i,t]),l.jsx(K.input,{style:{display:"none"},...n,ref:s,defaultValue:t})});_g.displayName=r1;function o1(e=[],t,n){const r=[...e];return r[n]=t,r.sort((o,s)=>o-s)}function Og(e,t,n){const s=100/(n-t)*(e-t);return uo(s,[0,100])}function s1(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function i1(e,t){if(e.length===1)return 0;const n=e.map(o=>Math.abs(o-t)),r=Math.min(...n);return n.indexOf(r)}function a1(e,t,n){const r=e/2,s=ic([0,50],[0,r]);return(r-s(t)*n)*n}function c1(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function l1(e,t){if(t>0){const n=c1(e);return Math.min(...n)>=t}return!0}function ic(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function u1(e){return(String(e).split(".")[1]||"").length}function d1(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var f1=Eg,h1=jg,p1=kg,m1=Ig;const g1=w.forwardRef(function({className:t,size:n="md",color:r="primary",showValue:o=!1,formatValue:s,value:i,defaultValue:a,...c},u){const d=i??a??[0],f=s??(h=>h);return l.jsxs(f1,{ref:u,className:_("cny-slider",`cny-slider-${n}`,`cny-slider-${r}`,t),value:i,defaultValue:a,...c,children:[l.jsx(h1,{className:"cny-slider-track",children:l.jsx(p1,{className:"cny-slider-range"})}),d.map((h,m)=>l.jsx(m1,{className:"cny-slider-thumb","aria-label":`Value ${m+1}`,children:o&&l.jsx("span",{className:"cny-slider-bubble",children:f(h)})},m))]})}),v1=w.forwardRef(function({steps:t,active:n,orientation:r="horizontal",size:o="md",onStepClick:s,className:i,...a},c){return l.jsx("ol",{ref:c,className:_("cny-stepper",`cny-stepper-${r}`,`cny-stepper-${o}`,i),"aria-label":"Progress",...a,children:t.map((u,d)=>{const f=d<n?"complete":d===n?"active":"upcoming",h=f==="complete"&&!!s;return l.jsxs("li",{className:_("cny-stepper-step",`is-${f}`),children:[l.jsxs("button",{type:"button",className:"cny-stepper-step-row",onClick:h?()=>s==null?void 0:s(d):void 0,disabled:!h,"aria-current":f==="active"?"step":void 0,children:[l.jsx("span",{className:"cny-stepper-marker","aria-hidden":"true",children:f==="complete"?l.jsx(Rt,{size:14}):u.icon??d+1}),l.jsxs("span",{className:"cny-stepper-text",children:[l.jsx("span",{className:"cny-stepper-label",children:u.label}),u.description&&l.jsx("span",{className:"cny-stepper-desc",children:u.description})]})]}),d<t.length-1&&l.jsx("span",{className:"cny-stepper-connector","aria-hidden":"true"})]},d)})})});exports.Accordion=zD;exports.AccordionContent=qD;exports.AccordionItem=YD;exports.AccordionTrigger=XD;exports.Alert=LS;exports.AspectRatio=a0;exports.Autocomplete=SD;exports.Avatar=VS;exports.AvatarStack=FS;exports.Box=en;exports.Breadcrumb=PD;exports.Button=hf;exports.ButtonGroup=fC;exports.Card=IS;exports.Center=c0;exports.Checkbox=fE;exports.Chip=aD;exports.CommandPalette=UE;exports.CommandPaletteTrigger=KE;exports.Container=o0;exports.DatePicker=WE;exports.Dialog=QE;exports.DialogClose=eM;exports.DialogTrigger=JE;exports.Divider=s0;exports.Drawer=tM;exports.DrawerClose=rM;exports.DrawerTrigger=nM;exports.FAB=hC;exports.Field=f0;exports.Grid=r0;exports.Group=l0;exports.IconButton=pC;exports.Input=kS;exports.List=cD;exports.ListItem=lD;exports.ListSeparator=uD;exports.ListSubheader=dD;exports.Menu=CA;exports.MenuCheckboxItem=PA;exports.MenuContent=RA;exports.MenuItem=TA;exports.MenuLabel=AA;exports.MenuRadioGroup=EA;exports.MenuRadioItem=MA;exports.MenuSeparator=DA;exports.MenuSub=NA;exports.MenuSubContent=kA;exports.MenuSubTrigger=jA;exports.MenuTrigger=SA;exports.MultiSelect=aE;exports.Navbar=KS;exports.NavbarActions=XS;exports.NavbarBrand=HS;exports.NavbarItem=YS;exports.NavbarNav=zS;exports.Pagination=TD;exports.Popover=nD;exports.PopoverAnchor=oD;exports.PopoverClose=sD;exports.PopoverContent=iD;exports.PopoverTrigger=rD;exports.Progress=$S;exports.ProgressRing=BS;exports.Radio=RE;exports.RadioGroup=SE;exports.Row=n0;exports.Scroll=jf;exports.ScrollRegion=GS;exports.Select=uP;exports.SelectGroup=fP;exports.SelectItem=dP;exports.SelectLabel=hP;exports.SelectSeparator=pP;exports.Sidebar=qS;exports.SidebarItem=QS;exports.SidebarSection=ZS;exports.Skeleton=US;exports.Slider=g1;exports.Spacer=i0;exports.Stack=t0;exports.Stepper=v1;exports.Switch=AE;exports.Tabs=yD;exports.TabsContent=wD;exports.TabsList=xD;exports.TabsTrigger=bD;exports.Text=d0;exports.Textarea=h0;exports.ToastProvider=XE;exports.ToggleButton=TC;exports.ToggleButtonGroup=zC;exports.ToggleButtonGroupItem=YC;exports.Tooltip=QA;exports.TooltipContent=tD;exports.TooltipProvider=ZA;exports.TooltipRoot=JA;exports.TooltipTrigger=eD;exports.useCommandPalette=GE;exports.useToast=ZE;
|
|
174
189
|
//# sourceMappingURL=index.cjs.map
|