chesai-ui 0.1.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/LICENSE +21 -0
- package/README.md +18 -0
- package/dist/chesai-ui.css +1 -0
- package/dist/chesai-ui.es.js +23190 -0
- package/dist/chesai-ui.umd.js +148 -0
- package/dist/components/accordion/index.d.ts +16 -0
- package/dist/components/appbar/index.d.ts +32 -0
- package/dist/components/avatar/AvatarGroup.d.ts +7 -0
- package/dist/components/avatar/index.d.ts +14 -0
- package/dist/components/badge/index.d.ts +10 -0
- package/dist/components/bottom-tabs/index.d.ts +31 -0
- package/dist/components/bouncy-box/index.d.ts +7 -0
- package/dist/components/button/index.d.ts +14 -0
- package/dist/components/button-group/index.d.ts +11 -0
- package/dist/components/calendar/index.d.ts +8 -0
- package/dist/components/card/index.d.ts +12 -0
- package/dist/components/checkbox/index.d.ts +5 -0
- package/dist/components/chip/index.d.ts +11 -0
- package/dist/components/context-menu/index.d.ts +34 -0
- package/dist/components/date-picker/header.d.ts +9 -0
- package/dist/components/date-picker/index.d.ts +10 -0
- package/dist/components/date-picker/input-view.d.ts +9 -0
- package/dist/components/date-picker/paginated-calendar.d.ts +8 -0
- package/dist/components/dialog/index.d.ts +37 -0
- package/dist/components/dropdown-menu/index.d.ts +31 -0
- package/dist/components/elastic-scroll-area/index.d.ts +24 -0
- package/dist/components/fab/index.d.ts +15 -0
- package/dist/components/icon-button/index.d.ts +12 -0
- package/dist/components/index.d.ts +28 -0
- package/dist/components/input/index.d.ts +18 -0
- package/dist/components/item/index.d.ts +30 -0
- package/dist/components/menubar/index.d.ts +38 -0
- package/dist/components/navigation-menu/index.d.ts +23 -0
- package/dist/components/otp-field/index.d.ts +34 -0
- package/dist/components/pull-to-refresh/index.d.ts +17 -0
- package/dist/components/radio-group/index.d.ts +18 -0
- package/dist/components/select/index.d.ts +51 -0
- package/dist/components/shallow-router/index.d.ts +63 -0
- package/dist/components/sheet/index.d.ts +41 -0
- package/dist/components/sidebar/index.d.ts +76 -0
- package/dist/components/slider/index.d.ts +9 -0
- package/dist/components/split-button/index.d.ts +19 -0
- package/dist/components/switch/index.d.ts +12 -0
- package/dist/components/table/index.d.ts +43 -0
- package/dist/components/tabs/index.d.ts +42 -0
- package/dist/components/taskbar/index.d.ts +23 -0
- package/dist/components/textarea/index.d.ts +17 -0
- package/dist/components/time-picker/index.d.ts +12 -0
- package/dist/components/toast/index.d.ts +9 -0
- package/dist/components/tooltip/index.d.ts +33 -0
- package/dist/components/typography/index.d.ts +30 -0
- package/dist/components/window-controls/index.d.ts +2 -0
- package/dist/context/List.context.d.ts +12 -0
- package/dist/hooks/use-calender.d.ts +16 -0
- package/dist/hooks/use-time-picker.d.ts +15 -0
- package/dist/hooks/useAppBar.d.ts +36 -0
- package/dist/hooks/useShallowRouter.d.ts +25 -0
- package/dist/index.d.ts +1 -0
- package/dist/storybook-utils.d.ts +4 -0
- package/package.json +50 -0
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
(function(W,p){typeof exports=="object"&&typeof module<"u"?p(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],p):(W=typeof globalThis<"u"?globalThis:W||self,p(W["chesai-ui"]={},W["react/jsx-runtime"],W.React,W.ReactDOM))})(this,(function(W,p,y,ai){"use strict";var iL=Object.defineProperty;var aL=(W,p,y)=>p in W?iL(W,p,{enumerable:!0,configurable:!0,writable:!0,value:y}):W[p]=y;var G=(W,p,y)=>aL(W,typeof p!="symbol"?p+"":p,y);function $l(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=$l(y),wr=$l(ai);function Hl(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Hl(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function H(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Hl(e))&&(r&&(r+=" "),r+=t);return r}const jl=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Yl=H,Me=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Yl(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(l=>{const u=n==null?void 0:n[l],d=s==null?void 0:s[l];if(u===null)return null;const f=jl(u)||jl(d);return o[l][f]}),a=n&&Object.entries(n).reduce((l,u)=>{let[d,f]=u;return f===void 0||(l[d]=f),l},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((l,u)=>{let{class:d,className:f,...h}=u;return Object.entries(h).every(v=>{let[g,w]=v;return Array.isArray(w)?w.includes({...s,...a}[g]):{...s,...a}[g]===w})?[...l,d,f]:l},[]);return Yl(e,i,c,n==null?void 0:n.class,n==null?void 0:n.className)},ci=y.createContext({});function Bn(e){const t=y.useRef(null);return t.current===null&&(t.current=e()),t.current}const li=typeof window<"u",yo=li?y.useLayoutEffect:y.useEffect,wo=y.createContext(null);function ui(e,t){e.indexOf(t)===-1&&e.push(t)}function bo(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const bt=(e,t,n)=>n>t?t:n<e?e:n;function di(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let Wn=()=>{},He=()=>{};process.env.NODE_ENV!=="production"&&(Wn=(e,t,n)=>{!e&&typeof console<"u"&&console.warn(di(t,n))},He=(e,t,n)=>{if(!e)throw new Error(di(t,n))});const Ht={},Ul=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function zl(e){return typeof e=="object"&&e!==null}const Kl=e=>/^0[^.\s]+$/u.test(e);function fi(e){let t;return()=>(t===void 0&&(t=e()),t)}const je=e=>e,ib=(e,t)=>n=>t(e(n)),br=(...e)=>e.reduce(ib),mn=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class hi{constructor(){this.subscriptions=[]}add(t){return ui(this.subscriptions,t),()=>bo(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 et=e=>e*1e3,xt=e=>e/1e3;function pi(e,t){return t?e*(1e3/t):0}const Gl=new Set;function xo(e,t,n){e||Gl.has(t)||(console.warn(di(t,n)),Gl.add(t))}const ab=(e,t,n)=>{const r=t-e;return((n-e)%r+r)%r+e},ql=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,cb=1e-7,lb=12;function ub(e,t,n,r,o){let s,i,a=0;do i=t+(n-t)/2,s=ql(i,r,o)-e,s>0?n=i:t=i;while(Math.abs(s)>cb&&++a<lb);return i}function xr(e,t,n,r){if(e===t&&n===r)return je;const o=s=>ub(s,0,1,e,n);return s=>s===0||s===1?s:ql(o(s),t,r)}const Xl=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Zl=e=>t=>1-e(1-t),Ql=xr(.33,1.53,.69,.99),mi=Zl(Ql),Jl=Xl(mi),eu=e=>(e*=2)<1?.5*mi(e):.5*(2-Math.pow(2,-10*(e-1))),gi=e=>1-Math.sin(Math.acos(e)),tu=Zl(gi),nu=Xl(gi),db=xr(.42,0,1,1),fb=xr(0,0,.58,1),ru=xr(.42,0,.58,1),ou=e=>Array.isArray(e)&&typeof e[0]!="number";function su(e,t){return ou(e)?e[ab(0,e.length,t)]:e}const iu=e=>Array.isArray(e)&&typeof e[0]=="number",au={linear:je,easeIn:db,easeInOut:ru,easeOut:fb,circIn:gi,circInOut:nu,circOut:tu,backIn:mi,backInOut:Jl,backOut:Ql,anticipate:eu},hb=e=>typeof e=="string",cu=e=>{if(iu(e)){He(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,r,o]=e;return xr(t,n,r,o)}else if(hb(e))return He(au[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),au[e];return e},So=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function pb(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 v=f&&o?n:r;return d&&i.add(u),v.has(u)||v.add(u),u},cancel:u=>{r.delete(u),i.delete(u)},process:u=>{if(a=u,o){s=!0;return}o=!0,[n,r]=[r,n],n.forEach(c),n.clear(),o=!1,s&&(s=!1,l.process(u))}};return l}const mb=40;function lu(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,i=So.reduce((x,C)=>(x[C]=pb(s),x),{}),{setup:a,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:h,postRender:v}=i,g=()=>{const x=Ht.useManualTiming?o.timestamp:performance.now();n=!1,Ht.useManualTiming||(o.delta=r?1e3/60:Math.max(Math.min(x-o.timestamp,mb),1)),o.timestamp=x,o.isProcessing=!0,a.process(o),c.process(o),l.process(o),u.process(o),d.process(o),f.process(o),h.process(o),v.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(g))},w=()=>{n=!0,r=!0,o.isProcessing||e(g)};return{schedule:So.reduce((x,C)=>{const E=i[C];return x[C]=(D,T=!1,P=!1)=>(n||w(),E.schedule(D,T,P)),x},{}),cancel:x=>{for(let C=0;C<So.length;C++)i[So[C]].cancel(x)},state:o,steps:i}}const{schedule:ge,cancel:ft,state:Ve,steps:vi}=lu(typeof requestAnimationFrame<"u"?requestAnimationFrame:je,!0);let Co;function gb(){Co=void 0}const Ye={now:()=>(Co===void 0&&Ye.set(Ve.isProcessing||Ht.useManualTiming?Ve.timestamp:performance.now()),Co),set:e=>{Co=e,queueMicrotask(gb)}},uu=e=>t=>typeof t=="string"&&t.startsWith(e),yi=uu("--"),vb=uu("var(--"),wi=e=>vb(e)?yb.test(e.split("/*")[0].trim()):!1,yb=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,$n={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Sr={...$n,transform:e=>bt(0,1,e)},To={...$n,default:1},Cr=e=>Math.round(e*1e5)/1e5,bi=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function wb(e){return e==null}const bb=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,xi=(e,t)=>n=>!!(typeof n=="string"&&bb.test(n)&&n.startsWith(e)||t&&!wb(n)&&Object.prototype.hasOwnProperty.call(n,t)),du=(e,t,n)=>r=>{if(typeof r!="string")return r;const[o,s,i,a]=r.match(bi);return{[e]:parseFloat(o),[t]:parseFloat(s),[n]:parseFloat(i),alpha:a!==void 0?parseFloat(a):1}},xb=e=>bt(0,255,e),Si={...$n,transform:e=>Math.round(xb(e))},gn={test:xi("rgb","red"),parse:du("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Si.transform(e)+", "+Si.transform(t)+", "+Si.transform(n)+", "+Cr(Sr.transform(r))+")"};function Sb(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 Ci={test:xi("#"),parse:Sb,transform:gn.transform},Tr=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Xt=Tr("deg"),St=Tr("%"),re=Tr("px"),Cb=Tr("vh"),Tb=Tr("vw"),fu={...St,parse:e=>St.parse(e)/100,transform:e=>St.transform(e*100)},Hn={test:xi("hsl","hue"),parse:du("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+St.transform(Cr(t))+", "+St.transform(Cr(n))+", "+Cr(Sr.transform(r))+")"},Ae={test:e=>gn.test(e)||Ci.test(e)||Hn.test(e),parse:e=>gn.test(e)?gn.parse(e):Hn.test(e)?Hn.parse(e):Ci.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?gn.transform(e):Hn.transform(e),getAnimatableNone:e=>{const t=Ae.parse(e);return t.alpha=0,Ae.transform(t)}},Eb=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Pb(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(bi))==null?void 0:t.length)||0)+(((n=e.match(Eb))==null?void 0:n.length)||0)>0}const hu="number",pu="color",Db="var",Mb="var(",mu="${}",Ob=/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 Er(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let s=0;const a=t.replace(Ob,c=>(Ae.test(c)?(r.color.push(s),o.push(pu),n.push(Ae.parse(c))):c.startsWith(Mb)?(r.var.push(s),o.push(Db),n.push(c)):(r.number.push(s),o.push(hu),n.push(parseFloat(c))),++s,mu)).split(mu);return{values:n,split:a,indexes:r,types:o}}function gu(e){return Er(e).values}function vu(e){const{split:t,types:n}=Er(e),r=t.length;return o=>{let s="";for(let i=0;i<r;i++)if(s+=t[i],o[i]!==void 0){const a=n[i];a===hu?s+=Cr(o[i]):a===pu?s+=Ae.transform(o[i]):s+=o[i]}return s}}const Nb=e=>typeof e=="number"?0:Ae.test(e)?Ae.getAnimatableNone(e):e;function Ab(e){const t=gu(e);return vu(e)(t.map(Nb))}const Zt={test:Pb,parse:gu,createTransformer:vu,getAnimatableNone:Ab};function Ti(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 kb({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=Ti(c,a,e+1/3),s=Ti(c,a,e),i=Ti(c,a,e-1/3)}return{red:Math.round(o*255),green:Math.round(s*255),blue:Math.round(i*255),alpha:r}}function Eo(e,t){return n=>n>0?t:e}const be=(e,t,n)=>e+(t-e)*n,Ei=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},Ib=[Ci,gn,Hn],_b=e=>Ib.find(t=>t.test(e));function yu(e){const t=_b(e);if(Wn(!!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===Hn&&(n=kb(n)),n}const wu=(e,t)=>{const n=yu(e),r=yu(t);if(!n||!r)return Eo(e,t);const o={...n};return s=>(o.red=Ei(n.red,r.red,s),o.green=Ei(n.green,r.green,s),o.blue=Ei(n.blue,r.blue,s),o.alpha=be(n.alpha,r.alpha,s),gn.transform(o))},Pi=new Set(["none","hidden"]);function Fb(e,t){return Pi.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Lb(e,t){return n=>be(e,t,n)}function Di(e){return typeof e=="number"?Lb:typeof e=="string"?wi(e)?Eo:Ae.test(e)?wu:Bb:Array.isArray(e)?bu:typeof e=="object"?Ae.test(e)?wu:Vb:Eo}function bu(e,t){const n=[...e],r=n.length,o=e.map((s,i)=>Di(s)(s,t[i]));return s=>{for(let i=0;i<r;i++)n[i]=o[i](s);return n}}function Vb(e,t){const n={...e,...t},r={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(r[o]=Di(e[o])(e[o],t[o]));return o=>{for(const s in r)n[s]=r[s](o);return n}}function Rb(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 Bb=(e,t)=>{const n=Zt.createTransformer(t),r=Er(e),o=Er(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?Pi.has(e)&&!o.values.length||Pi.has(t)&&!r.values.length?Fb(e,t):br(bu(Rb(r,o),o.values),n):(Wn(!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"),Eo(e,t))};function xu(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?be(e,t,n):Di(e)(e,t)}const Wb=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>ge.update(t,n),stop:()=>ft(t),now:()=>Ve.isProcessing?Ve.timestamp:Ye.now()}},Su=(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)})`},Po=2e4;function Mi(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Po;)t+=n,r=e.next(t);return t>=Po?1/0:t}function Cu(e,t=100,n){const r=n({...e,keyframes:[0,t]}),o=Math.min(Mi(r),Po);return{type:"keyframes",ease:s=>r.next(o*s).value/t,duration:xt(o)}}const $b=5;function Tu(e,t,n){const r=Math.max(t-$b,0);return pi(n-e(r),t-r)}const xe={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},Oi=.001;function Hb({duration:e=xe.duration,bounce:t=xe.bounce,velocity:n=xe.velocity,mass:r=xe.mass}){let o,s;Wn(e<=et(xe.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let i=1-t;i=bt(xe.minDamping,xe.maxDamping,i),e=bt(xe.minDuration,xe.maxDuration,xt(e)),i<1?(o=l=>{const u=l*i,d=u*e,f=u-n,h=Ni(l,i),v=Math.exp(-d);return Oi-f/h*v},s=l=>{const d=l*i*e,f=d*n+n,h=Math.pow(i,2)*Math.pow(l,2)*e,v=Math.exp(-d),g=Ni(Math.pow(l,2),i);return(-o(l)+Oi>0?-1:1)*((f-h)*v)/g}):(o=l=>{const u=Math.exp(-l*e),d=(l-n)*e+1;return-Oi+u*d},s=l=>{const u=Math.exp(-l*e),d=(n-l)*(e*e);return u*d});const a=5/e,c=Yb(o,s,a);if(e=et(e),isNaN(c))return{stiffness:xe.stiffness,damping:xe.damping,duration:e};{const l=Math.pow(c,2)*r;return{stiffness:l,damping:i*2*Math.sqrt(r*l),duration:e}}}const jb=12;function Yb(e,t,n){let r=n;for(let o=1;o<jb;o++)r=r-e(r)/t(r);return r}function Ni(e,t){return e*Math.sqrt(1-t*t)}const Ub=["duration","bounce"],zb=["stiffness","damping","mass"];function Eu(e,t){return t.some(n=>e[n]!==void 0)}function Kb(e){let t={velocity:xe.velocity,stiffness:xe.stiffness,damping:xe.damping,mass:xe.mass,isResolvedFromDuration:!1,...e};if(!Eu(e,zb)&&Eu(e,Ub))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),o=r*r,s=2*bt(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:xe.mass,stiffness:o,damping:s}}else{const n=Hb(e);t={...t,...n,mass:xe.mass},t.isResolvedFromDuration=!0}return t}function Pr(e=xe.visualDuration,t=xe.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:h}=Kb({...n,velocity:-xt(n.velocity||0)}),v=f||0,g=l/(2*Math.sqrt(c*u)),w=i-s,b=xt(Math.sqrt(c/u)),S=Math.abs(w)<5;r||(r=S?xe.restSpeed.granular:xe.restSpeed.default),o||(o=S?xe.restDelta.granular:xe.restDelta.default);let x;if(g<1){const E=Ni(b,g);x=D=>{const T=Math.exp(-g*b*D);return i-T*((v+g*b*w)/E*Math.sin(E*D)+w*Math.cos(E*D))}}else if(g===1)x=E=>i-Math.exp(-b*E)*(w+(v+b*w)*E);else{const E=b*Math.sqrt(g*g-1);x=D=>{const T=Math.exp(-g*b*D),P=Math.min(E*D,300);return i-T*((v+g*b*w)*Math.sinh(P)+E*w*Math.cosh(P))/E}}const C={calculatedDuration:h&&d||null,next:E=>{const D=x(E);if(h)a.done=E>=d;else{let T=E===0?v:0;g<1&&(T=E===0?et(v):Tu(x,E,D));const P=Math.abs(T)<=r,M=Math.abs(i-D)<=o;a.done=P&&M}return a.value=a.done?i:D,a},toString:()=>{const E=Math.min(Mi(C),Po),D=Su(T=>C.next(E*T).value,E,30);return E+"ms "+D},toTransition:()=>{}};return C}Pr.applyToOptions=e=>{const t=Cu(e,100,Pr);return e.ease=t.ease,e.duration=et(t.duration),e.type="keyframes",e};function Ai({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},h=P=>a!==void 0&&P<a||c!==void 0&&P>c,v=P=>a===void 0?c:c===void 0||Math.abs(a-P)<Math.abs(c-P)?a:c;let g=n*t;const w=d+g,b=i===void 0?w:i(w);b!==w&&(g=b-d);const S=P=>-g*Math.exp(-P/r),x=P=>b+S(P),C=P=>{const M=S(P),N=x(P);f.done=Math.abs(M)<=l,f.value=f.done?b:N};let E,D;const T=P=>{h(f.value)&&(E=P,D=Pr({keyframes:[f.value,v(f.value)],velocity:Tu(x,P,f.value),damping:o,stiffness:s,restDelta:l,restSpeed:u}))};return T(0),{calculatedDuration:null,next:P=>{let M=!1;return!D&&E===void 0&&(M=!0,C(P),T(P)),E!==void 0&&P>=E?D.next(P-E):(!M&&C(P),f)}}}function Gb(e,t,n){const r=[],o=n||Ht.mix||xu,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]||je:t;a=br(c,a)}r.push(a)}return r}function ki(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const s=e.length;if(He(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=Gb(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=mn(e[d],e[d+1],u);return a[d](f)};return n?u=>l(bt(e[0],e[s-1],u)):l}function Pu(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=mn(0,t,r);e.push(be(n,1,o))}}function Ii(e){const t=[0];return Pu(t,e.length-1),t}function qb(e,t){return e.map(n=>n*t)}function Xb(e,t){return e.map(()=>t||ru).splice(0,e.length-1)}function jn({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=ou(r)?r.map(cu):cu(r),s={done:!1,value:t[0]},i=qb(n&&n.length===t.length?n:Ii(t),e),a=ki(i,t,{ease:Array.isArray(o)?o:Xb(t,o)});return{calculatedDuration:e,next:c=>(s.value=a(c),s.done=c>=e,s)}}const Zb=e=>e!==null;function _i(e,{repeat:t,repeatType:n="loop"},r,o=1){const s=e.filter(Zb),a=o<0||t&&n!=="loop"&&t%2===1?0:s.length-1;return!a||r===void 0?s[a]:r}const Qb={decay:Ai,inertia:Ai,tween:jn,keyframes:jn,spring:Pr};function Du(e){typeof e.type=="string"&&(e.type=Qb[e.type])}class Fi{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 Jb=e=>e/100;class Do extends Fi{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var r,o;const{motionValue:n}=this.options;n&&n.updatedAt!==Ye.now()&&this.tick(Ye.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;Du(t);const{type:n=jn,repeat:r=0,repeatDelay:o=0,repeatType:s,velocity:i=0}=t;let{keyframes:a}=t;const c=n||jn;process.env.NODE_ENV!=="production"&&c!==jn&&He(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),c!==jn&&typeof a[0]!="number"&&(this.mixKeyframes=br(Jb,xu(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=Mi(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:h,type:v,onUpdate:g,finalKeyframe:w}=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 b=this.currentTime-l*(this.playbackSpeed>=0?1:-1),S=this.playbackSpeed>=0?b<0:b>o;this.currentTime=Math.max(b,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let x=this.currentTime,C=r;if(d){const P=Math.min(this.currentTime,o)/a;let M=Math.floor(P),N=P%1;!N&&P>=1&&(N=1),N===1&&M--,M=Math.min(M,d+1),!!(M%2)&&(f==="reverse"?(N=1-N,h&&(N-=h/a)):f==="mirror"&&(C=i)),x=bt(0,1,N)*a}const E=S?{done:!1,value:u[0]}:C.next(x);s&&(E.value=s(E.value));let{done:D}=E;!S&&c!==null&&(D=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);const T=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&D);return T&&v!==Ai&&(E.value=_i(u,this.options,w,this.speed)),g&&g(E.value),T&&this.finish(),E}then(t,n){return this.finished.then(t,n)}get duration(){return xt(this.calculatedDuration)}get time(){return xt(this.currentTime)}set time(t){var n;t=et(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(Ye.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=xt(this.currentTime))}play(){var o,s;if(this.isStopped)return;const{driver:t=Wb,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(Ye.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 e0(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const vn=e=>e*180/Math.PI,Li=e=>{const t=vn(Math.atan2(e[1],e[0]));return Vi(t)},t0={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Li,rotateZ:Li,skewX:e=>vn(Math.atan(e[1])),skewY:e=>vn(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Vi=e=>(e=e%360,e<0&&(e+=360),e),Mu=Li,Ou=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Nu=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),n0={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ou,scaleY:Nu,scale:e=>(Ou(e)+Nu(e))/2,rotateX:e=>Vi(vn(Math.atan2(e[6],e[5]))),rotateY:e=>Vi(vn(Math.atan2(-e[2],e[0]))),rotateZ:Mu,rotate:Mu,skewX:e=>vn(Math.atan(e[4])),skewY:e=>vn(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Ri(e){return e.includes("scale")?1:0}function Bi(e,t){if(!e||e==="none")return Ri(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,o;if(n)r=n0,o=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=t0,o=a}if(!o)return Ri(t);const s=r[t],i=o[1].split(",").map(o0);return typeof s=="function"?s(i):i[s]}const r0=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Bi(n,t)};function o0(e){return parseFloat(e.trim())}const Yn=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Un=new Set(Yn),Au=e=>e===$n||e===re,s0=new Set(["x","y","z"]),i0=Yn.filter(e=>!s0.has(e));function a0(e){const t=[];return i0.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const yn={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Bi(t,"x"),y:(e,{transform:t})=>Bi(t,"y")};yn.translateX=yn.x,yn.translateY=yn.y;const wn=new Set;let Wi=!1,$i=!1,Hi=!1;function ku(){if($i){const e=Array.from(wn).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const o=a0(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)})}$i=!1,Wi=!1,wn.forEach(e=>e.complete(Hi)),wn.clear()}function Iu(){wn.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&($i=!0)})}function c0(){Hi=!0,Iu(),ku(),Hi=!1}class ji{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?(wn.add(this),Wi||(Wi=!0,ge.read(Iu),ge.resolveKeyframes(ku))):(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])}e0(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),wn.delete(this)}cancel(){this.state==="scheduled"&&(wn.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const l0=e=>e.startsWith("--");function u0(e,t,n){l0(t)?e.style.setProperty(t,n):e.style[t]=n}const _u=fi(()=>window.ScrollTimeline!==void 0),d0={};function f0(e,t){const n=fi(e);return()=>d0[t]??n()}const Fu=f0(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Dr=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Lu={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Dr([0,.65,.55,1]),circOut:Dr([.55,0,1,.45]),backIn:Dr([.31,.01,.66,-.59]),backOut:Dr([.33,1.53,.69,.99])};function Vu(e,t){if(e)return typeof e=="function"?Fu()?Su(e,t):"ease-out":iu(e)?Dr(e):Array.isArray(e)?e.map(n=>Vu(n,t)||Lu.easeOut):Lu[e]}function h0(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=Vu(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 Yi(e){return typeof e=="function"&&"applyToOptions"in e}function p0({type:e,...t}){return Yi(e)&&Fu()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class m0 extends Fi{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!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,He(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const l=p0(t);this.animation=h0(n,r,o,l,s),l.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const u=_i(o,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(u):u0(n,r,u),this.animation.cancel()}c==null||c(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var t,n;this.isPseudoElement||(n=(t=this.animation).commitStyles)==null||n.call(t)}get duration(){var n,r;const t=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return xt(Number(t))}get time(){return xt(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=et(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){var r;return this.allowFlatten&&((r=this.animation.effect)==null||r.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&_u()?(this.animation.timeline=t,je):n(this)}}const Ru={anticipate:eu,backInOut:Jl,circInOut:nu};function g0(e){return e in Ru}function v0(e){typeof e.ease=="string"&&g0(e.ease)&&(e.ease=Ru[e.ease])}const Bu=10;class y0 extends m0{constructor(t){v0(t),Du(t),super(t),t.startTime&&(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 Do({...i,autoplay:!1}),c=et(this.finishedTime??this.time);n.setWithVelocity(a.sample(c-Bu).value,a.sample(c).value,Bu),a.stop()}}const Wu=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Zt.test(e)||e==="0")&&!e.startsWith("url("));function w0(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 b0(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=Wu(o,t),a=Wu(s,t);return Wn(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:w0(e)||(n==="spring"||Yi(n))&&r}function Ui(e){e.duration=0,e.type}const x0=new Set(["opacity","clipPath","filter","transform"]),S0=fi(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function C0(e){var u;const{motionValue:t,name:n,repeatDelay:r,repeatType:o,damping:s,type:i}=e;if(!(((u=t==null?void 0:t.owner)==null?void 0:u.current)instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:l}=t.owner.getProps();return S0()&&n&&x0.has(n)&&(n!=="transform"||!l)&&!c&&!r&&o!=="mirror"&&s!==0&&i!=="inertia"}const T0=40;class E0 extends Fi{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 v;super(),this.stop=()=>{var g,w;this._animation&&(this._animation.stop(),(g=this.stopTimeline)==null||g.call(this)),(w=this.keyframeResolver)==null||w.cancel()},this.createdAt=Ye.now();const f={autoplay:t,delay:n,type:r,repeat:o,repeatDelay:s,repeatType:i,name:c,motionValue:l,element:u,...d},h=(u==null?void 0:u.KeyframeResolver)||ji;this.keyframeResolver=new h(a,(g,w,b)=>this.onKeyframesResolved(g,w,f,!b),c,l,u),(v=this.keyframeResolver)==null||v.scheduleResolve()}onKeyframesResolved(t,n,r,o){this.keyframeResolver=void 0;const{name:s,type:i,velocity:a,delay:c,isHandoff:l,onUpdate:u}=r;this.resolvedAt=Ye.now(),b0(t,s,i,a)||((Ht.instantAnimations||!c)&&(u==null||u(_i(t,r,n))),t[0]=t[t.length-1],Ui(r),r.repeat=0);const f={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>T0?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},h=!l&&C0(f)?new y0({...f,element:f.motionValue.owner.current}):new Do(f);h.finished.then(()=>this.notifyFinished()).catch(je),this.pendingTimeline&&(this.stopTimeline=h.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=h}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),c0()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}class P0{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t){const n=this.animations.map(r=>r.attachTimeline(t));return()=>{n.forEach((r,o)=>{r&&r(),this.animations[o].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class D0 extends P0{then(t,n){return this.finished.finally(t).then(()=>{})}}const M0=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function O0(e){const t=M0.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${n??r}`,o]}const N0=4;function $u(e,t,n=1){He(n<=N0,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,o]=O0(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const i=s.trim();return Ul(i)?parseFloat(i):i}return wi(o)?$u(o,t,n+1):o}function zi(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const Hu=new Set(["width","height","top","left","right","bottom",...Yn]),A0={test:e=>e==="auto",parse:e=>e},ju=e=>t=>t.test(e),Yu=[$n,re,St,Xt,Tb,Cb,A0],Uu=e=>Yu.find(ju(e));function k0(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Kl(e):!0}const I0=new Set(["brightness","contrast","saturate","opacity"]);function _0(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(bi)||[];if(!r)return e;const o=n.replace(r,"");let s=I0.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+o+")"}const F0=/\b([a-z-]*)\(.*?\)/gu,Ki={...Zt,getAnimatableNone:e=>{const t=e.match(F0);return t?t.map(_0).join(" "):e}},zu={...$n,transform:Math.round},Gi={borderWidth:re,borderTopWidth:re,borderRightWidth:re,borderBottomWidth:re,borderLeftWidth:re,borderRadius:re,radius:re,borderTopLeftRadius:re,borderTopRightRadius:re,borderBottomRightRadius:re,borderBottomLeftRadius:re,width:re,maxWidth:re,height:re,maxHeight:re,top:re,right:re,bottom:re,left:re,padding:re,paddingTop:re,paddingRight:re,paddingBottom:re,paddingLeft:re,margin:re,marginTop:re,marginRight:re,marginBottom:re,marginLeft:re,backgroundPositionX:re,backgroundPositionY:re,...{rotate:Xt,rotateX:Xt,rotateY:Xt,rotateZ:Xt,scale:To,scaleX:To,scaleY:To,scaleZ:To,skew:Xt,skewX:Xt,skewY:Xt,distance:re,translateX:re,translateY:re,translateZ:re,x:re,y:re,z:re,perspective:re,transformPerspective:re,opacity:Sr,originX:fu,originY:fu,originZ:re},zIndex:zu,fillOpacity:Sr,strokeOpacity:Sr,numOctaves:zu},L0={...Gi,color:Ae,backgroundColor:Ae,outlineColor:Ae,fill:Ae,stroke:Ae,borderColor:Ae,borderTopColor:Ae,borderRightColor:Ae,borderBottomColor:Ae,borderLeftColor:Ae,filter:Ki,WebkitFilter:Ki},Ku=e=>L0[e];function Gu(e,t){let n=Ku(e);return n!==Ki&&(n=Zt),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const V0=new Set(["auto","none","0"]);function R0(e,t,n){let r=0,o;for(;r<e.length&&!o;){const s=e[r];typeof s=="string"&&!V0.has(s)&&Er(s).values.length&&(o=e[r]),r++}if(o&&n)for(const s of t)e[s]=Gu(n,o)}class B0 extends ji{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 c=0;c<t.length;c++){let l=t[c];if(typeof l=="string"&&(l=l.trim(),wi(l))){const u=$u(l,n.current);u!==void 0&&(t[c]=u),c===t.length-1&&(this.finalKeyframe=l)}}if(this.resolveNoneKeyframes(),!Hu.has(r)||t.length!==2)return;const[o,s]=t,i=Uu(o),a=Uu(s);if(i!==a)if(Au(i)&&Au(a))for(let c=0;c<t.length;c++){const l=t[c];typeof l=="string"&&(t[c]=parseFloat(l))}else yn[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let o=0;o<t.length;o++)(t[o]===null||k0(t[o]))&&r.push(o);r.length&&R0(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=yn[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]=yn[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 qi(e,t,n){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)}const qu=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Xi(e){return zl(e)&&"offsetHeight"in e}const Xu=30,W0=e=>!isNaN(parseFloat(e)),Mr={current:void 0};class $0{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var s;const o=Ye.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=Ye.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=W0(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&xo(!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 hi);const r=this.events[t].add(n);return t==="change"?()=>{r(),ge.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 Mr.current&&Mr.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=Ye.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Xu)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Xu);return pi(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 ht(e,t){return new $0(e,t)}const{schedule:Zi}=lu(queueMicrotask,!1),pt={x:!1,y:!1};function Zu(){return pt.x||pt.y}function H0(e){return e==="x"||e==="y"?pt[e]?null:(pt[e]=!0,()=>{pt[e]=!1}):pt.x||pt.y?null:(pt.x=pt.y=!0,()=>{pt.x=pt.y=!1})}function Qu(e,t){const n=qi(e),r=new AbortController,o={passive:!0,...t,signal:r.signal};return[n,o,()=>r.abort()]}function Ju(e){return!(e.pointerType==="touch"||Zu())}function j0(e,t,n={}){const[r,o,s]=Qu(e,n),i=a=>{if(!Ju(a))return;const{target:c}=a,l=t(c,a);if(typeof l!="function"||!c)return;const u=d=>{Ju(d)&&(l(d),c.removeEventListener("pointerleave",u))};c.addEventListener("pointerleave",u,o)};return r.forEach(a=>{a.addEventListener("pointerenter",i,o)}),s}const ed=(e,t)=>t?e===t?!0:ed(e,t.parentElement):!1,Qi=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Y0=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function U0(e){return Y0.has(e.tagName)||e.tabIndex!==-1}const Mo=new WeakSet;function td(e){return t=>{t.key==="Enter"&&e(t)}}function Ji(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const z0=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=td(()=>{if(Mo.has(n))return;Ji(n,"down");const o=td(()=>{Ji(n,"up")}),s=()=>Ji(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 nd(e){return Qi(e)&&!Zu()}function K0(e,t,n={}){const[r,o,s]=Qu(e,n),i=a=>{const c=a.currentTarget;if(!nd(a))return;Mo.add(c);const l=t(c,a),u=(h,v)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",f),Mo.has(c)&&Mo.delete(c),nd(h)&&typeof l=="function"&&l(h,{success:v})},d=h=>{u(h,c===window||c===document||n.useGlobalTarget||ed(c,h.target))},f=h=>{u(h,!1)};window.addEventListener("pointerup",d,o),window.addEventListener("pointercancel",f,o)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",i,o),Xi(a)&&(a.addEventListener("focus",l=>z0(l,o)),!U0(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),s}function Oo(e){return zl(e)&&"ownerSVGElement"in e}const No=new WeakMap;let Qt;const rd=(e,t,n)=>(r,o)=>o&&o[0]?o[0][e+"Size"]:Oo(r)&&"getBBox"in r?r.getBBox()[t]:r[n],G0=rd("inline","width","offsetWidth"),q0=rd("block","height","offsetHeight");function X0({target:e,borderBoxSize:t}){var n;(n=No.get(e))==null||n.forEach(r=>{r(e,{get width(){return G0(e,t)},get height(){return q0(e,t)}})})}function Z0(e){e.forEach(X0)}function Q0(){typeof ResizeObserver>"u"||(Qt=new ResizeObserver(Z0))}function J0(e,t){Qt||Q0();const n=qi(e);return n.forEach(r=>{let o=No.get(r);o||(o=new Set,No.set(r,o)),o.add(t),Qt==null||Qt.observe(r)}),()=>{n.forEach(r=>{const o=No.get(r);o==null||o.delete(t),o!=null&&o.size||Qt==null||Qt.unobserve(r)})}}const Ao=new Set;let zn;function ex(){zn=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Ao.forEach(t=>t(e))},window.addEventListener("resize",zn)}function tx(e){return Ao.add(e),zn||ex(),()=>{Ao.delete(e),!Ao.size&&typeof zn=="function"&&(window.removeEventListener("resize",zn),zn=void 0)}}function nx(e,t){return typeof e=="function"?tx(e):J0(e,t)}function od(e,t){let n;const r=()=>{const{currentTime:o}=t,i=(o===null?0:o.value)/100;n!==i&&e(i),n=i};return ge.preUpdate(r,!0),()=>ft(r)}function sd(e){return Oo(e)&&e.tagName==="svg"}function rx(...e){const t=!Array.isArray(e[0]),n=t?0:-1,r=e[0+n],o=e[1+n],s=e[2+n],i=e[3+n],a=ki(o,s,i);return t?a(r):a}const ke=e=>!!(e&&e.getVelocity);function ox(e,t,n){const r=e.get();let o=null,s=r,i;const a=typeof r=="string"?r.replace(/[\d.-]/g,""):void 0,c=()=>{o&&(o.stop(),o=null)},l=()=>{c(),o=new Do({keyframes:[ad(e.get()),ad(s)],velocity:e.getVelocity(),type:"spring",restDelta:.001,restSpeed:.01,...n,onUpdate:i})};if(e.attach((u,d)=>(s=u,i=f=>d(id(f,a)),ge.postRender(l),e.get()),c),ke(t)){const u=t.on("change",f=>e.set(id(f,a))),d=e.on("destroy",u);return()=>{u(),d()}}return c}function id(e,t){return t?e+t:e}function ad(e){return typeof e=="number"?e:parseFloat(e)}const sx=[...Yu,Ae,Zt],ix=e=>sx.find(ju(e)),Or=y.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class ax extends m.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=n.offsetParent,o=Xi(r)&&r.offsetWidth||0,s=this.props.sizeRef.current;s.height=n.offsetHeight||0,s.width=n.offsetWidth||0,s.top=n.offsetTop,s.left=n.offsetLeft,s.right=o-s.width-s.left}return null}componentDidUpdate(){}render(){return this.props.children}}function cx({children:e,isPresent:t,anchorX:n,root:r}){const o=y.useId(),s=y.useRef(null),i=y.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:a}=y.useContext(Or);return y.useInsertionEffect(()=>{const{width:c,height:l,top:u,left:d,right:f}=i.current;if(t||!s.current||!c||!l)return;const h=n==="left"?`left: ${d}`:`right: ${f}`;s.current.dataset.motionPopId=o;const v=document.createElement("style");a&&(v.nonce=a);const g=r??document.head;return g.appendChild(v),v.sheet&&v.sheet.insertRule(`
|
|
2
|
+
[data-motion-pop-id="${o}"] {
|
|
3
|
+
position: absolute !important;
|
|
4
|
+
width: ${c}px !important;
|
|
5
|
+
height: ${l}px !important;
|
|
6
|
+
${h}px !important;
|
|
7
|
+
top: ${u}px !important;
|
|
8
|
+
}
|
|
9
|
+
`),()=>{g.contains(v)&&g.removeChild(v)}},[t]),p.jsx(ax,{isPresent:t,childRef:s,sizeRef:i,children:m.cloneElement(e,{ref:s})})}const lx=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:s,mode:i,anchorX:a,root:c})=>{const l=Bn(ux),u=y.useId();let d=!0,f=y.useMemo(()=>(d=!1,{id:u,initial:t,isPresent:n,custom:o,onExitComplete:h=>{l.set(h,!0);for(const v of l.values())if(!v)return;r&&r()},register:h=>(l.set(h,!1),()=>l.delete(h))}),[n,l,r]);return s&&d&&(f={...f}),y.useMemo(()=>{l.forEach((h,v)=>l.set(v,!1))},[n]),m.useEffect(()=>{!n&&!l.size&&r&&r()},[n]),i==="popLayout"&&(e=p.jsx(cx,{isPresent:n,anchorX:a,root:c,children:e})),p.jsx(wo.Provider,{value:f,children:e})};function ux(){return new Map}function cd(e=!0){const t=y.useContext(wo);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=t,s=y.useId();y.useEffect(()=>{if(e)return o(s)},[e]);const i=y.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,i]:[!0]}const ko=e=>e.key||"";function ld(e){const t=[];return y.Children.forEach(e,n=>{y.isValidElement(n)&&t.push(n)}),t}const Kn=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:s="sync",propagate:i=!1,anchorX:a="left",root:c})=>{const[l,u]=cd(i),d=y.useMemo(()=>ld(e),[e]),f=i&&!l?[]:d.map(ko),h=y.useRef(!0),v=y.useRef(d),g=Bn(()=>new Map),[w,b]=y.useState(d),[S,x]=y.useState(d);yo(()=>{h.current=!1,v.current=d;for(let D=0;D<S.length;D++){const T=ko(S[D]);f.includes(T)?g.delete(T):g.get(T)!==!0&&g.set(T,!1)}},[S,f.length,f.join("-")]);const C=[];if(d!==w){let D=[...d];for(let T=0;T<S.length;T++){const P=S[T],M=ko(P);f.includes(M)||(D.splice(T,0,P),C.push(P))}return s==="wait"&&C.length&&(D=C),x(ld(D)),b(d),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:E}=y.useContext(ci);return p.jsx(p.Fragment,{children:S.map(D=>{const T=ko(D),P=i&&!l?!1:d===S||f.includes(T),M=()=>{if(g.has(T))g.set(T,!0);else return;let N=!0;g.forEach(_=>{_||(N=!1)}),N&&(E==null||E(),x(v.current),i&&(u==null||u()),r&&r())};return p.jsx(lx,{isPresent:P,initial:!h.current||n?void 0:!1,custom:t,presenceAffectsLayout:o,mode:s,root:c,onExitComplete:P?void 0:M,anchorX:a,children:D},T)})})},ud=y.createContext({strict:!1}),dd={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"]},Gn={};for(const e in dd)Gn[e]={isEnabled:t=>dd[e].some(n=>!!t[n])};function dx(e){for(const t in e)Gn[t]={...Gn[t],...e[t]}}const fx=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Io(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||fx.has(e)}let fd=e=>!Io(e);function hx(e){typeof e=="function"&&(fd=t=>t.startsWith("on")?!Io(t):e(t))}try{hx(require("@emotion/is-prop-valid").default)}catch{}function px(e,t,n){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||(fd(o)||n===!0&&Io(o)||!t&&!Io(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}const _o=y.createContext({});function Fo(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Nr(e){return typeof e=="string"||Array.isArray(e)}const ea=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ta=["initial",...ea];function Lo(e){return Fo(e.animate)||ta.some(t=>Nr(e[t]))}function hd(e){return!!(Lo(e)||e.variants)}function mx(e,t){if(Lo(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Nr(n)?n:void 0,animate:Nr(r)?r:void 0}}return e.inherit!==!1?t:{}}function gx(e){const{initial:t,animate:n}=mx(e,y.useContext(_o));return y.useMemo(()=>({initial:t,animate:n}),[pd(t),pd(n)])}function pd(e){return Array.isArray(e)?e.join(" "):e}const Ar={};function vx(e){for(const t in e)Ar[t]=e[t],yi(t)&&(Ar[t].isCSSVariable=!0)}function md(e,{layout:t,layoutId:n}){return Un.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Ar[e]||e==="opacity")}const yx={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},wx=Yn.length;function bx(e,t,n){let r="",o=!0;for(let s=0;s<wx;s++){const i=Yn[s],a=e[i];if(a===void 0)continue;let c=!0;if(typeof a=="number"?c=a===(i.startsWith("scale")?1:0):c=parseFloat(a)===0,!c||n){const l=qu(a,Gi[i]);if(!c){o=!1;const u=yx[i]||i;r+=`${u}(${l}) `}n&&(t[i]=l)}}return r=r.trim(),n?r=n(t,o?"":r):o&&(r="none"),r}function na(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(Un.has(c)){i=!0;continue}else if(yi(c)){o[c]=l;continue}else{const u=qu(l,Gi[c]);c.startsWith("origin")?(a=!0,s[c]=u):r[c]=u}}if(t.transform||(i||n?r.transform=bx(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}`}}const ra=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function gd(e,t,n){for(const r in t)!ke(t[r])&&!md(r,n)&&(e[r]=t[r])}function xx({transformTemplate:e},t){return y.useMemo(()=>{const n=ra();return na(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Sx(e,t){const n=e.style||{},r={};return gd(r,n,e),Object.assign(r,xx(e,t)),r}function Cx(e,t){const n={},r=Sx(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 Tx={offset:"stroke-dashoffset",array:"stroke-dasharray"},Ex={offset:"strokeDashoffset",array:"strokeDasharray"};function Px(e,t,n=1,r=0,o=!0){e.pathLength=1;const s=o?Tx:Ex;e[s.offset]=re.transform(-r);const i=re.transform(t),a=re.transform(n);e[s.array]=`${i} ${a}`}function vd(e,{attrX:t,attrY:n,attrScale:r,pathLength:o,pathSpacing:s=1,pathOffset:i=0,...a},c,l,u){if(na(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),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),o!==void 0&&Px(d,o,s,i,!1)}const yd=()=>({...ra(),attrs:{}}),wd=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Dx(e,t,n,r){const o=y.useMemo(()=>{const s=yd();return vd(s,t,wd(r),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};gd(s,e.style,e),o.style={...s,...o.style}}return o}const Mx=["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 oa(e){return typeof e!="string"||e.includes("-")?!1:!!(Mx.indexOf(e)>-1||/[A-Z]/u.test(e))}function Ox(e,t,n,{latestValues:r},o,s=!1){const a=(oa(e)?Dx:Cx)(t,r,o,e),c=px(t,typeof e=="string",s),l=e!==y.Fragment?{...c,...a,ref:n}:{},{children:u}=t,d=y.useMemo(()=>ke(u)?u.get():u,[u]);return y.createElement(e,{...l,children:d})}function bd(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function sa(e,t,n,r){if(typeof t=="function"){const[o,s]=bd(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]=bd(r);t=t(n!==void 0?n:e.custom,o,s)}return t}function Vo(e){return ke(e)?e.get():e}function Nx({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,o){return{latestValues:Ax(n,r,o,e),renderState:t()}}function Ax(e,t,n,r){const o={},s=r(e,{});for(const f in s)o[f]=Vo(s[f]);let{initial:i,animate:a}=e;const c=Lo(e),l=hd(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"&&!Fo(d)){const f=Array.isArray(d)?d:[d];for(let h=0;h<f.length;h++){const v=sa(e,f[h]);if(v){const{transitionEnd:g,transition:w,...b}=v;for(const S in b){let x=b[S];if(Array.isArray(x)){const C=u?x.length-1:0;x=x[C]}x!==null&&(o[S]=x)}for(const S in g)o[S]=g[S]}}}return o}const xd=e=>(t,n)=>{const r=y.useContext(_o),o=y.useContext(wo),s=()=>Nx(e,t,r,o);return n?s():Bn(s)};function ia(e,t,n){var s;const{style:r}=e,o={};for(const i in r)(ke(r[i])||t.style&&ke(t.style[i])||md(i,e)||((s=n==null?void 0:n.getValue(i))==null?void 0:s.liveStyle)!==void 0)&&(o[i]=r[i]);return o}const kx=xd({scrapeMotionValuesFromProps:ia,createRenderState:ra});function Sd(e,t,n){const r=ia(e,t,n);for(const o in e)if(ke(e[o])||ke(t[o])){const s=Yn.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[s]=e[o]}return r}const Ix=xd({scrapeMotionValuesFromProps:Sd,createRenderState:yd}),_x=Symbol.for("motionComponentSymbol");function qn(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Fx(e,t,n){return y.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):qn(n)&&(n.current=r))},[t,n])}const aa=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Cd="data-"+aa("framerAppearId"),Td=y.createContext({});function Lx(e,t,n,r,o){var g,w;const{visualElement:s}=y.useContext(_o),i=y.useContext(ud),a=y.useContext(wo),c=y.useContext(Or).reducedMotion,l=y.useRef(null);r=r||i.renderer,!l.current&&r&&(l.current=r(e,{visualState:t,parent:s,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:c}));const u=l.current,d=y.useContext(Td);u&&!u.projection&&o&&(u.type==="html"||u.type==="svg")&&Vx(l.current,n,o,d);const f=y.useRef(!1);y.useInsertionEffect(()=>{u&&f.current&&u.update(n,a)});const h=n[Cd],v=y.useRef(!!h&&!((g=window.MotionHandoffIsComplete)!=null&&g.call(window,h))&&((w=window.MotionHasOptimisedAnimation)==null?void 0:w.call(window,h)));return yo(()=>{u&&(f.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),u.scheduleRenderMicrotask(),v.current&&u.animationState&&u.animationState.animateChanges())}),y.useEffect(()=>{u&&(!v.current&&u.animationState&&u.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{var b;(b=window.MotionHandoffMarkAsComplete)==null||b.call(window,h)}),v.current=!1),u.enteringChildren=void 0)}),u}function Vx(e,t,n,r){const{layoutId:o,layout:s,drag:i,dragConstraints:a,layoutScroll:c,layoutRoot:l,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Ed(e.parent)),e.projection.setOptions({layoutId:o,layout:s,alwaysMeasureLayout:!!i||a&&qn(a),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:u,layoutScroll:c,layoutRoot:l})}function Ed(e){if(e)return e.options.allowProjection!==!1?e.projection:Ed(e.parent)}function ca(e,{forwardMotionProps:t=!1}={},n,r){n&&dx(n);const o=oa(e)?Ix:kx;function s(a,c){let l;const u={...y.useContext(Or),...a,layoutId:Rx(a)},{isStatic:d}=u,f=gx(a),h=o(a,d);if(!d&&li){Bx(u,n);const v=Wx(u);l=v.MeasureLayout,f.visualElement=Lx(e,h,u,r,v.ProjectionNode)}return p.jsxs(_o.Provider,{value:f,children:[l&&f.visualElement?p.jsx(l,{visualElement:f.visualElement,...u}):null,Ox(e,a,Fx(h,f.visualElement,c),h,d,t)]})}s.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const i=y.forwardRef(s);return i[_x]=e,i}function Rx({layoutId:e}){const t=y.useContext(ci).id;return t&&e!==void 0?t+"-"+e:e}function Bx(e,t){const n=y.useContext(ud).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?Wn(!1,r,"lazy-strict-mode"):He(!1,r,"lazy-strict-mode")}}function Wx(e){const{drag:t,layout:n}=Gn;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function $x(e,t){if(typeof Proxy>"u")return ca;const n=new Map,r=(s,i)=>ca(s,i,e,t),o=(s,i)=>(process.env.NODE_ENV!=="production"&&xo(!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,ca(i,void 0,e,t)),n.get(i))})}function Pd({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Hx({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function jx(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 la(e){return e===void 0||e===1}function ua({scale:e,scaleX:t,scaleY:n}){return!la(e)||!la(t)||!la(n)}function bn(e){return ua(e)||Dd(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Dd(e){return Md(e.x)||Md(e.y)}function Md(e){return e&&e!=="0%"}function Ro(e,t,n){const r=e-n,o=t*r;return n+o}function Od(e,t,n,r,o){return o!==void 0&&(e=Ro(e,o,r)),Ro(e,n,r)+t}function da(e,t=0,n=1,r,o){e.min=Od(e.min,t,n,r,o),e.max=Od(e.max,t,n,r,o)}function Nd(e,{x:t,y:n}){da(e.x,t.translate,t.scale,t.originPoint),da(e.y,n.translate,n.scale,n.originPoint)}const Ad=.999999999999,kd=1.0000000000001;function Yx(e,t,n,r=!1){const o=n.length;if(!o)return;t.x=t.y=1;let s,i;for(let a=0;a<o;a++){s=n[a],i=s.projectionDelta;const{visualElement:c}=s.options;c&&c.props.style&&c.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&Zn(e,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),i&&(t.x*=i.x.scale,t.y*=i.y.scale,Nd(e,i)),r&&bn(s.latestValues)&&Zn(e,s.latestValues))}t.x<kd&&t.x>Ad&&(t.x=1),t.y<kd&&t.y>Ad&&(t.y=1)}function Xn(e,t){e.min=e.min+t,e.max=e.max+t}function Id(e,t,n,r,o=.5){const s=be(e.min,e.max,o);da(e,t,n,s,r)}function Zn(e,t){Id(e.x,t.x,t.scaleX,t.scale,t.originX),Id(e.y,t.y,t.scaleY,t.scale,t.originY)}function _d(e,t){return Pd(jx(e.getBoundingClientRect(),t))}function Ux(e,t,n){const r=_d(e,n),{scroll:o}=t;return o&&(Xn(r.x,o.offset.x),Xn(r.y,o.offset.y)),r}const Fd=()=>({translate:0,scale:1,origin:0,originPoint:0}),Qn=()=>({x:Fd(),y:Fd()}),Ld=()=>({min:0,max:0}),Pe=()=>({x:Ld(),y:Ld()}),fa={current:null},Vd={current:!1};function zx(){if(Vd.current=!0,!!li)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>fa.current=e.matches;e.addEventListener("change",t),t()}else fa.current=!1}const kr=new WeakMap;function Kx(e,t,n){for(const r in t){const o=t[r],s=n[r];if(ke(o))e.addValue(r,o);else if(ke(s))e.addValue(r,ht(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,ht(i!==void 0?i:o,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Rd=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Bd{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:o,blockInitialAnimation:s,visualState:i},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=ji,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const f=Ye.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,ge.render(this.render,!1,!0))};const{latestValues:c,renderState:l}=i;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=l,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.options=a,this.blockInitialAnimation=!!s,this.isControllingVariants=Lo(n),this.isVariantNode=hd(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...d}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in d){const h=d[f];c[f]!==void 0&&ke(h)&&h.set(c[f])}}mount(t){var n;this.current=t,kr.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((r,o)=>this.bindToMotionValue(o,r)),Vd.current||zx(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:fa.current,process.env.NODE_ENV!=="production"&&xo(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),(n=this.parent)==null||n.addChild(this),this.update(this.props,this.presenceContext)}unmount(){var t;this.projection&&this.projection.unmount(),ft(this.notifyUpdate),ft(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){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=Un.has(t);r&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",i=>{this.latestValues[t]=i,this.props.onUpdate&&ge.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;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 Gn){const n=Gn[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):Pe()}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<Rd.length;r++){const o=Rd[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=Kx(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=ht(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"&&(Ul(r)||Kl(r))?r=parseFloat(r):!ix(r)&&Zt.test(n)&&(r=Gu(t,n)),this.setBaseTarget(t,ke(r)?r.get():r)),ke(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=sa(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&&!ke(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 hi),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Zi.render(this.render)}}class Wd extends Bd{constructor(){super(...arguments),this.KeyframeResolver=B0}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;ke(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function $d(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 Gx(e){return window.getComputedStyle(e)}class Hd extends Wd{constructor(){super(...arguments),this.type="html",this.renderInstance=$d}readValueFromInstance(t,n){var r;if(Un.has(n))return(r=this.projection)!=null&&r.isProjecting?Ri(n):r0(t,n);{const o=Gx(t),s=(yi(n)?o.getPropertyValue(n):o[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return _d(t,n)}build(t,n,r){na(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return ia(t,n,r)}}const jd=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function qx(e,t,n,r){$d(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(jd.has(o)?o:aa(o),t.attrs[o])}class Yd extends Wd{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Pe}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Un.has(n)){const r=Ku(n);return r&&r.default||0}return n=jd.has(n)?n:aa(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return Sd(t,n,r)}build(t,n,r){vd(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,o){qx(t,n,r,o)}mount(t){this.isSVGTag=wd(t.tagName),super.mount(t)}}const Xx=(e,t)=>oa(e)?new Yd(t):new Hd(t,{allowProjection:e!==y.Fragment});function Jn(e,t,n){const r=e.getProps();return sa(r,t,n!==void 0?n:r.custom,e)}const ha=e=>Array.isArray(e);function Zx(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,ht(n))}function Qx(e){return ha(e)?e[e.length-1]||0:e}function Jx(e,t){const n=Jn(e,t);let{transitionEnd:r={},transition:o={},...s}=n||{};s={...s,...r};for(const i in s){const a=Qx(s[i]);Zx(e,i,a)}}function eS(e){return!!(ke(e)&&e.add)}function pa(e,t){const n=e.getValue("willChange");if(eS(n))return n.add(t);if(!n&&Ht.WillChange){const r=new Ht.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Ud(e){return e.props[Cd]}const tS=e=>e!==null;function nS(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter(tS),s=t&&n!=="loop"&&t%2===1?0:o.length-1;return o[s]}const rS={type:"spring",stiffness:500,damping:25,restSpeed:10},oS=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),sS={type:"keyframes",duration:.8},iS={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},aS=(e,{keyframes:t})=>t.length>2?sS:Un.has(e)?e.startsWith("scale")?oS(t[1]):rS:iS;function cS({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:s,repeatType:i,repeatDelay:a,from:c,elapsed:l,...u}){return!!Object.keys(u).length}const ma=(e,t,n,r={},o,s)=>i=>{const a=zi(r,e)||{},c=a.delay||r.delay||0;let{elapsed:l=0}=r;l=l-et(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};cS(a)||Object.assign(u,aS(e,u)),u.duration&&(u.duration=et(u.duration)),u.repeatDelay&&(u.repeatDelay=et(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(Ui(u),u.delay===0&&(d=!0)),(Ht.instantAnimations||Ht.skipAnimations)&&(d=!0,Ui(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,d&&!s&&t.get()!==void 0){const f=nS(u.keyframes,a);if(f!==void 0){ge.update(()=>{u.onUpdate(f),u.onComplete()});return}}return a.isSync?new Do(u):new E0(u)};function lS({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function ga(e,t,{delay:n=0,transitionOverride:r,type:o}={}){let{transition:s=e.getDefaultTransition(),transitionEnd:i,...a}=t;r&&(s=r);const c=[],l=o&&e.animationState&&e.animationState.getState()[o];for(const u in a){const d=e.getValue(u,e.latestValues[u]??null),f=a[u];if(f===void 0||l&&lS(l,u))continue;const h={delay:n,...zi(s||{},u)},v=d.get();if(v!==void 0&&!d.isAnimating&&!Array.isArray(f)&&f===v&&!h.velocity)continue;let g=!1;if(window.MotionHandoffAnimation){const b=Ud(e);if(b){const S=window.MotionHandoffAnimation(b,u,ge);S!==null&&(h.startTime=S,g=!0)}}pa(e,u),d.start(ma(u,d,f,e.shouldReduceMotion&&Hu.has(u)?{type:!1}:h,e,g));const w=d.animation;w&&c.push(w)}return i&&Promise.all(c).then(()=>{ge.update(()=>{i&&Jx(e,i)})}),c}function zd(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}function va(e,t,n={}){var c;const r=Jn(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(ga(e,r,n)):()=>Promise.resolve(),i=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:u=0,staggerChildren:d,staggerDirection:f}=o;return uS(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 uS(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(va(c,t,{...i,delay:n+(typeof r=="function"?0:r)+zd(e.variantChildren,c,r,o,s)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(a)}function dS(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const o=t.map(s=>va(e,s,n));r=Promise.all(o)}else if(typeof t=="string")r=va(e,t,n);else{const o=typeof t=="function"?Jn(e,t,n.custom):t;r=Promise.all(ga(e,o,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function Kd(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 fS=ta.length;function Gd(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Gd(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<fS;n++){const r=ta[n],o=e.props[r];(Nr(o)||o===!1)&&(t[r]=o)}return t}const hS=[...ea].reverse(),pS=ea.length;function mS(e){return t=>Promise.all(t.map(({animation:n,options:r})=>dS(e,n,r)))}function gS(e){let t=mS(e),n=qd(),r=!0;const o=c=>(l,u)=>{var f;const d=Jn(e,u,c==="exit"?(f=e.presenceContext)==null?void 0:f.custom:void 0);if(d){const{transition:h,transitionEnd:v,...g}=d;l={...l,...g,...v}}return l};function s(c){t=c(e)}function i(c){const{props:l}=e,u=Gd(e.parent)||{},d=[],f=new Set;let h={},v=1/0;for(let w=0;w<pS;w++){const b=hS[w],S=n[b],x=l[b]!==void 0?l[b]:u[b],C=Nr(x),E=b===c?S.isActive:null;E===!1&&(v=w);let D=x===u[b]&&x!==l[b]&&C;if(D&&r&&e.manuallyAnimateOnMount&&(D=!1),S.protectedKeys={...h},!S.isActive&&E===null||!x&&!S.prevProp||Fo(x)||typeof x=="boolean")continue;const T=vS(S.prevProp,x);let P=T||b===c&&S.isActive&&!D&&C||w>v&&C,M=!1;const N=Array.isArray(x)?x:[x];let _=N.reduce(o(b),{});E===!1&&(_={});const{prevResolvedValues:V={}}=S,O={...V,..._},A=F=>{P=!0,f.has(F)&&(M=!0,f.delete(F)),S.needsAnimating[F]=!0;const k=e.getValue(F);k&&(k.liveStyle=!1)};for(const F in O){const k=_[F],I=V[F];if(h.hasOwnProperty(F))continue;let B=!1;ha(k)&&ha(I)?B=!Kd(k,I):B=k!==I,B?k!=null?A(F):f.add(F):k!==void 0&&f.has(F)?A(F):S.protectedKeys[F]=!0}S.prevProp=x,S.prevResolvedValues=_,S.isActive&&(h={...h,..._}),r&&e.blockInitialAnimation&&(P=!1);const L=D&&T;P&&(!L||M)&&d.push(...N.map(F=>{const k={type:b};if(typeof F=="string"&&r&&!L&&e.manuallyAnimateOnMount&&e.parent){const{parent:I}=e,B=Jn(I,F);if(I.enteringChildren&&B){const{delayChildren:U}=B.transition||{};k.delay=zd(I.enteringChildren,e,U)}}return{animation:F,options:k}}))}if(f.size){const w={};if(typeof l.initial!="boolean"){const b=Jn(e,Array.isArray(l.initial)?l.initial[0]:l.initial);b&&b.transition&&(w.transition=b.transition)}f.forEach(b=>{const S=e.getBaseTarget(b),x=e.getValue(b);x&&(x.liveStyle=!0),w[b]=S??null}),d.push({animation:w})}let g=!!d.length;return r&&(l.initial===!1||l.initial===l.animate)&&!e.manuallyAnimateOnMount&&(g=!1),r=!1,g?t(d):Promise.resolve()}function a(c,l){var d;if(n[c].isActive===l)return Promise.resolve();(d=e.variantChildren)==null||d.forEach(f=>{var h;return(h=f.animationState)==null?void 0:h.setActive(c,l)}),n[c].isActive=l;const u=i(c);for(const f in n)n[f].protectedKeys={};return u}return{animateChanges:i,setActive:a,setAnimateFunction:s,getState:()=>n,reset:()=>{n=qd(),r=!0}}}function vS(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Kd(t,e):!1}function xn(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function qd(){return{animate:xn(!0),whileInView:xn(),whileHover:xn(),whileTap:xn(),whileDrag:xn(),whileFocus:xn(),exit:xn()}}class Jt{constructor(t){this.isMounted=!1,this.node=t}update(){}}class yS extends Jt{constructor(t){super(t),t.animationState||(t.animationState=gS(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Fo(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 wS=0;class bS extends Jt{constructor(){super(...arguments),this.id=wS++}update(){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;const o=this.node.animationState.setActive("exit",!t);n&&!t&&o.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const xS={animation:{Feature:yS},exit:{Feature:bS}};function Ir(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function _r(e){return{point:{x:e.pageX,y:e.pageY}}}const SS=e=>t=>Qi(t)&&e(t,_r(t));function Fr(e,t,n,r){return Ir(e,t,SS(n),r)}const Xd=1e-4,CS=1-Xd,TS=1+Xd,Zd=.01,ES=0-Zd,PS=0+Zd;function $e(e){return e.max-e.min}function DS(e,t,n){return Math.abs(e-t)<=n}function Qd(e,t,n,r=.5){e.origin=r,e.originPoint=be(t.min,t.max,e.origin),e.scale=$e(n)/$e(t),e.translate=be(n.min,n.max,e.origin)-e.originPoint,(e.scale>=CS&&e.scale<=TS||isNaN(e.scale))&&(e.scale=1),(e.translate>=ES&&e.translate<=PS||isNaN(e.translate))&&(e.translate=0)}function Lr(e,t,n,r){Qd(e.x,t.x,n.x,r?r.originX:void 0),Qd(e.y,t.y,n.y,r?r.originY:void 0)}function Jd(e,t,n){e.min=n.min+t.min,e.max=e.min+$e(t)}function MS(e,t,n){Jd(e.x,t.x,n.x),Jd(e.y,t.y,n.y)}function ef(e,t,n){e.min=t.min-n.min,e.max=e.min+$e(t)}function Vr(e,t,n){ef(e.x,t.x,n.x),ef(e.y,t.y,n.y)}function tt(e){return[e("x"),e("y")]}const tf=({current:e})=>e?e.ownerDocument.defaultView:null,nf=(e,t)=>Math.abs(e-t);function OS(e,t){const n=nf(e.x,t.x),r=nf(e.y,t.y);return Math.sqrt(n**2+r**2)}class rf{constructor(t,n,{transformPagePoint:r,contextWindow:o=window,dragSnapToOrigin:s=!1,distanceThreshold:i=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const f=wa(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,v=OS(f.offset,{x:0,y:0})>=this.distanceThreshold;if(!h&&!v)return;const{point:g}=f,{timestamp:w}=Ve;this.history.push({...g,timestamp:w});const{onStart:b,onMove:S}=this.handlers;h||(b&&b(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),S&&S(this.lastMoveEvent,f)},this.handlePointerMove=(f,h)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=ya(h,this.transformPagePoint),ge.update(this.updatePoint,!0)},this.handlePointerUp=(f,h)=>{this.end();const{onEnd:v,onSessionEnd:g,resumeAnimation:w}=this.handlers;if(this.dragSnapToOrigin&&w&&w(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=wa(f.type==="pointercancel"?this.lastMoveEventInfo:ya(h,this.transformPagePoint),this.history);this.startEvent&&v&&v(f,b),g&&g(f,b)},!Qi(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=i,this.contextWindow=o||window;const a=_r(t),c=ya(a,this.transformPagePoint),{point:l}=c,{timestamp:u}=Ve;this.history=[{...l,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,wa(c,this.history)),this.removeListeners=br(Fr(this.contextWindow,"pointermove",this.handlePointerMove),Fr(this.contextWindow,"pointerup",this.handlePointerUp),Fr(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),ft(this.updatePoint)}}function ya(e,t){return t?{point:t(e.point)}:e}function of(e,t){return{x:e.x-t.x,y:e.y-t.y}}function wa({point:e},t){return{point:e,delta:of(e,sf(t)),offset:of(e,NS(t)),velocity:AS(t,.1)}}function NS(e){return e[0]}function sf(e){return e[e.length-1]}function AS(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=sf(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>et(t)));)n--;if(!r)return{x:0,y:0};const s=xt(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 kS(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?be(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?be(n,e,r.max):Math.min(e,n)),e}function af(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 IS(e,{top:t,left:n,bottom:r,right:o}){return{x:af(e.x,n,o),y:af(e.y,t,r)}}function cf(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 _S(e,t){return{x:cf(e.x,t.x),y:cf(e.y,t.y)}}function FS(e,t){let n=.5;const r=$e(e),o=$e(t);return o>r?n=mn(t.min,t.max-r,e.min):r>o&&(n=mn(e.min,e.max-o,t.min)),bt(0,1,n)}function LS(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 ba=.35;function VS(e=ba){return e===!1?e=0:e===!0&&(e=ba),{x:lf(e,"left","right"),y:lf(e,"top","bottom")}}function lf(e,t,n){return{min:uf(e,t),max:uf(e,n)}}function uf(e,t){return typeof e=="number"?e:e[t]||0}const RS=new WeakMap;class BS{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=Pe(),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=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(_r(d).point)},i=(d,f)=>{const{drag:h,dragPropagation:v,onDragStart:g}=this.getProps();if(h&&!v&&(this.openDragLock&&this.openDragLock(),this.openDragLock=H0(h),!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),tt(b=>{let S=this.getAxisMotionValue(b).get()||0;if(St.test(S)){const{projection:x}=this.visualElement;if(x&&x.layout){const C=x.layout.layoutBox[b];C&&(S=$e(C)*(parseFloat(S)/100))}}this.originPoint[b]=S}),g&&ge.postRender(()=>g(d,f)),pa(this.visualElement,"transform");const{animationState:w}=this.visualElement;w&&w.setActive("whileDrag",!0)},a=(d,f)=>{this.latestPointerEvent=d,this.latestPanInfo=f;const{dragPropagation:h,dragDirectionLock:v,onDirectionLock:g,onDrag:w}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:b}=f;if(v&&this.currentDirection===null){this.currentDirection=WS(b),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",f.point,b),this.updateAxis("y",f.point,b),this.visualElement.render(),w&&w(d,f)},c=(d,f)=>{this.latestPointerEvent=d,this.latestPanInfo=f,this.stop(d,f),this.latestPointerEvent=null,this.latestPanInfo=null},l=()=>tt(d=>{var f;return this.getAnimationState(d)==="paused"&&((f=this.getAxisMotionValue(d).animation)==null?void 0:f.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new rf(t,{onSessionStart:s,onStart:i,onMove:a,onSessionEnd:c,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:r,contextWindow:tf(this.visualElement)})}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&&ge.postRender(()=>a(r,o))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:o}=this.getProps();if(!r||!Bo(t,o,this.currentDirection))return;const s=this.getAxisMotionValue(t);let i=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(i=kS(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&&qn(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=IS(r.layoutBox,t):this.constraints=!1,this.elastic=VS(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&tt(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=LS(r.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!qn(t))return!1;const r=t.current;He(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=Ux(r,o.root,this.visualElement.getTransformPagePoint());let i=_S(o.layout.layoutBox,s);if(n){const a=n(Hx(i));this.hasMutatedConstraints=!!a,a&&(i=Pd(a))}return i}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:s,dragSnapToOrigin:i,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},l=tt(u=>{if(!Bo(u,n,this.currentDirection))return;let d=c&&c[u]||{};i&&(d={min:0,max:0});const f=o?200:1e6,h=o?40:1e7,v={type:"inertia",velocity:r?t[u]:0,bounceStiffness:f,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...s,...d};return this.startAxisValueAnimation(u,v)});return Promise.all(l).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return pa(this.visualElement,t),r.start(ma(t,r,0,n,this.visualElement,!1))}stopAnimation(){tt(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){tt(t=>{var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.state}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(!Bo(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];s.set(t[n]-be(i,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!qn(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]=FS({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.resolveConstraints(),tt(i=>{if(!Bo(i,t,null))return;const a=this.getAxisMotionValue(i),{min:c,max:l}=this.constraints[i];a.set(be(c,l,o[i]))})}addListeners(){if(!this.visualElement.current)return;RS.set(this.visualElement,this);const t=this.visualElement.current,n=Fr(t,"pointerdown",c=>{const{drag:l,dragListener:u=!0}=this.getProps();l&&u&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();qn(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,s=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),ge.read(r);const i=Ir(window,"resize",()=>this.scalePositionWithinConstraints()),a=o.addEventListener("didUpdate",(({delta:c,hasLayoutChanged:l})=>{this.isDragging&&l&&(tt(u=>{const d=this.getAxisMotionValue(u);d&&(this.originPoint[u]+=c[u].translate,d.set(d.get()+c[u].translate))}),this.visualElement.render())}));return()=>{i(),n(),s(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:s=!1,dragElastic:i=ba,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:s,dragElastic:i,dragMomentum:a}}}function Bo(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function WS(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class $S extends Jt{constructor(t){super(t),this.removeGroupControls=je,this.removeListeners=je,this.controls=new BS(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||je}unmount(){this.removeGroupControls(),this.removeListeners()}}const df=e=>(t,n)=>{e&&ge.postRender(()=>e(t,n))};class HS extends Jt{constructor(){super(...arguments),this.removePointerDownListener=je}onPointerDown(t){this.session=new rf(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:tf(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:df(t),onStart:df(n),onMove:r,onEnd:(s,i)=>{delete this.session,o&&ge.postRender(()=>o(s,i))}}}mount(){this.removePointerDownListener=Fr(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Wo={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function ff(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Rr={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(re.test(e))e=parseFloat(e);else return e;const n=ff(e,t.target.x),r=ff(e,t.target.y);return`${n}% ${r}%`}},jS={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=Zt.parse(e);if(o.length>5)return r;const s=Zt.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=be(a,c,.5);return typeof o[2+i]=="number"&&(o[2+i]/=l),typeof o[3+i]=="number"&&(o[3+i]/=l),s(o)}};let xa=!1;class YS extends y.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:s}=t;vx(US),s&&(n.group&&n.group.add(s),r&&r.register&&o&&r.register(s),xa&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),Wo.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:o,isPresent:s}=this.props,{projection:i}=r;return i&&(i.isPresent=s,xa=!0,o||t.layoutDependency!==n||n===void 0||t.isPresent!==s?i.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?i.promote():i.relegate()||ge.postRender(()=>{const a=i.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Zi.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=t;xa=!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 hf(e){const[t,n]=cd(),r=y.useContext(ci);return p.jsx(YS,{...e,layoutGroup:r,switchLayoutGroup:y.useContext(Td),isPresent:t,safeToRemove:n})}const US={borderRadius:{...Rr,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Rr,borderTopRightRadius:Rr,borderBottomLeftRadius:Rr,borderBottomRightRadius:Rr,boxShadow:jS};function pf(e,t,n){const r=ke(e)?e:ht(e);return r.start(ma("",r,t,n)),r.animation}const zS=(e,t)=>e.depth-t.depth;class KS{constructor(){this.children=[],this.isDirty=!1}add(t){ui(this.children,t),this.isDirty=!0}remove(t){bo(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(zS),this.isDirty=!1,this.children.forEach(t)}}function GS(e,t){const n=Ye.now(),r=({timestamp:o})=>{const s=o-n;s>=t&&(ft(r),e(s-t))};return ge.setup(r,!0),()=>ft(r)}const mf=["TopLeft","TopRight","BottomLeft","BottomRight"],qS=mf.length,gf=e=>typeof e=="string"?parseFloat(e):e,vf=e=>typeof e=="number"||re.test(e);function XS(e,t,n,r,o,s){o?(e.opacity=be(0,n.opacity??1,ZS(r)),e.opacityExit=be(t.opacity??1,0,QS(r))):s&&(e.opacity=be(t.opacity??1,n.opacity??1,r));for(let i=0;i<qS;i++){const a=`border${mf[i]}Radius`;let c=yf(t,a),l=yf(n,a);if(c===void 0&&l===void 0)continue;c||(c=0),l||(l=0),c===0||l===0||vf(c)===vf(l)?(e[a]=Math.max(be(gf(c),gf(l),r),0),(St.test(l)||St.test(c))&&(e[a]+="%")):e[a]=l}(t.rotate||n.rotate)&&(e.rotate=be(t.rotate||0,n.rotate||0,r))}function yf(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const ZS=wf(0,.5,tu),QS=wf(.5,.95,je);function wf(e,t,n){return r=>r<e?0:r>t?1:n(mn(e,t,r))}function bf(e,t){e.min=t.min,e.max=t.max}function nt(e,t){bf(e.x,t.x),bf(e.y,t.y)}function xf(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Sf(e,t,n,r,o){return e-=t,e=Ro(e,1/n,r),o!==void 0&&(e=Ro(e,1/o,r)),e}function JS(e,t=0,n=1,r=.5,o,s=e,i=e){if(St.test(t)&&(t=parseFloat(t),t=be(i.min,i.max,t/100)-i.min),typeof t!="number")return;let a=be(s.min,s.max,r);e===s&&(a-=t),e.min=Sf(e.min,t,n,a,o),e.max=Sf(e.max,t,n,a,o)}function Cf(e,t,[n,r,o],s,i){JS(e,t[n],t[r],t[o],t.scale,s,i)}const eC=["x","scaleX","originX"],tC=["y","scaleY","originY"];function Tf(e,t,n,r){Cf(e.x,t,eC,n?n.x:void 0,r?r.x:void 0),Cf(e.y,t,tC,n?n.y:void 0,r?r.y:void 0)}function Ef(e){return e.translate===0&&e.scale===1}function Pf(e){return Ef(e.x)&&Ef(e.y)}function Df(e,t){return e.min===t.min&&e.max===t.max}function nC(e,t){return Df(e.x,t.x)&&Df(e.y,t.y)}function Mf(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Of(e,t){return Mf(e.x,t.x)&&Mf(e.y,t.y)}function Nf(e){return $e(e.x)/$e(e.y)}function Af(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class rC{constructor(){this.members=[]}add(t){ui(this.members,t),t.scheduleRender()}remove(t){if(bo(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){const n=this.members.findIndex(o=>t===o);if(n===0)return!1;let r;for(let o=n;o>=0;o--){const s=this.members[o];if(s.isPresent!==!1){r=s;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;o===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function oC(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:h,skewY:v}=n;l&&(r=`perspective(${l}px) ${r}`),u&&(r+=`rotate(${u}deg) `),d&&(r+=`rotateX(${d}deg) `),f&&(r+=`rotateY(${f}deg) `),h&&(r+=`skewX(${h}deg) `),v&&(r+=`skewY(${v}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 Sa=["","X","Y","Z"],sC=1e3;let iC=0;function Ca(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function kf(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Ud(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",ge,!(o||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&kf(r)}function If({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(i={},a=t==null?void 0:t()){this.id=iC++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(lC),this.nodes.forEach(hC),this.nodes.forEach(pC),this.nodes.forEach(uC)},this.resolvedRelativeTargetAt=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 KS)}addEventListener(i,a){return this.eventHandlers.has(i)||this.eventHandlers.set(i,new hi),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=Oo(i)&&!sd(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;ge.read(()=>{d=window.innerWidth}),e(i,()=>{const h=window.innerWidth;h!==d&&(d=h,this.root.updateBlockedByResize=!0,u&&u(),u=GS(f,250),Wo.hasAnimatedSinceResize&&(Wo.hasAnimatedSinceResize=!1,this.nodes.forEach(Lf)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&l&&(a||c)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:d,hasRelativeLayoutChanged:f,layout:h})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const v=this.options.transition||l.getDefaultTransition()||wC,{onLayoutAnimationStart:g,onLayoutAnimationComplete:w}=l.getProps(),b=!this.targetLayout||!Of(this.targetLayout,h),S=!d&&f;if(this.options.layoutRoot||this.resumeFrom||S||d&&(b||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const x={...zi(v,"layout"),onPlay:g,onComplete:w};(l.shouldReduceMotion||this.options.layoutRoot)&&(x.delay=0,x.type=!1),this.startAnimation(x),this.setAnimationOrigin(u,S)}else d||Lf(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=h})}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(),ft(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(mC),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&&kf(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,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()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(_f);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Ff);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(fC),this.nodes.forEach(aC),this.nodes.forEach(cC)):this.nodes.forEach(Ff),this.clearAllSnapshots();const a=Ye.now();Ve.delta=bt(0,1e3/60,a-Ve.timestamp),Ve.timestamp=a,Ve.isProcessing=!0,vi.update.process(Ve),vi.preRender.process(Ve),vi.render.process(Ve),Ve.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Zi.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(dC),this.sharedNodes.forEach(gC)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ge.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ge.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!$e(this.snapshot.measuredBox.x)&&!$e(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.layoutCorrected=Pe(),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&&!Pf(this.projectionDelta),c=this.getTransformTemplate(),l=c?c(this.latestValues,""):void 0,u=l!==this.prevTransformTemplateValue;i&&this.instance&&(a||bn(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)),bC(c),{animationId:this.root.animationId,measuredBox:a,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var l;const{visualElement:i}=this.options;if(!i)return Pe();const a=i.measureViewportBox();if(!(((l=this.scroll)==null?void 0:l.wasRoot)||this.path.some(xC))){const{scroll:u}=this.root;u&&(Xn(a.x,u.offset.x),Xn(a.y,u.offset.y))}return a}removeElementScroll(i){var c;const a=Pe();if(nt(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&&nt(a,i),Xn(a.x,d.offset.x),Xn(a.y,d.offset.y))}return a}applyTransform(i,a=!1){const c=Pe();nt(c,i);for(let l=0;l<this.path.length;l++){const u=this.path[l];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&Zn(c,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),bn(u.latestValues)&&Zn(c,u.latestValues)}return bn(this.latestValues)&&Zn(c,this.latestValues),c}removeTransform(i){const a=Pe();nt(a,i);for(let c=0;c<this.path.length;c++){const l=this.path[c];if(!l.instance||!bn(l.latestValues))continue;ua(l.latestValues)&&l.updateSnapshot();const u=Pe(),d=l.measurePageBox();nt(u,d),Tf(a,l.latestValues,l.snapshot?l.snapshot.layoutBox:void 0,u)}return bn(this.latestValues)&&Tf(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!==Ve.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(i=!1){var f;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||(f=this.parent)!=null&&f.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:d}=this.options;if(!(!this.layout||!(u||d))){if(this.resolvedRelativeTargetAt=Ve.timestamp,!this.targetDelta&&!this.relativeTarget){const h=this.getClosestProjectingParent();h&&h.layout&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Pe(),this.relativeTargetOrigin=Pe(),Vr(this.relativeTargetOrigin,this.layout.layoutBox,h.layout.layoutBox),nt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Pe(),this.targetWithTransforms=Pe()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),MS(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):nt(this.target,this.layout.layoutBox),Nd(this.target,this.targetDelta)):nt(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const h=this.getClosestProjectingParent();h&&!!h.resumingFrom==!!this.resumingFrom&&!h.options.layoutScroll&&h.target&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Pe(),this.relativeTargetOrigin=Pe(),Vr(this.relativeTargetOrigin,this.target,h.target),nt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||ua(this.parent.latestValues)||Dd(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var v;const i=this.getLead(),a=!!this.resumingFrom||this!==i;let c=!0;if((this.isProjectionDirty||(v=this.parent)!=null&&v.isProjectionDirty)&&(c=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===Ve.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;nt(this.layoutCorrected,this.layout.layoutBox);const d=this.treeScale.x,f=this.treeScale.y;Yx(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=Pe());const{target:h}=i;if(!h){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(xf(this.prevProjectionDelta.x,this.projectionDelta.x),xf(this.prevProjectionDelta.y,this.projectionDelta.y)),Lr(this.projectionDelta,this.layoutCorrected,h,this.latestValues),(this.treeScale.x!==d||this.treeScale.y!==f||!Af(this.projectionDelta.x,this.prevProjectionDelta.x)||!Af(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",h))}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=Qn(),this.projectionDelta=Qn(),this.projectionDeltaWithTransform=Qn()}setAnimationOrigin(i,a=!1){const c=this.snapshot,l=c?c.latestValues:{},u={...this.latestValues},d=Qn();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=Pe(),h=c?c.source:void 0,v=this.layout?this.layout.source:void 0,g=h!==v,w=this.getStack(),b=!w||w.members.length<=1,S=!!(g&&!b&&this.options.crossfade===!0&&!this.path.some(yC));this.animationProgress=0;let x;this.mixTargetDelta=C=>{const E=C/1e3;Vf(d.x,i.x,E),Vf(d.y,i.y,E),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Vr(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),vC(this.relativeTarget,this.relativeTargetOrigin,f,E),x&&nC(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=Pe()),nt(x,this.relativeTarget)),g&&(this.animationValues=u,XS(u,l,this.latestValues,E,S,b)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=E},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&&(ft(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ge.update(()=>{Wo.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=ht(0)),this.currentAnimation=pf(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(sC),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&&Hf(this.options.animationType,this.layout.layoutBox,l.layoutBox)){c=this.target||Pe();const d=$e(this.layout.layoutBox.x);c.x.min=i.target.x.min,c.x.max=c.x.min+d;const f=$e(this.layout.layoutBox.y);c.y.min=i.target.y.min,c.y.max=c.y.min+f}nt(a,c),Zn(a,u),Lr(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(i,a){this.sharedNodes.has(i)||this.sharedNodes.set(i,new rC),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&&Ca("z",i,l,this.animationValues);for(let u=0;u<Sa.length;u++)Ca(`rotate${Sa[u]}`,i,l,this.animationValues),Ca(`skew${Sa[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=Vo(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=Vo(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!bn(this.latestValues)&&(i.transform=c?c({},""):"none",this.hasProjected=!1);return}i.visibility="";const u=l.animationValues||l.latestValues;this.applyTransformsToTarget();let d=oC(this.projectionDeltaWithTransform,this.treeScale,u);c&&(d=c(u,d)),i.transform=d;const{x:f,y:h}=this.projectionDelta;i.transformOrigin=`${f.origin*100}% ${h.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 v in Ar){if(u[v]===void 0)continue;const{correct:g,applyTo:w,isCSSVariable:b}=Ar[v],S=d==="none"?u[v]:g(u[v],l);if(w){const x=w.length;for(let C=0;C<x;C++)i[w[C]]=S}else b?this.options.visualElement.renderState.vars[v]=S:i[v]=S}this.options.layoutId&&(i.pointerEvents=l===this?Vo(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(_f),this.root.sharedNodes.clear()}}}function aC(e){e.updateLayout()}function cC(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;s==="size"?tt(d=>{const f=i?t.measuredBox[d]:t.layoutBox[d],h=$e(f);f.min=r[d].min,f.max=f.min+h}):Hf(s,t.layoutBox,r)&&tt(d=>{const f=i?t.measuredBox[d]:t.layoutBox[d],h=$e(r[d]);f.max=f.min+h,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+h)});const a=Qn();Lr(a,r,t.layoutBox);const c=Qn();i?Lr(c,e.applyTransform(o,!0),t.measuredBox):Lr(c,r,t.layoutBox);const l=!Pf(a);let u=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:f,layout:h}=d;if(f&&h){const v=Pe();Vr(v,t.layoutBox,f.layoutBox);const g=Pe();Vr(g,r,h.layoutBox),Of(v,g)||(u=!0),d.options.layoutRoot&&(e.relativeTarget=g,e.relativeTargetOrigin=v,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 lC(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 uC(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function dC(e){e.clearSnapshot()}function _f(e){e.clearMeasurements()}function Ff(e){e.isLayoutDirty=!1}function fC(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Lf(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function hC(e){e.resolveTargetDelta()}function pC(e){e.calcProjection()}function mC(e){e.resetSkewAndRotation()}function gC(e){e.removeLeadSnapshot()}function Vf(e,t,n){e.translate=be(t.translate,0,n),e.scale=be(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Rf(e,t,n,r){e.min=be(t.min,n.min,r),e.max=be(t.max,n.max,r)}function vC(e,t,n,r){Rf(e.x,t.x,n.x,r),Rf(e.y,t.y,n.y,r)}function yC(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const wC={duration:.45,ease:[.4,0,.1,1]},Bf=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Wf=Bf("applewebkit/")&&!Bf("chrome/")?Math.round:je;function $f(e){e.min=Wf(e.min),e.max=Wf(e.max)}function bC(e){$f(e.x),$f(e.y)}function Hf(e,t,n){return e==="position"||e==="preserve-aspect"&&!DS(Nf(t),Nf(n),.2)}function xC(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const SC=If({attachResizeListener:(e,t)=>Ir(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Ta={current:void 0},jf=If({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Ta.current){const e=new SC({});e.mount(window),e.setOptions({layoutScroll:!0}),Ta.current=e}return Ta.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),CC={pan:{Feature:HS},drag:{Feature:$S,ProjectionNode:jf,MeasureLayout:hf}};function Yf(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&&ge.postRender(()=>s(t,_r(t)))}class TC extends Jt{mount(){const{current:t}=this.node;t&&(this.unmount=j0(t,(n,r)=>(Yf(this.node,r,"Start"),o=>Yf(this.node,o,"End"))))}unmount(){}}class EC extends Jt{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=br(Ir(this.node.current,"focus",()=>this.onFocus()),Ir(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Uf(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&&ge.postRender(()=>s(t,_r(t)))}class PC extends Jt{mount(){const{current:t}=this.node;t&&(this.unmount=K0(t,(n,r)=>(Uf(this.node,r,"Start"),(o,{success:s})=>Uf(this.node,o,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Ea=new WeakMap,Pa=new WeakMap,DC=e=>{const t=Ea.get(e.target);t&&t(e)},MC=e=>{e.forEach(DC)};function OC({root:e,...t}){const n=e||document;Pa.has(n)||Pa.set(n,{});const r=Pa.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(MC,{root:e,...t})),r[o]}function NC(e,t,n){const r=OC(t);return Ea.set(e,n),r.observe(e),()=>{Ea.delete(e),r.unobserve(e)}}const AC={some:0,all:1};class kC extends Jt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();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:AC[o]},a=c=>{const{isIntersecting:l}=c;if(this.isInView===l||(this.isInView=l,s&&!l&&this.hasEnteredView))return;l&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",l);const{onViewportEnter:u,onViewportLeave:d}=this.node.getProps(),f=l?u:d;f&&f(c)};return NC(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(IC(t,n))&&this.startObserver()}unmount(){}}function IC({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const _C={...xS,...{inView:{Feature:kC},tap:{Feature:PC},focus:{Feature:EC},hover:{Feature:TC}},...CC,...{layout:{ProjectionNode:jf,MeasureLayout:hf}}},we=$x(_C,Xx);function FC(e,t,n){y.useInsertionEffect(()=>e.on(t,n),[e,t,n])}const LC=50,zf=()=>({current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}),VC=()=>({time:0,x:zf(),y:zf()}),RC={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function Kf(e,t,n,r){const o=n[t],{length:s,position:i}=RC[t],a=o.current,c=n.time;o.current=e[`scroll${i}`],o.scrollLength=e[`scroll${s}`]-e[`client${s}`],o.offset.length=0,o.offset[0]=0,o.offset[1]=o.scrollLength,o.progress=mn(0,o.scrollLength,o.current);const l=r-c;o.velocity=l>LC?0:pi(o.current-a,l)}function BC(e,t,n){Kf(e,"x",t,n),Kf(e,"y",t,n),t.time=n}function WC(e,t){const n={x:0,y:0};let r=e;for(;r&&r!==t;)if(Xi(r))n.x+=r.offsetLeft,n.y+=r.offsetTop,r=r.offsetParent;else if(r.tagName==="svg"){const o=r.getBoundingClientRect();r=r.parentElement;const s=r.getBoundingClientRect();n.x+=o.left-s.left,n.y+=o.top-s.top}else if(r instanceof SVGGraphicsElement){const{x:o,y:s}=r.getBBox();n.x+=o,n.y+=s;let i=null,a=r.parentNode;for(;!i;)a.tagName==="svg"&&(i=a),a=r.parentNode;r=i}else break;return n}const Da={start:0,center:.5,end:1};function Gf(e,t,n=0){let r=0;if(e in Da&&(e=Da[e]),typeof e=="string"){const o=parseFloat(e);e.endsWith("px")?r=o:e.endsWith("%")?e=o/100:e.endsWith("vw")?r=o/100*document.documentElement.clientWidth:e.endsWith("vh")?r=o/100*document.documentElement.clientHeight:e=o}return typeof e=="number"&&(r=t*e),n+r}const $C=[0,0];function HC(e,t,n,r){let o=Array.isArray(e)?e:$C,s=0,i=0;return typeof e=="number"?o=[e,e]:typeof e=="string"&&(e=e.trim(),e.includes(" ")?o=e.split(" "):o=[e,Da[e]?e:"0"]),s=Gf(o[0],n,r),i=Gf(o[1],t),s-i}const jC={All:[[0,0],[1,1]]},YC={x:0,y:0};function UC(e){return"getBBox"in e&&e.tagName!=="svg"?e.getBBox():{width:e.clientWidth,height:e.clientHeight}}function zC(e,t,n){const{offset:r=jC.All}=n,{target:o=e,axis:s="y"}=n,i=s==="y"?"height":"width",a=o!==e?WC(o,e):YC,c=o===e?{width:e.scrollWidth,height:e.scrollHeight}:UC(o),l={width:e.clientWidth,height:e.clientHeight};t[s].offset.length=0;let u=!t[s].interpolate;const d=r.length;for(let f=0;f<d;f++){const h=HC(r[f],l[i],c[i],a[s]);!u&&h!==t[s].interpolatorOffsets[f]&&(u=!0),t[s].offset[f]=h}u&&(t[s].interpolate=ki(t[s].offset,Ii(r),{clamp:!1}),t[s].interpolatorOffsets=[...t[s].offset]),t[s].progress=bt(0,1,t[s].interpolate(t[s].current))}function KC(e,t=e,n){if(n.x.targetOffset=0,n.y.targetOffset=0,t!==e){let r=t;for(;r&&r!==e;)n.x.targetOffset+=r.offsetLeft,n.y.targetOffset+=r.offsetTop,r=r.offsetParent}n.x.targetLength=t===e?t.scrollWidth:t.clientWidth,n.y.targetLength=t===e?t.scrollHeight:t.clientHeight,n.x.containerLength=e.clientWidth,n.y.containerLength=e.clientHeight,process.env.NODE_ENV!=="production"&&e&&t&&t!==e&&xo(getComputedStyle(e).position!=="static","Please ensure that the container has a non-static position, like 'relative', 'fixed', or 'absolute' to ensure scroll offset is calculated correctly.")}function GC(e,t,n,r={}){return{measure:o=>{KC(e,r.target,n),BC(e,n,o),(r.offset||r.target)&&zC(e,n,r)},notify:()=>t(n)}}const Br=new WeakMap,qf=new WeakMap,Ma=new WeakMap,Xf=e=>e===document.scrollingElement?window:e;function Zf(e,{container:t=document.scrollingElement,...n}={}){if(!t)return je;let r=Ma.get(t);r||(r=new Set,Ma.set(t,r));const o=VC(),s=GC(t,e,o,n);if(r.add(s),!Br.has(t)){const a=()=>{for(const d of r)d.measure(Ve.timestamp);ge.preUpdate(c)},c=()=>{for(const d of r)d.notify()},l=()=>ge.read(a);Br.set(t,l);const u=Xf(t);window.addEventListener("resize",l,{passive:!0}),t!==document.documentElement&&qf.set(t,nx(t,l)),u.addEventListener("scroll",l,{passive:!0}),l()}const i=Br.get(t);return ge.read(i,!1,!0),()=>{var l;ft(i);const a=Ma.get(t);if(!a||(a.delete(s),a.size))return;const c=Br.get(t);Br.delete(t),c&&(Xf(t).removeEventListener("scroll",c),(l=qf.get(t))==null||l(),window.removeEventListener("resize",c))}}const Qf=new Map;function qC(e){const t={value:0},n=Zf(r=>{t.value=r[e.axis].progress*100},e);return{currentTime:t,cancel:n}}function Jf({source:e,container:t,...n}){const{axis:r}=n;e&&(t=e);const o=Qf.get(t)??new Map;Qf.set(t,o);const s=n.target??"self",i=o.get(s)??{},a=r+(n.offset??[]).join(",");return i[a]||(i[a]=!n.target&&_u()?new ScrollTimeline({source:t,axis:r}):qC({container:t,...n})),i[a]}function XC(e,t){const n=Jf(t);return e.attachTimeline({timeline:t.target?void 0:n,observe:r=>(r.pause(),od(o=>{r.time=r.duration*o},n))})}function ZC(e){return e.length===2}function QC(e,t){return ZC(e)?Zf(n=>{e(n[t.axis].progress,n)},t):od(e,Jf(t))}function JC(e,{axis:t="y",container:n=document.scrollingElement,...r}={}){if(!n)return je;const o={axis:t,container:n,...r};return typeof e=="function"?QC(e,o):XC(e,o)}const eT=()=>({scrollX:ht(0),scrollY:ht(0),scrollXProgress:ht(0),scrollYProgress:ht(0)}),$o=e=>e?!e.current:!1;function tT({container:e,target:t,...n}={}){const r=Bn(eT),o=y.useRef(null),s=y.useRef(!1),i=y.useCallback(()=>(o.current=JC((a,{x:c,y:l})=>{r.scrollX.set(c.current),r.scrollXProgress.set(c.progress),r.scrollY.set(l.current),r.scrollYProgress.set(l.progress)},{...n,container:(e==null?void 0:e.current)||void 0,target:(t==null?void 0:t.current)||void 0}),()=>{var a;(a=o.current)==null||a.call(o)}),[e,t,JSON.stringify(n.offset)]);return yo(()=>{if(s.current=!1,$o(e)||$o(t)){s.current=!0;return}else return i()},[i]),y.useEffect(()=>{if(s.current)return He(!$o(e),"Container ref is defined but not hydrated","use-scroll-ref"),He(!$o(t),"Target ref is defined but not hydrated","use-scroll-ref"),i()},[i]),r}function Wr(e){const t=Bn(()=>ht(e)),{isStatic:n}=y.useContext(Or);if(n){const[,r]=y.useState(e);y.useEffect(()=>t.on("change",r),[])}return t}function eh(e,t){const n=Wr(t()),r=()=>n.set(t());return r(),yo(()=>{const o=()=>ge.preRender(r,!1,!0),s=e.map(i=>i.on("change",o));return()=>{s.forEach(i=>i()),ft(r)}}),n}function nT(e){Mr.current=[],e();const t=eh(Mr.current,e);return Mr.current=void 0,t}function mt(e,t,n,r){if(typeof e=="function")return nT(e);const o=typeof t=="function"?t:rx(t,n,r);return Array.isArray(e)?th(e,o):th([e],([s])=>o(s))}function th(e,t){const n=Bn(()=>[]);return eh(e,()=>{n.length=0;const r=e.length;for(let o=0;o<r;o++)n[o]=e[o].get();return t(n)})}function rT(e,t={}){const{isStatic:n}=y.useContext(Or),r=()=>ke(e)?e.get():e;if(n)return mt(r);const o=Wr(r());return y.useInsertionEffect(()=>ox(o,e,t),[o,JSON.stringify(t)]),o}function Oa(e){return typeof e=="object"&&!Array.isArray(e)}function nh(e,t,n,r){return typeof e=="string"&&Oa(t)?qi(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e:[e]}function oT(e,t,n){return e*(t+1)}function rh(e,t,n,r){return typeof t=="number"?t:t.startsWith("-")||t.startsWith("+")?Math.max(0,e+parseFloat(t)):t==="<"?n:t.startsWith("<")?Math.max(0,n+parseFloat(t.slice(1))):r.get(t)??e}function sT(e,t,n){for(let r=0;r<e.length;r++){const o=e[r];o.at>t&&o.at<n&&(bo(e,o),r--)}}function iT(e,t,n,r,o,s){sT(e,o,s);for(let i=0;i<t.length;i++)e.push({value:t[i],at:be(o,s,r[i]),easing:su(n,i)})}function aT(e,t){for(let n=0;n<e.length;n++)e[n]=e[n]/(t+1)}function cT(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}const lT="easeInOut",uT=20;function dT(e,{defaultTransition:t={},...n}={},r,o){const s=t.duration||.3,i=new Map,a=new Map,c={},l=new Map;let u=0,d=0,f=0;for(let h=0;h<e.length;h++){const v=e[h];if(typeof v=="string"){l.set(v,d);continue}else if(!Array.isArray(v)){l.set(v.name,rh(d,v.at,u,l));continue}let[g,w,b={}]=v;b.at!==void 0&&(d=rh(d,b.at,u,l));let S=0;const x=(C,E,D,T=0,P=0)=>{const M=fT(C),{delay:N=0,times:_=Ii(M),type:V="keyframes",repeat:O,repeatType:A,repeatDelay:L=0,...R}=E;let{ease:F=t.ease||"easeOut",duration:k}=E;const I=typeof N=="function"?N(T,P):N,B=M.length,U=Yi(V)?V:o==null?void 0:o[V||"keyframes"];if(B<=2&&U){let ne=100;if(B===2&&mT(M)){const J=M[1]-M[0];ne=Math.abs(J)}const ie={...R};k!==void 0&&(ie.duration=et(k));const Y=Cu(ie,ne,U);F=Y.ease,k=Y.duration}k??(k=s);const j=d+I;_.length===1&&_[0]===0&&(_[1]=1);const X=_.length-M.length;if(X>0&&Pu(_,X),M.length===1&&M.unshift(null),O){He(O<uT,"Repeat count too high, must be less than 20","repeat-count-high"),k=oT(k,O);const ne=[...M],ie=[..._];F=Array.isArray(F)?[...F]:[F];const Y=[...F];for(let J=0;J<O;J++){M.push(...ne);for(let te=0;te<ne.length;te++)_.push(ie[te]+(J+1)),F.push(te===0?"linear":su(Y,te-1))}aT(_,O)}const se=j+k;iT(D,M,F,_,j,se),S=Math.max(I+k,S),f=Math.max(se,f)};if(ke(g)){const C=oh(g,a);x(w,b,sh("default",C))}else{const C=nh(g,w,r,c),E=C.length;for(let D=0;D<E;D++){w=w,b=b;const T=C[D],P=oh(T,a);for(const M in w)x(w[M],hT(b,M),sh(M,P),D,E)}}u=d,d+=S}return a.forEach((h,v)=>{for(const g in h){const w=h[g];w.sort(cT);const b=[],S=[],x=[];for(let E=0;E<w.length;E++){const{at:D,value:T,easing:P}=w[E];b.push(T),S.push(mn(0,f,D)),x.push(P||"easeOut")}S[0]!==0&&(S.unshift(0),b.unshift(b[0]),x.unshift(lT)),S[S.length-1]!==1&&(S.push(1),b.push(null)),i.has(v)||i.set(v,{keyframes:{},transition:{}});const C=i.get(v);C.keyframes[g]=b,C.transition[g]={...t,duration:f,ease:x,times:S,...n}}}),i}function oh(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function sh(e,t){return t[e]||(t[e]=[]),t[e]}function fT(e){return Array.isArray(e)?e:[e]}function hT(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}const pT=e=>typeof e=="number",mT=e=>e.every(pT);function gT(e,t){return e in t}class vT extends Bd{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,n){if(gT(n,t)){const r=t[n];if(typeof r=="string"||typeof r=="number")return r}}getBaseTargetFromProps(){}removeValueFromRenderState(t,n){delete n.output[t]}measureInstanceViewportBox(){return Pe()}build(t,n){Object.assign(t.output,n)}renderInstance(t,{output:n}){Object.assign(t,n)}sortInstanceNodePosition(){return 0}}function yT(e){const t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=Oo(e)&&!sd(e)?new Yd(t):new Hd(t);n.mount(e),kr.set(e,n)}function wT(e){const t={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},n=new vT(t);n.mount(e),kr.set(e,n)}function bT(e,t){return ke(e)||typeof e=="number"||typeof e=="string"&&!Oa(t)}function ih(e,t,n,r){const o=[];if(bT(e,t))o.push(pf(e,Oa(t)&&t.default||t,n&&(n.default||n)));else{const s=nh(e,t,r),i=s.length;He(!!i,"No valid elements provided.","no-valid-elements");for(let a=0;a<i;a++){const c=s[a];He(c!==null,"You're trying to perform an animation on null. Ensure that selectors are correctly finding elements and refs are correctly hydrated.","animate-null");const l=c instanceof Element?yT:wT;kr.has(c)||l(c);const u=kr.get(c),d={...n};"delay"in d&&typeof d.delay=="function"&&(d.delay=d.delay(a,i)),o.push(...ga(u,{...t,transition:d},{}))}}return o}function xT(e,t,n){const r=[];return dT(e,t,n,{spring:Pr}).forEach(({keyframes:s,transition:i},a)=>{r.push(...ih(a,s,i))}),r}function ST(e){return Array.isArray(e)&&e.some(Array.isArray)}function CT(e){function t(n,r,o){let s=[];return ST(n)?s=xT(n,r,e):s=ih(n,r,o,e),new D0(s)}return t}const Na=CT(),TT=e=>{const{scrollBehavior:t="sticky",animatedBehavior:n=[],animatedColor:r="secondary",appBarColor:o="card",size:s="md",largeHeaderContent:i,smallHeaderContent:a,stickyHideTarget:c,scrollContainerRef:l,normalHeaderRowHeight:u=64,largeHeaderRowHeight:d=96,foldAnimationDistance:f=50,foldBorderRadius:h=24}=e,v=y.useRef(null),g=y.useRef(null),[w,b]=y.useState(!1),{scrollY:S}=tT({container:l}),x=Wr(0),[C,E]=y.useState({mainRow:s==="lg"?d:u,largeContent:0}),D=s==="lg"&&!!i&&!!a,T=s==="lg"&&!!i;y.useLayoutEffect(()=>{var le,ae;const J=(le=v.current)==null?void 0:le.offsetHeight,te=(ae=g.current)==null?void 0:ae.offsetHeight;(J&&J!==C.mainRow||te!==void 0&&te!==C.largeContent)&&E({mainRow:J||C.mainRow,largeContent:te||0})}),FC(S,"change",J=>{if(b(J>10),t==="conditionally-sticky"){const{mainRow:te,largeContent:le}=C,ae=D?le:0;let ue;c==="full-appbar"&&s==="lg"?ue=te+le:c==="main-row"?ue=D?u:te:ue=D?u:te+le;const Ee=J-ae;if(Ee<=0){x.set(0);return}const Z=S.getPrevious()??0,lt=Math.max(0,Z-ae),ut=Ee-lt,Qe=x.get()-ut,Vn=Math.max(-ue,Math.min(Qe,0));x.set(Vn)}else x.set(0)});const P=n.includes("appbar-color"),M=n.includes("fold"),N=n.includes("shadow"),_=P&&w?r:o,V=N&&w?"md":"none",O=mt(S,[0,f],[0,h],{clamp:!0}),A=C.largeContent,L=C.mainRow,R=L+A,F=mt(S,[0,A],[R,u],{clamp:!0}),k=rT(F,{stiffness:300,damping:30,mass:.5}),I=mt(S,[0,A],[L,u],{clamp:!0}),B=D?I:C.mainRow,U=mt(S,[0,A*.75],[1,0],{clamp:!0}),j=mt(S,[0,A],[0,-40],{clamp:!0}),X=A*.4,se=A*.9,ne=mt(S,[X,se],[1,0],{clamp:!0}),ie=mt(S,[X,se],[0,1],{clamp:!0}),Y=T?R+10:C.mainRow+20;return{isScrolled:w,contentPaddingTop:Y,headerProps:{style:{y:x,height:D?k:void 0,borderBottomLeftRadius:M?O:void 0,borderBottomRightRadius:M?O:void 0}},mainRowProps:{ref:v,style:{height:B}},largeContentProps:{ref:g,style:{opacity:D?U:1,y:D?j:0,pointerEvents:w&&D?"none":"auto"}},childrenContainerProps:{style:{opacity:D?ne:1}},smallHeaderProps:{style:{opacity:ie}},finalColor:_,finalShadow:V,isCollapsible:D,shouldRenderLargeContent:T}},ET=Me("fixed top-0 z-40 w-full transition-[colors,box-shadow] duration-300 ease-in-out",{variants:{appBarColor:{background:"bg-graphite-background text-graphite-foreground",card:"bg-graphite-card text-graphite-foreground",primary:"bg-graphite-primary text-graphite-primaryForeground",secondary:"bg-graphite-secondary text-graphite-secondaryForeground"},shadow:{none:"shadow-none",md:"shadow-sm"}},defaultVariants:{appBarColor:"card",shadow:"none"}}),ah=y.forwardRef(({className:e,children:t,startAdornment:n,centerAdornment:r,endAdornments:o=[],appBarColor:s,scrollBehavior:i,animatedBehavior:a,animatedColor:c,size:l,largeHeaderContent:u,smallHeaderContent:d,stickyHideTarget:f,scrollContainerRef:h,normalHeaderRowHeight:v,largeHeaderRowHeight:g,foldAnimationDistance:w,foldBorderRadius:b,...S},x)=>{const C={appBarColor:s,scrollBehavior:i,animatedBehavior:a,animatedColor:c,size:l,largeHeaderContent:u,smallHeaderContent:d,stickyHideTarget:f,scrollContainerRef:h,normalHeaderRowHeight:v,largeHeaderRowHeight:g,foldAnimationDistance:w,foldBorderRadius:b},{headerProps:E,mainRowProps:D,largeContentProps:T,childrenContainerProps:P,smallHeaderProps:M,finalColor:N,finalShadow:_,isCollapsible:V,shouldRenderLargeContent:O}=TT(C);return p.jsxs(we.header,{ref:x,className:H(ET({appBarColor:N,shadow:_,className:e}),(V||(a==null?void 0:a.includes("fold")))&&"overflow-hidden"),...E,...S,children:[p.jsxs(we.div,{...D,className:"flex w-full items-center",children:[p.jsxs("div",{className:"flex flex-1 items-center gap-2 px-4 min-w-0",children:[n&&p.jsx("div",{className:"flex justify-center items-center min-w-max",children:n}),p.jsxs("div",{className:"min-w-0 relative flex-1",children:[p.jsx(we.div,{...P,children:t}),V&&p.jsx(we.div,{...M,className:"absolute inset-0 flex items-center",children:d})]})]}),r&&p.jsx("div",{className:"flex justify-center items-center min-w-max flex-1 ",children:r}),p.jsx("div",{className:"flex items-center justify-end gap-1 px-4",children:o})]}),O&&p.jsx(we.div,{...T,className:"px-4 pb-4",children:u})]})});ah.displayName="AppBar";const PT=ah;function DT(e,t){const n=m.createContext(t),r=s=>{const{children:i,...a}=s,c=m.useMemo(()=>a,Object.values(a));return p.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 Ct(e,t=[]){let n=[];function r(s,i){const a=m.createContext(i),c=n.length;n=[...n,i];const l=d=>{var b;const{scope:f,children:h,...v}=d,g=((b=f==null?void 0:f[e])==null?void 0:b[c])||a,w=m.useMemo(()=>v,Object.values(v));return p.jsx(g.Provider,{value:w,children:h})};l.displayName=s+"Provider";function u(d,f){var g;const h=((g=f==null?void 0:f[e])==null?void 0:g[c])||a,v=m.useContext(h);if(v)return v;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,MT(o,...t)]}function MT(...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 Fe(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 Ie=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{};function ch(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ho(...e){return t=>{let n=!1;const r=e.map(o=>{const s=ch(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():ch(e[o],null)}}}}function fe(...e){return m.useCallback(Ho(...e),e)}function en(e){const t=NT(e),n=m.forwardRef((r,o)=>{const{children:s,...i}=r,a=m.Children.toArray(s),c=a.find(kT);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 p.jsx(t,{...i,ref:o,children:m.isValidElement(l)?m.cloneElement(l,void 0,u):null})}return p.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}var OT=en("Slot");function NT(e){const t=m.forwardRef((n,r)=>{const{children:o,...s}=n;if(m.isValidElement(o)){const i=_T(o),a=IT(s,o.props);return o.type!==m.Fragment&&(a.ref=r?Ho(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 AT=Symbol("radix.slottable");function kT(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===AT}function IT(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 _T(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 FT=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ce=FT.reduce((e,t)=>{const n=en(`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),p.jsx(c,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function lh(e,t){e&&wr.flushSync(()=>e.dispatchEvent(t))}function uh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function dh(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var jo={exports:{}},Aa={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* use-sync-external-store-shim.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var fh;function LT(){if(fh)return Aa;fh=1;var e=y;function t(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,s=e.useLayoutEffect,i=e.useDebugValue;function a(d,f){var h=f(),v=r({inst:{value:h,getSnapshot:f}}),g=v[0].inst,w=v[1];return s(function(){g.value=h,g.getSnapshot=f,c(g)&&w({inst:g})},[d,h,f]),o(function(){return c(g)&&w({inst:g}),d(function(){c(g)&&w({inst:g})})},[d]),i(h),h}function c(d){var f=d.getSnapshot;d=d.value;try{var h=f();return!n(d,h)}catch{return!0}}function l(d,f){return f()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?l:a;return Aa.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,Aa}var ka={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* use-sync-external-store-shim.development.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var hh;function VT(){return hh||(hh=1,process.env.NODE_ENV!=="production"&&(function(){function e(h,v){return h===v&&(h!==0||1/h===1/v)||h!==h&&v!==v}function t(h,v){u||o.startTransition===void 0||(u=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var g=v();if(!d){var w=v();s(g,w)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),d=!0)}w=i({inst:{value:g,getSnapshot:v}});var b=w[0].inst,S=w[1];return c(function(){b.value=g,b.getSnapshot=v,n(b)&&S({inst:b})},[h,g,v]),a(function(){return n(b)&&S({inst:b}),h(function(){n(b)&&S({inst:b})})},[h]),l(g),g}function n(h){var v=h.getSnapshot;h=h.value;try{var g=v();return!s(h,g)}catch{return!0}}function r(h,v){return v()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var o=y,s=typeof Object.is=="function"?Object.is:e,i=o.useState,a=o.useEffect,c=o.useLayoutEffect,l=o.useDebugValue,u=!1,d=!1,f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;ka.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:f,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),ka}var ph;function RT(){return ph||(ph=1,process.env.NODE_ENV==="production"?jo.exports=LT():jo.exports=VT()),jo.exports}var BT=RT();function WT(){return BT.useSyncExternalStore($T,()=>!0,()=>!1)}function $T(){return()=>{}}var Ia="Avatar",[HT]=Ct(Ia),[jT,mh]=HT(Ia),gh=m.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[o,s]=m.useState("idle");return p.jsx(jT,{scope:n,imageLoadingStatus:o,onImageLoadingStatusChange:s,children:p.jsx(ce.span,{...r,ref:t})})});gh.displayName=Ia;var vh="AvatarImage",yh=m.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:o=()=>{},...s}=e,i=mh(vh,n),a=YT(r,s),c=Fe(l=>{o(l),i.onImageLoadingStatusChange(l)});return Ie(()=>{a!=="idle"&&c(a)},[a,c]),a==="loaded"?p.jsx(ce.img,{...s,ref:t,src:r}):null});yh.displayName=vh;var wh="AvatarFallback",bh=m.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...o}=e,s=mh(wh,n),[i,a]=m.useState(r===void 0);return m.useEffect(()=>{if(r!==void 0){const c=window.setTimeout(()=>a(!0),r);return()=>window.clearTimeout(c)}},[r]),i&&s.imageLoadingStatus!=="loaded"?p.jsx(ce.span,{...o,ref:t}):null});bh.displayName=wh;function xh(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function YT(e,{referrerPolicy:t,crossOrigin:n}){const r=WT(),o=m.useRef(null),s=r?(o.current||(o.current=new window.Image),o.current):null,[i,a]=m.useState(()=>xh(s,e));return Ie(()=>{a(xh(s,e))},[s,e]),Ie(()=>{const c=d=>()=>{a(d)};if(!s)return;const l=c("loaded"),u=c("error");return s.addEventListener("load",l),s.addEventListener("error",u),t&&(s.referrerPolicy=t),typeof n=="string"&&(s.crossOrigin=n),()=>{s.removeEventListener("load",l),s.removeEventListener("error",u)}},[s,n,t]),i}var Sh=gh,UT=yh,Ch=bh;/**
|
|
26
|
+
* @license lucide-react v0.544.0 - ISC
|
|
27
|
+
*
|
|
28
|
+
* This source code is licensed under the ISC license.
|
|
29
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
30
|
+
*/const zT=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),KT=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Th=e=>{const t=KT(e);return t.charAt(0).toUpperCase()+t.slice(1)},Eh=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),GT=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
|
|
31
|
+
* @license lucide-react v0.544.0 - ISC
|
|
32
|
+
*
|
|
33
|
+
* This source code is licensed under the ISC license.
|
|
34
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
35
|
+
*/var qT={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"};/**
|
|
36
|
+
* @license lucide-react v0.544.0 - ISC
|
|
37
|
+
*
|
|
38
|
+
* This source code is licensed under the ISC license.
|
|
39
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
40
|
+
*/const XT=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...a},c)=>y.createElement("svg",{ref:c,...qT,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Eh("lucide",o),...!s&&!GT(a)&&{"aria-hidden":"true"},...a},[...i.map(([l,u])=>y.createElement(l,u)),...Array.isArray(s)?s:[s]]));/**
|
|
41
|
+
* @license lucide-react v0.544.0 - ISC
|
|
42
|
+
*
|
|
43
|
+
* This source code is licensed under the ISC license.
|
|
44
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
45
|
+
*/const Tt=(e,t)=>{const n=y.forwardRef(({className:r,...o},s)=>y.createElement(XT,{ref:s,iconNode:t,className:Eh(`lucide-${zT(Th(e))}`,`lucide-${e}`,r),...o}));return n.displayName=Th(e),n};/**
|
|
46
|
+
* @license lucide-react v0.544.0 - ISC
|
|
47
|
+
*
|
|
48
|
+
* This source code is licensed under the ISC license.
|
|
49
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
50
|
+
*/const ZT=Tt("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
|
|
51
|
+
* @license lucide-react v0.544.0 - ISC
|
|
52
|
+
*
|
|
53
|
+
* This source code is licensed under the ISC license.
|
|
54
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
55
|
+
*/const Ph=Tt("calendar",[["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"}]]);/**
|
|
56
|
+
* @license lucide-react v0.544.0 - ISC
|
|
57
|
+
*
|
|
58
|
+
* This source code is licensed under the ISC license.
|
|
59
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
60
|
+
*/const _a=Tt("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
61
|
+
* @license lucide-react v0.544.0 - ISC
|
|
62
|
+
*
|
|
63
|
+
* This source code is licensed under the ISC license.
|
|
64
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
65
|
+
*/const Dh=Tt("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
66
|
+
* @license lucide-react v0.544.0 - ISC
|
|
67
|
+
*
|
|
68
|
+
* This source code is licensed under the ISC license.
|
|
69
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
70
|
+
*/const QT=Tt("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
71
|
+
* @license lucide-react v0.544.0 - ISC
|
|
72
|
+
*
|
|
73
|
+
* This source code is licensed under the ISC license.
|
|
74
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
75
|
+
*/const Mh=Tt("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
76
|
+
* @license lucide-react v0.544.0 - ISC
|
|
77
|
+
*
|
|
78
|
+
* This source code is licensed under the ISC license.
|
|
79
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
80
|
+
*/const JT=Tt("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
81
|
+
* @license lucide-react v0.544.0 - ISC
|
|
82
|
+
*
|
|
83
|
+
* This source code is licensed under the ISC license.
|
|
84
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
85
|
+
*/const Fa=Tt("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
86
|
+
* @license lucide-react v0.544.0 - ISC
|
|
87
|
+
*
|
|
88
|
+
* This source code is licensed under the ISC license.
|
|
89
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
90
|
+
*/const eE=Tt("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
|
|
91
|
+
* @license lucide-react v0.544.0 - ISC
|
|
92
|
+
*
|
|
93
|
+
* This source code is licensed under the ISC license.
|
|
94
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
95
|
+
*/const tE=Tt("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]),Oh=Me("relative flex shrink-0 select-none items-center justify-center overflow-hidden align-middle font-medium",{variants:{size:{xs:"h-6 w-6 text-xs",sm:"h-8 w-8 text-sm",md:"h-12 w-12 text-base",lg:"h-16 w-16 text-2xl",xl:"h-24 w-24 text-4xl"},shape:{full:"rounded-full",minimal:"rounded-lg",sharp:"rounded-none"}},defaultVariants:{size:"md",shape:"full"}}),nE=e=>{const t=e.split(" ").filter(Boolean);return t.length===0?"?":t.length===1?t[0].charAt(0).toUpperCase():(t[0].charAt(0)+t[t.length-1].charAt(0)).toUpperCase()},Nh=y.forwardRef(({className:e,size:t="md",shape:n="full",src:r,fallback:o,variant:s="default",...i},a)=>{const[c,l]=y.useState("idle"),u=r&&c==="loading";if(s==="count")return p.jsx(Sh,{ref:a,className:H(Oh({size:t,shape:n,className:e})),...i,children:p.jsx(Ch,{className:"flex h-full w-full items-center justify-center bg-graphite-secondary text-graphite-secondaryForeground",delayMs:0,children:o})});const d=o?nE(o):p.jsx(tE,{className:"h-1/2 w-1/2"});return p.jsxs(Sh,{ref:a,className:H(Oh({size:t,shape:n,className:e}),"relative"),...i,children:[u&&p.jsx("div",{className:"absolute inset-0 z-10 animate-pulse bg-graphite-secondary"}),p.jsx(UT,{src:r,alt:o||"User avatar",className:"h-full w-full object-cover",onLoadingStatusChange:f=>{(c==="idle"&&f==="loading"||f==="loaded"||f==="error")&&l(f)}}),p.jsx(Ch,{className:"flex h-full w-full items-center justify-center bg-graphite-secondary text-graphite-secondaryForeground",delayMs:0,children:d})]})});Nh.displayName="Avatar";const rE=Me("inline-flex items-center border px-2 py-1 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-graphite-ring focus:ring-offset-2",{variants:{variant:{primary:"border-transparent bg-graphite-primary text-graphite-primaryForeground hover:bg-graphite-primary/80",secondary:"border-transparent bg-graphite-secondary text-graphite-secondaryForeground hover:bg-graphite-secondary/80",destructive:"border-transparent bg-red-500 text-graphite-primaryForeground hover:bg-red-600/80",outline:"text-graphite-foreground border-graphite-border"},shape:{full:"rounded-full",minimal:"rounded-lg",sharp:"rounded-none"}},defaultVariants:{variant:"primary",shape:"full"}}),Ah=y.forwardRef(({className:e,variant:t,shape:n,...r},o)=>p.jsx("div",{className:rE({variant:t,shape:n,className:e}),ref:o,...r}));Ah.displayName="Badge";const kh=y.forwardRef(({className:e,children:t,scaleAmount:n=.95,...r},o)=>p.jsx(we.span,{ref:o,className:H("cursor-pointer inline-block",e),whileTap:{scale:n},transition:{type:"spring",stiffness:400,damping:30},...r,children:t}));kh.displayName="BouncyBox";var Et={},Ih;function oE(){if(Ih)return Et;Ih=1;var e=Et&&Et.__assign||function(){return e=Object.assign||function(w){for(var b,S=1,x=arguments.length;S<x;S++){b=arguments[S];for(var C in b)Object.prototype.hasOwnProperty.call(b,C)&&(w[C]=b[C])}return w},e.apply(this,arguments)},t=Et&&Et.__rest||function(w,b){var S={};for(var x in w)Object.prototype.hasOwnProperty.call(w,x)&&b.indexOf(x)<0&&(S[x]=w[x]);if(w!=null&&typeof Object.getOwnPropertySymbols=="function")for(var C=0,x=Object.getOwnPropertySymbols(w);C<x.length;C++)b.indexOf(x[C])<0&&Object.prototype.propertyIsEnumerable.call(w,x[C])&&(S[x[C]]=w[x[C]]);return S};Object.defineProperty(Et,"__esModule",{value:!0}),Et.customRipple=void 0;var n=y,r=function(){return document},o=.4,s="__useRipple--ripple",i="__useRipple--ripple-container";function a(w){var b=(0,n.useRef)(null),S=e({duration:450,color:"rgba(255, 255, 255, .3)",cancelAutomatically:!1,timingFunction:"cubic-bezier(.42,.36,.28,.88)",disabled:!1,className:s,containerClassName:i,ignoreNonLeftClick:!0,ref:b},w??{}),x=S.ref,C=t(S,["ref"]),E=(0,n.useCallback)(function(D){var T,P;if(!(!x.current||C.disabled||C.ignoreNonLeftClick&&((T=D.nativeEvent)===null||T===void 0?void 0:T.which)!==1&&((P=D.nativeEvent)===null||P===void 0?void 0:P.type)==="mousedown")){var M=x.current;if(window.getComputedStyle(M).position==="static"&&f([["position","relative"]],M),!!M){var N=M.querySelector(":scope > .".concat(C.containerClassName)),_=N??v(C.containerClassName);N||M.appendChild(_),requestAnimationFrame(function(){var V,O=Date.now(),A=l(D,M,d(M,D,C)),L=["mouseup","touchend"],R=function(){var B=Date.now(),U=B-O;setTimeout(function(){h(A,C)},U>.4*C.duration?0:o*C.duration-U);for(var j=0,X=L;j<X.length;j++){var se=X[j];r().removeEventListener(se,R)}};if(!C.cancelAutomatically&&!g())for(var F=0,k=L;F<k.length;F++){var I=k[F];r().addEventListener(I,R)}else setTimeout(function(){return void h(A,C)},C.duration*o);_.appendChild(A),(V=C.onSpawn)===null||V===void 0||V.call(C,{ripple:A,cancelRipple:R,event:D,ref:x,container:_})})}}},[x,C]);return[x,E]}Et.default=a;function c(w){return function(b){return a(e(e({},w),b))}}Et.customRipple=c;function l(w,b,S){var x=b.getBoundingClientRect(),C=x.top,E=x.left;return S.style.setProperty("top",u(w.clientY-C)),S.style.setProperty("left",u(w.clientX-E)),S}function u(w){return"".concat(w,"px")}function d(w,b,S,x){var C=S.duration,E=S.color,D=S.timingFunction,T=S.className;x===void 0&&(x=document);var P=x.createElement("div"),M=b.clientX,N=b.clientY,_=w.getBoundingClientRect(),V=_.height,O=_.width,A=_.top,L=_.left,R=Math.max(N-A,V-N+A),F=Math.max(M-L,O-M+L),k=u(Math.hypot(R,F)*2),I=[["position","absolute"],["height",k],["width",k],["transform","translate(-50%, -50%) scale(0)"],["pointer-events","none"],["border-radius","50%"],["opacity",".6"],["background",E],["transition","transform ".concat(C*.6,"ms ").concat(D,", opacity ").concat(Math.max(C*.05,140),"ms ease-out")]];return P.classList.add(T),window.requestAnimationFrame(function(){f([["transform","translate(-50%, -50%) scale(1)"]],P)}),f(I,P)}function f(w,b){if(!b)return b;for(var S=0,x=w;S<x.length;S++){var C=x[S],E=C[0],D=C[1];b.style.setProperty(E,D)}return b}function h(w,b){var S=b.duration,x=b.timingFunction;f([["opacity","0"],["transition","transform ".concat(S*.6,"ms ").concat(x,", opacity ").concat(S*.65,"ms ease-in-out ").concat(S*.13,"ms")]],w),window.requestAnimationFrame(function(){w.addEventListener("transitionend",function(C){C.propertyName==="opacity"&&w.remove()})})}function v(w){var b=r().createElement("div");return b.classList.add(w),f([["position","absolute"],["height","100%"],["width","100%"],["border-radius","inherit"],["top","0"],["left","0"],["pointer-events","none"],["overflow","hidden"]],b)}function g(){var w,b;return"ontouchstart"in window||navigator.maxTouchPoints>0||((b=(w=navigator)===null||w===void 0?void 0:w.msMaxTouchPoints)!==null&&b!==void 0?b:!1)}return Et}var sE=oE();const rt=uh(sE),La=Me("font-semibold cursor-pointer min-w-max focus:outline-none transition-all duration-300 ease-in-out flex items-center justify-center relative overflow-hidden",{variants:{variant:{primary:"bg-graphite-primary hover:shadow-md disabled:bg-graphite-primary/70 text-graphite-primaryForeground hover:opacity-90 focus:ring-2 focus:ring-offset-2 focus:ring-graphite-ring ",secondary:"bg-graphite-secondary text-graphite-secondaryForeground disabled:bg-graphite-secondary/70 hover:bg-graphite-secondary/80 focus:ring-2 focus:ring-offset-2 focus:ring-graphite-ring",destructive:"bg-red-500 text-graphite-primaryForeground disabled:bg-red-500/70 hover:bg-red-600/80 focus:ring-2 focus:ring-offset-2 focus:ring-graphite-ring",ghost:"bg-transparent text-graphite-foreground disabled:opacity-70 hover:bg-graphite-secondary focus:ring-2 focus:ring-offset-2 focus:ring-graphite-ring",link:"bg-transparent text-graphite-primary disabled:opacity-70 hover:text-graphite-primary hover:underline !p-1 focus:ring-2 focus:ring-offset-2 focus:ring-graphite-ring"},size:{xs:"h-8 px-2 text-xs",sm:"h-10 px-4 text-sm",md:"h-12 px-6 text-base",lg:"h-14 px-8 text-lg"},shape:{full:"rounded-full",minimal:"rounded-lg",sharp:"rounded-none"},isLoading:{true:"cursor-wait"}},defaultVariants:{variant:"primary",size:"md",shape:"full"}}),er=y.forwardRef(({className:e,variant:t="primary",size:n,shape:r,children:o,disabled:s,startIcon:i,endIcon:a,isLoading:c,...l},u)=>{const d=y.useRef(null);y.useImperativeHandle(u,()=>d.current);const f=t==="primary"||t==="destructive"?"rgba(255, 255, 255, 0.4)":"rgba(0, 0, 0, 0.1)",h=d,[,v]=rt({ref:h,color:f,duration:400,disabled:s||c}),g={xs:"h-4 w-4",sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"};return p.jsx("button",{className:La({variant:t,size:n,shape:r,className:e,isLoading:c}),ref:d,onPointerDown:w=>{w.stopPropagation(),v(w)},disabled:s||c,...l,children:p.jsx(Kn,{mode:"wait",initial:!1,children:c?p.jsx(we.div,{initial:{opacity:0,scale:.5},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.5},transition:{duration:.2},children:p.jsx(Fa,{className:`animate-spin ease-[cubic-bezier(0.95,0.05,0.795,0.035)] ${g[n||"md"]}`})},"spinner"):p.jsxs(we.span,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{duration:.2},className:"relative z-10 flex items-center justify-center",children:[i&&p.jsx("span",{className:"mr-2 flex items-center",children:i}),o,a&&p.jsx("span",{className:"ml-2 flex items-center",children:a})]},"content")})})});er.displayName="Button";const _h=({children:e,className:t,shape:n="full",...r})=>{const o={full:{left:"rounded-l-full",right:"rounded-r-full"},minimal:{left:"rounded-l-lg",right:"rounded-r-lg"},sharp:{left:"rounded-l-none",right:"rounded-r-none"}},s=y.Children.toArray(e);return p.jsx("fieldset",{className:H("inline-flex items-center border-none p-0",t),...r,children:s.map((i,a)=>{if(!y.isValidElement(i))return i;const c=a===0,l=a===s.length-1;let u="";c?u=H(o[n].left,"rounded-r-none"):l?u=H(o[n].right,"rounded-l-none"):u="rounded-none";const d=H(i.props.className,u,!c&&"-ml-px","focus:z-10");return y.cloneElement(i,{...i.props,className:d})})})};_h.displayName="ButtonGroup";function iE(e,t,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(" ")}const Va={},$r={};function Sn(e,t){try{const r=(Va[e]||(Va[e]=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return r in $r?$r[r]:Fh(r,r.split(":"))}catch{if(e in $r)return $r[e];const n=e==null?void 0:e.match(aE);return n?Fh(e,n.slice(1)):NaN}}const aE=/([+-]\d\d):?(\d\d)?/;function Fh(e,t){const n=+(t[0]||0),r=+(t[1]||0),o=+(t[2]||0)/60;return $r[e]=n*60+r>0?n*60+r+o:n*60-r-o}class Pt extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(Sn(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),Vh(this),Ra(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new Pt(...n,t):new Pt(Date.now(),t)}withTimeZone(t){return new Pt(+this,t)}getTimezoneOffset(){const t=-Sn(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),Ra(this),+this}[Symbol.for("constructDateFrom")](t){return new Pt(+new Date(t),this.timeZone)}}const Lh=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!Lh.test(e))return;const t=e.replace(Lh,"$1UTC");Pt.prototype[t]&&(e.startsWith("get")?Pt.prototype[e]=function(){return this.internal[t]()}:(Pt.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),cE(this),+this},Pt.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),Ra(this),+this}))});function Ra(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-Sn(e.timeZone,e)*60))}function cE(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),Vh(e)}function Vh(e){const t=Sn(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),r=new Date(+e);r.setUTCHours(r.getUTCHours()-1);const o=-new Date(+e).getTimezoneOffset(),s=-new Date(+r).getTimezoneOffset(),i=o-s,a=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();i&&a&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+i);const c=o-n;c&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+c);const l=new Date(+e);l.setUTCSeconds(0);const u=o>0?l.getSeconds():(l.getSeconds()-60)%60,d=Math.round(-(Sn(e.timeZone,e)*60))%60;(d||u)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+d),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+d+u));const f=Sn(e.timeZone,e),h=f>0?Math.floor(f):Math.ceil(f),g=-new Date(+e).getTimezoneOffset()-h,w=h!==n,b=g-c;if(w&&b){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+b);const S=Sn(e.timeZone,e),x=S>0?Math.floor(S):Math.ceil(S),C=h-x;C&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+C),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+C))}}class Be extends Pt{static tz(t,...n){return n.length?new Be(...n,t):new Be(Date.now(),t)}toISOString(){const[t,n,r]=this.tzComponents(),o=`${t}${n}:${r}`;return this.internal.toISOString().slice(0,-1)+o}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,n,r,o]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${r} ${n} ${o}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[n,r,o]=this.tzComponents();return`${t} GMT${n}${r}${o} (${iE(this.timeZone,this)})`}toLocaleString(t,n){return Date.prototype.toLocaleString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleDateString(t,n){return Date.prototype.toLocaleDateString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleTimeString(t,n){return Date.prototype.toLocaleTimeString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),n=t>0?"-":"+",r=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),o=String(Math.abs(t)%60).padStart(2,"0");return[n,r,o]}withTimeZone(t){return new Be(+this,t)}[Symbol.for("constructDateFrom")](t){return new Be(+new Date(t),this.timeZone)}}const Rh=6048e5,lE=864e5,uE=6e4,dE=36e5,fE=1e3,Bh=Symbol.for("constructDateFrom");function pe(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Bh in e?e[Bh](t):e instanceof Date?new e.constructor(t):new Date(t)}function de(e,t){return pe(t||e,e)}function Hr(e,t,n){const r=de(e,n==null?void 0:n.in);return isNaN(t)?pe((n==null?void 0:n.in)||e,NaN):(t&&r.setDate(r.getDate()+t),r)}function Ba(e,t,n){const r=de(e,n==null?void 0:n.in);if(isNaN(t))return pe(e,NaN);if(!t)return r;const o=r.getDate(),s=pe(e,r.getTime());s.setMonth(r.getMonth()+t+1,0);const i=s.getDate();return o>=i?s:(r.setFullYear(s.getFullYear(),s.getMonth(),o),r)}function Wh(e,t,n){const{years:r=0,months:o=0,weeks:s=0,days:i=0,hours:a=0,minutes:c=0,seconds:l=0}=t,u=de(e,n==null?void 0:n.in),d=o||r?Ba(u,o+r*12):u,f=i||s?Hr(d,i+s*7):d,h=c+a*60,g=(l+h*60)*1e3;return pe(e,+f+g)}let hE={};function Cn(){return hE}function Dt(e,t){var a,c,l,u;const n=Cn(),r=(t==null?void 0:t.weekStartsOn)??((c=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((u=(l=n.locale)==null?void 0:l.options)==null?void 0:u.weekStartsOn)??0,o=de(e,t==null?void 0:t.in),s=o.getDay(),i=(s<r?7:0)+s-r;return o.setDate(o.getDate()-i),o.setHours(0,0,0,0),o}function Tn(e,t){return Dt(e,{...t,weekStartsOn:1})}function $h(e,t){const n=de(e,t==null?void 0:t.in),r=n.getFullYear(),o=pe(n,0);o.setFullYear(r+1,0,4),o.setHours(0,0,0,0);const s=Tn(o),i=pe(n,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const a=Tn(i);return n.getTime()>=s.getTime()?r+1:n.getTime()>=a.getTime()?r:r-1}function Yo(e){const t=de(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function tr(e,...t){const n=pe.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function jr(e,t){const n=de(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function Hh(e,t,n){const[r,o]=tr(n==null?void 0:n.in,e,t),s=jr(r),i=jr(o),a=+s-Yo(s),c=+i-Yo(i);return Math.round((a-c)/lE)}function pE(e,t){const n=$h(e,t),r=pe(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Tn(r)}function mE(e,t,n){return Hr(e,t*7,n)}function gE(e,t,n){return Ba(e,t*12,n)}function vE(e,t){let n,r=t==null?void 0:t.in;return e.forEach(o=>{!r&&typeof o=="object"&&(r=pe.bind(null,o));const s=de(o,r);(!n||n<s||isNaN(+s))&&(n=s)}),pe(r,n||NaN)}function yE(e,t){let n,r=t==null?void 0:t.in;return e.forEach(o=>{!r&&typeof o=="object"&&(r=pe.bind(null,o));const s=de(o,r);(!n||n>s||isNaN(+s))&&(n=s)}),pe(r,n||NaN)}function wE(e){return pe(e,Date.now())}function En(e,t,n){const[r,o]=tr(n==null?void 0:n.in,e,t);return+jr(r)==+jr(o)}function jh(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Yh(e){return!(!jh(e)&&typeof e!="number"||isNaN(+de(e)))}function bE(e,t,n){const[r,o]=tr(n==null?void 0:n.in,e,t),s=r.getFullYear()-o.getFullYear(),i=r.getMonth()-o.getMonth();return s*12+i}function Uh(e,t){const n=de(e,t==null?void 0:t.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function zh(e,t){const[n,r]=tr(e,t.start,t.end);return{start:n,end:r}}function xE(e,t){const{start:n,end:r}=zh(t==null?void 0:t.in,e);let o=+n>+r;const s=o?+n:+r,i=o?r:n;i.setHours(0,0,0,0);let a=1;const c=[];for(;+i<=s;)c.push(pe(n,i)),i.setDate(i.getDate()+a),i.setHours(0,0,0,0);return o?c.reverse():c}function SE(e,t){const{start:n,end:r}=zh(t==null?void 0:t.in,e);let o=+n>+r;const s=o?+n:+r,i=o?r:n;i.setHours(0,0,0,0),i.setDate(1);let a=1;const c=[];for(;+i<=s;)c.push(pe(n,i)),i.setMonth(i.getMonth()+a);return o?c.reverse():c}function Kh(e,t){const n=de(e,t==null?void 0:t.in);return n.setDate(1),n.setHours(0,0,0,0),n}function CE(e,t){const n=de(e,t==null?void 0:t.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}function Gh(e,t){const n=de(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function Wa(e,t){var a,c,l,u;const n=Cn(),r=(t==null?void 0:t.weekStartsOn)??((c=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((u=(l=n.locale)==null?void 0:l.options)==null?void 0:u.weekStartsOn)??0,o=de(e,t==null?void 0:t.in),s=o.getDay(),i=(s<r?-7:0)+6-(s-r);return o.setDate(o.getDate()+i),o.setHours(23,59,59,999),o}function TE(e,t){return Wa(e,{...t,weekStartsOn:1})}const EE={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},PE=(e,t,n)=>{let r;const o=EE[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function $a(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const DE={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},ME={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},OE={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},NE={date:$a({formats:DE,defaultWidth:"full"}),time:$a({formats:ME,defaultWidth:"full"}),dateTime:$a({formats:OE,defaultWidth:"full"})},AE={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},kE=(e,t,n,r)=>AE[e];function Yr(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let o;if(r==="formatting"&&e.formattingValues){const i=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):i;o=e.formattingValues[a]||e.formattingValues[i]}else{const i=e.defaultWidth,a=n!=null&&n.width?String(n.width):e.defaultWidth;o=e.values[a]||e.values[i]}const s=e.argumentCallback?e.argumentCallback(t):t;return o[s]}}const IE={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},_E={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},FE={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},LE={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},VE={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},RE={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},BE={ordinalNumber:(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:Yr({values:IE,defaultWidth:"wide"}),quarter:Yr({values:_E,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Yr({values:FE,defaultWidth:"wide"}),day:Yr({values:LE,defaultWidth:"wide"}),dayPeriod:Yr({values:VE,defaultWidth:"wide",formattingValues:RE,defaultFormattingWidth:"wide"})};function Ur(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(o);if(!s)return null;const i=s[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(a)?$E(a,d=>d.test(i)):WE(a,d=>d.test(i));let l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;const u=t.slice(i.length);return{value:l,rest:u}}}function WE(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function $E(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function HE(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],s=t.match(e.parsePattern);if(!s)return null;let i=e.valueCallback?e.valueCallback(s[0]):s[0];i=n.valueCallback?n.valueCallback(i):i;const a=t.slice(o.length);return{value:i,rest:a}}}const jE=/^(\d+)(th|st|nd|rd)?/i,YE=/\d+/i,UE={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},zE={any:[/^b/i,/^(a|c)/i]},KE={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},GE={any:[/1/i,/2/i,/3/i,/4/i]},qE={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},XE={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},ZE={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},QE={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},JE={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},eP={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},tP={ordinalNumber:HE({matchPattern:jE,parsePattern:YE,valueCallback:e=>parseInt(e,10)}),era:Ur({matchPatterns:UE,defaultMatchWidth:"wide",parsePatterns:zE,defaultParseWidth:"any"}),quarter:Ur({matchPatterns:KE,defaultMatchWidth:"wide",parsePatterns:GE,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Ur({matchPatterns:qE,defaultMatchWidth:"wide",parsePatterns:XE,defaultParseWidth:"any"}),day:Ur({matchPatterns:ZE,defaultMatchWidth:"wide",parsePatterns:QE,defaultParseWidth:"any"}),dayPeriod:Ur({matchPatterns:JE,defaultMatchWidth:"any",parsePatterns:eP,defaultParseWidth:"any"})},Uo={code:"en-US",formatDistance:PE,formatLong:NE,formatRelative:kE,localize:BE,match:tP,options:{weekStartsOn:0,firstWeekContainsDate:1}};function nP(e,t){const n=de(e,t==null?void 0:t.in);return Hh(n,Gh(n))+1}function Ha(e,t){const n=de(e,t==null?void 0:t.in),r=+Tn(n)-+pE(n);return Math.round(r/Rh)+1}function ja(e,t){var u,d,f,h;const n=de(e,t==null?void 0:t.in),r=n.getFullYear(),o=Cn(),s=(t==null?void 0:t.firstWeekContainsDate)??((d=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??o.firstWeekContainsDate??((h=(f=o.locale)==null?void 0:f.options)==null?void 0:h.firstWeekContainsDate)??1,i=pe((t==null?void 0:t.in)||e,0);i.setFullYear(r+1,0,s),i.setHours(0,0,0,0);const a=Dt(i,t),c=pe((t==null?void 0:t.in)||e,0);c.setFullYear(r,0,s),c.setHours(0,0,0,0);const l=Dt(c,t);return+n>=+a?r+1:+n>=+l?r:r-1}function rP(e,t){var a,c,l,u;const n=Cn(),r=(t==null?void 0:t.firstWeekContainsDate)??((c=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((u=(l=n.locale)==null?void 0:l.options)==null?void 0:u.firstWeekContainsDate)??1,o=ja(e,t),s=pe((t==null?void 0:t.in)||e,0);return s.setFullYear(o,0,r),s.setHours(0,0,0,0),Dt(s,t)}function Ya(e,t){const n=de(e,t==null?void 0:t.in),r=+Dt(n,t)-+rP(n,t);return Math.round(r/Rh)+1}function ve(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const tn={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return ve(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):ve(n+1,2)},d(e,t){return ve(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return ve(e.getHours()%12||12,t.length)},H(e,t){return ve(e.getHours(),t.length)},m(e,t){return ve(e.getMinutes(),t.length)},s(e,t){return ve(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return ve(o,t.length)}},nr={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},qh={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return tn.y(e,t)},Y:function(e,t,n,r){const o=ja(e,r),s=o>0?o:1-o;if(t==="YY"){const i=s%100;return ve(i,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):ve(s,t.length)},R:function(e,t){const n=$h(e);return ve(n,t.length)},u:function(e,t){const n=e.getFullYear();return ve(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return ve(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return ve(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return tn.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return ve(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=Ya(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):ve(o,t.length)},I:function(e,t,n){const r=Ha(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):ve(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):tn.d(e,t)},D:function(e,t,n){const r=nP(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):ve(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),s=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return ve(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});case"eeee":default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),s=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return ve(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});case"cccc":default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=r===0?7:r;switch(t){case"i":return String(o);case"ii":return ve(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(r===12?o=nr.noon:r===0?o=nr.midnight:o=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(r>=17?o=nr.evening:r>=12?o=nr.afternoon:r>=4?o=nr.morning:o=nr.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return tn.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):tn.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):ve(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):ve(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):tn.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):tn.s(e,t)},S:function(e,t){return tn.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return Zh(r);case"XXXX":case"XX":return Pn(r);case"XXXXX":case"XXX":default:return Pn(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return Zh(r);case"xxxx":case"xx":return Pn(r);case"xxxxx":case"xxx":default:return Pn(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Xh(r,":");case"OOOO":default:return"GMT"+Pn(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Xh(r,":");case"zzzz":default:return"GMT"+Pn(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return ve(r,t.length)},T:function(e,t,n){return ve(+e,t.length)}};function Xh(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),s=r%60;return s===0?n+String(o):n+String(o)+t+ve(s,2)}function Zh(e,t){return e%60===0?(e>0?"-":"+")+ve(Math.abs(e)/60,2):Pn(e,t)}function Pn(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=ve(Math.trunc(r/60),2),s=ve(r%60,2);return n+o+t+s}const Qh=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Jh=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Ua={p:Jh,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return Qh(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",Qh(r,t)).replace("{{time}}",Jh(o,t))}},oP=/^D+$/,sP=/^Y+$/,iP=["D","DD","YY","YYYY"];function ep(e){return oP.test(e)}function tp(e){return sP.test(e)}function za(e,t,n){const r=aP(e,t,n);if(console.warn(r),iP.includes(e))throw new RangeError(r)}function aP(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const cP=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,lP=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,uP=/^'([^]*?)'?$/,dP=/''/g,fP=/[a-zA-Z]/;function Ue(e,t,n){var u,d,f,h,v,g,w,b;const r=Cn(),o=(n==null?void 0:n.locale)??r.locale??Uo,s=(n==null?void 0:n.firstWeekContainsDate)??((d=(u=n==null?void 0:n.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??r.firstWeekContainsDate??((h=(f=r.locale)==null?void 0:f.options)==null?void 0:h.firstWeekContainsDate)??1,i=(n==null?void 0:n.weekStartsOn)??((g=(v=n==null?void 0:n.locale)==null?void 0:v.options)==null?void 0:g.weekStartsOn)??r.weekStartsOn??((b=(w=r.locale)==null?void 0:w.options)==null?void 0:b.weekStartsOn)??0,a=de(e,n==null?void 0:n.in);if(!Yh(a))throw new RangeError("Invalid time value");let c=t.match(lP).map(S=>{const x=S[0];if(x==="p"||x==="P"){const C=Ua[x];return C(S,o.formatLong)}return S}).join("").match(cP).map(S=>{if(S==="''")return{isToken:!1,value:"'"};const x=S[0];if(x==="'")return{isToken:!1,value:hP(S)};if(qh[x])return{isToken:!0,value:S};if(x.match(fP))throw new RangeError("Format string contains an unescaped latin alphabet character `"+x+"`");return{isToken:!1,value:S}});o.localize.preprocessor&&(c=o.localize.preprocessor(a,c));const l={firstWeekContainsDate:s,weekStartsOn:i,locale:o};return c.map(S=>{if(!S.isToken)return S.value;const x=S.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&tp(x)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&ep(x))&&za(x,t,String(e));const C=qh[x[0]];return C(a,x,o.localize,l)}).join("")}function hP(e){const t=e.match(uP);return t?t[1].replace(dP,"'"):e}function pP(e,t){const n=de(e,t==null?void 0:t.in),r=n.getFullYear(),o=n.getMonth(),s=pe(n,0);return s.setFullYear(r,o+1,0),s.setHours(0,0,0,0),s.getDate()}function mP(){return Object.assign({},Cn())}function gP(e,t){const n=de(e,t==null?void 0:t.in).getDay();return n===0?7:n}function vP(e,t){return de(e,t==null?void 0:t.in).getMonth()}function yP(e,t){return de(e,t==null?void 0:t.in).getFullYear()}function np(e,t){return+de(e)>+de(t)}function rp(e,t){return+de(e)<+de(t)}function wP(e,t){const n=bP(t)?new t(0):pe(t,0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}function bP(e){var t;return typeof e=="function"&&((t=e.prototype)==null?void 0:t.constructor)===e}const xP=10;class op{constructor(){G(this,"subPriority",0)}validate(t,n){return!0}}class SP extends op{constructor(t,n,r,o,s){super(),this.value=t,this.validateValue=n,this.setValue=r,this.priority=o,s&&(this.subPriority=s)}validate(t,n){return this.validateValue(t,this.value,n)}set(t,n,r){return this.setValue(t,n,this.value,r)}}class CP extends op{constructor(n,r){super();G(this,"priority",xP);G(this,"subPriority",-1);this.context=n||(o=>pe(r,o))}set(n,r){return r.timestampIsSet?n:pe(n,wP(n,this.context))}}class me{run(t,n,r,o){const s=this.parse(t,n,r,o);return s?{setter:new SP(s.value,this.validate,this.set,this.priority,this.subPriority),rest:s.rest}:null}validate(t,n,r){return!0}}class TP extends me{constructor(){super(...arguments);G(this,"priority",140);G(this,"incompatibleTokens",["R","u","t","T"])}parse(n,r,o){switch(r){case"G":case"GG":case"GGG":return o.era(n,{width:"abbreviated"})||o.era(n,{width:"narrow"});case"GGGGG":return o.era(n,{width:"narrow"});case"GGGG":default:return o.era(n,{width:"wide"})||o.era(n,{width:"abbreviated"})||o.era(n,{width:"narrow"})}}set(n,r,o){return r.era=o,n.setFullYear(o,0,1),n.setHours(0,0,0,0),n}}const Oe={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},Mt={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function Ne(e,t){return e&&{value:t(e.value),rest:e.rest}}function Se(e,t){const n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function Ot(e,t){const n=t.match(e);if(!n)return null;if(n[0]==="Z")return{value:0,rest:t.slice(1)};const r=n[1]==="+"?1:-1,o=n[2]?parseInt(n[2],10):0,s=n[3]?parseInt(n[3],10):0,i=n[5]?parseInt(n[5],10):0;return{value:r*(o*dE+s*uE+i*fE),rest:t.slice(n[0].length)}}function sp(e){return Se(Oe.anyDigitsSigned,e)}function De(e,t){switch(e){case 1:return Se(Oe.singleDigit,t);case 2:return Se(Oe.twoDigits,t);case 3:return Se(Oe.threeDigits,t);case 4:return Se(Oe.fourDigits,t);default:return Se(new RegExp("^\\d{1,"+e+"}"),t)}}function zo(e,t){switch(e){case 1:return Se(Oe.singleDigitSigned,t);case 2:return Se(Oe.twoDigitsSigned,t);case 3:return Se(Oe.threeDigitsSigned,t);case 4:return Se(Oe.fourDigitsSigned,t);default:return Se(new RegExp("^-?\\d{1,"+e+"}"),t)}}function Ka(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function ip(e,t){const n=t>0,r=n?t:1-t;let o;if(r<=50)o=e||100;else{const s=r+50,i=Math.trunc(s/100)*100,a=e>=s%100;o=e+i-(a?100:0)}return n?o:1-o}function ap(e){return e%400===0||e%4===0&&e%100!==0}class EP extends me{constructor(){super(...arguments);G(this,"priority",130);G(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(n,r,o){const s=i=>({year:i,isTwoDigitYear:r==="yy"});switch(r){case"y":return Ne(De(4,n),s);case"yo":return Ne(o.ordinalNumber(n,{unit:"year"}),s);default:return Ne(De(r.length,n),s)}}validate(n,r){return r.isTwoDigitYear||r.year>0}set(n,r,o){const s=n.getFullYear();if(o.isTwoDigitYear){const a=ip(o.year,s);return n.setFullYear(a,0,1),n.setHours(0,0,0,0),n}const i=!("era"in r)||r.era===1?o.year:1-o.year;return n.setFullYear(i,0,1),n.setHours(0,0,0,0),n}}class PP extends me{constructor(){super(...arguments);G(this,"priority",130);G(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(n,r,o){const s=i=>({year:i,isTwoDigitYear:r==="YY"});switch(r){case"Y":return Ne(De(4,n),s);case"Yo":return Ne(o.ordinalNumber(n,{unit:"year"}),s);default:return Ne(De(r.length,n),s)}}validate(n,r){return r.isTwoDigitYear||r.year>0}set(n,r,o,s){const i=ja(n,s);if(o.isTwoDigitYear){const c=ip(o.year,i);return n.setFullYear(c,0,s.firstWeekContainsDate),n.setHours(0,0,0,0),Dt(n,s)}const a=!("era"in r)||r.era===1?o.year:1-o.year;return n.setFullYear(a,0,s.firstWeekContainsDate),n.setHours(0,0,0,0),Dt(n,s)}}class DP extends me{constructor(){super(...arguments);G(this,"priority",130);G(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(n,r){return zo(r==="R"?4:r.length,n)}set(n,r,o){const s=pe(n,0);return s.setFullYear(o,0,4),s.setHours(0,0,0,0),Tn(s)}}class MP extends me{constructor(){super(...arguments);G(this,"priority",130);G(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(n,r){return zo(r==="u"?4:r.length,n)}set(n,r,o){return n.setFullYear(o,0,1),n.setHours(0,0,0,0),n}}class OP extends me{constructor(){super(...arguments);G(this,"priority",120);G(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(n,r,o){switch(r){case"Q":case"QQ":return De(r.length,n);case"Qo":return o.ordinalNumber(n,{unit:"quarter"});case"QQQ":return o.quarter(n,{width:"abbreviated",context:"formatting"})||o.quarter(n,{width:"narrow",context:"formatting"});case"QQQQQ":return o.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return o.quarter(n,{width:"wide",context:"formatting"})||o.quarter(n,{width:"abbreviated",context:"formatting"})||o.quarter(n,{width:"narrow",context:"formatting"})}}validate(n,r){return r>=1&&r<=4}set(n,r,o){return n.setMonth((o-1)*3,1),n.setHours(0,0,0,0),n}}class NP extends me{constructor(){super(...arguments);G(this,"priority",120);G(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(n,r,o){switch(r){case"q":case"qq":return De(r.length,n);case"qo":return o.ordinalNumber(n,{unit:"quarter"});case"qqq":return o.quarter(n,{width:"abbreviated",context:"standalone"})||o.quarter(n,{width:"narrow",context:"standalone"});case"qqqqq":return o.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return o.quarter(n,{width:"wide",context:"standalone"})||o.quarter(n,{width:"abbreviated",context:"standalone"})||o.quarter(n,{width:"narrow",context:"standalone"})}}validate(n,r){return r>=1&&r<=4}set(n,r,o){return n.setMonth((o-1)*3,1),n.setHours(0,0,0,0),n}}class AP extends me{constructor(){super(...arguments);G(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);G(this,"priority",110)}parse(n,r,o){const s=i=>i-1;switch(r){case"M":return Ne(Se(Oe.month,n),s);case"MM":return Ne(De(2,n),s);case"Mo":return Ne(o.ordinalNumber(n,{unit:"month"}),s);case"MMM":return o.month(n,{width:"abbreviated",context:"formatting"})||o.month(n,{width:"narrow",context:"formatting"});case"MMMMM":return o.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return o.month(n,{width:"wide",context:"formatting"})||o.month(n,{width:"abbreviated",context:"formatting"})||o.month(n,{width:"narrow",context:"formatting"})}}validate(n,r){return r>=0&&r<=11}set(n,r,o){return n.setMonth(o,1),n.setHours(0,0,0,0),n}}class kP extends me{constructor(){super(...arguments);G(this,"priority",110);G(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(n,r,o){const s=i=>i-1;switch(r){case"L":return Ne(Se(Oe.month,n),s);case"LL":return Ne(De(2,n),s);case"Lo":return Ne(o.ordinalNumber(n,{unit:"month"}),s);case"LLL":return o.month(n,{width:"abbreviated",context:"standalone"})||o.month(n,{width:"narrow",context:"standalone"});case"LLLLL":return o.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return o.month(n,{width:"wide",context:"standalone"})||o.month(n,{width:"abbreviated",context:"standalone"})||o.month(n,{width:"narrow",context:"standalone"})}}validate(n,r){return r>=0&&r<=11}set(n,r,o){return n.setMonth(o,1),n.setHours(0,0,0,0),n}}function IP(e,t,n){const r=de(e,n==null?void 0:n.in),o=Ya(r,n)-t;return r.setDate(r.getDate()-o*7),de(r,n==null?void 0:n.in)}class _P extends me{constructor(){super(...arguments);G(this,"priority",100);G(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(n,r,o){switch(r){case"w":return Se(Oe.week,n);case"wo":return o.ordinalNumber(n,{unit:"week"});default:return De(r.length,n)}}validate(n,r){return r>=1&&r<=53}set(n,r,o,s){return Dt(IP(n,o,s),s)}}function FP(e,t,n){const r=de(e,n==null?void 0:n.in),o=Ha(r,n)-t;return r.setDate(r.getDate()-o*7),r}class LP extends me{constructor(){super(...arguments);G(this,"priority",100);G(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(n,r,o){switch(r){case"I":return Se(Oe.week,n);case"Io":return o.ordinalNumber(n,{unit:"week"});default:return De(r.length,n)}}validate(n,r){return r>=1&&r<=53}set(n,r,o){return Tn(FP(n,o))}}const VP=[31,28,31,30,31,30,31,31,30,31,30,31],RP=[31,29,31,30,31,30,31,31,30,31,30,31];class BP extends me{constructor(){super(...arguments);G(this,"priority",90);G(this,"subPriority",1);G(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(n,r,o){switch(r){case"d":return Se(Oe.date,n);case"do":return o.ordinalNumber(n,{unit:"date"});default:return De(r.length,n)}}validate(n,r){const o=n.getFullYear(),s=ap(o),i=n.getMonth();return s?r>=1&&r<=RP[i]:r>=1&&r<=VP[i]}set(n,r,o){return n.setDate(o),n.setHours(0,0,0,0),n}}class WP extends me{constructor(){super(...arguments);G(this,"priority",90);G(this,"subpriority",1);G(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(n,r,o){switch(r){case"D":case"DD":return Se(Oe.dayOfYear,n);case"Do":return o.ordinalNumber(n,{unit:"date"});default:return De(r.length,n)}}validate(n,r){const o=n.getFullYear();return ap(o)?r>=1&&r<=366:r>=1&&r<=365}set(n,r,o){return n.setMonth(0,o),n.setHours(0,0,0,0),n}}function Ga(e,t,n){var d,f,h,v;const r=Cn(),o=(n==null?void 0:n.weekStartsOn)??((f=(d=n==null?void 0:n.locale)==null?void 0:d.options)==null?void 0:f.weekStartsOn)??r.weekStartsOn??((v=(h=r.locale)==null?void 0:h.options)==null?void 0:v.weekStartsOn)??0,s=de(e,n==null?void 0:n.in),i=s.getDay(),c=(t%7+7)%7,l=7-o,u=t<0||t>6?t-(i+l)%7:(c+l)%7-(i+l)%7;return Hr(s,u,n)}class $P extends me{constructor(){super(...arguments);G(this,"priority",90);G(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(n,r,o){switch(r){case"E":case"EE":case"EEE":return o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"});case"EEEEE":return o.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"});case"EEEE":default:return o.day(n,{width:"wide",context:"formatting"})||o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"})}}validate(n,r){return r>=0&&r<=6}set(n,r,o,s){return n=Ga(n,o,s),n.setHours(0,0,0,0),n}}class HP extends me{constructor(){super(...arguments);G(this,"priority",90);G(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(n,r,o,s){const i=a=>{const c=Math.floor((a-1)/7)*7;return(a+s.weekStartsOn+6)%7+c};switch(r){case"e":case"ee":return Ne(De(r.length,n),i);case"eo":return Ne(o.ordinalNumber(n,{unit:"day"}),i);case"eee":return o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"});case"eeeee":return o.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"});case"eeee":default:return o.day(n,{width:"wide",context:"formatting"})||o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"})}}validate(n,r){return r>=0&&r<=6}set(n,r,o,s){return n=Ga(n,o,s),n.setHours(0,0,0,0),n}}class jP extends me{constructor(){super(...arguments);G(this,"priority",90);G(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(n,r,o,s){const i=a=>{const c=Math.floor((a-1)/7)*7;return(a+s.weekStartsOn+6)%7+c};switch(r){case"c":case"cc":return Ne(De(r.length,n),i);case"co":return Ne(o.ordinalNumber(n,{unit:"day"}),i);case"ccc":return o.day(n,{width:"abbreviated",context:"standalone"})||o.day(n,{width:"short",context:"standalone"})||o.day(n,{width:"narrow",context:"standalone"});case"ccccc":return o.day(n,{width:"narrow",context:"standalone"});case"cccccc":return o.day(n,{width:"short",context:"standalone"})||o.day(n,{width:"narrow",context:"standalone"});case"cccc":default:return o.day(n,{width:"wide",context:"standalone"})||o.day(n,{width:"abbreviated",context:"standalone"})||o.day(n,{width:"short",context:"standalone"})||o.day(n,{width:"narrow",context:"standalone"})}}validate(n,r){return r>=0&&r<=6}set(n,r,o,s){return n=Ga(n,o,s),n.setHours(0,0,0,0),n}}function YP(e,t,n){const r=de(e,n==null?void 0:n.in),o=gP(r,n),s=t-o;return Hr(r,s,n)}class UP extends me{constructor(){super(...arguments);G(this,"priority",90);G(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(n,r,o){const s=i=>i===0?7:i;switch(r){case"i":case"ii":return De(r.length,n);case"io":return o.ordinalNumber(n,{unit:"day"});case"iii":return Ne(o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"}),s);case"iiiii":return Ne(o.day(n,{width:"narrow",context:"formatting"}),s);case"iiiiii":return Ne(o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"}),s);case"iiii":default:return Ne(o.day(n,{width:"wide",context:"formatting"})||o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"}),s)}}validate(n,r){return r>=1&&r<=7}set(n,r,o){return n=YP(n,o),n.setHours(0,0,0,0),n}}class zP extends me{constructor(){super(...arguments);G(this,"priority",80);G(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(n,r,o){switch(r){case"a":case"aa":case"aaa":return o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaaa":return o.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return o.dayPeriod(n,{width:"wide",context:"formatting"})||o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,r,o){return n.setHours(Ka(o),0,0,0),n}}class KP extends me{constructor(){super(...arguments);G(this,"priority",80);G(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(n,r,o){switch(r){case"b":case"bb":case"bbb":return o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbbb":return o.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return o.dayPeriod(n,{width:"wide",context:"formatting"})||o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,r,o){return n.setHours(Ka(o),0,0,0),n}}class GP extends me{constructor(){super(...arguments);G(this,"priority",80);G(this,"incompatibleTokens",["a","b","t","T"])}parse(n,r,o){switch(r){case"B":case"BB":case"BBB":return o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBBB":return o.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return o.dayPeriod(n,{width:"wide",context:"formatting"})||o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,r,o){return n.setHours(Ka(o),0,0,0),n}}class qP extends me{constructor(){super(...arguments);G(this,"priority",70);G(this,"incompatibleTokens",["H","K","k","t","T"])}parse(n,r,o){switch(r){case"h":return Se(Oe.hour12h,n);case"ho":return o.ordinalNumber(n,{unit:"hour"});default:return De(r.length,n)}}validate(n,r){return r>=1&&r<=12}set(n,r,o){const s=n.getHours()>=12;return s&&o<12?n.setHours(o+12,0,0,0):!s&&o===12?n.setHours(0,0,0,0):n.setHours(o,0,0,0),n}}class XP extends me{constructor(){super(...arguments);G(this,"priority",70);G(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(n,r,o){switch(r){case"H":return Se(Oe.hour23h,n);case"Ho":return o.ordinalNumber(n,{unit:"hour"});default:return De(r.length,n)}}validate(n,r){return r>=0&&r<=23}set(n,r,o){return n.setHours(o,0,0,0),n}}class ZP extends me{constructor(){super(...arguments);G(this,"priority",70);G(this,"incompatibleTokens",["h","H","k","t","T"])}parse(n,r,o){switch(r){case"K":return Se(Oe.hour11h,n);case"Ko":return o.ordinalNumber(n,{unit:"hour"});default:return De(r.length,n)}}validate(n,r){return r>=0&&r<=11}set(n,r,o){return n.getHours()>=12&&o<12?n.setHours(o+12,0,0,0):n.setHours(o,0,0,0),n}}class QP extends me{constructor(){super(...arguments);G(this,"priority",70);G(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(n,r,o){switch(r){case"k":return Se(Oe.hour24h,n);case"ko":return o.ordinalNumber(n,{unit:"hour"});default:return De(r.length,n)}}validate(n,r){return r>=1&&r<=24}set(n,r,o){const s=o<=24?o%24:o;return n.setHours(s,0,0,0),n}}class JP extends me{constructor(){super(...arguments);G(this,"priority",60);G(this,"incompatibleTokens",["t","T"])}parse(n,r,o){switch(r){case"m":return Se(Oe.minute,n);case"mo":return o.ordinalNumber(n,{unit:"minute"});default:return De(r.length,n)}}validate(n,r){return r>=0&&r<=59}set(n,r,o){return n.setMinutes(o,0,0),n}}class eD extends me{constructor(){super(...arguments);G(this,"priority",50);G(this,"incompatibleTokens",["t","T"])}parse(n,r,o){switch(r){case"s":return Se(Oe.second,n);case"so":return o.ordinalNumber(n,{unit:"second"});default:return De(r.length,n)}}validate(n,r){return r>=0&&r<=59}set(n,r,o){return n.setSeconds(o,0),n}}class tD extends me{constructor(){super(...arguments);G(this,"priority",30);G(this,"incompatibleTokens",["t","T"])}parse(n,r){const o=s=>Math.trunc(s*Math.pow(10,-r.length+3));return Ne(De(r.length,n),o)}set(n,r,o){return n.setMilliseconds(o),n}}class nD extends me{constructor(){super(...arguments);G(this,"priority",10);G(this,"incompatibleTokens",["t","T","x"])}parse(n,r){switch(r){case"X":return Ot(Mt.basicOptionalMinutes,n);case"XX":return Ot(Mt.basic,n);case"XXXX":return Ot(Mt.basicOptionalSeconds,n);case"XXXXX":return Ot(Mt.extendedOptionalSeconds,n);case"XXX":default:return Ot(Mt.extended,n)}}set(n,r,o){return r.timestampIsSet?n:pe(n,n.getTime()-Yo(n)-o)}}class rD extends me{constructor(){super(...arguments);G(this,"priority",10);G(this,"incompatibleTokens",["t","T","X"])}parse(n,r){switch(r){case"x":return Ot(Mt.basicOptionalMinutes,n);case"xx":return Ot(Mt.basic,n);case"xxxx":return Ot(Mt.basicOptionalSeconds,n);case"xxxxx":return Ot(Mt.extendedOptionalSeconds,n);case"xxx":default:return Ot(Mt.extended,n)}}set(n,r,o){return r.timestampIsSet?n:pe(n,n.getTime()-Yo(n)-o)}}class oD extends me{constructor(){super(...arguments);G(this,"priority",40);G(this,"incompatibleTokens","*")}parse(n){return sp(n)}set(n,r,o){return[pe(n,o*1e3),{timestampIsSet:!0}]}}class sD extends me{constructor(){super(...arguments);G(this,"priority",20);G(this,"incompatibleTokens","*")}parse(n){return sp(n)}set(n,r,o){return[pe(n,o),{timestampIsSet:!0}]}}const iD={G:new TP,y:new EP,Y:new PP,R:new DP,u:new MP,Q:new OP,q:new NP,M:new AP,L:new kP,w:new _P,I:new LP,d:new BP,D:new WP,E:new $P,e:new HP,c:new jP,i:new UP,a:new zP,b:new KP,B:new GP,h:new qP,H:new XP,K:new ZP,k:new QP,m:new JP,s:new eD,S:new tD,X:new nD,x:new rD,t:new oD,T:new sD},aD=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,cD=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,lD=/^'([^]*?)'?$/,uD=/''/g,dD=/\S/,fD=/[a-zA-Z]/;function hD(e,t,n,r){var w,b,S,x;const o=()=>pe(n,NaN),s=mP(),i=s.locale??Uo,a=s.firstWeekContainsDate??((b=(w=s.locale)==null?void 0:w.options)==null?void 0:b.firstWeekContainsDate)??1,c=s.weekStartsOn??((x=(S=s.locale)==null?void 0:S.options)==null?void 0:x.weekStartsOn)??0,l={firstWeekContainsDate:a,weekStartsOn:c,locale:i},u=[new CP(r==null?void 0:r.in,n)],d=t.match(cD).map(C=>{const E=C[0];if(E in Ua){const D=Ua[E];return D(C,i.formatLong)}return C}).join("").match(aD),f=[];for(let C of d){tp(C)&&za(C,t,e),ep(C)&&za(C,t,e);const E=C[0],D=iD[E];if(D){const{incompatibleTokens:T}=D;if(Array.isArray(T)){const M=f.find(N=>T.includes(N.token)||N.token===E);if(M)throw new RangeError(`The format string mustn't contain \`${M.fullToken}\` and \`${C}\` at the same time`)}else if(D.incompatibleTokens==="*"&&f.length>0)throw new RangeError(`The format string mustn't contain \`${C}\` and any other token at the same time`);f.push({token:E,fullToken:C});const P=D.run(e,C,i.match,l);if(!P)return o();u.push(P.setter),e=P.rest}else{if(E.match(fD))throw new RangeError("Format string contains an unescaped latin alphabet character `"+E+"`");if(C==="''"?C="'":E==="'"&&(C=pD(C)),e.indexOf(C)===0)e=e.slice(C.length);else return o()}}if(e.length>0&&dD.test(e))return o();const h=u.map(C=>C.priority).sort((C,E)=>E-C).filter((C,E,D)=>D.indexOf(C)===E).map(C=>u.filter(E=>E.priority===C).sort((E,D)=>D.subPriority-E.subPriority)).map(C=>C[0]);let v=de(n,r==null?void 0:r.in);if(isNaN(+v))return o();const g={};for(const C of h){if(!C.validate(v,l))return o();const E=C.set(v,g,l);Array.isArray(E)?(v=E[0],Object.assign(g,E[1])):v=E}return v}function pD(e){return e.match(lD)[1].replace(uD,"'")}function cp(e,t,n){const[r,o]=tr(n==null?void 0:n.in,e,t);return r.getFullYear()===o.getFullYear()&&r.getMonth()===o.getMonth()}function mD(e,t,n){const[r,o]=tr(n==null?void 0:n.in,e,t);return r.getFullYear()===o.getFullYear()}function gD(e,t){return En(pe(e,e),wE(e))}function lp(e,t,n){const r=de(e,n==null?void 0:n.in),o=r.getFullYear(),s=r.getDate(),i=pe(e,0);i.setFullYear(o,t,15),i.setHours(0,0,0,0);const a=pP(i);return r.setMonth(t,Math.min(s,a)),r}function up(e,t,n){let r=de(e,n==null?void 0:n.in);return isNaN(+r)?pe(e,NaN):(t.year!=null&&r.setFullYear(t.year),t.month!=null&&(r=lp(r,t.month)),t.date!=null&&r.setDate(t.date),t.hours!=null&&r.setHours(t.hours),t.minutes!=null&&r.setMinutes(t.minutes),t.seconds!=null&&r.setSeconds(t.seconds),t.milliseconds!=null&&r.setMilliseconds(t.milliseconds),r)}function vD(e,t,n){const r=de(e,n==null?void 0:n.in);return isNaN(+r)?pe(e,NaN):(r.setFullYear(t),r)}const dp=5,yD=4;function wD(e,t){const n=t.startOfMonth(e),r=n.getDay()>0?n.getDay():7,o=t.addDays(e,-r+1),s=t.addDays(o,dp*7-1);return t.getMonth(e)===t.getMonth(s)?dp:yD}function fp(e,t){const n=t.startOfMonth(e),r=n.getDay();return r===1?n:r===0?t.addDays(n,-6):t.addDays(n,-1*(r-1))}function bD(e,t){const n=fp(e,t),r=wD(e,t);return t.addDays(n,r*7-1)}class Ge{constructor(t,n){this.Date=Date,this.today=()=>{var r;return(r=this.overrides)!=null&&r.today?this.overrides.today():this.options.timeZone?Be.tz(this.options.timeZone):new this.Date},this.newDate=(r,o,s)=>{var i;return(i=this.overrides)!=null&&i.newDate?this.overrides.newDate(r,o,s):this.options.timeZone?new Be(r,o,s,this.options.timeZone):new Date(r,o,s)},this.addDays=(r,o)=>{var s;return(s=this.overrides)!=null&&s.addDays?this.overrides.addDays(r,o):Hr(r,o)},this.addMonths=(r,o)=>{var s;return(s=this.overrides)!=null&&s.addMonths?this.overrides.addMonths(r,o):Ba(r,o)},this.addWeeks=(r,o)=>{var s;return(s=this.overrides)!=null&&s.addWeeks?this.overrides.addWeeks(r,o):mE(r,o)},this.addYears=(r,o)=>{var s;return(s=this.overrides)!=null&&s.addYears?this.overrides.addYears(r,o):gE(r,o)},this.differenceInCalendarDays=(r,o)=>{var s;return(s=this.overrides)!=null&&s.differenceInCalendarDays?this.overrides.differenceInCalendarDays(r,o):Hh(r,o)},this.differenceInCalendarMonths=(r,o)=>{var s;return(s=this.overrides)!=null&&s.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(r,o):bE(r,o)},this.eachMonthOfInterval=r=>{var o;return(o=this.overrides)!=null&&o.eachMonthOfInterval?this.overrides.eachMonthOfInterval(r):SE(r)},this.endOfBroadcastWeek=r=>{var o;return(o=this.overrides)!=null&&o.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(r):bD(r,this)},this.endOfISOWeek=r=>{var o;return(o=this.overrides)!=null&&o.endOfISOWeek?this.overrides.endOfISOWeek(r):TE(r)},this.endOfMonth=r=>{var o;return(o=this.overrides)!=null&&o.endOfMonth?this.overrides.endOfMonth(r):Uh(r)},this.endOfWeek=(r,o)=>{var s;return(s=this.overrides)!=null&&s.endOfWeek?this.overrides.endOfWeek(r,o):Wa(r,this.options)},this.endOfYear=r=>{var o;return(o=this.overrides)!=null&&o.endOfYear?this.overrides.endOfYear(r):CE(r)},this.format=(r,o,s)=>{var a;const i=(a=this.overrides)!=null&&a.format?this.overrides.format(r,o,this.options):Ue(r,o,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(i):i},this.getISOWeek=r=>{var o;return(o=this.overrides)!=null&&o.getISOWeek?this.overrides.getISOWeek(r):Ha(r)},this.getMonth=(r,o)=>{var s;return(s=this.overrides)!=null&&s.getMonth?this.overrides.getMonth(r,this.options):vP(r,this.options)},this.getYear=(r,o)=>{var s;return(s=this.overrides)!=null&&s.getYear?this.overrides.getYear(r,this.options):yP(r,this.options)},this.getWeek=(r,o)=>{var s;return(s=this.overrides)!=null&&s.getWeek?this.overrides.getWeek(r,this.options):Ya(r,this.options)},this.isAfter=(r,o)=>{var s;return(s=this.overrides)!=null&&s.isAfter?this.overrides.isAfter(r,o):np(r,o)},this.isBefore=(r,o)=>{var s;return(s=this.overrides)!=null&&s.isBefore?this.overrides.isBefore(r,o):rp(r,o)},this.isDate=r=>{var o;return(o=this.overrides)!=null&&o.isDate?this.overrides.isDate(r):jh(r)},this.isSameDay=(r,o)=>{var s;return(s=this.overrides)!=null&&s.isSameDay?this.overrides.isSameDay(r,o):En(r,o)},this.isSameMonth=(r,o)=>{var s;return(s=this.overrides)!=null&&s.isSameMonth?this.overrides.isSameMonth(r,o):cp(r,o)},this.isSameYear=(r,o)=>{var s;return(s=this.overrides)!=null&&s.isSameYear?this.overrides.isSameYear(r,o):mD(r,o)},this.max=r=>{var o;return(o=this.overrides)!=null&&o.max?this.overrides.max(r):vE(r)},this.min=r=>{var o;return(o=this.overrides)!=null&&o.min?this.overrides.min(r):yE(r)},this.setMonth=(r,o)=>{var s;return(s=this.overrides)!=null&&s.setMonth?this.overrides.setMonth(r,o):lp(r,o)},this.setYear=(r,o)=>{var s;return(s=this.overrides)!=null&&s.setYear?this.overrides.setYear(r,o):vD(r,o)},this.startOfBroadcastWeek=(r,o)=>{var s;return(s=this.overrides)!=null&&s.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(r,this):fp(r,this)},this.startOfDay=r=>{var o;return(o=this.overrides)!=null&&o.startOfDay?this.overrides.startOfDay(r):jr(r)},this.startOfISOWeek=r=>{var o;return(o=this.overrides)!=null&&o.startOfISOWeek?this.overrides.startOfISOWeek(r):Tn(r)},this.startOfMonth=r=>{var o;return(o=this.overrides)!=null&&o.startOfMonth?this.overrides.startOfMonth(r):Kh(r)},this.startOfWeek=(r,o)=>{var s;return(s=this.overrides)!=null&&s.startOfWeek?this.overrides.startOfWeek(r,this.options):Dt(r,this.options)},this.startOfYear=r=>{var o;return(o=this.overrides)!=null&&o.startOfYear?this.overrides.startOfYear(r):Gh(r)},this.options={locale:Uo,...t},this.overrides=n}getDigitMap(){const{numerals:t="latn"}=this.options,n=new Intl.NumberFormat("en-US",{numberingSystem:t}),r={};for(let o=0;o<10;o++)r[o.toString()]=n.format(o);return r}replaceDigits(t){const n=this.getDigitMap();return t.replace(/\d/g,r=>n[r]||r)}formatNumber(t){return this.replaceDigits(t.toString())}getMonthYearOrder(){var n;const t=(n=this.options.locale)==null?void 0:n.code;return t&&Ge.yearFirstLocales.has(t)?"year-first":"month-first"}formatMonthYear(t){const{locale:n,timeZone:r,numerals:o}=this.options,s=n==null?void 0:n.code;if(s&&Ge.yearFirstLocales.has(s))try{return new Intl.DateTimeFormat(s,{month:"long",year:"numeric",timeZone:r,numberingSystem:o}).format(t)}catch{}const i=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(t,i)}}Ge.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);const Nt=new Ge;class hp{constructor(t,n,r=Nt){this.date=t,this.displayMonth=n,this.outside=!!(n&&!r.isSameMonth(t,n)),this.dateLib=r}isEqualTo(t){return this.dateLib.isSameDay(t.date,this.date)&&this.dateLib.isSameMonth(t.displayMonth,this.displayMonth)}}class xD{constructor(t,n){this.date=t,this.weeks=n}}class SD{constructor(t,n){this.days=n,this.weekNumber=t}}function CD(e){return y.createElement("button",{...e})}function TD(e){return y.createElement("span",{...e})}function ED(e){const{size:t=24,orientation:n="left",className:r}=e;return y.createElement("svg",{className:r,width:t,height:t,viewBox:"0 0 24 24"},n==="up"&&y.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&y.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&y.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&y.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function PD(e){const{day:t,modifiers:n,...r}=e;return y.createElement("td",{...r})}function DD(e){const{day:t,modifiers:n,...r}=e,o=y.useRef(null);return y.useEffect(()=>{var s;n.focused&&((s=o.current)==null||s.focus())},[n.focused]),y.createElement("button",{ref:o,...r})}var Q;(function(e){e.Root="root",e.Chevron="chevron",e.Day="day",e.DayButton="day_button",e.CaptionLabel="caption_label",e.Dropdowns="dropdowns",e.Dropdown="dropdown",e.DropdownRoot="dropdown_root",e.Footer="footer",e.MonthGrid="month_grid",e.MonthCaption="month_caption",e.MonthsDropdown="months_dropdown",e.Month="month",e.Months="months",e.Nav="nav",e.NextMonthButton="button_next",e.PreviousMonthButton="button_previous",e.Week="week",e.Weeks="weeks",e.Weekday="weekday",e.Weekdays="weekdays",e.WeekNumber="week_number",e.WeekNumberHeader="week_number_header",e.YearsDropdown="years_dropdown"})(Q||(Q={}));var Ce;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(Ce||(Ce={}));var gt;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(gt||(gt={}));var qe;(function(e){e.weeks_before_enter="weeks_before_enter",e.weeks_before_exit="weeks_before_exit",e.weeks_after_enter="weeks_after_enter",e.weeks_after_exit="weeks_after_exit",e.caption_after_enter="caption_after_enter",e.caption_after_exit="caption_after_exit",e.caption_before_enter="caption_before_enter",e.caption_before_exit="caption_before_exit"})(qe||(qe={}));function MD(e){const{options:t,className:n,components:r,classNames:o,...s}=e,i=[o[Q.Dropdown],n].join(" "),a=t==null?void 0:t.find(({value:c})=>c===s.value);return y.createElement("span",{"data-disabled":s.disabled,className:o[Q.DropdownRoot]},y.createElement(r.Select,{className:i,...s},t==null?void 0:t.map(({value:c,label:l,disabled:u})=>y.createElement(r.Option,{key:c,value:c,disabled:u},l))),y.createElement("span",{className:o[Q.CaptionLabel],"aria-hidden":!0},a==null?void 0:a.label,y.createElement(r.Chevron,{orientation:"down",size:18,className:o[Q.Chevron]})))}function OD(e){return y.createElement("div",{...e})}function ND(e){return y.createElement("div",{...e})}function AD(e){const{calendarMonth:t,displayIndex:n,...r}=e;return y.createElement("div",{...r},e.children)}function kD(e){const{calendarMonth:t,displayIndex:n,...r}=e;return y.createElement("div",{...r})}function ID(e){return y.createElement("table",{...e})}function _D(e){return y.createElement("div",{...e})}const pp=y.createContext(void 0);function zr(){const e=y.useContext(pp);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function FD(e){const{components:t}=zr();return y.createElement(t.Dropdown,{...e})}function LD(e){const{onPreviousClick:t,onNextClick:n,previousMonth:r,nextMonth:o,...s}=e,{components:i,classNames:a,labels:{labelPrevious:c,labelNext:l}}=zr(),u=y.useCallback(f=>{o&&(n==null||n(f))},[o,n]),d=y.useCallback(f=>{r&&(t==null||t(f))},[r,t]);return y.createElement("nav",{...s},y.createElement(i.PreviousMonthButton,{type:"button",className:a[Q.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":r?void 0:!0,"aria-label":c(r),onClick:d},y.createElement(i.Chevron,{disabled:r?void 0:!0,className:a[Q.Chevron],orientation:"left"})),y.createElement(i.NextMonthButton,{type:"button",className:a[Q.NextMonthButton],tabIndex:o?void 0:-1,"aria-disabled":o?void 0:!0,"aria-label":l(o),onClick:u},y.createElement(i.Chevron,{disabled:o?void 0:!0,orientation:"right",className:a[Q.Chevron]})))}function VD(e){const{components:t}=zr();return y.createElement(t.Button,{...e})}function RD(e){return y.createElement("option",{...e})}function BD(e){const{components:t}=zr();return y.createElement(t.Button,{...e})}function WD(e){const{rootRef:t,...n}=e;return y.createElement("div",{...n,ref:t})}function $D(e){return y.createElement("select",{...e})}function HD(e){const{week:t,...n}=e;return y.createElement("tr",{...n})}function jD(e){return y.createElement("th",{...e})}function YD(e){return y.createElement("thead",{"aria-hidden":!0},y.createElement("tr",{...e}))}function UD(e){const{week:t,...n}=e;return y.createElement("th",{...n})}function zD(e){return y.createElement("th",{...e})}function KD(e){return y.createElement("tbody",{...e})}function GD(e){const{components:t}=zr();return y.createElement(t.Dropdown,{...e})}const qD=Object.freeze(Object.defineProperty({__proto__:null,Button:CD,CaptionLabel:TD,Chevron:ED,Day:PD,DayButton:DD,Dropdown:MD,DropdownNav:OD,Footer:ND,Month:AD,MonthCaption:kD,MonthGrid:ID,Months:_D,MonthsDropdown:FD,Nav:LD,NextMonthButton:VD,Option:RD,PreviousMonthButton:BD,Root:WD,Select:$D,Week:HD,WeekNumber:UD,WeekNumberHeader:zD,Weekday:jD,Weekdays:YD,Weeks:KD,YearsDropdown:GD},Symbol.toStringTag,{value:"Module"}));function jt(e,t,n=!1,r=Nt){let{from:o,to:s}=e;const{differenceInCalendarDays:i,isSameDay:a}=r;return o&&s?(i(s,o)<0&&([o,s]=[s,o]),i(t,o)>=(n?1:0)&&i(s,t)>=(n?1:0)):!n&&s?a(s,t):!n&&o?a(o,t):!1}function mp(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function qa(e){return!!(e&&typeof e=="object"&&"from"in e)}function gp(e){return!!(e&&typeof e=="object"&&"after"in e)}function vp(e){return!!(e&&typeof e=="object"&&"before"in e)}function yp(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function wp(e,t){return Array.isArray(e)&&e.every(t.isDate)}function Yt(e,t,n=Nt){const r=Array.isArray(t)?t:[t],{isSameDay:o,differenceInCalendarDays:s,isAfter:i}=n;return r.some(a=>{if(typeof a=="boolean")return a;if(n.isDate(a))return o(e,a);if(wp(a,n))return a.includes(e);if(qa(a))return jt(a,e,!1,n);if(yp(a))return Array.isArray(a.dayOfWeek)?a.dayOfWeek.includes(e.getDay()):a.dayOfWeek===e.getDay();if(mp(a)){const c=s(a.before,e),l=s(a.after,e),u=c>0,d=l<0;return i(a.before,a.after)?d&&u:u||d}return gp(a)?s(e,a.after)>0:vp(a)?s(a.before,e)>0:typeof a=="function"?a(e):!1})}function XD(e,t,n,r,o){const{disabled:s,hidden:i,modifiers:a,showOutsideDays:c,broadcastCalendar:l,today:u}=t,{isSameDay:d,isSameMonth:f,startOfMonth:h,isBefore:v,endOfMonth:g,isAfter:w}=o,b=n&&h(n),S=r&&g(r),x={[Ce.focused]:[],[Ce.outside]:[],[Ce.disabled]:[],[Ce.hidden]:[],[Ce.today]:[]},C={};for(const E of e){const{date:D,displayMonth:T}=E,P=!!(T&&!f(D,T)),M=!!(b&&v(D,b)),N=!!(S&&w(D,S)),_=!!(s&&Yt(D,s,o)),V=!!(i&&Yt(D,i,o))||M||N||!l&&!c&&P||l&&c===!1&&P,O=d(D,u??o.today());P&&x.outside.push(E),_&&x.disabled.push(E),V&&x.hidden.push(E),O&&x.today.push(E),a&&Object.keys(a).forEach(A=>{const L=a==null?void 0:a[A];L&&Yt(D,L,o)&&(C[A]?C[A].push(E):C[A]=[E])})}return E=>{const D={[Ce.focused]:!1,[Ce.disabled]:!1,[Ce.hidden]:!1,[Ce.outside]:!1,[Ce.today]:!1},T={};for(const P in x){const M=x[P];D[P]=M.some(N=>N===E)}for(const P in C)T[P]=C[P].some(M=>M===E);return{...D,...T}}}function ZD(e,t,n={}){return Object.entries(e).filter(([,o])=>o===!0).reduce((o,[s])=>(n[s]?o.push(n[s]):t[Ce[s]]?o.push(t[Ce[s]]):t[gt[s]]&&o.push(t[gt[s]]),o),[t[Q.Day]])}function QD(e){return{...qD,...e}}function JD(e){const t={"data-mode":e.mode??void 0,"data-required":"required"in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0,"data-nav-layout":e.navLayout||void 0};return Object.entries(e).forEach(([n,r])=>{n.startsWith("data-")&&(t[n]=r)}),t}function eM(){const e={};for(const t in Q)e[Q[t]]=`rdp-${Q[t]}`;for(const t in Ce)e[Ce[t]]=`rdp-${Ce[t]}`;for(const t in gt)e[gt[t]]=`rdp-${gt[t]}`;for(const t in qe)e[qe[t]]=`rdp-${qe[t]}`;return e}function bp(e,t,n){return(n??new Ge(t)).formatMonthYear(e)}const tM=bp;function nM(e,t,n){return(n??new Ge(t)).format(e,"d")}function rM(e,t=Nt){return t.format(e,"LLLL")}function oM(e,t,n){return(n??new Ge(t)).format(e,"cccccc")}function sM(e,t=Nt){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function iM(){return""}function xp(e,t=Nt){return t.format(e,"yyyy")}const aM=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:bp,formatDay:nM,formatMonthCaption:tM,formatMonthDropdown:rM,formatWeekNumber:sM,formatWeekNumberHeader:iM,formatWeekdayName:oM,formatYearCaption:xp,formatYearDropdown:xp},Symbol.toStringTag,{value:"Module"}));function cM(e){return e!=null&&e.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e!=null&&e.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...aM,...e}}function lM(e,t,n,r,o){const{startOfMonth:s,startOfYear:i,endOfYear:a,eachMonthOfInterval:c,getMonth:l}=o;return c({start:i(e),end:a(e)}).map(f=>{const h=r.formatMonthDropdown(f,o),v=l(f),g=t&&f<s(t)||n&&f>s(n)||!1;return{value:v,label:h,disabled:g}})}function uM(e,t={},n={}){let r={...t==null?void 0:t[Q.Day]};return Object.entries(e).filter(([,o])=>o===!0).forEach(([o])=>{r={...r,...n==null?void 0:n[o]}}),r}function dM(e,t,n){const r=e.today(),o=t?e.startOfISOWeek(r):e.startOfWeek(r),s=[];for(let i=0;i<7;i++){const a=e.addDays(o,i);s.push(a)}return s}function fM(e,t,n,r,o=!1){if(!e||!t)return;const{startOfYear:s,endOfYear:i,addYears:a,getYear:c,isBefore:l,isSameYear:u}=r,d=s(e),f=i(t),h=[];let v=d;for(;l(v,f)||u(v,f);)h.push(v),v=a(v,1);return o&&h.reverse(),h.map(g=>{const w=n.formatYearDropdown(g,r);return{value:c(g),label:w,disabled:!1}})}function Sp(e,t,n,r){let o=(r??new Ge(n)).format(e,"PPPP");return t.today&&(o=`Today, ${o}`),t.selected&&(o=`${o}, selected`),o}const hM=Sp;function Cp(e,t,n){return(n??new Ge(t)).formatMonthYear(e)}const pM=Cp;function mM(e,t,n,r){let o=(r??new Ge(n)).format(e,"PPPP");return t!=null&&t.today&&(o=`Today, ${o}`),o}function gM(e){return"Choose the Month"}function vM(){return""}function yM(e){return"Go to the Next Month"}function wM(e){return"Go to the Previous Month"}function bM(e,t,n){return(n??new Ge(t)).format(e,"cccc")}function xM(e,t){return`Week ${e}`}function SM(e){return"Week Number"}function CM(e){return"Choose the Year"}const TM=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:pM,labelDay:hM,labelDayButton:Sp,labelGrid:Cp,labelGridcell:mM,labelMonthDropdown:gM,labelNav:vM,labelNext:yM,labelPrevious:wM,labelWeekNumber:xM,labelWeekNumberHeader:SM,labelWeekday:bM,labelYearDropdown:CM},Symbol.toStringTag,{value:"Module"})),Kr=e=>e instanceof HTMLElement?e:null,Xa=e=>[...e.querySelectorAll("[data-animated-month]")??[]],EM=e=>Kr(e.querySelector("[data-animated-month]")),Za=e=>Kr(e.querySelector("[data-animated-caption]")),Qa=e=>Kr(e.querySelector("[data-animated-weeks]")),PM=e=>Kr(e.querySelector("[data-animated-nav]")),DM=e=>Kr(e.querySelector("[data-animated-weekdays]"));function MM(e,t,{classNames:n,months:r,focused:o,dateLib:s}){const i=y.useRef(null),a=y.useRef(r),c=y.useRef(!1);y.useLayoutEffect(()=>{const l=a.current;if(a.current=r,!t||!e.current||!(e.current instanceof HTMLElement)||r.length===0||l.length===0||r.length!==l.length)return;const u=s.isSameMonth(r[0].date,l[0].date),d=s.isAfter(r[0].date,l[0].date),f=d?n[qe.caption_after_enter]:n[qe.caption_before_enter],h=d?n[qe.weeks_after_enter]:n[qe.weeks_before_enter],v=i.current,g=e.current.cloneNode(!0);if(g instanceof HTMLElement?(Xa(g).forEach(x=>{if(!(x instanceof HTMLElement))return;const C=EM(x);C&&x.contains(C)&&x.removeChild(C);const E=Za(x);E&&E.classList.remove(f);const D=Qa(x);D&&D.classList.remove(h)}),i.current=g):i.current=null,c.current||u||o)return;const w=v instanceof HTMLElement?Xa(v):[],b=Xa(e.current);if(b!=null&&b.every(S=>S instanceof HTMLElement)&&w&&w.every(S=>S instanceof HTMLElement)){c.current=!0,e.current.style.isolation="isolate";const S=PM(e.current);S&&(S.style.zIndex="1"),b.forEach((x,C)=>{const E=w[C];if(!E)return;x.style.position="relative",x.style.overflow="hidden";const D=Za(x);D&&D.classList.add(f);const T=Qa(x);T&&T.classList.add(h);const P=()=>{c.current=!1,e.current&&(e.current.style.isolation=""),S&&(S.style.zIndex=""),D&&D.classList.remove(f),T&&T.classList.remove(h),x.style.position="",x.style.overflow="",x.contains(E)&&x.removeChild(E)};E.style.pointerEvents="none",E.style.position="absolute",E.style.overflow="hidden",E.setAttribute("aria-hidden","true");const M=DM(E);M&&(M.style.opacity="0");const N=Za(E);N&&(N.classList.add(d?n[qe.caption_before_exit]:n[qe.caption_after_exit]),N.addEventListener("animationend",P));const _=Qa(E);_&&_.classList.add(d?n[qe.weeks_before_exit]:n[qe.weeks_after_exit]),x.insertBefore(E,x.firstChild)})}})}function OM(e,t,n,r){const o=e[0],s=e[e.length-1],{ISOWeek:i,fixedWeeks:a,broadcastCalendar:c}=n??{},{addDays:l,differenceInCalendarDays:u,differenceInCalendarMonths:d,endOfBroadcastWeek:f,endOfISOWeek:h,endOfMonth:v,endOfWeek:g,isAfter:w,startOfBroadcastWeek:b,startOfISOWeek:S,startOfWeek:x}=r,C=c?b(o,r):i?S(o):x(o),E=c?f(s):i?h(v(s)):g(v(s)),D=u(E,C),T=d(s,o)+1,P=[];for(let _=0;_<=D;_++){const V=l(C,_);if(t&&w(V,t))break;P.push(V)}const N=(c?35:42)*T;if(a&&P.length<N){const _=N-P.length;for(let V=0;V<_;V++){const O=l(P[P.length-1],1);P.push(O)}}return P}function NM(e){const t=[];return e.reduce((n,r)=>{const o=r.weeks.reduce((s,i)=>s.concat(i.days.slice()),t.slice());return n.concat(o.slice())},t.slice())}function AM(e,t,n,r){const{numberOfMonths:o=1}=n,s=[];for(let i=0;i<o;i++){const a=r.addMonths(e,i);if(t&&a>t)break;s.push(a)}return s}function Tp(e,t,n,r){const{month:o,defaultMonth:s,today:i=r.today(),numberOfMonths:a=1}=e;let c=o||s||i;const{differenceInCalendarMonths:l,addMonths:u,startOfMonth:d}=r;if(n&&l(n,c)<a-1){const f=-1*(a-1);c=u(n,f)}return t&&l(c,t)<0&&(c=t),d(c)}function kM(e,t,n,r){const{addDays:o,endOfBroadcastWeek:s,endOfISOWeek:i,endOfMonth:a,endOfWeek:c,getISOWeek:l,getWeek:u,startOfBroadcastWeek:d,startOfISOWeek:f,startOfWeek:h}=r,v=e.reduce((g,w)=>{const b=n.broadcastCalendar?d(w,r):n.ISOWeek?f(w):h(w),S=n.broadcastCalendar?s(w):n.ISOWeek?i(a(w)):c(a(w)),x=t.filter(T=>T>=b&&T<=S),C=n.broadcastCalendar?35:42;if(n.fixedWeeks&&x.length<C){const T=t.filter(P=>{const M=C-x.length;return P>S&&P<=o(S,M)});x.push(...T)}const E=x.reduce((T,P)=>{const M=n.ISOWeek?l(P):u(P),N=T.find(V=>V.weekNumber===M),_=new hp(P,w,r);return N?N.days.push(_):T.push(new SD(M,[_])),T},[]),D=new xD(w,E);return g.push(D),g},[]);return n.reverseMonths?v.reverse():v}function IM(e,t){let{startMonth:n,endMonth:r}=e;const{startOfYear:o,startOfDay:s,startOfMonth:i,endOfMonth:a,addYears:c,endOfYear:l,newDate:u,today:d}=t,{fromYear:f,toYear:h,fromMonth:v,toMonth:g}=e;!n&&v&&(n=v),!n&&f&&(n=t.newDate(f,0,1)),!r&&g&&(r=g),!r&&h&&(r=u(h,11,31));const w=e.captionLayout==="dropdown"||e.captionLayout==="dropdown-years";return n?n=i(n):f?n=u(f,0,1):!n&&w&&(n=o(c(e.today??d(),-100))),r?r=a(r):h?r=u(h,11,31):!r&&w&&(r=l(e.today??d())),[n&&s(n),r&&s(r)]}function _M(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:o,numberOfMonths:s=1}=n,{startOfMonth:i,addMonths:a,differenceInCalendarMonths:c}=r,l=o?s:1,u=i(e);if(!t)return a(u,l);if(!(c(t,e)<s))return a(u,l)}function FM(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:o,numberOfMonths:s}=n,{startOfMonth:i,addMonths:a,differenceInCalendarMonths:c}=r,l=o?s??1:1,u=i(e);if(!t)return a(u,-l);if(!(c(u,t)<=0))return a(u,-l)}function LM(e){const t=[];return e.reduce((n,r)=>n.concat(r.weeks.slice()),t.slice())}function Ko(e,t){const[n,r]=y.useState(e);return[t===void 0?n:t,r]}function VM(e,t){const[n,r]=IM(e,t),{startOfMonth:o,endOfMonth:s}=t,i=Tp(e,n,r,t),[a,c]=Ko(i,e.month?i:void 0);y.useEffect(()=>{const D=Tp(e,n,r,t);c(D)},[e.timeZone]);const l=AM(a,r,e,t),u=OM(l,e.endMonth?s(e.endMonth):void 0,e,t),d=kM(l,u,e,t),f=LM(d),h=NM(d),v=FM(a,n,e,t),g=_M(a,r,e,t),{disableNavigation:w,onMonthChange:b}=e,S=D=>f.some(T=>T.days.some(P=>P.isEqualTo(D))),x=D=>{if(w)return;let T=o(D);n&&T<o(n)&&(T=o(n)),r&&T>o(r)&&(T=o(r)),c(T),b==null||b(T)};return{months:d,weeks:f,days:h,navStart:n,navEnd:r,previousMonth:v,nextMonth:g,goToMonth:x,goToDay:D=>{S(D)||x(D.date)}}}var At;(function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"})(At||(At={}));function Ep(e){return!e[Ce.disabled]&&!e[Ce.hidden]&&!e[Ce.outside]}function RM(e,t,n,r){let o,s=-1;for(const i of e){const a=t(i);Ep(a)&&(a[Ce.focused]&&s<At.FocusedModifier?(o=i,s=At.FocusedModifier):r!=null&&r.isEqualTo(i)&&s<At.LastFocused?(o=i,s=At.LastFocused):n(i.date)&&s<At.Selected?(o=i,s=At.Selected):a[Ce.today]&&s<At.Today&&(o=i,s=At.Today))}return o||(o=e.find(i=>Ep(t(i)))),o}function BM(e,t,n,r,o,s,i){const{ISOWeek:a,broadcastCalendar:c}=s,{addDays:l,addMonths:u,addWeeks:d,addYears:f,endOfBroadcastWeek:h,endOfISOWeek:v,endOfWeek:g,max:w,min:b,startOfBroadcastWeek:S,startOfISOWeek:x,startOfWeek:C}=i;let D={day:l,week:d,month:u,year:f,startOfWeek:T=>c?S(T,i):a?x(T):C(T),endOfWeek:T=>c?h(T):a?v(T):g(T)}[e](n,t==="after"?1:-1);return t==="before"&&r?D=w([r,D]):t==="after"&&o&&(D=b([o,D])),D}function Pp(e,t,n,r,o,s,i,a=0){if(a>365)return;const c=BM(e,t,n.date,r,o,s,i),l=!!(s.disabled&&Yt(c,s.disabled,i)),u=!!(s.hidden&&Yt(c,s.hidden,i)),d=c,f=new hp(c,d,i);return!l&&!u?f:Pp(e,t,f,r,o,s,i,a+1)}function WM(e,t,n,r,o){const{autoFocus:s}=e,[i,a]=y.useState(),c=RM(t.days,n,r||(()=>!1),i),[l,u]=y.useState(s?c:void 0);return{isFocusTarget:g=>!!(c!=null&&c.isEqualTo(g)),setFocused:u,focused:l,blur:()=>{a(l),u(void 0)},moveFocus:(g,w)=>{if(!l)return;const b=Pp(g,w,l,t.navStart,t.navEnd,e,o);b&&(t.goToDay(b),u(b))}}}function $M(e,t){const{selected:n,required:r,onSelect:o}=e,[s,i]=Ko(n,o?n:void 0),a=o?n:s,{isSameDay:c}=t,l=h=>(a==null?void 0:a.some(v=>c(v,h)))??!1,{min:u,max:d}=e;return{selected:a,select:(h,v,g)=>{let w=[...a??[]];if(l(h)){if((a==null?void 0:a.length)===u||r&&(a==null?void 0:a.length)===1)return;w=a==null?void 0:a.filter(b=>!c(b,h))}else(a==null?void 0:a.length)===d?w=[h]:w=[...w,h];return o||i(w),o==null||o(w,h,v,g),w},isSelected:l}}function HM(e,t,n=0,r=0,o=!1,s=Nt){const{from:i,to:a}=t||{},{isSameDay:c,isAfter:l,isBefore:u}=s;let d;if(!i&&!a)d={from:e,to:n>0?void 0:e};else if(i&&!a)c(i,e)?n===0?d={from:i,to:e}:o?d={from:i,to:void 0}:d=void 0:u(e,i)?d={from:e,to:i}:d={from:i,to:e};else if(i&&a)if(c(i,e)&&c(a,e))o?d={from:i,to:a}:d=void 0;else if(c(i,e))d={from:i,to:n>0?void 0:e};else if(c(a,e))d={from:e,to:n>0?void 0:e};else if(u(e,i))d={from:e,to:a};else if(l(e,i))d={from:i,to:e};else if(l(e,a))d={from:i,to:e};else throw new Error("Invalid range");if(d!=null&&d.from&&(d!=null&&d.to)){const f=s.differenceInCalendarDays(d.to,d.from);r>0&&f>r?d={from:e,to:void 0}:n>1&&f<n&&(d={from:e,to:void 0})}return d}function jM(e,t,n=Nt){const r=Array.isArray(t)?t:[t];let o=e.from;const s=n.differenceInCalendarDays(e.to,e.from),i=Math.min(s,6);for(let a=0;a<=i;a++){if(r.includes(o.getDay()))return!0;o=n.addDays(o,1)}return!1}function Dp(e,t,n=Nt){return jt(e,t.from,!1,n)||jt(e,t.to,!1,n)||jt(t,e.from,!1,n)||jt(t,e.to,!1,n)}function YM(e,t,n=Nt){const r=Array.isArray(t)?t:[t];if(r.filter(a=>typeof a!="function").some(a=>typeof a=="boolean"?a:n.isDate(a)?jt(e,a,!1,n):wp(a,n)?a.some(c=>jt(e,c,!1,n)):qa(a)?a.from&&a.to?Dp(e,{from:a.from,to:a.to},n):!1:yp(a)?jM(e,a.dayOfWeek,n):mp(a)?n.isAfter(a.before,a.after)?Dp(e,{from:n.addDays(a.after,1),to:n.addDays(a.before,-1)},n):Yt(e.from,a,n)||Yt(e.to,a,n):gp(a)||vp(a)?Yt(e.from,a,n)||Yt(e.to,a,n):!1))return!0;const i=r.filter(a=>typeof a=="function");if(i.length){let a=e.from;const c=n.differenceInCalendarDays(e.to,e.from);for(let l=0;l<=c;l++){if(i.some(u=>u(a)))return!0;a=n.addDays(a,1)}}return!1}function UM(e,t){const{disabled:n,excludeDisabled:r,selected:o,required:s,onSelect:i}=e,[a,c]=Ko(o,i?o:void 0),l=i?o:a;return{selected:l,select:(f,h,v)=>{const{min:g,max:w}=e,b=f?HM(f,l,g,w,s,t):void 0;return r&&n&&(b!=null&&b.from)&&b.to&&YM({from:b.from,to:b.to},n,t)&&(b.from=f,b.to=void 0),i||c(b),i==null||i(b,f,h,v),b},isSelected:f=>l&&jt(l,f,!1,t)}}function zM(e,t){const{selected:n,required:r,onSelect:o}=e,[s,i]=Ko(n,o?n:void 0),a=o?n:s,{isSameDay:c}=t;return{selected:a,select:(d,f,h)=>{let v=d;return!r&&a&&a&&c(d,a)&&(v=void 0),o||i(v),o==null||o(v,d,f,h),v},isSelected:d=>a?c(a,d):!1}}function KM(e,t){const n=zM(e,t),r=$M(e,t),o=UM(e,t);switch(e.mode){case"single":return n;case"multiple":return r;case"range":return o;default:return}}function GM(e){var si;let t=e;t.timeZone&&(t={...e},t.today&&(t.today=new Be(t.today,t.timeZone)),t.month&&(t.month=new Be(t.month,t.timeZone)),t.defaultMonth&&(t.defaultMonth=new Be(t.defaultMonth,t.timeZone)),t.startMonth&&(t.startMonth=new Be(t.startMonth,t.timeZone)),t.endMonth&&(t.endMonth=new Be(t.endMonth,t.timeZone)),t.mode==="single"&&t.selected?t.selected=new Be(t.selected,t.timeZone):t.mode==="multiple"&&t.selected?t.selected=(si=t.selected)==null?void 0:si.map($=>new Be($,t.timeZone)):t.mode==="range"&&t.selected&&(t.selected={from:t.selected.from?new Be(t.selected.from,t.timeZone):void 0,to:t.selected.to?new Be(t.selected.to,t.timeZone):void 0}));const{components:n,formatters:r,labels:o,dateLib:s,locale:i,classNames:a}=y.useMemo(()=>{const $={...Uo,...t.locale};return{dateLib:new Ge({locale:$,weekStartsOn:t.broadcastCalendar?1:t.weekStartsOn,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},t.dateLib),components:QD(t.components),formatters:cM(t.formatters),labels:{...TM,...t.labels},locale:$,classNames:{...eM(),...t.classNames}}},[t.locale,t.broadcastCalendar,t.weekStartsOn,t.firstWeekContainsDate,t.useAdditionalWeekYearTokens,t.useAdditionalDayOfYearTokens,t.timeZone,t.numerals,t.dateLib,t.components,t.formatters,t.labels,t.classNames]),{captionLayout:c,mode:l,navLayout:u,numberOfMonths:d=1,onDayBlur:f,onDayClick:h,onDayFocus:v,onDayKeyDown:g,onDayMouseEnter:w,onDayMouseLeave:b,onNextClick:S,onPrevClick:x,showWeekNumber:C,styles:E}=t,{formatCaption:D,formatDay:T,formatMonthDropdown:P,formatWeekNumber:M,formatWeekNumberHeader:N,formatWeekdayName:_,formatYearDropdown:V}=r,O=VM(t,s),{days:A,months:L,navStart:R,navEnd:F,previousMonth:k,nextMonth:I,goToMonth:B}=O,U=XD(A,t,R,F,s),{isSelected:j,select:X,selected:se}=KM(t,s)??{},{blur:ne,focused:ie,isFocusTarget:Y,moveFocus:J,setFocused:te}=WM(t,O,U,j??(()=>!1),s),{labelDayButton:le,labelGridcell:ae,labelGrid:ue,labelMonthDropdown:Ee,labelNav:Z,labelPrevious:lt,labelNext:ut,labelWeekday:Qe,labelWeekNumber:Vn,labelWeekNumberHeader:hn,labelYearDropdown:pn}=o,Js=y.useMemo(()=>dM(s,t.ISOWeek),[s,t.ISOWeek]),ei=l!==void 0||h!==void 0,qt=y.useCallback(()=>{k&&(B(k),x==null||x(k))},[k,B,x]),vo=y.useCallback(()=>{I&&(B(I),S==null||S(I))},[B,I,S]),ti=y.useCallback(($,ee)=>z=>{z.preventDefault(),z.stopPropagation(),te($),X==null||X($.date,ee,z),h==null||h($.date,ee,z)},[X,h,te]),_l=y.useCallback(($,ee)=>z=>{te($),v==null||v($.date,ee,z)},[v,te]),Fl=y.useCallback(($,ee)=>z=>{ne(),f==null||f($.date,ee,z)},[ne,f]),yr=y.useCallback(($,ee)=>z=>{const q={ArrowLeft:[z.shiftKey?"month":"day",t.dir==="rtl"?"after":"before"],ArrowRight:[z.shiftKey?"month":"day",t.dir==="rtl"?"before":"after"],ArrowDown:[z.shiftKey?"year":"week","after"],ArrowUp:[z.shiftKey?"year":"week","before"],PageUp:[z.shiftKey?"year":"month","before"],PageDown:[z.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(q[z.key]){z.preventDefault(),z.stopPropagation();const[he,oe]=q[z.key];J(he,oe)}g==null||g($.date,ee,z)},[J,g,t.dir]),Ll=y.useCallback(($,ee)=>z=>{w==null||w($.date,ee,z)},[w]),ni=y.useCallback(($,ee)=>z=>{b==null||b($.date,ee,z)},[b]),Vl=y.useCallback($=>ee=>{const z=Number(ee.target.value),q=s.setMonth(s.startOfMonth($),z);B(q)},[s,B]),Rn=y.useCallback($=>ee=>{const z=Number(ee.target.value),q=s.setYear(s.startOfMonth($),z);B(q)},[s,B]),{className:ri,style:Rl}=y.useMemo(()=>({className:[a[Q.Root],t.className].filter(Boolean).join(" "),style:{...E==null?void 0:E[Q.Root],...t.style}}),[a,t.className,t.style,E]),Bl=JD(t),oi=y.useRef(null);MM(oi,!!t.animate,{classNames:a,months:L,focused:ie,dateLib:s});const Wl={dayPickerProps:t,selected:se,select:X,isSelected:j,months:L,nextMonth:I,previousMonth:k,goToMonth:B,getModifiers:U,components:n,classNames:a,styles:E,labels:o,formatters:r};return y.createElement(pp.Provider,{value:Wl},y.createElement(n.Root,{rootRef:t.animate?oi:void 0,className:ri,style:Rl,dir:t.dir,id:t.id,lang:t.lang,nonce:t.nonce,title:t.title,role:t.role,"aria-label":t["aria-label"],"aria-labelledby":t["aria-labelledby"],...Bl},y.createElement(n.Months,{className:a[Q.Months],style:E==null?void 0:E[Q.Months]},!t.hideNavigation&&!u&&y.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:a[Q.Nav],style:E==null?void 0:E[Q.Nav],"aria-label":Z(),onPreviousClick:qt,onNextClick:vo,previousMonth:k,nextMonth:I}),L.map(($,ee)=>y.createElement(n.Month,{"data-animated-month":t.animate?"true":void 0,className:a[Q.Month],style:E==null?void 0:E[Q.Month],key:ee,displayIndex:ee,calendarMonth:$},u==="around"&&!t.hideNavigation&&ee===0&&y.createElement(n.PreviousMonthButton,{type:"button",className:a[Q.PreviousMonthButton],tabIndex:k?void 0:-1,"aria-disabled":k?void 0:!0,"aria-label":lt(k),onClick:qt,"data-animated-button":t.animate?"true":void 0},y.createElement(n.Chevron,{disabled:k?void 0:!0,className:a[Q.Chevron],orientation:t.dir==="rtl"?"right":"left"})),y.createElement(n.MonthCaption,{"data-animated-caption":t.animate?"true":void 0,className:a[Q.MonthCaption],style:E==null?void 0:E[Q.MonthCaption],calendarMonth:$,displayIndex:ee},c!=null&&c.startsWith("dropdown")?y.createElement(n.DropdownNav,{className:a[Q.Dropdowns],style:E==null?void 0:E[Q.Dropdowns]},(()=>{const z=c==="dropdown"||c==="dropdown-months"?y.createElement(n.MonthsDropdown,{key:"month",className:a[Q.MonthsDropdown],"aria-label":Ee(),classNames:a,components:n,disabled:!!t.disableNavigation,onChange:Vl($.date),options:lM($.date,R,F,r,s),style:E==null?void 0:E[Q.Dropdown],value:s.getMonth($.date)}):y.createElement("span",{key:"month"},P($.date,s)),q=c==="dropdown"||c==="dropdown-years"?y.createElement(n.YearsDropdown,{key:"year",className:a[Q.YearsDropdown],"aria-label":pn(s.options),classNames:a,components:n,disabled:!!t.disableNavigation,onChange:Rn($.date),options:fM(R,F,r,s,!!t.reverseYears),style:E==null?void 0:E[Q.Dropdown],value:s.getYear($.date)}):y.createElement("span",{key:"year"},V($.date,s));return s.getMonthYearOrder()==="year-first"?[q,z]:[z,q]})(),y.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},D($.date,s.options,s))):y.createElement(n.CaptionLabel,{className:a[Q.CaptionLabel],role:"status","aria-live":"polite"},D($.date,s.options,s))),u==="around"&&!t.hideNavigation&&ee===d-1&&y.createElement(n.NextMonthButton,{type:"button",className:a[Q.NextMonthButton],tabIndex:I?void 0:-1,"aria-disabled":I?void 0:!0,"aria-label":ut(I),onClick:vo,"data-animated-button":t.animate?"true":void 0},y.createElement(n.Chevron,{disabled:I?void 0:!0,className:a[Q.Chevron],orientation:t.dir==="rtl"?"left":"right"})),ee===d-1&&u==="after"&&!t.hideNavigation&&y.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:a[Q.Nav],style:E==null?void 0:E[Q.Nav],"aria-label":Z(),onPreviousClick:qt,onNextClick:vo,previousMonth:k,nextMonth:I}),y.createElement(n.MonthGrid,{role:"grid","aria-multiselectable":l==="multiple"||l==="range","aria-label":ue($.date,s.options,s)||void 0,className:a[Q.MonthGrid],style:E==null?void 0:E[Q.MonthGrid]},!t.hideWeekdays&&y.createElement(n.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:a[Q.Weekdays],style:E==null?void 0:E[Q.Weekdays]},C&&y.createElement(n.WeekNumberHeader,{"aria-label":hn(s.options),className:a[Q.WeekNumberHeader],style:E==null?void 0:E[Q.WeekNumberHeader],scope:"col"},N()),Js.map(z=>y.createElement(n.Weekday,{"aria-label":Qe(z,s.options,s),className:a[Q.Weekday],key:String(z),style:E==null?void 0:E[Q.Weekday],scope:"col"},_(z,s.options,s)))),y.createElement(n.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:a[Q.Weeks],style:E==null?void 0:E[Q.Weeks]},$.weeks.map(z=>y.createElement(n.Week,{className:a[Q.Week],key:z.weekNumber,style:E==null?void 0:E[Q.Week],week:z},C&&y.createElement(n.WeekNumber,{week:z,style:E==null?void 0:E[Q.WeekNumber],"aria-label":Vn(z.weekNumber,{locale:i}),className:a[Q.WeekNumber],scope:"row",role:"rowheader"},M(z.weekNumber,s)),z.days.map(q=>{const{date:he}=q,oe=U(q);if(oe[Ce.focused]=!oe.hidden&&!!(ie!=null&&ie.isEqualTo(q)),oe[gt.selected]=(j==null?void 0:j(he))||oe.selected,qa(se)){const{from:wt,to:dt}=se;oe[gt.range_start]=!!(wt&&dt&&s.isSameDay(he,wt)),oe[gt.range_end]=!!(wt&&dt&&s.isSameDay(he,dt)),oe[gt.range_middle]=jt(se,he,!0,s)}const Re=uM(oe,E,t.modifiersStyles),Wt=ZD(oe,a,t.modifiersClassNames),Je=!ei&&!oe.hidden?ae(he,oe,s.options,s):void 0;return y.createElement(n.Day,{key:`${s.format(he,"yyyy-MM-dd")}_${s.format(q.displayMonth,"yyyy-MM")}`,day:q,modifiers:oe,className:Wt.join(" "),style:Re,role:"gridcell","aria-selected":oe.selected||void 0,"aria-label":Je,"data-day":s.format(he,"yyyy-MM-dd"),"data-month":q.outside?s.format(he,"yyyy-MM"):void 0,"data-selected":oe.selected||void 0,"data-disabled":oe.disabled||void 0,"data-hidden":oe.hidden||void 0,"data-outside":q.outside||void 0,"data-focused":oe.focused||void 0,"data-today":oe.today||void 0},!oe.hidden&&ei?y.createElement(n.DayButton,{className:a[Q.DayButton],style:E==null?void 0:E[Q.DayButton],type:"button",day:q,modifiers:oe,disabled:oe.disabled||void 0,tabIndex:Y(q)?0:-1,"aria-label":le(he,oe,s.options,s),onClick:ti(q,oe),onBlur:Fl(q,oe),onFocus:_l(q,oe),onKeyDown:yr(q,oe),onMouseEnter:Ll(q,oe),onMouseLeave:ni(q,oe)},T(he,s.options,s)):!oe.hidden&&T(q.date,s.options,s))})))))))),t.footer&&y.createElement(n.Footer,{className:a[Q.Footer],style:E==null?void 0:E[Q.Footer],role:"status","aria-live":"polite"},t.footer)))}const Ja=Me("font-semibold focus:outline-none min-w-max transition-all duration-300 ease-in-out flex items-center justify-center relative overflow-hidden p-0",{variants:{variant:{primary:"bg-graphite-primary disabled:bg-graphite-primary/70 text-graphite-primaryForeground hover:opacity-90 focus:ring-2 focus:ring-offset-2 focus:ring-graphite-ring",secondary:"bg-graphite-secondary disabled:bg-graphite-secondary/70 text-graphite-secondaryForeground hover:bg-graphite-secondary/80 focus:ring-2 focus:ring-offset-2 focus:ring-graphite-ring",destructive:"bg-red-500 text-graphite-primaryForeground disabled:bg-red-500/70 hover:bg-red-600/80 focus:ring-2 focus:ring-offset-2 focus:ring-graphite-ring",ghost:"bg-transparent disabled:opacity-70 text-graphite-foreground hover:bg-graphite-secondary focus:ring-2 focus:ring-offset-2 focus:ring-graphite-ring",link:"bg-transparent disabled:opacity-70 text-graphite-primary hover:text-graphite-primary hover:underline !p-1 focus:ring-2 focus:ring-offset-2 focus:ring-graphite-ring"},size:{xs:"h-8 w-8",sm:"h-10 w-10",md:"h-12 w-12",lg:"h-14 w-14"},shape:{full:"rounded-full",minimal:"rounded-lg",sharp:"rounded-none"},isLoading:{true:"cursor-wait"}},defaultVariants:{variant:"primary",size:"md",shape:"full"}}),rr=y.forwardRef(({className:e,variant:t,size:n,shape:r,children:o,disabled:s,isLoading:i,...a},c)=>{const l=y.useRef(null);y.useImperativeHandle(c,()=>l.current);const u=t==="primary"||t==="destructive"?"rgba(255, 255, 255, 0.4)":"rgba(0, 0, 0, 0.1)",d=l,[,f]=rt({ref:d,color:u,duration:600,disabled:s||i}),h={xs:"h-4 w-4",sm:"h-5 w-5",md:"h-6 w-6",lg:"h-8 w-8"};return p.jsx("button",{className:Ja({variant:t,size:n,shape:r,className:e,isLoading:i}),ref:l,onPointerDown:v=>{v.stopPropagation(),f(v)},disabled:s||i,...a,children:p.jsx(Kn,{mode:"wait",initial:!1,children:i?p.jsx(we.div,{initial:{opacity:0,scale:.5},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.5},transition:{duration:.2},children:p.jsx(Fa,{className:`animate-spin ${h[n||"md"]}`})},"spinner"):p.jsx(we.span,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{duration:.2},className:"relative z-10",children:o},"content")})})});rr.displayName="IconButton";function Mp({className:e,classNames:t,showOutsideDays:n=!0,...r}){return p.jsx(GM,{showOutsideDays:n,className:H("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:H(La({variant:"ghost",shape:"full"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex justify-center",head_cell:"text-gray-500 rounded-md w-9 font-normal text-[0.8rem] text-center",row:"flex w-full mt-2 justify-center",cell:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-full [&:has([aria-selected].day-outside)]:bg-graphite-secondary/50 [&:has([aria-selected])]:bg-graphite-secondary first:[&:has([aria-selected])]:rounded-l-full last:[&:has([aria-selected])]:rounded-r-full focus-within:relative focus-within:z-20",day:H(Ja({variant:"ghost",shape:"full"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-graphite-primary text-graphite-primaryForeground hover:bg-graphite-primary hover:text-graphite-primaryForeground focus:bg-graphite-primary focus:text-graphite-primaryForeground",day_today:"bg-graphite-secondary text-graphite-secondaryForeground",day_outside:"day-outside text-gray-500 opacity-50 aria-selected:bg-graphite-secondary/50 aria-selected:text-gray-500 aria-selected:opacity-30",day_disabled:"text-gray-500 opacity-50",day_range_middle:"aria-selected:bg-graphite-secondary aria-selected:text-graphite-secondaryForeground",day_hidden:"invisible",...t},...r})}Mp.displayName="Calendar";const qM=Me("shadow-xs transition-colors duration-200",{variants:{variant:{primary:"bg-graphite-card",secondary:"bg-graphite-secondary",glass:"bg-white/5 backdrop-blur-lg border border-white/10 text-graphite-primaryForeground"},shape:{full:"rounded-3xl",minimal:"rounded-xl",sharp:"rounded-none"},padding:{none:"p-0",sm:"p-2",md:"p-5",lg:"p-8"},isSelected:{true:"border-2 border-graphite-primary",false:" border-2 border-transparent"}},compoundVariants:[{variant:"glass",isSelected:!1,className:"border border-white/10"}],defaultVariants:{variant:"primary",shape:"minimal",padding:"md",isSelected:!1}}),ec=y.forwardRef(({className:e,shape:t,variant:n,padding:r,isSelected:o,...s},i)=>p.jsx("div",{className:H(qM({shape:t,variant:n,padding:r,isSelected:o}),e),ref:i,...s}));ec.displayName="Card";const XM=e=>p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})}),Op=y.forwardRef(({className:e,id:t,label:n,...r},o)=>{const s=y.useId(),i=t||s;return p.jsxs("div",{className:"inline-flex items-center",children:[p.jsxs("div",{className:"relative flex items-center justify-center h-6 w-6",children:[p.jsx("input",{type:"checkbox",ref:o,id:i,className:H("peer h-6 w-6 shrink-0 appearance-none transition-colors duration-200","rounded-lg","border-2 border-graphite-border","checked:border-graphite-primary checked:bg-graphite-primary","focus:outline-none focus:ring-2 focus:ring-graphite-ring focus:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50 disabled:checked:bg-graphite-border disabled:checked:border-graphite-border",e),...r}),p.jsx(XM,{className:H("pointer-events-none absolute h-4 w-4 text-graphite-primaryForeground","stroke-[3.5]","transition-transform duration-200 ease-in-out transform scale-0 peer-checked:scale-100")})]}),n&&p.jsx("label",{htmlFor:i,className:"ml-3 text-sm font-medium text-graphite-foreground select-none",children:n})]})});Op.displayName="Checkbox";const ZM=Me("inline-flex items-center justify-center h-10 px-4 rounded-full font-semibold text-sm border-2 transition-colors relative overflow-hidden disabled:pointer-events-none disabled:opacity-50",{variants:{selected:{true:"bg-graphite-primary text-graphite-primaryForeground border border-graphite-primary",false:"bg-transparent text-graphite-foreground border border-graphite-border hover:bg-graphite-secondary"}},defaultVariants:{selected:!1}}),Np=y.forwardRef(({className:e,selected:t,children:n,disabled:r,startIcon:o,endIcon:s,...i},a)=>{const c=y.useRef(null);y.useImperativeHandle(a,()=>c.current);const l=t?"rgba(255, 255, 255, 0.3)":"rgba(0, 0, 0, 0.1)",u=c,[,d]=rt({ref:u,color:l,duration:400,disabled:r});return p.jsx("button",{className:ZM({selected:t,className:e}),ref:c,onPointerDown:d,disabled:r,...i,children:p.jsxs("span",{className:"relative z-10 flex items-center justify-center",children:[o&&p.jsx("span",{className:"mr-2 flex items-center",children:o}),n,s&&p.jsx("span",{className:"ml-2 flex items-center",children:s})]})})});Np.displayName="Chip";function K(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function QM(e,t=globalThis==null?void 0:globalThis.document){const n=Fe(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 JM="DismissableLayer",tc="dismissableLayer.update",e1="dismissableLayer.pointerDownOutside",t1="dismissableLayer.focusOutside",Ap,kp=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Gr=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...c}=e,l=m.useContext(kp),[u,d]=m.useState(null),f=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=m.useState({}),v=fe(t,T=>d(T)),g=Array.from(l.layers),[w]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),b=g.indexOf(w),S=u?g.indexOf(u):-1,x=l.layersWithOutsidePointerEventsDisabled.size>0,C=S>=b,E=o1(T=>{const P=T.target,M=[...l.branches].some(N=>N.contains(P));!C||M||(o==null||o(T),i==null||i(T),T.defaultPrevented||a==null||a())},f),D=s1(T=>{const P=T.target;[...l.branches].some(N=>N.contains(P))||(s==null||s(T),i==null||i(T),T.defaultPrevented||a==null||a())},f);return QM(T=>{S===l.layers.size-1&&(r==null||r(T),!T.defaultPrevented&&a&&(T.preventDefault(),a()))},f),m.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(Ap=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),Ip(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=Ap)}},[u,f,n,l]),m.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),Ip())},[u,l]),m.useEffect(()=>{const T=()=>h({});return document.addEventListener(tc,T),()=>document.removeEventListener(tc,T)},[]),p.jsx(ce.div,{...c,ref:v,style:{pointerEvents:x?C?"auto":"none":void 0,...e.style},onFocusCapture:K(e.onFocusCapture,D.onFocusCapture),onBlurCapture:K(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:K(e.onPointerDownCapture,E.onPointerDownCapture)})});Gr.displayName=JM;var n1="DismissableLayerBranch",r1=m.forwardRef((e,t)=>{const n=m.useContext(kp),r=m.useRef(null),o=fe(t,r);return m.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),p.jsx(ce.div,{...e,ref:o})});r1.displayName=n1;function o1(e,t=globalThis==null?void 0:globalThis.document){const n=Fe(e),r=m.useRef(!1),o=m.useRef(()=>{});return m.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let c=function(){_p(e1,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 s1(e,t=globalThis==null?void 0:globalThis.document){const n=Fe(e),r=m.useRef(!1);return m.useEffect(()=>{const o=s=>{s.target&&!r.current&&_p(t1,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 Ip(){const e=new CustomEvent(tc);document.dispatchEvent(e)}function _p(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?lh(o,s):o.dispatchEvent(s)}var nc=0;function Go(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Fp()),document.body.insertAdjacentElement("beforeend",e[1]??Fp()),nc++,()=>{nc===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),nc--}},[])}function Fp(){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 rc="focusScope.autoFocusOnMount",oc="focusScope.autoFocusOnUnmount",Lp={bubbles:!1,cancelable:!0},i1="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=Fe(o),u=Fe(s),d=m.useRef(null),f=fe(t,g=>c(g)),h=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let g=function(x){if(h.paused||!a)return;const C=x.target;a.contains(C)?d.current=C:nn(d.current,{select:!0})},w=function(x){if(h.paused||!a)return;const C=x.relatedTarget;C!==null&&(a.contains(C)||nn(d.current,{select:!0}))},b=function(x){if(document.activeElement===document.body)for(const E of x)E.removedNodes.length>0&&nn(a)};document.addEventListener("focusin",g),document.addEventListener("focusout",w);const S=new MutationObserver(b);return a&&S.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",w),S.disconnect()}}},[r,a,h.paused]),m.useEffect(()=>{if(a){Bp.add(h);const g=document.activeElement;if(!a.contains(g)){const b=new CustomEvent(rc,Lp);a.addEventListener(rc,l),a.dispatchEvent(b),b.defaultPrevented||(a1(f1(Vp(a)),{select:!0}),document.activeElement===g&&nn(a))}return()=>{a.removeEventListener(rc,l),setTimeout(()=>{const b=new CustomEvent(oc,Lp);a.addEventListener(oc,u),a.dispatchEvent(b),b.defaultPrevented||nn(g??document.body,{select:!0}),a.removeEventListener(oc,u),Bp.remove(h)},0)}}},[a,l,u,h]);const v=m.useCallback(g=>{if(!n&&!r||h.paused)return;const w=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,b=document.activeElement;if(w&&b){const S=g.currentTarget,[x,C]=c1(S);x&&C?!g.shiftKey&&b===C?(g.preventDefault(),n&&nn(x,{select:!0})):g.shiftKey&&b===x&&(g.preventDefault(),n&&nn(C,{select:!0})):b===S&&g.preventDefault()}},[n,r,h.paused]);return p.jsx(ce.div,{tabIndex:-1,...i,ref:f,onKeyDown:v})});qr.displayName=i1;function a1(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(nn(r,{select:t}),document.activeElement!==n)return}function c1(e){const t=Vp(e),n=Rp(t,e),r=Rp(t.reverse(),e);return[n,r]}function Vp(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 Rp(e,t){for(const n of e)if(!l1(n,{upTo:t}))return n}function l1(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 u1(e){return e instanceof HTMLInputElement&&"select"in e}function nn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&u1(e)&&t&&e.select()}}var Bp=d1();function d1(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Wp(e,t),e.unshift(t)},remove(t){var n;e=Wp(e,t),(n=e[0])==null||n.resume()}}}function Wp(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function f1(e){return e.filter(t=>t.tagName!=="A")}var h1=m[" useId ".trim().toString()]||(()=>{}),p1=0;function ot(e){const[t,n]=m.useState(h1());return Ie(()=>{n(r=>r??String(p1++))},[e]),t?`radix-${t}`:""}const m1=["top","right","bottom","left"],rn=Math.min,Xe=Math.max,qo=Math.round,Xo=Math.floor,kt=e=>({x:e,y:e}),g1={left:"right",right:"left",bottom:"top",top:"bottom"},v1={start:"end",end:"start"};function sc(e,t,n){return Xe(e,rn(t,n))}function Ut(e,t){return typeof e=="function"?e(t):e}function zt(e){return e.split("-")[0]}function or(e){return e.split("-")[1]}function ic(e){return e==="x"?"y":"x"}function ac(e){return e==="y"?"height":"width"}const y1=new Set(["top","bottom"]);function It(e){return y1.has(zt(e))?"y":"x"}function cc(e){return ic(It(e))}function w1(e,t,n){n===void 0&&(n=!1);const r=or(e),o=cc(e),s=ac(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Zo(i)),[i,Zo(i)]}function b1(e){const t=Zo(e);return[lc(e),t,lc(t)]}function lc(e){return e.replace(/start|end/g,t=>v1[t])}const $p=["left","right"],Hp=["right","left"],x1=["top","bottom"],S1=["bottom","top"];function C1(e,t,n){switch(e){case"top":case"bottom":return n?t?Hp:$p:t?$p:Hp;case"left":case"right":return t?x1:S1;default:return[]}}function T1(e,t,n,r){const o=or(e);let s=C1(zt(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(lc)))),s}function Zo(e){return e.replace(/left|right|bottom|top/g,t=>g1[t])}function E1(e){return{top:0,right:0,bottom:0,left:0,...e}}function jp(e){return typeof e!="number"?E1(e):{top:e,right:e,bottom:e,left:e}}function Qo(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 Yp(e,t,n){let{reference:r,floating:o}=e;const s=It(t),i=cc(t),a=ac(i),c=zt(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 h;switch(c){case"top":h={x:u,y:r.y-o.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-o.width,y:d};break;default:h={x:r.x,y:r.y}}switch(or(t)){case"start":h[i]-=f*(n&&l?-1:1);break;case"end":h[i]+=f*(n&&l?-1:1);break}return h}const P1=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),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}=Yp(l,r,c),f=r,h={},v=0;for(let g=0;g<a.length;g++){const{name:w,fn:b}=a[g],{x:S,y:x,data:C,reset:E}=await b({x:u,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:h,rects:l,platform:i,elements:{reference:e,floating:t}});u=S??u,d=x??d,h={...h,[w]:{...h[w],...C}},E&&v<=50&&(v++,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}=Yp(l,f,c)),g=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:h}};async function Xr(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:h=0}=Ut(t,e),v=jp(h),w=a[f?d==="floating"?"reference":"floating":d],b=Qo(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(w)))==null||n?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),S=d==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),C=await(s.isElement==null?void 0:s.isElement(x))?await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1}:{x:1,y:1},E=Qo(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:S,offsetParent:x,strategy:c}):S);return{top:(b.top-E.top+v.top)/C.y,bottom:(E.bottom-b.bottom+v.bottom)/C.y,left:(b.left-E.left+v.left)/C.x,right:(E.right-b.right+v.right)/C.x}}const D1=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}=Ut(e,t)||{};if(l==null)return{};const d=jp(u),f={x:n,y:r},h=cc(o),v=ac(h),g=await i.getDimensions(l),w=h==="y",b=w?"top":"left",S=w?"bottom":"right",x=w?"clientHeight":"clientWidth",C=s.reference[v]+s.reference[h]-f[h]-s.floating[v],E=f[h]-s.reference[h],D=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l));let T=D?D[x]:0;(!T||!await(i.isElement==null?void 0:i.isElement(D)))&&(T=a.floating[x]||s.floating[v]);const P=C/2-E/2,M=T/2-g[v]/2-1,N=rn(d[b],M),_=rn(d[S],M),V=N,O=T-g[v]-_,A=T/2-g[v]/2+P,L=sc(V,A,O),R=!c.arrow&&or(o)!=null&&A!==L&&s.reference[v]/2-(A<V?N:_)-g[v]/2<0,F=R?A<V?A-V:A-O:0;return{[h]:f[h]+F,data:{[h]:L,centerOffset:A-L-F,...R&&{alignmentOffset:F}},reset:R}}}),M1=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:h="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:g=!0,...w}=Ut(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const b=zt(o),S=It(a),x=zt(a)===a,C=await(c.isRTL==null?void 0:c.isRTL(l.floating)),E=f||(x||!g?[Zo(a)]:b1(a)),D=v!=="none";!f&&D&&E.push(...T1(a,g,v,C));const T=[a,...E],P=await Xr(t,w),M=[];let N=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&M.push(P[b]),d){const A=w1(o,i,C);M.push(P[A[0]],P[A[1]])}if(N=[...N,{placement:o,overflows:M}],!M.every(A=>A<=0)){var _,V;const A=(((_=s.flip)==null?void 0:_.index)||0)+1,L=T[A];if(L&&(!(d==="alignment"?S!==It(L):!1)||N.every(k=>It(k.placement)===S?k.overflows[0]>0:!0)))return{data:{index:A,overflows:N},reset:{placement:L}};let R=(V=N.filter(F=>F.overflows[0]<=0).sort((F,k)=>F.overflows[1]-k.overflows[1])[0])==null?void 0:V.placement;if(!R)switch(h){case"bestFit":{var O;const F=(O=N.filter(k=>{if(D){const I=It(k.placement);return I===S||I==="y"}return!0}).map(k=>[k.placement,k.overflows.filter(I=>I>0).reduce((I,B)=>I+B,0)]).sort((k,I)=>k[1]-I[1])[0])==null?void 0:O[0];F&&(R=F);break}case"initialPlacement":R=a;break}if(o!==R)return{reset:{placement:R}}}return{}}}};function Up(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function zp(e){return m1.some(t=>e[t]>=0)}const O1=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=Ut(e,t);switch(r){case"referenceHidden":{const s=await Xr(t,{...o,elementContext:"reference"}),i=Up(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:zp(i)}}}case"escaped":{const s=await Xr(t,{...o,altBoundary:!0}),i=Up(s,n.floating);return{data:{escapedOffsets:i,escaped:zp(i)}}}default:return{}}}}},Kp=new Set(["left","top"]);async function N1(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=zt(n),a=or(n),c=It(n)==="y",l=Kp.has(i)?-1:1,u=s&&c?-1:1,d=Ut(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:v}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof v=="number"&&(h=a==="end"?v*-1:v),c?{x:h*u,y:f*l}:{x:f*l,y:h*u}}const A1=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 N1(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}}}}},k1=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:a={fn:w=>{let{x:b,y:S}=w;return{x:b,y:S}}},...c}=Ut(e,t),l={x:n,y:r},u=await Xr(t,c),d=It(zt(o)),f=ic(d);let h=l[f],v=l[d];if(s){const w=f==="y"?"top":"left",b=f==="y"?"bottom":"right",S=h+u[w],x=h-u[b];h=sc(S,h,x)}if(i){const w=d==="y"?"top":"left",b=d==="y"?"bottom":"right",S=v+u[w],x=v-u[b];v=sc(S,v,x)}const g=a.fn({...t,[f]:h,[d]:v});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[f]:s,[d]:i}}}}}},I1=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}=Ut(e,t),u={x:n,y:r},d=It(o),f=ic(d);let h=u[f],v=u[d];const g=Ut(a,t),w=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){const x=f==="y"?"height":"width",C=s.reference[f]-s.floating[x]+w.mainAxis,E=s.reference[f]+s.reference[x]-w.mainAxis;h<C?h=C:h>E&&(h=E)}if(l){var b,S;const x=f==="y"?"width":"height",C=Kp.has(zt(o)),E=s.reference[d]-s.floating[x]+(C&&((b=i.offset)==null?void 0:b[d])||0)+(C?0:w.crossAxis),D=s.reference[d]+s.reference[x]+(C?0:((S=i.offset)==null?void 0:S[d])||0)-(C?w.crossAxis:0);v<E?v=E:v>D&&(v=D)}return{[f]:h,[d]:v}}}},_1=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}=Ut(e,t),u=await Xr(t,l),d=zt(o),f=or(o),h=It(o)==="y",{width:v,height:g}=s.floating;let w,b;d==="top"||d==="bottom"?(w=d,b=f===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(b=d,w=f==="end"?"top":"bottom");const S=g-u.top-u.bottom,x=v-u.left-u.right,C=rn(g-u[w],S),E=rn(v-u[b],x),D=!t.middlewareData.shift;let T=C,P=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(P=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=S),D&&!f){const N=Xe(u.left,0),_=Xe(u.right,0),V=Xe(u.top,0),O=Xe(u.bottom,0);h?P=v-2*(N!==0||_!==0?N+_:Xe(u.left,u.right)):T=g-2*(V!==0||O!==0?V+O:Xe(u.top,u.bottom))}await c({...t,availableWidth:P,availableHeight:T});const M=await i.getDimensions(a.floating);return v!==M.width||g!==M.height?{reset:{rects:!0}}:{}}}};function Jo(){return typeof window<"u"}function sr(e){return uc(e)?(e.nodeName||"").toLowerCase():"#document"}function ze(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function _t(e){var t;return(t=(uc(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function uc(e){return Jo()?e instanceof Node||e instanceof ze(e).Node:!1}function ye(e){return Jo()?e instanceof Element||e instanceof ze(e).Element:!1}function Ze(e){return Jo()?e instanceof HTMLElement||e instanceof ze(e).HTMLElement:!1}function dc(e){return!Jo()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ze(e).ShadowRoot}const F1=new Set(["inline","contents"]);function Zr(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=st(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!F1.has(o)}const L1=new Set(["table","td","th"]);function V1(e){return L1.has(sr(e))}const R1=[":popover-open",":modal"];function es(e){return R1.some(t=>{try{return e.matches(t)}catch{return!1}})}const B1=["transform","translate","scale","rotate","perspective"],W1=["transform","translate","scale","rotate","perspective","filter"],$1=["paint","layout","strict","content"];function fc(e){const t=ts(),n=ye(e)?st(e):e;return B1.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||W1.some(r=>(n.willChange||"").includes(r))||$1.some(r=>(n.contain||"").includes(r))}function H1(e){let t=Gt(e);for(;Ze(t)&&!Kt(t);){if(fc(t))return t;if(es(t))return null;t=Gt(t)}return null}function ts(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const j1=new Set(["html","body","#document"]);function Kt(e){return j1.has(sr(e))}function st(e){return ze(e).getComputedStyle(e)}function ns(e){return ye(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Gt(e){if(sr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||dc(e)&&e.host||_t(e);return dc(t)?t.host:t}function Gp(e){const t=Gt(e);return Kt(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ze(t)&&Zr(t)?t:Gp(t)}function on(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Gp(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=ze(o);if(s){const a=hc(i);return t.concat(i,i.visualViewport||[],Zr(o)?o:[],a&&n?on(a):[])}return t.concat(o,on(o,[],n))}function hc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function qp(e){const t=st(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Ze(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=qo(n)!==s||qo(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function pc(e){return ye(e)?e:e.contextElement}function ir(e){const t=pc(e);if(!Ze(t))return kt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=qp(t);let i=(s?qo(n.width):n.width)/r,a=(s?qo(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const Y1=kt(0);function Xp(e){const t=ze(e);return!ts()||!t.visualViewport?Y1:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function U1(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ze(e)?!1:t}function Dn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=pc(e);let i=kt(1);t&&(r?ye(r)&&(i=ir(r)):i=ir(e));const a=U1(s,n,r)?Xp(s):kt(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=ze(s),h=r&&ye(r)?ze(r):r;let v=f,g=hc(v);for(;g&&r&&h!==v;){const w=ir(g),b=g.getBoundingClientRect(),S=st(g),x=b.left+(g.clientLeft+parseFloat(S.paddingLeft))*w.x,C=b.top+(g.clientTop+parseFloat(S.paddingTop))*w.y;c*=w.x,l*=w.y,u*=w.x,d*=w.y,c+=x,l+=C,v=ze(g),g=hc(v)}}return Qo({width:u,height:d,x:c,y:l})}function rs(e,t){const n=ns(e).scrollLeft;return t?t.left+n:Dn(_t(e)).left+n}function Zp(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-rs(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function z1(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=_t(r),a=t?es(t.floating):!1;if(r===i||a&&s)return n;let c={scrollLeft:0,scrollTop:0},l=kt(1);const u=kt(0),d=Ze(r);if((d||!d&&!s)&&((sr(r)!=="body"||Zr(i))&&(c=ns(r)),Ze(r))){const h=Dn(r);l=ir(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}const f=i&&!d&&!s?Zp(i,c):kt(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 K1(e){return Array.from(e.getClientRects())}function G1(e){const t=_t(e),n=ns(e),r=e.ownerDocument.body,o=Xe(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Xe(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+rs(e);const a=-n.scrollTop;return st(r).direction==="rtl"&&(i+=Xe(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}const Qp=25;function q1(e,t){const n=ze(e),r=_t(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=ts();(!u||u&&t==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}const l=rs(r);if(l<=0){const u=r.ownerDocument,d=u.body,f=getComputedStyle(d),h=u.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,v=Math.abs(r.clientWidth-d.clientWidth-h);v<=Qp&&(s-=v)}else l<=Qp&&(s+=l);return{width:s,height:i,x:a,y:c}}const X1=new Set(["absolute","fixed"]);function Z1(e,t){const n=Dn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=Ze(e)?ir(e):kt(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 Jp(e,t,n){let r;if(t==="viewport")r=q1(e,n);else if(t==="document")r=G1(_t(e));else if(ye(t))r=Z1(t,n);else{const o=Xp(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Qo(r)}function em(e,t){const n=Gt(e);return n===t||!ye(n)||Kt(n)?!1:st(n).position==="fixed"||em(n,t)}function Q1(e,t){const n=t.get(e);if(n)return n;let r=on(e,[],!1).filter(a=>ye(a)&&sr(a)!=="body"),o=null;const s=st(e).position==="fixed";let i=s?Gt(e):e;for(;ye(i)&&!Kt(i);){const a=st(i),c=fc(i);!c&&a.position==="fixed"&&(o=null),(s?!c&&!o:!c&&a.position==="static"&&!!o&&X1.has(o.position)||Zr(i)&&!c&&em(e,i))?r=r.filter(u=>u!==i):o=a,i=Gt(i)}return t.set(e,r),r}function J1(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?es(t)?[]:Q1(t,this._c):[].concat(n),r],a=i[0],c=i.reduce((l,u)=>{const d=Jp(t,u,o);return l.top=Xe(d.top,l.top),l.right=rn(d.right,l.right),l.bottom=rn(d.bottom,l.bottom),l.left=Xe(d.left,l.left),l},Jp(t,a,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function eO(e){const{width:t,height:n}=qp(e);return{width:t,height:n}}function tO(e,t,n){const r=Ze(t),o=_t(t),s=n==="fixed",i=Dn(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const c=kt(0);function l(){c.x=rs(o)}if(r||!r&&!s)if((sr(t)!=="body"||Zr(o))&&(a=ns(t)),r){const h=Dn(t,!0,s,t);c.x=h.x+t.clientLeft,c.y=h.y+t.clientTop}else o&&l();s&&!r&&o&&l();const u=o&&!r&&!s?Zp(o,a):kt(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 mc(e){return st(e).position==="static"}function tm(e,t){if(!Ze(e)||st(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return _t(e)===n&&(n=n.ownerDocument.body),n}function nm(e,t){const n=ze(e);if(es(e))return n;if(!Ze(e)){let o=Gt(e);for(;o&&!Kt(o);){if(ye(o)&&!mc(o))return o;o=Gt(o)}return n}let r=tm(e,t);for(;r&&V1(r)&&mc(r);)r=tm(r,t);return r&&Kt(r)&&mc(r)&&!fc(r)?n:r||H1(e)||n}const nO=async function(e){const t=this.getOffsetParent||nm,n=this.getDimensions,r=await n(e.floating);return{reference:tO(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function rO(e){return st(e).direction==="rtl"}const oO={convertOffsetParentRelativeRectToViewportRelativeRect:z1,getDocumentElement:_t,getClippingRect:J1,getOffsetParent:nm,getElementRects:nO,getClientRects:K1,getDimensions:eO,getScale:ir,isElement:ye,isRTL:rO};function rm(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function sO(e,t){let n=null,r;const o=_t(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:h}=l;if(a||t(),!f||!h)return;const v=Xo(d),g=Xo(o.clientWidth-(u+f)),w=Xo(o.clientHeight-(d+h)),b=Xo(u),x={rootMargin:-v+"px "+-g+"px "+-w+"px "+-b+"px",threshold:Xe(0,rn(1,c))||1};let C=!0;function E(D){const T=D[0].intersectionRatio;if(T!==c){if(!C)return i();T?i(!1,T):r=setTimeout(()=>{i(!1,1e-7)},1e3)}T===1&&!rm(l,e.getBoundingClientRect())&&i(),C=!1}try{n=new IntersectionObserver(E,{...x,root:o.ownerDocument})}catch{n=new IntersectionObserver(E,x)}n.observe(e)}return i(!0),s}function om(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=pc(e),u=o||s?[...l?on(l):[],...on(t)]:[];u.forEach(b=>{o&&b.addEventListener("scroll",n,{passive:!0}),s&&b.addEventListener("resize",n)});const d=l&&a?sO(l,n):null;let f=-1,h=null;i&&(h=new ResizeObserver(b=>{let[S]=b;S&&S.target===l&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=h)==null||x.observe(t)})),n()}),l&&!c&&h.observe(l),h.observe(t));let v,g=c?Dn(e):null;c&&w();function w(){const b=Dn(e);g&&!rm(g,b)&&n(),g=b,v=requestAnimationFrame(w)}return n(),()=>{var b;u.forEach(S=>{o&&S.removeEventListener("scroll",n),s&&S.removeEventListener("resize",n)}),d==null||d(),(b=h)==null||b.disconnect(),h=null,c&&cancelAnimationFrame(v)}}const iO=A1,aO=k1,cO=M1,lO=_1,uO=O1,sm=D1,dO=I1,fO=(e,t,n)=>{const r=new Map,o={platform:oO,...n},s={...o.platform,_c:r};return P1(e,t,{...o,platform:s})};var hO=typeof document<"u",pO=function(){},os=hO?y.useLayoutEffect:pO;function ss(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(!ss(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)&&!ss(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function im(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function am(e,t){const n=im(e);return Math.round(t*n)/n}function gc(e){const t=m.useRef(e);return os(()=>{t.current=e}),t}function cm(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,h]=m.useState(r);ss(f,r)||h(r);const[v,g]=m.useState(null),[w,b]=m.useState(null),S=m.useCallback(k=>{k!==D.current&&(D.current=k,g(k))},[]),x=m.useCallback(k=>{k!==T.current&&(T.current=k,b(k))},[]),C=s||v,E=i||w,D=m.useRef(null),T=m.useRef(null),P=m.useRef(u),M=c!=null,N=gc(c),_=gc(o),V=gc(l),O=m.useCallback(()=>{if(!D.current||!T.current)return;const k={placement:t,strategy:n,middleware:f};_.current&&(k.platform=_.current),fO(D.current,T.current,k).then(I=>{const B={...I,isPositioned:V.current!==!1};A.current&&!ss(P.current,B)&&(P.current=B,wr.flushSync(()=>{d(B)}))})},[f,t,n,_,V]);os(()=>{l===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,d(k=>({...k,isPositioned:!1})))},[l]);const A=m.useRef(!1);os(()=>(A.current=!0,()=>{A.current=!1}),[]),os(()=>{if(C&&(D.current=C),E&&(T.current=E),C&&E){if(N.current)return N.current(C,E,O);O()}},[C,E,O,N,M]);const L=m.useMemo(()=>({reference:D,floating:T,setReference:S,setFloating:x}),[S,x]),R=m.useMemo(()=>({reference:C,floating:E}),[C,E]),F=m.useMemo(()=>{const k={position:n,left:0,top:0};if(!R.floating)return k;const I=am(R.floating,u.x),B=am(R.floating,u.y);return a?{...k,transform:"translate("+I+"px, "+B+"px)",...im(R.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:I,top:B}},[n,a,R.floating,u.x,u.y]);return m.useMemo(()=>({...u,update:O,refs:L,elements:R,floatingStyles:F}),[u,O,L,R,F])}const mO=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?sm({element:r.current,padding:o}).fn(n):{}:r?sm({element:r,padding:o}).fn(n):{}}}},lm=(e,t)=>({...iO(e),options:[e,t]}),um=(e,t)=>({...aO(e),options:[e,t]}),gO=(e,t)=>({...dO(e),options:[e,t]}),dm=(e,t)=>({...cO(e),options:[e,t]}),vO=(e,t)=>({...lO(e),options:[e,t]}),yO=(e,t)=>({...uO(e),options:[e,t]}),fm=(e,t)=>({...mO(e),options:[e,t]});var wO="Arrow",hm=m.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return p.jsx(ce.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:p.jsx("polygon",{points:"0,0 30,0 15,10"})})});hm.displayName=wO;var bO=hm;function xO(e){const[t,n]=m.useState(void 0);return Ie(()=>{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 vc="Popper",[pm,ar]=Ct(vc),[SO,mm]=pm(vc),gm=e=>{const{__scopePopper:t,children:n}=e,[r,o]=m.useState(null);return p.jsx(SO,{scope:t,anchor:r,onAnchorChange:o,children:n})};gm.displayName=vc;var vm="PopperAnchor",ym=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=mm(vm,n),i=m.useRef(null),a=fe(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:p.jsx(ce.div,{...o,ref:a})});ym.displayName=vm;var yc="PopperContent",[CO,TO]=pm(yc),wm=m.forwardRef((e,t)=>{var Y,J,te,le,ae,ue;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:h="optimized",onPlaced:v,...g}=e,w=mm(yc,n),[b,S]=m.useState(null),x=fe(t,Ee=>S(Ee)),[C,E]=m.useState(null),D=xO(C),T=(D==null?void 0:D.width)??0,P=(D==null?void 0:D.height)??0,M=r+(s!=="center"?"-"+s:""),N=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},_=Array.isArray(l)?l:[l],V=_.length>0,O={padding:N,boundary:_.filter(PO),altBoundary:V},{refs:A,floatingStyles:L,placement:R,isPositioned:F,middlewareData:k}=cm({strategy:"fixed",placement:M,whileElementsMounted:(...Ee)=>om(...Ee,{animationFrame:h==="always"}),elements:{reference:w.anchor},middleware:[lm({mainAxis:o+P,alignmentAxis:i}),c&&um({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?gO():void 0,...O}),c&&dm({...O}),vO({...O,apply:({elements:Ee,rects:Z,availableWidth:lt,availableHeight:ut})=>{const{width:Qe,height:Vn}=Z.reference,hn=Ee.floating.style;hn.setProperty("--radix-popper-available-width",`${lt}px`),hn.setProperty("--radix-popper-available-height",`${ut}px`),hn.setProperty("--radix-popper-anchor-width",`${Qe}px`),hn.setProperty("--radix-popper-anchor-height",`${Vn}px`)}}),C&&fm({element:C,padding:a}),DO({arrowWidth:T,arrowHeight:P}),f&&yO({strategy:"referenceHidden",...O})]}),[I,B]=Sm(R),U=Fe(v);Ie(()=>{F&&(U==null||U())},[F,U]);const j=(Y=k.arrow)==null?void 0:Y.x,X=(J=k.arrow)==null?void 0:J.y,se=((te=k.arrow)==null?void 0:te.centerOffset)!==0,[ne,ie]=m.useState();return Ie(()=>{b&&ie(window.getComputedStyle(b).zIndex)},[b]),p.jsx("div",{ref:A.setFloating,"data-radix-popper-content-wrapper":"",style:{...L,transform:F?L.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ne,"--radix-popper-transform-origin":[(le=k.transformOrigin)==null?void 0:le.x,(ae=k.transformOrigin)==null?void 0:ae.y].join(" "),...((ue=k.hide)==null?void 0:ue.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:p.jsx(CO,{scope:n,placedSide:I,onArrowChange:E,arrowX:j,arrowY:X,shouldHideArrow:se,children:p.jsx(ce.div,{"data-side":I,"data-align":B,...g,ref:x,style:{...g.style,animation:F?void 0:"none"}})})})});wm.displayName=yc;var bm="PopperArrow",EO={top:"bottom",right:"left",bottom:"top",left:"right"},xm=m.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=TO(bm,r),i=EO[s.placedSide];return p.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:p.jsx(bO,{...o,ref:n,style:{...o.style,display:"block"}})})});xm.displayName=bm;function PO(e){return e!==null}var DO=e=>({name:"transformOrigin",options:e,fn(t){var w,b,S;const{placement:n,rects:r,middlewareData:o}=t,i=((w=o.arrow)==null?void 0:w.centerOffset)!==0,a=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[l,u]=Sm(n),d={start:"0%",center:"50%",end:"100%"}[u],f=(((b=o.arrow)==null?void 0:b.x)??0)+a/2,h=(((S=o.arrow)==null?void 0:S.y)??0)+c/2;let v="",g="";return l==="bottom"?(v=i?d:`${f}px`,g=`${-c}px`):l==="top"?(v=i?d:`${f}px`,g=`${r.floating.height+c}px`):l==="right"?(v=`${-c}px`,g=i?d:`${h}px`):l==="left"&&(v=`${r.floating.width+c}px`,g=i?d:`${h}px`),{data:{x:v,y:g}}}});function Sm(e){const[t,n="center"]=e.split("-");return[t,n]}var is=gm,as=ym,wc=wm,bc=xm,MO="Portal",Qr=m.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,s]=m.useState(!1);Ie(()=>s(!0),[]);const i=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?ai.createPortal(p.jsx(ce.div,{...r,ref:t}),i):null});Qr.displayName=MO;function OO(e,t){return m.useReducer((n,r)=>t[n][r]??n,e)}var Ke=e=>{const{present:t,children:n}=e,r=NO(t),o=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),s=fe(r.ref,AO(o));return typeof n=="function"||r.isPresent?m.cloneElement(o,{ref:s}):null};Ke.displayName="Presence";function NO(e){const[t,n]=m.useState(),r=m.useRef(null),o=m.useRef(e),s=m.useRef("none"),i=e?"mounted":"unmounted",[a,c]=OO(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const l=cs(r.current);s.current=a==="mounted"?l:"none"},[a]),Ie(()=>{const l=r.current,u=o.current;if(u!==e){const f=s.current,h=cs(l);e?c("MOUNT"):h==="none"||(l==null?void 0:l.display)==="none"?c("UNMOUNT"):c(u&&f!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),Ie(()=>{if(t){let l;const u=t.ownerDocument.defaultView??window,d=h=>{const g=cs(r.current).includes(CSS.escape(h.animationName));if(h.target===t&&g&&(c("ANIMATION_END"),!o.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",l=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},f=h=>{h.target===t&&(s.current=cs(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 cs(e){return(e==null?void 0:e.animationName)||"none"}function AO(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 kO=m[" useInsertionEffect ".trim().toString()]||Ie;function Mn({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,i]=IO({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=_O(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 IO({defaultProp:e,onChange:t}){const[n,r]=m.useState(e),o=m.useRef(n),s=m.useRef(t);return kO(()=>{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 _O(e){return typeof e=="function"}var FO=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},cr=new WeakMap,ls=new WeakMap,us={},xc=0,Cm=function(e){return e&&(e.host||Cm(e.parentNode))},LO=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Cm(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})},VO=function(e,t,n,r){var o=LO(t,Array.isArray(e)?e:[e]);us[n]||(us[n]=new WeakMap);var s=us[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 h=f.getAttribute(r),v=h!==null&&h!=="false",g=(cr.get(f)||0)+1,w=(s.get(f)||0)+1;cr.set(f,g),s.set(f,w),i.push(f),g===1&&v&&ls.set(f,!0),w===1&&f.setAttribute(n,"true"),v||f.setAttribute(r,"true")}catch(b){console.error("aria-hidden: cannot operate on ",f,b)}})};return u(t),a.clear(),xc++,function(){i.forEach(function(d){var f=cr.get(d)-1,h=s.get(d)-1;cr.set(d,f),s.set(d,h),f||(ls.has(d)||d.removeAttribute(r),ls.delete(d)),h||d.removeAttribute(n)}),xc--,xc||(cr=new WeakMap,cr=new WeakMap,ls=new WeakMap,us={})}},ds=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=FO(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),VO(r,o,n,"aria-hidden")):function(){return null}},Ft=function(){return Ft=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},Ft.apply(this,arguments)};function Tm(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 RO(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))}typeof SuppressedError=="function"&&SuppressedError;var fs="right-scroll-bar-position",hs="width-before-scroll-bar",BO="with-scroll-bars-hidden",WO="--removed-body-scroll-bar-size";function Sc(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function $O(e,t){var n=y.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 HO=typeof window<"u"?m.useLayoutEffect:m.useEffect,Em=new WeakMap;function jO(e,t){var n=$O(null,function(r){return e.forEach(function(o){return Sc(o,r)})});return HO(function(){var r=Em.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||Sc(a,null)}),s.forEach(function(a){o.has(a)||Sc(a,i)})}Em.set(n,e)},[e]),n}function YO(e){return e}function UO(e,t){t===void 0&&(t=YO);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 zO(e){e===void 0&&(e={});var t=UO(null);return t.options=Ft({async:!0,ssr:!1},e),t}var Pm=function(e){var t=e.sideCar,n=Tm(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,Ft({},n))};Pm.isSideCarExport=!0;function KO(e,t){return e.useMedium(t),Pm}var Dm=zO(),Cc=function(){},ps=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:Cc,onWheelCapture:Cc,onTouchMoveCapture:Cc}),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,h=e.noRelative,v=e.noIsolation,g=e.inert,w=e.allowPinchZoom,b=e.as,S=b===void 0?"div":b,x=e.gapMode,C=Tm(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=f,D=jO([n,t]),T=Ft(Ft({},C),o);return m.createElement(m.Fragment,null,u&&m.createElement(E,{sideCar:Dm,removeScrollBar:l,shards:d,noRelative:h,noIsolation:v,inert:g,setCallbacks:s,allowPinchZoom:!!w,lockRef:n,gapMode:x}),i?m.cloneElement(m.Children.only(a),Ft(Ft({},T),{ref:D})):m.createElement(S,Ft({},T,{className:c,ref:D}),a))});ps.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},ps.classNames={fullWidth:hs,zeroRight:fs};var GO=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function qO(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=GO();return t&&e.setAttribute("nonce",t),e}function XO(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ZO(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var QO=function(){var e=0,t=null;return{add:function(n){e==0&&(t=qO())&&(XO(t,n),ZO(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},JO=function(){var e=QO();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Mm=function(){var e=JO(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},eN={left:0,top:0,right:0,gap:0},Tc=function(e){return parseInt(e||"",10)||0},tN=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[Tc(n),Tc(r),Tc(o)]},nN=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return eN;var t=tN(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])}},rN=Mm(),lr="data-scroll-locked",oN=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
96
|
+
.`.concat(BO,` {
|
|
97
|
+
overflow: hidden `).concat(r,`;
|
|
98
|
+
padding-right: `).concat(a,"px ").concat(r,`;
|
|
99
|
+
}
|
|
100
|
+
body[`).concat(lr,`] {
|
|
101
|
+
overflow: hidden `).concat(r,`;
|
|
102
|
+
overscroll-behavior: contain;
|
|
103
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
104
|
+
padding-left: `.concat(o,`px;
|
|
105
|
+
padding-top: `).concat(s,`px;
|
|
106
|
+
padding-right: `).concat(i,`px;
|
|
107
|
+
margin-left:0;
|
|
108
|
+
margin-top:0;
|
|
109
|
+
margin-right: `).concat(a,"px ").concat(r,`;
|
|
110
|
+
`),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.`).concat(fs,` {
|
|
114
|
+
right: `).concat(a,"px ").concat(r,`;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.`).concat(hs,` {
|
|
118
|
+
margin-right: `).concat(a,"px ").concat(r,`;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.`).concat(fs," .").concat(fs,` {
|
|
122
|
+
right: 0 `).concat(r,`;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.`).concat(hs," .").concat(hs,` {
|
|
126
|
+
margin-right: 0 `).concat(r,`;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
body[`).concat(lr,`] {
|
|
130
|
+
`).concat(WO,": ").concat(a,`px;
|
|
131
|
+
}
|
|
132
|
+
`)},Om=function(){var e=parseInt(document.body.getAttribute(lr)||"0",10);return isFinite(e)?e:0},sN=function(){m.useEffect(function(){return document.body.setAttribute(lr,(Om()+1).toString()),function(){var e=Om()-1;e<=0?document.body.removeAttribute(lr):document.body.setAttribute(lr,e.toString())}},[])},iN=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;sN();var s=m.useMemo(function(){return nN(o)},[o]);return m.createElement(rN,{styles:oN(s,!t,o,n?"":"!important")})},Ec=!1;if(typeof window<"u")try{var ms=Object.defineProperty({},"passive",{get:function(){return Ec=!0,!0}});window.addEventListener("test",ms,ms),window.removeEventListener("test",ms,ms)}catch{Ec=!1}var ur=Ec?{passive:!1}:!1,aN=function(e){return e.tagName==="TEXTAREA"},Nm=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!aN(e)&&n[t]==="visible")},cN=function(e){return Nm(e,"overflowY")},lN=function(e){return Nm(e,"overflowX")},Am=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=km(e,r);if(o){var s=Im(e,r),i=s[1],a=s[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},uN=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},dN=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},km=function(e,t){return e==="v"?cN(t):lN(t)},Im=function(e,t){return e==="v"?uN(t):dN(t)},fN=function(e,t){return e==="h"&&t==="rtl"?-1:1},hN=function(e,t,n,r,o){var s=fN(e,window.getComputedStyle(t).direction),i=s*r,a=n.target,c=t.contains(a),l=!1,u=i>0,d=0,f=0;do{if(!a)break;var h=Im(e,a),v=h[0],g=h[1],w=h[2],b=g-w-s*v;(v||b)&&km(e,a)&&(d+=b,f+=v);var S=a.parentNode;a=S&&S.nodeType===Node.DOCUMENT_FRAGMENT_NODE?S.host:S}while(!c&&a!==document.body||c&&(t.contains(a)||t===a));return(u&&Math.abs(d)<1||!u&&Math.abs(f)<1)&&(l=!0),l},gs=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},_m=function(e){return[e.deltaX,e.deltaY]},Fm=function(e){return e&&"current"in e?e.current:e},pN=function(e,t){return e[0]===t[0]&&e[1]===t[1]},mN=function(e){return`
|
|
133
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
134
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
135
|
+
`)},gN=0,dr=[];function vN(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),o=m.useState(gN++)[0],s=m.useState(Mm)[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=RO([e.lockRef.current],(e.shards||[]).map(Fm),!0).filter(Boolean);return g.forEach(function(w){return w.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),g.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=m.useCallback(function(g,w){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!i.current.allowPinchZoom;var b=gs(g),S=n.current,x="deltaX"in g?g.deltaX:S[0]-b[0],C="deltaY"in g?g.deltaY:S[1]-b[1],E,D=g.target,T=Math.abs(x)>Math.abs(C)?"h":"v";if("touches"in g&&T==="h"&&D.type==="range")return!1;var P=Am(T,D);if(!P)return!0;if(P?E=T:(E=T==="v"?"h":"v",P=Am(T,D)),!P)return!1;if(!r.current&&"changedTouches"in g&&(x||C)&&(r.current=E),!E)return!0;var M=r.current||E;return hN(M,w,g,M==="h"?x:C)},[]),c=m.useCallback(function(g){var w=g;if(!(!dr.length||dr[dr.length-1]!==s)){var b="deltaY"in w?_m(w):gs(w),S=t.current.filter(function(E){return E.name===w.type&&(E.target===w.target||w.target===E.shadowParent)&&pN(E.delta,b)})[0];if(S&&S.should){w.cancelable&&w.preventDefault();return}if(!S){var x=(i.current.shards||[]).map(Fm).filter(Boolean).filter(function(E){return E.contains(w.target)}),C=x.length>0?a(w,x[0]):!i.current.noIsolation;C&&w.cancelable&&w.preventDefault()}}},[]),l=m.useCallback(function(g,w,b,S){var x={name:g,delta:w,target:b,should:S,shadowParent:yN(b)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(C){return C!==x})},1)},[]),u=m.useCallback(function(g){n.current=gs(g),r.current=void 0},[]),d=m.useCallback(function(g){l(g.type,_m(g),g.target,a(g,e.lockRef.current))},[]),f=m.useCallback(function(g){l(g.type,gs(g),g.target,a(g,e.lockRef.current))},[]);m.useEffect(function(){return dr.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",c,ur),document.addEventListener("touchmove",c,ur),document.addEventListener("touchstart",u,ur),function(){dr=dr.filter(function(g){return g!==s}),document.removeEventListener("wheel",c,ur),document.removeEventListener("touchmove",c,ur),document.removeEventListener("touchstart",u,ur)}},[]);var h=e.removeScrollBar,v=e.inert;return m.createElement(m.Fragment,null,v?m.createElement(s,{styles:mN(o)}):null,h?m.createElement(iN,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function yN(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const wN=KO(Dm,vN);var Jr=m.forwardRef(function(e,t){return m.createElement(ps,Ft({},e,{ref:t,sideCar:wN}))});Jr.classNames=ps.classNames;var vs="Popover",[Lm]=Ct(vs,[ar]),eo=ar(),[bN,sn]=Lm(vs),Vm=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!1}=e,a=eo(t),c=m.useRef(null),[l,u]=m.useState(!1),[d,f]=Mn({prop:r,defaultProp:o??!1,onChange:s,caller:vs});return p.jsx(is,{...a,children:p.jsx(bN,{scope:t,contentId:ot(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(h=>!h),[f]),hasCustomAnchor:l,onCustomAnchorAdd:m.useCallback(()=>u(!0),[]),onCustomAnchorRemove:m.useCallback(()=>u(!1),[]),modal:i,children:n})})};Vm.displayName=vs;var Rm="PopoverAnchor",xN=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=sn(Rm,n),s=eo(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:a}=o;return m.useEffect(()=>(i(),()=>a()),[i,a]),p.jsx(as,{...s,...r,ref:t})});xN.displayName=Rm;var Bm="PopoverTrigger",Wm=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=sn(Bm,n),s=eo(n),i=fe(t,o.triggerRef),a=p.jsx(ce.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Um(o.open),...r,ref:i,onClick:K(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?a:p.jsx(as,{asChild:!0,...s,children:a})});Wm.displayName=Bm;var Pc="PopoverPortal",[SN,CN]=Lm(Pc,{forceMount:void 0}),$m=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,s=sn(Pc,t);return p.jsx(SN,{scope:t,forceMount:n,children:p.jsx(Ke,{present:n||s.open,children:p.jsx(Qr,{asChild:!0,container:o,children:r})})})};$m.displayName=Pc;var fr="PopoverContent",Hm=m.forwardRef((e,t)=>{const n=CN(fr,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,s=sn(fr,e.__scopePopover);return p.jsx(Ke,{present:r||s.open,children:s.modal?p.jsx(EN,{...o,ref:t}):p.jsx(PN,{...o,ref:t})})});Hm.displayName=fr;var TN=en("PopoverContent.RemoveScroll"),EN=m.forwardRef((e,t)=>{const n=sn(fr,e.__scopePopover),r=m.useRef(null),o=fe(t,r),s=m.useRef(!1);return m.useEffect(()=>{const i=r.current;if(i)return ds(i)},[]),p.jsx(Jr,{as:TN,allowPinchZoom:!0,children:p.jsx(jm,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:K(e.onCloseAutoFocus,i=>{var a;i.preventDefault(),s.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:K(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:K(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),PN=m.forwardRef((e,t)=>{const n=sn(fr,e.__scopePopover),r=m.useRef(!1),o=m.useRef(!1);return p.jsx(jm,{...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()}})}),jm=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=sn(fr,n),h=eo(n);return Go(),p.jsx(qr,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:p.jsx(Gr,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),children:p.jsx(wc,{"data-state":Um(f.open),role:"dialog",id:f.contentId,...h,...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)"}})})})}),Ym="PopoverClose",DN=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=sn(Ym,n);return p.jsx(ce.button,{type:"button",...r,ref:t,onClick:K(e.onClick,()=>o.onOpenChange(!1))})});DN.displayName=Ym;var MN="PopoverArrow",ON=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=eo(n);return p.jsx(bc,{...o,...r,ref:t})});ON.displayName=MN;function Um(e){return e?"open":"closed"}var NN=Vm,AN=Wm,kN=$m,IN=Hm;function zm({nativeEvent:e}){return window.TouchEvent?e instanceof TouchEvent:"touches"in e}function Km(e){return e.nativeEvent instanceof MouseEvent}function Gm(e,t={}){const{threshold:n=400,onStart:r,onFinish:o,onCancel:s}=t,i=m.useRef(!1),a=m.useRef(!1),c=m.useRef();return m.useMemo(()=>{if(typeof e!="function")return{};const l=h=>{!Km(h)&&!zm(h)||(r&&r(h),a.current=!0,c.current=setTimeout(()=>{e(h),i.current=!0},n))},u=h=>{!Km(h)&&!zm(h)||(i.current?o&&o(h):a.current&&s&&s(h),i.current=!1,a.current=!1,c.current&&window.clearTimeout(c.current))};return{...{onMouseDown:l,onMouseUp:u,onMouseLeave:u},...{onTouchStart:l,onTouchEnd:u}}},[e,n,s,o,r])}function ys(e){const t=m.useCallback(o=>{const s=window.matchMedia(e);return s.addEventListener("change",o),()=>{s.removeEventListener("change",o)}},[e]),n=()=>window.matchMedia(e).matches,r=()=>{throw Error("useMediaQuery is a client-only hook")};return m.useSyncExternalStore(t,n,r)}var ws={exports:{}};/*!
|
|
136
|
+
* tabbable 6.2.0
|
|
137
|
+
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
138
|
+
*/var qm=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],bs=qm.join(","),Xm=typeof Element>"u",On=Xm?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,xs=!Xm&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},Ss=function e(t,n){var r;n===void 0&&(n=!0);var o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),s=o===""||o==="true",i=s||n&&t&&e(t.parentNode);return i},_N=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},Zm=function(t,n,r){if(Ss(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(bs));return n&&On.call(t,bs)&&o.unshift(t),o=o.filter(r),o},Qm=function e(t,n,r){for(var o=[],s=Array.from(t);s.length;){var i=s.shift();if(!Ss(i,!1))if(i.tagName==="SLOT"){var a=i.assignedElements(),c=a.length?a:i.children,l=e(c,!0,r);r.flatten?o.push.apply(o,l):o.push({scopeParent:i,candidates:l})}else{var u=On.call(i,bs);u&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var d=i.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(i),f=!Ss(d,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(d&&f){var h=e(d===!0?i.children:d.children,!0,r);r.flatten?o.push.apply(o,h):o.push({scopeParent:i,candidates:h})}else s.unshift.apply(s,i.children)}}return o},Jm=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},an=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||_N(t))&&!Jm(t)?0:t.tabIndex},FN=function(t,n){var r=an(t);return r<0&&n&&!Jm(t)?0:r},LN=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},eg=function(t){return t.tagName==="INPUT"},VN=function(t){return eg(t)&&t.type==="hidden"},RN=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},BN=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},WN=function(t){if(!t.name)return!0;var n=t.form||xs(t),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var s=BN(o,t.form);return!s||s===t},$N=function(t){return eg(t)&&t.type==="radio"},HN=function(t){return $N(t)&&!WN(t)},jN=function(t){var n,r=t&&xs(t),o=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==t){var i,a,c;for(s=!!((i=o)!==null&&i!==void 0&&(a=i.ownerDocument)!==null&&a!==void 0&&a.contains(o)||t!=null&&(c=t.ownerDocument)!==null&&c!==void 0&&c.contains(t));!s&&o;){var l,u,d;r=xs(o),o=(l=r)===null||l===void 0?void 0:l.host,s=!!((u=o)!==null&&u!==void 0&&(d=u.ownerDocument)!==null&&d!==void 0&&d.contains(o))}}return s},tg=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},YN=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var s=On.call(t,"details>summary:first-of-type"),i=s?t.parentElement:t;if(On.call(i,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof o=="function"){for(var a=t;t;){var c=t.parentElement,l=xs(t);if(c&&!c.shadowRoot&&o(c)===!0)return tg(t);t.assignedSlot?t=t.assignedSlot:!c&&l!==t.ownerDocument?t=l.host:t=c}t=a}if(jN(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return tg(t);return!1},UN=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return On.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},Cs=function(t,n){return!(n.disabled||Ss(n)||VN(n)||YN(n,t)||RN(n)||UN(n))},Dc=function(t,n){return!(HN(n)||an(n)<0||!Cs(t,n))},zN=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},KN=function e(t){var n=[],r=[];return t.forEach(function(o,s){var i=!!o.scopeParent,a=i?o.scopeParent:o,c=FN(a,i),l=i?e(o.candidates):a;c===0?i?n.push.apply(n,l):n.push(a):r.push({documentOrder:s,tabIndex:c,item:o,isScope:i,content:l})}),r.sort(LN).reduce(function(o,s){return s.isScope?o.push.apply(o,s.content):o.push(s.content),o},[]).concat(n)},Ts=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Qm([t],n.includeContainer,{filter:Dc.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:zN}):r=Zm(t,n.includeContainer,Dc.bind(null,n)),KN(r)},ng=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Qm([t],n.includeContainer,{filter:Cs.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=Zm(t,n.includeContainer,Cs.bind(null,n)),r},Nn=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return On.call(t,bs)===!1?!1:Dc(n,t)},GN=qm.concat("iframe").join(","),Es=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return On.call(t,GN)===!1?!1:Cs(n,t)};const qN=Object.freeze(Object.defineProperty({__proto__:null,focusable:ng,getTabIndex:an,isFocusable:Es,isTabbable:Nn,tabbable:Ts},Symbol.toStringTag,{value:"Module"}));/*!
|
|
139
|
+
* focus-trap 7.6.5
|
|
140
|
+
* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
|
|
141
|
+
*/function Mc(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function XN(e){if(Array.isArray(e))return Mc(e)}function ZN(e,t,n){return(t=nA(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function QN(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function JN(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
142
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function og(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?rg(Object(n),!0).forEach(function(r){ZN(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rg(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function eA(e){return XN(e)||QN(e)||rA(e)||JN()}function tA(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function nA(e){var t=tA(e,"string");return typeof t=="symbol"?t:t+""}function rA(e,t){if(e){if(typeof e=="string")return Mc(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Mc(e,t):void 0}}var sg={activateTrap:function(t,n){if(t.length>0){var r=t[t.length-1];r!==n&&r._setPausedState(!0)}var o=t.indexOf(n);o===-1||t.splice(o,1),t.push(n)},deactivateTrap:function(t,n){var r=t.indexOf(n);r!==-1&&t.splice(r,1),t.length>0&&!t[t.length-1]._isManuallyPaused()&&t[t.length-1]._setPausedState(!1)}},oA=function(t){return t.tagName&&t.tagName.toLowerCase()==="input"&&typeof t.select=="function"},sA=function(t){return(t==null?void 0:t.key)==="Escape"||(t==null?void 0:t.key)==="Esc"||(t==null?void 0:t.keyCode)===27},to=function(t){return(t==null?void 0:t.key)==="Tab"||(t==null?void 0:t.keyCode)===9},iA=function(t){return to(t)&&!t.shiftKey},aA=function(t){return to(t)&&t.shiftKey},ig=function(t){return setTimeout(t,0)},no=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return typeof t=="function"?t.apply(void 0,r):t},Ps=function(t){return t.target.shadowRoot&&typeof t.composedPath=="function"?t.composedPath()[0]:t.target},cA=[],lA=function(t,n){var r=(n==null?void 0:n.document)||document,o=(n==null?void 0:n.trapStack)||cA,s=og({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:iA,isKeyBackward:aA},n),i={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},a,c=function(O,A,L){return O&&O[A]!==void 0?O[A]:s[L||A]},l=function(O,A){var L=typeof(A==null?void 0:A.composedPath)=="function"?A.composedPath():void 0;return i.containerGroups.findIndex(function(R){var F=R.container,k=R.tabbableNodes;return F.contains(O)||(L==null?void 0:L.includes(F))||k.find(function(I){return I===O})})},u=function(O){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},L=A.hasFallback,R=L===void 0?!1:L,F=A.params,k=F===void 0?[]:F,I=s[O];if(typeof I=="function"&&(I=I.apply(void 0,eA(k))),I===!0&&(I=void 0),!I){if(I===void 0||I===!1)return I;throw new Error("`".concat(O,"` was specified but was not a node, or did not return a node"))}var B=I;if(typeof I=="string"){try{B=r.querySelector(I)}catch(U){throw new Error("`".concat(O,'` appears to be an invalid selector; error="').concat(U.message,'"'))}if(!B&&!R)throw new Error("`".concat(O,"` as selector refers to no known node"))}return B},d=function(){var O=u("initialFocus",{hasFallback:!0});if(O===!1)return!1;if(O===void 0||O&&!Es(O,s.tabbableOptions))if(l(r.activeElement)>=0)O=r.activeElement;else{var A=i.tabbableGroups[0],L=A&&A.firstTabbableNode;O=L||u("fallbackFocus")}else O===null&&(O=u("fallbackFocus"));if(!O)throw new Error("Your focus-trap needs to have at least one focusable element");return O},f=function(){if(i.containerGroups=i.containers.map(function(O){var A=Ts(O,s.tabbableOptions),L=ng(O,s.tabbableOptions),R=A.length>0?A[0]:void 0,F=A.length>0?A[A.length-1]:void 0,k=L.find(function(U){return Nn(U)}),I=L.slice().reverse().find(function(U){return Nn(U)}),B=!!A.find(function(U){return an(U)>0});return{container:O,tabbableNodes:A,focusableNodes:L,posTabIndexesFound:B,firstTabbableNode:R,lastTabbableNode:F,firstDomTabbableNode:k,lastDomTabbableNode:I,nextTabbableNode:function(j){var X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,se=A.indexOf(j);return se<0?X?L.slice(L.indexOf(j)+1).find(function(ne){return Nn(ne)}):L.slice(0,L.indexOf(j)).reverse().find(function(ne){return Nn(ne)}):A[se+(X?1:-1)]}}}),i.tabbableGroups=i.containerGroups.filter(function(O){return O.tabbableNodes.length>0}),i.tabbableGroups.length<=0&&!u("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(i.containerGroups.find(function(O){return O.posTabIndexesFound})&&i.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},h=function(O){var A=O.activeElement;if(A)return A.shadowRoot&&A.shadowRoot.activeElement!==null?h(A.shadowRoot):A},v=function(O){if(O!==!1&&O!==h(document)){if(!O||!O.focus){v(d());return}O.focus({preventScroll:!!s.preventScroll}),i.mostRecentlyFocusedNode=O,oA(O)&&O.select()}},g=function(O){var A=u("setReturnFocus",{params:[O]});return A||(A===!1?!1:O)},w=function(O){var A=O.target,L=O.event,R=O.isBackward,F=R===void 0?!1:R;A=A||Ps(L),f();var k=null;if(i.tabbableGroups.length>0){var I=l(A,L),B=I>=0?i.containerGroups[I]:void 0;if(I<0)F?k=i.tabbableGroups[i.tabbableGroups.length-1].lastTabbableNode:k=i.tabbableGroups[0].firstTabbableNode;else if(F){var U=i.tabbableGroups.findIndex(function(Y){var J=Y.firstTabbableNode;return A===J});if(U<0&&(B.container===A||Es(A,s.tabbableOptions)&&!Nn(A,s.tabbableOptions)&&!B.nextTabbableNode(A,!1))&&(U=I),U>=0){var j=U===0?i.tabbableGroups.length-1:U-1,X=i.tabbableGroups[j];k=an(A)>=0?X.lastTabbableNode:X.lastDomTabbableNode}else to(L)||(k=B.nextTabbableNode(A,!1))}else{var se=i.tabbableGroups.findIndex(function(Y){var J=Y.lastTabbableNode;return A===J});if(se<0&&(B.container===A||Es(A,s.tabbableOptions)&&!Nn(A,s.tabbableOptions)&&!B.nextTabbableNode(A))&&(se=I),se>=0){var ne=se===i.tabbableGroups.length-1?0:se+1,ie=i.tabbableGroups[ne];k=an(A)>=0?ie.firstTabbableNode:ie.firstDomTabbableNode}else to(L)||(k=B.nextTabbableNode(A))}}else k=u("fallbackFocus");return k},b=function(O){var A=Ps(O);if(!(l(A,O)>=0)){if(no(s.clickOutsideDeactivates,O)){a.deactivate({returnFocus:s.returnFocusOnDeactivate});return}no(s.allowOutsideClick,O)||O.preventDefault()}},S=function(O){var A=Ps(O),L=l(A,O)>=0;if(L||A instanceof Document)L&&(i.mostRecentlyFocusedNode=A);else{O.stopImmediatePropagation();var R,F=!0;if(i.mostRecentlyFocusedNode)if(an(i.mostRecentlyFocusedNode)>0){var k=l(i.mostRecentlyFocusedNode),I=i.containerGroups[k].tabbableNodes;if(I.length>0){var B=I.findIndex(function(U){return U===i.mostRecentlyFocusedNode});B>=0&&(s.isKeyForward(i.recentNavEvent)?B+1<I.length&&(R=I[B+1],F=!1):B-1>=0&&(R=I[B-1],F=!1))}}else i.containerGroups.some(function(U){return U.tabbableNodes.some(function(j){return an(j)>0})})||(F=!1);else F=!1;F&&(R=w({target:i.mostRecentlyFocusedNode,isBackward:s.isKeyBackward(i.recentNavEvent)})),v(R||i.mostRecentlyFocusedNode||d())}i.recentNavEvent=void 0},x=function(O){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;i.recentNavEvent=O;var L=w({event:O,isBackward:A});L&&(to(O)&&O.preventDefault(),v(L))},C=function(O){(s.isKeyForward(O)||s.isKeyBackward(O))&&x(O,s.isKeyBackward(O))},E=function(O){sA(O)&&no(s.escapeDeactivates,O)!==!1&&(O.preventDefault(),a.deactivate())},D=function(O){var A=Ps(O);l(A,O)>=0||no(s.clickOutsideDeactivates,O)||no(s.allowOutsideClick,O)||(O.preventDefault(),O.stopImmediatePropagation())},T=function(){if(i.active)return sg.activateTrap(o,a),i.delayInitialFocusTimer=s.delayInitialFocus?ig(function(){v(d())}):v(d()),r.addEventListener("focusin",S,!0),r.addEventListener("mousedown",b,{capture:!0,passive:!1}),r.addEventListener("touchstart",b,{capture:!0,passive:!1}),r.addEventListener("click",D,{capture:!0,passive:!1}),r.addEventListener("keydown",C,{capture:!0,passive:!1}),r.addEventListener("keydown",E),a},P=function(){if(i.active)return r.removeEventListener("focusin",S,!0),r.removeEventListener("mousedown",b,!0),r.removeEventListener("touchstart",b,!0),r.removeEventListener("click",D,!0),r.removeEventListener("keydown",C,!0),r.removeEventListener("keydown",E),a},M=function(O){var A=O.some(function(L){var R=Array.from(L.removedNodes);return R.some(function(F){return F===i.mostRecentlyFocusedNode})});A&&v(d())},N=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(M):void 0,_=function(){N&&(N.disconnect(),i.active&&!i.paused&&i.containers.map(function(O){N.observe(O,{subtree:!0,childList:!0})}))};return a={get active(){return i.active},get paused(){return i.paused},activate:function(O){if(i.active)return this;var A=c(O,"onActivate"),L=c(O,"onPostActivate"),R=c(O,"checkCanFocusTrap");R||f(),i.active=!0,i.paused=!1,i.nodeFocusedBeforeActivation=h(r),A==null||A();var F=function(){R&&f(),T(),_(),L==null||L()};return R?(R(i.containers.concat()).then(F,F),this):(F(),this)},deactivate:function(O){if(!i.active)return this;var A=og({onDeactivate:s.onDeactivate,onPostDeactivate:s.onPostDeactivate,checkCanReturnFocus:s.checkCanReturnFocus},O);clearTimeout(i.delayInitialFocusTimer),i.delayInitialFocusTimer=void 0,P(),i.active=!1,i.paused=!1,_(),sg.deactivateTrap(o,a);var L=c(A,"onDeactivate"),R=c(A,"onPostDeactivate"),F=c(A,"checkCanReturnFocus"),k=c(A,"returnFocus","returnFocusOnDeactivate");L==null||L();var I=function(){ig(function(){k&&v(g(i.nodeFocusedBeforeActivation)),R==null||R()})};return k&&F?(F(g(i.nodeFocusedBeforeActivation)).then(I,I),this):(I(),this)},pause:function(O){return i.active?(i.manuallyPaused=!0,this._setPausedState(!0,O)):this},unpause:function(O){return i.active?(i.manuallyPaused=!1,o[o.length-1]!==this?this:this._setPausedState(!1,O)):this},updateContainerElements:function(O){var A=[].concat(O).filter(Boolean);return i.containers=A.map(function(L){return typeof L=="string"?r.querySelector(L):L}),i.active&&f(),_(),this}},Object.defineProperties(a,{_isManuallyPaused:{value:function(){return i.manuallyPaused}},_setPausedState:{value:function(O,A){if(i.paused===O)return this;if(i.paused=O,O){var L=c(A,"onPause"),R=c(A,"onPostPause");L==null||L(),P(),_(),R==null||R()}else{var F=c(A,"onUnpause"),k=c(A,"onPostUnpause");F==null||F(),f(),T(),_(),k==null||k()}return this}}}),a.updateContainerElements(t),a};const uA=dh(Object.freeze(Object.defineProperty({__proto__:null,createFocusTrap:lA},Symbol.toStringTag,{value:"Module"}))),dA=dh(qN);var ag;function fA(){if(ag)return ws.exports;ag=1;function e(T){"@babel/helpers - typeof";return e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(P){return typeof P}:function(P){return P&&typeof Symbol=="function"&&P.constructor===Symbol&&P!==Symbol.prototype?"symbol":typeof P},e(T)}var t,n;function r(T,P){if(!(T instanceof P))throw new TypeError("Cannot call a class as a function")}function o(T,P){for(var M=0;M<P.length;M++){var N=P[M];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(T,v(N.key),N)}}function s(T,P,M){return P&&o(T.prototype,P),Object.defineProperty(T,"prototype",{writable:!1}),T}function i(T,P,M){return P=u(P),a(T,l()?Reflect.construct(P,M||[],u(T).constructor):P.apply(T,M))}function a(T,P){if(P&&(e(P)=="object"||typeof P=="function"))return P;if(P!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return c(T)}function c(T){if(T===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return T}function l(){try{var T=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(l=function(){return!!T})()}function u(T){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(P){return P.__proto__||Object.getPrototypeOf(P)},u(T)}function d(T,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function");T.prototype=Object.create(P&&P.prototype,{constructor:{value:T,writable:!0,configurable:!0}}),Object.defineProperty(T,"prototype",{writable:!1}),P&&f(T,P)}function f(T,P){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(M,N){return M.__proto__=N,M},f(T,P)}function h(T,P,M){return(P=v(P))in T?Object.defineProperty(T,P,{value:M,enumerable:!0,configurable:!0,writable:!0}):T[P]=M,T}function v(T){var P=g(T,"string");return e(P)=="symbol"?P:P+""}function g(T,P){if(e(T)!="object"||!T)return T;var M=T[Symbol.toPrimitive];if(M!==void 0){var N=M.call(T,P);if(e(N)!="object")return N;throw new TypeError("@@toPrimitive must return a primitive value.")}return(P==="string"?String:Number)(T)}var w=y,b=uA,S=b.createFocusTrap,x=dA,C=x.isFocusable,E=parseInt((t=(n=/^(\d+)\./.exec(w.version))===null||n===void 0?void 0:n[1])!==null&&t!==void 0?t:0,10),D=(function(T){function P(M){var N;r(this,P),N=i(this,P,[M]),h(N,"getNodeForOption",function(O){var A,L=(A=this.internalOptions[O])!==null&&A!==void 0?A:this.originalOptions[O];if(typeof L=="function"){for(var R=arguments.length,F=new Array(R>1?R-1:0),k=1;k<R;k++)F[k-1]=arguments[k];L=L.apply(void 0,F)}if(L===!0&&(L=void 0),!L){if(L===void 0||L===!1)return L;throw new Error("`".concat(O,"` was specified but was not a node, or did not return a node"))}var I=L;if(typeof L=="string"){var B;if(I=(B=this.getDocument())===null||B===void 0?void 0:B.querySelector(L),!I)throw new Error("`".concat(O,"` as selector refers to no known node"))}return I}),N.handleDeactivate=N.handleDeactivate.bind(N),N.handlePostDeactivate=N.handlePostDeactivate.bind(N),N.handleClickOutsideDeactivates=N.handleClickOutsideDeactivates.bind(N),N.internalOptions={returnFocusOnDeactivate:!1,checkCanReturnFocus:null,onDeactivate:N.handleDeactivate,onPostDeactivate:N.handlePostDeactivate,clickOutsideDeactivates:N.handleClickOutsideDeactivates},N.originalOptions={returnFocusOnDeactivate:!0,onDeactivate:null,onPostDeactivate:null,checkCanReturnFocus:null,clickOutsideDeactivates:!1};var _=M.focusTrapOptions;for(var V in _)if(Object.prototype.hasOwnProperty.call(_,V)){if(V==="returnFocusOnDeactivate"||V==="onDeactivate"||V==="onPostDeactivate"||V==="checkCanReturnFocus"||V==="clickOutsideDeactivates"){N.originalOptions[V]=_[V];continue}N.internalOptions[V]=_[V]}return N.outsideClick=null,N.focusTrapElements=M.containerElements||[],N.updatePreviousElement(),N}return d(P,T),s(P,[{key:"getDocument",value:function(){return this.props.focusTrapOptions.document||(typeof document<"u"?document:void 0)}},{key:"getReturnFocusNode",value:function(){var N=this.getNodeForOption("setReturnFocus",this.previouslyFocusedElement);return N||(N===!1?!1:this.previouslyFocusedElement)}},{key:"updatePreviousElement",value:function(){var N=this.getDocument();N&&(this.previouslyFocusedElement=N.activeElement)}},{key:"deactivateTrap",value:function(){!this.focusTrap||!this.focusTrap.active||this.focusTrap.deactivate({returnFocus:!1,checkCanReturnFocus:null,onDeactivate:this.originalOptions.onDeactivate})}},{key:"handleClickOutsideDeactivates",value:function(N){var _=typeof this.originalOptions.clickOutsideDeactivates=="function"?this.originalOptions.clickOutsideDeactivates.call(null,N):this.originalOptions.clickOutsideDeactivates;return _&&(this.outsideClick={target:N.target,allowDeactivation:_}),_}},{key:"handleDeactivate",value:function(){this.originalOptions.onDeactivate&&this.originalOptions.onDeactivate.call(null),this.deactivateTrap()}},{key:"handlePostDeactivate",value:function(){var N=this,_=function(){var O=N.getReturnFocusNode(),A=!!(N.originalOptions.returnFocusOnDeactivate&&O!==null&&O!==void 0&&O.focus&&(!N.outsideClick||N.outsideClick.allowDeactivation&&!C(N.outsideClick.target,N.internalOptions.tabbableOptions))),L=N.internalOptions.preventScroll,R=L===void 0?!1:L;A&&O.focus({preventScroll:R}),N.originalOptions.onPostDeactivate&&N.originalOptions.onPostDeactivate.call(null),N.outsideClick=null};this.originalOptions.checkCanReturnFocus?this.originalOptions.checkCanReturnFocus.call(null,this.getReturnFocusNode()).then(_,_):_()}},{key:"setupFocusTrap",value:function(){if(this.focusTrap)this.props.active&&!this.focusTrap.active&&(this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause());else{var N=this.focusTrapElements.some(Boolean);N&&(this.focusTrap=this.props._createFocusTrap(this.focusTrapElements,this.internalOptions),this.props.active&&this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause())}}},{key:"componentDidMount",value:function(){this.props.active&&this.setupFocusTrap()}},{key:"componentDidUpdate",value:function(N){if(this.focusTrap){N.containerElements!==this.props.containerElements&&this.focusTrap.updateContainerElements(this.props.containerElements);var _=!N.active&&this.props.active,V=N.active&&!this.props.active,O=!N.paused&&this.props.paused,A=N.paused&&!this.props.paused;if(_&&(this.updatePreviousElement(),this.focusTrap.activate()),V){this.deactivateTrap();return}O&&this.focusTrap.pause(),A&&this.focusTrap.unpause()}else N.containerElements!==this.props.containerElements&&(this.focusTrapElements=this.props.containerElements),this.props.active&&(this.updatePreviousElement(),this.setupFocusTrap())}},{key:"componentWillUnmount",value:function(){this.deactivateTrap()}},{key:"render",value:function(){var N=this,_=this.props.children?w.Children.only(this.props.children):void 0;if(_){if(_.type&&_.type===w.Fragment)throw new Error("A focus-trap cannot use a Fragment as its child container. Try replacing it with a <div> element.");var V=function(L){var R=N.props.containerElements;_&&(E>=19?typeof _.props.ref=="function"?_.props.ref(L):_.props.ref&&(_.props.ref.current=L):typeof _.ref=="function"?_.ref(L):_.ref&&(_.ref.current=L)),N.focusTrapElements=R||[L]},O=w.cloneElement(_,{ref:V});return O}return null}}])})(w.Component);return D.defaultProps={active:!0,paused:!1,focusTrapOptions:{},_createFocusTrap:S},ws.exports=D,ws.exports.FocusTrap=D,ws.exports}var hA=fA();const pA=uh(hA);var mA=m.createContext(void 0);function Ds(e){const t=m.useContext(mA);return e||t||"ltr"}function Oc(e,[t,n]){return Math.min(n,Math.max(t,e))}function gA(e,t){return m.useReducer((n,r)=>t[n][r]??n,e)}var Nc="ScrollArea",[cg]=Ct(Nc),[vA,it]=cg(Nc),lg=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:s=600,...i}=e,[a,c]=m.useState(null),[l,u]=m.useState(null),[d,f]=m.useState(null),[h,v]=m.useState(null),[g,w]=m.useState(null),[b,S]=m.useState(0),[x,C]=m.useState(0),[E,D]=m.useState(!1),[T,P]=m.useState(!1),M=fe(t,_=>c(_)),N=Ds(o);return p.jsx(vA,{scope:n,type:r,dir:N,scrollHideDelay:s,scrollArea:a,viewport:l,onViewportChange:u,content:d,onContentChange:f,scrollbarX:h,onScrollbarXChange:v,scrollbarXEnabled:E,onScrollbarXEnabledChange:D,scrollbarY:g,onScrollbarYChange:w,scrollbarYEnabled:T,onScrollbarYEnabledChange:P,onCornerWidthChange:S,onCornerHeightChange:C,children:p.jsx(ce.div,{dir:N,...i,ref:M,style:{position:"relative","--radix-scroll-area-corner-width":b+"px","--radix-scroll-area-corner-height":x+"px",...e.style}})})});lg.displayName=Nc;var ug="ScrollAreaViewport",dg=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:o,...s}=e,i=it(ug,n),a=m.useRef(null),c=fe(t,a,i.onViewportChange);return p.jsxs(p.Fragment,{children:[p.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),p.jsx(ce.div,{"data-radix-scroll-area-viewport":"",...s,ref:c,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style},children:p.jsx("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});dg.displayName=ug;var Lt="ScrollAreaScrollbar",fg=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=it(Lt,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:i}=o,a=e.orientation==="horizontal";return m.useEffect(()=>(a?s(!0):i(!0),()=>{a?s(!1):i(!1)}),[a,s,i]),o.type==="hover"?p.jsx(yA,{...r,ref:t,forceMount:n}):o.type==="scroll"?p.jsx(wA,{...r,ref:t,forceMount:n}):o.type==="auto"?p.jsx(hg,{...r,ref:t,forceMount:n}):o.type==="always"?p.jsx(Ac,{...r,ref:t}):null});fg.displayName=Lt;var yA=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=it(Lt,e.__scopeScrollArea),[s,i]=m.useState(!1);return m.useEffect(()=>{const a=o.scrollArea;let c=0;if(a){const l=()=>{window.clearTimeout(c),i(!0)},u=()=>{c=window.setTimeout(()=>i(!1),o.scrollHideDelay)};return a.addEventListener("pointerenter",l),a.addEventListener("pointerleave",u),()=>{window.clearTimeout(c),a.removeEventListener("pointerenter",l),a.removeEventListener("pointerleave",u)}}},[o.scrollArea,o.scrollHideDelay]),p.jsx(Ke,{present:n||s,children:p.jsx(hg,{"data-state":s?"visible":"hidden",...r,ref:t})})}),wA=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=it(Lt,e.__scopeScrollArea),s=e.orientation==="horizontal",i=As(()=>c("SCROLL_END"),100),[a,c]=gA("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return m.useEffect(()=>{if(a==="idle"){const l=window.setTimeout(()=>c("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(l)}},[a,o.scrollHideDelay,c]),m.useEffect(()=>{const l=o.viewport,u=s?"scrollLeft":"scrollTop";if(l){let d=l[u];const f=()=>{const h=l[u];d!==h&&(c("SCROLL"),i()),d=h};return l.addEventListener("scroll",f),()=>l.removeEventListener("scroll",f)}},[o.viewport,s,c,i]),p.jsx(Ke,{present:n||a!=="hidden",children:p.jsx(Ac,{"data-state":a==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:K(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:K(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),hg=m.forwardRef((e,t)=>{const n=it(Lt,e.__scopeScrollArea),{forceMount:r,...o}=e,[s,i]=m.useState(!1),a=e.orientation==="horizontal",c=As(()=>{if(n.viewport){const l=n.viewport.offsetWidth<n.viewport.scrollWidth,u=n.viewport.offsetHeight<n.viewport.scrollHeight;i(a?l:u)}},10);return hr(n.viewport,c),hr(n.content,c),p.jsx(Ke,{present:r||s,children:p.jsx(Ac,{"data-state":s?"visible":"hidden",...o,ref:t})})}),Ac=m.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=it(Lt,e.__scopeScrollArea),s=m.useRef(null),i=m.useRef(0),[a,c]=m.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=yg(a.viewport,a.content),u={...r,sizes:a,onSizesChange:c,hasThumb:l>0&&l<1,onThumbChange:f=>s.current=f,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:f=>i.current=f};function d(f,h){return EA(f,i.current,a,h)}return n==="horizontal"?p.jsx(bA,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const f=o.viewport.scrollLeft,h=wg(f,a,o.dir);s.current.style.transform=`translate3d(${h}px, 0, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollLeft=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollLeft=d(f,o.dir))}}):n==="vertical"?p.jsx(xA,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const f=o.viewport.scrollTop,h=wg(f,a);s.current.style.transform=`translate3d(0, ${h}px, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollTop=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollTop=d(f))}}):null}),bA=m.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,s=it(Lt,e.__scopeScrollArea),[i,a]=m.useState(),c=m.useRef(null),l=fe(t,c,s.onScrollbarXChange);return m.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),p.jsx(mg,{"data-orientation":"horizontal",...o,ref:l,sizes:n,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Ns(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,d)=>{if(s.viewport){const f=s.viewport.scrollLeft+u.deltaX;e.onWheelScroll(f),xg(f,d)&&u.preventDefault()}},onResize:()=>{c.current&&s.viewport&&i&&r({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:Os(i.paddingLeft),paddingEnd:Os(i.paddingRight)}})}})}),xA=m.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,s=it(Lt,e.__scopeScrollArea),[i,a]=m.useState(),c=m.useRef(null),l=fe(t,c,s.onScrollbarYChange);return m.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),p.jsx(mg,{"data-orientation":"vertical",...o,ref:l,sizes:n,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Ns(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,d)=>{if(s.viewport){const f=s.viewport.scrollTop+u.deltaY;e.onWheelScroll(f),xg(f,d)&&u.preventDefault()}},onResize:()=>{c.current&&s.viewport&&i&&r({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:Os(i.paddingTop),paddingEnd:Os(i.paddingBottom)}})}})}),[SA,pg]=cg(Lt),mg=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:s,onThumbPointerUp:i,onThumbPointerDown:a,onThumbPositionChange:c,onDragScroll:l,onWheelScroll:u,onResize:d,...f}=e,h=it(Lt,n),[v,g]=m.useState(null),w=fe(t,M=>g(M)),b=m.useRef(null),S=m.useRef(""),x=h.viewport,C=r.content-r.viewport,E=Fe(u),D=Fe(c),T=As(d,10);function P(M){if(b.current){const N=M.clientX-b.current.left,_=M.clientY-b.current.top;l({x:N,y:_})}}return m.useEffect(()=>{const M=N=>{const _=N.target;(v==null?void 0:v.contains(_))&&E(N,C)};return document.addEventListener("wheel",M,{passive:!1}),()=>document.removeEventListener("wheel",M,{passive:!1})},[x,v,C,E]),m.useEffect(D,[r,D]),hr(v,T),hr(h.content,T),p.jsx(SA,{scope:n,scrollbar:v,hasThumb:o,onThumbChange:Fe(s),onThumbPointerUp:Fe(i),onThumbPositionChange:D,onThumbPointerDown:Fe(a),children:p.jsx(ce.div,{...f,ref:w,style:{position:"absolute",...f.style},onPointerDown:K(e.onPointerDown,M=>{M.button===0&&(M.target.setPointerCapture(M.pointerId),b.current=v.getBoundingClientRect(),S.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",h.viewport&&(h.viewport.style.scrollBehavior="auto"),P(M))}),onPointerMove:K(e.onPointerMove,P),onPointerUp:K(e.onPointerUp,M=>{const N=M.target;N.hasPointerCapture(M.pointerId)&&N.releasePointerCapture(M.pointerId),document.body.style.webkitUserSelect=S.current,h.viewport&&(h.viewport.style.scrollBehavior=""),b.current=null})})})}),Ms="ScrollAreaThumb",gg=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=pg(Ms,e.__scopeScrollArea);return p.jsx(Ke,{present:n||o.hasThumb,children:p.jsx(CA,{ref:t,...r})})}),CA=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,s=it(Ms,n),i=pg(Ms,n),{onThumbPositionChange:a}=i,c=fe(t,d=>i.onThumbChange(d)),l=m.useRef(void 0),u=As(()=>{l.current&&(l.current(),l.current=void 0)},100);return m.useEffect(()=>{const d=s.viewport;if(d){const f=()=>{if(u(),!l.current){const h=PA(d,a);l.current=h,a()}};return a(),d.addEventListener("scroll",f),()=>d.removeEventListener("scroll",f)}},[s.viewport,u,a]),p.jsx(ce.div,{"data-state":i.hasThumb?"visible":"hidden",...o,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:K(e.onPointerDownCapture,d=>{const h=d.target.getBoundingClientRect(),v=d.clientX-h.left,g=d.clientY-h.top;i.onThumbPointerDown({x:v,y:g})}),onPointerUp:K(e.onPointerUp,i.onThumbPointerUp)})});gg.displayName=Ms;var kc="ScrollAreaCorner",vg=m.forwardRef((e,t)=>{const n=it(kc,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?p.jsx(TA,{...e,ref:t}):null});vg.displayName=kc;var TA=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=it(kc,n),[s,i]=m.useState(0),[a,c]=m.useState(0),l=!!(s&&a);return hr(o.scrollbarX,()=>{var d;const u=((d=o.scrollbarX)==null?void 0:d.offsetHeight)||0;o.onCornerHeightChange(u),c(u)}),hr(o.scrollbarY,()=>{var d;const u=((d=o.scrollbarY)==null?void 0:d.offsetWidth)||0;o.onCornerWidthChange(u),i(u)}),l?p.jsx(ce.div,{...r,ref:t,style:{width:s,height:a,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Os(e){return e?parseInt(e,10):0}function yg(e,t){const n=e/t;return isNaN(n)?0:n}function Ns(e){const t=yg(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function EA(e,t,n,r="ltr"){const o=Ns(n),s=o/2,i=t||s,a=o-i,c=n.scrollbar.paddingStart+i,l=n.scrollbar.size-n.scrollbar.paddingEnd-a,u=n.content-n.viewport,d=r==="ltr"?[0,u]:[u*-1,0];return bg([c,l],d)(e)}function wg(e,t,n="ltr"){const r=Ns(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-o,i=t.content-t.viewport,a=s-r,c=n==="ltr"?[0,i]:[i*-1,0],l=Oc(e,c);return bg([0,i],[0,a])(l)}function bg(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 xg(e,t){return e>0&&e<t}var PA=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function o(){const s={left:e.scrollLeft,top:e.scrollTop},i=n.left!==s.left,a=n.top!==s.top;(i||a)&&t(),n=s,r=window.requestAnimationFrame(o)})(),()=>window.cancelAnimationFrame(r)};function As(e,t){const n=Fe(e),r=m.useRef(0);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),m.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function hr(e,t){const n=Fe(t);Ie(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}var DA=lg,MA=dg,Sg=fg,OA=gg,NA=vg;const AA=.25,Ic=200,kA=300,IA=30,Cg=80,_A=({pullProgress:e,isRefreshing:t})=>{const n=mt(e,[0,Cg],[0,180]);return t?p.jsx(Fa,{className:"h-5 w-5 animate-spin text-graphite-primary"}):p.jsx(we.div,{style:{rotate:n},children:p.jsx(ZT,{className:"h-5 w-5 text-graphite-foreground/70"})})},FA=(e,t,n)=>{const{orientation:r,isEnabled:o,damping:s,isRefreshEnabled:i,onRefresh:a,pullThreshold:c}=n,l=r==="vertical",[u,d]=y.useState(!1),f=y.useRef(!1),h=y.useRef(0),v=y.useRef(!1),g=y.useRef(null),w=y.useCallback(()=>{Na(t,0,{type:"spring",stiffness:kA,damping:IA})},[t]),b=y.useCallback(async()=>{if(!a||!l){w();return}d(!0),w();try{await a()}finally{d(!1)}},[a,w,l]);return y.useEffect(()=>{const S=e.current;if(!S||!o)return;const x=T=>{if(u)return;const{scrollTop:P,scrollLeft:M,scrollHeight:N,scrollWidth:_,clientHeight:V,clientWidth:O}=S,A=l?P:M,L=l?N:_,R=l?V:O,F=l?T.deltaY:T.deltaX,k=A<=0,I=A>=L-R,B=F<0,U=F>0;if(k&&B||I&&U){T.preventDefault();const j=t.get(),X=Math.abs(j)/Ic,se=F*s*(1-X),ne=Math.max(-Ic,Math.min(Ic,j-se));t.set(ne),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{const ie=t.get();Math.abs(ie)>0&&(i&&ie>=c?b():w())},50)}},C=T=>{u||T.touches.length!==1||(f.current=!0,h.current=l?T.touches[0].clientY:T.touches[0].clientX)},E=T=>{if(!f.current||u||T.touches.length!==1)return;const{scrollTop:P,scrollLeft:M,scrollHeight:N,scrollWidth:_,clientHeight:V,clientWidth:O}=S,A=l?P:M,L=l?N:_,R=l?V:O,F=l?T.touches[0].clientY:T.touches[0].clientX,k=F-h.current,I=A<=0,B=A>=L-R,U=k<0,j=k>0;I&&j||B&&U?(v.current=!0,t.set(k*s)):v.current&&(v.current=!1,t.set(0),h.current=F)},D=()=>{f.current&&(f.current=!1,v.current&&(i&&t.get()>=c?b():w(),v.current=!1))};return S.addEventListener("wheel",x,{passive:!1}),S.addEventListener("touchstart",C,{passive:!1}),S.addEventListener("touchmove",E,{passive:!1}),S.addEventListener("touchend",D,{passive:!0}),S.addEventListener("touchcancel",D,{passive:!0}),()=>{S.removeEventListener("wheel",x),S.removeEventListener("touchstart",C),S.removeEventListener("touchmove",E),S.removeEventListener("touchend",D),S.removeEventListener("touchcancel",D),g.current&&clearTimeout(g.current)}},[e,o,s,t,w,i,c,b,u,l]),{isRefreshing:u}},Tg=y.forwardRef(({className:e,children:t,orientation:n="vertical",elasticity:r=!0,dampingFactor:o=AA,scrollbarVisibility:s="auto",pullToRefresh:i=!1,onRefresh:a,pullThreshold:c=Cg,RefreshIndicatorComponent:l=_A,...u},d)=>{const f=y.useRef(null);y.useImperativeHandle(d,()=>f.current,[]);const h=Wr(0),v=n==="vertical",{isRefreshing:g}=FA(f,h,{orientation:n,isEnabled:r||i,damping:o,isRefreshEnabled:i,onRefresh:a,pullThreshold:c}),w=mt(h,S=>S>0?S:0),b=mt(w,[0,c*.5],[0,1]);return p.jsxs(DA,{className:H("relative h-full w-full overflow-hidden!",e),...u,children:[i&&v&&p.jsx(we.div,{className:"pointer-events-none absolute inset-x-0 top-[-40px] z-50 flex justify-center",style:{y:g?c+40:w,opacity:g?1:b},transition:{type:"spring",stiffness:300,damping:30},children:p.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-graphite-card shadow-md",children:p.jsx(l,{pullProgress:w,isRefreshing:g})})}),p.jsx(we.div,{style:{[v?"y":"x"]:h},className:"h-full w-full",children:p.jsx(MA,{ref:f,className:"h-full w-full rounded-[inherit]",style:{touchAction:v?"pan-y":"pan-x"},children:t})}),p.jsx(ks,{scrollbarVisibility:s,orientation:"vertical"}),p.jsx(ks,{scrollbarVisibility:s,orientation:"horizontal"}),p.jsx(NA,{})]})});Tg.displayName="ElasticScrollArea";const ks=y.forwardRef(({className:e,orientation:t="vertical",scrollbarVisibility:n="auto",...r},o)=>p.jsx(Sg,{ref:o,orientation:t,className:H("flex touch-none select-none transition-opacity duration-200 z-[100]",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 border-t border-t-transparent p-[1px]",{"opacity-100":n==="always","data-[state=hidden]:opacity-0":n==="scroll","opacity-0 data-[state=visible]:opacity-100":n==="auto"},e),...r,children:p.jsx(OA,{className:"relative flex-1 rounded-full bg-graphite-primary/30"})}));ks.displayName=Sg.displayName;const Eg=Object.assign(Tg,{ScrollBar:ks}),LA={h1:"scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl",h2:"scroll-m-20 text-3xl font-semibold tracking-tight first:mt-0",h3:"scroll-m-20 text-2xl font-semibold tracking-tight",h4:"scroll-m-20 text-xl font-semibold tracking-tight",p:"leading-7 [&:not(:first-child)]:mt-6",blockquote:"mt-6 border-l-2 border-graphite-primary pl-6 italic text-gray-600",highlight:"relative rounded bg-graphite-secondary px-[0.3rem] py-[0.2rem] text-sm font-semibold text-graphite-secondaryForeground",lead:"text-xl text-gray-500",large:"text-lg font-semibold",small:"text-sm font-medium leading-none",muted:"text-sm text-gray-500"},VA={h1:"h1",h2:"h2",h3:"h3",h4:"h4",p:"p",blockquote:"blockquote",highlight:"span",lead:"p",large:"div",small:"small",muted:"p"},An=y.forwardRef(({as:e,variant:t,className:n,children:r,...o},s)=>{const i=e||VA[t]||"p",a=`${LA[t]} ${n||""}`.trim();return p.jsx(i,{ref:s,className:a,...o,children:r})});An.displayName="Typography";const Pg=y.createContext(null),cn=()=>{const e=y.useContext(Pg);if(!e)throw new Error("Dialog components must be used within a <Dialog>");return e},RA=({children:e})=>{const[t,n]=y.useState(!1);return y.useEffect(()=>n(!0),[]),t?ai.createPortal(e,document.body):null},_c=({open:e,onOpenChange:t,children:n,variant:r="basic"})=>{const[,o]=y.useState(null),s=y.useId(),i=y.useId();return p.jsx(Pg.Provider,{value:{open:e,onOpenChange:t,setTriggerRef:o,titleId:s,descriptionId:i,variant:r},children:n})},Is=y.forwardRef(({children:e,asChild:t=!1,onClick:n,...r},o)=>{const{onOpenChange:s,setTriggerRef:i}=cn(),c={...r,ref:l=>{i(l),typeof o=="function"?o(l):o&&(o.current=l)},onClick:l=>{s(!0),n==null||n(l)}};return t&&y.isValidElement(e)?y.cloneElement(e,c):p.jsx("button",{...c,children:e})});Is.displayName="DialogTrigger";const BA={hidden:{opacity:0,scale:.92},visible:{opacity:1,scale:1,transition:{duration:.3,ease:[.2,0,0,1.1]}},exit:{opacity:0,scale:.95,transition:{duration:.2,ease:[.4,0,1,1]}}},WA={hidden:{y:"100%",opacity:0},visible:{y:"0%",opacity:1,transition:{duration:.35,ease:[.2,.7,.1,1]}},exit:{y:"50%",opacity:0,transition:{duration:.2,ease:[.2,.2,.5,1]}}},$A={hidden:{opacity:0},visible:{opacity:1,transition:{duration:.25,ease:[.25,.46,.45,.94]}},exit:{opacity:0,transition:{duration:.2,ease:[.25,.46,.45,.94]}}},HA={hidden:{opacity:0},visible:{opacity:1,transition:{duration:.25,ease:[.4,0,.2,1]}},exit:{opacity:0,transition:{duration:.2,ease:[.4,0,1,1]}}},jA={hidden:{opacity:0,y:8},visible:{opacity:1,y:0,transition:{duration:.25,delay:.1,ease:[.4,0,.2,1]}}},_s=y.forwardRef(({className:e,children:t,shape:n="minimal",...r},o)=>{const{open:s,onOpenChange:i,titleId:a,descriptionId:c,variant:l}=cn();y.useEffect(()=>(s&&(document.body.style.overflow="hidden",l==="fullscreen"&&(document.body.style.overscrollBehavior="none")),()=>{document.body.style.overflow="",document.body.style.overscrollBehavior=""}),[s,l]);const u=l==="fullscreen",d=u?HA:$A;return p.jsx(RA,{children:p.jsx(Kn,{mode:"wait",children:s&&p.jsx(pA,{active:s,focusTrapOptions:{onDeactivate:()=>i(!1),escapeDeactivates:!0,allowOutsideClick:!0},children:p.jsxs("div",{ref:o,className:H("fixed inset-0 z-50 flex",!u&&"items-center justify-center p-4 sm:p-8",u&&"items-end sm:items-center sm:justify-center sm:p-8"),...r,children:[p.jsx(we.div,{initial:"hidden",animate:"visible",exit:"exit",variants:d,className:H("absolute inset-0",u?"bg-black/32":"bg-black/50"),onClick:()=>i(!1),style:{willChange:"opacity"}}),p.jsx(we.div,{role:"dialog","aria-modal":"true","aria-labelledby":a,"aria-describedby":c,variants:u?WA:BA,initial:"hidden",animate:"visible",exit:"exit",className:H("relative z-10 flex flex-col",u?["w-full bg-white shadow-2xl","h-full sm:max-h-[90vh] sm:w-full sm:max-w-2xl","sm:rounded-3xl","overflow-hidden"]:"w-full max-w-lg",e),style:{willChange:"transform, opacity",backfaceVisibility:"hidden",transform:"translate3d(0, 0, 0)"},children:u?p.jsx(we.div,{className:"flex h-full flex-col",initial:"hidden",animate:"visible",variants:jA,style:{willChange:"opacity",transform:"translate3d(0, 0, 0)"},children:t}):p.jsx(ec,{shape:n,className:"relative w-full shadow-2xl",children:t})})]})})})})});_s.displayName="DialogContent";const Dg=y.forwardRef(({children:e,asChild:t=!1,onClick:n,...r},o)=>{const{onOpenChange:s}=cn(),i={...r,ref:o,onClick:a=>{s(!1),n==null||n(a)}};return t&&y.isValidElement(e)?y.cloneElement(e,i):p.jsx("button",{...i,children:e})});Dg.displayName="DialogClose";const Fc=e=>{const{variant:t}=cn();return p.jsx("div",{className:H(t==="basic"&&"flex flex-col space-y-1.5 text-center sm:text-left",t==="fullscreen"&&["flex flex-shrink-0 flex-row items-center justify-between","px-6 py-4 sm:px-8 sm:py-6","bg-white","border-b border-gray-200/60"],e.className),style:{...t==="fullscreen"&&{willChange:"transform",transform:"translate3d(0, 0, 0)"}},...e})};Fc.displayName="DialogHeader";const Lc=e=>{const{variant:t}=cn();return p.jsx("div",{className:H(t==="basic"&&"mt-6 flex gap-2 sm:justify-end",t==="fullscreen"&&["flex flex-shrink-0 flex-row justify-end gap-3","px-6 py-4 sm:px-8 sm:py-6","bg-white","border-t border-gray-200/60"],e.className),style:{...t==="fullscreen"&&{willChange:"transform",transform:"translate3d(0, 0, 0)"}},...e})};Lc.displayName="DialogFooter";const Vc=y.forwardRef((e,t)=>{const{titleId:n,variant:r}=cn();return p.jsx("h2",{ref:t,id:n,className:H("font-semibold tracking-tight",r==="fullscreen"?"text-2xl sm:text-3xl":"text-xl"),...e})});Vc.displayName="DialogTitle";const Mg=y.forwardRef((e,t)=>{const{descriptionId:n}=cn();return p.jsx(An,{variant:"muted",ref:t,id:n,...e})});Mg.displayName="DialogDescription";const Og=y.forwardRef(({className:e,children:t,elasticity:n=!0,pullToRefresh:r,onRefresh:o,...s},i)=>{const{variant:a}=cn();return a==="fullscreen"?p.jsx(Eg,{ref:i,className:H("flex-1 pt-0!","px-6 py-4 sm:px-8 sm:py-6 transition-all",e),elasticity:n,pullToRefresh:r,onRefresh:o,...s,children:t}):p.jsx("div",{ref:i,className:H("flex-1",e),...s,children:t})});Og.displayName="DialogBody";const Ng=Me("flex items-center transition-all duration-200 w-full",{variants:{variant:{primary:"bg-graphite-card border-2 px-4",secondary:"bg-graphite-secondary border-2 px-4",minimal:"bg-transparent p-0"},shape:{full:"rounded-4xl",minimal:"rounded-2xl",sharp:"rounded-none"},size:{sm:"h-10 text-sm",md:"h-12 text-base",lg:"h-14 text-lg"},isErrored:{true:""},isFocused:{true:""},disabled:{true:"bg-graphite-secondary opacity-50 cursor-not-allowed"}},compoundVariants:[{variant:"primary",isErrored:!1,isFocused:!1,className:"border-graphite-border"},{variant:"primary",isFocused:!0,isErrored:!1,className:"border-graphite-primary"},{variant:"primary",isErrored:!0,className:"border-red-500"},{variant:"primary",isFocused:!0,isErrored:!0,className:"border-red-600"},{variant:"secondary",isErrored:!1,isFocused:!1,className:"border-transparent"},{variant:"secondary",isFocused:!0,isErrored:!1,className:"border-graphite-primary"},{variant:"secondary",isErrored:!0,className:"border-red-500"},{variant:"secondary",isFocused:!0,isErrored:!0,className:"border-red-600"},{variant:"minimal",className:"rounded-none border-0"}],defaultVariants:{variant:"primary",shape:"minimal",size:"md"}}),ro=y.forwardRef(({className:e,id:t,label:n,startAdornment:r,endAdornment:o,error:s,disabled:i,shape:a,size:c,wrapperClassName:l,variant:u,onFocus:d,onBlur:f,onKeyDown:h,onPaste:v,type:g,...w},b)=>{const S=y.useId(),x=t||S,C=!!s,[E,D]=y.useState(!1),T=_=>{D(!0),d==null||d(_)},P=_=>{D(!1),f==null||f(_)},M=_=>{if(g==="number"){const{value:V}=_.currentTarget,O=["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","Home","End"];if(_.key==="."&&!V.includes(".")||O.includes(_.key)||_.ctrlKey||_.metaKey)return;/^[0-9]$/.test(_.key)||_.preventDefault()}h==null||h(_)},N=_=>{if(g==="number"){const V=_.clipboardData.getData("text");/^\d*\.?\d*$/.test(V)||_.preventDefault()}v==null||v(_)};return p.jsxs("div",{className:"w-full flex flex-col gap-2",children:[n&&p.jsx("label",{htmlFor:x,className:"block text-sm font-medium text-graphite-primary",children:n}),p.jsxs("div",{className:Ng({variant:u,shape:a,size:c,isErrored:C,isFocused:E,disabled:i,className:l}),children:[r&&p.jsx("div",{className:"flex items-center mr-2",children:r}),p.jsx("input",{id:x,ref:b,disabled:i,type:g,onFocus:T,onBlur:P,onKeyDown:M,onPaste:N,className:H("w-full flex-1 bg-transparent focus:outline-none","disabled:cursor-not-allowed",u==="secondary"&&"placeholder:text-gray-500",e),...w}),o&&p.jsx("div",{className:"flex items-center ml-2",children:o})]}),C&&p.jsx("p",{className:"mt-2 text-sm text-red-600",children:s})]})});ro.displayName="Input";const YA=({mode:e,selectedDate:t,selectedRange:n,onEditClick:r})=>{const o=()=>t?Ue(t,"E, MMM d"):"Select date",s=()=>n!=null&&n.from?n.from&&!n.to?Ue(n.from,"MMM d"):n.from&&n.to?`${Ue(n.from,"MMM d")} – ${Ue(n.to,"MMM d")}`:"Select dates":"Select dates";return p.jsxs("div",{className:"flex items-center justify-between pt-6 px-0 pb-2",children:[p.jsxs("div",{children:[e==="range"&&p.jsx(An,{variant:"muted",children:"Depart – Return dates"}),p.jsx(An,{variant:"h2",className:"!mt-0",children:e==="single"?o():s()})]}),p.jsx(rr,{variant:"ghost",size:"md","aria-label":"Enter date manually",onClick:r,children:p.jsx(eE,{className:"h-5 w-5"})})]})},Rc=e=>e?e.toLocaleDateString("en-US",{month:"2-digit",day:"2-digit",year:"numeric"}):"",Bc=e=>e&&typeof e=="object"&&"from"in e,UA=({mode:e,value:t,onValueChange:n,onCalendarClick:r})=>{const[o,s]=y.useState(""),[i,a]=y.useState(""),[c,l]=y.useState(""),[u,d]=y.useState("");y.useEffect(()=>{e==="single"?s(Rc(t)):Bc(t)?(s(Rc(t.from)),a(Rc(t.to))):(s(""),a(""))},[t,e]);const f=g=>{if(!g)return;const w=hD(g,"P",new Date);return Yh(w)?w:null},h=g=>{const w=g.target.value;s(w);const b=f(w);if(b===null)l("Invalid date");else if(l(""),e==="single")n(b);else{const S=Bc(t)?t.to:void 0;n({from:b,to:S})}},v=g=>{const w=g.target.value;a(w);const b=f(w);if(b===null)d("Invalid date");else{d("");const S=Bc(t)?t.from:void 0;n({from:S,to:b})}};return p.jsxs("div",{className:"p-4",children:[p.jsx(An,{variant:"muted",children:"Select date"}),p.jsxs("div",{className:"flex items-center justify-between mt-2 mb-6",children:[p.jsx(An,{variant:"h2",className:"!mt-0",children:"Enter date"}),p.jsx(rr,{variant:"ghost",size:"md",onClick:r,"aria-label":"Switch to calendar view",children:p.jsx(Ph,{className:"h-6 w-6"})})]}),p.jsxs("div",{className:"space-y-4",children:[p.jsx(ro,{label:e==="single"?"Date":"Start date",value:o,onChange:h,placeholder:"mm/dd/yyyy",error:c,autoFocus:!0}),e==="range"&&p.jsx(ro,{label:"End date",value:i,onChange:v,placeholder:"mm/dd/yyyy",error:u})]})]})},zA=(e,t,n="single")=>{const r=Kh(e),o=Uh(e),s=Dt(r),i=Wa(o);return{daysInMonth:y.useMemo(()=>xE({start:s,end:i}),[s,i]),weekdays:["S","M","T","W","T","F","S"],getDayProps:l=>{const u=n==="range"&&t&&"from"in t,d=n==="single"&&t instanceof Date&&En(l,t)||u&&(t.from&&En(l,t.from)||t.to&&En(l,t.to)),f=u&&t.from&&En(l,t.from),h=u&&t.to&&En(l,t.to),v=u&&t.from&&t.to&&np(l,t.from)&&rp(l,t.to);return{isCurrentMonth:cp(l,e),isToday:gD(l),isSelected:d,isRangeStart:f,isRangeEnd:h,isInRange:v}}}},Ag=({mode:e,value:t,onSelect:n})=>{const r=e==="single"?t:t==null?void 0:t.from,[o,s]=y.useState(r||new Date),[i,a]=y.useState("day"),[c,l]=y.useState(0),{daysInMonth:u,weekdays:d,getDayProps:f}=zA(o,t,e),h=y.useMemo(()=>Array.from({length:12},(T,P)=>Ue(new Date(0,P),"MMM")),[]),v=y.useMemo(()=>{const T=Math.floor(o.getFullYear()/12)*12;return Array.from({length:12},(P,M)=>T+M)},[o]),g=T=>{l(T),i==="day"?s(P=>Wh(P,{months:T})):i==="year"&&s(P=>Wh(P,{years:T*12}))},w=(T,P)=>{P.offset.x>50?g(-1):P.offset.x<-50&&g(1)},b=T=>{if(e==="single")n(T);else{const P=t&&"from"in t?t:{};!P.from||P.from&&P.to?n({from:T,to:void 0}):n({from:T>P.from?P.from:T,to:T>P.from?T:P.from})}},S=T=>{s(up(o,{month:T})),a("day")},x=T=>{s(up(o,{year:T})),a("month")},C=()=>{a(i==="day"?"year":i==="year"?"month":"day")},E={enter:T=>({opacity:0,x:T>0?"100%":"-100%"}),center:{opacity:1,x:"0%"},exit:T=>({opacity:0,x:T<0?"100%":"-100%"})},D=new Date;return p.jsxs("div",{className:"p-0 w-full max-w-sm mx-auto",children:[p.jsxs("div",{className:"flex items-center justify-between mb-4 px-1",children:[p.jsxs("button",{type:"button",onClick:C,className:"text-base font-semibold hover:bg-graphite-secondary px-2 py-1 rounded-lg transition-colors",children:[i==="day"&&Ue(o,"MMMM yyyy"),i==="month"&&Ue(o,"yyyy"),i==="year"&&`${v[0]} - ${v[11]}`]}),(i==="day"||i==="year")&&p.jsxs("div",{className:"flex items-center ",children:[p.jsx(rr,{variant:"ghost",size:"sm",onClick:()=>g(-1),"aria-label":"Previous",children:p.jsx(QT,{className:"h-5 w-5"})}),p.jsx(rr,{variant:"ghost",size:"sm",onClick:()=>g(1),"aria-label":"Next",children:p.jsx(Mh,{className:"h-5 w-5"})})]})]}),p.jsx("div",{className:"relative overflow-hidden h-72",children:p.jsxs(Kn,{initial:!1,custom:c,children:[i==="day"&&p.jsxs(we.div,{custom:c,variants:E,initial:"enter",animate:"center",exit:"exit",drag:"x",dragConstraints:{left:0,right:0},onDragEnd:w,transition:{type:"spring",stiffness:400,damping:40},className:"grid grid-cols-7 text-center absolute w-full cursor-grab active:cursor-grabbing",children:[d.map((T,P)=>p.jsx("div",{className:"w-10 h-10 flex items-center justify-center text-sm font-medium text-gray-500",children:T},`${T}-${P}`)),u.map(T=>{const{isCurrentMonth:P,isToday:M,isSelected:N,isRangeStart:_,isRangeEnd:V,isInRange:O}=f(T);return p.jsx("div",{className:H("h-10 flex items-center justify-center",O&&"bg-graphite-secondary",_&&"bg-graphite-secondary rounded-l-full",V&&"bg-graphite-secondary rounded-r-full"),children:p.jsx("button",{type:"button",onClick:()=>b(T),disabled:!P,className:H("w-10 h-10 flex items-center justify-center rounded-full transition-colors text-sm","focus:outline-none focus:ring-2 focus:ring-graphite-ring focus:ring-offset-1",!P&&"text-gray-400 pointer-events-none",!N&&!O&&"hover:bg-graphite-secondary",M&&!N&&"font-bold ring-1 ring-graphite-primary",N&&"bg-graphite-primary text-graphite-primaryForeground"),children:Ue(T,"d")})},T.toISOString())})]},Ue(o,"yyyy-MM")),i==="month"&&p.jsx(we.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{duration:.2},className:"grid grid-cols-3 absolute w-full",children:h.map((T,P)=>{const M=P===o.getMonth(),N=P===D.getMonth()&&o.getFullYear()===D.getFullYear();return p.jsx("button",{type:"button",onClick:()=>S(P),className:H("h-16 flex items-center justify-center rounded-xl transition-colors text-sm font-semibold","focus:outline-none focus:ring-2 focus:ring-graphite-ring focus:ring-offset-1",M?"bg-graphite-primary text-graphite-primaryForeground":"hover:bg-graphite-secondary",N&&!M&&"ring-1 ring-graphite-primary"),children:T},T)})},"month-view"),i==="year"&&p.jsx(we.div,{custom:c,variants:E,initial:"enter",animate:"center",exit:"exit",drag:"x",dragConstraints:{left:0,right:0},onDragEnd:w,transition:{type:"spring",stiffness:400,damping:40},className:"grid grid-cols-3 absolute w-full cursor-grab active:cursor-grabbing",children:v.map(T=>{const P=T===o.getFullYear(),M=T===D.getFullYear();return p.jsx("button",{type:"button",onClick:()=>x(T),className:H("h-16 flex items-center justify-center rounded-xl transition-colors text-sm font-semibold","focus:outline-none focus:ring-2 focus:ring-graphite-ring focus:ring-offset-1",P?"bg-graphite-primary text-graphite-primaryForeground":"hover:bg-graphite-secondary",M&&!P&&"ring-1 ring-graphite-primary"),children:T},T)})},v[0])]})})]})},KA=({value:e,onChange:t,mode:n="single",placeholder:r="Pick a date",variant:o,...s})=>{const[i,a]=y.useState(!1),[c,l]=y.useState(!1),u=ys("(max-width: 767px)"),d=o||(u?"fullscreen":"docked"),[f,h]=y.useState(e),v=e?n==="single"&&e instanceof Date?Ue(e,"MMMM dd, yyyy"):n==="range"&&"from"in e?e.from&&e.to?`${Ue(e.from,"MMM d")} - ${Ue(e.to,"MMM d")}`:e.from?Ue(e.from,"MMMM dd, yyyy"):"":"":"",g=()=>{t==null||t(f),a(!1),l(!1)},w=x=>{x&&h(e),a(x),x||l(!1)},b=p.jsx("div",{className:"cursor-pointer",children:p.jsx(ro,{readOnly:!0,value:v,placeholder:r,endAdornment:p.jsx(Ph,{className:"h-4 w-4 text-gray-500"}),className:"cursor-pointer",...s})});if(d==="docked")return p.jsxs(NN,{open:i,onOpenChange:w,children:[p.jsx(AN,{asChild:!0,children:b}),p.jsx(kN,{children:p.jsx(IN,{sideOffset:8,className:H("z-50 min-w-[320px] w-full p-4 bg-graphite-card rounded-xl border border-graphite-border shadow-lg","data-[state=open]:animate-menu-enter data-[state=closed]:animate-menu-exit"),children:p.jsx(Ag,{mode:n,value:e,onSelect:x=>{t==null||t(x),a(!1)}})})})]});const S=p.jsxs(_s,{shape:"full",className:"!p-0 max-w-sm",children:[c?p.jsx(UA,{mode:n,value:f,onValueChange:h,onCalendarClick:()=>l(!1)}):p.jsx(YA,{mode:n,selectedDate:f,selectedRange:f,onEditClick:()=>l(!0)}),!c&&p.jsx(Ag,{mode:n,value:f,onSelect:h}),p.jsxs("div",{className:"flex justify-end gap-2 ",children:[p.jsx(er,{variant:"ghost",onClick:()=>w(!1),children:"Cancel"}),p.jsx(er,{variant:"ghost",onClick:g,children:"OK"})]})]});return d==="modal"?p.jsxs(_c,{open:i,onOpenChange:w,variant:"basic",children:[p.jsx(Is,{asChild:!0,children:b}),S]}):null};function Wc(e){const t=e+"CollectionProvider",[n,r]=Ct(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=g=>{const{scope:w,children:b}=g,S=y.useRef(null),x=y.useRef(new Map).current;return p.jsx(o,{scope:w,itemMap:x,collectionRef:S,children:b})};i.displayName=t;const a=e+"CollectionSlot",c=en(a),l=y.forwardRef((g,w)=>{const{scope:b,children:S}=g,x=s(a,b),C=fe(w,x.collectionRef);return p.jsx(c,{ref:C,children:S})});l.displayName=a;const u=e+"CollectionItemSlot",d="data-radix-collection-item",f=en(u),h=y.forwardRef((g,w)=>{const{scope:b,children:S,...x}=g,C=y.useRef(null),E=fe(w,C),D=s(u,b);return y.useEffect(()=>(D.itemMap.set(C,{ref:C,...x}),()=>void D.itemMap.delete(C))),p.jsx(f,{[d]:"",ref:E,children:S})});h.displayName=u;function v(g){const w=s(e+"CollectionConsumer",g);return y.useCallback(()=>{const S=w.collectionRef.current;if(!S)return[];const x=Array.from(S.querySelectorAll(`[${d}]`));return Array.from(w.itemMap.values()).sort((D,T)=>x.indexOf(D.ref.current)-x.indexOf(T.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:i,Slot:l,ItemSlot:h},v,r]}var $c="rovingFocusGroup.onEntryFocus",GA={bubbles:!1,cancelable:!0},oo="RovingFocusGroup",[Hc,kg,qA]=Wc(oo),[XA,Ig]=Ct(oo,[qA]),[ZA,QA]=XA(oo),_g=m.forwardRef((e,t)=>p.jsx(Hc.Provider,{scope:e.__scopeRovingFocusGroup,children:p.jsx(Hc.Slot,{scope:e.__scopeRovingFocusGroup,children:p.jsx(JA,{...e,ref:t})})}));_g.displayName=oo;var JA=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),h=fe(t,f),v=Ds(s),[g,w]=Mn({prop:i,defaultProp:a??null,onChange:c,caller:oo}),[b,S]=m.useState(!1),x=Fe(l),C=kg(n),E=m.useRef(!1),[D,T]=m.useState(0);return m.useEffect(()=>{const P=f.current;if(P)return P.addEventListener($c,x),()=>P.removeEventListener($c,x)},[x]),p.jsx(ZA,{scope:n,orientation:r,dir:v,loop:o,currentTabStopId:g,onItemFocus:m.useCallback(P=>w(P),[w]),onItemShiftTab:m.useCallback(()=>S(!0),[]),onFocusableItemAdd:m.useCallback(()=>T(P=>P+1),[]),onFocusableItemRemove:m.useCallback(()=>T(P=>P-1),[]),children:p.jsx(ce.div,{tabIndex:b||D===0?-1:0,"data-orientation":r,...d,ref:h,style:{outline:"none",...e.style},onMouseDown:K(e.onMouseDown,()=>{E.current=!0}),onFocus:K(e.onFocus,P=>{const M=!E.current;if(P.target===P.currentTarget&&M&&!b){const N=new CustomEvent($c,GA);if(P.currentTarget.dispatchEvent(N),!N.defaultPrevented){const _=C().filter(R=>R.focusable),V=_.find(R=>R.active),O=_.find(R=>R.id===g),L=[V,O,..._].filter(Boolean).map(R=>R.ref.current);Vg(L,u)}}E.current=!1}),onBlur:K(e.onBlur,()=>S(!1))})})}),Fg="RovingFocusGroupItem",Lg=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,children:i,...a}=e,c=ot(),l=s||c,u=QA(Fg,n),d=u.currentTabStopId===l,f=kg(n),{onFocusableItemAdd:h,onFocusableItemRemove:v,currentTabStopId:g}=u;return m.useEffect(()=>{if(r)return h(),()=>v()},[r,h,v]),p.jsx(Hc.ItemSlot,{scope:n,id:l,focusable:r,active:o,children:p.jsx(ce.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...a,ref:t,onMouseDown:K(e.onMouseDown,w=>{r?u.onItemFocus(l):w.preventDefault()}),onFocus:K(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:K(e.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){u.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const b=nk(w,u.orientation,u.dir);if(b!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let x=f().filter(C=>C.focusable).map(C=>C.ref.current);if(b==="last")x.reverse();else if(b==="prev"||b==="next"){b==="prev"&&x.reverse();const C=x.indexOf(w.currentTarget);x=u.loop?rk(x,C+1):x.slice(C+1)}setTimeout(()=>Vg(x))}}),children:typeof i=="function"?i({isCurrentTabStop:d,hasTabStop:g!=null}):i})})});Lg.displayName=Fg;var ek={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function tk(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function nk(e,t,n){const r=tk(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return ek[r]}function Vg(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function rk(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var ok=_g,sk=Lg,jc=["Enter"," "],ik=["ArrowDown","PageUp","Home"],Rg=["ArrowUp","PageDown","End"],ak=[...ik,...Rg],ck={ltr:[...jc,"ArrowRight"],rtl:[...jc,"ArrowLeft"]},lk={ltr:["ArrowLeft"],rtl:["ArrowRight"]},so="Menu",[io,uk,dk]=Wc(so),[kn,Bg]=Ct(so,[dk,ar,Ig]),ao=ar(),Wg=Ig(),[$g,ln]=kn(so),[fk,co]=kn(so),Hg=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:i=!0}=e,a=ao(t),[c,l]=m.useState(null),u=m.useRef(!1),d=Fe(s),f=Ds(o);return m.useEffect(()=>{const h=()=>{u.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>u.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),p.jsx(is,{...a,children:p.jsx($g,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:p.jsx(fk,{scope:t,onClose:m.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:i,children:r})})})};Hg.displayName=so;var hk="MenuAnchor",Yc=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=ao(n);return p.jsx(as,{...o,...r,ref:t})});Yc.displayName=hk;var Uc="MenuPortal",[pk,jg]=kn(Uc,{forceMount:void 0}),Yg=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=ln(Uc,t);return p.jsx(pk,{scope:t,forceMount:n,children:p.jsx(Ke,{present:n||s.open,children:p.jsx(Qr,{asChild:!0,container:o,children:r})})})};Yg.displayName=Uc;var at="MenuContent",[mk,zc]=kn(at),Ug=m.forwardRef((e,t)=>{const n=jg(at,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=ln(at,e.__scopeMenu),i=co(at,e.__scopeMenu);return p.jsx(io.Provider,{scope:e.__scopeMenu,children:p.jsx(Ke,{present:r||s.open,children:p.jsx(io.Slot,{scope:e.__scopeMenu,children:i.modal?p.jsx(gk,{...o,ref:t}):p.jsx(vk,{...o,ref:t})})})})}),gk=m.forwardRef((e,t)=>{const n=ln(at,e.__scopeMenu),r=m.useRef(null),o=fe(t,r);return m.useEffect(()=>{const s=r.current;if(s)return ds(s)},[]),p.jsx(Kc,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:K(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),vk=m.forwardRef((e,t)=>{const n=ln(at,e.__scopeMenu);return p.jsx(Kc,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),yk=en("MenuContent.ScrollLock"),Kc=m.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:h,disableOutsideScroll:v,...g}=e,w=ln(at,n),b=co(at,n),S=ao(n),x=Wg(n),C=uk(n),[E,D]=m.useState(null),T=m.useRef(null),P=fe(t,T,w.onContentChange),M=m.useRef(0),N=m.useRef(""),_=m.useRef(0),V=m.useRef(null),O=m.useRef("right"),A=m.useRef(0),L=v?Jr:m.Fragment,R=v?{as:yk,allowPinchZoom:!0}:void 0,F=I=>{var Y,J;const B=N.current+I,U=C().filter(te=>!te.disabled),j=document.activeElement,X=(Y=U.find(te=>te.ref.current===j))==null?void 0:Y.textValue,se=U.map(te=>te.textValue),ne=Nk(se,B,X),ie=(J=U.find(te=>te.textValue===ne))==null?void 0:J.ref.current;(function te(le){N.current=le,window.clearTimeout(M.current),le!==""&&(M.current=window.setTimeout(()=>te(""),1e3))})(B),ie&&setTimeout(()=>ie.focus())};m.useEffect(()=>()=>window.clearTimeout(M.current),[]),Go();const k=m.useCallback(I=>{var U,j;return O.current===((U=V.current)==null?void 0:U.side)&&kk(I,(j=V.current)==null?void 0:j.area)},[]);return p.jsx(mk,{scope:n,searchRef:N,onItemEnter:m.useCallback(I=>{k(I)&&I.preventDefault()},[k]),onItemLeave:m.useCallback(I=>{var B;k(I)||((B=T.current)==null||B.focus(),D(null))},[k]),onTriggerLeave:m.useCallback(I=>{k(I)&&I.preventDefault()},[k]),pointerGraceTimerRef:_,onPointerGraceIntentChange:m.useCallback(I=>{V.current=I},[]),children:p.jsx(L,{...R,children:p.jsx(qr,{asChild:!0,trapped:o,onMountAutoFocus:K(s,I=>{var B;I.preventDefault(),(B=T.current)==null||B.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:p.jsx(Gr,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:h,children:p.jsx(ok,{asChild:!0,...x,dir:b.dir,orientation:"vertical",loop:r,currentTabStopId:E,onCurrentTabStopIdChange:D,onEntryFocus:K(c,I=>{b.isUsingKeyboardRef.current||I.preventDefault()}),preventScrollOnEntryFocus:!0,children:p.jsx(wc,{role:"menu","aria-orientation":"vertical","data-state":lv(w.open),"data-radix-menu-content":"",dir:b.dir,...S,...g,ref:P,style:{outline:"none",...g.style},onKeyDown:K(g.onKeyDown,I=>{const U=I.target.closest("[data-radix-menu-content]")===I.currentTarget,j=I.ctrlKey||I.altKey||I.metaKey,X=I.key.length===1;U&&(I.key==="Tab"&&I.preventDefault(),!j&&X&&F(I.key));const se=T.current;if(I.target!==se||!ak.includes(I.key))return;I.preventDefault();const ie=C().filter(Y=>!Y.disabled).map(Y=>Y.ref.current);Rg.includes(I.key)&&ie.reverse(),Mk(ie)}),onBlur:K(e.onBlur,I=>{I.currentTarget.contains(I.target)||(window.clearTimeout(M.current),N.current="")}),onPointerMove:K(e.onPointerMove,uo(I=>{const B=I.target,U=A.current!==I.clientX;if(I.currentTarget.contains(B)&&U){const j=I.clientX>A.current?"right":"left";O.current=j,A.current=I.clientX}}))})})})})})})});Ug.displayName=at;var wk="MenuGroup",Gc=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return p.jsx(ce.div,{role:"group",...r,ref:t})});Gc.displayName=wk;var bk="MenuLabel",zg=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return p.jsx(ce.div,{...r,ref:t})});zg.displayName=bk;var Fs="MenuItem",Kg="menu.itemSelect",Ls=m.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,s=m.useRef(null),i=co(Fs,e.__scopeMenu),a=zc(Fs,e.__scopeMenu),c=fe(t,s),l=m.useRef(!1),u=()=>{const d=s.current;if(!n&&d){const f=new CustomEvent(Kg,{bubbles:!0,cancelable:!0});d.addEventListener(Kg,h=>r==null?void 0:r(h),{once:!0}),lh(d,f),f.defaultPrevented?l.current=!1:i.onClose()}};return p.jsx(Gg,{...o,ref:c,disabled:n,onClick:K(e.onClick,u),onPointerDown:d=>{var f;(f=e.onPointerDown)==null||f.call(e,d),l.current=!0},onPointerUp:K(e.onPointerUp,d=>{var f;l.current||(f=d.currentTarget)==null||f.click()}),onKeyDown:K(e.onKeyDown,d=>{const f=a.searchRef.current!=="";n||f&&d.key===" "||jc.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});Ls.displayName=Fs;var Gg=m.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...s}=e,i=zc(Fs,n),a=Wg(n),c=m.useRef(null),l=fe(t,c),[u,d]=m.useState(!1),[f,h]=m.useState("");return m.useEffect(()=>{const v=c.current;v&&h((v.textContent??"").trim())},[s.children]),p.jsx(io.ItemSlot,{scope:n,disabled:r,textValue:o??f,children:p.jsx(sk,{asChild:!0,...a,focusable:!r,children:p.jsx(ce.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:l,onPointerMove:K(e.onPointerMove,uo(v=>{r?i.onItemLeave(v):(i.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:K(e.onPointerLeave,uo(v=>i.onItemLeave(v))),onFocus:K(e.onFocus,()=>d(!0)),onBlur:K(e.onBlur,()=>d(!1))})})})}),xk="MenuCheckboxItem",qg=m.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return p.jsx(ev,{scope:e.__scopeMenu,checked:n,children:p.jsx(Ls,{role:"menuitemcheckbox","aria-checked":Vs(n)?"mixed":n,...o,ref:t,"data-state":Zc(n),onSelect:K(o.onSelect,()=>r==null?void 0:r(Vs(n)?!0:!n),{checkForDefaultPrevented:!1})})})});qg.displayName=xk;var Xg="MenuRadioGroup",[Sk,Ck]=kn(Xg,{value:void 0,onValueChange:()=>{}}),Zg=m.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,s=Fe(r);return p.jsx(Sk,{scope:e.__scopeMenu,value:n,onValueChange:s,children:p.jsx(Gc,{...o,ref:t})})});Zg.displayName=Xg;var Qg="MenuRadioItem",Jg=m.forwardRef((e,t)=>{const{value:n,...r}=e,o=Ck(Qg,e.__scopeMenu),s=n===o.value;return p.jsx(ev,{scope:e.__scopeMenu,checked:s,children:p.jsx(Ls,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":Zc(s),onSelect:K(r.onSelect,()=>{var i;return(i=o.onValueChange)==null?void 0:i.call(o,n)},{checkForDefaultPrevented:!1})})})});Jg.displayName=Qg;var qc="MenuItemIndicator",[ev,Tk]=kn(qc,{checked:!1}),tv=m.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,s=Tk(qc,n);return p.jsx(Ke,{present:r||Vs(s.checked)||s.checked===!0,children:p.jsx(ce.span,{...o,ref:t,"data-state":Zc(s.checked)})})});tv.displayName=qc;var Ek="MenuSeparator",nv=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return p.jsx(ce.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});nv.displayName=Ek;var Pk="MenuArrow",rv=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=ao(n);return p.jsx(bc,{...o,...r,ref:t})});rv.displayName=Pk;var Xc="MenuSub",[Dk,ov]=kn(Xc),sv=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:o}=e,s=ln(Xc,t),i=ao(t),[a,c]=m.useState(null),[l,u]=m.useState(null),d=Fe(o);return m.useEffect(()=>(s.open===!1&&d(!1),()=>d(!1)),[s.open,d]),p.jsx(is,{...i,children:p.jsx($g,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:p.jsx(Dk,{scope:t,contentId:ot(),triggerId:ot(),trigger:a,onTriggerChange:c,children:n})})})};sv.displayName=Xc;var lo="MenuSubTrigger",iv=m.forwardRef((e,t)=>{const n=ln(lo,e.__scopeMenu),r=co(lo,e.__scopeMenu),o=ov(lo,e.__scopeMenu),s=zc(lo,e.__scopeMenu),i=m.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:c}=s,l={__scopeMenu:e.__scopeMenu},u=m.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return m.useEffect(()=>u,[u]),m.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),c(null)}},[a,c]),p.jsx(Yc,{asChild:!0,...l,children:p.jsx(Gg,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":lv(n.open),...e,ref:Ho(t,o.onTriggerChange),onClick:d=>{var f;(f=e.onClick)==null||f.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:K(e.onPointerMove,uo(d=>{s.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(s.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:K(e.onPointerLeave,uo(d=>{var h,v;u();const f=(h=n.content)==null?void 0:h.getBoundingClientRect();if(f){const g=(v=n.content)==null?void 0:v.dataset.side,w=g==="right",b=w?-5:5,S=f[w?"left":"right"],x=f[w?"right":"left"];s.onPointerGraceIntentChange({area:[{x:d.clientX+b,y:d.clientY},{x:S,y:f.top},{x,y:f.top},{x,y:f.bottom},{x:S,y:f.bottom}],side:g}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(d),d.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:K(e.onKeyDown,d=>{var h;const f=s.searchRef.current!=="";e.disabled||f&&d.key===" "||ck[r.dir].includes(d.key)&&(n.onOpenChange(!0),(h=n.content)==null||h.focus(),d.preventDefault())})})})});iv.displayName=lo;var av="MenuSubContent",cv=m.forwardRef((e,t)=>{const n=jg(at,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=ln(at,e.__scopeMenu),i=co(at,e.__scopeMenu),a=ov(av,e.__scopeMenu),c=m.useRef(null),l=fe(t,c);return p.jsx(io.Provider,{scope:e.__scopeMenu,children:p.jsx(Ke,{present:r||s.open,children:p.jsx(io.Slot,{scope:e.__scopeMenu,children:p.jsx(Kc,{id:a.contentId,"aria-labelledby":a.triggerId,...o,ref:l,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var d;i.isUsingKeyboardRef.current&&((d=c.current)==null||d.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:K(e.onFocusOutside,u=>{u.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:K(e.onEscapeKeyDown,u=>{i.onClose(),u.preventDefault()}),onKeyDown:K(e.onKeyDown,u=>{var h;const d=u.currentTarget.contains(u.target),f=lk[i.dir].includes(u.key);d&&f&&(s.onOpenChange(!1),(h=a.trigger)==null||h.focus(),u.preventDefault())})})})})})});cv.displayName=av;function lv(e){return e?"open":"closed"}function Vs(e){return e==="indeterminate"}function Zc(e){return Vs(e)?"indeterminate":e?"checked":"unchecked"}function Mk(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Ok(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Nk(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=Ok(e,Math.max(s,0));o.length===1&&(i=i.filter(l=>l!==n));const c=i.find(l=>l.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}function Ak(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],l=a.x,u=a.y,d=c.x,f=c.y;u>r!=f>r&&n<(d-l)*(r-u)/(f-u)+l&&(o=!o)}return o}function kk(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Ak(n,t)}function uo(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Ik=Hg,_k=Yc,Fk=Yg,Lk=Ug,Vk=Gc,Rk=zg,Bk=Ls,Wk=qg,$k=Zg,Hk=Jg,jk=tv,Yk=nv,Uk=rv,zk=sv,Kk=iv,Gk=cv,Rs="DropdownMenu",[qk]=Ct(Rs,[Bg]),We=Bg(),[Xk,uv]=qk(Rs),dv=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:i,modal:a=!0}=e,c=We(t),l=m.useRef(null),[u,d]=Mn({prop:o,defaultProp:s??!1,onChange:i,caller:Rs});return p.jsx(Xk,{scope:t,triggerId:ot(),triggerRef:l,contentId:ot(),open:u,onOpenChange:d,onOpenToggle:m.useCallback(()=>d(f=>!f),[d]),modal:a,children:p.jsx(Ik,{...c,open:u,onOpenChange:d,dir:r,modal:a,children:n})})};dv.displayName=Rs;var fv="DropdownMenuTrigger",hv=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,s=uv(fv,n),i=We(n);return p.jsx(_k,{asChild:!0,...i,children:p.jsx(ce.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:Ho(t,s.triggerRef),onPointerDown:K(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(s.onOpenToggle(),s.open||a.preventDefault())}),onKeyDown:K(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&s.onOpenToggle(),a.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});hv.displayName=fv;var Zk="DropdownMenuPortal",pv=e=>{const{__scopeDropdownMenu:t,...n}=e,r=We(t);return p.jsx(Fk,{...r,...n})};pv.displayName=Zk;var mv="DropdownMenuContent",gv=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=uv(mv,n),s=We(n),i=m.useRef(!1);return p.jsx(Lk,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...r,ref:t,onCloseAutoFocus:K(e.onCloseAutoFocus,a=>{var c;i.current||(c=o.triggerRef.current)==null||c.focus(),i.current=!1,a.preventDefault()}),onInteractOutside:K(e.onInteractOutside,a=>{const c=a.detail.originalEvent,l=c.button===0&&c.ctrlKey===!0,u=c.button===2||l;(!o.modal||u)&&(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)"}})});gv.displayName=mv;var Qk="DropdownMenuGroup",vv=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=We(n);return p.jsx(Vk,{...o,...r,ref:t})});vv.displayName=Qk;var Jk="DropdownMenuLabel",yv=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=We(n);return p.jsx(Rk,{...o,...r,ref:t})});yv.displayName=Jk;var eI="DropdownMenuItem",wv=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=We(n);return p.jsx(Bk,{...o,...r,ref:t})});wv.displayName=eI;var tI="DropdownMenuCheckboxItem",bv=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=We(n);return p.jsx(Wk,{...o,...r,ref:t})});bv.displayName=tI;var nI="DropdownMenuRadioGroup",xv=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=We(n);return p.jsx($k,{...o,...r,ref:t})});xv.displayName=nI;var rI="DropdownMenuRadioItem",Sv=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=We(n);return p.jsx(Hk,{...o,...r,ref:t})});Sv.displayName=rI;var oI="DropdownMenuItemIndicator",Cv=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=We(n);return p.jsx(jk,{...o,...r,ref:t})});Cv.displayName=oI;var sI="DropdownMenuSeparator",Tv=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=We(n);return p.jsx(Yk,{...o,...r,ref:t})});Tv.displayName=sI;var iI="DropdownMenuArrow",aI=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=We(n);return p.jsx(Uk,{...o,...r,ref:t})});aI.displayName=iI;var cI=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:o,defaultOpen:s}=e,i=We(t),[a,c]=Mn({prop:r,defaultProp:s??!1,onChange:o,caller:"DropdownMenuSub"});return p.jsx(zk,{...i,open:a,onOpenChange:c,children:n})},lI="DropdownMenuSubTrigger",Ev=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=We(n);return p.jsx(Kk,{...o,...r,ref:t})});Ev.displayName=lI;var uI="DropdownMenuSubContent",Pv=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=We(n);return p.jsx(Gk,{...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)"}})});Pv.displayName=uI;var dI=dv,fI=hv,Dv=pv,Mv=gv,hI=vv,Ov=yv,Nv=wv,Av=bv,pI=xv,kv=Sv,Iv=Cv,_v=Tv,mI=cI,Fv=Ev,Lv=Pv;const Vv=y.createContext({shape:"minimal"}),pr=()=>y.useContext(Vv),gI=({shape:e="minimal",...t})=>p.jsx(Vv.Provider,{value:{shape:e},children:p.jsx(dI,{...t})}),vI=fI,yI=hI,wI=Dv,bI=mI,xI=pI,Rv=Me(["z-50 min-w-[12rem] max-h-[var(--radix-dropdown-menu-content-available-height)] overflow-y-auto overflow-x-hidden","border border-graphite-border bg-graphite-card p-1.5","shadow-md"],{variants:{shape:{full:"rounded-3xl",minimal:"rounded-xl",sharp:"rounded-none"}},defaultVariants:{shape:"minimal"}}),Bv=y.forwardRef(({className:e,sideOffset:t=8,...n},r)=>{const{shape:o}=pr();return p.jsx(Dv,{children:p.jsx(Mv,{ref:r,sideOffset:t,className:H(Rv({shape:o}),"data-[state=open]:animate-menu-enter","data-[state=closed]:animate-menu-exit","data-[side=top]:origin-bottom","data-[side=bottom]:origin-top","data-[side=left]:origin-right","data-[side=right]:origin-left",e),...n})})});Bv.displayName=Mv.displayName;const Wv=y.forwardRef(({className:e,inset:t,...n},r)=>{const{shape:o}=pr(),s=y.useRef(null),[i,a]=rt({ref:s,color:"rgba(128, 128, 128, 0.1)",duration:400});return y.useImperativeHandle(r,()=>s.current),p.jsx(Nv,{ref:s,onPointerDown:a,className:H("relative flex cursor-pointer select-none items-center gap-2 rounded-lg px-3 py-2.5 text-sm outline-none overflow-hidden","transition-colors duration-150 ease-[cubic-bezier(0.2,0,0,1)]","hover:bg-graphite-secondary/60 focus:bg-graphite-secondary data-[highlighted]:bg-graphite-secondary","focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-graphite-foreground/20","data-[disabled]:pointer-events-none data-[disabled]:opacity-38","[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",o==="sharp"&&"!rounded-none",e),...n})});Wv.displayName=Nv.displayName;const $v=y.forwardRef(({className:e,children:t,...n},r)=>{const{shape:o}=pr(),s=y.useRef(null),[i,a]=rt({ref:s,color:"rgba(128, 128, 128, 0.1)",duration:400});return y.useImperativeHandle(r,()=>s.current),p.jsxs(Av,{ref:s,onPointerDown:a,className:H("relative flex cursor-pointer select-none items-center rounded-lg py-2.5 pl-8 pr-3 text-sm outline-none overflow-hidden","transition-colors duration-150 ease-[cubic-bezier(0.2,0,0,1)]","hover:bg-graphite-secondary/60 focus:bg-graphite-secondary data-[highlighted]:bg-graphite-secondary","focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-graphite-foreground/20","data-[disabled]:pointer-events-none data-[disabled]:opacity-38",o==="sharp"&&"!rounded-none",e),...n,children:[p.jsx("span",{className:"absolute left-2 flex h-4 w-4 items-center justify-center",children:p.jsx(Iv,{children:p.jsx(_a,{className:"h-4 w-4 animate-check-in"})})}),t]})});$v.displayName=Av.displayName;const Hv=y.forwardRef(({className:e,children:t,...n},r)=>{const{shape:o}=pr(),s=y.useRef(null),[i,a]=rt({ref:s,color:"rgba(128, 128, 128, 0.1)",duration:400});return y.useImperativeHandle(r,()=>s.current),p.jsxs(kv,{ref:s,onPointerDown:a,className:H("relative flex cursor-pointer select-none items-center rounded-lg py-2.5 pl-8 pr-3 text-sm outline-none overflow-hidden","transition-colors duration-150 ease-[cubic-bezier(0.2,0,0,1)]","hover:bg-graphite-secondary/60 focus:bg-graphite-secondary data-[highlighted]:bg-graphite-secondary","focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-graphite-foreground/20","data-[disabled]:pointer-events-none data-[disabled]:opacity-38",o==="sharp"&&"!rounded-none",e),...n,children:[p.jsx("span",{className:"absolute left-2 flex h-4 w-4 items-center justify-center",children:p.jsx(Iv,{children:p.jsx(JT,{className:"h-2 w-2 fill-current animate-check-in"})})}),t]})});Hv.displayName=kv.displayName;const jv=y.forwardRef(({className:e,children:t,inset:n,...r},o)=>{const{shape:s}=pr(),i=y.useRef(null),[a,c]=rt({ref:i,color:"rgba(128, 128, 128, 0.1)",duration:400});return y.useImperativeHandle(o,()=>i.current),p.jsxs(Fv,{ref:i,onPointerDown:c,className:H("relative flex cursor-pointer select-none items-center gap-2 rounded-lg px-3 py-2.5 text-sm outline-none overflow-hidden","transition-colors duration-150 ease-[cubic-bezier(0.2,0,0,1)]","hover:bg-graphite-secondary/60 focus:bg-graphite-secondary","data-[state=open]:bg-graphite-secondary data-[highlighted]:bg-graphite-secondary","focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-graphite-foreground/20","[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",n&&"pl-8",s==="sharp"&&"!rounded-none",e),...r,children:[t,p.jsx(Mh,{className:"ml-auto h-4 w-4 transition-transform duration-200 ease-[cubic-bezier(0.2,0,0,1)] group-data-[state=open]:rotate-90"})]})});jv.displayName=Fv.displayName;const Yv=y.forwardRef(({className:e,...t},n)=>{const{shape:r}=pr();return p.jsx(Lv,{ref:n,className:H(Rv({shape:r}),"data-[state=open]:data-[side=right]:animate-submenu-enter-right","data-[state=closed]:data-[side=right]:animate-submenu-exit-right","data-[state=open]:data-[side=left]:animate-submenu-enter-left","data-[state=closed]:data-[side=left]:animate-submenu-exit-left","data-[state=open]:data-[side=top]:animate-menu-enter","data-[state=closed]:data-[side=top]:animate-menu-exit","data-[state=open]:data-[side=bottom]:animate-menu-enter","data-[state=closed]:data-[side=bottom]:animate-menu-exit",e),...t})});Yv.displayName=Lv.displayName;const Uv=y.forwardRef(({className:e,inset:t,...n},r)=>p.jsx(Ov,{ref:r,className:H("px-3 py-2 text-xs font-medium text-graphite-foreground/70 tracking-wide",t&&"pl-8",e),...n}));Uv.displayName=Ov.displayName;const zv=y.forwardRef(({className:e,...t},n)=>p.jsx(_v,{ref:n,className:H("-mx-1 my-1.5 h-px bg-graphite-border/60",e),...t}));zv.displayName=_v.displayName;const Kv=({className:e,...t})=>p.jsx("span",{className:H("ml-auto text-xs font-mono tracking-wider text-graphite-foreground/50",e),...t});Kv.displayName="DropdownMenuShortcut";const SI=Me("font-semibold focus:outline-none flex transition-shadow duration-200 items-center justify-start relative overflow-hidden group shadow-lg hover:shadow-xl focus:ring-2 focus:ring-offset-2 focus:ring-graphite-ring",{variants:{variant:{primary:"bg-graphite-primary text-graphite-primaryForeground",secondary:"bg-graphite-secondary text-graphite-secondaryForeground"},size:{sm:"h-10",md:"h-14",lg:"h-16"},shape:{full:"rounded-full",minimal:"rounded-2xl",sharp:"rounded-none"}},defaultVariants:{variant:"primary",size:"md",shape:"full"}}),Gv={type:"spring",stiffness:500,damping:40,mass:1},qv=y.forwardRef(({className:e,variant:t,size:n,shape:r,children:o,disabled:s,icon:i,isExtended:a,...c},l)=>{const u=y.useRef(null);y.useImperativeHandle(l,()=>u.current);const d=u,f=t==="primary"?"rgba(255, 255, 255, 0.3)":"rgba(0, 0, 0, 0.1)",[,h]=rt({ref:d,color:f,duration:400,disabled:s}),v=CI[n||"md"];return p.jsxs(we.button,{initial:{scale:0,opacity:0},animate:{scale:1,opacity:1,paddingLeft:a?v/2:v/4,paddingRight:a?v/2:v/4},transition:Gv,className:H(SI({variant:t,size:n,shape:r,className:e}),!a&&"justify-center"),ref:u,onPointerDown:h,disabled:s,...c,children:[p.jsx(we.span,{layout:"position",className:"flex-shrink-0 z-10",children:i}),p.jsx(Kn,{children:a&&p.jsx(we.div,{initial:{width:0,opacity:0},animate:{width:"auto",opacity:1,marginLeft:"0.75rem"},exit:{width:0,opacity:0,marginLeft:0},transition:Gv,className:"whitespace-nowrap overflow-hidden",children:o})})]})}),CI={sm:40,md:56,lg:64};qv.displayName="FAB";const Xv=m.createContext({variant:"primary",size:"md",direction:"horizontal"}),Bs=()=>m.useContext(Xv),TI=Me("group/item relative flex flex-wrap items-center border text-sm outline-none transition-colors duration-150 focus-visible:ring-2 focus-visible:ring-graphite-ring focus-visible:ring-offset-2 overflow-hidden",{variants:{variant:{primary:"bg-graphite-card border-graphite-border",secondary:"bg-graphite-secondary border-transparent",ghost:"bg-transparent border-transparent hover:bg-graphite-secondary/60"},size:{sm:"gap-3",md:"gap-4",lg:"gap-4"},padding:{none:"p-0",sm:"p-3",md:"p-4",lg:"p-5"},shape:{full:"rounded-full",minimal:"rounded-xl",sharp:"rounded-none"},direction:{horizontal:"flex-row",vertical:"flex-col justify-center text-center"}},defaultVariants:{variant:"primary",size:"md",padding:"md",shape:"minimal",direction:"horizontal"}}),EI=Me("flex shrink-0 items-center justify-center gap-2 [&_svg]:pointer-events-none",{variants:{variant:{default:"",icon:"bg-graphite-secondary border border-graphite-border [&_svg:not([class*='size-'])]:text-graphite-foreground/80",avatar:"overflow-hidden"},size:{sm:"size-8 rounded-lg [&_svg:not([class*='size-'])]:size-4",md:"size-10 rounded-lg [&_svg:not([class*='size-'])]:size-5",lg:"size-12 rounded-xl [&_svg:not([class*='size-'])]:size-6"},shape:{full:"rounded-full",minimal:"rounded-lg",sharp:"rounded-none"}},defaultVariants:{variant:"default",size:"md",shape:"minimal"}}),Zv=m.forwardRef(({className:e,...t},n)=>p.jsx("div",{ref:n,role:"list","data-slot":"item-group",className:H("group/item-group flex flex-col gap-2",e),...t}));Zv.displayName="ItemGroup";const Qv=m.forwardRef(({className:e,...t},n)=>p.jsx("div",{ref:n,"data-slot":"item-separator",className:H("h-px w-full bg-graphite-border",e),...t}));Qv.displayName="ItemSeparator";const Jv=m.forwardRef(({className:e,variant:t="primary",size:n="md",shape:r="minimal",direction:o="horizontal",padding:s="md",asChild:i=!1,disabled:a,disableRipple:c=!1,onLongPress:l,onPointerDown:u,...d},f)=>{const h=i?OT:"div",v=m.useRef(null);m.useImperativeHandle(f,()=>v.current);const[,g]=rt({ref:v,color:"rgba(0, 0, 0, 0.1)",duration:400,disabled:a||c}),w=Gm(l||null),S={...d,...l?w:{},onPointerDown:x=>{l&&typeof w.onPointerDown=="function"&&w.onPointerDown(x),g(x),u==null||u(x)}};return p.jsx(Xv.Provider,{value:{variant:t,size:n,direction:o},children:p.jsx(h,{ref:v,"data-slot":"item",disabled:a,className:H(TI({variant:t,size:n,shape:r,direction:o,padding:s,className:e}),a&&"opacity-50 cursor-not-allowed"),...S})})});Jv.displayName="Item";const ey=m.forwardRef(({className:e,variant:t,shape:n="minimal",...r},o)=>{const{size:s,direction:i}=Bs();return p.jsx("div",{ref:o,"data-slot":"item-media",className:H(EI({variant:t,size:s,shape:n,className:e}),i==="horizontal"?"mb-auto":"mb-2"),...r})});ey.displayName="ItemMedia";const ty=m.forwardRef(({className:e,...t},n)=>{const{direction:r}=Bs();return p.jsx("div",{ref:n,"data-slot":"item-content",className:H("flex flex-1 flex-col gap-0.5 min-w-0",r==="vertical"&&"items-center",e),...t})});ty.displayName="ItemContent";const ny=m.forwardRef(({className:e,...t},n)=>{const{direction:r}=Bs();return p.jsx("div",{ref:n,"data-slot":"item-title",className:H("flex w-fit items-center gap-2 text-base font-semibold leading-snug truncate",r==="vertical"&&"justify-center",e),...t})});ny.displayName="ItemTitle";const ry=m.forwardRef(({className:e,...t},n)=>p.jsx("p",{ref:n,"data-slot":"item-description",className:H("text-graphite-foreground/70 line-clamp-2 text-sm font-normal leading-normal",e),...t}));ry.displayName="ItemDescription";const oy=m.forwardRef(({className:e,...t},n)=>{const{direction:r}=Bs();return p.jsx("div",{ref:n,"data-slot":"item-actions",className:H("flex items-center gap-2",r==="horizontal"?"ml-auto pl-4":"mt-2",e),...t})});oy.displayName="ItemActions";const sy=m.forwardRef(({className:e,...t},n)=>p.jsx("div",{ref:n,"data-slot":"item-header",className:H("flex basis-full items-center justify-between gap-2",e),...t}));sy.displayName="ItemHeader";const iy=m.forwardRef(({className:e,...t},n)=>p.jsx("div",{ref:n,"data-slot":"item-footer",className:H("flex basis-full items-center justify-between gap-2 mt-2",e),...t}));iy.displayName="ItemFooter";const Qc=y.forwardRef(({className:e,id:t,label:n,...r},o)=>{const s=y.useId(),i=t||s;return p.jsxs("div",{className:"inline-flex items-center",children:[p.jsxs("div",{className:"relative flex h-5 w-5 items-center justify-center",children:[p.jsx("input",{type:"radio",ref:o,id:i,className:H("peer h-5 w-5 shrink-0 appearance-none rounded-full border-2 transition-colors duration-200","border-graphite-border","checked:border-graphite-primary","focus:outline-none focus:ring-2 focus:ring-graphite-ring focus:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50 disabled:checked:border-graphite-border",e),...r}),p.jsx("div",{className:H("pointer-events-none absolute h-2.5 w-2.5 rounded-full bg-graphite-primary","transition-transform duration-200 ease-in-out transform scale-0 peer-checked:scale-100")})]}),n&&p.jsx("label",{htmlFor:i,className:"ml-3 select-none text-sm font-medium text-graphite-foreground",children:n})]})});Qc.displayName="RadioGroup.Item";const Jc=y.forwardRef(({className:e,label:t,children:n,value:r,onValueChange:o,name:s,disabled:i,...a},c)=>{const l=y.useId(),u=s||l,d=`radiogroup-label-${l}`;return p.jsxs("div",{className:"flex flex-col gap-2",children:[t&&p.jsx("div",{id:d,className:"mb-2 block text-sm font-medium text-graphite-primary",children:t}),p.jsx("div",{ref:c,role:"radiogroup","aria-labelledby":t?d:void 0,className:H("flex flex-col gap-3",e),...a,children:y.Children.map(n,f=>y.isValidElement(f)?y.cloneElement(f,{name:u,checked:f.props.value===r,disabled:i||f.props.disabled,onChange:h=>{var v,g;o==null||o(h.currentTarget.value),(g=(v=f.props).onChange)==null||g.call(v,h)}}):f)})]})});Jc.displayName="RadioGroup";const PI=Object.assign(Jc,{Item:Qc});function DI(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 ay=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"}),MI="VisuallyHidden",OI=m.forwardRef((e,t)=>p.jsx(ce.span,{...e,ref:t,style:{...ay,...e.style}}));OI.displayName=MI;var NI=[" ","Enter","ArrowUp","ArrowDown"],AI=[" ","Enter"],In="Select",[Ws,$s,kI]=Wc(In),[mr]=Ct(In,[kI,ar]),Hs=ar(),[II,un]=mr(In),[_I,FI]=mr(In),cy=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:h,form:v}=e,g=Hs(t),[w,b]=m.useState(null),[S,x]=m.useState(null),[C,E]=m.useState(!1),D=Ds(l),[T,P]=Mn({prop:r,defaultProp:o??!1,onChange:s,caller:In}),[M,N]=Mn({prop:i,defaultProp:a,onChange:c,caller:In}),_=m.useRef(null),V=w?v||!!w.closest("form"):!0,[O,A]=m.useState(new Set),L=Array.from(O).map(R=>R.props.value).join(";");return p.jsx(is,{...g,children:p.jsxs(II,{required:h,scope:t,trigger:w,onTriggerChange:b,valueNode:S,onValueNodeChange:x,valueNodeHasChildren:C,onValueNodeHasChildrenChange:E,contentId:ot(),value:M,onValueChange:N,open:T,onOpenChange:P,dir:D,triggerPointerDownPosRef:_,disabled:f,children:[p.jsx(Ws.Provider,{scope:t,children:p.jsx(_I,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback(R=>{A(F=>new Set(F).add(R))},[]),onNativeOptionRemove:m.useCallback(R=>{A(F=>{const k=new Set(F);return k.delete(R),k})},[]),children:n})}),V?p.jsxs(Ay,{"aria-hidden":!0,required:h,tabIndex:-1,name:u,autoComplete:d,value:M,onChange:R=>N(R.target.value),disabled:f,form:v,children:[M===void 0?p.jsx("option",{value:""}):null,Array.from(O)]},L):null]})})};cy.displayName=In;var ly="SelectTrigger",uy=m.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,s=Hs(n),i=un(ly,n),a=i.disabled||r,c=fe(t,i.onTriggerChange),l=$s(n),u=m.useRef("touch"),[d,f,h]=Iy(g=>{const w=l().filter(x=>!x.disabled),b=w.find(x=>x.value===i.value),S=_y(w,g,b);S!==void 0&&i.onValueChange(S.value)}),v=g=>{a||(i.onOpenChange(!0),h()),g&&(i.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})};return p.jsx(as,{asChild:!0,...s,children:p.jsx(ce.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":ky(i.value)?"":void 0,...o,ref:c,onClick:K(o.onClick,g=>{g.currentTarget.focus(),u.current!=="mouse"&&v(g)}),onPointerDown:K(o.onPointerDown,g=>{u.current=g.pointerType;const w=g.target;w.hasPointerCapture(g.pointerId)&&w.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(v(g),g.preventDefault())}),onKeyDown:K(o.onKeyDown,g=>{const w=d.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&f(g.key),!(w&&g.key===" ")&&NI.includes(g.key)&&(v(),g.preventDefault())})})})});uy.displayName=ly;var dy="SelectValue",fy=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:s,placeholder:i="",...a}=e,c=un(dy,n),{onValueNodeHasChildrenChange:l}=c,u=s!==void 0,d=fe(t,c.onValueNodeChange);return Ie(()=>{l(u)},[l,u]),p.jsx(ce.span,{...a,ref:d,style:{pointerEvents:"none"},children:ky(c.value)?p.jsx(p.Fragment,{children:i}):s})});fy.displayName=dy;var LI="SelectIcon",hy=m.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return p.jsx(ce.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});hy.displayName=LI;var VI="SelectPortal",py=e=>p.jsx(Qr,{asChild:!0,...e});py.displayName=VI;var _n="SelectContent",my=m.forwardRef((e,t)=>{const n=un(_n,e.__scopeSelect),[r,o]=m.useState();if(Ie(()=>{o(new DocumentFragment)},[]),!n.open){const s=r;return s?wr.createPortal(p.jsx(gy,{scope:e.__scopeSelect,children:p.jsx(Ws.Slot,{scope:e.__scopeSelect,children:p.jsx("div",{children:e.children})})}),s):null}return p.jsx(vy,{...e,ref:t})});my.displayName=_n;var vt=10,[gy,dn]=mr(_n),RI="SelectContentImpl",BI=en("SelectContent.RemoveScroll"),vy=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:h,sticky:v,hideWhenDetached:g,avoidCollisions:w,...b}=e,S=un(_n,n),[x,C]=m.useState(null),[E,D]=m.useState(null),T=fe(t,Y=>C(Y)),[P,M]=m.useState(null),[N,_]=m.useState(null),V=$s(n),[O,A]=m.useState(!1),L=m.useRef(!1);m.useEffect(()=>{if(x)return ds(x)},[x]),Go();const R=m.useCallback(Y=>{const[J,...te]=V().map(ue=>ue.ref.current),[le]=te.slice(-1),ae=document.activeElement;for(const ue of Y)if(ue===ae||(ue==null||ue.scrollIntoView({block:"nearest"}),ue===J&&E&&(E.scrollTop=0),ue===le&&E&&(E.scrollTop=E.scrollHeight),ue==null||ue.focus(),document.activeElement!==ae))return},[V,E]),F=m.useCallback(()=>R([P,x]),[R,P,x]);m.useEffect(()=>{O&&F()},[O,F]);const{onOpenChange:k,triggerPointerDownPosRef:I}=S;m.useEffect(()=>{if(x){let Y={x:0,y:0};const J=le=>{var ae,ue;Y={x:Math.abs(Math.round(le.pageX)-(((ae=I.current)==null?void 0:ae.x)??0)),y:Math.abs(Math.round(le.pageY)-(((ue=I.current)==null?void 0:ue.y)??0))}},te=le=>{Y.x<=10&&Y.y<=10?le.preventDefault():x.contains(le.target)||k(!1),document.removeEventListener("pointermove",J),I.current=null};return I.current!==null&&(document.addEventListener("pointermove",J),document.addEventListener("pointerup",te,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",J),document.removeEventListener("pointerup",te,{capture:!0})}}},[x,k,I]),m.useEffect(()=>{const Y=()=>k(!1);return window.addEventListener("blur",Y),window.addEventListener("resize",Y),()=>{window.removeEventListener("blur",Y),window.removeEventListener("resize",Y)}},[k]);const[B,U]=Iy(Y=>{const J=V().filter(ae=>!ae.disabled),te=J.find(ae=>ae.ref.current===document.activeElement),le=_y(J,Y,te);le&&setTimeout(()=>le.ref.current.focus())}),j=m.useCallback((Y,J,te)=>{const le=!L.current&&!te;(S.value!==void 0&&S.value===J||le)&&(M(Y),le&&(L.current=!0))},[S.value]),X=m.useCallback(()=>x==null?void 0:x.focus(),[x]),se=m.useCallback((Y,J,te)=>{const le=!L.current&&!te;(S.value!==void 0&&S.value===J||le)&&_(Y)},[S.value]),ne=r==="popper"?el:yy,ie=ne===el?{side:a,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:h,sticky:v,hideWhenDetached:g,avoidCollisions:w}:{};return p.jsx(gy,{scope:n,content:x,viewport:E,onViewportChange:D,itemRefCallback:j,selectedItem:P,onItemLeave:X,itemTextRefCallback:se,focusSelectedItem:F,selectedItemText:N,position:r,isPositioned:O,searchRef:B,children:p.jsx(Jr,{as:BI,allowPinchZoom:!0,children:p.jsx(qr,{asChild:!0,trapped:S.open,onMountAutoFocus:Y=>{Y.preventDefault()},onUnmountAutoFocus:K(o,Y=>{var J;(J=S.trigger)==null||J.focus({preventScroll:!0}),Y.preventDefault()}),children:p.jsx(Gr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:Y=>Y.preventDefault(),onDismiss:()=>S.onOpenChange(!1),children:p.jsx(ne,{role:"listbox",id:S.contentId,"data-state":S.open?"open":"closed",dir:S.dir,onContextMenu:Y=>Y.preventDefault(),...b,...ie,onPlaced:()=>A(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:K(b.onKeyDown,Y=>{const J=Y.ctrlKey||Y.altKey||Y.metaKey;if(Y.key==="Tab"&&Y.preventDefault(),!J&&Y.key.length===1&&U(Y.key),["ArrowUp","ArrowDown","Home","End"].includes(Y.key)){let le=V().filter(ae=>!ae.disabled).map(ae=>ae.ref.current);if(["ArrowUp","End"].includes(Y.key)&&(le=le.slice().reverse()),["ArrowUp","ArrowDown"].includes(Y.key)){const ae=Y.target,ue=le.indexOf(ae);le=le.slice(ue+1)}setTimeout(()=>R(le)),Y.preventDefault()}})})})})})})});vy.displayName=RI;var WI="SelectItemAlignedPosition",yy=m.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,s=un(_n,n),i=dn(_n,n),[a,c]=m.useState(null),[l,u]=m.useState(null),d=fe(t,T=>u(T)),f=$s(n),h=m.useRef(!1),v=m.useRef(!0),{viewport:g,selectedItem:w,selectedItemText:b,focusSelectedItem:S}=i,x=m.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&l&&g&&w&&b){const T=s.trigger.getBoundingClientRect(),P=l.getBoundingClientRect(),M=s.valueNode.getBoundingClientRect(),N=b.getBoundingClientRect();if(s.dir!=="rtl"){const ae=N.left-P.left,ue=M.left-ae,Ee=T.left-ue,Z=T.width+Ee,lt=Math.max(Z,P.width),ut=window.innerWidth-vt,Qe=Oc(ue,[vt,Math.max(vt,ut-lt)]);a.style.minWidth=Z+"px",a.style.left=Qe+"px"}else{const ae=P.right-N.right,ue=window.innerWidth-M.right-ae,Ee=window.innerWidth-T.right-ue,Z=T.width+Ee,lt=Math.max(Z,P.width),ut=window.innerWidth-vt,Qe=Oc(ue,[vt,Math.max(vt,ut-lt)]);a.style.minWidth=Z+"px",a.style.right=Qe+"px"}const _=f(),V=window.innerHeight-vt*2,O=g.scrollHeight,A=window.getComputedStyle(l),L=parseInt(A.borderTopWidth,10),R=parseInt(A.paddingTop,10),F=parseInt(A.borderBottomWidth,10),k=parseInt(A.paddingBottom,10),I=L+R+O+k+F,B=Math.min(w.offsetHeight*5,I),U=window.getComputedStyle(g),j=parseInt(U.paddingTop,10),X=parseInt(U.paddingBottom,10),se=T.top+T.height/2-vt,ne=V-se,ie=w.offsetHeight/2,Y=w.offsetTop+ie,J=L+R+Y,te=I-J;if(J<=se){const ae=_.length>0&&w===_[_.length-1].ref.current;a.style.bottom="0px";const ue=l.clientHeight-g.offsetTop-g.offsetHeight,Ee=Math.max(ne,ie+(ae?X:0)+ue+F),Z=J+Ee;a.style.height=Z+"px"}else{const ae=_.length>0&&w===_[0].ref.current;a.style.top="0px";const Ee=Math.max(se,L+g.offsetTop+(ae?j:0)+ie)+te;a.style.height=Ee+"px",g.scrollTop=J-se+g.offsetTop}a.style.margin=`${vt}px 0`,a.style.minHeight=B+"px",a.style.maxHeight=V+"px",r==null||r(),requestAnimationFrame(()=>h.current=!0)}},[f,s.trigger,s.valueNode,a,l,g,w,b,s.dir,r]);Ie(()=>x(),[x]);const[C,E]=m.useState();Ie(()=>{l&&E(window.getComputedStyle(l).zIndex)},[l]);const D=m.useCallback(T=>{T&&v.current===!0&&(x(),S==null||S(),v.current=!1)},[x,S]);return p.jsx(HI,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:D,children:p.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:p.jsx(ce.div,{...o,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});yy.displayName=WI;var $I="SelectPopperPosition",el=m.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=vt,...s}=e,i=Hs(n);return p.jsx(wc,{...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)"}})});el.displayName=$I;var[HI,tl]=mr(_n,{}),nl="SelectViewport",wy=m.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,s=dn(nl,n),i=tl(nl,n),a=fe(t,s.onViewportChange),c=m.useRef(0);return p.jsxs(p.Fragment,{children:[p.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}),p.jsx(Ws.Slot,{scope:n,children:p.jsx(ce.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:K(o.onScroll,l=>{const u=l.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:f}=i;if(f!=null&&f.current&&d){const h=Math.abs(c.current-u.scrollTop);if(h>0){const v=window.innerHeight-vt*2,g=parseFloat(d.style.minHeight),w=parseFloat(d.style.height),b=Math.max(g,w);if(b<v){const S=b+h,x=Math.min(v,S),C=S-x;d.style.height=x+"px",d.style.bottom==="0px"&&(u.scrollTop=C>0?C:0,d.style.justifyContent="flex-end")}}}c.current=u.scrollTop})})})]})});wy.displayName=nl;var by="SelectGroup",[jI,YI]=mr(by),xy=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=ot();return p.jsx(jI,{scope:n,id:o,children:p.jsx(ce.div,{role:"group","aria-labelledby":o,...r,ref:t})})});xy.displayName=by;var Sy="SelectLabel",Cy=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=YI(Sy,n);return p.jsx(ce.div,{id:o.id,...r,ref:t})});Cy.displayName=Sy;var js="SelectItem",[UI,Ty]=mr(js),Ey=m.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:s,...i}=e,a=un(js,n),c=dn(js,n),l=a.value===r,[u,d]=m.useState(s??""),[f,h]=m.useState(!1),v=fe(t,S=>{var x;return(x=c.itemRefCallback)==null?void 0:x.call(c,S,r,o)}),g=ot(),w=m.useRef("touch"),b=()=>{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 p.jsx(UI,{scope:n,value:r,disabled:o,textId:g,isSelected:l,onItemTextChange:m.useCallback(S=>{d(x=>x||((S==null?void 0:S.textContent)??"").trim())},[]),children:p.jsx(Ws.ItemSlot,{scope:n,value:r,disabled:o,textValue:u,children:p.jsx(ce.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:v,onFocus:K(i.onFocus,()=>h(!0)),onBlur:K(i.onBlur,()=>h(!1)),onClick:K(i.onClick,()=>{w.current!=="mouse"&&b()}),onPointerUp:K(i.onPointerUp,()=>{w.current==="mouse"&&b()}),onPointerDown:K(i.onPointerDown,S=>{w.current=S.pointerType}),onPointerMove:K(i.onPointerMove,S=>{var x;w.current=S.pointerType,o?(x=c.onItemLeave)==null||x.call(c):w.current==="mouse"&&S.currentTarget.focus({preventScroll:!0})}),onPointerLeave:K(i.onPointerLeave,S=>{var x;S.currentTarget===document.activeElement&&((x=c.onItemLeave)==null||x.call(c))}),onKeyDown:K(i.onKeyDown,S=>{var C;((C=c.searchRef)==null?void 0:C.current)!==""&&S.key===" "||(AI.includes(S.key)&&b(),S.key===" "&&S.preventDefault())})})})})});Ey.displayName=js;var fo="SelectItemText",Py=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...s}=e,i=un(fo,n),a=dn(fo,n),c=Ty(fo,n),l=FI(fo,n),[u,d]=m.useState(null),f=fe(t,b=>d(b),c.onItemTextChange,b=>{var S;return(S=a.itemTextRefCallback)==null?void 0:S.call(a,b,c.value,c.disabled)}),h=u==null?void 0:u.textContent,v=m.useMemo(()=>p.jsx("option",{value:c.value,disabled:c.disabled,children:h},c.value),[c.disabled,c.value,h]),{onNativeOptionAdd:g,onNativeOptionRemove:w}=l;return Ie(()=>(g(v),()=>w(v)),[g,w,v]),p.jsxs(p.Fragment,{children:[p.jsx(ce.span,{id:c.textId,...s,ref:f}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?wr.createPortal(s.children,i.valueNode):null]})});Py.displayName=fo;var Dy="SelectItemIndicator",My=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Ty(Dy,n).isSelected?p.jsx(ce.span,{"aria-hidden":!0,...r,ref:t}):null});My.displayName=Dy;var rl="SelectScrollUpButton",zI=m.forwardRef((e,t)=>{const n=dn(rl,e.__scopeSelect),r=tl(rl,e.__scopeSelect),[o,s]=m.useState(!1),i=fe(t,r.onScrollButtonChange);return Ie(()=>{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?p.jsx(Oy,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});zI.displayName=rl;var ol="SelectScrollDownButton",KI=m.forwardRef((e,t)=>{const n=dn(ol,e.__scopeSelect),r=tl(ol,e.__scopeSelect),[o,s]=m.useState(!1),i=fe(t,r.onScrollButtonChange);return Ie(()=>{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?p.jsx(Oy,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});KI.displayName=ol;var Oy=m.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,s=dn("SelectScrollButton",n),i=m.useRef(null),a=$s(n),c=m.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return m.useEffect(()=>()=>c(),[c]),Ie(()=>{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]),p.jsx(ce.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:K(o.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:K(o.onPointerMove,()=>{var l;(l=s.onItemLeave)==null||l.call(s),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:K(o.onPointerLeave,()=>{c()})})}),GI="SelectSeparator",Ny=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return p.jsx(ce.div,{"aria-hidden":!0,...r,ref:t})});Ny.displayName=GI;var sl="SelectArrow",qI=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Hs(n),s=un(sl,n),i=dn(sl,n);return s.open&&i.position==="popper"?p.jsx(bc,{...o,...r,ref:t}):null});qI.displayName=sl;var XI="SelectBubbleInput",Ay=m.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=m.useRef(null),s=fe(r,o),i=DI(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]),p.jsx(ce.select,{...n,style:{...ay,...n.style},ref:s,defaultValue:t})});Ay.displayName=XI;function ky(e){return e===""||e===void 0}function Iy(e){const t=Fe(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 _y(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=ZI(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 ZI(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var QI=cy,Fy=uy,JI=fy,e_=hy,t_=py,Ly=my,n_=wy,r_=xy,Vy=Cy,Ry=Ey,o_=Py,s_=My,By=Ny;const Wy=y.createContext({variant:"primary",shape:"minimal",size:"md"}),Ys=()=>y.useContext(Wy),$y=Me("flex items-center justify-between transition-all duration-200 w-full px-4 border-2 text-left",{variants:{variant:{primary:"bg-graphite-card",secondary:"bg-graphite-secondary"},shape:{full:"rounded-full",minimal:"rounded-2xl",sharp:"rounded-none"},size:{sm:"h-10 text-sm",md:"h-12 text-base",lg:"h-14 text-lg"},isErrored:{true:""},disabled:{true:"bg-graphite-secondary opacity-50 cursor-not-allowed"}},compoundVariants:[{variant:"primary",isErrored:!1,className:"border-graphite-border data-[state=open]:border-graphite-primary"},{variant:"secondary",isErrored:!1,className:"border-transparent data-[state=open]:border-graphite-primary"},{isErrored:!0,className:"border-red-500 data-[state=open]:border-red-600"}],defaultVariants:{variant:"primary",shape:"minimal",size:"md"}}),i_=Me("relative z-50 min-w-[8rem] overflow-hidden border shadow-md",{variants:{variant:{primary:"bg-graphite-card text-graphite-foreground border-graphite-border",secondary:"bg-graphite-secondary text-graphite-secondaryForeground border-transparent"},shape:{full:"rounded-3xl",minimal:"rounded-xl",sharp:"rounded-none"}},defaultVariants:{variant:"primary",shape:"minimal"}}),a_=Me("relative flex w-full cursor-pointer select-none items-center rounded-lg pr-2 pl-8 outline-none overflow-hidden transition-colors duration-150 ease-in-out data-[highlighted]:bg-graphite-secondary/80 focus:bg-graphite-secondary/80 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",{variants:{size:{sm:"py-2 text-sm",md:"py-2 text-base",lg:"py-2.5 text-lg"},shape:{full:"",minimal:"",sharp:"!rounded-none"}},defaultVariants:{size:"md"}}),c_=r_,Hy=JI,jy=({children:e,variant:t="primary",shape:n="minimal",size:r="md",...o})=>p.jsx(Wy.Provider,{value:{variant:t,shape:n,size:r},children:p.jsx(QI,{...o,children:e})}),il=y.forwardRef(({className:e,children:t,variant:n,shape:r,size:o,error:s,disabled:i,...a},c)=>{const l=Ys();return p.jsxs(Fy,{ref:c,disabled:i,className:$y({variant:n||l.variant,shape:r||l.shape,size:o,isErrored:!!s,disabled:i,className:e}),...a,children:[t,p.jsx(e_,{asChild:!0,children:p.jsx(Dh,{className:"h-4 w-4 opacity-50"})})]})});il.displayName=Fy.displayName;const al=y.forwardRef(({className:e,children:t,position:n="item-aligned",...r},o)=>{const{variant:s,shape:i}=Ys();return p.jsx(t_,{children:p.jsx(Ly,{ref:o,className:H(i_({variant:s,shape:i}),n==="popper"?"data-[state=open]:animate-menu-enter data-[state=closed]:animate-menu-exit w-[var(--radix-select-trigger-width)]":"data-[state=open]:animate-select-enter data-[state=closed]:animate-select-exit","data-[side=bottom]:origin-top data-[side=top]:origin-bottom ",e),position:n,...r,children:p.jsx(n_,{className:H("p-1",n==="popper"&&["max-h-64","[mask-image:linear-gradient(to_bottom,transparent,black_1rem,black_calc(100%-1rem),transparent)]"],n==="popper"&&"w-full"),children:t})})})});al.displayName=Ly.displayName;const cl=y.forwardRef(({className:e,children:t,...n},r)=>{const{shape:o,variant:s,size:i}=Ys(),a=y.useRef(null),c=s==="primary"?"rgba(0, 0, 0, 0.1)":"rgba(255, 255, 255, 0.1)",[,l]=rt({ref:a,color:c,duration:400,disabled:n.disabled});return y.useImperativeHandle(r,()=>a.current),p.jsxs(Ry,{ref:a,onPointerDown:l,className:H(a_({size:i,shape:o}),e),...n,children:[p.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:p.jsx(s_,{children:p.jsx(_a,{className:"h-4 w-4"})})}),p.jsx(o_,{className:"truncate",children:t})]})});cl.displayName=Ry.displayName;const Yy=y.forwardRef(({className:e,...t},n)=>{const{size:r}=Ys();return p.jsx(Vy,{ref:n,className:H("py-1.5 pl-8 pr-2 font-semibold",{"text-sm":r==="sm","text-base":r==="md","text-lg":r==="lg"},e),...t})});Yy.displayName=Vy.displayName;const Uy=y.forwardRef(({className:e,...t},n)=>p.jsx(By,{ref:n,className:H("-mx-1 my-1 h-px bg-graphite-border",e),...t}));Uy.displayName=By.displayName;const l_=({item:e,isSelected:t,onSelect:n,variant:r})=>{const o=y.useRef(null),s=r==="primary"?"rgba(0, 0, 0, 0.1)":"rgba(255, 255, 255, 0.1)",[,i]=rt({ref:o,color:s,duration:400,disabled:e.disabled});return p.jsx("button",{ref:o,type:"button",onPointerDown:i,disabled:e.disabled,onClick:()=>n(e.value),className:H("relative flex w-full cursor-pointer select-none items-center rounded-lg py-3 pl-8 pr-2 text-left text-sm outline-none overflow-hidden","transition-colors duration-150 ease-in-out","focus:bg-graphite-secondary/80",t&&"font-semibold text-graphite-primary","disabled:pointer-events-none disabled:opacity-50"),children:p.jsxs("span",{className:"relative z-10 flex items-center w-full",children:[t&&p.jsx("span",{className:"absolute -left-6 flex h-3.5 w-3.5 items-center justify-center",children:p.jsx(_a,{className:"h-4 w-4"})}),p.jsx("span",{className:"truncate",children:e.label})]})})},zy=y.forwardRef(({label:e,error:t,placeholder:n,items:r,id:o,variant:s="primary",shape:i="minimal",size:a="md",disabled:c,contentPosition:l="item-aligned",value:u,onValueChange:d,...f},h)=>{var E;const v=ys("(max-width: 768px)"),g=y.useId(),[w,b]=y.useState(!1),[S,x]=y.useState(u),C=o||g;if(v&&l==="popper"){const D=M=>{M&&x(u),b(M)},T=()=>{S!==void 0&&(d==null||d(S)),b(!1)},P=((E=r.find(M=>M.value===u))==null?void 0:E.label)||n;return p.jsxs("div",{className:"w-full flex flex-col gap-2",children:[e&&p.jsx("div",{className:"block text-sm font-medium text-graphite-primary",children:e}),p.jsxs(_c,{open:w,onOpenChange:D,children:[p.jsx(Is,{asChild:!0,children:p.jsxs("button",{ref:h,type:"button",id:C,disabled:c,className:$y({variant:s,shape:i,size:a,isErrored:!!t,disabled:c}),children:[p.jsx("span",{className:"truncate",children:P}),p.jsx(Dh,{className:"h-4 w-4 opacity-50"})]})}),p.jsxs(_s,{shape:i,className:"fixed bottom-0 m-0 w-full max-w-full rounded-b-none rounded-t-2xl p-4",children:[p.jsx(Fc,{className:"text-left",children:p.jsx(Vc,{children:e||n})}),p.jsx("div",{className:H("mt-4 max-h-[40vh] overflow-y-auto ","[mask-image:linear-gradient(to_bottom,transparent,black_1rem,black_calc(100%-1rem),transparent)]"),children:r.map(M=>p.jsx(l_,{item:M,isSelected:S===M.value,onSelect:x,variant:s},M.value))}),p.jsxs(Lc,{className:"flex justify-end gap-4",children:[p.jsx(er,{variant:"ghost",size:"sm",onClick:()=>b(!1),children:"Cancel"}),p.jsx(er,{size:"sm",variant:"primary",onClick:T,children:"Done"})]})]})]}),t&&p.jsx("p",{className:"mt-2 text-sm text-red-600",children:t})]})}return p.jsxs("div",{className:"w-full flex flex-col gap-2",children:[e&&p.jsx("label",{htmlFor:C,className:"block text-sm font-medium text-graphite-primary",children:e}),p.jsxs(jy,{disabled:c,variant:s,shape:i,size:a,value:u,onValueChange:d,...f,children:[p.jsx(il,{id:C,ref:h,size:a,error:t,disabled:c,children:p.jsx("span",{className:"truncate",children:p.jsx(Hy,{placeholder:n})})}),p.jsx(al,{position:l,children:r.map(D=>p.jsx(cl,{value:D.value,disabled:D.disabled,children:D.label},D.value))})]}),t&&p.jsx("p",{className:"mt-2 text-sm text-red-600",children:t})]})});zy.displayName="SelectInput";const u_=(e={})=>{const{mode:t="search",paramName:n="path",basePath:r="/"}=e,[o,s]=y.useState(()=>new URLSearchParams(window.location.search)),[i,a]=y.useState(()=>window.location.pathname),c=y.useMemo(()=>t==="pathname"?i===r||i===`${r}/`?"/":i.startsWith(r)&&i.slice(r.length)||"/":o.get(n)||"/",[t,i,o,n,r]),l=y.useMemo(()=>{const x=new URLSearchParams(o);return x.delete(n),x},[o,n]);y.useEffect(()=>{const x=()=>{s(new URLSearchParams(window.location.search)),a(window.location.pathname)};return window.addEventListener("popstate",x),()=>window.removeEventListener("popstate",x)},[]);const u=y.useCallback((x,C={},E=null)=>{if(t==="pathname"){const D=x==="/"||!x?r:`${r}${x}`,T=new URLSearchParams;Object.entries(C).forEach(([N,_])=>{_!=null&&T.set(N,String(_))});const P=T.toString(),M=`${D}${P?`?${P}`:""}`;window.history.pushState(E,"",M),a(D),s(T)}else{const D=new URLSearchParams(window.location.search);x?D.set(n,x):D.delete(n),Object.entries(C).forEach(([P,M])=>{M!=null?D.set(P,String(M)):D.delete(P)});const T=`${window.location.pathname}?${D.toString()}`;window.history.pushState(E,"",T),s(D)}},[t,r,n]),d=y.useCallback((x,C={},E=null)=>{if(t==="pathname"){const D=x==="/"||!x?r:`${r}${x}`,T=new URLSearchParams;Object.entries(C).forEach(([N,_])=>{_!=null&&T.set(N,String(_))});const P=T.toString(),M=`${D}${P?`?${P}`:""}`;window.history.replaceState(E,"",M),a(D),s(T)}else{const D=new URLSearchParams(window.location.search);x?D.set(n,x):D.delete(n),Object.entries(C).forEach(([P,M])=>{M!=null?D.set(P,String(M)):D.delete(P)});const T=`${window.location.pathname}?${D.toString()}`;window.history.replaceState(E,"",T),s(D)}},[t,r,n]),f=y.useCallback((x,C=!1)=>{const E=new URLSearchParams(window.location.search);Object.entries(x).forEach(([T,P])=>{T!==n&&(P!=null?E.set(T,String(P)):E.delete(T))});const D=`${window.location.pathname}?${E.toString()}`;C?window.history.replaceState(null,"",D):window.history.pushState(null,"",D),s(E)},[n]),h=y.useCallback((x=!0)=>{const C=new URLSearchParams;let E=window.location.pathname;t==="search"&&x&&c&&c!=="/"&&C.set(n,c);const D=C.toString();D&&(E=`${E}?${D}`),window.history.pushState(null,"",E),s(C)},[c,n,t]),v=y.useCallback(x=>o.get(x),[o]),g=y.useCallback(x=>o.has(x),[o]),w=y.useCallback(()=>window.history.back(),[]),b=y.useCallback(()=>window.history.forward(),[]),S=y.useCallback(x=>window.history.go(x),[]);return{path:c,searchParams:o,otherParams:l,push:u,replace:d,goBack:w,goForward:b,go:S,updateParams:f,clearParams:h,getParam:v,hasParam:g,length:window.history.length,href:window.location.href,basename:window.location.pathname}},ll=y.createContext(null),Us=()=>{const e=y.useContext(ll);if(!e)throw new Error("useRouter must be used within a <ShallowRouter> provider");return e.router},Ky=()=>{const e=y.useContext(ll);if(!e)throw new Error("useRouterOptions must be used within a <ShallowRouter> provider");return e.options},Gy=({children:e,mode:t="search",paramName:n="path",basePath:r="/"})=>{const o=u_({mode:t,paramName:n,basePath:r}),s=y.useMemo(()=>({mode:t,paramName:n,basePath:r}),[t,n,r]),i=y.useMemo(()=>({router:o,options:s}),[o,s]);return p.jsx(ll.Provider,{value:i,children:e})},d_=({path:e,children:t})=>{const{path:n}=Us(),r=e.endsWith("/*"),o=r?e.slice(0,-2):e;return(r?n.startsWith(o):n===e)?p.jsx(p.Fragment,{children:t}):null},ul=y.forwardRef(({children:e,path:t,...n},r)=>p.jsx("div",{ref:r,...n,children:e},t));ul.displayName="ShallowPage";const f_=({children:e})=>{const{path:t}=Us(),r=y.Children.toArray(e).filter(o=>y.isValidElement(o)&&o.type===ul).find(o=>o.props.path===t)||null;return p.jsx(p.Fragment,{children:r})};var zs="Dialog",[qy]=Ct(zs),[h_,yt]=qy(zs),Xy=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]=Mn({prop:r,defaultProp:o??!1,onChange:s,caller:zs});return p.jsx(h_,{scope:t,triggerRef:a,contentRef:c,contentId:ot(),titleId:ot(),descriptionId:ot(),open:l,onOpenChange:u,onOpenToggle:m.useCallback(()=>u(d=>!d),[u]),modal:i,children:n})};Xy.displayName=zs;var Zy="DialogTrigger",Qy=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=yt(Zy,n),s=fe(t,o.triggerRef);return p.jsx(ce.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":hl(o.open),...r,ref:s,onClick:K(e.onClick,o.onOpenToggle)})});Qy.displayName=Zy;var dl="DialogPortal",[p_,Jy]=qy(dl,{forceMount:void 0}),ew=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=yt(dl,t);return p.jsx(p_,{scope:t,forceMount:n,children:m.Children.map(r,i=>p.jsx(Ke,{present:n||s.open,children:p.jsx(Qr,{asChild:!0,container:o,children:i})}))})};ew.displayName=dl;var Ks="DialogOverlay",tw=m.forwardRef((e,t)=>{const n=Jy(Ks,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=yt(Ks,e.__scopeDialog);return s.modal?p.jsx(Ke,{present:r||s.open,children:p.jsx(g_,{...o,ref:t})}):null});tw.displayName=Ks;var m_=en("DialogOverlay.RemoveScroll"),g_=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=yt(Ks,n);return p.jsx(Jr,{as:m_,allowPinchZoom:!0,shards:[o.contentRef],children:p.jsx(ce.div,{"data-state":hl(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Fn="DialogContent",nw=m.forwardRef((e,t)=>{const n=Jy(Fn,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=yt(Fn,e.__scopeDialog);return p.jsx(Ke,{present:r||s.open,children:s.modal?p.jsx(v_,{...o,ref:t}):p.jsx(y_,{...o,ref:t})})});nw.displayName=Fn;var v_=m.forwardRef((e,t)=>{const n=yt(Fn,e.__scopeDialog),r=m.useRef(null),o=fe(t,n.contentRef,r);return m.useEffect(()=>{const s=r.current;if(s)return ds(s)},[]),p.jsx(rw,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:K(e.onCloseAutoFocus,s=>{var i;s.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:K(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&s.preventDefault()}),onFocusOutside:K(e.onFocusOutside,s=>s.preventDefault())})}),y_=m.forwardRef((e,t)=>{const n=yt(Fn,e.__scopeDialog),r=m.useRef(!1),o=m.useRef(!1);return p.jsx(rw,{...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()}})}),rw=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,...i}=e,a=yt(Fn,n),c=m.useRef(null),l=fe(t,c);return Go(),p.jsxs(p.Fragment,{children:[p.jsx(qr,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:p.jsx(Gr,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":hl(a.open),...i,ref:l,onDismiss:()=>a.onOpenChange(!1)})}),p.jsxs(p.Fragment,{children:[p.jsx(w_,{titleId:a.titleId}),p.jsx(x_,{contentRef:c,descriptionId:a.descriptionId})]})]})}),fl="DialogTitle",ow=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=yt(fl,n);return p.jsx(ce.h2,{id:o.titleId,...r,ref:t})});ow.displayName=fl;var sw="DialogDescription",iw=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=yt(sw,n);return p.jsx(ce.p,{id:o.descriptionId,...r,ref:t})});iw.displayName=sw;var aw="DialogClose",cw=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=yt(aw,n);return p.jsx(ce.button,{type:"button",...r,ref:t,onClick:K(e.onClick,()=>o.onOpenChange(!1))})});cw.displayName=aw;function hl(e){return e?"open":"closed"}var lw="DialogTitleWarning",[PL,uw]=DT(lw,{contentName:Fn,titleName:fl,docsSlug:"dialog"}),w_=({titleId:e})=>{const t=uw(lw),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
143
|
+
|
|
144
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
145
|
+
|
|
146
|
+
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},b_="DialogDescriptionWarning",x_=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${uw(b_).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},S_=Xy,C_=Qy,T_=ew,E_=tw,P_=nw,D_=ow,M_=iw,O_=cw;function N_(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const dw=y.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldAnimate:{current:!0},shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),ho=()=>{const e=y.useContext(dw);if(!e)throw new Error("useDrawerContext must be used within a Drawer.Root");return e};N_(`[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(
|
|
147
|
+
[data-state=closed]
|
|
148
|
+
){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}`);function A_(){const e=navigator.userAgent;return typeof window<"u"&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))}function k_(){return pl(/^Mac/)}function I_(){return pl(/^iPhone/)}function fw(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function __(){return pl(/^iPad/)||k_()&&navigator.maxTouchPoints>1}function hw(){return I_()||__()}function pl(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.platform):void 0}const F_=24,L_=typeof window<"u"?y.useLayoutEffect:y.useEffect;function pw(...e){return(...t)=>{for(let n of e)typeof n=="function"&&n(...t)}}const ml=typeof document<"u"&&window.visualViewport;function mw(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function gw(e){for(mw(e)&&(e=e.parentElement);e&&!mw(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const V_=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let Gs=0,gl;function R_(e={}){let{isDisabled:t}=e;L_(()=>{if(!t)return Gs++,Gs===1&&hw()&&(gl=B_()),()=>{Gs--,Gs===0&&(gl==null||gl())}},[t])}function B_(){let e,t=0,n=d=>{e=gw(d.target),!(e===document.documentElement&&e===document.body)&&(t=d.changedTouches[0].pageY)},r=d=>{if(!e||e===document.documentElement||e===document.body){d.preventDefault();return}let f=d.changedTouches[0].pageY,h=e.scrollTop,v=e.scrollHeight-e.clientHeight;v!==0&&((h<=0&&f>t||h>=v&&f<t)&&d.preventDefault(),t=f)},o=d=>{let f=d.target;vl(f)&&f!==document.activeElement&&(d.preventDefault(),f.style.transform="translateY(-2000px)",f.focus(),requestAnimationFrame(()=>{f.style.transform=""}))},s=d=>{let f=d.target;vl(f)&&(f.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{f.style.transform="",ml&&(ml.height<window.innerHeight?requestAnimationFrame(()=>{vw(f)}):ml.addEventListener("resize",()=>vw(f),{once:!0}))}))},i=()=>{window.scrollTo(0,0)},a=window.pageXOffset,c=window.pageYOffset,l=pw(W_(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let u=pw(po(document,"touchstart",n,{passive:!1,capture:!0}),po(document,"touchmove",r,{passive:!1,capture:!0}),po(document,"touchend",o,{passive:!1,capture:!0}),po(document,"focus",s,!0),po(window,"scroll",i));return()=>{l(),u(),window.scrollTo(a,c)}}function W_(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}function po(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function vw(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let n=gw(e);if(n!==document.documentElement&&n!==document.body&&n!==e){let r=n.getBoundingClientRect().top,o=e.getBoundingClientRect().top,s=e.getBoundingClientRect().bottom;const i=n.getBoundingClientRect().bottom+F_;s>i&&(n.scrollTop+=o-r)}e=n.parentElement}}function vl(e){return e instanceof HTMLInputElement&&!V_.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function $_(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function H_(...e){return t=>e.forEach(n=>$_(n,t))}function yw(...e){return m.useCallback(H_(...e),e)}const ww=new WeakMap;function Le(e,t,n=!1){if(!e||!(e instanceof HTMLElement))return;let r={};Object.entries(t).forEach(([o,s])=>{if(o.startsWith("--")){e.style.setProperty(o,s);return}r[o]=e.style[o],e.style[o]=s}),!n&&ww.set(e,r)}function j_(e,t){if(!e||!(e instanceof HTMLElement))return;let n=ww.get(e);n&&(e.style[t]=n[t])}const _e=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function qs(e,t){if(!e)return null;const n=window.getComputedStyle(e),r=n.transform||n.webkitTransform||n.mozTransform;let o=r.match(/^matrix3d\((.+)\)$/);return o?parseFloat(o[1].split(", ")[_e(t)?13:12]):(o=r.match(/^matrix\((.+)\)$/),o?parseFloat(o[1].split(", ")[_e(t)?5:4]):null)}function Y_(e){return 8*(Math.log(e+1)-2)}function yl(e,t){if(!e)return()=>{};const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}function U_(...e){return(...t)=>{for(const n of e)typeof n=="function"&&n(...t)}}const Te={DURATION:.5,EASE:[.32,.72,0,1]},bw=.4,z_=.25,K_=100,xw=8,Ln=16,wl=26,bl="vaul-dragging";function Sw(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...n)=>t.current==null?void 0:t.current.call(t,...n),[])}function G_({defaultProp:e,onChange:t}){const n=y.useState(e),[r]=n,o=y.useRef(r),s=Sw(t);return y.useEffect(()=>{o.current!==r&&(s(r),o.current=r)},[r,o,s]),n}function Cw({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=G_({defaultProp:t,onChange:n}),s=e!==void 0,i=s?e:r,a=Sw(n),c=y.useCallback(l=>{if(s){const d=typeof l=="function"?l(e):l;d!==e&&a(d)}else o(l)},[s,e,o,a]);return[i,c]}function q_({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:n,drawerRef:r,overlayRef:o,fadeFromIndex:s,onSnapPointChange:i,direction:a="bottom",container:c,snapToSequentialPoint:l}){const[u,d]=Cw({prop:e,defaultProp:n==null?void 0:n[0],onChange:t}),[f,h]=y.useState(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);y.useEffect(()=>{function T(){h({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",T),()=>window.removeEventListener("resize",T)},[]);const v=y.useMemo(()=>u===(n==null?void 0:n[n.length-1])||null,[n,u]),g=y.useMemo(()=>{var T;return(T=n==null?void 0:n.findIndex(P=>P===u))!=null?T:null},[n,u]),w=n&&n.length>0&&(s||s===0)&&!Number.isNaN(s)&&n[s]===u||!n,b=y.useMemo(()=>{const T=c?{width:c.getBoundingClientRect().width,height:c.getBoundingClientRect().height}:typeof window<"u"?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var P;return(P=n==null?void 0:n.map(M=>{const N=typeof M=="string";let _=0;if(N&&(_=parseInt(M,10)),_e(a)){const O=N?_:f?M*T.height:0;return f?a==="bottom"?T.height-O:-T.height+O:O}const V=N?_:f?M*T.width:0;return f?a==="right"?T.width-V:-T.width+V:V}))!=null?P:[]},[n,f,c]),S=y.useMemo(()=>g!==null?b==null?void 0:b[g]:null,[b,g]),x=y.useCallback(T=>{var P;const M=(P=b==null?void 0:b.findIndex(N=>N===T))!=null?P:null;i(M),Le(r.current,{transition:`transform ${Te.DURATION}s cubic-bezier(${Te.EASE.join(",")})`,transform:_e(a)?`translate3d(0, ${T}px, 0)`:`translate3d(${T}px, 0, 0)`}),b&&M!==b.length-1&&s!==void 0&&M!==s&&M<s?Le(o.current,{transition:`opacity ${Te.DURATION}s cubic-bezier(${Te.EASE.join(",")})`,opacity:"0"}):Le(o.current,{transition:`opacity ${Te.DURATION}s cubic-bezier(${Te.EASE.join(",")})`,opacity:"1"}),d(n==null?void 0:n[Math.max(M,0)])},[r.current,n,b,s,o,d]);y.useEffect(()=>{if(u||e){var T;const P=(T=n==null?void 0:n.findIndex(M=>M===e||M===u))!=null?T:-1;b&&P!==-1&&typeof b[P]=="number"&&x(b[P])}},[u,e,n,b,x]);function C({draggedDistance:T,closeDrawer:P,velocity:M,dismissible:N}){if(s===void 0)return;const _=a==="bottom"||a==="right"?(S??0)-T:(S??0)+T,V=g===s-1,O=g===0,A=T>0;if(V&&Le(o.current,{transition:`opacity ${Te.DURATION}s cubic-bezier(${Te.EASE.join(",")})`}),!l&&M>2&&!A){N?P():x(b[0]);return}if(!l&&M>2&&A&&b&&n){x(b[n.length-1]);return}const L=b==null?void 0:b.reduce((F,k)=>typeof F!="number"||typeof k!="number"?F:Math.abs(k-_)<Math.abs(F-_)?k:F),R=_e(a)?window.innerHeight:window.innerWidth;if(M>bw&&Math.abs(T)<R*.4){const F=A?1:-1;if(F>0&&v&&n){x(b[n.length-1]);return}if(O&&F<0&&N&&P(),g===null)return;x(b[g+F]);return}x(L)}function E({draggedDistance:T}){if(S===null)return;const P=a==="bottom"||a==="right"?S-T:S+T;(a==="bottom"||a==="right")&&P<b[b.length-1]||(a==="top"||a==="left")&&P>b[b.length-1]||Le(r.current,{transform:_e(a)?`translate3d(0, ${P}px, 0)`:`translate3d(${P}px, 0, 0)`})}function D(T,P){if(!n||typeof g!="number"||!b||s===void 0)return null;const M=g===s-1;if(g>=s&&P)return 0;if(M&&!P)return 1;if(!w&&!M)return null;const _=M?g+1:g-1,V=M?b[_]-b[_-1]:b[_+1]-b[_],O=T/Math.abs(V);return M?1-O:O}return{isLastSnapPoint:v,activeSnapPoint:u,shouldFade:w,getPercentageDragged:D,setActiveSnapPoint:d,activeSnapPointIndex:g,onRelease:C,onDrag:E,snapPointsOffset:b}}const X_=()=>()=>{};function Z_(){const{direction:e,isOpen:t,shouldScaleBackground:n,setBackgroundColorOnScale:r,noBodyStyles:o}=ho(),s=y.useRef(null),i=y.useMemo(()=>document.body.style.backgroundColor,[]);function a(){return(window.innerWidth-wl)/window.innerWidth}y.useEffect(()=>{if(t&&n){s.current&&clearTimeout(s.current);const c=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!c)return;U_(r&&!o?yl(document.body,{background:"black"}):X_,yl(c,{transformOrigin:_e(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${Te.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Te.EASE.join(",")})`}));const l=yl(c,{borderRadius:`${xw}px`,overflow:"hidden",..._e(e)?{transform:`scale(${a()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${a()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{l(),s.current=window.setTimeout(()=>{i?document.body.style.background=i:document.body.style.removeProperty("background")},Te.DURATION*1e3)}}},[t,n,i])}let mo=null;function Q_({isOpen:e,modal:t,nested:n,hasBeenOpened:r,preventScrollRestoration:o,noBodyStyles:s}){const[i,a]=y.useState(()=>typeof window<"u"?window.location.href:""),c=y.useRef(0),l=y.useCallback(()=>{if(fw()&&mo===null&&e&&!s){mo={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};const{scrollX:d,innerHeight:f}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-c.current}px`,left:`${-d}px`,right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{const h=f-window.innerHeight;h&&c.current>=f&&(document.body.style.top=`${-(c.current+h)}px`)}),300)}},[e]),u=y.useCallback(()=>{if(fw()&&mo!==null&&!s){const d=-parseInt(document.body.style.top,10),f=-parseInt(document.body.style.left,10);Object.assign(document.body.style,mo),window.requestAnimationFrame(()=>{if(o&&i!==window.location.href){a(window.location.href);return}window.scrollTo(f,d)}),mo=null}},[i]);return y.useEffect(()=>{function d(){c.current=window.scrollY}return d(),window.addEventListener("scroll",d),()=>{window.removeEventListener("scroll",d)}},[]),y.useEffect(()=>{if(t)return()=>{typeof document>"u"||document.querySelector("[data-vaul-drawer]")||u()}},[t,u]),y.useEffect(()=>{n||!r||(e?(!window.matchMedia("(display-mode: standalone)").matches&&l(),t||window.setTimeout(()=>{u()},500)):u())},[e,r,i,t,n,l,u]),{restorePositionSetting:u}}function J_({open:e,onOpenChange:t,children:n,onDrag:r,onRelease:o,snapPoints:s,shouldScaleBackground:i=!1,setBackgroundColorOnScale:a=!0,closeThreshold:c=z_,scrollLockTimeout:l=K_,dismissible:u=!0,handleOnly:d=!1,fadeFromIndex:f=s&&s.length-1,activeSnapPoint:h,setActiveSnapPoint:v,fixed:g,modal:w=!0,onClose:b,nested:S,noBodyStyles:x=!1,direction:C="bottom",defaultOpen:E=!1,disablePreventScroll:D=!0,snapToSequentialPoint:T=!1,preventScrollRestoration:P=!1,repositionInputs:M=!0,onAnimationEnd:N,container:_,autoFocus:V=!1}){var O,A;const[L=!1,R]=Cw({defaultProp:E,prop:e,onChange:$=>{t==null||t($),!$&&!S&&Fl(),setTimeout(()=>{N==null||N($)},Te.DURATION*1e3),$&&!w&&typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),$||(document.body.style.pointerEvents="auto")}}),[F,k]=y.useState(!1),[I,B]=y.useState(!1),[U,j]=y.useState(!1),X=y.useRef(null),se=y.useRef(null),ne=y.useRef(null),ie=y.useRef(null),Y=y.useRef(null),J=y.useRef(!1),te=y.useRef(null),le=y.useRef(0),ae=y.useRef(!1),ue=y.useRef(!E),Ee=y.useRef(0),Z=y.useRef(null),lt=y.useRef(((O=Z.current)==null?void 0:O.getBoundingClientRect().height)||0),ut=y.useRef(((A=Z.current)==null?void 0:A.getBoundingClientRect().width)||0),Qe=y.useRef(0),Vn=y.useCallback($=>{s&&$===qt.length-1&&(se.current=new Date)},[]),{activeSnapPoint:hn,activeSnapPointIndex:pn,setActiveSnapPoint:Js,onRelease:ei,snapPointsOffset:qt,onDrag:vo,shouldFade:ti,getPercentageDragged:_l}=q_({snapPoints:s,activeSnapPointProp:h,setActiveSnapPointProp:v,drawerRef:Z,fadeFromIndex:f,overlayRef:X,onSnapPointChange:Vn,direction:C,container:_,snapToSequentialPoint:T});R_({isDisabled:!L||I||!w||U||!F||!M||!D});const{restorePositionSetting:Fl}=Q_({isOpen:L,modal:w,nested:S??!1,hasBeenOpened:F,preventScrollRestoration:P,noBodyStyles:x});function yr(){return(window.innerWidth-wl)/window.innerWidth}function Ll($){var ee,z;!u&&!s||Z.current&&!Z.current.contains($.target)||(lt.current=((ee=Z.current)==null?void 0:ee.getBoundingClientRect().height)||0,ut.current=((z=Z.current)==null?void 0:z.getBoundingClientRect().width)||0,B(!0),ne.current=new Date,hw()&&window.addEventListener("touchend",()=>J.current=!1,{once:!0}),$.target.setPointerCapture($.pointerId),le.current=_e(C)?$.pageY:$.pageX)}function ni($,ee){var z;let q=$;const he=(z=window.getSelection())==null?void 0:z.toString(),oe=Z.current?qs(Z.current,C):null,Re=new Date;if(q.tagName==="SELECT"||q.hasAttribute("data-vaul-no-drag")||q.closest("[data-vaul-no-drag]"))return!1;if(C==="right"||C==="left")return!0;if(se.current&&Re.getTime()-se.current.getTime()<500)return!1;if(oe!==null&&(C==="bottom"?oe>0:oe<0))return!0;if(he&&he.length>0)return!1;if(Y.current&&Re.getTime()-Y.current.getTime()<l&&oe===0||ee)return Y.current=Re,!1;for(;q;){if(q.scrollHeight>q.clientHeight){if(q.scrollTop!==0)return Y.current=new Date,!1;if(q.getAttribute("role")==="dialog")return!0}q=q.parentNode}return!0}function Vl($){if(Z.current&&I){const ee=C==="bottom"||C==="right"?1:-1,z=(le.current-(_e(C)?$.pageY:$.pageX))*ee,q=z>0,he=s&&!u&&!q;if(he&&pn===0)return;const oe=Math.abs(z),Re=document.querySelector("[data-vaul-drawer-wrapper]"),Wt=C==="bottom"||C==="top"?lt.current:ut.current;let Je=oe/Wt;const wt=_l(oe,q);if(wt!==null&&(Je=wt),he&&Je>=1||!J.current&&!ni($.target,q))return;if(Z.current.classList.add(bl),J.current=!0,Le(Z.current,{transition:"none"}),Le(X.current,{transition:"none"}),s&&vo({draggedDistance:z}),q&&!s){const $t=Y_(z),ii=Math.min($t*-1,0)*ee;Le(Z.current,{transform:_e(C)?`translate3d(0, ${ii}px, 0)`:`translate3d(${ii}px, 0, 0)`});return}const dt=1-Je;if((ti||f&&pn===f-1)&&(r==null||r($,Je),Le(X.current,{opacity:`${dt}`,transition:"none"},!0)),Re&&X.current&&i){const $t=Math.min(yr()+Je*(1-yr()),1),ii=8-Je*8,sb=Math.max(0,14-Je*14);Le(Re,{borderRadius:`${ii}px`,transform:_e(C)?`scale(${$t}) translate3d(0, ${sb}px, 0)`:`scale(${$t}) translate3d(${sb}px, 0, 0)`,transition:"none"},!0)}if(!s){const $t=oe*ee;Le(Z.current,{transform:_e(C)?`translate3d(0, ${$t}px, 0)`:`translate3d(${$t}px, 0, 0)`})}}}y.useEffect(()=>{window.requestAnimationFrame(()=>{ue.current=!0})},[]),y.useEffect(()=>{var $;function ee(){if(!Z.current||!M)return;const z=document.activeElement;if(vl(z)||ae.current){var q;const he=((q=window.visualViewport)==null?void 0:q.height)||0,oe=window.innerHeight;let Re=oe-he;const Wt=Z.current.getBoundingClientRect().height||0,Je=Wt>oe*.8;Qe.current||(Qe.current=Wt);const wt=Z.current.getBoundingClientRect().top;if(Math.abs(Ee.current-Re)>60&&(ae.current=!ae.current),s&&s.length>0&&qt&&pn){const dt=qt[pn]||0;Re+=dt}if(Ee.current=Re,Wt>he||ae.current){const dt=Z.current.getBoundingClientRect().height;let $t=dt;dt>he&&($t=he-(Je?wt:wl)),g?Z.current.style.height=`${dt-Math.max(Re,0)}px`:Z.current.style.height=`${Math.max($t,he-wt)}px`}else A_()||(Z.current.style.height=`${Qe.current}px`);s&&s.length>0&&!ae.current?Z.current.style.bottom="0px":Z.current.style.bottom=`${Math.max(Re,0)}px`}}return($=window.visualViewport)==null||$.addEventListener("resize",ee),()=>{var z;return(z=window.visualViewport)==null?void 0:z.removeEventListener("resize",ee)}},[pn,s,qt]);function Rn($){Rl(),b==null||b(),$||R(!1),setTimeout(()=>{s&&Js(s[0])},Te.DURATION*1e3)}function ri(){if(!Z.current)return;const $=document.querySelector("[data-vaul-drawer-wrapper]"),ee=qs(Z.current,C);Le(Z.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${Te.DURATION}s cubic-bezier(${Te.EASE.join(",")})`}),Le(X.current,{transition:`opacity ${Te.DURATION}s cubic-bezier(${Te.EASE.join(",")})`,opacity:"1"}),i&&ee&&ee>0&&L&&Le($,{borderRadius:`${xw}px`,overflow:"hidden",..._e(C)?{transform:`scale(${yr()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${yr()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${Te.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Te.EASE.join(",")})`},!0)}function Rl(){!I||!Z.current||(Z.current.classList.remove(bl),J.current=!1,B(!1),ie.current=new Date)}function Bl($){if(!I||!Z.current)return;Z.current.classList.remove(bl),J.current=!1,B(!1),ie.current=new Date;const ee=qs(Z.current,C);if(!$||!ni($.target,!1)||!ee||Number.isNaN(ee)||ne.current===null)return;const z=ie.current.getTime()-ne.current.getTime(),q=le.current-(_e(C)?$.pageY:$.pageX),he=Math.abs(q)/z;if(he>.05&&(j(!0),setTimeout(()=>{j(!1)},200)),s){ei({draggedDistance:q*(C==="bottom"||C==="right"?1:-1),closeDrawer:Rn,velocity:he,dismissible:u}),o==null||o($,!0);return}if(C==="bottom"||C==="right"?q>0:q<0){ri(),o==null||o($,!0);return}if(he>bw){Rn(),o==null||o($,!1);return}var oe;const Re=Math.min((oe=Z.current.getBoundingClientRect().height)!=null?oe:0,window.innerHeight);var Wt;const Je=Math.min((Wt=Z.current.getBoundingClientRect().width)!=null?Wt:0,window.innerWidth),wt=C==="left"||C==="right";if(Math.abs(ee)>=(wt?Je:Re)*c){Rn(),o==null||o($,!1);return}o==null||o($,!0),ri()}y.useEffect(()=>(L&&(Le(document.documentElement,{scrollBehavior:"auto"}),se.current=new Date),()=>{j_(document.documentElement,"scrollBehavior")}),[L]);function oi($){const ee=$?(window.innerWidth-Ln)/window.innerWidth:1,z=$?-Ln:0;te.current&&window.clearTimeout(te.current),Le(Z.current,{transition:`transform ${Te.DURATION}s cubic-bezier(${Te.EASE.join(",")})`,transform:_e(C)?`scale(${ee}) translate3d(0, ${z}px, 0)`:`scale(${ee}) translate3d(${z}px, 0, 0)`}),!$&&Z.current&&(te.current=setTimeout(()=>{const q=qs(Z.current,C);Le(Z.current,{transition:"none",transform:_e(C)?`translate3d(0, ${q}px, 0)`:`translate3d(${q}px, 0, 0)`})},500))}function Wl($,ee){if(ee<0)return;const z=(window.innerWidth-Ln)/window.innerWidth,q=z+ee*(1-z),he=-Ln+ee*Ln;Le(Z.current,{transform:_e(C)?`scale(${q}) translate3d(0, ${he}px, 0)`:`scale(${q}) translate3d(${he}px, 0, 0)`,transition:"none"})}function si($,ee){const z=_e(C)?window.innerHeight:window.innerWidth,q=ee?(z-Ln)/z:1,he=ee?-Ln:0;ee&&Le(Z.current,{transition:`transform ${Te.DURATION}s cubic-bezier(${Te.EASE.join(",")})`,transform:_e(C)?`scale(${q}) translate3d(0, ${he}px, 0)`:`scale(${q}) translate3d(${he}px, 0, 0)`})}return y.useEffect(()=>{w||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[w]),y.createElement(S_,{defaultOpen:E,onOpenChange:$=>{!u&&!$||($?k(!0):Rn(!0),R($))},open:L},y.createElement(dw.Provider,{value:{activeSnapPoint:hn,snapPoints:s,setActiveSnapPoint:Js,drawerRef:Z,overlayRef:X,onOpenChange:t,onPress:Ll,onRelease:Bl,onDrag:Vl,dismissible:u,shouldAnimate:ue,handleOnly:d,isOpen:L,isDragging:I,shouldFade:ti,closeDrawer:Rn,onNestedDrag:Wl,onNestedOpenChange:oi,onNestedRelease:si,keyboardIsOpen:ae,modal:w,snapPointsOffset:qt,activeSnapPointIndex:pn,direction:C,shouldScaleBackground:i,setBackgroundColorOnScale:a,noBodyStyles:x,container:_,autoFocus:V}},n))}const Tw=y.forwardRef(function({...e},t){const{overlayRef:n,snapPoints:r,onRelease:o,shouldFade:s,isOpen:i,modal:a,shouldAnimate:c}=ho(),l=yw(t,n),u=r&&r.length>0;if(!a)return null;const d=y.useCallback(f=>o(f),[o]);return y.createElement(E_,{onMouseUp:d,ref:l,"data-vaul-overlay":"","data-vaul-snap-points":i&&u?"true":"false","data-vaul-snap-points-overlay":i&&s?"true":"false","data-vaul-animate":c!=null&&c.current?"true":"false",...e})});Tw.displayName="Drawer.Overlay";const Ew=y.forwardRef(function({onPointerDownOutside:e,style:t,onOpenAutoFocus:n,...r},o){const{drawerRef:s,onPress:i,onRelease:a,onDrag:c,keyboardIsOpen:l,snapPointsOffset:u,activeSnapPointIndex:d,modal:f,isOpen:h,direction:v,snapPoints:g,container:w,handleOnly:b,shouldAnimate:S,autoFocus:x}=ho(),[C,E]=y.useState(!1),D=yw(o,s),T=y.useRef(null),P=y.useRef(null),M=y.useRef(!1),N=g&&g.length>0;Z_();const _=(O,A,L=0)=>{if(M.current)return!0;const R=Math.abs(O.y),F=Math.abs(O.x),k=F>R,I=["bottom","right"].includes(A)?1:-1;if(A==="left"||A==="right"){if(!(O.x*I<0)&&F>=0&&F<=L)return k}else if(!(O.y*I<0)&&R>=0&&R<=L)return!k;return M.current=!0,!0};y.useEffect(()=>{N&&window.requestAnimationFrame(()=>{E(!0)})},[]);function V(O){T.current=null,M.current=!1,a(O)}return y.createElement(P_,{"data-vaul-drawer-direction":v,"data-vaul-drawer":"","data-vaul-delayed-snap-points":C?"true":"false","data-vaul-snap-points":h&&N?"true":"false","data-vaul-custom-container":w?"true":"false","data-vaul-animate":S!=null&&S.current?"true":"false",...r,ref:D,style:u&&u.length>0?{"--snap-point-height":`${u[d??0]}px`,...t}:t,onPointerDown:O=>{b||(r.onPointerDown==null||r.onPointerDown.call(r,O),T.current={x:O.pageX,y:O.pageY},i(O))},onOpenAutoFocus:O=>{n==null||n(O),x||O.preventDefault()},onPointerDownOutside:O=>{if(e==null||e(O),!f||O.defaultPrevented){O.preventDefault();return}l.current&&(l.current=!1)},onFocusOutside:O=>{if(!f){O.preventDefault();return}},onPointerMove:O=>{if(P.current=O,b||(r.onPointerMove==null||r.onPointerMove.call(r,O),!T.current))return;const A=O.pageY-T.current.y,L=O.pageX-T.current.x,R=O.pointerType==="touch"?10:2;_({x:L,y:A},v,R)?c(O):(Math.abs(L)>R||Math.abs(A)>R)&&(T.current=null)},onPointerUp:O=>{r.onPointerUp==null||r.onPointerUp.call(r,O),T.current=null,M.current=!1,a(O)},onPointerOut:O=>{r.onPointerOut==null||r.onPointerOut.call(r,O),V(P.current)},onContextMenu:O=>{r.onContextMenu==null||r.onContextMenu.call(r,O),P.current&&V(P.current)}})});Ew.displayName="Drawer.Content";const eF=250,tF=120,nF=y.forwardRef(function({preventCycle:e=!1,children:t,...n},r){const{closeDrawer:o,isDragging:s,snapPoints:i,activeSnapPoint:a,setActiveSnapPoint:c,dismissible:l,handleOnly:u,isOpen:d,onPress:f,onDrag:h}=ho(),v=y.useRef(null),g=y.useRef(!1);function w(){if(g.current){x();return}window.setTimeout(()=>{b()},tF)}function b(){if(s||e||g.current){x();return}if(x(),!i||i.length===0){l||o();return}if(a===i[i.length-1]&&l){o();return}const E=i.findIndex(T=>T===a);if(E===-1)return;const D=i[E+1];c(D)}function S(){v.current=window.setTimeout(()=>{g.current=!0},eF)}function x(){v.current&&window.clearTimeout(v.current),g.current=!1}return y.createElement("div",{onClick:w,onPointerCancel:x,onPointerDown:C=>{u&&f(C),S()},onPointerMove:C=>{u&&h(C)},ref:r,"data-vaul-drawer-visible":d?"true":"false","data-vaul-handle":"","aria-hidden":"true",...n},y.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},t))});nF.displayName="Drawer.Handle";function rF(e){const t=ho(),{container:n=t.container,...r}=e;return y.createElement(T_,{container:n,...r})}const fn={Root:J_,Content:Ew,Overlay:Tw,Trigger:C_,Portal:rF,Close:O_,Title:D_,Description:M_},Pw=y.createContext({mode:"normal",shape:"full",hasSnapPoints:!1,direction:"bottom"}),Dw=()=>y.useContext(Pw),Mw=({mode:e="normal",shape:t="full",side:n="right",forceBottomSheet:r=!1,snapPoints:o,activeSnapPoint:s,setActiveSnapPoint:i,...a})=>{const l=ys("(min-width: 768px)")&&!r,u=l?n:"bottom";return p.jsx(Pw.Provider,{value:{mode:e,shape:t,hasSnapPoints:l?!1:!!o&&o.length>0,direction:u},children:p.jsx(fn.Root,{direction:u,...a,snapPoints:l?void 0:o,activeSnapPoint:l?void 0:s,setActiveSnapPoint:l?void 0:i})})};Mw.displayName="Sheet";const oF=fn.Trigger,sF=fn.Close,iF=fn.Portal,aF=fn.Title,cF=fn.Description,lF=Me("fixed z-50 flex flex-col bg-graphite-card shadow-lg",{variants:{side:{top:"inset-x-0 top-0",bottom:"inset-x-0 bottom-0 max-h-[96%]",left:"inset-y-0 left-0 w-full max-w-sm",right:"inset-y-0 right-0 w-full max-w-sm"},height:{snap:"h-full",auto:"h-auto"},shape:{full:"",minimal:"",sharp:""},mode:{normal:"",detached:""}},compoundVariants:[{side:"bottom",mode:"normal",className:"mx-auto max-w-xl"},{side:"bottom",mode:"detached",className:"inset-x-4 bottom-4 mx-auto max-w-lg"},{side:"bottom",mode:"normal",shape:"full",className:"rounded-t-3xl"},{side:"bottom",mode:"normal",shape:"minimal",className:"rounded-t-lg"},{side:"bottom",mode:"normal",shape:"sharp",className:"rounded-t-none"},{side:"bottom",mode:"detached",shape:"full",className:"rounded-2xl"},{side:"bottom",mode:"detached",shape:"minimal",className:"rounded-lg"},{side:"bottom",mode:"detached",shape:"sharp",className:"rounded-none"},{side:"left",shape:"full",mode:"normal",className:"rounded-r-2xl"},{side:"left",shape:"minimal",mode:"normal",className:"rounded-r-lg"},{side:"left",shape:"sharp",mode:"normal",className:"rounded-r-none"},{side:"left",shape:"full",mode:"detached",className:"left-4 rounded-2xl"},{side:"left",shape:"minimal",mode:"detached",className:"left-4 rounded-lg"},{side:"left",shape:"sharp",mode:"detached",className:"left-4 rounded-none"},{side:"right",shape:"full",mode:"normal",className:"rounded-l-2xl"},{side:"right",shape:"minimal",mode:"normal",className:"rounded-l-lg"},{side:"right",shape:"sharp",mode:"normal",className:"rounded-l-none"},{side:"right",shape:"full",mode:"detached",className:"top-4 bottom-4 right-4 rounded-2xl"},{side:"right",shape:"minimal",mode:"detached",className:"top-4 bottom-4 right-4 rounded-lg"},{side:"right",shape:"sharp",mode:"detached",className:"top-4 bottom-4 right-4 rounded-none"}],defaultVariants:{shape:"full",mode:"normal"}}),Ow=y.forwardRef(({className:e,shape:t,...n},r)=>{const{mode:o,shape:s,hasSnapPoints:i,direction:a}=Dw(),c=t||s,l=o==="detached"?{"--vaul-after-display":"0"}:{};return p.jsxs(iF,{children:[p.jsx(fn.Overlay,{className:"fixed inset-0 z-50 bg-black/50"}),p.jsx(fn.Content,{ref:r,style:{...n.style,...l},className:H(lF({side:a,mode:o,shape:c,height:a==="bottom"&&i?"snap":"auto"}),e),...n})]})});Ow.displayName="Sheet.Content";const Nw=({className:e,...t})=>p.jsx("div",{className:H("flex flex-col gap-1 p-6 text-center sm:text-left",e),...t});Nw.displayName="Sheet.Header";const Aw=({className:e,...t})=>p.jsx("div",{className:H("mt-auto flex flex-col gap-2 p-6",e),...t});Aw.displayName="Sheet.Footer";const kw=({className:e,...t})=>{const{direction:n}=Dw();return n!=="bottom"?null:p.jsx("div",{className:"flex-shrink-0 p-4",children:p.jsx("div",{className:H("mx-auto h-1.5 w-12 flex-shrink-0 rounded-full bg-graphite-foreground/40",e),...t})})};kw.displayName="Sheet.Grabber";const uF=Object.assign(Mw,{Trigger:oF,Content:Ow,Close:sF,Title:aF,Description:cF,Header:Nw,Footer:Aw,Grabber:kw}),Iw=({children:e,className:t,shape:n="full",...r})=>{if(y.Children.count(e)!==2)return console.error("SplitButton requires exactly two children."),null;const[o,s]=e,i={full:{left:"rounded-l-full",right:"rounded-r-full"},minimal:{left:"rounded-l-lg",right:"rounded-r-lg"},sharp:{left:"rounded-l-none",right:"rounded-r-none"}},a=y.cloneElement(o,{className:H(o.props.className,i[n].left,n==="sharp"?"!rounded-r-none":"!rounded-r-xs")}),c=y.cloneElement(s,{className:H(s.props.className,i[n].right,n==="sharp"?"!rounded-l-none":"!rounded-l-xs")});return p.jsxs("div",{className:H("inline-flex items-center gap-0.5",t),...r,children:[a,c]})};Iw.displayName="SplitButton";const dF=Me("transition-colors peer-focus:outline-none peer-focus:ring-2 peer-focus:ring-graphite-ring peer-focus:ring-offset-2 peer-disabled:opacity-50 peer-disabled:cursor-not-allowed bg-graphite-border peer-checked:bg-graphite-primary",{variants:{size:{sm:"w-10 h-6",md:"w-12 h-7",lg:"w-14 h-8"},shape:{full:"rounded-full",minimal:"rounded-xl",sharp:"rounded-none"}},defaultVariants:{size:"md",shape:"full"}}),fF=Me("absolute bg-white transition-transform duration-200 ease-in-out shadow-lg",{variants:{size:{sm:"h-5 w-5 top-[2px] left-[2px]",md:"h-6 w-6 top-[2px] left-[2px]",lg:"h-7 w-7 top-[2px] left-[2px]"},shape:{full:"rounded-full",minimal:"rounded-lg",sharp:"rounded-none"}},defaultVariants:{size:"md",shape:"full"}}),hF={sm:"peer-checked:translate-x-4",md:"peer-checked:translate-x-5",lg:"peer-checked:translate-x-6"},_w=y.forwardRef(({className:e,id:t,label:n,size:r="md",shape:o="full",...s},i)=>{const a=y.useId(),c=t||a;return p.jsxs("label",{htmlFor:c,className:H("inline-flex items-center cursor-pointer",e),children:[p.jsxs("div",{className:"relative",children:[p.jsx("input",{type:"checkbox",ref:i,id:c,className:"sr-only peer",...s}),p.jsx("div",{className:H(dF({size:r,shape:o}))}),p.jsx("div",{className:H(fF({size:r,shape:o}),hF[r])})]}),n&&p.jsx("div",{className:"ml-3 text-sm font-medium text-graphite-foreground select-none",children:n})]})});_w.displayName="Switch";const Fw=y.createContext(null),Xs=()=>{const e=y.useContext(Fw);if(!e)throw new Error("useTabs must be used within a <Tabs> provider.");return e},pF=({children:e,defaultValue:t,variant:n="primary",pageTransition:r="fade",routingMode:o="search",routingParamName:s="tab",initialTab:i})=>{const a=y.useId();return p.jsx(Gy,{mode:o,paramName:s,children:p.jsx(mF,{defaultValue:t,variant:n,pageTransition:r,indicatorId:a,initialTab:i,children:e})})},mF=({children:e,defaultValue:t,variant:n="primary",pageTransition:r="fade",indicatorId:o,initialTab:s})=>{const{path:i,push:a,replace:c}=Us(),{mode:l}=Ky();y.useEffect(()=>{s&&c(s)},[s]);const u=i==="/"?t:i,d=f=>{f!==u&&a(f)};return p.jsx(Fw.Provider,{value:{activeTab:u,setActiveTab:d,variant:n,pageTransition:r,indicatorId:o},children:e})},Lw=y.forwardRef(({children:e,className:t,...n},r)=>{const o=y.useRef(null),[s,i]=y.useState(!1),[a,c]=y.useState("start");y.useImperativeHandle(r,()=>o.current);const l=y.useCallback(()=>{const f=o.current;if(!f)return;const h=f.scrollWidth>f.clientWidth;if(i(h),!h){c("start");return}const v=f.scrollLeft<=1,g=f.scrollLeft>=f.scrollWidth-f.clientWidth-1;c(v?"start":g?"end":"middle")},[]);y.useEffect(()=>{const f=o.current;if(!f)return;l();const h=new ResizeObserver(l);h.observe(f);const v=new MutationObserver(l);return v.observe(f,{childList:!0,subtree:!0}),()=>{h.disconnect(),v.disconnect()}},[l]);const u=()=>{l()},d={start:{maskImage:"linear-gradient(to right, black calc(100% - 48px), transparent 100%)"},middle:{maskImage:"linear-gradient(to right, transparent 0%, black 48px, black calc(100% - 48px), transparent 100%)"},end:{maskImage:"linear-gradient(to right, transparent 0%, black 48px)"}};return p.jsx("div",{ref:o,role:"tablist",onScroll:u,className:H("relative flex border-b border-graphite-border",s&&"overflow-x-auto no-scrollbar",t),style:s?d[a]:{},...n,children:e})});Lw.displayName="Tabs.List";const gF=Me("relative flex px-6 flex-col items-center justify-center gap-1.5 flex-1 min-h-14 max-auto pb-2 pt-2 font-semibold text-sm transition-colors duration-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-graphite-ring focus-visible:ring-offset-2",{variants:{variant:{primary:"pt-1",secondary:""},isActive:{true:"text-graphite-primary",false:"text-graphite-foreground/60 hover:text-graphite-foreground/80"}},defaultVariants:{variant:"primary",isActive:!1}}),Vw=y.forwardRef(({value:e,children:t,icon:n,className:r,...o},s)=>{const{activeTab:i,setActiveTab:a,variant:c,indicatorId:l}=Xs(),u=i===e,d=y.useRef(null),[,f]=rt({ref:d,color:"rgba(0, 0, 0, 0.1)",duration:450});return y.useImperativeHandle(s,()=>d.current),y.useEffect(()=>{u&&d.current&&d.current.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})},[u]),p.jsxs("button",{ref:d,role:"tab","aria-selected":u,"data-state":u?"active":"inactive",onClick:()=>a(e),onPointerDown:f,className:H(gF({variant:c,isActive:u}),r),...o,children:[c==="primary"&&n,p.jsx("span",{className:"relative z-10",children:t}),u&&p.jsx(we.div,{layoutId:l,className:H("absolute bottom-0 rounded-full bg-graphite-primary",c==="primary"?"w-8":"w-full"),style:{height:"2px"},transition:{type:"spring",stiffness:400,damping:35}})]})});Vw.displayName="Tabs.Trigger";const Rw=y.forwardRef(({children:e,className:t,...n},r)=>{const{activeTab:o,setActiveTab:s,pageTransition:i}=Xs(),a=y.useRef(null),[c,l]=y.useState(0),u=Wr(0);if(i==="fade"){const g=y.Children.toArray(e).find(w=>{var b;return y.isValidElement(w)&&((b=w.props)==null?void 0:b.value)===o});return p.jsx("div",{ref:r,className:H("relative",t),...n,children:p.jsx(Kn,{mode:"wait",children:g&&y.isValidElement(g)?y.cloneElement(g,{key:o}):null})})}const d=y.Children.toArray(e).filter(y.isValidElement),f=d.map(g=>g.props.value),h=f.indexOf(o);y.useEffect(()=>{const g=()=>{a.current&&l(a.current.offsetWidth)};return g(),window.addEventListener("resize",g),()=>window.removeEventListener("resize",g)},[]),y.useEffect(()=>{if(c>0){const g=-h*c;Na(u,g,{type:"spring",stiffness:400,damping:40})}},[h,c,u]);const v=(g,w)=>{const{offset:b,velocity:S}=w,x=300,C=c*.3;if(S.x<-x||b.x<-C){const E=Math.min(h+1,d.length-1);s(f[E])}else if(S.x>x||b.x>C){const E=Math.max(h-1,0);s(f[E])}else Na(u,-h*c,{type:"spring",stiffness:400,damping:40})};return p.jsx("div",{ref:a,className:H("overflow-hidden",t),...n,children:p.jsx(we.div,{role:"tabpanel",ref:r,className:"flex cursor-grab active:cursor-grabbing",style:{x:u},drag:"x",dragConstraints:{left:-c*(d.length-1),right:0},onDragEnd:v,children:d})})});Rw.displayName="Tabs.Content";const Bw=y.forwardRef(({value:e,children:t,className:n,...r},o)=>{const{activeTab:s,pageTransition:i}=Xs();return i==="fade"?p.jsx(we.div,{ref:o,role:"tabpanel",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:{duration:.1}},transition:{duration:.2},className:H("p-4",n),...r,children:t}):p.jsx("div",{ref:o,role:"tabpanel",className:H("w-full flex-shrink-0 p-4 min-h-[100px]",n),"aria-hidden":s!==e,...r,children:t})});Bw.displayName="Tabs.Panel";const vF=Object.assign(pF,{List:Lw,Trigger:Vw,Content:Rw,Panel:Bw}),yF=Me("flex items-start transition-all duration-200 w-full",{variants:{variant:{primary:"bg-graphite-card border-2 px-4",secondary:"bg-graphite-secondary border-2 px-4",minimal:"bg-transparent p-0"},shape:{full:"rounded-4xl",minimal:"rounded-2xl",sharp:"rounded-none"},size:{sm:"py-2 text-sm",md:"py-3 text-base",lg:"py-4 text-lg"},isErrored:{true:""},isFocused:{true:""},disabled:{true:"bg-graphite-secondary opacity-50 cursor-not-allowed"}},compoundVariants:[{variant:"primary",isErrored:!1,isFocused:!1,className:"border-graphite-border"},{variant:"secondary",isErrored:!1,isFocused:!1,className:"border-transparent"},{variant:"primary",isFocused:!0,isErrored:!1,className:"border-graphite-primary"},{variant:"secondary",isFocused:!0,isErrored:!1,className:"border-graphite-primary"},{variant:"primary",isFocused:!1,isErrored:!0,className:"border-red-500"},{variant:"secondary",isFocused:!1,isErrored:!0,className:"border-red-500"},{variant:"primary",isFocused:!0,isErrored:!0,className:"border-red-600"},{variant:"secondary",isFocused:!0,isErrored:!0,className:"border-red-600"},{variant:"minimal",className:"rounded-none border-0"}],defaultVariants:{variant:"primary",shape:"minimal",size:"md"}}),Ww=y.forwardRef(({className:e,id:t,label:n,error:r,disabled:o,shape:s,size:i,wrapperClassName:a,variant:c,onFocus:l,onBlur:u,onChange:d,rows:f=3,value:h,...v},g)=>{const w=y.useId(),b=t||w,S=!!r,[x,C]=y.useState(!1),E=y.useRef(null);y.useImperativeHandle(g,()=>E.current);const D=()=>{const N=E.current;N&&(N.style.height="auto",N.style.height=`${N.scrollHeight}px`)};y.useEffect(()=>{D()},[h]);const T=N=>{C(!0),l==null||l(N)},P=N=>{C(!1),u==null||u(N)},M=N=>{D(),d==null||d(N)};return p.jsxs("div",{className:"w-full flex flex-col gap-2",children:[n&&p.jsx("label",{htmlFor:b,className:"block text-sm font-medium text-graphite-primary",children:n}),p.jsx("div",{className:yF({variant:c,shape:s,size:i,isErrored:S,isFocused:x,disabled:o,className:a}),children:p.jsx("textarea",{id:b,ref:E,disabled:o,rows:f,onFocus:T,onBlur:P,onChange:M,value:h,className:H("w-full flex-1 bg-transparent focus:outline-none resize-none overflow-hidden","disabled:cursor-not-allowed",c==="secondary"&&"placeholder:text-gray-500",e),...v})}),S&&p.jsx("p",{className:"mt-2 text-sm text-red-600",children:r})]})});Ww.displayName="TextArea";function wF(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function bF(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function $w(){return/apple/i.test(navigator.vendor)}function xF(){return wF().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function SF(){return bF().includes("jsdom/")}const Hw="data-floating-ui-focusable",CF="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function xl(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function gr(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&dc(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function vr(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Sl(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function TF(e){return e.matches("html,body")}function Vt(e){return(e==null?void 0:e.ownerDocument)||document}function EF(e){return Ze(e)&&e.matches(CF)}function PF(e){if(!e||SF())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function DF(e){return e?e.hasAttribute(Hw)?e:e.querySelector("["+Hw+"]")||e:null}function Zs(e,t,n){return n===void 0&&(n=!0),e.filter(o=>{var s;return o.parentId===t&&(!n||((s=o.context)==null?void 0:s.open))}).flatMap(o=>[o,...Zs(e,o.id,n)])}function MF(e){return"nativeEvent"in e}function Cl(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}var OF=typeof document<"u",NF=function(){},Rt=OF?y.useLayoutEffect:NF;const AF={...m};function Qs(e){const t=m.useRef(e);return Rt(()=>{t.current=e}),t}const kF=AF.useInsertionEffect||(e=>e());function Bt(e){const t=m.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return kF(()=>{t.current=e}),m.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}const jw=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Yw(e,t){const n=Ts(e,jw()),r=n.length;if(r===0)return;const o=xl(Vt(e)),s=n.indexOf(o),i=s===-1?t===1?0:r-1:s+t;return n[i]}function IF(e){return Yw(Vt(e).body,1)||e}function _F(e){return Yw(Vt(e).body,-1)||e}function Tl(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!gr(n,r)}function FF(e){Ts(e,jw()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Uw(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const LF="data-floating-ui-focusable",zw="active",Kw="selected",VF={...m};let Gw=!1,RF=0;const qw=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+RF++;function BF(){const[e,t]=m.useState(()=>Gw?qw():void 0);return Rt(()=>{e==null&&t(qw())},[]),m.useEffect(()=>{Gw=!0},[]),e}const El=VF.useId||BF;let Pl;process.env.NODE_ENV!=="production"&&(Pl=new Set);function WF(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=Pl)!=null&&e.has(o))){var s;(s=Pl)==null||s.add(o),console.error(o)}}function $F(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}const HF=m.createContext(null),jF=m.createContext(null),Dl=()=>{var e;return((e=m.useContext(HF))==null?void 0:e.id)||null},Ml=()=>m.useContext(jF);function go(e){return"data-floating-ui-"+e}function ct(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const Xw=go("safe-polygon");function Ol(e,t,n){if(n&&!Cl(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const r=e();return typeof r=="number"?r:r==null?void 0:r[t]}return e==null?void 0:e[t]}function Nl(e){return typeof e=="function"?e():e}function YF(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:s,elements:i}=e,{enabled:a=!0,delay:c=0,handleClose:l=null,mouseOnly:u=!1,restMs:d=0,move:f=!0}=t,h=Ml(),v=Dl(),g=Qs(l),w=Qs(c),b=Qs(n),S=Qs(d),x=m.useRef(),C=m.useRef(-1),E=m.useRef(),D=m.useRef(-1),T=m.useRef(!0),P=m.useRef(!1),M=m.useRef(()=>{}),N=m.useRef(!1),_=Bt(()=>{var F;const k=(F=o.current.openEvent)==null?void 0:F.type;return(k==null?void 0:k.includes("mouse"))&&k!=="mousedown"});m.useEffect(()=>{if(!a)return;function F(k){let{open:I}=k;I||(ct(C),ct(D),T.current=!0,N.current=!1)}return s.on("openchange",F),()=>{s.off("openchange",F)}},[a,s]),m.useEffect(()=>{if(!a||!g.current||!n)return;function F(I){_()&&r(!1,I,"hover")}const k=Vt(i.floating).documentElement;return k.addEventListener("mouseleave",F),()=>{k.removeEventListener("mouseleave",F)}},[i.floating,n,r,a,g,_]);const V=m.useCallback(function(F,k,I){k===void 0&&(k=!0),I===void 0&&(I="hover");const B=Ol(w.current,"close",x.current);B&&!E.current?(ct(C),C.current=window.setTimeout(()=>r(!1,F,I),B)):k&&(ct(C),r(!1,F,I))},[w,r]),O=Bt(()=>{M.current(),E.current=void 0}),A=Bt(()=>{if(P.current){const F=Vt(i.floating).body;F.style.pointerEvents="",F.removeAttribute(Xw),P.current=!1}}),L=Bt(()=>o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1);m.useEffect(()=>{if(!a)return;function F(j){if(ct(C),T.current=!1,u&&!Cl(x.current)||Nl(S.current)>0&&!Ol(w.current,"open"))return;const X=Ol(w.current,"open",x.current);X?C.current=window.setTimeout(()=>{b.current||r(!0,j,"hover")},X):n||r(!0,j,"hover")}function k(j){if(L()){A();return}M.current();const X=Vt(i.floating);if(ct(D),N.current=!1,g.current&&o.current.floatingContext){n||ct(C),E.current=g.current({...o.current.floatingContext,tree:h,x:j.clientX,y:j.clientY,onClose(){A(),O(),L()||V(j,!0,"safe-polygon")}});const ne=E.current;X.addEventListener("mousemove",ne),M.current=()=>{X.removeEventListener("mousemove",ne)};return}(x.current==="touch"?!gr(i.floating,j.relatedTarget):!0)&&V(j)}function I(j){L()||o.current.floatingContext&&(g.current==null||g.current({...o.current.floatingContext,tree:h,x:j.clientX,y:j.clientY,onClose(){A(),O(),L()||V(j)}})(j))}function B(){ct(C)}function U(j){L()||V(j,!1)}if(ye(i.domReference)){const j=i.domReference,X=i.floating;return n&&j.addEventListener("mouseleave",I),f&&j.addEventListener("mousemove",F,{once:!0}),j.addEventListener("mouseenter",F),j.addEventListener("mouseleave",k),X&&(X.addEventListener("mouseleave",I),X.addEventListener("mouseenter",B),X.addEventListener("mouseleave",U)),()=>{n&&j.removeEventListener("mouseleave",I),f&&j.removeEventListener("mousemove",F),j.removeEventListener("mouseenter",F),j.removeEventListener("mouseleave",k),X&&(X.removeEventListener("mouseleave",I),X.removeEventListener("mouseenter",B),X.removeEventListener("mouseleave",U))}}},[i,a,e,u,f,V,O,A,r,n,b,h,w,g,o,L,S]),Rt(()=>{var F;if(a&&n&&(F=g.current)!=null&&(F=F.__options)!=null&&F.blockPointerEvents&&_()){P.current=!0;const I=i.floating;if(ye(i.domReference)&&I){var k;const B=Vt(i.floating).body;B.setAttribute(Xw,"");const U=i.domReference,j=h==null||(k=h.nodesRef.current.find(X=>X.id===v))==null||(k=k.context)==null?void 0:k.elements.floating;return j&&(j.style.pointerEvents=""),B.style.pointerEvents="none",U.style.pointerEvents="auto",I.style.pointerEvents="auto",()=>{B.style.pointerEvents="",U.style.pointerEvents="",I.style.pointerEvents=""}}}},[a,n,v,i,h,g,_]),Rt(()=>{n||(x.current=void 0,N.current=!1,O(),A())},[n,O,A]),m.useEffect(()=>()=>{O(),ct(C),ct(D),A()},[a,i.domReference,O,A]);const R=m.useMemo(()=>{function F(k){x.current=k.pointerType}return{onPointerDown:F,onPointerEnter:F,onMouseMove(k){const{nativeEvent:I}=k;function B(){!T.current&&!b.current&&r(!0,I,"hover")}u&&!Cl(x.current)||n||Nl(S.current)===0||N.current&&k.movementX**2+k.movementY**2<2||(ct(D),x.current==="touch"?B():(N.current=!0,D.current=window.setTimeout(B,Nl(S.current))))}}},[u,r,n,b,S]);return m.useMemo(()=>a?{reference:R}:{},[a,R])}const Zw={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},Qw=m.forwardRef(function(t,n){const[r,o]=m.useState();Rt(()=>{$w()&&o("button")},[]);const s={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[go("focus-guard")]:"",style:Zw};return p.jsx("span",{...t,...s})}),Jw=m.createContext(null),eb=go("portal");function UF(e){e===void 0&&(e={});const{id:t,root:n}=e,r=El(),o=KF(),[s,i]=m.useState(null),a=m.useRef(null);return Rt(()=>()=>{s==null||s.remove(),queueMicrotask(()=>{a.current=null})},[s]),Rt(()=>{if(!r||a.current)return;const c=t?document.getElementById(t):null;if(!c)return;const l=document.createElement("div");l.id=r,l.setAttribute(eb,""),c.appendChild(l),a.current=l,i(l)},[t,r]),Rt(()=>{if(n===null||!r||a.current)return;let c=n||(o==null?void 0:o.portalNode);c&&!uc(c)&&(c=c.current),c=c||document.body;let l=null;t&&(l=document.createElement("div"),l.id=t,c.appendChild(l));const u=document.createElement("div");u.id=r,u.setAttribute(eb,""),c=l||c,c.appendChild(u),a.current=u,i(u)},[t,n,r,o]),s}function zF(e){const{children:t,id:n,root:r,preserveTabOrder:o=!0}=e,s=UF({id:n,root:r}),[i,a]=m.useState(null),c=m.useRef(null),l=m.useRef(null),u=m.useRef(null),d=m.useRef(null),f=i==null?void 0:i.modal,h=i==null?void 0:i.open,v=!!i&&!i.modal&&i.open&&o&&!!(r||s);return m.useEffect(()=>{if(!s||!o||f)return;function g(w){s&&Tl(w)&&(w.type==="focusin"?Uw:FF)(s)}return s.addEventListener("focusin",g,!0),s.addEventListener("focusout",g,!0),()=>{s.removeEventListener("focusin",g,!0),s.removeEventListener("focusout",g,!0)}},[s,o,f]),m.useEffect(()=>{s&&(h||Uw(s))},[h,s]),p.jsxs(Jw.Provider,{value:m.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:c,afterOutsideRef:l,beforeInsideRef:u,afterInsideRef:d,portalNode:s,setFocusManagerState:a}),[o,s]),children:[v&&s&&p.jsx(Qw,{"data-type":"outside",ref:c,onFocus:g=>{if(Tl(g,s)){var w;(w=u.current)==null||w.focus()}else{const b=i?i.domReference:null,S=_F(b);S==null||S.focus()}}}),v&&s&&p.jsx("span",{"aria-owns":s.id,style:Zw}),s&&wr.createPortal(t,s),v&&s&&p.jsx(Qw,{"data-type":"outside",ref:l,onFocus:g=>{if(Tl(g,s)){var w;(w=d.current)==null||w.focus()}else{const b=i?i.domReference:null,S=IF(b);S==null||S.focus(),i!=null&&i.closeOnFocusOut&&(i==null||i.onOpenChange(!1,g.nativeEvent,"focus-out"))}}})]})}const KF=()=>m.useContext(Jw),GF={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},qF={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},tb=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function XF(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:s}=e,{enabled:i=!0,escapeKey:a=!0,outsidePress:c=!0,outsidePressEvent:l="pointerdown",referencePress:u=!1,referencePressEvent:d="pointerdown",ancestorScroll:f=!1,bubbles:h,capture:v}=t,g=Ml(),w=Bt(typeof c=="function"?c:()=>!1),b=typeof c=="function"?w:c,S=m.useRef(!1),{escapeKey:x,outsidePress:C}=tb(h),{escapeKey:E,outsidePress:D}=tb(v),T=m.useRef(!1),P=Bt(A=>{var L;if(!n||!i||!a||A.key!=="Escape"||T.current)return;const R=(L=s.current.floatingContext)==null?void 0:L.nodeId,F=g?Zs(g.nodesRef.current,R):[];if(!x&&(A.stopPropagation(),F.length>0)){let k=!0;if(F.forEach(I=>{var B;if((B=I.context)!=null&&B.open&&!I.context.dataRef.current.__escapeKeyBubbles){k=!1;return}}),!k)return}r(!1,MF(A)?A.nativeEvent:A,"escape-key")}),M=Bt(A=>{var L;const R=()=>{var F;P(A),(F=vr(A))==null||F.removeEventListener("keydown",R)};(L=vr(A))==null||L.addEventListener("keydown",R)}),N=Bt(A=>{var L;const R=s.current.insideReactTree;s.current.insideReactTree=!1;const F=S.current;if(S.current=!1,l==="click"&&F||R||typeof b=="function"&&!b(A))return;const k=vr(A),I="["+go("inert")+"]",B=Vt(o.floating).querySelectorAll(I);let U=ye(k)?k:null;for(;U&&!Kt(U);){const ne=Gt(U);if(Kt(ne)||!ye(ne))break;U=ne}if(B.length&&ye(k)&&!TF(k)&&!gr(k,o.floating)&&Array.from(B).every(ne=>!gr(U,ne)))return;if(Ze(k)&&O){const ne=Kt(k),ie=st(k),Y=/auto|scroll/,J=ne||Y.test(ie.overflowX),te=ne||Y.test(ie.overflowY),le=J&&k.clientWidth>0&&k.scrollWidth>k.clientWidth,ae=te&&k.clientHeight>0&&k.scrollHeight>k.clientHeight,ue=ie.direction==="rtl",Ee=ae&&(ue?A.offsetX<=k.offsetWidth-k.clientWidth:A.offsetX>k.clientWidth),Z=le&&A.offsetY>k.clientHeight;if(Ee||Z)return}const j=(L=s.current.floatingContext)==null?void 0:L.nodeId,X=g&&Zs(g.nodesRef.current,j).some(ne=>{var ie;return Sl(A,(ie=ne.context)==null?void 0:ie.elements.floating)});if(Sl(A,o.floating)||Sl(A,o.domReference)||X)return;const se=g?Zs(g.nodesRef.current,j):[];if(se.length>0){let ne=!0;if(se.forEach(ie=>{var Y;if((Y=ie.context)!=null&&Y.open&&!ie.context.dataRef.current.__outsidePressBubbles){ne=!1;return}}),!ne)return}r(!1,A,"outside-press")}),_=Bt(A=>{var L;const R=()=>{var F;N(A),(F=vr(A))==null||F.removeEventListener(l,R)};(L=vr(A))==null||L.addEventListener(l,R)});m.useEffect(()=>{if(!n||!i)return;s.current.__escapeKeyBubbles=x,s.current.__outsidePressBubbles=C;let A=-1;function L(B){r(!1,B,"ancestor-scroll")}function R(){window.clearTimeout(A),T.current=!0}function F(){A=window.setTimeout(()=>{T.current=!1},ts()?5:0)}const k=Vt(o.floating);a&&(k.addEventListener("keydown",E?M:P,E),k.addEventListener("compositionstart",R),k.addEventListener("compositionend",F)),b&&k.addEventListener(l,D?_:N,D);let I=[];return f&&(ye(o.domReference)&&(I=on(o.domReference)),ye(o.floating)&&(I=I.concat(on(o.floating))),!ye(o.reference)&&o.reference&&o.reference.contextElement&&(I=I.concat(on(o.reference.contextElement)))),I=I.filter(B=>{var U;return B!==((U=k.defaultView)==null?void 0:U.visualViewport)}),I.forEach(B=>{B.addEventListener("scroll",L,{passive:!0})}),()=>{a&&(k.removeEventListener("keydown",E?M:P,E),k.removeEventListener("compositionstart",R),k.removeEventListener("compositionend",F)),b&&k.removeEventListener(l,D?_:N,D),I.forEach(B=>{B.removeEventListener("scroll",L)}),window.clearTimeout(A)}},[s,o,a,b,l,n,r,f,i,x,C,P,E,M,N,D,_]),m.useEffect(()=>{s.current.insideReactTree=!1},[s,b,l]);const V=m.useMemo(()=>({onKeyDown:P,...u&&{[GF[d]]:A=>{r(!1,A.nativeEvent,"reference-press")},...d!=="click"&&{onClick(A){r(!1,A.nativeEvent,"reference-press")}}}}),[P,r,u,d]),O=m.useMemo(()=>({onKeyDown:P,onMouseDown(){S.current=!0},onMouseUp(){S.current=!0},[qF[l]]:()=>{s.current.insideReactTree=!0}}),[P,l,s]);return m.useMemo(()=>i?{reference:V,floating:O}:{},[i,V,O])}function ZF(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=El(),s=m.useRef({}),[i]=m.useState(()=>$F()),a=Dl()!=null;if(process.env.NODE_ENV!=="production"){const h=r.reference;h&&!ye(h)&&WF("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[c,l]=m.useState(r.reference),u=Bt((h,v,g)=>{s.current.openEvent=h?v:void 0,i.emit("openchange",{open:h,event:v,reason:g,nested:a}),n==null||n(h,v,g)}),d=m.useMemo(()=>({setPositionReference:l}),[]),f=m.useMemo(()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference}),[c,r.reference,r.floating]);return m.useMemo(()=>({dataRef:s,open:t,onOpenChange:u,elements:f,events:i,floatingId:o,refs:d}),[t,u,f,i,o,d])}function QF(e){e===void 0&&(e={});const{nodeId:t}=e,n=ZF({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[s,i]=m.useState(null),[a,c]=m.useState(null),u=(o==null?void 0:o.domReference)||s,d=m.useRef(null),f=Ml();Rt(()=>{u&&(d.current=u)},[u]);const h=cm({...e,elements:{...o,...a&&{reference:a}}}),v=m.useCallback(x=>{const C=ye(x)?{getBoundingClientRect:()=>x.getBoundingClientRect(),getClientRects:()=>x.getClientRects(),contextElement:x}:x;c(C),h.refs.setReference(C)},[h.refs]),g=m.useCallback(x=>{(ye(x)||x===null)&&(d.current=x,i(x)),(ye(h.refs.reference.current)||h.refs.reference.current===null||x!==null&&!ye(x))&&h.refs.setReference(x)},[h.refs]),w=m.useMemo(()=>({...h.refs,setReference:g,setPositionReference:v,domReference:d}),[h.refs,g,v]),b=m.useMemo(()=>({...h.elements,domReference:u}),[h.elements,u]),S=m.useMemo(()=>({...h,...r,refs:w,elements:b,nodeId:t}),[h,w,b,t,r]);return Rt(()=>{r.dataRef.current.floatingContext=S;const x=f==null?void 0:f.nodesRef.current.find(C=>C.id===t);x&&(x.context=S)}),m.useMemo(()=>({...h,context:S,refs:w,elements:b}),[h,w,b,S])}function Al(){return xF()&&$w()}function JF(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:s,elements:i}=e,{enabled:a=!0,visibleOnly:c=!0}=t,l=m.useRef(!1),u=m.useRef(-1),d=m.useRef(!0);m.useEffect(()=>{if(!a)return;const h=ze(i.domReference);function v(){!n&&Ze(i.domReference)&&i.domReference===xl(Vt(i.domReference))&&(l.current=!0)}function g(){d.current=!0}function w(){d.current=!1}return h.addEventListener("blur",v),Al()&&(h.addEventListener("keydown",g,!0),h.addEventListener("pointerdown",w,!0)),()=>{h.removeEventListener("blur",v),Al()&&(h.removeEventListener("keydown",g,!0),h.removeEventListener("pointerdown",w,!0))}},[i.domReference,n,a]),m.useEffect(()=>{if(!a)return;function h(v){let{reason:g}=v;(g==="reference-press"||g==="escape-key")&&(l.current=!0)}return o.on("openchange",h),()=>{o.off("openchange",h)}},[o,a]),m.useEffect(()=>()=>{ct(u)},[]);const f=m.useMemo(()=>({onMouseLeave(){l.current=!1},onFocus(h){if(l.current)return;const v=vr(h.nativeEvent);if(c&&ye(v)){if(Al()&&!h.relatedTarget){if(!d.current&&!EF(v))return}else if(!PF(v))return}r(!0,h.nativeEvent,"focus")},onBlur(h){l.current=!1;const v=h.relatedTarget,g=h.nativeEvent,w=ye(v)&&v.hasAttribute(go("focus-guard"))&&v.getAttribute("data-type")==="outside";u.current=window.setTimeout(()=>{var b;const S=xl(i.domReference?i.domReference.ownerDocument:document);!v&&S===i.domReference||gr((b=s.current.floatingContext)==null?void 0:b.refs.floating.current,S)||gr(i.domReference,S)||w||r(!1,g,"focus")})}}),[s,i.domReference,r,c]);return m.useMemo(()=>a?{reference:f}:{},[a,f])}function kl(e,t,n){const r=new Map,o=n==="item";let s=e;if(o&&e){const{[zw]:i,[Kw]:a,...c}=e;s=c}return{...n==="floating"&&{tabIndex:-1,[LF]:""},...s,...t.map(i=>{const a=i?i[n]:null;return typeof a=="function"?e?a(e):null:a}).concat(e).reduce((i,a)=>(a&&Object.entries(a).forEach(c=>{let[l,u]=c;if(!(o&&[zw,Kw].includes(l)))if(l.indexOf("on")===0){if(r.has(l)||r.set(l,[]),typeof u=="function"){var d;(d=r.get(l))==null||d.push(u),i[l]=function(){for(var f,h=arguments.length,v=new Array(h),g=0;g<h;g++)v[g]=arguments[g];return(f=r.get(l))==null?void 0:f.map(w=>w(...v)).find(w=>w!==void 0)}}}else i[l]=u}),i),{})}}function eL(e){e===void 0&&(e=[]);const t=e.map(a=>a==null?void 0:a.reference),n=e.map(a=>a==null?void 0:a.floating),r=e.map(a=>a==null?void 0:a.item),o=m.useCallback(a=>kl(a,e,"reference"),t),s=m.useCallback(a=>kl(a,e,"floating"),n),i=m.useCallback(a=>kl(a,e,"item"),r);return m.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:i}),[o,s,i])}const tL=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function nL(e,t){var n,r;t===void 0&&(t={});const{open:o,elements:s,floatingId:i}=e,{enabled:a=!0,role:c="dialog"}=t,l=El(),u=((n=s.domReference)==null?void 0:n.id)||l,d=m.useMemo(()=>{var S;return((S=DF(s.floating))==null?void 0:S.id)||i},[s.floating,i]),f=(r=tL.get(c))!=null?r:c,v=Dl()!=null,g=m.useMemo(()=>f==="tooltip"||c==="label"?{["aria-"+(c==="label"?"labelledby":"describedby")]:o?d:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":f==="alertdialog"?"dialog":f,"aria-controls":o?d:void 0,...f==="listbox"&&{role:"combobox"},...f==="menu"&&{id:u},...f==="menu"&&v&&{role:"menuitem"},...c==="select"&&{"aria-autocomplete":"none"},...c==="combobox"&&{"aria-autocomplete":"list"}},[f,d,v,o,u,c]),w=m.useMemo(()=>{const S={id:d,...f&&{role:f}};return f==="tooltip"||c==="label"?S:{...S,...f==="menu"&&{"aria-labelledby":u}}},[f,d,u,c]),b=m.useCallback(S=>{let{active:x,selected:C}=S;const E={role:"option",...x&&{id:d+"-fui-option"}};switch(c){case"select":case"combobox":return{...E,"aria-selected":C}}return{}},[d,c]);return m.useMemo(()=>a?{reference:g,floating:w,item:b}:{},[a,g,w,b])}const rL=Me("font-semibold relative z-50",{variants:{variant:{primary:"bg-graphite-primary text-graphite-primaryForeground",secondary:"bg-graphite-secondary text-graphite-secondaryForeground"},size:{sm:"px-2 py-1 text-xs",md:"px-3 py-1.5 text-sm",lg:"px-4 py-2 text-base"},shape:{full:"rounded-full",minimal:"rounded-lg",sharp:"rounded-none"}},defaultVariants:{variant:"primary",size:"md",shape:"minimal"}}),nb=y.createContext(null),Il=()=>{const e=y.useContext(nb);if(e==null)throw new Error("Tooltip components must be wrapped in <TooltipProvider />");return e},oL=({children:e})=>{const[t,n]=y.useState(!1),r=y.useRef(null),o=ys("(pointer: coarse)"),s=QF({open:t,onOpenChange:n,middleware:[lm(10),dm(),um({padding:8}),fm({element:r})],whileElementsMounted:om,strategy:"fixed",placement:"top"}),i=s.context,a=YF(i,{enabled:!o,move:!1}),c=JF(i,{enabled:!o}),l=XF(i,{referencePress:!o}),u=nL(i,{role:"tooltip"}),d=Gm(o?()=>n(!0):null,{threshold:500}),f=eL([a,c,l,u]),h=y.useMemo(()=>({isOpen:t,setIsOpen:n,getReferenceProps:v=>({...f.getReferenceProps(v),...o?d:{}}),getFloatingProps:f.getFloatingProps,floatingStyles:s.floatingStyles,refs:s.refs,middlewareData:s.middlewareData,placement:s.placement,arrowRef:r}),[t,f,o,d,s.floatingStyles,s.refs,s.middlewareData,s.placement]);return p.jsx(nb.Provider,{value:h,children:e})};function rb(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}const sL=y.forwardRef(function({children:t,asChild:n=!0,...r},o){const s=Il(),i=t==null?void 0:t.ref,a=y.useMemo(()=>rb([o,i,s.refs.setReference]),[o,i,s.refs.setReference]);if(!y.isValidElement(t))return console.warn("TooltipTrigger expects a single React element as a child"),p.jsx("span",{ref:a,...s.getReferenceProps(r),"data-state":s.isOpen?"open":"closed",children:t});const c=t.props;return y.cloneElement(t,s.getReferenceProps({ref:a,...r,...c}))}),ob=y.forwardRef(({className:e,variant:t,size:n,shape:r,style:o,children:s,...i},a)=>{var v,g;const c=Il(),[l,u]=y.useState(!1),d=y.useMemo(()=>rb([a,c.refs.setFloating]),[a,c.refs.setFloating]);if(y.useEffect(()=>{if(c.isOpen){const w=setTimeout(()=>u(!0),10);return()=>clearTimeout(w)}else u(!1)},[c.isOpen]),!c.isOpen)return null;const f={top:"bottom",right:"left",bottom:"top",left:"right"}[c.placement.split("-")[0]],h={primary:"bg-graphite-primary",secondary:"bg-graphite-secondary"}[t||"primary"];return p.jsx(zF,{children:p.jsxs("div",{ref:d,className:rL({variant:t,size:n,shape:r,className:e}),style:{...c.floatingStyles,...o,visibility:c.floatingStyles.transform?"visible":"hidden",opacity:l?1:0,transition:"opacity 200ms ease-in-out"},...c.getFloatingProps(i),children:[s,p.jsx("div",{ref:c.arrowRef,className:H("absolute h-2 w-2 rotate-45",h),style:{left:((v=c.middlewareData.arrow)==null?void 0:v.x)??"",top:((g=c.middlewareData.arrow)==null?void 0:g.y)??"",[f]:"-4px"}})]})})});ob.displayName="Tooltip",W.AppBar=PT,W.Avatar=Nh,W.Badge=Ah,W.BouncyBox=kh,W.Button=er,W.ButtonGroup=_h,W.Calendar=Mp,W.Card=ec,W.Checkbox=Op,W.Chip=Np,W.DatePicker=KA,W.Dialog=_c,W.DialogBody=Og,W.DialogClose=Dg,W.DialogContent=_s,W.DialogDescription=Mg,W.DialogFooter=Lc,W.DialogHeader=Fc,W.DialogTitle=Vc,W.DialogTrigger=Is,W.DropdownMenu=gI,W.DropdownMenuCheckboxItem=$v,W.DropdownMenuContent=Bv,W.DropdownMenuGroup=yI,W.DropdownMenuItem=Wv,W.DropdownMenuLabel=Uv,W.DropdownMenuPortal=wI,W.DropdownMenuRadioGroup=xI,W.DropdownMenuRadioItem=Hv,W.DropdownMenuSeparator=zv,W.DropdownMenuShortcut=Kv,W.DropdownMenuSub=bI,W.DropdownMenuSubContent=Yv,W.DropdownMenuSubTrigger=jv,W.DropdownMenuTrigger=vI,W.ElasticScrollArea=Eg,W.FAB=qv,W.IconButton=rr,W.Input=ro,W.Item=Jv,W.ItemActions=oy,W.ItemContent=ty,W.ItemDescription=ry,W.ItemFooter=iy,W.ItemGroup=Zv,W.ItemHeader=sy,W.ItemMedia=ey,W.ItemSeparator=Qv,W.ItemTitle=ny,W.Radio=PI,W.RadioGroup=Jc,W.RadioGroupItem=Qc,W.Select=jy,W.SelectContent=al,W.SelectGroup=c_,W.SelectInput=zy,W.SelectItem=cl,W.SelectLabel=Yy,W.SelectSeparator=Uy,W.SelectTrigger=il,W.SelectValue=Hy,W.ShallowPage=ul,W.ShallowRoute=d_,W.ShallowRouter=Gy,W.ShallowSwitch=f_,W.Sheet=uF,W.SplitButton=Iw,W.Switch=_w,W.Tabs=vF,W.TextArea=Ww,W.Tooltip=ob,W.TooltipProvider=oL,W.TooltipTrigger=sL,W.Typography=An,W.buttonVariants=La,W.iconButtonVariants=Ja,W.inputWrapperVariants=Ng,W.useRouter=Us,W.useRouterOptions=Ky,W.useTabs=Xs,W.useTooltip=Il,Object.defineProperty(W,Symbol.toStringTag,{value:"Module"})}));
|