@oniratec/onira-react-ui 3.0.0 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const zo=require("tailwind-merge"),ha=require("clsx"),l=require("react/jsx-runtime"),b=require("react"),J=require("lucide-react"),ma=require("react-dom"),Dd=require("@radix-ui/react-dropdown-menu"),Rd=require("lottie-react"),Ad=require("@radix-ui/react-select"),Md=require("@radix-ui/react-tooltip");function Br(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const h=Br(b),Zo=Br(ma),fe=Br(Dd),pe=Br(Ad),Wt=Br(Md),wr=t=>{let e=0;for(let r=0;r<t.length;r++){const n=t.charCodeAt(r);e=(e<<5)-e+n,e=e&e}return Math.abs(e)},Bo=(t,e)=>Math.floor(t/Math.pow(10,e)%10),$s=(t,e)=>!(Bo(t,e)%2),Se=(t,e,r)=>{const n=t%e;return r&&Bo(t,r)%2===0?-n:n},zt=(t,e,r)=>e[t%r],Id=t=>{t.slice(0,1)==="#"&&(t=t.slice(1));const e=parseInt(t.substr(0,2),16),r=parseInt(t.substr(2,2),16),n=parseInt(t.substr(4,2),16);return(e*299+r*587+n*114)/1e3>=128?"#000000":"#FFFFFF"},Pd=4,ue=80;function Fd(t,e){const r=wr(t),n=e&&e.length;return Array.from({length:Pd},(s,a)=>({color:zt(r+a,e,n),translateX:Se(r*(a+1),ue/2-(a+17),1),translateY:Se(r*(a+1),ue/2-(a+17),2),rotate:Se(r*(a+1),360),isSquare:$s(r,2)}))}const di=({name:t,colors:e,title:r,square:n,size:s,...a})=>{const i=Fd(t,e),o=h.useId();return l.jsxs("svg",{viewBox:"0 0 "+ue+" "+ue,fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:s,height:s,...a,children:[r&&l.jsx("title",{children:t}),l.jsx("mask",{id:o,maskUnits:"userSpaceOnUse",x:0,y:0,width:ue,height:ue,children:l.jsx("rect",{width:ue,height:ue,rx:n?void 0:ue*2,fill:"#FFFFFF"})}),l.jsxs("g",{mask:`url(#${o})`,children:[l.jsx("rect",{width:ue,height:ue,fill:i[0].color}),l.jsx("rect",{x:(ue-60)/2,y:(ue-20)/2,width:ue,height:i[1].isSquare?ue:ue/8,fill:i[1].color,transform:"translate("+i[1].translateX+" "+i[1].translateY+") rotate("+i[1].rotate+" "+ue/2+" "+ue/2+")"}),l.jsx("circle",{cx:ue/2,cy:ue/2,fill:i[2].color,r:ue/5,transform:"translate("+i[2].translateX+" "+i[2].translateY+")"}),l.jsx("line",{x1:0,y1:ue/2,x2:ue,y2:ue/2,strokeWidth:2,stroke:i[3].color,transform:"translate("+i[3].translateX+" "+i[3].translateY+") rotate("+i[3].rotate+" "+ue/2+" "+ue/2+")"})]})]})},It=90,Ld=5;function Vd(t,e){const r=wr(t),n=e&&e.length,s=Array.from({length:Ld},(i,o)=>zt(r+o,e,n)),a=[];return a[0]=s[0],a[1]=s[1],a[2]=s[1],a[3]=s[2],a[4]=s[2],a[5]=s[3],a[6]=s[3],a[7]=s[0],a[8]=s[4],a}const $d=({name:t,colors:e,title:r,square:n,size:s,...a})=>{const i=Vd(t,e),o=b.useId();return l.jsxs("svg",{viewBox:"0 0 "+It+" "+It,fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:s,height:s,...a,children:[r&&l.jsx("title",{children:t}),l.jsx("mask",{id:o,maskUnits:"userSpaceOnUse",x:0,y:0,width:It,height:It,children:l.jsx("rect",{width:It,height:It,rx:n?void 0:It*2,fill:"#FFFFFF"})}),l.jsxs("g",{mask:`url(#${o})`,children:[l.jsx("path",{d:"M0 0h90v45H0z",fill:i[0]}),l.jsx("path",{d:"M0 45h90v45H0z",fill:i[1]}),l.jsx("path",{d:"M83 45a38 38 0 00-76 0h76z",fill:i[2]}),l.jsx("path",{d:"M83 45a38 38 0 01-76 0h76z",fill:i[3]}),l.jsx("path",{d:"M77 45a32 32 0 10-64 0h64z",fill:i[4]}),l.jsx("path",{d:"M77 45a32 32 0 11-64 0h64z",fill:i[5]}),l.jsx("path",{d:"M71 45a26 26 0 00-52 0h52z",fill:i[6]}),l.jsx("path",{d:"M71 45a26 26 0 01-52 0h52z",fill:i[7]}),l.jsx("circle",{cx:45,cy:45,r:23,fill:i[8]})]})]})},Wd=64,Pt=80;function zd(t,e){const r=wr(t),n=e&&e.length;return Array.from({length:Wd},(s,a)=>zt(r%(a+1),e,n))}const Zd=({name:t,colors:e,title:r,square:n,size:s,...a})=>{const i=zd(t,e),o=h.useId();return l.jsxs("svg",{viewBox:"0 0 "+Pt+" "+Pt,fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:s,height:s,...a,children:[r&&l.jsx("title",{children:t}),l.jsx("mask",{id:o,"mask-type":"alpha",maskUnits:"userSpaceOnUse",x:0,y:0,width:Pt,height:Pt,children:l.jsx("rect",{width:Pt,height:Pt,rx:n?void 0:Pt*2,fill:"#FFFFFF"})}),l.jsxs("g",{mask:`url(#${o})`,children:[l.jsx("rect",{width:10,height:10,fill:i[0]}),l.jsx("rect",{x:20,width:10,height:10,fill:i[1]}),l.jsx("rect",{x:40,width:10,height:10,fill:i[2]}),l.jsx("rect",{x:60,width:10,height:10,fill:i[3]}),l.jsx("rect",{x:10,width:10,height:10,fill:i[4]}),l.jsx("rect",{x:30,width:10,height:10,fill:i[5]}),l.jsx("rect",{x:50,width:10,height:10,fill:i[6]}),l.jsx("rect",{x:70,width:10,height:10,fill:i[7]}),l.jsx("rect",{y:10,width:10,height:10,fill:i[8]}),l.jsx("rect",{y:20,width:10,height:10,fill:i[9]}),l.jsx("rect",{y:30,width:10,height:10,fill:i[10]}),l.jsx("rect",{y:40,width:10,height:10,fill:i[11]}),l.jsx("rect",{y:50,width:10,height:10,fill:i[12]}),l.jsx("rect",{y:60,width:10,height:10,fill:i[13]}),l.jsx("rect",{y:70,width:10,height:10,fill:i[14]}),l.jsx("rect",{x:20,y:10,width:10,height:10,fill:i[15]}),l.jsx("rect",{x:20,y:20,width:10,height:10,fill:i[16]}),l.jsx("rect",{x:20,y:30,width:10,height:10,fill:i[17]}),l.jsx("rect",{x:20,y:40,width:10,height:10,fill:i[18]}),l.jsx("rect",{x:20,y:50,width:10,height:10,fill:i[19]}),l.jsx("rect",{x:20,y:60,width:10,height:10,fill:i[20]}),l.jsx("rect",{x:20,y:70,width:10,height:10,fill:i[21]}),l.jsx("rect",{x:40,y:10,width:10,height:10,fill:i[22]}),l.jsx("rect",{x:40,y:20,width:10,height:10,fill:i[23]}),l.jsx("rect",{x:40,y:30,width:10,height:10,fill:i[24]}),l.jsx("rect",{x:40,y:40,width:10,height:10,fill:i[25]}),l.jsx("rect",{x:40,y:50,width:10,height:10,fill:i[26]}),l.jsx("rect",{x:40,y:60,width:10,height:10,fill:i[27]}),l.jsx("rect",{x:40,y:70,width:10,height:10,fill:i[28]}),l.jsx("rect",{x:60,y:10,width:10,height:10,fill:i[29]}),l.jsx("rect",{x:60,y:20,width:10,height:10,fill:i[30]}),l.jsx("rect",{x:60,y:30,width:10,height:10,fill:i[31]}),l.jsx("rect",{x:60,y:40,width:10,height:10,fill:i[32]}),l.jsx("rect",{x:60,y:50,width:10,height:10,fill:i[33]}),l.jsx("rect",{x:60,y:60,width:10,height:10,fill:i[34]}),l.jsx("rect",{x:60,y:70,width:10,height:10,fill:i[35]}),l.jsx("rect",{x:10,y:10,width:10,height:10,fill:i[36]}),l.jsx("rect",{x:10,y:20,width:10,height:10,fill:i[37]}),l.jsx("rect",{x:10,y:30,width:10,height:10,fill:i[38]}),l.jsx("rect",{x:10,y:40,width:10,height:10,fill:i[39]}),l.jsx("rect",{x:10,y:50,width:10,height:10,fill:i[40]}),l.jsx("rect",{x:10,y:60,width:10,height:10,fill:i[41]}),l.jsx("rect",{x:10,y:70,width:10,height:10,fill:i[42]}),l.jsx("rect",{x:30,y:10,width:10,height:10,fill:i[43]}),l.jsx("rect",{x:30,y:20,width:10,height:10,fill:i[44]}),l.jsx("rect",{x:30,y:30,width:10,height:10,fill:i[45]}),l.jsx("rect",{x:30,y:40,width:10,height:10,fill:i[46]}),l.jsx("rect",{x:30,y:50,width:10,height:10,fill:i[47]}),l.jsx("rect",{x:30,y:60,width:10,height:10,fill:i[48]}),l.jsx("rect",{x:30,y:70,width:10,height:10,fill:i[49]}),l.jsx("rect",{x:50,y:10,width:10,height:10,fill:i[50]}),l.jsx("rect",{x:50,y:20,width:10,height:10,fill:i[51]}),l.jsx("rect",{x:50,y:30,width:10,height:10,fill:i[52]}),l.jsx("rect",{x:50,y:40,width:10,height:10,fill:i[53]}),l.jsx("rect",{x:50,y:50,width:10,height:10,fill:i[54]}),l.jsx("rect",{x:50,y:60,width:10,height:10,fill:i[55]}),l.jsx("rect",{x:50,y:70,width:10,height:10,fill:i[56]}),l.jsx("rect",{x:70,y:10,width:10,height:10,fill:i[57]}),l.jsx("rect",{x:70,y:20,width:10,height:10,fill:i[58]}),l.jsx("rect",{x:70,y:30,width:10,height:10,fill:i[59]}),l.jsx("rect",{x:70,y:40,width:10,height:10,fill:i[60]}),l.jsx("rect",{x:70,y:50,width:10,height:10,fill:i[61]}),l.jsx("rect",{x:70,y:60,width:10,height:10,fill:i[62]}),l.jsx("rect",{x:70,y:70,width:10,height:10,fill:i[63]})]})]})},he=36;function Bd(t,e){const r=wr(t),n=e&&e.length,s=zt(r,e,n),a=Se(r,10,1),i=a<5?a+he/9:a,o=Se(r,10,2),c=o<5?o+he/9:o;return{wrapperColor:s,faceColor:Id(s),backgroundColor:zt(r+13,e,n),wrapperTranslateX:i,wrapperTranslateY:c,wrapperRotate:Se(r,360),wrapperScale:1+Se(r,he/12)/10,isMouthOpen:$s(r,2),isCircle:$s(r,1),eyeSpread:Se(r,5),mouthSpread:Se(r,3),faceRotate:Se(r,10,3),faceTranslateX:i>he/6?i/2:Se(r,8,1),faceTranslateY:c>he/6?c/2:Se(r,7,2)}}const fi=({name:t,colors:e,title:r,square:n,size:s,...a})=>{const i=Bd(t,e),o=h.useId();return l.jsxs("svg",{viewBox:"0 0 "+he+" "+he,fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:s,height:s,...a,children:[r&&l.jsx("title",{children:t}),l.jsx("mask",{id:o,maskUnits:"userSpaceOnUse",x:0,y:0,width:he,height:he,children:l.jsx("rect",{width:he,height:he,rx:n?void 0:he*2,fill:"#FFFFFF"})}),l.jsxs("g",{mask:`url(#${o})`,children:[l.jsx("rect",{width:he,height:he,fill:i.backgroundColor}),l.jsx("rect",{x:"0",y:"0",width:he,height:he,transform:"translate("+i.wrapperTranslateX+" "+i.wrapperTranslateY+") rotate("+i.wrapperRotate+" "+he/2+" "+he/2+") scale("+i.wrapperScale+")",fill:i.wrapperColor,rx:i.isCircle?he:he/6}),l.jsxs("g",{transform:"translate("+i.faceTranslateX+" "+i.faceTranslateY+") rotate("+i.faceRotate+" "+he/2+" "+he/2+")",children:[i.isMouthOpen?l.jsx("path",{d:"M15 "+(19+i.mouthSpread)+"c2 1 4 1 6 0",stroke:i.faceColor,fill:"none",strokeLinecap:"round"}):l.jsx("path",{d:"M13,"+(19+i.mouthSpread)+" a1,0.75 0 0,0 10,0",fill:i.faceColor}),l.jsx("rect",{x:14-i.eyeSpread,y:14,width:1.5,height:2,rx:1,stroke:"none",fill:i.faceColor}),l.jsx("rect",{x:20+i.eyeSpread,y:14,width:1.5,height:2,rx:1,stroke:"none",fill:i.faceColor})]})]})]})},Ud=4,Ee=80;function Hd(t,e){const r=wr(t),n=e&&e.length;return Array.from({length:Ud},(s,a)=>zt(r+a,e,n))}const qd=({name:t,colors:e,title:r,square:n,size:s,...a})=>{const i=Hd(t,e),o=t.replace(/\s/g,""),c=h.useId();return l.jsxs("svg",{viewBox:"0 0 "+Ee+" "+Ee,fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:s,height:s,...a,children:[r&&l.jsx("title",{children:t}),l.jsx("mask",{id:c,maskUnits:"userSpaceOnUse",x:0,y:0,width:Ee,height:Ee,children:l.jsx("rect",{width:Ee,height:Ee,rx:n?void 0:Ee*2,fill:"#FFFFFF"})}),l.jsxs("g",{mask:`url(#${c})`,children:[l.jsx("path",{fill:"url(#gradient_paint0_linear_"+o+")",d:"M0 0h80v40H0z"}),l.jsx("path",{fill:"url(#gradient_paint1_linear_"+o+")",d:"M0 40h80v40H0z"})]}),l.jsxs("defs",{children:[l.jsxs("linearGradient",{id:"gradient_paint0_linear_"+o,x1:Ee/2,y1:0,x2:Ee/2,y2:Ee/2,gradientUnits:"userSpaceOnUse",children:[l.jsx("stop",{stopColor:i[0]}),l.jsx("stop",{offset:1,stopColor:i[1]})]}),l.jsxs("linearGradient",{id:"gradient_paint1_linear_"+o,x1:Ee/2,y1:Ee/2,x2:Ee/2,y2:Ee,gradientUnits:"userSpaceOnUse",children:[l.jsx("stop",{stopColor:i[2]}),l.jsx("stop",{offset:1,stopColor:i[3]})]})]})]})},Yd=3,ke=80;function Gd(t,e){const r=wr(t),n=e&&e.length;return Array.from({length:Yd},(s,a)=>({color:zt(r+a,e,n),translateX:Se(r*(a+1),ke/10,1),translateY:Se(r*(a+1),ke/10,2),scale:1.2+Se(r*(a+1),ke/20)/10,rotate:Se(r*(a+1),360,1)}))}const Uo=({name:t,colors:e,title:r,square:n,size:s,...a})=>{const i=Gd(t,e),o=h.useId();return l.jsxs("svg",{viewBox:"0 0 "+ke+" "+ke,fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:s,height:s,...a,children:[r&&l.jsx("title",{children:t}),l.jsx("mask",{id:o,maskUnits:"userSpaceOnUse",x:0,y:0,width:ke,height:ke,children:l.jsx("rect",{width:ke,height:ke,rx:n?void 0:ke*2,fill:"#FFFFFF"})}),l.jsxs("g",{mask:`url(#${o})`,children:[l.jsx("rect",{width:ke,height:ke,fill:i[0].color}),l.jsx("path",{filter:`url(#filter_${o})`,d:"M32.414 59.35L50.376 70.5H72.5v-71H33.728L26.5 13.381l19.057 27.08L32.414 59.35z",fill:i[1].color,transform:"translate("+i[1].translateX+" "+i[1].translateY+") rotate("+i[1].rotate+" "+ke/2+" "+ke/2+") scale("+i[2].scale+")"}),l.jsx("path",{filter:`url(#filter_${o})`,style:{mixBlendMode:"overlay"},d:"M22.216 24L0 46.75l14.108 38.129L78 86l-3.081-59.276-22.378 4.005 12.972 20.186-23.35 27.395L22.215 24z",fill:i[2].color,transform:"translate("+i[2].translateX+" "+i[2].translateY+") rotate("+i[2].rotate+" "+ke/2+" "+ke/2+") scale("+i[2].scale+")"})]}),l.jsx("defs",{children:l.jsxs("filter",{id:`filter_${o}`,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[l.jsx("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),l.jsx("feBlend",{in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),l.jsx("feGaussianBlur",{stdDeviation:7,result:"effect1_foregroundBlur"})]})})]})},Xd={pixel:Zd,bauhaus:di,ring:$d,beam:fi,sunset:qd,marble:Uo,geometric:fi,abstract:di},Ho=({variant:t="marble",colors:e=["#92A1C6","#146A7C","#F0AB3D","#C271B4","#C20D90"],name:r="Clara Barton",title:n=!1,size:s="40px",square:a=!1,...i})=>{const o=Xd[t]||Uo;return l.jsx(o,{colors:e,name:r,title:n,size:s,square:a,...i})},qo=["var(--oniratec-brand)","var(--oniratec-fill-primary)","var(--oniratec-label-primary)"],Jd=({personId:t})=>l.jsx(Ho,{size:40,name:t,variant:"beam",colors:qo}),Kd=({userId:t})=>l.jsx(Ho,{size:40,name:t,variant:"bauhaus",colors:qo});function N(...t){return zo.twMerge(ha.clsx(t))}const Qd=({children:t,className:e})=>l.jsx("div",{className:N("rounded-lg border border-[color:var(--oniratec-border-primary)] bg-[color:var(--oniratec-fill-primary)] p-4 shadow-[var(--oniratec-shadow-card-md)]",e),children:t});function hi(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Yo(...t){return e=>{let r=!1;const n=t.map(s=>{const a=hi(s,e);return!r&&typeof a=="function"&&(r=!0),a});if(r)return()=>{for(let s=0;s<n.length;s++){const a=n[s];typeof a=="function"?a():hi(t[s],null)}}}}function $e(...t){return h.useCallback(Yo(...t),t)}function Zn(t){const e=ef(t),r=h.forwardRef((n,s)=>{const{children:a,...i}=n,o=h.Children.toArray(a),c=o.find(rf);if(c){const u=c.props.children,f=o.map(d=>d===c?h.Children.count(u)>1?h.Children.only(null):h.isValidElement(u)?u.props.children:null:d);return l.jsx(e,{...i,ref:s,children:h.isValidElement(u)?h.cloneElement(u,void 0,f):null})}return l.jsx(e,{...i,ref:s,children:a})});return r.displayName=`${t}.Slot`,r}var Go=Zn("Slot");function ef(t){const e=h.forwardRef((r,n)=>{const{children:s,...a}=r;if(h.isValidElement(s)){const i=sf(s),o=nf(a,s.props);return s.type!==h.Fragment&&(o.ref=n?Yo(n,i):i),h.cloneElement(s,o)}return h.Children.count(s)>1?h.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var tf=Symbol("radix.slottable");function rf(t){return h.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===tf}function nf(t,e){const r={...e};for(const n in e){const s=t[n],a=e[n];/^on[A-Z]/.test(n)?s&&a?r[n]=(...o)=>{const c=a(...o);return s(...o),c}:s&&(r[n]=s):n==="style"?r[n]={...s,...a}:n==="className"&&(r[n]=[s,a].filter(Boolean).join(" "))}return{...t,...r}}function sf(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}const mi=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,pi=ha.clsx,Bn=(t,e)=>r=>{var n;if(e?.variants==null)return pi(t,r?.class,r?.className);const{variants:s,defaultVariants:a}=e,i=Object.keys(s).map(u=>{const f=r?.[u],d=a?.[u];if(f===null)return null;const m=mi(f)||mi(d);return s[u][m]}),o=r&&Object.entries(r).reduce((u,f)=>{let[d,m]=f;return m===void 0||(u[d]=m),u},{}),c=e==null||(n=e.compoundVariants)===null||n===void 0?void 0:n.reduce((u,f)=>{let{class:d,className:m,...p}=f;return Object.entries(p).every(y=>{let[g,x]=y;return Array.isArray(x)?x.includes({...a,...o}[g]):{...a,...o}[g]===x})?[...u,d,m]:u},[]);return pi(t,i,c,r?.class,r?.className)},Xo=Bn("inline-flex shrink-0 items-center justify-center gap-1.5 whitespace-nowrap rounded-lg border border-transparent text-sm font-medium transition-[background-color,border-color,color,transform,box-shadow] outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",primary:"bg-primary text-primary-foreground hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted dark:border-input dark:bg-input/30 dark:hover:bg-input/50",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted dark:hover:bg-muted/60",link:"h-auto rounded-none border-transparent px-0 py-0 text-primary underline-offset-4 hover:underline focus-visible:border-transparent focus-visible:ring-0"},size:{xs:"h-6 rounded-md px-2 text-xs [&_svg]:size-3",sm:"h-7 rounded-md px-2.5 text-[0.8rem] [&_svg]:size-3.5",md:"h-8 px-2.5",lg:"h-9 px-3 text-sm",icon:"h-8 w-8","icon-sm":"h-7 w-7 rounded-md","icon-lg":"h-9 w-9"}},defaultVariants:{variant:"default",size:"md"}}),Le=h.forwardRef(({className:t,asChild:e=!1,variant:r="default",size:n="md",loading:s=!1,disabled:a,children:i,...o},c)=>{const u=e?Go:"button";return l.jsxs(u,{ref:c,"data-size":n??void 0,"data-variant":r??void 0,className:N(Xo({variant:r,size:n}),t),disabled:a||s,...o,children:[s&&l.jsx(J.Loader2,{className:"h-4 w-4 animate-spin"}),i]})});Le.displayName="Button";const af=({src:t,alt:e,width:r=70,height:n=70,className:s,ImageComponent:a,...i})=>{const o=a??"img";return l.jsx(o,{type:void 0,props:void 0,src:t,alt:e,width:r,height:n,className:N("inline-block object-contain",s),...i},null)},Ws=({children:t,className:e,size:r="default"})=>l.jsx("div",{className:N("flex flex-col overflow-hidden rounded-xl bg-card text-card-foreground ring-1 ring-foreground/10 shadow-card-sm transition-[box-shadow,transform]",r==="sm"?"gap-3 py-3":"gap-4 py-4","hover:shadow-card-md",e),children:t}),Jo=({children:t,className:e})=>l.jsx("div",{className:N("grid gap-1 px-4",e),children:t}),Ko=({children:t,className:e})=>l.jsx("h3",{className:N("text-base font-medium leading-snug text-card-foreground",e),children:t}),of=({children:t,className:e})=>l.jsx("p",{className:N("text-sm text-muted-foreground",e),children:t}),Qo=({children:t,className:e})=>l.jsx("div",{className:N("px-4",e),children:t}),lf=({children:t,className:e})=>l.jsx("div",{className:N("ml-auto flex items-center gap-2",e),children:t}),cf=({children:t,className:e})=>l.jsx("div",{className:N("flex items-center gap-2 border-t bg-muted/50 p-4",e),children:t}),el=Bn("relative grid w-full grid-cols-[auto_1fr] items-start gap-3 rounded-xl bg-card p-4 text-sm text-card-foreground ring-1 ring-foreground/10",{variants:{variant:{info:"[&_svg]:text-muted-foreground",success:"bg-primary/5 ring-primary/15 [&_svg]:text-primary dark:bg-primary/10",warning:"bg-amber-500/10 ring-amber-500/20 [&_svg]:text-amber-600 dark:bg-amber-500/15 dark:[&_svg]:text-amber-400",error:"bg-destructive/10 ring-destructive/20 [&_svg]:text-destructive dark:bg-destructive/15"}},defaultVariants:{variant:"info"}}),uf={error:J.AlertCircle,warning:J.AlertTriangle,info:J.Info,success:J.CheckCircle},tl=h.forwardRef(({className:t,variant:e="info",children:r,...n},s)=>{const a=uf[e];return l.jsxs("div",{ref:s,role:"alert",className:N(el({variant:e}),t),...n,children:[a&&l.jsx(a,{className:"mt-0.5 h-4 w-4 shrink-0","aria-hidden":"true"}),l.jsx("div",{className:"flex-1",children:r})]})});tl.displayName="Alert";const rl=h.forwardRef(({className:t,...e},r)=>l.jsx("h5",{ref:r,className:N("mb-1 font-medium leading-none tracking-tight",t),...e}));rl.displayName="AlertTitle";const nl=h.forwardRef(({className:t,...e},r)=>l.jsx("div",{ref:r,className:N("text-sm text-muted-foreground [&_p]:leading-relaxed",t),...e}));nl.displayName="AlertDescription";const sl=Bn("inline-flex items-center rounded-md border font-medium transition-colors focus:outline-none focus-visible:ring-3 focus-visible:ring-ring/50",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",success:"border-transparent bg-emerald-500/15 text-emerald-700 dark:text-emerald-400",warning:"border-transparent bg-amber-500/10 text-amber-700 dark:text-amber-300",danger:"border-transparent bg-destructive/10 text-destructive",info:"border-transparent bg-accent text-accent-foreground",outline:"border-border bg-background text-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground"},size:{sm:"px-1.5 py-0.5 text-[11px]",md:"px-2 py-0.5 text-xs"}},defaultVariants:{variant:"default",size:"md"}}),pa=h.forwardRef(({className:t,variant:e="default",size:r="md",...n},s)=>l.jsx("span",{ref:s,className:N(sl({variant:e,size:r}),t),...n}));pa.displayName="Badge";const al=h.forwardRef(({className:t,id:e,label:r,description:n,size:s="md",indeterminate:a=!1,disabled:i,"aria-describedby":o,"aria-invalid":c,...u},f)=>{const d=h.useId(),m=e??d,p=n?`${m}-description`:void 0,y=c===!0||c==="true",g=h.useRef(null);h.useEffect(()=>{g.current&&(g.current.indeterminate=a)},[a]);const x=h.useCallback(v=>{g.current=v,typeof f=="function"?f(v):f&&(f.current=v)},[f]);return l.jsxs("label",{htmlFor:m,className:N("inline-flex w-fit items-start gap-2.5 text-sm",i&&"cursor-not-allowed opacity-60",t),children:[l.jsx("input",{ref:x,id:m,type:"checkbox",disabled:i,"aria-invalid":y||void 0,"aria-checked":a?"mixed":void 0,"aria-describedby":[o,p].filter(Boolean).join(" ")||void 0,className:"peer sr-only",...u}),l.jsx("span",{className:N("flex shrink-0 items-center justify-center rounded-[min(var(--radius-md),10px)] border border-input bg-background text-primary-foreground transition-[background-color,border-color,box-shadow,color] outline-none","peer-focus-visible:border-ring peer-focus-visible:ring-3 peer-focus-visible:ring-ring/50","peer-disabled:border-border/50 peer-disabled:bg-muted/50 peer-disabled:opacity-70",!a&&"peer-checked:border-primary peer-checked:bg-primary peer-checked:[&_svg]:opacity-100",a&&"border-primary bg-primary [&_svg]:opacity-100",y&&"border-destructive peer-focus-visible:border-destructive peer-focus-visible:ring-destructive/20",s==="sm"?"h-4 w-4":"h-5 w-5"),children:a?l.jsx(J.Minus,{className:"h-3.5 w-3.5 opacity-0 transition-opacity"}):l.jsx(J.Check,{className:"h-3.5 w-3.5 opacity-0 transition-opacity"})}),(r||n)&&l.jsxs("span",{className:"grid gap-1 leading-tight",children:[r&&l.jsx("span",{className:"font-medium text-foreground",children:r}),n&&l.jsx("span",{id:p,className:"text-sm text-muted-foreground",children:n})]})]})});al.displayName="Checkbox";function Re(t,e,{checkForDefaultPrevented:r=!0}={}){return function(s){if(t?.(s),r===!1||!s.defaultPrevented)return e?.(s)}}function df(t,e){const r=h.createContext(e),n=a=>{const{children:i,...o}=a,c=h.useMemo(()=>o,Object.values(o));return l.jsx(r.Provider,{value:c,children:i})};n.displayName=t+"Provider";function s(a){const i=h.useContext(r);if(i)return i;if(e!==void 0)return e;throw new Error(`\`${a}\` must be used within \`${t}\``)}return[n,s]}function Un(t,e=[]){let r=[];function n(a,i){const o=h.createContext(i),c=r.length;r=[...r,i];const u=d=>{const{scope:m,children:p,...y}=d,g=m?.[t]?.[c]||o,x=h.useMemo(()=>y,Object.values(y));return l.jsx(g.Provider,{value:x,children:p})};u.displayName=a+"Provider";function f(d,m){const p=m?.[t]?.[c]||o,y=h.useContext(p);if(y)return y;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${a}\``)}return[u,f]}const s=()=>{const a=r.map(i=>h.createContext(i));return function(o){const c=o?.[t]||a;return h.useMemo(()=>({[`__scope${t}`]:{...o,[t]:c}}),[o,c])}};return s.scopeName=t,[n,ff(s,...e)]}function ff(...t){const e=t[0];if(t.length===1)return e;const r=()=>{const n=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(a){const i=n.reduce((o,{useScope:c,scopeName:u})=>{const d=c(a)[`__scope${u}`];return{...o,...d}},{});return h.useMemo(()=>({[`__scope${e.scopeName}`]:i}),[i])}};return r.scopeName=e.scopeName,r}var hf=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],_e=hf.reduce((t,e)=>{const r=Zn(`Primitive.${e}`),n=h.forwardRef((s,a)=>{const{asChild:i,...o}=s,c=i?r:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...o,ref:a})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function mf(t,e){t&&Zo.flushSync(()=>t.dispatchEvent(e))}function hr(t){const e=h.useRef(t);return h.useEffect(()=>{e.current=t}),h.useMemo(()=>(...r)=>e.current?.(...r),[])}function pf(t,e=globalThis?.document){const r=hr(t);h.useEffect(()=>{const n=s=>{s.key==="Escape"&&r(s)};return e.addEventListener("keydown",n,{capture:!0}),()=>e.removeEventListener("keydown",n,{capture:!0})},[r,e])}var gf="DismissableLayer",zs="dismissableLayer.update",yf="dismissableLayer.pointerDownOutside",vf="dismissableLayer.focusOutside",gi,il=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ga=h.forwardRef((t,e)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:i,onDismiss:o,...c}=t,u=h.useContext(il),[f,d]=h.useState(null),m=f?.ownerDocument??globalThis?.document,[,p]=h.useState({}),y=$e(e,T=>d(T)),g=Array.from(u.layers),[x]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=g.indexOf(x),S=f?g.indexOf(f):-1,C=u.layersWithOutsidePointerEventsDisabled.size>0,k=S>=v,w=wf(T=>{const A=T.target,$=[...u.branches].some(L=>L.contains(A));!k||$||(s?.(T),i?.(T),T.defaultPrevented||o?.())},m),j=kf(T=>{const A=T.target;[...u.branches].some(L=>L.contains(A))||(a?.(T),i?.(T),T.defaultPrevented||o?.())},m);return pf(T=>{S===u.layers.size-1&&(n?.(T),!T.defaultPrevented&&o&&(T.preventDefault(),o()))},m),h.useEffect(()=>{if(f)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(gi=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),yi(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=gi)}},[f,m,r,u]),h.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),yi())},[f,u]),h.useEffect(()=>{const T=()=>p({});return document.addEventListener(zs,T),()=>document.removeEventListener(zs,T)},[]),l.jsx(_e.div,{...c,ref:y,style:{pointerEvents:C?k?"auto":"none":void 0,...t.style},onFocusCapture:Re(t.onFocusCapture,j.onFocusCapture),onBlurCapture:Re(t.onBlurCapture,j.onBlurCapture),onPointerDownCapture:Re(t.onPointerDownCapture,w.onPointerDownCapture)})});ga.displayName=gf;var xf="DismissableLayerBranch",bf=h.forwardRef((t,e)=>{const r=h.useContext(il),n=h.useRef(null),s=$e(e,n);return h.useEffect(()=>{const a=n.current;if(a)return r.branches.add(a),()=>{r.branches.delete(a)}},[r.branches]),l.jsx(_e.div,{...t,ref:s})});bf.displayName=xf;function wf(t,e=globalThis?.document){const r=hr(t),n=h.useRef(!1),s=h.useRef(()=>{});return h.useEffect(()=>{const a=o=>{if(o.target&&!n.current){let c=function(){ol(yf,r,u,{discrete:!0})};const u={originalEvent:o};o.pointerType==="touch"?(e.removeEventListener("click",s.current),s.current=c,e.addEventListener("click",s.current,{once:!0})):c()}else e.removeEventListener("click",s.current);n.current=!1},i=window.setTimeout(()=>{e.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(i),e.removeEventListener("pointerdown",a),e.removeEventListener("click",s.current)}},[e,r]),{onPointerDownCapture:()=>n.current=!0}}function kf(t,e=globalThis?.document){const r=hr(t),n=h.useRef(!1);return h.useEffect(()=>{const s=a=>{a.target&&!n.current&&ol(vf,r,{originalEvent:a},{discrete:!1})};return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function yi(){const t=new CustomEvent(zs);document.dispatchEvent(t)}function ol(t,e,r,{discrete:n}){const s=r.originalEvent.target,a=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:r});e&&s.addEventListener(t,e,{once:!0}),n?mf(s,a):s.dispatchEvent(a)}var vs=0;function ll(){h.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??vi()),document.body.insertAdjacentElement("beforeend",t[1]??vi()),vs++,()=>{vs===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),vs--}},[])}function vi(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var xs="focusScope.autoFocusOnMount",bs="focusScope.autoFocusOnUnmount",xi={bubbles:!1,cancelable:!0},Sf="FocusScope",ya=h.forwardRef((t,e)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...i}=t,[o,c]=h.useState(null),u=hr(s),f=hr(a),d=h.useRef(null),m=$e(e,g=>c(g)),p=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(n){let g=function(C){if(p.paused||!o)return;const k=C.target;o.contains(k)?d.current=k:kt(d.current,{select:!0})},x=function(C){if(p.paused||!o)return;const k=C.relatedTarget;k!==null&&(o.contains(k)||kt(d.current,{select:!0}))},v=function(C){if(document.activeElement===document.body)for(const w of C)w.removedNodes.length>0&&kt(o)};document.addEventListener("focusin",g),document.addEventListener("focusout",x);const S=new MutationObserver(v);return o&&S.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",x),S.disconnect()}}},[n,o,p.paused]),h.useEffect(()=>{if(o){wi.add(p);const g=document.activeElement;if(!o.contains(g)){const v=new CustomEvent(xs,xi);o.addEventListener(xs,u),o.dispatchEvent(v),v.defaultPrevented||(Nf(Ef(cl(o)),{select:!0}),document.activeElement===g&&kt(o))}return()=>{o.removeEventListener(xs,u),setTimeout(()=>{const v=new CustomEvent(bs,xi);o.addEventListener(bs,f),o.dispatchEvent(v),v.defaultPrevented||kt(g??document.body,{select:!0}),o.removeEventListener(bs,f),wi.remove(p)},0)}}},[o,u,f,p]);const y=h.useCallback(g=>{if(!r&&!n||p.paused)return;const x=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,v=document.activeElement;if(x&&v){const S=g.currentTarget,[C,k]=Cf(S);C&&k?!g.shiftKey&&v===k?(g.preventDefault(),r&&kt(C,{select:!0})):g.shiftKey&&v===C&&(g.preventDefault(),r&&kt(k,{select:!0})):v===S&&g.preventDefault()}},[r,n,p.paused]);return l.jsx(_e.div,{tabIndex:-1,...i,ref:m,onKeyDown:y})});ya.displayName=Sf;function Nf(t,{select:e=!1}={}){const r=document.activeElement;for(const n of t)if(kt(n,{select:e}),document.activeElement!==r)return}function Cf(t){const e=cl(t),r=bi(e,t),n=bi(e.reverse(),t);return[r,n]}function cl(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function bi(t,e){for(const r of t)if(!_f(r,{upTo:e}))return r}function _f(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function Tf(t){return t instanceof HTMLInputElement&&"select"in t}function kt(t,{select:e=!1}={}){if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),t!==r&&Tf(t)&&e&&t.select()}}var wi=jf();function jf(){let t=[];return{add(e){const r=t[0];e!==r&&r?.pause(),t=ki(t,e),t.unshift(e)},remove(e){t=ki(t,e),t[0]?.resume()}}}function ki(t,e){const r=[...t],n=r.indexOf(e);return n!==-1&&r.splice(n,1),r}function Ef(t){return t.filter(e=>e.tagName!=="A")}var jt=globalThis?.document?h.useLayoutEffect:()=>{},Of=h[" useId ".trim().toString()]||(()=>{}),Df=0;function xn(t){const[e,r]=h.useState(Of());return jt(()=>{r(n=>n??String(Df++))},[t]),t||(e?`radix-${e}`:"")}const Rf=["top","right","bottom","left"],Et=Math.min,Ie=Math.max,Tn=Math.round,an=Math.floor,lt=t=>({x:t,y:t}),Af={left:"right",right:"left",bottom:"top",top:"bottom"},Mf={start:"end",end:"start"};function Zs(t,e,r){return Ie(t,Et(e,r))}function pt(t,e){return typeof t=="function"?t(e):t}function gt(t){return t.split("-")[0]}function kr(t){return t.split("-")[1]}function va(t){return t==="x"?"y":"x"}function xa(t){return t==="y"?"height":"width"}const If=new Set(["top","bottom"]);function ot(t){return If.has(gt(t))?"y":"x"}function ba(t){return va(ot(t))}function Pf(t,e,r){r===void 0&&(r=!1);const n=kr(t),s=ba(t),a=xa(s);let i=s==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[a]>e.floating[a]&&(i=jn(i)),[i,jn(i)]}function Ff(t){const e=jn(t);return[Bs(t),e,Bs(e)]}function Bs(t){return t.replace(/start|end/g,e=>Mf[e])}const Si=["left","right"],Ni=["right","left"],Lf=["top","bottom"],Vf=["bottom","top"];function $f(t,e,r){switch(t){case"top":case"bottom":return r?e?Ni:Si:e?Si:Ni;case"left":case"right":return e?Lf:Vf;default:return[]}}function Wf(t,e,r,n){const s=kr(t);let a=$f(gt(t),r==="start",n);return s&&(a=a.map(i=>i+"-"+s),e&&(a=a.concat(a.map(Bs)))),a}function jn(t){return t.replace(/left|right|bottom|top/g,e=>Af[e])}function zf(t){return{top:0,right:0,bottom:0,left:0,...t}}function ul(t){return typeof t!="number"?zf(t):{top:t,right:t,bottom:t,left:t}}function En(t){const{x:e,y:r,width:n,height:s}=t;return{width:n,height:s,top:r,left:e,right:e+n,bottom:r+s,x:e,y:r}}function Ci(t,e,r){let{reference:n,floating:s}=t;const a=ot(e),i=ba(e),o=xa(i),c=gt(e),u=a==="y",f=n.x+n.width/2-s.width/2,d=n.y+n.height/2-s.height/2,m=n[o]/2-s[o]/2;let p;switch(c){case"top":p={x:f,y:n.y-s.height};break;case"bottom":p={x:f,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:d};break;case"left":p={x:n.x-s.width,y:d};break;default:p={x:n.x,y:n.y}}switch(kr(e)){case"start":p[i]-=m*(r&&u?-1:1);break;case"end":p[i]+=m*(r&&u?-1:1);break}return p}const Zf=async(t,e,r)=>{const{placement:n="bottom",strategy:s="absolute",middleware:a=[],platform:i}=r,o=a.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(e));let u=await i.getElementRects({reference:t,floating:e,strategy:s}),{x:f,y:d}=Ci(u,n,c),m=n,p={},y=0;for(let g=0;g<o.length;g++){const{name:x,fn:v}=o[g],{x:S,y:C,data:k,reset:w}=await v({x:f,y:d,initialPlacement:n,placement:m,strategy:s,middlewareData:p,rects:u,platform:i,elements:{reference:t,floating:e}});f=S??f,d=C??d,p={...p,[x]:{...p[x],...k}},w&&y<=50&&(y++,typeof w=="object"&&(w.placement&&(m=w.placement),w.rects&&(u=w.rects===!0?await i.getElementRects({reference:t,floating:e,strategy:s}):w.rects),{x:f,y:d}=Ci(u,m,c)),g=-1)}return{x:f,y:d,placement:m,strategy:s,middlewareData:p}};async function Fr(t,e){var r;e===void 0&&(e={});const{x:n,y:s,platform:a,rects:i,elements:o,strategy:c}=t,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:d="floating",altBoundary:m=!1,padding:p=0}=pt(e,t),y=ul(p),x=o[m?d==="floating"?"reference":"floating":d],v=En(await a.getClippingRect({element:(r=await(a.isElement==null?void 0:a.isElement(x)))==null||r?x:x.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(o.floating)),boundary:u,rootBoundary:f,strategy:c})),S=d==="floating"?{x:n,y:s,width:i.floating.width,height:i.floating.height}:i.reference,C=await(a.getOffsetParent==null?void 0:a.getOffsetParent(o.floating)),k=await(a.isElement==null?void 0:a.isElement(C))?await(a.getScale==null?void 0:a.getScale(C))||{x:1,y:1}:{x:1,y:1},w=En(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:S,offsetParent:C,strategy:c}):S);return{top:(v.top-w.top+y.top)/k.y,bottom:(w.bottom-v.bottom+y.bottom)/k.y,left:(v.left-w.left+y.left)/k.x,right:(w.right-v.right+y.right)/k.x}}const Bf=t=>({name:"arrow",options:t,async fn(e){const{x:r,y:n,placement:s,rects:a,platform:i,elements:o,middlewareData:c}=e,{element:u,padding:f=0}=pt(t,e)||{};if(u==null)return{};const d=ul(f),m={x:r,y:n},p=ba(s),y=xa(p),g=await i.getDimensions(u),x=p==="y",v=x?"top":"left",S=x?"bottom":"right",C=x?"clientHeight":"clientWidth",k=a.reference[y]+a.reference[p]-m[p]-a.floating[y],w=m[p]-a.reference[p],j=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let T=j?j[C]:0;(!T||!await(i.isElement==null?void 0:i.isElement(j)))&&(T=o.floating[C]||a.floating[y]);const A=k/2-w/2,$=T/2-g[y]/2-1,L=Et(d[v],$),z=Et(d[S],$),B=L,G=T-g[y]-z,Q=T/2-g[y]/2+A,H=Zs(B,Q,G),P=!c.arrow&&kr(s)!=null&&Q!==H&&a.reference[y]/2-(Q<B?L:z)-g[y]/2<0,U=P?Q<B?Q-B:Q-G:0;return{[p]:m[p]+U,data:{[p]:H,centerOffset:Q-H-U,...P&&{alignmentOffset:U}},reset:P}}}),Uf=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var r,n;const{placement:s,middlewareData:a,rects:i,initialPlacement:o,platform:c,elements:u}=e,{mainAxis:f=!0,crossAxis:d=!0,fallbackPlacements:m,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:g=!0,...x}=pt(t,e);if((r=a.arrow)!=null&&r.alignmentOffset)return{};const v=gt(s),S=ot(o),C=gt(o)===o,k=await(c.isRTL==null?void 0:c.isRTL(u.floating)),w=m||(C||!g?[jn(o)]:Ff(o)),j=y!=="none";!m&&j&&w.push(...Wf(o,g,y,k));const T=[o,...w],A=await Fr(e,x),$=[];let L=((n=a.flip)==null?void 0:n.overflows)||[];if(f&&$.push(A[v]),d){const Q=Pf(s,i,k);$.push(A[Q[0]],A[Q[1]])}if(L=[...L,{placement:s,overflows:$}],!$.every(Q=>Q<=0)){var z,B;const Q=(((z=a.flip)==null?void 0:z.index)||0)+1,H=T[Q];if(H&&(!(d==="alignment"?S!==ot(H):!1)||L.every(V=>ot(V.placement)===S?V.overflows[0]>0:!0)))return{data:{index:Q,overflows:L},reset:{placement:H}};let P=(B=L.filter(U=>U.overflows[0]<=0).sort((U,V)=>U.overflows[1]-V.overflows[1])[0])==null?void 0:B.placement;if(!P)switch(p){case"bestFit":{var G;const U=(G=L.filter(V=>{if(j){const ie=ot(V.placement);return ie===S||ie==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(ie=>ie>0).reduce((ie,F)=>ie+F,0)]).sort((V,ie)=>V[1]-ie[1])[0])==null?void 0:G[0];U&&(P=U);break}case"initialPlacement":P=o;break}if(s!==P)return{reset:{placement:P}}}return{}}}};function _i(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Ti(t){return Rf.some(e=>t[e]>=0)}const Hf=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:r}=e,{strategy:n="referenceHidden",...s}=pt(t,e);switch(n){case"referenceHidden":{const a=await Fr(e,{...s,elementContext:"reference"}),i=_i(a,r.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Ti(i)}}}case"escaped":{const a=await Fr(e,{...s,altBoundary:!0}),i=_i(a,r.floating);return{data:{escapedOffsets:i,escaped:Ti(i)}}}default:return{}}}}},dl=new Set(["left","top"]);async function qf(t,e){const{placement:r,platform:n,elements:s}=t,a=await(n.isRTL==null?void 0:n.isRTL(s.floating)),i=gt(r),o=kr(r),c=ot(r)==="y",u=dl.has(i)?-1:1,f=a&&c?-1:1,d=pt(e,t);let{mainAxis:m,crossAxis:p,alignmentAxis:y}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return o&&typeof y=="number"&&(p=o==="end"?y*-1:y),c?{x:p*f,y:m*u}:{x:m*u,y:p*f}}const Yf=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var r,n;const{x:s,y:a,placement:i,middlewareData:o}=e,c=await qf(e,t);return i===((r=o.offset)==null?void 0:r.placement)&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:s+c.x,y:a+c.y,data:{...c,placement:i}}}}},Gf=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:r,y:n,placement:s}=e,{mainAxis:a=!0,crossAxis:i=!1,limiter:o={fn:x=>{let{x:v,y:S}=x;return{x:v,y:S}}},...c}=pt(t,e),u={x:r,y:n},f=await Fr(e,c),d=ot(gt(s)),m=va(d);let p=u[m],y=u[d];if(a){const x=m==="y"?"top":"left",v=m==="y"?"bottom":"right",S=p+f[x],C=p-f[v];p=Zs(S,p,C)}if(i){const x=d==="y"?"top":"left",v=d==="y"?"bottom":"right",S=y+f[x],C=y-f[v];y=Zs(S,y,C)}const g=o.fn({...e,[m]:p,[d]:y});return{...g,data:{x:g.x-r,y:g.y-n,enabled:{[m]:a,[d]:i}}}}}},Xf=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:r,y:n,placement:s,rects:a,middlewareData:i}=e,{offset:o=0,mainAxis:c=!0,crossAxis:u=!0}=pt(t,e),f={x:r,y:n},d=ot(s),m=va(d);let p=f[m],y=f[d];const g=pt(o,e),x=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){const C=m==="y"?"height":"width",k=a.reference[m]-a.floating[C]+x.mainAxis,w=a.reference[m]+a.reference[C]-x.mainAxis;p<k?p=k:p>w&&(p=w)}if(u){var v,S;const C=m==="y"?"width":"height",k=dl.has(gt(s)),w=a.reference[d]-a.floating[C]+(k&&((v=i.offset)==null?void 0:v[d])||0)+(k?0:x.crossAxis),j=a.reference[d]+a.reference[C]+(k?0:((S=i.offset)==null?void 0:S[d])||0)-(k?x.crossAxis:0);y<w?y=w:y>j&&(y=j)}return{[m]:p,[d]:y}}}},Jf=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var r,n;const{placement:s,rects:a,platform:i,elements:o}=e,{apply:c=()=>{},...u}=pt(t,e),f=await Fr(e,u),d=gt(s),m=kr(s),p=ot(s)==="y",{width:y,height:g}=a.floating;let x,v;d==="top"||d==="bottom"?(x=d,v=m===(await(i.isRTL==null?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(v=d,x=m==="end"?"top":"bottom");const S=g-f.top-f.bottom,C=y-f.left-f.right,k=Et(g-f[x],S),w=Et(y-f[v],C),j=!e.middlewareData.shift;let T=k,A=w;if((r=e.middlewareData.shift)!=null&&r.enabled.x&&(A=C),(n=e.middlewareData.shift)!=null&&n.enabled.y&&(T=S),j&&!m){const L=Ie(f.left,0),z=Ie(f.right,0),B=Ie(f.top,0),G=Ie(f.bottom,0);p?A=y-2*(L!==0||z!==0?L+z:Ie(f.left,f.right)):T=g-2*(B!==0||G!==0?B+G:Ie(f.top,f.bottom))}await c({...e,availableWidth:A,availableHeight:T});const $=await i.getDimensions(o.floating);return y!==$.width||g!==$.height?{reset:{rects:!0}}:{}}}};function Hn(){return typeof window<"u"}function Sr(t){return fl(t)?(t.nodeName||"").toLowerCase():"#document"}function Pe(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function ft(t){var e;return(e=(fl(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function fl(t){return Hn()?t instanceof Node||t instanceof Pe(t).Node:!1}function Qe(t){return Hn()?t instanceof Element||t instanceof Pe(t).Element:!1}function ut(t){return Hn()?t instanceof HTMLElement||t instanceof Pe(t).HTMLElement:!1}function ji(t){return!Hn()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Pe(t).ShadowRoot}const Kf=new Set(["inline","contents"]);function Ur(t){const{overflow:e,overflowX:r,overflowY:n,display:s}=et(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&!Kf.has(s)}const Qf=new Set(["table","td","th"]);function eh(t){return Qf.has(Sr(t))}const th=[":popover-open",":modal"];function qn(t){return th.some(e=>{try{return t.matches(e)}catch{return!1}})}const rh=["transform","translate","scale","rotate","perspective"],nh=["transform","translate","scale","rotate","perspective","filter"],sh=["paint","layout","strict","content"];function wa(t){const e=ka(),r=Qe(t)?et(t):t;return rh.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!e&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!e&&(r.filter?r.filter!=="none":!1)||nh.some(n=>(r.willChange||"").includes(n))||sh.some(n=>(r.contain||"").includes(n))}function ah(t){let e=Ot(t);for(;ut(e)&&!mr(e);){if(wa(e))return e;if(qn(e))return null;e=Ot(e)}return null}function ka(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const ih=new Set(["html","body","#document"]);function mr(t){return ih.has(Sr(t))}function et(t){return Pe(t).getComputedStyle(t)}function Yn(t){return Qe(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Ot(t){if(Sr(t)==="html")return t;const e=t.assignedSlot||t.parentNode||ji(t)&&t.host||ft(t);return ji(e)?e.host:e}function hl(t){const e=Ot(t);return mr(e)?t.ownerDocument?t.ownerDocument.body:t.body:ut(e)&&Ur(e)?e:hl(e)}function Lr(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);const s=hl(t),a=s===((n=t.ownerDocument)==null?void 0:n.body),i=Pe(s);if(a){const o=Us(i);return e.concat(i,i.visualViewport||[],Ur(s)?s:[],o&&r?Lr(o):[])}return e.concat(s,Lr(s,[],r))}function Us(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function ml(t){const e=et(t);let r=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const s=ut(t),a=s?t.offsetWidth:r,i=s?t.offsetHeight:n,o=Tn(r)!==a||Tn(n)!==i;return o&&(r=a,n=i),{width:r,height:n,$:o}}function Sa(t){return Qe(t)?t:t.contextElement}function cr(t){const e=Sa(t);if(!ut(e))return lt(1);const r=e.getBoundingClientRect(),{width:n,height:s,$:a}=ml(e);let i=(a?Tn(r.width):r.width)/n,o=(a?Tn(r.height):r.height)/s;return(!i||!Number.isFinite(i))&&(i=1),(!o||!Number.isFinite(o))&&(o=1),{x:i,y:o}}const oh=lt(0);function pl(t){const e=Pe(t);return!ka()||!e.visualViewport?oh:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function lh(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==Pe(t)?!1:e}function Zt(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);const s=t.getBoundingClientRect(),a=Sa(t);let i=lt(1);e&&(n?Qe(n)&&(i=cr(n)):i=cr(t));const o=lh(a,r,n)?pl(a):lt(0);let c=(s.left+o.x)/i.x,u=(s.top+o.y)/i.y,f=s.width/i.x,d=s.height/i.y;if(a){const m=Pe(a),p=n&&Qe(n)?Pe(n):n;let y=m,g=Us(y);for(;g&&n&&p!==y;){const x=cr(g),v=g.getBoundingClientRect(),S=et(g),C=v.left+(g.clientLeft+parseFloat(S.paddingLeft))*x.x,k=v.top+(g.clientTop+parseFloat(S.paddingTop))*x.y;c*=x.x,u*=x.y,f*=x.x,d*=x.y,c+=C,u+=k,y=Pe(g),g=Us(y)}}return En({width:f,height:d,x:c,y:u})}function Gn(t,e){const r=Yn(t).scrollLeft;return e?e.left+r:Zt(ft(t)).left+r}function gl(t,e){const r=t.getBoundingClientRect(),n=r.left+e.scrollLeft-Gn(t,r),s=r.top+e.scrollTop;return{x:n,y:s}}function ch(t){let{elements:e,rect:r,offsetParent:n,strategy:s}=t;const a=s==="fixed",i=ft(n),o=e?qn(e.floating):!1;if(n===i||o&&a)return r;let c={scrollLeft:0,scrollTop:0},u=lt(1);const f=lt(0),d=ut(n);if((d||!d&&!a)&&((Sr(n)!=="body"||Ur(i))&&(c=Yn(n)),ut(n))){const p=Zt(n);u=cr(n),f.x=p.x+n.clientLeft,f.y=p.y+n.clientTop}const m=i&&!d&&!a?gl(i,c):lt(0);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-c.scrollLeft*u.x+f.x+m.x,y:r.y*u.y-c.scrollTop*u.y+f.y+m.y}}function uh(t){return Array.from(t.getClientRects())}function dh(t){const e=ft(t),r=Yn(t),n=t.ownerDocument.body,s=Ie(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),a=Ie(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+Gn(t);const o=-r.scrollTop;return et(n).direction==="rtl"&&(i+=Ie(e.clientWidth,n.clientWidth)-s),{width:s,height:a,x:i,y:o}}const Ei=25;function fh(t,e){const r=Pe(t),n=ft(t),s=r.visualViewport;let a=n.clientWidth,i=n.clientHeight,o=0,c=0;if(s){a=s.width,i=s.height;const f=ka();(!f||f&&e==="fixed")&&(o=s.offsetLeft,c=s.offsetTop)}const u=Gn(n);if(u<=0){const f=n.ownerDocument,d=f.body,m=getComputedStyle(d),p=f.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,y=Math.abs(n.clientWidth-d.clientWidth-p);y<=Ei&&(a-=y)}else u<=Ei&&(a+=u);return{width:a,height:i,x:o,y:c}}const hh=new Set(["absolute","fixed"]);function mh(t,e){const r=Zt(t,!0,e==="fixed"),n=r.top+t.clientTop,s=r.left+t.clientLeft,a=ut(t)?cr(t):lt(1),i=t.clientWidth*a.x,o=t.clientHeight*a.y,c=s*a.x,u=n*a.y;return{width:i,height:o,x:c,y:u}}function Oi(t,e,r){let n;if(e==="viewport")n=fh(t,r);else if(e==="document")n=dh(ft(t));else if(Qe(e))n=mh(e,r);else{const s=pl(t);n={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return En(n)}function yl(t,e){const r=Ot(t);return r===e||!Qe(r)||mr(r)?!1:et(r).position==="fixed"||yl(r,e)}function ph(t,e){const r=e.get(t);if(r)return r;let n=Lr(t,[],!1).filter(o=>Qe(o)&&Sr(o)!=="body"),s=null;const a=et(t).position==="fixed";let i=a?Ot(t):t;for(;Qe(i)&&!mr(i);){const o=et(i),c=wa(i);!c&&o.position==="fixed"&&(s=null),(a?!c&&!s:!c&&o.position==="static"&&!!s&&hh.has(s.position)||Ur(i)&&!c&&yl(t,i))?n=n.filter(f=>f!==i):s=o,i=Ot(i)}return e.set(t,n),n}function gh(t){let{element:e,boundary:r,rootBoundary:n,strategy:s}=t;const i=[...r==="clippingAncestors"?qn(e)?[]:ph(e,this._c):[].concat(r),n],o=i[0],c=i.reduce((u,f)=>{const d=Oi(e,f,s);return u.top=Ie(d.top,u.top),u.right=Et(d.right,u.right),u.bottom=Et(d.bottom,u.bottom),u.left=Ie(d.left,u.left),u},Oi(e,o,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function yh(t){const{width:e,height:r}=ml(t);return{width:e,height:r}}function vh(t,e,r){const n=ut(e),s=ft(e),a=r==="fixed",i=Zt(t,!0,a,e);let o={scrollLeft:0,scrollTop:0};const c=lt(0);function u(){c.x=Gn(s)}if(n||!n&&!a)if((Sr(e)!=="body"||Ur(s))&&(o=Yn(e)),n){const p=Zt(e,!0,a,e);c.x=p.x+e.clientLeft,c.y=p.y+e.clientTop}else s&&u();a&&!n&&s&&u();const f=s&&!n&&!a?gl(s,o):lt(0),d=i.left+o.scrollLeft-c.x-f.x,m=i.top+o.scrollTop-c.y-f.y;return{x:d,y:m,width:i.width,height:i.height}}function ws(t){return et(t).position==="static"}function Di(t,e){if(!ut(t)||et(t).position==="fixed")return null;if(e)return e(t);let r=t.offsetParent;return ft(t)===r&&(r=r.ownerDocument.body),r}function vl(t,e){const r=Pe(t);if(qn(t))return r;if(!ut(t)){let s=Ot(t);for(;s&&!mr(s);){if(Qe(s)&&!ws(s))return s;s=Ot(s)}return r}let n=Di(t,e);for(;n&&eh(n)&&ws(n);)n=Di(n,e);return n&&mr(n)&&ws(n)&&!wa(n)?r:n||ah(t)||r}const xh=async function(t){const e=this.getOffsetParent||vl,r=this.getDimensions,n=await r(t.floating);return{reference:vh(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function bh(t){return et(t).direction==="rtl"}const wh={convertOffsetParentRelativeRectToViewportRelativeRect:ch,getDocumentElement:ft,getClippingRect:gh,getOffsetParent:vl,getElementRects:xh,getClientRects:uh,getDimensions:yh,getScale:cr,isElement:Qe,isRTL:bh};function xl(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function kh(t,e){let r=null,n;const s=ft(t);function a(){var o;clearTimeout(n),(o=r)==null||o.disconnect(),r=null}function i(o,c){o===void 0&&(o=!1),c===void 0&&(c=1),a();const u=t.getBoundingClientRect(),{left:f,top:d,width:m,height:p}=u;if(o||e(),!m||!p)return;const y=an(d),g=an(s.clientWidth-(f+m)),x=an(s.clientHeight-(d+p)),v=an(f),C={rootMargin:-y+"px "+-g+"px "+-x+"px "+-v+"px",threshold:Ie(0,Et(1,c))||1};let k=!0;function w(j){const T=j[0].intersectionRatio;if(T!==c){if(!k)return i();T?i(!1,T):n=setTimeout(()=>{i(!1,1e-7)},1e3)}T===1&&!xl(u,t.getBoundingClientRect())&&i(),k=!1}try{r=new IntersectionObserver(w,{...C,root:s.ownerDocument})}catch{r=new IntersectionObserver(w,C)}r.observe(t)}return i(!0),a}function Sh(t,e,r,n){n===void 0&&(n={});const{ancestorScroll:s=!0,ancestorResize:a=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,u=Sa(t),f=s||a?[...u?Lr(u):[],...Lr(e)]:[];f.forEach(v=>{s&&v.addEventListener("scroll",r,{passive:!0}),a&&v.addEventListener("resize",r)});const d=u&&o?kh(u,r):null;let m=-1,p=null;i&&(p=new ResizeObserver(v=>{let[S]=v;S&&S.target===u&&p&&(p.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var C;(C=p)==null||C.observe(e)})),r()}),u&&!c&&p.observe(u),p.observe(e));let y,g=c?Zt(t):null;c&&x();function x(){const v=Zt(t);g&&!xl(g,v)&&r(),g=v,y=requestAnimationFrame(x)}return r(),()=>{var v;f.forEach(S=>{s&&S.removeEventListener("scroll",r),a&&S.removeEventListener("resize",r)}),d?.(),(v=p)==null||v.disconnect(),p=null,c&&cancelAnimationFrame(y)}}const Nh=Yf,Ch=Gf,_h=Uf,Th=Jf,jh=Hf,Ri=Bf,Eh=Xf,Oh=(t,e,r)=>{const n=new Map,s={platform:wh,...r},a={...s.platform,_c:n};return Zf(t,e,{...s,platform:a})};var Dh=typeof document<"u",Rh=function(){},bn=Dh?b.useLayoutEffect:Rh;function On(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let r,n,s;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(r=t.length,r!==e.length)return!1;for(n=r;n--!==0;)if(!On(t[n],e[n]))return!1;return!0}if(s=Object.keys(t),r=s.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(e,s[n]))return!1;for(n=r;n--!==0;){const a=s[n];if(!(a==="_owner"&&t.$$typeof)&&!On(t[a],e[a]))return!1}return!0}return t!==t&&e!==e}function bl(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Ai(t,e){const r=bl(t);return Math.round(e*r)/r}function ks(t){const e=h.useRef(t);return bn(()=>{e.current=t}),e}function Ah(t){t===void 0&&(t={});const{placement:e="bottom",strategy:r="absolute",middleware:n=[],platform:s,elements:{reference:a,floating:i}={},transform:o=!0,whileElementsMounted:c,open:u}=t,[f,d]=h.useState({x:0,y:0,strategy:r,placement:e,middlewareData:{},isPositioned:!1}),[m,p]=h.useState(n);On(m,n)||p(n);const[y,g]=h.useState(null),[x,v]=h.useState(null),S=h.useCallback(V=>{V!==j.current&&(j.current=V,g(V))},[]),C=h.useCallback(V=>{V!==T.current&&(T.current=V,v(V))},[]),k=a||y,w=i||x,j=h.useRef(null),T=h.useRef(null),A=h.useRef(f),$=c!=null,L=ks(c),z=ks(s),B=ks(u),G=h.useCallback(()=>{if(!j.current||!T.current)return;const V={placement:e,strategy:r,middleware:m};z.current&&(V.platform=z.current),Oh(j.current,T.current,V).then(ie=>{const F={...ie,isPositioned:B.current!==!1};Q.current&&!On(A.current,F)&&(A.current=F,Zo.flushSync(()=>{d(F)}))})},[m,e,r,z,B]);bn(()=>{u===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,d(V=>({...V,isPositioned:!1})))},[u]);const Q=h.useRef(!1);bn(()=>(Q.current=!0,()=>{Q.current=!1}),[]),bn(()=>{if(k&&(j.current=k),w&&(T.current=w),k&&w){if(L.current)return L.current(k,w,G);G()}},[k,w,G,L,$]);const H=h.useMemo(()=>({reference:j,floating:T,setReference:S,setFloating:C}),[S,C]),P=h.useMemo(()=>({reference:k,floating:w}),[k,w]),U=h.useMemo(()=>{const V={position:r,left:0,top:0};if(!P.floating)return V;const ie=Ai(P.floating,f.x),F=Ai(P.floating,f.y);return o?{...V,transform:"translate("+ie+"px, "+F+"px)",...bl(P.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:ie,top:F}},[r,o,P.floating,f.x,f.y]);return h.useMemo(()=>({...f,update:G,refs:H,elements:P,floatingStyles:U}),[f,G,H,P,U])}const Mh=t=>{function e(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:t,fn(r){const{element:n,padding:s}=typeof t=="function"?t(r):t;return n&&e(n)?n.current!=null?Ri({element:n.current,padding:s}).fn(r):{}:n?Ri({element:n,padding:s}).fn(r):{}}}},Ih=(t,e)=>({...Nh(t),options:[t,e]}),Ph=(t,e)=>({...Ch(t),options:[t,e]}),Fh=(t,e)=>({...Eh(t),options:[t,e]}),Lh=(t,e)=>({..._h(t),options:[t,e]}),Vh=(t,e)=>({...Th(t),options:[t,e]}),$h=(t,e)=>({...jh(t),options:[t,e]}),Wh=(t,e)=>({...Mh(t),options:[t,e]});var zh="Arrow",wl=h.forwardRef((t,e)=>{const{children:r,width:n=10,height:s=5,...a}=t;return l.jsx(_e.svg,{...a,ref:e,width:n,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?r:l.jsx("polygon",{points:"0,0 30,0 15,10"})})});wl.displayName=zh;var Zh=wl;function kl(t){const[e,r]=h.useState(void 0);return jt(()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});const n=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const a=s[0];let i,o;if("borderBoxSize"in a){const c=a.borderBoxSize,u=Array.isArray(c)?c[0]:c;i=u.inlineSize,o=u.blockSize}else i=t.offsetWidth,o=t.offsetHeight;r({width:i,height:o})});return n.observe(t,{box:"border-box"}),()=>n.unobserve(t)}else r(void 0)},[t]),e}var Na="Popper",[Sl,Nl]=Un(Na),[Bh,Cl]=Sl(Na),_l=t=>{const{__scopePopper:e,children:r}=t,[n,s]=h.useState(null);return l.jsx(Bh,{scope:e,anchor:n,onAnchorChange:s,children:r})};_l.displayName=Na;var Tl="PopperAnchor",jl=h.forwardRef((t,e)=>{const{__scopePopper:r,virtualRef:n,...s}=t,a=Cl(Tl,r),i=h.useRef(null),o=$e(e,i),c=h.useRef(null);return h.useEffect(()=>{const u=c.current;c.current=n?.current||i.current,u!==c.current&&a.onAnchorChange(c.current)}),n?null:l.jsx(_e.div,{...s,ref:o})});jl.displayName=Tl;var Ca="PopperContent",[Uh,Hh]=Sl(Ca),El=h.forwardRef((t,e)=>{const{__scopePopper:r,side:n="bottom",sideOffset:s=0,align:a="center",alignOffset:i=0,arrowPadding:o=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:d="partial",hideWhenDetached:m=!1,updatePositionStrategy:p="optimized",onPlaced:y,...g}=t,x=Cl(Ca,r),[v,S]=h.useState(null),C=$e(e,Te=>S(Te)),[k,w]=h.useState(null),j=kl(k),T=j?.width??0,A=j?.height??0,$=n+(a!=="center"?"-"+a:""),L=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},z=Array.isArray(u)?u:[u],B=z.length>0,G={padding:L,boundary:z.filter(Yh),altBoundary:B},{refs:Q,floatingStyles:H,placement:P,isPositioned:U,middlewareData:V}=Ah({strategy:"fixed",placement:$,whileElementsMounted:(...Te)=>Sh(...Te,{animationFrame:p==="always"}),elements:{reference:x.anchor},middleware:[Ih({mainAxis:s+A,alignmentAxis:i}),c&&Ph({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?Fh():void 0,...G}),c&&Lh({...G}),Vh({...G,apply:({elements:Te,rects:le,availableWidth:vt,availableHeight:Yt})=>{const{width:Gt,height:xt}=le.reference,Xt=Te.floating.style;Xt.setProperty("--radix-popper-available-width",`${vt}px`),Xt.setProperty("--radix-popper-available-height",`${Yt}px`),Xt.setProperty("--radix-popper-anchor-width",`${Gt}px`),Xt.setProperty("--radix-popper-anchor-height",`${xt}px`)}}),k&&Wh({element:k,padding:o}),Gh({arrowWidth:T,arrowHeight:A}),m&&$h({strategy:"referenceHidden",...G})]}),[ie,F]=Rl(P),D=hr(y);jt(()=>{U&&D?.()},[U,D]);const ee=V.arrow?.x,W=V.arrow?.y,oe=V.arrow?.centerOffset!==0,[ce,ve]=h.useState();return jt(()=>{v&&ve(window.getComputedStyle(v).zIndex)},[v]),l.jsx("div",{ref:Q.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:U?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ce,"--radix-popper-transform-origin":[V.transformOrigin?.x,V.transformOrigin?.y].join(" "),...V.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:l.jsx(Uh,{scope:r,placedSide:ie,onArrowChange:w,arrowX:ee,arrowY:W,shouldHideArrow:oe,children:l.jsx(_e.div,{"data-side":ie,"data-align":F,...g,ref:C,style:{...g.style,animation:U?void 0:"none"}})})})});El.displayName=Ca;var Ol="PopperArrow",qh={top:"bottom",right:"left",bottom:"top",left:"right"},Dl=h.forwardRef(function(e,r){const{__scopePopper:n,...s}=e,a=Hh(Ol,n),i=qh[a.placedSide];return l.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:l.jsx(Zh,{...s,ref:r,style:{...s.style,display:"block"}})})});Dl.displayName=Ol;function Yh(t){return t!==null}var Gh=t=>({name:"transformOrigin",options:t,fn(e){const{placement:r,rects:n,middlewareData:s}=e,i=s.arrow?.centerOffset!==0,o=i?0:t.arrowWidth,c=i?0:t.arrowHeight,[u,f]=Rl(r),d={start:"0%",center:"50%",end:"100%"}[f],m=(s.arrow?.x??0)+o/2,p=(s.arrow?.y??0)+c/2;let y="",g="";return u==="bottom"?(y=i?d:`${m}px`,g=`${-c}px`):u==="top"?(y=i?d:`${m}px`,g=`${n.floating.height+c}px`):u==="right"?(y=`${-c}px`,g=i?d:`${p}px`):u==="left"&&(y=`${n.floating.width+c}px`,g=i?d:`${p}px`),{data:{x:y,y:g}}}});function Rl(t){const[e,r="center"]=t.split("-");return[e,r]}var Xh=_l,Al=jl,Jh=El,Kh=Dl,Qh="Portal",_a=h.forwardRef((t,e)=>{const{container:r,...n}=t,[s,a]=h.useState(!1);jt(()=>a(!0),[]);const i=r||s&&globalThis?.document?.body;return i?ma.createPortal(l.jsx(_e.div,{...n,ref:e}),i):null});_a.displayName=Qh;function em(t,e){return h.useReducer((r,n)=>e[r][n]??r,t)}var Nr=t=>{const{present:e,children:r}=t,n=tm(e),s=typeof r=="function"?r({present:n.isPresent}):h.Children.only(r),a=$e(n.ref,rm(s));return typeof r=="function"||n.isPresent?h.cloneElement(s,{ref:a}):null};Nr.displayName="Presence";function tm(t){const[e,r]=h.useState(),n=h.useRef(null),s=h.useRef(t),a=h.useRef("none"),i=t?"mounted":"unmounted",[o,c]=em(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const u=on(n.current);a.current=o==="mounted"?u:"none"},[o]),jt(()=>{const u=n.current,f=s.current;if(f!==t){const m=a.current,p=on(u);t?c("MOUNT"):p==="none"||u?.display==="none"?c("UNMOUNT"):c(f&&m!==p?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,c]),jt(()=>{if(e){let u;const f=e.ownerDocument.defaultView??window,d=p=>{const g=on(n.current).includes(CSS.escape(p.animationName));if(p.target===e&&g&&(c("ANIMATION_END"),!s.current)){const x=e.style.animationFillMode;e.style.animationFillMode="forwards",u=f.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=x)})}},m=p=>{p.target===e&&(a.current=on(n.current))};return e.addEventListener("animationstart",m),e.addEventListener("animationcancel",d),e.addEventListener("animationend",d),()=>{f.clearTimeout(u),e.removeEventListener("animationstart",m),e.removeEventListener("animationcancel",d),e.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:h.useCallback(u=>{n.current=u?getComputedStyle(u):null,r(u)},[])}}function on(t){return t?.animationName||"none"}function rm(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var nm=h[" useInsertionEffect ".trim().toString()]||jt;function Ta({prop:t,defaultProp:e,onChange:r=()=>{},caller:n}){const[s,a,i]=sm({defaultProp:e,onChange:r}),o=t!==void 0,c=o?t:s;{const f=h.useRef(t!==void 0);h.useEffect(()=>{const d=f.current;d!==o&&console.warn(`${n} is changing from ${d?"controlled":"uncontrolled"} to ${o?"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.`),f.current=o},[o,n])}const u=h.useCallback(f=>{if(o){const d=am(f)?f(t):f;d!==t&&i.current?.(d)}else a(f)},[o,t,a,i]);return[c,u]}function sm({defaultProp:t,onChange:e}){const[r,n]=h.useState(t),s=h.useRef(r),a=h.useRef(e);return nm(()=>{a.current=e},[e]),h.useEffect(()=>{s.current!==r&&(a.current?.(r),s.current=r)},[r,s]),[r,n,a]}function am(t){return typeof t=="function"}var im=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},er=new WeakMap,ln=new WeakMap,cn={},Ss=0,Ml=function(t){return t&&(t.host||Ml(t.parentNode))},om=function(t,e){return e.map(function(r){if(t.contains(r))return r;var n=Ml(r);return n&&t.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",t,". Doing nothing"),null)}).filter(function(r){return!!r})},lm=function(t,e,r,n){var s=om(e,Array.isArray(t)?t:[t]);cn[r]||(cn[r]=new WeakMap);var a=cn[r],i=[],o=new Set,c=new Set(s),u=function(d){!d||o.has(d)||(o.add(d),u(d.parentNode))};s.forEach(u);var f=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(m){if(o.has(m))f(m);else try{var p=m.getAttribute(n),y=p!==null&&p!=="false",g=(er.get(m)||0)+1,x=(a.get(m)||0)+1;er.set(m,g),a.set(m,x),i.push(m),g===1&&y&&ln.set(m,!0),x===1&&m.setAttribute(r,"true"),y||m.setAttribute(n,"true")}catch(v){console.error("aria-hidden: cannot operate on ",m,v)}})};return f(e),o.clear(),Ss++,function(){i.forEach(function(d){var m=er.get(d)-1,p=a.get(d)-1;er.set(d,m),a.set(d,p),m||(ln.has(d)||d.removeAttribute(n),ln.delete(d)),p||d.removeAttribute(r)}),Ss--,Ss||(er=new WeakMap,er=new WeakMap,ln=new WeakMap,cn={})}},Il=function(t,e,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(t)?t:[t]),s=im(t);return s?(n.push.apply(n,Array.from(s.querySelectorAll("[aria-live], script"))),lm(n,s,r,"aria-hidden")):function(){return null}},it=function(){return it=Object.assign||function(e){for(var r,n=1,s=arguments.length;n<s;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},it.apply(this,arguments)};function Pl(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(r[n[s]]=t[n[s]]);return r}function cm(t,e,r){if(r||arguments.length===2)for(var n=0,s=e.length,a;n<s;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return t.concat(a||Array.prototype.slice.call(e))}var wn="right-scroll-bar-position",kn="width-before-scroll-bar",um="with-scroll-bars-hidden",dm="--removed-body-scroll-bar-size";function Ns(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function fm(t,e){var r=b.useState(function(){return{value:t,callback:e,facade:{get current(){return r.value},set current(n){var s=r.value;s!==n&&(r.value=n,r.callback(n,s))}}}})[0];return r.callback=e,r.facade}var hm=typeof window<"u"?h.useLayoutEffect:h.useEffect,Mi=new WeakMap;function mm(t,e){var r=fm(null,function(n){return t.forEach(function(s){return Ns(s,n)})});return hm(function(){var n=Mi.get(r);if(n){var s=new Set(n),a=new Set(t),i=r.current;s.forEach(function(o){a.has(o)||Ns(o,null)}),a.forEach(function(o){s.has(o)||Ns(o,i)})}Mi.set(r,t)},[t]),r}function pm(t){return t}function gm(t,e){e===void 0&&(e=pm);var r=[],n=!1,s={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:t},useMedium:function(a){var i=e(a,n);return r.push(i),function(){r=r.filter(function(o){return o!==i})}},assignSyncMedium:function(a){for(n=!0;r.length;){var i=r;r=[],i.forEach(a)}r={push:function(o){return a(o)},filter:function(){return r}}},assignMedium:function(a){n=!0;var i=[];if(r.length){var o=r;r=[],o.forEach(a),i=r}var c=function(){var f=i;i=[],f.forEach(a)},u=function(){return Promise.resolve().then(c)};u(),r={push:function(f){i.push(f),u()},filter:function(f){return i=i.filter(f),r}}}};return s}function ym(t){t===void 0&&(t={});var e=gm(null);return e.options=it({async:!0,ssr:!1},t),e}var Fl=function(t){var e=t.sideCar,r=Pl(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=e.read();if(!n)throw new Error("Sidecar medium not found");return h.createElement(n,it({},r))};Fl.isSideCarExport=!0;function vm(t,e){return t.useMedium(e),Fl}var Ll=ym(),Cs=function(){},Xn=h.forwardRef(function(t,e){var r=h.useRef(null),n=h.useState({onScrollCapture:Cs,onWheelCapture:Cs,onTouchMoveCapture:Cs}),s=n[0],a=n[1],i=t.forwardProps,o=t.children,c=t.className,u=t.removeScrollBar,f=t.enabled,d=t.shards,m=t.sideCar,p=t.noRelative,y=t.noIsolation,g=t.inert,x=t.allowPinchZoom,v=t.as,S=v===void 0?"div":v,C=t.gapMode,k=Pl(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),w=m,j=mm([r,e]),T=it(it({},k),s);return h.createElement(h.Fragment,null,f&&h.createElement(w,{sideCar:Ll,removeScrollBar:u,shards:d,noRelative:p,noIsolation:y,inert:g,setCallbacks:a,allowPinchZoom:!!x,lockRef:r,gapMode:C}),i?h.cloneElement(h.Children.only(o),it(it({},T),{ref:j})):h.createElement(S,it({},T,{className:c,ref:j}),o))});Xn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Xn.classNames={fullWidth:kn,zeroRight:wn};var xm=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function bm(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=xm();return e&&t.setAttribute("nonce",e),t}function wm(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function km(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var Sm=function(){var t=0,e=null;return{add:function(r){t==0&&(e=bm())&&(wm(e,r),km(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},Nm=function(){var t=Sm();return function(e,r){h.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&r])}},Vl=function(){var t=Nm(),e=function(r){var n=r.styles,s=r.dynamic;return t(n,s),null};return e},Cm={left:0,top:0,right:0,gap:0},_s=function(t){return parseInt(t||"",10)||0},_m=function(t){var e=window.getComputedStyle(document.body),r=e[t==="padding"?"paddingLeft":"marginLeft"],n=e[t==="padding"?"paddingTop":"marginTop"],s=e[t==="padding"?"paddingRight":"marginRight"];return[_s(r),_s(n),_s(s)]},Tm=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return Cm;var e=_m(t),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,n-r+e[2]-e[0])}},jm=Vl(),ur="data-scroll-locked",Em=function(t,e,r,n){var s=t.left,a=t.top,i=t.right,o=t.gap;return r===void 0&&(r="margin"),`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Wo=require("tailwind-merge"),ha=require("clsx"),l=require("react/jsx-runtime"),b=require("react"),J=require("lucide-react"),ma=require("react-dom"),Dd=require("@radix-ui/react-dropdown-menu"),Rd=require("lottie-react"),Ad=require("@radix-ui/react-select"),Md=require("@radix-ui/react-tooltip");function Br(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const h=Br(b),Zo=Br(ma),fe=Br(Dd),pe=Br(Ad),zt=Br(Md),wr=t=>{let e=0;for(let r=0;r<t.length;r++){const n=t.charCodeAt(r);e=(e<<5)-e+n,e=e&e}return Math.abs(e)},Bo=(t,e)=>Math.floor(t/Math.pow(10,e)%10),$s=(t,e)=>!(Bo(t,e)%2),Se=(t,e,r)=>{const n=t%e;return r&&Bo(t,r)%2===0?-n:n},Wt=(t,e,r)=>e[t%r],Id=t=>{t.slice(0,1)==="#"&&(t=t.slice(1));const e=parseInt(t.substr(0,2),16),r=parseInt(t.substr(2,2),16),n=parseInt(t.substr(4,2),16);return(e*299+r*587+n*114)/1e3>=128?"#000000":"#FFFFFF"},Pd=4,ue=80;function Fd(t,e){const r=wr(t),n=e&&e.length;return Array.from({length:Pd},(s,a)=>({color:Wt(r+a,e,n),translateX:Se(r*(a+1),ue/2-(a+17),1),translateY:Se(r*(a+1),ue/2-(a+17),2),rotate:Se(r*(a+1),360),isSquare:$s(r,2)}))}const di=({name:t,colors:e,title:r,square:n,size:s,...a})=>{const i=Fd(t,e),o=h.useId();return l.jsxs("svg",{viewBox:"0 0 "+ue+" "+ue,fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:s,height:s,...a,children:[r&&l.jsx("title",{children:t}),l.jsx("mask",{id:o,maskUnits:"userSpaceOnUse",x:0,y:0,width:ue,height:ue,children:l.jsx("rect",{width:ue,height:ue,rx:n?void 0:ue*2,fill:"#FFFFFF"})}),l.jsxs("g",{mask:`url(#${o})`,children:[l.jsx("rect",{width:ue,height:ue,fill:i[0].color}),l.jsx("rect",{x:(ue-60)/2,y:(ue-20)/2,width:ue,height:i[1].isSquare?ue:ue/8,fill:i[1].color,transform:"translate("+i[1].translateX+" "+i[1].translateY+") rotate("+i[1].rotate+" "+ue/2+" "+ue/2+")"}),l.jsx("circle",{cx:ue/2,cy:ue/2,fill:i[2].color,r:ue/5,transform:"translate("+i[2].translateX+" "+i[2].translateY+")"}),l.jsx("line",{x1:0,y1:ue/2,x2:ue,y2:ue/2,strokeWidth:2,stroke:i[3].color,transform:"translate("+i[3].translateX+" "+i[3].translateY+") rotate("+i[3].rotate+" "+ue/2+" "+ue/2+")"})]})]})},It=90,Ld=5;function Vd(t,e){const r=wr(t),n=e&&e.length,s=Array.from({length:Ld},(i,o)=>Wt(r+o,e,n)),a=[];return a[0]=s[0],a[1]=s[1],a[2]=s[1],a[3]=s[2],a[4]=s[2],a[5]=s[3],a[6]=s[3],a[7]=s[0],a[8]=s[4],a}const $d=({name:t,colors:e,title:r,square:n,size:s,...a})=>{const i=Vd(t,e),o=b.useId();return l.jsxs("svg",{viewBox:"0 0 "+It+" "+It,fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:s,height:s,...a,children:[r&&l.jsx("title",{children:t}),l.jsx("mask",{id:o,maskUnits:"userSpaceOnUse",x:0,y:0,width:It,height:It,children:l.jsx("rect",{width:It,height:It,rx:n?void 0:It*2,fill:"#FFFFFF"})}),l.jsxs("g",{mask:`url(#${o})`,children:[l.jsx("path",{d:"M0 0h90v45H0z",fill:i[0]}),l.jsx("path",{d:"M0 45h90v45H0z",fill:i[1]}),l.jsx("path",{d:"M83 45a38 38 0 00-76 0h76z",fill:i[2]}),l.jsx("path",{d:"M83 45a38 38 0 01-76 0h76z",fill:i[3]}),l.jsx("path",{d:"M77 45a32 32 0 10-64 0h64z",fill:i[4]}),l.jsx("path",{d:"M77 45a32 32 0 11-64 0h64z",fill:i[5]}),l.jsx("path",{d:"M71 45a26 26 0 00-52 0h52z",fill:i[6]}),l.jsx("path",{d:"M71 45a26 26 0 01-52 0h52z",fill:i[7]}),l.jsx("circle",{cx:45,cy:45,r:23,fill:i[8]})]})]})},zd=64,Pt=80;function Wd(t,e){const r=wr(t),n=e&&e.length;return Array.from({length:zd},(s,a)=>Wt(r%(a+1),e,n))}const Zd=({name:t,colors:e,title:r,square:n,size:s,...a})=>{const i=Wd(t,e),o=h.useId();return l.jsxs("svg",{viewBox:"0 0 "+Pt+" "+Pt,fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:s,height:s,...a,children:[r&&l.jsx("title",{children:t}),l.jsx("mask",{id:o,"mask-type":"alpha",maskUnits:"userSpaceOnUse",x:0,y:0,width:Pt,height:Pt,children:l.jsx("rect",{width:Pt,height:Pt,rx:n?void 0:Pt*2,fill:"#FFFFFF"})}),l.jsxs("g",{mask:`url(#${o})`,children:[l.jsx("rect",{width:10,height:10,fill:i[0]}),l.jsx("rect",{x:20,width:10,height:10,fill:i[1]}),l.jsx("rect",{x:40,width:10,height:10,fill:i[2]}),l.jsx("rect",{x:60,width:10,height:10,fill:i[3]}),l.jsx("rect",{x:10,width:10,height:10,fill:i[4]}),l.jsx("rect",{x:30,width:10,height:10,fill:i[5]}),l.jsx("rect",{x:50,width:10,height:10,fill:i[6]}),l.jsx("rect",{x:70,width:10,height:10,fill:i[7]}),l.jsx("rect",{y:10,width:10,height:10,fill:i[8]}),l.jsx("rect",{y:20,width:10,height:10,fill:i[9]}),l.jsx("rect",{y:30,width:10,height:10,fill:i[10]}),l.jsx("rect",{y:40,width:10,height:10,fill:i[11]}),l.jsx("rect",{y:50,width:10,height:10,fill:i[12]}),l.jsx("rect",{y:60,width:10,height:10,fill:i[13]}),l.jsx("rect",{y:70,width:10,height:10,fill:i[14]}),l.jsx("rect",{x:20,y:10,width:10,height:10,fill:i[15]}),l.jsx("rect",{x:20,y:20,width:10,height:10,fill:i[16]}),l.jsx("rect",{x:20,y:30,width:10,height:10,fill:i[17]}),l.jsx("rect",{x:20,y:40,width:10,height:10,fill:i[18]}),l.jsx("rect",{x:20,y:50,width:10,height:10,fill:i[19]}),l.jsx("rect",{x:20,y:60,width:10,height:10,fill:i[20]}),l.jsx("rect",{x:20,y:70,width:10,height:10,fill:i[21]}),l.jsx("rect",{x:40,y:10,width:10,height:10,fill:i[22]}),l.jsx("rect",{x:40,y:20,width:10,height:10,fill:i[23]}),l.jsx("rect",{x:40,y:30,width:10,height:10,fill:i[24]}),l.jsx("rect",{x:40,y:40,width:10,height:10,fill:i[25]}),l.jsx("rect",{x:40,y:50,width:10,height:10,fill:i[26]}),l.jsx("rect",{x:40,y:60,width:10,height:10,fill:i[27]}),l.jsx("rect",{x:40,y:70,width:10,height:10,fill:i[28]}),l.jsx("rect",{x:60,y:10,width:10,height:10,fill:i[29]}),l.jsx("rect",{x:60,y:20,width:10,height:10,fill:i[30]}),l.jsx("rect",{x:60,y:30,width:10,height:10,fill:i[31]}),l.jsx("rect",{x:60,y:40,width:10,height:10,fill:i[32]}),l.jsx("rect",{x:60,y:50,width:10,height:10,fill:i[33]}),l.jsx("rect",{x:60,y:60,width:10,height:10,fill:i[34]}),l.jsx("rect",{x:60,y:70,width:10,height:10,fill:i[35]}),l.jsx("rect",{x:10,y:10,width:10,height:10,fill:i[36]}),l.jsx("rect",{x:10,y:20,width:10,height:10,fill:i[37]}),l.jsx("rect",{x:10,y:30,width:10,height:10,fill:i[38]}),l.jsx("rect",{x:10,y:40,width:10,height:10,fill:i[39]}),l.jsx("rect",{x:10,y:50,width:10,height:10,fill:i[40]}),l.jsx("rect",{x:10,y:60,width:10,height:10,fill:i[41]}),l.jsx("rect",{x:10,y:70,width:10,height:10,fill:i[42]}),l.jsx("rect",{x:30,y:10,width:10,height:10,fill:i[43]}),l.jsx("rect",{x:30,y:20,width:10,height:10,fill:i[44]}),l.jsx("rect",{x:30,y:30,width:10,height:10,fill:i[45]}),l.jsx("rect",{x:30,y:40,width:10,height:10,fill:i[46]}),l.jsx("rect",{x:30,y:50,width:10,height:10,fill:i[47]}),l.jsx("rect",{x:30,y:60,width:10,height:10,fill:i[48]}),l.jsx("rect",{x:30,y:70,width:10,height:10,fill:i[49]}),l.jsx("rect",{x:50,y:10,width:10,height:10,fill:i[50]}),l.jsx("rect",{x:50,y:20,width:10,height:10,fill:i[51]}),l.jsx("rect",{x:50,y:30,width:10,height:10,fill:i[52]}),l.jsx("rect",{x:50,y:40,width:10,height:10,fill:i[53]}),l.jsx("rect",{x:50,y:50,width:10,height:10,fill:i[54]}),l.jsx("rect",{x:50,y:60,width:10,height:10,fill:i[55]}),l.jsx("rect",{x:50,y:70,width:10,height:10,fill:i[56]}),l.jsx("rect",{x:70,y:10,width:10,height:10,fill:i[57]}),l.jsx("rect",{x:70,y:20,width:10,height:10,fill:i[58]}),l.jsx("rect",{x:70,y:30,width:10,height:10,fill:i[59]}),l.jsx("rect",{x:70,y:40,width:10,height:10,fill:i[60]}),l.jsx("rect",{x:70,y:50,width:10,height:10,fill:i[61]}),l.jsx("rect",{x:70,y:60,width:10,height:10,fill:i[62]}),l.jsx("rect",{x:70,y:70,width:10,height:10,fill:i[63]})]})]})},he=36;function Bd(t,e){const r=wr(t),n=e&&e.length,s=Wt(r,e,n),a=Se(r,10,1),i=a<5?a+he/9:a,o=Se(r,10,2),c=o<5?o+he/9:o;return{wrapperColor:s,faceColor:Id(s),backgroundColor:Wt(r+13,e,n),wrapperTranslateX:i,wrapperTranslateY:c,wrapperRotate:Se(r,360),wrapperScale:1+Se(r,he/12)/10,isMouthOpen:$s(r,2),isCircle:$s(r,1),eyeSpread:Se(r,5),mouthSpread:Se(r,3),faceRotate:Se(r,10,3),faceTranslateX:i>he/6?i/2:Se(r,8,1),faceTranslateY:c>he/6?c/2:Se(r,7,2)}}const fi=({name:t,colors:e,title:r,square:n,size:s,...a})=>{const i=Bd(t,e),o=h.useId();return l.jsxs("svg",{viewBox:"0 0 "+he+" "+he,fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:s,height:s,...a,children:[r&&l.jsx("title",{children:t}),l.jsx("mask",{id:o,maskUnits:"userSpaceOnUse",x:0,y:0,width:he,height:he,children:l.jsx("rect",{width:he,height:he,rx:n?void 0:he*2,fill:"#FFFFFF"})}),l.jsxs("g",{mask:`url(#${o})`,children:[l.jsx("rect",{width:he,height:he,fill:i.backgroundColor}),l.jsx("rect",{x:"0",y:"0",width:he,height:he,transform:"translate("+i.wrapperTranslateX+" "+i.wrapperTranslateY+") rotate("+i.wrapperRotate+" "+he/2+" "+he/2+") scale("+i.wrapperScale+")",fill:i.wrapperColor,rx:i.isCircle?he:he/6}),l.jsxs("g",{transform:"translate("+i.faceTranslateX+" "+i.faceTranslateY+") rotate("+i.faceRotate+" "+he/2+" "+he/2+")",children:[i.isMouthOpen?l.jsx("path",{d:"M15 "+(19+i.mouthSpread)+"c2 1 4 1 6 0",stroke:i.faceColor,fill:"none",strokeLinecap:"round"}):l.jsx("path",{d:"M13,"+(19+i.mouthSpread)+" a1,0.75 0 0,0 10,0",fill:i.faceColor}),l.jsx("rect",{x:14-i.eyeSpread,y:14,width:1.5,height:2,rx:1,stroke:"none",fill:i.faceColor}),l.jsx("rect",{x:20+i.eyeSpread,y:14,width:1.5,height:2,rx:1,stroke:"none",fill:i.faceColor})]})]})]})},Ud=4,Ee=80;function Hd(t,e){const r=wr(t),n=e&&e.length;return Array.from({length:Ud},(s,a)=>Wt(r+a,e,n))}const qd=({name:t,colors:e,title:r,square:n,size:s,...a})=>{const i=Hd(t,e),o=t.replace(/\s/g,""),c=h.useId();return l.jsxs("svg",{viewBox:"0 0 "+Ee+" "+Ee,fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:s,height:s,...a,children:[r&&l.jsx("title",{children:t}),l.jsx("mask",{id:c,maskUnits:"userSpaceOnUse",x:0,y:0,width:Ee,height:Ee,children:l.jsx("rect",{width:Ee,height:Ee,rx:n?void 0:Ee*2,fill:"#FFFFFF"})}),l.jsxs("g",{mask:`url(#${c})`,children:[l.jsx("path",{fill:"url(#gradient_paint0_linear_"+o+")",d:"M0 0h80v40H0z"}),l.jsx("path",{fill:"url(#gradient_paint1_linear_"+o+")",d:"M0 40h80v40H0z"})]}),l.jsxs("defs",{children:[l.jsxs("linearGradient",{id:"gradient_paint0_linear_"+o,x1:Ee/2,y1:0,x2:Ee/2,y2:Ee/2,gradientUnits:"userSpaceOnUse",children:[l.jsx("stop",{stopColor:i[0]}),l.jsx("stop",{offset:1,stopColor:i[1]})]}),l.jsxs("linearGradient",{id:"gradient_paint1_linear_"+o,x1:Ee/2,y1:Ee/2,x2:Ee/2,y2:Ee,gradientUnits:"userSpaceOnUse",children:[l.jsx("stop",{stopColor:i[2]}),l.jsx("stop",{offset:1,stopColor:i[3]})]})]})]})},Yd=3,ke=80;function Gd(t,e){const r=wr(t),n=e&&e.length;return Array.from({length:Yd},(s,a)=>({color:Wt(r+a,e,n),translateX:Se(r*(a+1),ke/10,1),translateY:Se(r*(a+1),ke/10,2),scale:1.2+Se(r*(a+1),ke/20)/10,rotate:Se(r*(a+1),360,1)}))}const Uo=({name:t,colors:e,title:r,square:n,size:s,...a})=>{const i=Gd(t,e),o=h.useId();return l.jsxs("svg",{viewBox:"0 0 "+ke+" "+ke,fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:s,height:s,...a,children:[r&&l.jsx("title",{children:t}),l.jsx("mask",{id:o,maskUnits:"userSpaceOnUse",x:0,y:0,width:ke,height:ke,children:l.jsx("rect",{width:ke,height:ke,rx:n?void 0:ke*2,fill:"#FFFFFF"})}),l.jsxs("g",{mask:`url(#${o})`,children:[l.jsx("rect",{width:ke,height:ke,fill:i[0].color}),l.jsx("path",{filter:`url(#filter_${o})`,d:"M32.414 59.35L50.376 70.5H72.5v-71H33.728L26.5 13.381l19.057 27.08L32.414 59.35z",fill:i[1].color,transform:"translate("+i[1].translateX+" "+i[1].translateY+") rotate("+i[1].rotate+" "+ke/2+" "+ke/2+") scale("+i[2].scale+")"}),l.jsx("path",{filter:`url(#filter_${o})`,style:{mixBlendMode:"overlay"},d:"M22.216 24L0 46.75l14.108 38.129L78 86l-3.081-59.276-22.378 4.005 12.972 20.186-23.35 27.395L22.215 24z",fill:i[2].color,transform:"translate("+i[2].translateX+" "+i[2].translateY+") rotate("+i[2].rotate+" "+ke/2+" "+ke/2+") scale("+i[2].scale+")"})]}),l.jsx("defs",{children:l.jsxs("filter",{id:`filter_${o}`,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[l.jsx("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),l.jsx("feBlend",{in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),l.jsx("feGaussianBlur",{stdDeviation:7,result:"effect1_foregroundBlur"})]})})]})},Xd={pixel:Zd,bauhaus:di,ring:$d,beam:fi,sunset:qd,marble:Uo,geometric:fi,abstract:di},Ho=({variant:t="marble",colors:e=["#92A1C6","#146A7C","#F0AB3D","#C271B4","#C20D90"],name:r="Clara Barton",title:n=!1,size:s="40px",square:a=!1,...i})=>{const o=Xd[t]||Uo;return l.jsx(o,{colors:e,name:r,title:n,size:s,square:a,...i})},qo=["var(--oniratec-brand)","var(--oniratec-fill-primary)","var(--oniratec-label-primary)"],Jd=({personId:t})=>l.jsx(Ho,{size:40,name:t,variant:"beam",colors:qo}),Kd=({userId:t})=>l.jsx(Ho,{size:40,name:t,variant:"bauhaus",colors:qo});function N(...t){return Wo.twMerge(ha.clsx(t))}const Qd=({children:t,className:e})=>l.jsx("div",{className:N("rounded-lg border border-[color:var(--oniratec-border-primary)] bg-[color:var(--oniratec-fill-primary)] p-4 shadow-[var(--oniratec-shadow-card-md)]",e),children:t});function hi(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Yo(...t){return e=>{let r=!1;const n=t.map(s=>{const a=hi(s,e);return!r&&typeof a=="function"&&(r=!0),a});if(r)return()=>{for(let s=0;s<n.length;s++){const a=n[s];typeof a=="function"?a():hi(t[s],null)}}}}function $e(...t){return h.useCallback(Yo(...t),t)}function Zn(t){const e=ef(t),r=h.forwardRef((n,s)=>{const{children:a,...i}=n,o=h.Children.toArray(a),c=o.find(rf);if(c){const u=c.props.children,f=o.map(d=>d===c?h.Children.count(u)>1?h.Children.only(null):h.isValidElement(u)?u.props.children:null:d);return l.jsx(e,{...i,ref:s,children:h.isValidElement(u)?h.cloneElement(u,void 0,f):null})}return l.jsx(e,{...i,ref:s,children:a})});return r.displayName=`${t}.Slot`,r}var Go=Zn("Slot");function ef(t){const e=h.forwardRef((r,n)=>{const{children:s,...a}=r;if(h.isValidElement(s)){const i=sf(s),o=nf(a,s.props);return s.type!==h.Fragment&&(o.ref=n?Yo(n,i):i),h.cloneElement(s,o)}return h.Children.count(s)>1?h.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var tf=Symbol("radix.slottable");function rf(t){return h.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===tf}function nf(t,e){const r={...e};for(const n in e){const s=t[n],a=e[n];/^on[A-Z]/.test(n)?s&&a?r[n]=(...o)=>{const c=a(...o);return s(...o),c}:s&&(r[n]=s):n==="style"?r[n]={...s,...a}:n==="className"&&(r[n]=[s,a].filter(Boolean).join(" "))}return{...t,...r}}function sf(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}const mi=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,pi=ha.clsx,Bn=(t,e)=>r=>{var n;if(e?.variants==null)return pi(t,r?.class,r?.className);const{variants:s,defaultVariants:a}=e,i=Object.keys(s).map(u=>{const f=r?.[u],d=a?.[u];if(f===null)return null;const m=mi(f)||mi(d);return s[u][m]}),o=r&&Object.entries(r).reduce((u,f)=>{let[d,m]=f;return m===void 0||(u[d]=m),u},{}),c=e==null||(n=e.compoundVariants)===null||n===void 0?void 0:n.reduce((u,f)=>{let{class:d,className:m,...p}=f;return Object.entries(p).every(y=>{let[g,x]=y;return Array.isArray(x)?x.includes({...a,...o}[g]):{...a,...o}[g]===x})?[...u,d,m]:u},[]);return pi(t,i,c,r?.class,r?.className)},Xo=Bn("inline-flex shrink-0 items-center justify-center gap-1.5 whitespace-nowrap rounded-lg border border-transparent text-sm font-medium transition-[background-color,border-color,color,transform,box-shadow] outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",primary:"bg-primary text-primary-foreground hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted dark:border-input dark:bg-input/30 dark:hover:bg-input/50",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted dark:hover:bg-muted/60",link:"h-auto rounded-none border-transparent px-0 py-0 text-primary underline-offset-4 hover:underline focus-visible:border-transparent focus-visible:ring-0"},size:{xs:"h-6 rounded-md px-2 text-xs [&_svg]:size-3",sm:"h-7 rounded-md px-2.5 text-[0.8rem] [&_svg]:size-3.5",md:"h-8 px-2.5",lg:"h-9 px-3 text-sm",icon:"h-8 w-8","icon-sm":"h-7 w-7 rounded-md","icon-lg":"h-9 w-9"}},defaultVariants:{variant:"default",size:"md"}}),Le=h.forwardRef(({className:t,asChild:e=!1,variant:r="default",size:n="md",loading:s=!1,disabled:a,children:i,...o},c)=>{const u=e?Go:"button";return l.jsxs(u,{ref:c,"data-size":n??void 0,"data-variant":r??void 0,className:N(Xo({variant:r,size:n}),t),disabled:a||s,...o,children:[s&&l.jsx(J.Loader2,{className:"h-4 w-4 animate-spin"}),i]})});Le.displayName="Button";const af=({src:t,alt:e,width:r=70,height:n=70,className:s,ImageComponent:a,...i})=>{const o=a??"img";return l.jsx(o,{type:void 0,props:void 0,src:t,alt:e,width:r,height:n,className:N("inline-block object-contain",s),...i},null)},zs=({children:t,className:e,size:r="default"})=>l.jsx("div",{className:N("flex flex-col overflow-hidden rounded-xl bg-card text-card-foreground ring-1 ring-foreground/10 shadow-card-sm transition-[box-shadow,transform]",r==="sm"?"gap-3 py-3":"gap-4 py-4","hover:shadow-card-md",e),children:t}),Jo=({children:t,className:e})=>l.jsx("div",{className:N("grid gap-1 px-4",e),children:t}),Ko=({children:t,className:e})=>l.jsx("h3",{className:N("text-base font-medium leading-snug text-card-foreground",e),children:t}),of=({children:t,className:e})=>l.jsx("p",{className:N("text-sm text-muted-foreground",e),children:t}),Qo=({children:t,className:e})=>l.jsx("div",{className:N("px-4",e),children:t}),lf=({children:t,className:e})=>l.jsx("div",{className:N("ml-auto flex items-center gap-2",e),children:t}),cf=({children:t,className:e})=>l.jsx("div",{className:N("flex items-center gap-2 border-t bg-muted/50 p-4",e),children:t}),el=Bn("relative grid w-full grid-cols-[auto_1fr] items-start gap-3 rounded-xl bg-card p-4 text-sm text-card-foreground ring-1 ring-foreground/10",{variants:{variant:{info:"[&_svg]:text-muted-foreground",success:"bg-primary/5 ring-primary/15 [&_svg]:text-primary dark:bg-primary/10",warning:"bg-amber-500/10 ring-amber-500/20 [&_svg]:text-amber-600 dark:bg-amber-500/15 dark:[&_svg]:text-amber-400",error:"bg-destructive/10 ring-destructive/20 [&_svg]:text-destructive dark:bg-destructive/15"}},defaultVariants:{variant:"info"}}),uf={error:J.AlertCircle,warning:J.AlertTriangle,info:J.Info,success:J.CheckCircle},tl=h.forwardRef(({className:t,variant:e="info",children:r,...n},s)=>{const a=uf[e];return l.jsxs("div",{ref:s,role:"alert",className:N(el({variant:e}),t),...n,children:[a&&l.jsx(a,{className:"mt-0.5 h-4 w-4 shrink-0","aria-hidden":"true"}),l.jsx("div",{className:"flex-1",children:r})]})});tl.displayName="Alert";const rl=h.forwardRef(({className:t,...e},r)=>l.jsx("h5",{ref:r,className:N("mb-1 font-medium leading-none tracking-tight",t),...e}));rl.displayName="AlertTitle";const nl=h.forwardRef(({className:t,...e},r)=>l.jsx("div",{ref:r,className:N("text-sm text-muted-foreground [&_p]:leading-relaxed",t),...e}));nl.displayName="AlertDescription";const sl=Bn("inline-flex items-center rounded-md border font-medium transition-colors focus:outline-none focus-visible:ring-3 focus-visible:ring-ring/50",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",success:"border-transparent bg-emerald-500/15 text-emerald-700 dark:text-emerald-400",warning:"border-transparent bg-amber-500/10 text-amber-700 dark:text-amber-300",danger:"border-transparent bg-destructive/10 text-destructive",info:"border-transparent bg-accent text-accent-foreground",outline:"border-border bg-background text-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground"},size:{sm:"px-1.5 py-0.5 text-[11px]",md:"px-2 py-0.5 text-xs"}},defaultVariants:{variant:"default",size:"md"}}),pa=h.forwardRef(({className:t,variant:e="default",size:r="md",...n},s)=>l.jsx("span",{ref:s,className:N(sl({variant:e,size:r}),t),...n}));pa.displayName="Badge";const al=h.forwardRef(({className:t,id:e,label:r,description:n,size:s="md",indeterminate:a=!1,disabled:i,"aria-describedby":o,"aria-invalid":c,...u},f)=>{const d=h.useId(),m=e??d,p=n?`${m}-description`:void 0,y=c===!0||c==="true",g=h.useRef(null);h.useEffect(()=>{g.current&&(g.current.indeterminate=a)},[a]);const x=h.useCallback(v=>{g.current=v,typeof f=="function"?f(v):f&&(f.current=v)},[f]);return l.jsxs("label",{htmlFor:m,className:N("inline-flex w-fit items-start gap-2.5 text-sm",i&&"cursor-not-allowed opacity-60",t),children:[l.jsx("input",{ref:x,id:m,type:"checkbox",disabled:i,"aria-invalid":y||void 0,"aria-checked":a?"mixed":void 0,"aria-describedby":[o,p].filter(Boolean).join(" ")||void 0,className:"peer sr-only",...u}),l.jsx("span",{className:N("flex shrink-0 items-center justify-center rounded-[min(var(--radius-md),10px)] border border-input bg-background text-primary-foreground transition-[background-color,border-color,box-shadow,color] outline-none","peer-focus-visible:border-ring peer-focus-visible:ring-3 peer-focus-visible:ring-ring/50","peer-disabled:border-border/50 peer-disabled:bg-muted/50 peer-disabled:opacity-70",!a&&"peer-checked:border-primary peer-checked:bg-primary peer-checked:[&_svg]:opacity-100",a&&"border-primary bg-primary [&_svg]:opacity-100",y&&"border-destructive peer-focus-visible:border-destructive peer-focus-visible:ring-destructive/20",s==="sm"?"h-4 w-4":"h-5 w-5"),children:a?l.jsx(J.Minus,{className:"h-3.5 w-3.5 opacity-0 transition-opacity"}):l.jsx(J.Check,{className:"h-3.5 w-3.5 opacity-0 transition-opacity"})}),(r||n)&&l.jsxs("span",{className:"grid gap-1 leading-tight",children:[r&&l.jsx("span",{className:"font-medium text-foreground",children:r}),n&&l.jsx("span",{id:p,className:"text-sm text-muted-foreground",children:n})]})]})});al.displayName="Checkbox";function Re(t,e,{checkForDefaultPrevented:r=!0}={}){return function(s){if(t?.(s),r===!1||!s.defaultPrevented)return e?.(s)}}function df(t,e){const r=h.createContext(e),n=a=>{const{children:i,...o}=a,c=h.useMemo(()=>o,Object.values(o));return l.jsx(r.Provider,{value:c,children:i})};n.displayName=t+"Provider";function s(a){const i=h.useContext(r);if(i)return i;if(e!==void 0)return e;throw new Error(`\`${a}\` must be used within \`${t}\``)}return[n,s]}function Un(t,e=[]){let r=[];function n(a,i){const o=h.createContext(i),c=r.length;r=[...r,i];const u=d=>{const{scope:m,children:p,...y}=d,g=m?.[t]?.[c]||o,x=h.useMemo(()=>y,Object.values(y));return l.jsx(g.Provider,{value:x,children:p})};u.displayName=a+"Provider";function f(d,m){const p=m?.[t]?.[c]||o,y=h.useContext(p);if(y)return y;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${a}\``)}return[u,f]}const s=()=>{const a=r.map(i=>h.createContext(i));return function(o){const c=o?.[t]||a;return h.useMemo(()=>({[`__scope${t}`]:{...o,[t]:c}}),[o,c])}};return s.scopeName=t,[n,ff(s,...e)]}function ff(...t){const e=t[0];if(t.length===1)return e;const r=()=>{const n=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(a){const i=n.reduce((o,{useScope:c,scopeName:u})=>{const d=c(a)[`__scope${u}`];return{...o,...d}},{});return h.useMemo(()=>({[`__scope${e.scopeName}`]:i}),[i])}};return r.scopeName=e.scopeName,r}var hf=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],_e=hf.reduce((t,e)=>{const r=Zn(`Primitive.${e}`),n=h.forwardRef((s,a)=>{const{asChild:i,...o}=s,c=i?r:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...o,ref:a})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function mf(t,e){t&&Zo.flushSync(()=>t.dispatchEvent(e))}function hr(t){const e=h.useRef(t);return h.useEffect(()=>{e.current=t}),h.useMemo(()=>(...r)=>e.current?.(...r),[])}function pf(t,e=globalThis?.document){const r=hr(t);h.useEffect(()=>{const n=s=>{s.key==="Escape"&&r(s)};return e.addEventListener("keydown",n,{capture:!0}),()=>e.removeEventListener("keydown",n,{capture:!0})},[r,e])}var gf="DismissableLayer",Ws="dismissableLayer.update",yf="dismissableLayer.pointerDownOutside",vf="dismissableLayer.focusOutside",gi,il=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ga=h.forwardRef((t,e)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:i,onDismiss:o,...c}=t,u=h.useContext(il),[f,d]=h.useState(null),m=f?.ownerDocument??globalThis?.document,[,p]=h.useState({}),y=$e(e,T=>d(T)),g=Array.from(u.layers),[x]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=g.indexOf(x),S=f?g.indexOf(f):-1,C=u.layersWithOutsidePointerEventsDisabled.size>0,k=S>=v,w=wf(T=>{const A=T.target,$=[...u.branches].some(L=>L.contains(A));!k||$||(s?.(T),i?.(T),T.defaultPrevented||o?.())},m),j=kf(T=>{const A=T.target;[...u.branches].some(L=>L.contains(A))||(a?.(T),i?.(T),T.defaultPrevented||o?.())},m);return pf(T=>{S===u.layers.size-1&&(n?.(T),!T.defaultPrevented&&o&&(T.preventDefault(),o()))},m),h.useEffect(()=>{if(f)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(gi=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),yi(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=gi)}},[f,m,r,u]),h.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),yi())},[f,u]),h.useEffect(()=>{const T=()=>p({});return document.addEventListener(Ws,T),()=>document.removeEventListener(Ws,T)},[]),l.jsx(_e.div,{...c,ref:y,style:{pointerEvents:C?k?"auto":"none":void 0,...t.style},onFocusCapture:Re(t.onFocusCapture,j.onFocusCapture),onBlurCapture:Re(t.onBlurCapture,j.onBlurCapture),onPointerDownCapture:Re(t.onPointerDownCapture,w.onPointerDownCapture)})});ga.displayName=gf;var xf="DismissableLayerBranch",bf=h.forwardRef((t,e)=>{const r=h.useContext(il),n=h.useRef(null),s=$e(e,n);return h.useEffect(()=>{const a=n.current;if(a)return r.branches.add(a),()=>{r.branches.delete(a)}},[r.branches]),l.jsx(_e.div,{...t,ref:s})});bf.displayName=xf;function wf(t,e=globalThis?.document){const r=hr(t),n=h.useRef(!1),s=h.useRef(()=>{});return h.useEffect(()=>{const a=o=>{if(o.target&&!n.current){let c=function(){ol(yf,r,u,{discrete:!0})};const u={originalEvent:o};o.pointerType==="touch"?(e.removeEventListener("click",s.current),s.current=c,e.addEventListener("click",s.current,{once:!0})):c()}else e.removeEventListener("click",s.current);n.current=!1},i=window.setTimeout(()=>{e.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(i),e.removeEventListener("pointerdown",a),e.removeEventListener("click",s.current)}},[e,r]),{onPointerDownCapture:()=>n.current=!0}}function kf(t,e=globalThis?.document){const r=hr(t),n=h.useRef(!1);return h.useEffect(()=>{const s=a=>{a.target&&!n.current&&ol(vf,r,{originalEvent:a},{discrete:!1})};return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function yi(){const t=new CustomEvent(Ws);document.dispatchEvent(t)}function ol(t,e,r,{discrete:n}){const s=r.originalEvent.target,a=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:r});e&&s.addEventListener(t,e,{once:!0}),n?mf(s,a):s.dispatchEvent(a)}var vs=0;function ll(){h.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??vi()),document.body.insertAdjacentElement("beforeend",t[1]??vi()),vs++,()=>{vs===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),vs--}},[])}function vi(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var xs="focusScope.autoFocusOnMount",bs="focusScope.autoFocusOnUnmount",xi={bubbles:!1,cancelable:!0},Sf="FocusScope",ya=h.forwardRef((t,e)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...i}=t,[o,c]=h.useState(null),u=hr(s),f=hr(a),d=h.useRef(null),m=$e(e,g=>c(g)),p=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(n){let g=function(C){if(p.paused||!o)return;const k=C.target;o.contains(k)?d.current=k:kt(d.current,{select:!0})},x=function(C){if(p.paused||!o)return;const k=C.relatedTarget;k!==null&&(o.contains(k)||kt(d.current,{select:!0}))},v=function(C){if(document.activeElement===document.body)for(const w of C)w.removedNodes.length>0&&kt(o)};document.addEventListener("focusin",g),document.addEventListener("focusout",x);const S=new MutationObserver(v);return o&&S.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",x),S.disconnect()}}},[n,o,p.paused]),h.useEffect(()=>{if(o){wi.add(p);const g=document.activeElement;if(!o.contains(g)){const v=new CustomEvent(xs,xi);o.addEventListener(xs,u),o.dispatchEvent(v),v.defaultPrevented||(Nf(Ef(cl(o)),{select:!0}),document.activeElement===g&&kt(o))}return()=>{o.removeEventListener(xs,u),setTimeout(()=>{const v=new CustomEvent(bs,xi);o.addEventListener(bs,f),o.dispatchEvent(v),v.defaultPrevented||kt(g??document.body,{select:!0}),o.removeEventListener(bs,f),wi.remove(p)},0)}}},[o,u,f,p]);const y=h.useCallback(g=>{if(!r&&!n||p.paused)return;const x=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,v=document.activeElement;if(x&&v){const S=g.currentTarget,[C,k]=Cf(S);C&&k?!g.shiftKey&&v===k?(g.preventDefault(),r&&kt(C,{select:!0})):g.shiftKey&&v===C&&(g.preventDefault(),r&&kt(k,{select:!0})):v===S&&g.preventDefault()}},[r,n,p.paused]);return l.jsx(_e.div,{tabIndex:-1,...i,ref:m,onKeyDown:y})});ya.displayName=Sf;function Nf(t,{select:e=!1}={}){const r=document.activeElement;for(const n of t)if(kt(n,{select:e}),document.activeElement!==r)return}function Cf(t){const e=cl(t),r=bi(e,t),n=bi(e.reverse(),t);return[r,n]}function cl(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function bi(t,e){for(const r of t)if(!_f(r,{upTo:e}))return r}function _f(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function Tf(t){return t instanceof HTMLInputElement&&"select"in t}function kt(t,{select:e=!1}={}){if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),t!==r&&Tf(t)&&e&&t.select()}}var wi=jf();function jf(){let t=[];return{add(e){const r=t[0];e!==r&&r?.pause(),t=ki(t,e),t.unshift(e)},remove(e){t=ki(t,e),t[0]?.resume()}}}function ki(t,e){const r=[...t],n=r.indexOf(e);return n!==-1&&r.splice(n,1),r}function Ef(t){return t.filter(e=>e.tagName!=="A")}var jt=globalThis?.document?h.useLayoutEffect:()=>{},Of=h[" useId ".trim().toString()]||(()=>{}),Df=0;function xn(t){const[e,r]=h.useState(Of());return jt(()=>{r(n=>n??String(Df++))},[t]),t||(e?`radix-${e}`:"")}const Rf=["top","right","bottom","left"],Et=Math.min,Ie=Math.max,Tn=Math.round,an=Math.floor,lt=t=>({x:t,y:t}),Af={left:"right",right:"left",bottom:"top",top:"bottom"},Mf={start:"end",end:"start"};function Zs(t,e,r){return Ie(t,Et(e,r))}function pt(t,e){return typeof t=="function"?t(e):t}function gt(t){return t.split("-")[0]}function kr(t){return t.split("-")[1]}function va(t){return t==="x"?"y":"x"}function xa(t){return t==="y"?"height":"width"}const If=new Set(["top","bottom"]);function ot(t){return If.has(gt(t))?"y":"x"}function ba(t){return va(ot(t))}function Pf(t,e,r){r===void 0&&(r=!1);const n=kr(t),s=ba(t),a=xa(s);let i=s==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[a]>e.floating[a]&&(i=jn(i)),[i,jn(i)]}function Ff(t){const e=jn(t);return[Bs(t),e,Bs(e)]}function Bs(t){return t.replace(/start|end/g,e=>Mf[e])}const Si=["left","right"],Ni=["right","left"],Lf=["top","bottom"],Vf=["bottom","top"];function $f(t,e,r){switch(t){case"top":case"bottom":return r?e?Ni:Si:e?Si:Ni;case"left":case"right":return e?Lf:Vf;default:return[]}}function zf(t,e,r,n){const s=kr(t);let a=$f(gt(t),r==="start",n);return s&&(a=a.map(i=>i+"-"+s),e&&(a=a.concat(a.map(Bs)))),a}function jn(t){return t.replace(/left|right|bottom|top/g,e=>Af[e])}function Wf(t){return{top:0,right:0,bottom:0,left:0,...t}}function ul(t){return typeof t!="number"?Wf(t):{top:t,right:t,bottom:t,left:t}}function En(t){const{x:e,y:r,width:n,height:s}=t;return{width:n,height:s,top:r,left:e,right:e+n,bottom:r+s,x:e,y:r}}function Ci(t,e,r){let{reference:n,floating:s}=t;const a=ot(e),i=ba(e),o=xa(i),c=gt(e),u=a==="y",f=n.x+n.width/2-s.width/2,d=n.y+n.height/2-s.height/2,m=n[o]/2-s[o]/2;let p;switch(c){case"top":p={x:f,y:n.y-s.height};break;case"bottom":p={x:f,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:d};break;case"left":p={x:n.x-s.width,y:d};break;default:p={x:n.x,y:n.y}}switch(kr(e)){case"start":p[i]-=m*(r&&u?-1:1);break;case"end":p[i]+=m*(r&&u?-1:1);break}return p}const Zf=async(t,e,r)=>{const{placement:n="bottom",strategy:s="absolute",middleware:a=[],platform:i}=r,o=a.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(e));let u=await i.getElementRects({reference:t,floating:e,strategy:s}),{x:f,y:d}=Ci(u,n,c),m=n,p={},y=0;for(let g=0;g<o.length;g++){const{name:x,fn:v}=o[g],{x:S,y:C,data:k,reset:w}=await v({x:f,y:d,initialPlacement:n,placement:m,strategy:s,middlewareData:p,rects:u,platform:i,elements:{reference:t,floating:e}});f=S??f,d=C??d,p={...p,[x]:{...p[x],...k}},w&&y<=50&&(y++,typeof w=="object"&&(w.placement&&(m=w.placement),w.rects&&(u=w.rects===!0?await i.getElementRects({reference:t,floating:e,strategy:s}):w.rects),{x:f,y:d}=Ci(u,m,c)),g=-1)}return{x:f,y:d,placement:m,strategy:s,middlewareData:p}};async function Fr(t,e){var r;e===void 0&&(e={});const{x:n,y:s,platform:a,rects:i,elements:o,strategy:c}=t,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:d="floating",altBoundary:m=!1,padding:p=0}=pt(e,t),y=ul(p),x=o[m?d==="floating"?"reference":"floating":d],v=En(await a.getClippingRect({element:(r=await(a.isElement==null?void 0:a.isElement(x)))==null||r?x:x.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(o.floating)),boundary:u,rootBoundary:f,strategy:c})),S=d==="floating"?{x:n,y:s,width:i.floating.width,height:i.floating.height}:i.reference,C=await(a.getOffsetParent==null?void 0:a.getOffsetParent(o.floating)),k=await(a.isElement==null?void 0:a.isElement(C))?await(a.getScale==null?void 0:a.getScale(C))||{x:1,y:1}:{x:1,y:1},w=En(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:S,offsetParent:C,strategy:c}):S);return{top:(v.top-w.top+y.top)/k.y,bottom:(w.bottom-v.bottom+y.bottom)/k.y,left:(v.left-w.left+y.left)/k.x,right:(w.right-v.right+y.right)/k.x}}const Bf=t=>({name:"arrow",options:t,async fn(e){const{x:r,y:n,placement:s,rects:a,platform:i,elements:o,middlewareData:c}=e,{element:u,padding:f=0}=pt(t,e)||{};if(u==null)return{};const d=ul(f),m={x:r,y:n},p=ba(s),y=xa(p),g=await i.getDimensions(u),x=p==="y",v=x?"top":"left",S=x?"bottom":"right",C=x?"clientHeight":"clientWidth",k=a.reference[y]+a.reference[p]-m[p]-a.floating[y],w=m[p]-a.reference[p],j=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let T=j?j[C]:0;(!T||!await(i.isElement==null?void 0:i.isElement(j)))&&(T=o.floating[C]||a.floating[y]);const A=k/2-w/2,$=T/2-g[y]/2-1,L=Et(d[v],$),W=Et(d[S],$),B=L,G=T-g[y]-W,Q=T/2-g[y]/2+A,H=Zs(B,Q,G),P=!c.arrow&&kr(s)!=null&&Q!==H&&a.reference[y]/2-(Q<B?L:W)-g[y]/2<0,U=P?Q<B?Q-B:Q-G:0;return{[p]:m[p]+U,data:{[p]:H,centerOffset:Q-H-U,...P&&{alignmentOffset:U}},reset:P}}}),Uf=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var r,n;const{placement:s,middlewareData:a,rects:i,initialPlacement:o,platform:c,elements:u}=e,{mainAxis:f=!0,crossAxis:d=!0,fallbackPlacements:m,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:g=!0,...x}=pt(t,e);if((r=a.arrow)!=null&&r.alignmentOffset)return{};const v=gt(s),S=ot(o),C=gt(o)===o,k=await(c.isRTL==null?void 0:c.isRTL(u.floating)),w=m||(C||!g?[jn(o)]:Ff(o)),j=y!=="none";!m&&j&&w.push(...zf(o,g,y,k));const T=[o,...w],A=await Fr(e,x),$=[];let L=((n=a.flip)==null?void 0:n.overflows)||[];if(f&&$.push(A[v]),d){const Q=Pf(s,i,k);$.push(A[Q[0]],A[Q[1]])}if(L=[...L,{placement:s,overflows:$}],!$.every(Q=>Q<=0)){var W,B;const Q=(((W=a.flip)==null?void 0:W.index)||0)+1,H=T[Q];if(H&&(!(d==="alignment"?S!==ot(H):!1)||L.every(V=>ot(V.placement)===S?V.overflows[0]>0:!0)))return{data:{index:Q,overflows:L},reset:{placement:H}};let P=(B=L.filter(U=>U.overflows[0]<=0).sort((U,V)=>U.overflows[1]-V.overflows[1])[0])==null?void 0:B.placement;if(!P)switch(p){case"bestFit":{var G;const U=(G=L.filter(V=>{if(j){const ie=ot(V.placement);return ie===S||ie==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(ie=>ie>0).reduce((ie,F)=>ie+F,0)]).sort((V,ie)=>V[1]-ie[1])[0])==null?void 0:G[0];U&&(P=U);break}case"initialPlacement":P=o;break}if(s!==P)return{reset:{placement:P}}}return{}}}};function _i(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Ti(t){return Rf.some(e=>t[e]>=0)}const Hf=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:r}=e,{strategy:n="referenceHidden",...s}=pt(t,e);switch(n){case"referenceHidden":{const a=await Fr(e,{...s,elementContext:"reference"}),i=_i(a,r.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Ti(i)}}}case"escaped":{const a=await Fr(e,{...s,altBoundary:!0}),i=_i(a,r.floating);return{data:{escapedOffsets:i,escaped:Ti(i)}}}default:return{}}}}},dl=new Set(["left","top"]);async function qf(t,e){const{placement:r,platform:n,elements:s}=t,a=await(n.isRTL==null?void 0:n.isRTL(s.floating)),i=gt(r),o=kr(r),c=ot(r)==="y",u=dl.has(i)?-1:1,f=a&&c?-1:1,d=pt(e,t);let{mainAxis:m,crossAxis:p,alignmentAxis:y}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return o&&typeof y=="number"&&(p=o==="end"?y*-1:y),c?{x:p*f,y:m*u}:{x:m*u,y:p*f}}const Yf=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var r,n;const{x:s,y:a,placement:i,middlewareData:o}=e,c=await qf(e,t);return i===((r=o.offset)==null?void 0:r.placement)&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:s+c.x,y:a+c.y,data:{...c,placement:i}}}}},Gf=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:r,y:n,placement:s}=e,{mainAxis:a=!0,crossAxis:i=!1,limiter:o={fn:x=>{let{x:v,y:S}=x;return{x:v,y:S}}},...c}=pt(t,e),u={x:r,y:n},f=await Fr(e,c),d=ot(gt(s)),m=va(d);let p=u[m],y=u[d];if(a){const x=m==="y"?"top":"left",v=m==="y"?"bottom":"right",S=p+f[x],C=p-f[v];p=Zs(S,p,C)}if(i){const x=d==="y"?"top":"left",v=d==="y"?"bottom":"right",S=y+f[x],C=y-f[v];y=Zs(S,y,C)}const g=o.fn({...e,[m]:p,[d]:y});return{...g,data:{x:g.x-r,y:g.y-n,enabled:{[m]:a,[d]:i}}}}}},Xf=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:r,y:n,placement:s,rects:a,middlewareData:i}=e,{offset:o=0,mainAxis:c=!0,crossAxis:u=!0}=pt(t,e),f={x:r,y:n},d=ot(s),m=va(d);let p=f[m],y=f[d];const g=pt(o,e),x=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){const C=m==="y"?"height":"width",k=a.reference[m]-a.floating[C]+x.mainAxis,w=a.reference[m]+a.reference[C]-x.mainAxis;p<k?p=k:p>w&&(p=w)}if(u){var v,S;const C=m==="y"?"width":"height",k=dl.has(gt(s)),w=a.reference[d]-a.floating[C]+(k&&((v=i.offset)==null?void 0:v[d])||0)+(k?0:x.crossAxis),j=a.reference[d]+a.reference[C]+(k?0:((S=i.offset)==null?void 0:S[d])||0)-(k?x.crossAxis:0);y<w?y=w:y>j&&(y=j)}return{[m]:p,[d]:y}}}},Jf=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var r,n;const{placement:s,rects:a,platform:i,elements:o}=e,{apply:c=()=>{},...u}=pt(t,e),f=await Fr(e,u),d=gt(s),m=kr(s),p=ot(s)==="y",{width:y,height:g}=a.floating;let x,v;d==="top"||d==="bottom"?(x=d,v=m===(await(i.isRTL==null?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(v=d,x=m==="end"?"top":"bottom");const S=g-f.top-f.bottom,C=y-f.left-f.right,k=Et(g-f[x],S),w=Et(y-f[v],C),j=!e.middlewareData.shift;let T=k,A=w;if((r=e.middlewareData.shift)!=null&&r.enabled.x&&(A=C),(n=e.middlewareData.shift)!=null&&n.enabled.y&&(T=S),j&&!m){const L=Ie(f.left,0),W=Ie(f.right,0),B=Ie(f.top,0),G=Ie(f.bottom,0);p?A=y-2*(L!==0||W!==0?L+W:Ie(f.left,f.right)):T=g-2*(B!==0||G!==0?B+G:Ie(f.top,f.bottom))}await c({...e,availableWidth:A,availableHeight:T});const $=await i.getDimensions(o.floating);return y!==$.width||g!==$.height?{reset:{rects:!0}}:{}}}};function Hn(){return typeof window<"u"}function Sr(t){return fl(t)?(t.nodeName||"").toLowerCase():"#document"}function Pe(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function ft(t){var e;return(e=(fl(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function fl(t){return Hn()?t instanceof Node||t instanceof Pe(t).Node:!1}function Qe(t){return Hn()?t instanceof Element||t instanceof Pe(t).Element:!1}function ut(t){return Hn()?t instanceof HTMLElement||t instanceof Pe(t).HTMLElement:!1}function ji(t){return!Hn()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Pe(t).ShadowRoot}const Kf=new Set(["inline","contents"]);function Ur(t){const{overflow:e,overflowX:r,overflowY:n,display:s}=et(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&!Kf.has(s)}const Qf=new Set(["table","td","th"]);function eh(t){return Qf.has(Sr(t))}const th=[":popover-open",":modal"];function qn(t){return th.some(e=>{try{return t.matches(e)}catch{return!1}})}const rh=["transform","translate","scale","rotate","perspective"],nh=["transform","translate","scale","rotate","perspective","filter"],sh=["paint","layout","strict","content"];function wa(t){const e=ka(),r=Qe(t)?et(t):t;return rh.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!e&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!e&&(r.filter?r.filter!=="none":!1)||nh.some(n=>(r.willChange||"").includes(n))||sh.some(n=>(r.contain||"").includes(n))}function ah(t){let e=Ot(t);for(;ut(e)&&!mr(e);){if(wa(e))return e;if(qn(e))return null;e=Ot(e)}return null}function ka(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const ih=new Set(["html","body","#document"]);function mr(t){return ih.has(Sr(t))}function et(t){return Pe(t).getComputedStyle(t)}function Yn(t){return Qe(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Ot(t){if(Sr(t)==="html")return t;const e=t.assignedSlot||t.parentNode||ji(t)&&t.host||ft(t);return ji(e)?e.host:e}function hl(t){const e=Ot(t);return mr(e)?t.ownerDocument?t.ownerDocument.body:t.body:ut(e)&&Ur(e)?e:hl(e)}function Lr(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);const s=hl(t),a=s===((n=t.ownerDocument)==null?void 0:n.body),i=Pe(s);if(a){const o=Us(i);return e.concat(i,i.visualViewport||[],Ur(s)?s:[],o&&r?Lr(o):[])}return e.concat(s,Lr(s,[],r))}function Us(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function ml(t){const e=et(t);let r=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const s=ut(t),a=s?t.offsetWidth:r,i=s?t.offsetHeight:n,o=Tn(r)!==a||Tn(n)!==i;return o&&(r=a,n=i),{width:r,height:n,$:o}}function Sa(t){return Qe(t)?t:t.contextElement}function cr(t){const e=Sa(t);if(!ut(e))return lt(1);const r=e.getBoundingClientRect(),{width:n,height:s,$:a}=ml(e);let i=(a?Tn(r.width):r.width)/n,o=(a?Tn(r.height):r.height)/s;return(!i||!Number.isFinite(i))&&(i=1),(!o||!Number.isFinite(o))&&(o=1),{x:i,y:o}}const oh=lt(0);function pl(t){const e=Pe(t);return!ka()||!e.visualViewport?oh:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function lh(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==Pe(t)?!1:e}function Zt(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);const s=t.getBoundingClientRect(),a=Sa(t);let i=lt(1);e&&(n?Qe(n)&&(i=cr(n)):i=cr(t));const o=lh(a,r,n)?pl(a):lt(0);let c=(s.left+o.x)/i.x,u=(s.top+o.y)/i.y,f=s.width/i.x,d=s.height/i.y;if(a){const m=Pe(a),p=n&&Qe(n)?Pe(n):n;let y=m,g=Us(y);for(;g&&n&&p!==y;){const x=cr(g),v=g.getBoundingClientRect(),S=et(g),C=v.left+(g.clientLeft+parseFloat(S.paddingLeft))*x.x,k=v.top+(g.clientTop+parseFloat(S.paddingTop))*x.y;c*=x.x,u*=x.y,f*=x.x,d*=x.y,c+=C,u+=k,y=Pe(g),g=Us(y)}}return En({width:f,height:d,x:c,y:u})}function Gn(t,e){const r=Yn(t).scrollLeft;return e?e.left+r:Zt(ft(t)).left+r}function gl(t,e){const r=t.getBoundingClientRect(),n=r.left+e.scrollLeft-Gn(t,r),s=r.top+e.scrollTop;return{x:n,y:s}}function ch(t){let{elements:e,rect:r,offsetParent:n,strategy:s}=t;const a=s==="fixed",i=ft(n),o=e?qn(e.floating):!1;if(n===i||o&&a)return r;let c={scrollLeft:0,scrollTop:0},u=lt(1);const f=lt(0),d=ut(n);if((d||!d&&!a)&&((Sr(n)!=="body"||Ur(i))&&(c=Yn(n)),ut(n))){const p=Zt(n);u=cr(n),f.x=p.x+n.clientLeft,f.y=p.y+n.clientTop}const m=i&&!d&&!a?gl(i,c):lt(0);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-c.scrollLeft*u.x+f.x+m.x,y:r.y*u.y-c.scrollTop*u.y+f.y+m.y}}function uh(t){return Array.from(t.getClientRects())}function dh(t){const e=ft(t),r=Yn(t),n=t.ownerDocument.body,s=Ie(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),a=Ie(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+Gn(t);const o=-r.scrollTop;return et(n).direction==="rtl"&&(i+=Ie(e.clientWidth,n.clientWidth)-s),{width:s,height:a,x:i,y:o}}const Ei=25;function fh(t,e){const r=Pe(t),n=ft(t),s=r.visualViewport;let a=n.clientWidth,i=n.clientHeight,o=0,c=0;if(s){a=s.width,i=s.height;const f=ka();(!f||f&&e==="fixed")&&(o=s.offsetLeft,c=s.offsetTop)}const u=Gn(n);if(u<=0){const f=n.ownerDocument,d=f.body,m=getComputedStyle(d),p=f.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,y=Math.abs(n.clientWidth-d.clientWidth-p);y<=Ei&&(a-=y)}else u<=Ei&&(a+=u);return{width:a,height:i,x:o,y:c}}const hh=new Set(["absolute","fixed"]);function mh(t,e){const r=Zt(t,!0,e==="fixed"),n=r.top+t.clientTop,s=r.left+t.clientLeft,a=ut(t)?cr(t):lt(1),i=t.clientWidth*a.x,o=t.clientHeight*a.y,c=s*a.x,u=n*a.y;return{width:i,height:o,x:c,y:u}}function Oi(t,e,r){let n;if(e==="viewport")n=fh(t,r);else if(e==="document")n=dh(ft(t));else if(Qe(e))n=mh(e,r);else{const s=pl(t);n={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return En(n)}function yl(t,e){const r=Ot(t);return r===e||!Qe(r)||mr(r)?!1:et(r).position==="fixed"||yl(r,e)}function ph(t,e){const r=e.get(t);if(r)return r;let n=Lr(t,[],!1).filter(o=>Qe(o)&&Sr(o)!=="body"),s=null;const a=et(t).position==="fixed";let i=a?Ot(t):t;for(;Qe(i)&&!mr(i);){const o=et(i),c=wa(i);!c&&o.position==="fixed"&&(s=null),(a?!c&&!s:!c&&o.position==="static"&&!!s&&hh.has(s.position)||Ur(i)&&!c&&yl(t,i))?n=n.filter(f=>f!==i):s=o,i=Ot(i)}return e.set(t,n),n}function gh(t){let{element:e,boundary:r,rootBoundary:n,strategy:s}=t;const i=[...r==="clippingAncestors"?qn(e)?[]:ph(e,this._c):[].concat(r),n],o=i[0],c=i.reduce((u,f)=>{const d=Oi(e,f,s);return u.top=Ie(d.top,u.top),u.right=Et(d.right,u.right),u.bottom=Et(d.bottom,u.bottom),u.left=Ie(d.left,u.left),u},Oi(e,o,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function yh(t){const{width:e,height:r}=ml(t);return{width:e,height:r}}function vh(t,e,r){const n=ut(e),s=ft(e),a=r==="fixed",i=Zt(t,!0,a,e);let o={scrollLeft:0,scrollTop:0};const c=lt(0);function u(){c.x=Gn(s)}if(n||!n&&!a)if((Sr(e)!=="body"||Ur(s))&&(o=Yn(e)),n){const p=Zt(e,!0,a,e);c.x=p.x+e.clientLeft,c.y=p.y+e.clientTop}else s&&u();a&&!n&&s&&u();const f=s&&!n&&!a?gl(s,o):lt(0),d=i.left+o.scrollLeft-c.x-f.x,m=i.top+o.scrollTop-c.y-f.y;return{x:d,y:m,width:i.width,height:i.height}}function ws(t){return et(t).position==="static"}function Di(t,e){if(!ut(t)||et(t).position==="fixed")return null;if(e)return e(t);let r=t.offsetParent;return ft(t)===r&&(r=r.ownerDocument.body),r}function vl(t,e){const r=Pe(t);if(qn(t))return r;if(!ut(t)){let s=Ot(t);for(;s&&!mr(s);){if(Qe(s)&&!ws(s))return s;s=Ot(s)}return r}let n=Di(t,e);for(;n&&eh(n)&&ws(n);)n=Di(n,e);return n&&mr(n)&&ws(n)&&!wa(n)?r:n||ah(t)||r}const xh=async function(t){const e=this.getOffsetParent||vl,r=this.getDimensions,n=await r(t.floating);return{reference:vh(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function bh(t){return et(t).direction==="rtl"}const wh={convertOffsetParentRelativeRectToViewportRelativeRect:ch,getDocumentElement:ft,getClippingRect:gh,getOffsetParent:vl,getElementRects:xh,getClientRects:uh,getDimensions:yh,getScale:cr,isElement:Qe,isRTL:bh};function xl(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function kh(t,e){let r=null,n;const s=ft(t);function a(){var o;clearTimeout(n),(o=r)==null||o.disconnect(),r=null}function i(o,c){o===void 0&&(o=!1),c===void 0&&(c=1),a();const u=t.getBoundingClientRect(),{left:f,top:d,width:m,height:p}=u;if(o||e(),!m||!p)return;const y=an(d),g=an(s.clientWidth-(f+m)),x=an(s.clientHeight-(d+p)),v=an(f),C={rootMargin:-y+"px "+-g+"px "+-x+"px "+-v+"px",threshold:Ie(0,Et(1,c))||1};let k=!0;function w(j){const T=j[0].intersectionRatio;if(T!==c){if(!k)return i();T?i(!1,T):n=setTimeout(()=>{i(!1,1e-7)},1e3)}T===1&&!xl(u,t.getBoundingClientRect())&&i(),k=!1}try{r=new IntersectionObserver(w,{...C,root:s.ownerDocument})}catch{r=new IntersectionObserver(w,C)}r.observe(t)}return i(!0),a}function Sh(t,e,r,n){n===void 0&&(n={});const{ancestorScroll:s=!0,ancestorResize:a=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,u=Sa(t),f=s||a?[...u?Lr(u):[],...Lr(e)]:[];f.forEach(v=>{s&&v.addEventListener("scroll",r,{passive:!0}),a&&v.addEventListener("resize",r)});const d=u&&o?kh(u,r):null;let m=-1,p=null;i&&(p=new ResizeObserver(v=>{let[S]=v;S&&S.target===u&&p&&(p.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var C;(C=p)==null||C.observe(e)})),r()}),u&&!c&&p.observe(u),p.observe(e));let y,g=c?Zt(t):null;c&&x();function x(){const v=Zt(t);g&&!xl(g,v)&&r(),g=v,y=requestAnimationFrame(x)}return r(),()=>{var v;f.forEach(S=>{s&&S.removeEventListener("scroll",r),a&&S.removeEventListener("resize",r)}),d?.(),(v=p)==null||v.disconnect(),p=null,c&&cancelAnimationFrame(y)}}const Nh=Yf,Ch=Gf,_h=Uf,Th=Jf,jh=Hf,Ri=Bf,Eh=Xf,Oh=(t,e,r)=>{const n=new Map,s={platform:wh,...r},a={...s.platform,_c:n};return Zf(t,e,{...s,platform:a})};var Dh=typeof document<"u",Rh=function(){},bn=Dh?b.useLayoutEffect:Rh;function On(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let r,n,s;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(r=t.length,r!==e.length)return!1;for(n=r;n--!==0;)if(!On(t[n],e[n]))return!1;return!0}if(s=Object.keys(t),r=s.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(e,s[n]))return!1;for(n=r;n--!==0;){const a=s[n];if(!(a==="_owner"&&t.$$typeof)&&!On(t[a],e[a]))return!1}return!0}return t!==t&&e!==e}function bl(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Ai(t,e){const r=bl(t);return Math.round(e*r)/r}function ks(t){const e=h.useRef(t);return bn(()=>{e.current=t}),e}function Ah(t){t===void 0&&(t={});const{placement:e="bottom",strategy:r="absolute",middleware:n=[],platform:s,elements:{reference:a,floating:i}={},transform:o=!0,whileElementsMounted:c,open:u}=t,[f,d]=h.useState({x:0,y:0,strategy:r,placement:e,middlewareData:{},isPositioned:!1}),[m,p]=h.useState(n);On(m,n)||p(n);const[y,g]=h.useState(null),[x,v]=h.useState(null),S=h.useCallback(V=>{V!==j.current&&(j.current=V,g(V))},[]),C=h.useCallback(V=>{V!==T.current&&(T.current=V,v(V))},[]),k=a||y,w=i||x,j=h.useRef(null),T=h.useRef(null),A=h.useRef(f),$=c!=null,L=ks(c),W=ks(s),B=ks(u),G=h.useCallback(()=>{if(!j.current||!T.current)return;const V={placement:e,strategy:r,middleware:m};W.current&&(V.platform=W.current),Oh(j.current,T.current,V).then(ie=>{const F={...ie,isPositioned:B.current!==!1};Q.current&&!On(A.current,F)&&(A.current=F,Zo.flushSync(()=>{d(F)}))})},[m,e,r,W,B]);bn(()=>{u===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,d(V=>({...V,isPositioned:!1})))},[u]);const Q=h.useRef(!1);bn(()=>(Q.current=!0,()=>{Q.current=!1}),[]),bn(()=>{if(k&&(j.current=k),w&&(T.current=w),k&&w){if(L.current)return L.current(k,w,G);G()}},[k,w,G,L,$]);const H=h.useMemo(()=>({reference:j,floating:T,setReference:S,setFloating:C}),[S,C]),P=h.useMemo(()=>({reference:k,floating:w}),[k,w]),U=h.useMemo(()=>{const V={position:r,left:0,top:0};if(!P.floating)return V;const ie=Ai(P.floating,f.x),F=Ai(P.floating,f.y);return o?{...V,transform:"translate("+ie+"px, "+F+"px)",...bl(P.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:ie,top:F}},[r,o,P.floating,f.x,f.y]);return h.useMemo(()=>({...f,update:G,refs:H,elements:P,floatingStyles:U}),[f,G,H,P,U])}const Mh=t=>{function e(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:t,fn(r){const{element:n,padding:s}=typeof t=="function"?t(r):t;return n&&e(n)?n.current!=null?Ri({element:n.current,padding:s}).fn(r):{}:n?Ri({element:n,padding:s}).fn(r):{}}}},Ih=(t,e)=>({...Nh(t),options:[t,e]}),Ph=(t,e)=>({...Ch(t),options:[t,e]}),Fh=(t,e)=>({...Eh(t),options:[t,e]}),Lh=(t,e)=>({..._h(t),options:[t,e]}),Vh=(t,e)=>({...Th(t),options:[t,e]}),$h=(t,e)=>({...jh(t),options:[t,e]}),zh=(t,e)=>({...Mh(t),options:[t,e]});var Wh="Arrow",wl=h.forwardRef((t,e)=>{const{children:r,width:n=10,height:s=5,...a}=t;return l.jsx(_e.svg,{...a,ref:e,width:n,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?r:l.jsx("polygon",{points:"0,0 30,0 15,10"})})});wl.displayName=Wh;var Zh=wl;function kl(t){const[e,r]=h.useState(void 0);return jt(()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});const n=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const a=s[0];let i,o;if("borderBoxSize"in a){const c=a.borderBoxSize,u=Array.isArray(c)?c[0]:c;i=u.inlineSize,o=u.blockSize}else i=t.offsetWidth,o=t.offsetHeight;r({width:i,height:o})});return n.observe(t,{box:"border-box"}),()=>n.unobserve(t)}else r(void 0)},[t]),e}var Na="Popper",[Sl,Nl]=Un(Na),[Bh,Cl]=Sl(Na),_l=t=>{const{__scopePopper:e,children:r}=t,[n,s]=h.useState(null);return l.jsx(Bh,{scope:e,anchor:n,onAnchorChange:s,children:r})};_l.displayName=Na;var Tl="PopperAnchor",jl=h.forwardRef((t,e)=>{const{__scopePopper:r,virtualRef:n,...s}=t,a=Cl(Tl,r),i=h.useRef(null),o=$e(e,i),c=h.useRef(null);return h.useEffect(()=>{const u=c.current;c.current=n?.current||i.current,u!==c.current&&a.onAnchorChange(c.current)}),n?null:l.jsx(_e.div,{...s,ref:o})});jl.displayName=Tl;var Ca="PopperContent",[Uh,Hh]=Sl(Ca),El=h.forwardRef((t,e)=>{const{__scopePopper:r,side:n="bottom",sideOffset:s=0,align:a="center",alignOffset:i=0,arrowPadding:o=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:d="partial",hideWhenDetached:m=!1,updatePositionStrategy:p="optimized",onPlaced:y,...g}=t,x=Cl(Ca,r),[v,S]=h.useState(null),C=$e(e,Te=>S(Te)),[k,w]=h.useState(null),j=kl(k),T=j?.width??0,A=j?.height??0,$=n+(a!=="center"?"-"+a:""),L=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},W=Array.isArray(u)?u:[u],B=W.length>0,G={padding:L,boundary:W.filter(Yh),altBoundary:B},{refs:Q,floatingStyles:H,placement:P,isPositioned:U,middlewareData:V}=Ah({strategy:"fixed",placement:$,whileElementsMounted:(...Te)=>Sh(...Te,{animationFrame:p==="always"}),elements:{reference:x.anchor},middleware:[Ih({mainAxis:s+A,alignmentAxis:i}),c&&Ph({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?Fh():void 0,...G}),c&&Lh({...G}),Vh({...G,apply:({elements:Te,rects:le,availableWidth:vt,availableHeight:Yt})=>{const{width:Gt,height:xt}=le.reference,Xt=Te.floating.style;Xt.setProperty("--radix-popper-available-width",`${vt}px`),Xt.setProperty("--radix-popper-available-height",`${Yt}px`),Xt.setProperty("--radix-popper-anchor-width",`${Gt}px`),Xt.setProperty("--radix-popper-anchor-height",`${xt}px`)}}),k&&zh({element:k,padding:o}),Gh({arrowWidth:T,arrowHeight:A}),m&&$h({strategy:"referenceHidden",...G})]}),[ie,F]=Rl(P),D=hr(y);jt(()=>{U&&D?.()},[U,D]);const ee=V.arrow?.x,z=V.arrow?.y,oe=V.arrow?.centerOffset!==0,[ce,ve]=h.useState();return jt(()=>{v&&ve(window.getComputedStyle(v).zIndex)},[v]),l.jsx("div",{ref:Q.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:U?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ce,"--radix-popper-transform-origin":[V.transformOrigin?.x,V.transformOrigin?.y].join(" "),...V.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:l.jsx(Uh,{scope:r,placedSide:ie,onArrowChange:w,arrowX:ee,arrowY:z,shouldHideArrow:oe,children:l.jsx(_e.div,{"data-side":ie,"data-align":F,...g,ref:C,style:{...g.style,animation:U?void 0:"none"}})})})});El.displayName=Ca;var Ol="PopperArrow",qh={top:"bottom",right:"left",bottom:"top",left:"right"},Dl=h.forwardRef(function(e,r){const{__scopePopper:n,...s}=e,a=Hh(Ol,n),i=qh[a.placedSide];return l.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:l.jsx(Zh,{...s,ref:r,style:{...s.style,display:"block"}})})});Dl.displayName=Ol;function Yh(t){return t!==null}var Gh=t=>({name:"transformOrigin",options:t,fn(e){const{placement:r,rects:n,middlewareData:s}=e,i=s.arrow?.centerOffset!==0,o=i?0:t.arrowWidth,c=i?0:t.arrowHeight,[u,f]=Rl(r),d={start:"0%",center:"50%",end:"100%"}[f],m=(s.arrow?.x??0)+o/2,p=(s.arrow?.y??0)+c/2;let y="",g="";return u==="bottom"?(y=i?d:`${m}px`,g=`${-c}px`):u==="top"?(y=i?d:`${m}px`,g=`${n.floating.height+c}px`):u==="right"?(y=`${-c}px`,g=i?d:`${p}px`):u==="left"&&(y=`${n.floating.width+c}px`,g=i?d:`${p}px`),{data:{x:y,y:g}}}});function Rl(t){const[e,r="center"]=t.split("-");return[e,r]}var Xh=_l,Al=jl,Jh=El,Kh=Dl,Qh="Portal",_a=h.forwardRef((t,e)=>{const{container:r,...n}=t,[s,a]=h.useState(!1);jt(()=>a(!0),[]);const i=r||s&&globalThis?.document?.body;return i?ma.createPortal(l.jsx(_e.div,{...n,ref:e}),i):null});_a.displayName=Qh;function em(t,e){return h.useReducer((r,n)=>e[r][n]??r,t)}var Nr=t=>{const{present:e,children:r}=t,n=tm(e),s=typeof r=="function"?r({present:n.isPresent}):h.Children.only(r),a=$e(n.ref,rm(s));return typeof r=="function"||n.isPresent?h.cloneElement(s,{ref:a}):null};Nr.displayName="Presence";function tm(t){const[e,r]=h.useState(),n=h.useRef(null),s=h.useRef(t),a=h.useRef("none"),i=t?"mounted":"unmounted",[o,c]=em(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const u=on(n.current);a.current=o==="mounted"?u:"none"},[o]),jt(()=>{const u=n.current,f=s.current;if(f!==t){const m=a.current,p=on(u);t?c("MOUNT"):p==="none"||u?.display==="none"?c("UNMOUNT"):c(f&&m!==p?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,c]),jt(()=>{if(e){let u;const f=e.ownerDocument.defaultView??window,d=p=>{const g=on(n.current).includes(CSS.escape(p.animationName));if(p.target===e&&g&&(c("ANIMATION_END"),!s.current)){const x=e.style.animationFillMode;e.style.animationFillMode="forwards",u=f.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=x)})}},m=p=>{p.target===e&&(a.current=on(n.current))};return e.addEventListener("animationstart",m),e.addEventListener("animationcancel",d),e.addEventListener("animationend",d),()=>{f.clearTimeout(u),e.removeEventListener("animationstart",m),e.removeEventListener("animationcancel",d),e.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:h.useCallback(u=>{n.current=u?getComputedStyle(u):null,r(u)},[])}}function on(t){return t?.animationName||"none"}function rm(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var nm=h[" useInsertionEffect ".trim().toString()]||jt;function Ta({prop:t,defaultProp:e,onChange:r=()=>{},caller:n}){const[s,a,i]=sm({defaultProp:e,onChange:r}),o=t!==void 0,c=o?t:s;{const f=h.useRef(t!==void 0);h.useEffect(()=>{const d=f.current;d!==o&&console.warn(`${n} is changing from ${d?"controlled":"uncontrolled"} to ${o?"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.`),f.current=o},[o,n])}const u=h.useCallback(f=>{if(o){const d=am(f)?f(t):f;d!==t&&i.current?.(d)}else a(f)},[o,t,a,i]);return[c,u]}function sm({defaultProp:t,onChange:e}){const[r,n]=h.useState(t),s=h.useRef(r),a=h.useRef(e);return nm(()=>{a.current=e},[e]),h.useEffect(()=>{s.current!==r&&(a.current?.(r),s.current=r)},[r,s]),[r,n,a]}function am(t){return typeof t=="function"}var im=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},er=new WeakMap,ln=new WeakMap,cn={},Ss=0,Ml=function(t){return t&&(t.host||Ml(t.parentNode))},om=function(t,e){return e.map(function(r){if(t.contains(r))return r;var n=Ml(r);return n&&t.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",t,". Doing nothing"),null)}).filter(function(r){return!!r})},lm=function(t,e,r,n){var s=om(e,Array.isArray(t)?t:[t]);cn[r]||(cn[r]=new WeakMap);var a=cn[r],i=[],o=new Set,c=new Set(s),u=function(d){!d||o.has(d)||(o.add(d),u(d.parentNode))};s.forEach(u);var f=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(m){if(o.has(m))f(m);else try{var p=m.getAttribute(n),y=p!==null&&p!=="false",g=(er.get(m)||0)+1,x=(a.get(m)||0)+1;er.set(m,g),a.set(m,x),i.push(m),g===1&&y&&ln.set(m,!0),x===1&&m.setAttribute(r,"true"),y||m.setAttribute(n,"true")}catch(v){console.error("aria-hidden: cannot operate on ",m,v)}})};return f(e),o.clear(),Ss++,function(){i.forEach(function(d){var m=er.get(d)-1,p=a.get(d)-1;er.set(d,m),a.set(d,p),m||(ln.has(d)||d.removeAttribute(n),ln.delete(d)),p||d.removeAttribute(r)}),Ss--,Ss||(er=new WeakMap,er=new WeakMap,ln=new WeakMap,cn={})}},Il=function(t,e,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(t)?t:[t]),s=im(t);return s?(n.push.apply(n,Array.from(s.querySelectorAll("[aria-live], script"))),lm(n,s,r,"aria-hidden")):function(){return null}},it=function(){return it=Object.assign||function(e){for(var r,n=1,s=arguments.length;n<s;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},it.apply(this,arguments)};function Pl(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(r[n[s]]=t[n[s]]);return r}function cm(t,e,r){if(r||arguments.length===2)for(var n=0,s=e.length,a;n<s;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return t.concat(a||Array.prototype.slice.call(e))}var wn="right-scroll-bar-position",kn="width-before-scroll-bar",um="with-scroll-bars-hidden",dm="--removed-body-scroll-bar-size";function Ns(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function fm(t,e){var r=b.useState(function(){return{value:t,callback:e,facade:{get current(){return r.value},set current(n){var s=r.value;s!==n&&(r.value=n,r.callback(n,s))}}}})[0];return r.callback=e,r.facade}var hm=typeof window<"u"?h.useLayoutEffect:h.useEffect,Mi=new WeakMap;function mm(t,e){var r=fm(null,function(n){return t.forEach(function(s){return Ns(s,n)})});return hm(function(){var n=Mi.get(r);if(n){var s=new Set(n),a=new Set(t),i=r.current;s.forEach(function(o){a.has(o)||Ns(o,null)}),a.forEach(function(o){s.has(o)||Ns(o,i)})}Mi.set(r,t)},[t]),r}function pm(t){return t}function gm(t,e){e===void 0&&(e=pm);var r=[],n=!1,s={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:t},useMedium:function(a){var i=e(a,n);return r.push(i),function(){r=r.filter(function(o){return o!==i})}},assignSyncMedium:function(a){for(n=!0;r.length;){var i=r;r=[],i.forEach(a)}r={push:function(o){return a(o)},filter:function(){return r}}},assignMedium:function(a){n=!0;var i=[];if(r.length){var o=r;r=[],o.forEach(a),i=r}var c=function(){var f=i;i=[],f.forEach(a)},u=function(){return Promise.resolve().then(c)};u(),r={push:function(f){i.push(f),u()},filter:function(f){return i=i.filter(f),r}}}};return s}function ym(t){t===void 0&&(t={});var e=gm(null);return e.options=it({async:!0,ssr:!1},t),e}var Fl=function(t){var e=t.sideCar,r=Pl(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=e.read();if(!n)throw new Error("Sidecar medium not found");return h.createElement(n,it({},r))};Fl.isSideCarExport=!0;function vm(t,e){return t.useMedium(e),Fl}var Ll=ym(),Cs=function(){},Xn=h.forwardRef(function(t,e){var r=h.useRef(null),n=h.useState({onScrollCapture:Cs,onWheelCapture:Cs,onTouchMoveCapture:Cs}),s=n[0],a=n[1],i=t.forwardProps,o=t.children,c=t.className,u=t.removeScrollBar,f=t.enabled,d=t.shards,m=t.sideCar,p=t.noRelative,y=t.noIsolation,g=t.inert,x=t.allowPinchZoom,v=t.as,S=v===void 0?"div":v,C=t.gapMode,k=Pl(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),w=m,j=mm([r,e]),T=it(it({},k),s);return h.createElement(h.Fragment,null,f&&h.createElement(w,{sideCar:Ll,removeScrollBar:u,shards:d,noRelative:p,noIsolation:y,inert:g,setCallbacks:a,allowPinchZoom:!!x,lockRef:r,gapMode:C}),i?h.cloneElement(h.Children.only(o),it(it({},T),{ref:j})):h.createElement(S,it({},T,{className:c,ref:j}),o))});Xn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Xn.classNames={fullWidth:kn,zeroRight:wn};var xm=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function bm(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=xm();return e&&t.setAttribute("nonce",e),t}function wm(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function km(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var Sm=function(){var t=0,e=null;return{add:function(r){t==0&&(e=bm())&&(wm(e,r),km(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},Nm=function(){var t=Sm();return function(e,r){h.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&r])}},Vl=function(){var t=Nm(),e=function(r){var n=r.styles,s=r.dynamic;return t(n,s),null};return e},Cm={left:0,top:0,right:0,gap:0},_s=function(t){return parseInt(t||"",10)||0},_m=function(t){var e=window.getComputedStyle(document.body),r=e[t==="padding"?"paddingLeft":"marginLeft"],n=e[t==="padding"?"paddingTop":"marginTop"],s=e[t==="padding"?"paddingRight":"marginRight"];return[_s(r),_s(n),_s(s)]},Tm=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return Cm;var e=_m(t),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,n-r+e[2]-e[0])}},jm=Vl(),ur="data-scroll-locked",Em=function(t,e,r,n){var s=t.left,a=t.top,i=t.right,o=t.gap;return r===void 0&&(r="margin"),`
2
2
  .`.concat(um,` {
3
3
  overflow: hidden `).concat(n,`;
4
4
  padding-right: `).concat(o,"px ").concat(n,`;
@@ -35,12 +35,12 @@
35
35
  body[`).concat(ur,`] {
36
36
  `).concat(dm,": ").concat(o,`px;
37
37
  }
38
- `)},Ii=function(){var t=parseInt(document.body.getAttribute(ur)||"0",10);return isFinite(t)?t:0},Om=function(){h.useEffect(function(){return document.body.setAttribute(ur,(Ii()+1).toString()),function(){var t=Ii()-1;t<=0?document.body.removeAttribute(ur):document.body.setAttribute(ur,t.toString())}},[])},Dm=function(t){var e=t.noRelative,r=t.noImportant,n=t.gapMode,s=n===void 0?"margin":n;Om();var a=h.useMemo(function(){return Tm(s)},[s]);return h.createElement(jm,{styles:Em(a,!e,s,r?"":"!important")})},Hs=!1;if(typeof window<"u")try{var un=Object.defineProperty({},"passive",{get:function(){return Hs=!0,!0}});window.addEventListener("test",un,un),window.removeEventListener("test",un,un)}catch{Hs=!1}var tr=Hs?{passive:!1}:!1,Rm=function(t){return t.tagName==="TEXTAREA"},$l=function(t,e){if(!(t instanceof Element))return!1;var r=window.getComputedStyle(t);return r[e]!=="hidden"&&!(r.overflowY===r.overflowX&&!Rm(t)&&r[e]==="visible")},Am=function(t){return $l(t,"overflowY")},Mm=function(t){return $l(t,"overflowX")},Pi=function(t,e){var r=e.ownerDocument,n=e;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var s=Wl(t,n);if(s){var a=zl(t,n),i=a[1],o=a[2];if(i>o)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},Im=function(t){var e=t.scrollTop,r=t.scrollHeight,n=t.clientHeight;return[e,r,n]},Pm=function(t){var e=t.scrollLeft,r=t.scrollWidth,n=t.clientWidth;return[e,r,n]},Wl=function(t,e){return t==="v"?Am(e):Mm(e)},zl=function(t,e){return t==="v"?Im(e):Pm(e)},Fm=function(t,e){return t==="h"&&e==="rtl"?-1:1},Lm=function(t,e,r,n,s){var a=Fm(t,window.getComputedStyle(e).direction),i=a*n,o=r.target,c=e.contains(o),u=!1,f=i>0,d=0,m=0;do{if(!o)break;var p=zl(t,o),y=p[0],g=p[1],x=p[2],v=g-x-a*y;(y||v)&&Wl(t,o)&&(d+=v,m+=y);var S=o.parentNode;o=S&&S.nodeType===Node.DOCUMENT_FRAGMENT_NODE?S.host:S}while(!c&&o!==document.body||c&&(e.contains(o)||e===o));return(f&&Math.abs(d)<1||!f&&Math.abs(m)<1)&&(u=!0),u},dn=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},Fi=function(t){return[t.deltaX,t.deltaY]},Li=function(t){return t&&"current"in t?t.current:t},Vm=function(t,e){return t[0]===e[0]&&t[1]===e[1]},$m=function(t){return`
38
+ `)},Ii=function(){var t=parseInt(document.body.getAttribute(ur)||"0",10);return isFinite(t)?t:0},Om=function(){h.useEffect(function(){return document.body.setAttribute(ur,(Ii()+1).toString()),function(){var t=Ii()-1;t<=0?document.body.removeAttribute(ur):document.body.setAttribute(ur,t.toString())}},[])},Dm=function(t){var e=t.noRelative,r=t.noImportant,n=t.gapMode,s=n===void 0?"margin":n;Om();var a=h.useMemo(function(){return Tm(s)},[s]);return h.createElement(jm,{styles:Em(a,!e,s,r?"":"!important")})},Hs=!1;if(typeof window<"u")try{var un=Object.defineProperty({},"passive",{get:function(){return Hs=!0,!0}});window.addEventListener("test",un,un),window.removeEventListener("test",un,un)}catch{Hs=!1}var tr=Hs?{passive:!1}:!1,Rm=function(t){return t.tagName==="TEXTAREA"},$l=function(t,e){if(!(t instanceof Element))return!1;var r=window.getComputedStyle(t);return r[e]!=="hidden"&&!(r.overflowY===r.overflowX&&!Rm(t)&&r[e]==="visible")},Am=function(t){return $l(t,"overflowY")},Mm=function(t){return $l(t,"overflowX")},Pi=function(t,e){var r=e.ownerDocument,n=e;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var s=zl(t,n);if(s){var a=Wl(t,n),i=a[1],o=a[2];if(i>o)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},Im=function(t){var e=t.scrollTop,r=t.scrollHeight,n=t.clientHeight;return[e,r,n]},Pm=function(t){var e=t.scrollLeft,r=t.scrollWidth,n=t.clientWidth;return[e,r,n]},zl=function(t,e){return t==="v"?Am(e):Mm(e)},Wl=function(t,e){return t==="v"?Im(e):Pm(e)},Fm=function(t,e){return t==="h"&&e==="rtl"?-1:1},Lm=function(t,e,r,n,s){var a=Fm(t,window.getComputedStyle(e).direction),i=a*n,o=r.target,c=e.contains(o),u=!1,f=i>0,d=0,m=0;do{if(!o)break;var p=Wl(t,o),y=p[0],g=p[1],x=p[2],v=g-x-a*y;(y||v)&&zl(t,o)&&(d+=v,m+=y);var S=o.parentNode;o=S&&S.nodeType===Node.DOCUMENT_FRAGMENT_NODE?S.host:S}while(!c&&o!==document.body||c&&(e.contains(o)||e===o));return(f&&Math.abs(d)<1||!f&&Math.abs(m)<1)&&(u=!0),u},dn=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},Fi=function(t){return[t.deltaX,t.deltaY]},Li=function(t){return t&&"current"in t?t.current:t},Vm=function(t,e){return t[0]===e[0]&&t[1]===e[1]},$m=function(t){return`
39
39
  .block-interactivity-`.concat(t,` {pointer-events: none;}
40
40
  .allow-interactivity-`).concat(t,` {pointer-events: all;}
41
- `)},Wm=0,rr=[];function zm(t){var e=h.useRef([]),r=h.useRef([0,0]),n=h.useRef(),s=h.useState(Wm++)[0],a=h.useState(Vl)[0],i=h.useRef(t);h.useEffect(function(){i.current=t},[t]),h.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(s));var g=cm([t.lockRef.current],(t.shards||[]).map(Li),!0).filter(Boolean);return g.forEach(function(x){return x.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),g.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(s))})}}},[t.inert,t.lockRef.current,t.shards]);var o=h.useCallback(function(g,x){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!i.current.allowPinchZoom;var v=dn(g),S=r.current,C="deltaX"in g?g.deltaX:S[0]-v[0],k="deltaY"in g?g.deltaY:S[1]-v[1],w,j=g.target,T=Math.abs(C)>Math.abs(k)?"h":"v";if("touches"in g&&T==="h"&&j.type==="range")return!1;var A=window.getSelection(),$=A&&A.anchorNode,L=$?$===j||$.contains(j):!1;if(L)return!1;var z=Pi(T,j);if(!z)return!0;if(z?w=T:(w=T==="v"?"h":"v",z=Pi(T,j)),!z)return!1;if(!n.current&&"changedTouches"in g&&(C||k)&&(n.current=w),!w)return!0;var B=n.current||w;return Lm(B,x,g,B==="h"?C:k)},[]),c=h.useCallback(function(g){var x=g;if(!(!rr.length||rr[rr.length-1]!==a)){var v="deltaY"in x?Fi(x):dn(x),S=e.current.filter(function(w){return w.name===x.type&&(w.target===x.target||x.target===w.shadowParent)&&Vm(w.delta,v)})[0];if(S&&S.should){x.cancelable&&x.preventDefault();return}if(!S){var C=(i.current.shards||[]).map(Li).filter(Boolean).filter(function(w){return w.contains(x.target)}),k=C.length>0?o(x,C[0]):!i.current.noIsolation;k&&x.cancelable&&x.preventDefault()}}},[]),u=h.useCallback(function(g,x,v,S){var C={name:g,delta:x,target:v,should:S,shadowParent:Zm(v)};e.current.push(C),setTimeout(function(){e.current=e.current.filter(function(k){return k!==C})},1)},[]),f=h.useCallback(function(g){r.current=dn(g),n.current=void 0},[]),d=h.useCallback(function(g){u(g.type,Fi(g),g.target,o(g,t.lockRef.current))},[]),m=h.useCallback(function(g){u(g.type,dn(g),g.target,o(g,t.lockRef.current))},[]);h.useEffect(function(){return rr.push(a),t.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:m}),document.addEventListener("wheel",c,tr),document.addEventListener("touchmove",c,tr),document.addEventListener("touchstart",f,tr),function(){rr=rr.filter(function(g){return g!==a}),document.removeEventListener("wheel",c,tr),document.removeEventListener("touchmove",c,tr),document.removeEventListener("touchstart",f,tr)}},[]);var p=t.removeScrollBar,y=t.inert;return h.createElement(h.Fragment,null,y?h.createElement(a,{styles:$m(s)}):null,p?h.createElement(Dm,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function Zm(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const Bm=vm(Ll,zm);var ja=h.forwardRef(function(t,e){return h.createElement(Xn,it({},t,{ref:e,sideCar:Bm}))});ja.classNames=Xn.classNames;var Jn="Popover",[Zl]=Un(Jn,[Nl]),Hr=Nl(),[Um,At]=Zl(Jn),Bl=t=>{const{__scopePopover:e,children:r,open:n,defaultOpen:s,onOpenChange:a,modal:i=!1}=t,o=Hr(e),c=h.useRef(null),[u,f]=h.useState(!1),[d,m]=Ta({prop:n,defaultProp:s??!1,onChange:a,caller:Jn});return l.jsx(Xh,{...o,children:l.jsx(Um,{scope:e,contentId:xn(),triggerRef:c,open:d,onOpenChange:m,onOpenToggle:h.useCallback(()=>m(p=>!p),[m]),hasCustomAnchor:u,onCustomAnchorAdd:h.useCallback(()=>f(!0),[]),onCustomAnchorRemove:h.useCallback(()=>f(!1),[]),modal:i,children:r})})};Bl.displayName=Jn;var Ul="PopoverAnchor",Hm=h.forwardRef((t,e)=>{const{__scopePopover:r,...n}=t,s=At(Ul,r),a=Hr(r),{onCustomAnchorAdd:i,onCustomAnchorRemove:o}=s;return h.useEffect(()=>(i(),()=>o()),[i,o]),l.jsx(Al,{...a,...n,ref:e})});Hm.displayName=Ul;var Hl="PopoverTrigger",ql=h.forwardRef((t,e)=>{const{__scopePopover:r,...n}=t,s=At(Hl,r),a=Hr(r),i=$e(e,s.triggerRef),o=l.jsx(_e.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Kl(s.open),...n,ref:i,onClick:Re(t.onClick,s.onOpenToggle)});return s.hasCustomAnchor?o:l.jsx(Al,{asChild:!0,...a,children:o})});ql.displayName=Hl;var Ea="PopoverPortal",[qm,Ym]=Zl(Ea,{forceMount:void 0}),Yl=t=>{const{__scopePopover:e,forceMount:r,children:n,container:s}=t,a=At(Ea,e);return l.jsx(qm,{scope:e,forceMount:r,children:l.jsx(Nr,{present:r||a.open,children:l.jsx(_a,{asChild:!0,container:s,children:n})})})};Yl.displayName=Ea;var pr="PopoverContent",Gl=h.forwardRef((t,e)=>{const r=Ym(pr,t.__scopePopover),{forceMount:n=r.forceMount,...s}=t,a=At(pr,t.__scopePopover);return l.jsx(Nr,{present:n||a.open,children:a.modal?l.jsx(Xm,{...s,ref:e}):l.jsx(Jm,{...s,ref:e})})});Gl.displayName=pr;var Gm=Zn("PopoverContent.RemoveScroll"),Xm=h.forwardRef((t,e)=>{const r=At(pr,t.__scopePopover),n=h.useRef(null),s=$e(e,n),a=h.useRef(!1);return h.useEffect(()=>{const i=n.current;if(i)return Il(i)},[]),l.jsx(ja,{as:Gm,allowPinchZoom:!0,children:l.jsx(Xl,{...t,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Re(t.onCloseAutoFocus,i=>{i.preventDefault(),a.current||r.triggerRef.current?.focus()}),onPointerDownOutside:Re(t.onPointerDownOutside,i=>{const o=i.detail.originalEvent,c=o.button===0&&o.ctrlKey===!0,u=o.button===2||c;a.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:Re(t.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),Jm=h.forwardRef((t,e)=>{const r=At(pr,t.__scopePopover),n=h.useRef(!1),s=h.useRef(!1);return l.jsx(Xl,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{t.onCloseAutoFocus?.(a),a.defaultPrevented||(n.current||r.triggerRef.current?.focus(),a.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:a=>{t.onInteractOutside?.(a),a.defaultPrevented||(n.current=!0,a.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const i=a.target;r.triggerRef.current?.contains(i)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&s.current&&a.preventDefault()}})}),Xl=h.forwardRef((t,e)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:i,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:f,...d}=t,m=At(pr,r),p=Hr(r);return ll(),l.jsx(ya,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:a,children:l.jsx(ga,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:f,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>m.onOpenChange(!1),children:l.jsx(Jh,{"data-state":Kl(m.open),role:"dialog",id:m.contentId,...p,...d,ref:e,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)"}})})})}),Jl="PopoverClose",Km=h.forwardRef((t,e)=>{const{__scopePopover:r,...n}=t,s=At(Jl,r);return l.jsx(_e.button,{type:"button",...n,ref:e,onClick:Re(t.onClick,()=>s.onOpenChange(!1))})});Km.displayName=Jl;var Qm="PopoverArrow",ep=h.forwardRef((t,e)=>{const{__scopePopover:r,...n}=t,s=Hr(r);return l.jsx(Kh,{...s,...n,ref:e})});ep.displayName=Qm;function Kl(t){return t?"open":"closed"}var tp=Bl,rp=ql,np=Yl,sp=Gl;class qt extends Error{}class ap extends qt{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class ip extends qt{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class op extends qt{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class lr extends qt{}class Ql extends qt{constructor(e){super(`Invalid unit ${e}`)}}class Ne extends qt{}class wt extends qt{constructor(){super("Zone is an abstract class")}}const E="numeric",tt="short",Fe="long",Dn={year:E,month:E,day:E},ec={year:E,month:tt,day:E},lp={year:E,month:tt,day:E,weekday:tt},tc={year:E,month:Fe,day:E},rc={year:E,month:Fe,day:E,weekday:Fe},nc={hour:E,minute:E},sc={hour:E,minute:E,second:E},ac={hour:E,minute:E,second:E,timeZoneName:tt},ic={hour:E,minute:E,second:E,timeZoneName:Fe},oc={hour:E,minute:E,hourCycle:"h23"},lc={hour:E,minute:E,second:E,hourCycle:"h23"},cc={hour:E,minute:E,second:E,hourCycle:"h23",timeZoneName:tt},uc={hour:E,minute:E,second:E,hourCycle:"h23",timeZoneName:Fe},dc={year:E,month:E,day:E,hour:E,minute:E},fc={year:E,month:E,day:E,hour:E,minute:E,second:E},hc={year:E,month:tt,day:E,hour:E,minute:E},mc={year:E,month:tt,day:E,hour:E,minute:E,second:E},cp={year:E,month:tt,day:E,weekday:tt,hour:E,minute:E},pc={year:E,month:Fe,day:E,hour:E,minute:E,timeZoneName:tt},gc={year:E,month:Fe,day:E,hour:E,minute:E,second:E,timeZoneName:tt},yc={year:E,month:Fe,day:E,weekday:Fe,hour:E,minute:E,timeZoneName:Fe},vc={year:E,month:Fe,day:E,weekday:Fe,hour:E,minute:E,second:E,timeZoneName:Fe};class qr{get type(){throw new wt}get name(){throw new wt}get ianaName(){return this.name}get isUniversal(){throw new wt}offsetName(e,r){throw new wt}formatOffset(e,r){throw new wt}offset(e){throw new wt}equals(e){throw new wt}get isValid(){throw new wt}}let Ts=null;class Kn extends qr{static get instance(){return Ts===null&&(Ts=new Kn),Ts}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:r,locale:n}){return Ec(e,r,n)}formatOffset(e,r){return Pr(this.offset(e),r)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}const qs=new Map;function up(t){let e=qs.get(t);return e===void 0&&(e=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),qs.set(t,e)),e}const dp={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function fp(t,e){const r=t.format(e).replace(/\u200E/g,""),n=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(r),[,s,a,i,o,c,u,f]=n;return[i,s,a,o,c,u,f]}function hp(t,e){const r=t.formatToParts(e),n=[];for(let s=0;s<r.length;s++){const{type:a,value:i}=r[s],o=dp[a];a==="era"?n[o]=i:Z(o)||(n[o]=parseInt(i,10))}return n}const js=new Map;class dt extends qr{static create(e){let r=js.get(e);return r===void 0&&js.set(e,r=new dt(e)),r}static resetCache(){js.clear(),qs.clear()}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch{return!1}}constructor(e){super(),this.zoneName=e,this.valid=dt.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:r,locale:n}){return Ec(e,r,n,this.name)}formatOffset(e,r){return Pr(this.offset(e),r)}offset(e){if(!this.valid)return NaN;const r=new Date(e);if(isNaN(r))return NaN;const n=up(this.name);let[s,a,i,o,c,u,f]=n.formatToParts?hp(n,r):fp(n,r);o==="BC"&&(s=-Math.abs(s)+1);const m=es({year:s,month:a,day:i,hour:c===24?0:c,minute:u,second:f,millisecond:0});let p=+r;const y=p%1e3;return p-=y>=0?y:1e3+y,(m-p)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let Vi={};function mp(t,e={}){const r=JSON.stringify([t,e]);let n=Vi[r];return n||(n=new Intl.ListFormat(t,e),Vi[r]=n),n}const Ys=new Map;function Gs(t,e={}){const r=JSON.stringify([t,e]);let n=Ys.get(r);return n===void 0&&(n=new Intl.DateTimeFormat(t,e),Ys.set(r,n)),n}const Xs=new Map;function pp(t,e={}){const r=JSON.stringify([t,e]);let n=Xs.get(r);return n===void 0&&(n=new Intl.NumberFormat(t,e),Xs.set(r,n)),n}const Js=new Map;function gp(t,e={}){const{base:r,...n}=e,s=JSON.stringify([t,n]);let a=Js.get(s);return a===void 0&&(a=new Intl.RelativeTimeFormat(t,e),Js.set(s,a)),a}let Dr=null;function yp(){return Dr||(Dr=new Intl.DateTimeFormat().resolvedOptions().locale,Dr)}const Ks=new Map;function xc(t){let e=Ks.get(t);return e===void 0&&(e=new Intl.DateTimeFormat(t).resolvedOptions(),Ks.set(t,e)),e}const Qs=new Map;function vp(t){let e=Qs.get(t);if(!e){const r=new Intl.Locale(t);e="getWeekInfo"in r?r.getWeekInfo():r.weekInfo,"minimalDays"in e||(e={...bc,...e}),Qs.set(t,e)}return e}function xp(t){const e=t.indexOf("-x-");e!==-1&&(t=t.substring(0,e));const r=t.indexOf("-u-");if(r===-1)return[t];{let n,s;try{n=Gs(t).resolvedOptions(),s=t}catch{const c=t.substring(0,r);n=Gs(c).resolvedOptions(),s=c}const{numberingSystem:a,calendar:i}=n;return[s,a,i]}}function bp(t,e,r){return(r||e)&&(t.includes("-u-")||(t+="-u"),r&&(t+=`-ca-${r}`),e&&(t+=`-nu-${e}`)),t}function wp(t){const e=[];for(let r=1;r<=12;r++){const n=I.utc(2009,r,1);e.push(t(n))}return e}function kp(t){const e=[];for(let r=1;r<=7;r++){const n=I.utc(2016,11,13+r);e.push(t(n))}return e}function fn(t,e,r,n){const s=t.listingMode();return s==="error"?null:s==="en"?r(e):n(e)}function Sp(t){return t.numberingSystem&&t.numberingSystem!=="latn"?!1:t.numberingSystem==="latn"||!t.locale||t.locale.startsWith("en")||xc(t.locale).numberingSystem==="latn"}class Np{constructor(e,r,n){this.padTo=n.padTo||0,this.floor=n.floor||!1;const{padTo:s,floor:a,...i}=n;if(!r||Object.keys(i).length>0){const o={useGrouping:!1,...n};n.padTo>0&&(o.minimumIntegerDigits=n.padTo),this.inf=pp(e,o)}}format(e){if(this.inf){const r=this.floor?Math.floor(e):e;return this.inf.format(r)}else{const r=this.floor?Math.floor(e):Ma(e,3);return ge(r,this.padTo)}}}class Cp{constructor(e,r,n){this.opts=n,this.originalZone=void 0;let s;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){const i=-1*(e.offset/60),o=i>=0?`Etc/GMT+${i}`:`Etc/GMT${i}`;e.offset!==0&&dt.create(o).valid?(s=o,this.dt=e):(s="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,s=e.zone.name):(s="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const a={...this.opts};a.timeZone=a.timeZone||s,this.dtf=Gs(r,a)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(r=>{if(r.type==="timeZoneName"){const n=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...r,value:n}}else return r}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class _p{constructor(e,r,n){this.opts={style:"long",...n},!r&&Tc()&&(this.rtf=gp(e,n))}format(e,r){return this.rtf?this.rtf.format(e,r):Yp(r,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,r){return this.rtf?this.rtf.formatToParts(e,r):[]}}const bc={firstDay:1,minimalDays:4,weekend:[6,7]};class ae{static fromOpts(e){return ae.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,r,n,s,a=!1){const i=e||de.defaultLocale,o=i||(a?"en-US":yp()),c=r||de.defaultNumberingSystem,u=n||de.defaultOutputCalendar,f=ta(s)||de.defaultWeekSettings;return new ae(o,c,u,f,i)}static resetCache(){Dr=null,Ys.clear(),Xs.clear(),Js.clear(),Ks.clear(),Qs.clear()}static fromObject({locale:e,numberingSystem:r,outputCalendar:n,weekSettings:s}={}){return ae.create(e,r,n,s)}constructor(e,r,n,s,a){const[i,o,c]=xp(e);this.locale=i,this.numberingSystem=r||o||null,this.outputCalendar=n||c||null,this.weekSettings=s,this.intl=bp(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=a,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=Sp(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),r=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&r?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:ae.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,ta(e.weekSettings)||this.weekSettings,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,r=!1){return fn(this,e,Rc,()=>{const n=this.intl==="ja"||this.intl.startsWith("ja-");r&=!n;const s=r?{month:e,day:"numeric"}:{month:e},a=r?"format":"standalone";if(!this.monthsCache[a][e]){const i=n?o=>this.dtFormatter(o,s).format():o=>this.extract(o,s,"month");this.monthsCache[a][e]=wp(i)}return this.monthsCache[a][e]})}weekdays(e,r=!1){return fn(this,e,Ic,()=>{const n=r?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},s=r?"format":"standalone";return this.weekdaysCache[s][e]||(this.weekdaysCache[s][e]=kp(a=>this.extract(a,n,"weekday"))),this.weekdaysCache[s][e]})}meridiems(){return fn(this,void 0,()=>Pc,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[I.utc(2016,11,13,9),I.utc(2016,11,13,19)].map(r=>this.extract(r,e,"dayperiod"))}return this.meridiemCache})}eras(e){return fn(this,e,Fc,()=>{const r={era:e};return this.eraCache[e]||(this.eraCache[e]=[I.utc(-40,1,1),I.utc(2017,1,1)].map(n=>this.extract(n,r,"era"))),this.eraCache[e]})}extract(e,r,n){const s=this.dtFormatter(e,r),a=s.formatToParts(),i=a.find(o=>o.type.toLowerCase()===n);return i?i.value:null}numberFormatter(e={}){return new Np(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,r={}){return new Cp(e,this.intl,r)}relFormatter(e={}){return new _p(this.intl,this.isEnglish(),e)}listFormatter(e={}){return mp(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||xc(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:jc()?vp(this.locale):bc}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let Es=null;class je extends qr{static get utcInstance(){return Es===null&&(Es=new je(0)),Es}static instance(e){return e===0?je.utcInstance:new je(e)}static parseSpecifier(e){if(e){const r=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(r)return new je(ts(r[1],r[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Pr(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Pr(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,r){return Pr(this.fixed,r)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class Tp extends qr{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Ct(t,e){if(Z(t)||t===null)return e;if(t instanceof qr)return t;if(Ap(t)){const r=t.toLowerCase();return r==="default"?e:r==="local"||r==="system"?Kn.instance:r==="utc"||r==="gmt"?je.utcInstance:je.parseSpecifier(r)||dt.create(t)}else return _t(t)?je.instance(t):typeof t=="object"&&"offset"in t&&typeof t.offset=="function"?t:new Tp(t)}const Oa={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},$i={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},jp=Oa.hanidec.replace(/[\[|\]]/g,"").split("");function Ep(t){let e=parseInt(t,10);if(isNaN(e)){e="";for(let r=0;r<t.length;r++){const n=t.charCodeAt(r);if(t[r].search(Oa.hanidec)!==-1)e+=jp.indexOf(t[r]);else for(const s in $i){const[a,i]=$i[s];n>=a&&n<=i&&(e+=n-a)}}return parseInt(e,10)}else return e}const ea=new Map;function Op(){ea.clear()}function Ye({numberingSystem:t},e=""){const r=t||"latn";let n=ea.get(r);n===void 0&&(n=new Map,ea.set(r,n));let s=n.get(e);return s===void 0&&(s=new RegExp(`${Oa[r]}${e}`),n.set(e,s)),s}let Wi=()=>Date.now(),zi="system",Zi=null,Bi=null,Ui=null,Hi=60,qi,Yi=null;class de{static get now(){return Wi}static set now(e){Wi=e}static set defaultZone(e){zi=e}static get defaultZone(){return Ct(zi,Kn.instance)}static get defaultLocale(){return Zi}static set defaultLocale(e){Zi=e}static get defaultNumberingSystem(){return Bi}static set defaultNumberingSystem(e){Bi=e}static get defaultOutputCalendar(){return Ui}static set defaultOutputCalendar(e){Ui=e}static get defaultWeekSettings(){return Yi}static set defaultWeekSettings(e){Yi=ta(e)}static get twoDigitCutoffYear(){return Hi}static set twoDigitCutoffYear(e){Hi=e%100}static get throwOnInvalid(){return qi}static set throwOnInvalid(e){qi=e}static resetCaches(){ae.resetCache(),dt.resetCache(),I.resetCache(),Op()}}class Ke{constructor(e,r){this.reason=e,this.explanation=r}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const wc=[0,31,59,90,120,151,181,212,243,273,304,334],kc=[0,31,60,91,121,152,182,213,244,274,305,335];function Ze(t,e){return new Ke("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${t}, which is invalid`)}function Da(t,e,r){const n=new Date(Date.UTC(t,e-1,r));t<100&&t>=0&&n.setUTCFullYear(n.getUTCFullYear()-1900);const s=n.getUTCDay();return s===0?7:s}function Sc(t,e,r){return r+(Yr(t)?kc:wc)[e-1]}function Nc(t,e){const r=Yr(t)?kc:wc,n=r.findIndex(a=>a<e),s=e-r[n];return{month:n+1,day:s}}function Ra(t,e){return(t-e+7)%7+1}function Rn(t,e=4,r=1){const{year:n,month:s,day:a}=t,i=Sc(n,s,a),o=Ra(Da(n,s,a),r);let c=Math.floor((i-o+14-e)/7),u;return c<1?(u=n-1,c=Vr(u,e,r)):c>Vr(n,e,r)?(u=n+1,c=1):u=n,{weekYear:u,weekNumber:c,weekday:o,...rs(t)}}function Gi(t,e=4,r=1){const{weekYear:n,weekNumber:s,weekday:a}=t,i=Ra(Da(n,1,e),r),o=dr(n);let c=s*7+a-i-7+e,u;c<1?(u=n-1,c+=dr(u)):c>o?(u=n+1,c-=dr(n)):u=n;const{month:f,day:d}=Nc(u,c);return{year:u,month:f,day:d,...rs(t)}}function Os(t){const{year:e,month:r,day:n}=t,s=Sc(e,r,n);return{year:e,ordinal:s,...rs(t)}}function Xi(t){const{year:e,ordinal:r}=t,{month:n,day:s}=Nc(e,r);return{year:e,month:n,day:s,...rs(t)}}function Ji(t,e){if(!Z(t.localWeekday)||!Z(t.localWeekNumber)||!Z(t.localWeekYear)){if(!Z(t.weekday)||!Z(t.weekNumber)||!Z(t.weekYear))throw new lr("Cannot mix locale-based week fields with ISO-based week fields");return Z(t.localWeekday)||(t.weekday=t.localWeekday),Z(t.localWeekNumber)||(t.weekNumber=t.localWeekNumber),Z(t.localWeekYear)||(t.weekYear=t.localWeekYear),delete t.localWeekday,delete t.localWeekNumber,delete t.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function Dp(t,e=4,r=1){const n=Qn(t.weekYear),s=Be(t.weekNumber,1,Vr(t.weekYear,e,r)),a=Be(t.weekday,1,7);return n?s?a?!1:Ze("weekday",t.weekday):Ze("week",t.weekNumber):Ze("weekYear",t.weekYear)}function Rp(t){const e=Qn(t.year),r=Be(t.ordinal,1,dr(t.year));return e?r?!1:Ze("ordinal",t.ordinal):Ze("year",t.year)}function Cc(t){const e=Qn(t.year),r=Be(t.month,1,12),n=Be(t.day,1,An(t.year,t.month));return e?r?n?!1:Ze("day",t.day):Ze("month",t.month):Ze("year",t.year)}function _c(t){const{hour:e,minute:r,second:n,millisecond:s}=t,a=Be(e,0,23)||e===24&&r===0&&n===0&&s===0,i=Be(r,0,59),o=Be(n,0,59),c=Be(s,0,999);return a?i?o?c?!1:Ze("millisecond",s):Ze("second",n):Ze("minute",r):Ze("hour",e)}function Z(t){return typeof t>"u"}function _t(t){return typeof t=="number"}function Qn(t){return typeof t=="number"&&t%1===0}function Ap(t){return typeof t=="string"}function Mp(t){return Object.prototype.toString.call(t)==="[object Date]"}function Tc(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function jc(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function Ip(t){return Array.isArray(t)?t:[t]}function Ki(t,e,r){if(t.length!==0)return t.reduce((n,s)=>{const a=[e(s),s];return n&&r(n[0],a[0])===n[0]?n:a},null)[1]}function Pp(t,e){return e.reduce((r,n)=>(r[n]=t[n],r),{})}function gr(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function ta(t){if(t==null)return null;if(typeof t!="object")throw new Ne("Week settings must be an object");if(!Be(t.firstDay,1,7)||!Be(t.minimalDays,1,7)||!Array.isArray(t.weekend)||t.weekend.some(e=>!Be(e,1,7)))throw new Ne("Invalid week settings");return{firstDay:t.firstDay,minimalDays:t.minimalDays,weekend:Array.from(t.weekend)}}function Be(t,e,r){return Qn(t)&&t>=e&&t<=r}function Fp(t,e){return t-e*Math.floor(t/e)}function ge(t,e=2){const r=t<0;let n;return r?n="-"+(""+-t).padStart(e,"0"):n=(""+t).padStart(e,"0"),n}function St(t){if(!(Z(t)||t===null||t===""))return parseInt(t,10)}function Ft(t){if(!(Z(t)||t===null||t===""))return parseFloat(t)}function Aa(t){if(!(Z(t)||t===null||t==="")){const e=parseFloat("0."+t)*1e3;return Math.floor(e)}}function Ma(t,e,r="round"){const n=10**e;switch(r){case"expand":return t>0?Math.ceil(t*n)/n:Math.floor(t*n)/n;case"trunc":return Math.trunc(t*n)/n;case"round":return Math.round(t*n)/n;case"floor":return Math.floor(t*n)/n;case"ceil":return Math.ceil(t*n)/n;default:throw new RangeError(`Value rounding ${r} is out of range`)}}function Yr(t){return t%4===0&&(t%100!==0||t%400===0)}function dr(t){return Yr(t)?366:365}function An(t,e){const r=Fp(e-1,12)+1,n=t+(e-r)/12;return r===2?Yr(n)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][r-1]}function es(t){let e=Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second,t.millisecond);return t.year<100&&t.year>=0&&(e=new Date(e),e.setUTCFullYear(t.year,t.month-1,t.day)),+e}function Qi(t,e,r){return-Ra(Da(t,1,e),r)+e-1}function Vr(t,e=4,r=1){const n=Qi(t,e,r),s=Qi(t+1,e,r);return(dr(t)-n+s)/7}function ra(t){return t>99?t:t>de.twoDigitCutoffYear?1900+t:2e3+t}function Ec(t,e,r,n=null){const s=new Date(t),a={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};n&&(a.timeZone=n);const i={timeZoneName:e,...a},o=new Intl.DateTimeFormat(r,i).formatToParts(s).find(c=>c.type.toLowerCase()==="timezonename");return o?o.value:null}function ts(t,e){let r=parseInt(t,10);Number.isNaN(r)&&(r=0);const n=parseInt(e,10)||0,s=r<0||Object.is(r,-0)?-n:n;return r*60+s}function Oc(t){const e=Number(t);if(typeof t=="boolean"||t===""||!Number.isFinite(e))throw new Ne(`Invalid unit value ${t}`);return e}function Mn(t,e){const r={};for(const n in t)if(gr(t,n)){const s=t[n];if(s==null)continue;r[e(n)]=Oc(s)}return r}function Pr(t,e){const r=Math.trunc(Math.abs(t/60)),n=Math.trunc(Math.abs(t%60)),s=t>=0?"+":"-";switch(e){case"short":return`${s}${ge(r,2)}:${ge(n,2)}`;case"narrow":return`${s}${r}${n>0?`:${n}`:""}`;case"techie":return`${s}${ge(r,2)}${ge(n,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function rs(t){return Pp(t,["hour","minute","second","millisecond"])}const Lp=["January","February","March","April","May","June","July","August","September","October","November","December"],Dc=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Vp=["J","F","M","A","M","J","J","A","S","O","N","D"];function Rc(t){switch(t){case"narrow":return[...Vp];case"short":return[...Dc];case"long":return[...Lp];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const Ac=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Mc=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],$p=["M","T","W","T","F","S","S"];function Ic(t){switch(t){case"narrow":return[...$p];case"short":return[...Mc];case"long":return[...Ac];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Pc=["AM","PM"],Wp=["Before Christ","Anno Domini"],zp=["BC","AD"],Zp=["B","A"];function Fc(t){switch(t){case"narrow":return[...Zp];case"short":return[...zp];case"long":return[...Wp];default:return null}}function Bp(t){return Pc[t.hour<12?0:1]}function Up(t,e){return Ic(e)[t.weekday-1]}function Hp(t,e){return Rc(e)[t.month-1]}function qp(t,e){return Fc(e)[t.year<0?0:1]}function Yp(t,e,r="always",n=!1){const s={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},a=["hours","minutes","seconds"].indexOf(t)===-1;if(r==="auto"&&a){const d=t==="days";switch(e){case 1:return d?"tomorrow":`next ${s[t][0]}`;case-1:return d?"yesterday":`last ${s[t][0]}`;case 0:return d?"today":`this ${s[t][0]}`}}const i=Object.is(e,-0)||e<0,o=Math.abs(e),c=o===1,u=s[t],f=n?c?u[1]:u[2]||u[1]:c?s[t][0]:t;return i?`${o} ${f} ago`:`in ${o} ${f}`}function eo(t,e){let r="";for(const n of t)n.literal?r+=n.val:r+=e(n.val);return r}const Gp={D:Dn,DD:ec,DDD:tc,DDDD:rc,t:nc,tt:sc,ttt:ac,tttt:ic,T:oc,TT:lc,TTT:cc,TTTT:uc,f:dc,ff:hc,fff:pc,ffff:yc,F:fc,FF:mc,FFF:gc,FFFF:vc};class Ce{static create(e,r={}){return new Ce(e,r)}static parseFormat(e){let r=null,n="",s=!1;const a=[];for(let i=0;i<e.length;i++){const o=e.charAt(i);o==="'"?((n.length>0||s)&&a.push({literal:s||/^\s+$/.test(n),val:n===""?"'":n}),r=null,n="",s=!s):s||o===r?n+=o:(n.length>0&&a.push({literal:/^\s+$/.test(n),val:n}),n=o,r=o)}return n.length>0&&a.push({literal:s||/^\s+$/.test(n),val:n}),a}static macroTokenToFormatOpts(e){return Gp[e]}constructor(e,r){this.opts=r,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,r){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...r}).format()}dtFormatter(e,r={}){return this.loc.dtFormatter(e,{...this.opts,...r})}formatDateTime(e,r){return this.dtFormatter(e,r).format()}formatDateTimeParts(e,r){return this.dtFormatter(e,r).formatToParts()}formatInterval(e,r){return this.dtFormatter(e.start,r).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,r){return this.dtFormatter(e,r).resolvedOptions()}num(e,r=0,n=void 0){if(this.opts.forceSimple)return ge(e,r);const s={...this.opts};return r>0&&(s.padTo=r),n&&(s.signDisplay=n),this.loc.numberFormatter(s).format(e)}formatDateTimeFromString(e,r){const n=this.loc.listingMode()==="en",s=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",a=(p,y)=>this.loc.extract(e,p,y),i=p=>e.isOffsetFixed&&e.offset===0&&p.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,p.format):"",o=()=>n?Bp(e):a({hour:"numeric",hourCycle:"h12"},"dayperiod"),c=(p,y)=>n?Hp(e,p):a(y?{month:p}:{month:p,day:"numeric"},"month"),u=(p,y)=>n?Up(e,p):a(y?{weekday:p}:{weekday:p,month:"long",day:"numeric"},"weekday"),f=p=>{const y=Ce.macroTokenToFormatOpts(p);return y?this.formatWithSystemDefault(e,y):p},d=p=>n?qp(e,p):a({era:p},"era"),m=p=>{switch(p){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return i({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return i({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return i({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return o();case"d":return s?a({day:"numeric"},"day"):this.num(e.day);case"dd":return s?a({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return s?a({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return s?a({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return c("short",!0);case"LLLL":return c("long",!0);case"LLLLL":return c("narrow",!0);case"M":return s?a({month:"numeric"},"month"):this.num(e.month);case"MM":return s?a({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return c("short",!1);case"MMMM":return c("long",!1);case"MMMMM":return c("narrow",!1);case"y":return s?a({year:"numeric"},"year"):this.num(e.year);case"yy":return s?a({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return s?a({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return s?a({year:"numeric"},"year"):this.num(e.year,6);case"G":return d("short");case"GG":return d("long");case"GGGGG":return d("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return f(p)}};return eo(Ce.parseFormat(r),m)}formatDurationFromString(e,r){const n=this.opts.signMode==="negativeLargestOnly"?-1:1,s=f=>{switch(f[0]){case"S":return"milliseconds";case"s":return"seconds";case"m":return"minutes";case"h":return"hours";case"d":return"days";case"w":return"weeks";case"M":return"months";case"y":return"years";default:return null}},a=(f,d)=>m=>{const p=s(m);if(p){const y=d.isNegativeDuration&&p!==d.largestUnit?n:1;let g;return this.opts.signMode==="negativeLargestOnly"&&p!==d.largestUnit?g="never":this.opts.signMode==="all"?g="always":g="auto",this.num(f.get(p)*y,m.length,g)}else return m},i=Ce.parseFormat(r),o=i.reduce((f,{literal:d,val:m})=>d?f:f.concat(m),[]),c=e.shiftTo(...o.map(s).filter(f=>f)),u={isNegativeDuration:c<0,largestUnit:Object.keys(c.values)[0]};return eo(i,a(c,u))}}const Lc=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Cr(...t){const e=t.reduce((r,n)=>r+n.source,"");return RegExp(`^${e}$`)}function _r(...t){return e=>t.reduce(([r,n,s],a)=>{const[i,o,c]=a(e,s);return[{...r,...i},o||n,c]},[{},null,1]).slice(0,2)}function Tr(t,...e){if(t==null)return[null,null];for(const[r,n]of e){const s=r.exec(t);if(s)return n(s)}return[null,null]}function Vc(...t){return(e,r)=>{const n={};let s;for(s=0;s<t.length;s++)n[t[s]]=St(e[r+s]);return[n,null,r+s]}}const $c=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,Xp=`(?:${$c.source}?(?:\\[(${Lc.source})\\])?)?`,Ia=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Wc=RegExp(`${Ia.source}${Xp}`),Pa=RegExp(`(?:[Tt]${Wc.source})?`),Jp=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Kp=/(\d{4})-?W(\d\d)(?:-?(\d))?/,Qp=/(\d{4})-?(\d{3})/,eg=Vc("weekYear","weekNumber","weekDay"),tg=Vc("year","ordinal"),rg=/(\d{4})-(\d\d)-(\d\d)/,zc=RegExp(`${Ia.source} ?(?:${$c.source}|(${Lc.source}))?`),ng=RegExp(`(?: ${zc.source})?`);function fr(t,e,r){const n=t[e];return Z(n)?r:St(n)}function sg(t,e){return[{year:fr(t,e),month:fr(t,e+1,1),day:fr(t,e+2,1)},null,e+3]}function jr(t,e){return[{hours:fr(t,e,0),minutes:fr(t,e+1,0),seconds:fr(t,e+2,0),milliseconds:Aa(t[e+3])},null,e+4]}function Gr(t,e){const r=!t[e]&&!t[e+1],n=ts(t[e+1],t[e+2]),s=r?null:je.instance(n);return[{},s,e+3]}function Xr(t,e){const r=t[e]?dt.create(t[e]):null;return[{},r,e+1]}const ag=RegExp(`^T?${Ia.source}$`),ig=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function og(t){const[e,r,n,s,a,i,o,c,u]=t,f=e[0]==="-",d=c&&c[0]==="-",m=(p,y=!1)=>p!==void 0&&(y||p&&f)?-p:p;return[{years:m(Ft(r)),months:m(Ft(n)),weeks:m(Ft(s)),days:m(Ft(a)),hours:m(Ft(i)),minutes:m(Ft(o)),seconds:m(Ft(c),c==="-0"),milliseconds:m(Aa(u),d)}]}const lg={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Fa(t,e,r,n,s,a,i){const o={year:e.length===2?ra(St(e)):St(e),month:Dc.indexOf(r)+1,day:St(n),hour:St(s),minute:St(a)};return i&&(o.second=St(i)),t&&(o.weekday=t.length>3?Ac.indexOf(t)+1:Mc.indexOf(t)+1),o}const cg=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function ug(t){const[,e,r,n,s,a,i,o,c,u,f,d]=t,m=Fa(e,s,n,r,a,i,o);let p;return c?p=lg[c]:u?p=0:p=ts(f,d),[m,new je(p)]}function dg(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const fg=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,hg=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,mg=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function to(t){const[,e,r,n,s,a,i,o]=t;return[Fa(e,s,n,r,a,i,o),je.utcInstance]}function pg(t){const[,e,r,n,s,a,i,o]=t;return[Fa(e,o,r,n,s,a,i),je.utcInstance]}const gg=Cr(Jp,Pa),yg=Cr(Kp,Pa),vg=Cr(Qp,Pa),xg=Cr(Wc),Zc=_r(sg,jr,Gr,Xr),bg=_r(eg,jr,Gr,Xr),wg=_r(tg,jr,Gr,Xr),kg=_r(jr,Gr,Xr);function Sg(t){return Tr(t,[gg,Zc],[yg,bg],[vg,wg],[xg,kg])}function Ng(t){return Tr(dg(t),[cg,ug])}function Cg(t){return Tr(t,[fg,to],[hg,to],[mg,pg])}function _g(t){return Tr(t,[ig,og])}const Tg=_r(jr);function jg(t){return Tr(t,[ag,Tg])}const Eg=Cr(rg,ng),Og=Cr(zc),Dg=_r(jr,Gr,Xr);function Rg(t){return Tr(t,[Eg,Zc],[Og,Dg])}const ro="Invalid Duration",Bc={weeks:{days:7,hours:168,minutes:10080,seconds:10080*60,milliseconds:10080*60*1e3},days:{hours:24,minutes:1440,seconds:1440*60,milliseconds:1440*60*1e3},hours:{minutes:60,seconds:3600,milliseconds:3600*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},Ag={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:2184*60,seconds:2184*60*60,milliseconds:2184*60*60*1e3},months:{weeks:4,days:30,hours:720,minutes:720*60,seconds:720*60*60,milliseconds:720*60*60*1e3},...Bc},ze=146097/400,nr=146097/4800,Mg={years:{quarters:4,months:12,weeks:ze/7,days:ze,hours:ze*24,minutes:ze*24*60,seconds:ze*24*60*60,milliseconds:ze*24*60*60*1e3},quarters:{months:3,weeks:ze/28,days:ze/4,hours:ze*24/4,minutes:ze*24*60/4,seconds:ze*24*60*60/4,milliseconds:ze*24*60*60*1e3/4},months:{weeks:nr/7,days:nr,hours:nr*24,minutes:nr*24*60,seconds:nr*24*60*60,milliseconds:nr*24*60*60*1e3},...Bc},Vt=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Ig=Vt.slice(0).reverse();function mt(t,e,r=!1){const n={values:r?e.values:{...t.values,...e.values||{}},loc:t.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||t.conversionAccuracy,matrix:e.matrix||t.matrix};return new te(n)}function Uc(t,e){let r=e.milliseconds??0;for(const n of Ig.slice(1))e[n]&&(r+=e[n]*t[n].milliseconds);return r}function no(t,e){const r=Uc(t,e)<0?-1:1;Vt.reduceRight((n,s)=>{if(Z(e[s]))return n;if(n){const a=e[n]*r,i=t[s][n],o=Math.floor(a/i);e[s]+=o*r,e[n]-=o*i*r}return s},null),Vt.reduce((n,s)=>{if(Z(e[s]))return n;if(n){const a=e[n]%1;e[n]-=a,e[s]+=a*t[n][s]}return s},null)}function so(t){const e={};for(const[r,n]of Object.entries(t))n!==0&&(e[r]=n);return e}class te{constructor(e){const r=e.conversionAccuracy==="longterm"||!1;let n=r?Mg:Ag;e.matrix&&(n=e.matrix),this.values=e.values,this.loc=e.loc||ae.create(),this.conversionAccuracy=r?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=n,this.isLuxonDuration=!0}static fromMillis(e,r){return te.fromObject({milliseconds:e},r)}static fromObject(e,r={}){if(e==null||typeof e!="object")throw new Ne(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new te({values:Mn(e,te.normalizeUnit),loc:ae.fromObject(r),conversionAccuracy:r.conversionAccuracy,matrix:r.matrix})}static fromDurationLike(e){if(_t(e))return te.fromMillis(e);if(te.isDuration(e))return e;if(typeof e=="object")return te.fromObject(e);throw new Ne(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,r){const[n]=_g(e);return n?te.fromObject(n,r):te.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,r){const[n]=jg(e);return n?te.fromObject(n,r):te.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,r=null){if(!e)throw new Ne("need to specify a reason the Duration is invalid");const n=e instanceof Ke?e:new Ke(e,r);if(de.throwOnInvalid)throw new op(n);return new te({invalid:n})}static normalizeUnit(e){const r={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!r)throw new Ql(e);return r}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,r={}){const n={...r,floor:r.round!==!1&&r.floor!==!1};return this.isValid?Ce.create(this.loc,n).formatDurationFromString(this,e):ro}toHuman(e={}){if(!this.isValid)return ro;const r=e.showZeros!==!1,n=Vt.map(s=>{const a=this.values[s];return Z(a)||a===0&&!r?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:s.slice(0,-1)}).format(a)}).filter(s=>s);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=Ma(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const r=this.toMillis();return r<0||r>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},I.fromMillis(r,{zone:"UTC"}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?Uc(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const r=te.fromDurationLike(e),n={};for(const s of Vt)(gr(r.values,s)||gr(this.values,s))&&(n[s]=r.get(s)+this.get(s));return mt(this,{values:n},!0)}minus(e){if(!this.isValid)return this;const r=te.fromDurationLike(e);return this.plus(r.negate())}mapUnits(e){if(!this.isValid)return this;const r={};for(const n of Object.keys(this.values))r[n]=Oc(e(this.values[n],n));return mt(this,{values:r},!0)}get(e){return this[te.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const r={...this.values,...Mn(e,te.normalizeUnit)};return mt(this,{values:r})}reconfigure({locale:e,numberingSystem:r,conversionAccuracy:n,matrix:s}={}){const i={loc:this.loc.clone({locale:e,numberingSystem:r}),matrix:s,conversionAccuracy:n};return mt(this,i)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return no(this.matrix,e),mt(this,{values:e},!0)}rescale(){if(!this.isValid)return this;const e=so(this.normalize().shiftToAll().toObject());return mt(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(i=>te.normalizeUnit(i));const r={},n={},s=this.toObject();let a;for(const i of Vt)if(e.indexOf(i)>=0){a=i;let o=0;for(const u in n)o+=this.matrix[u][i]*n[u],n[u]=0;_t(s[i])&&(o+=s[i]);const c=Math.trunc(o);r[i]=c,n[i]=(o*1e3-c*1e3)/1e3}else _t(s[i])&&(n[i]=s[i]);for(const i in n)n[i]!==0&&(r[a]+=i===a?n[i]:n[i]/this.matrix[a][i]);return no(this.matrix,r),mt(this,{values:r},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const r of Object.keys(this.values))e[r]=this.values[r]===0?0:-this.values[r];return mt(this,{values:e},!0)}removeZeros(){if(!this.isValid)return this;const e=so(this.values);return mt(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function r(n,s){return n===void 0||n===0?s===void 0||s===0:n===s}for(const n of Vt)if(!r(this.values[n],e.values[n]))return!1;return!0}}const sr="Invalid Interval";function Pg(t,e){return!t||!t.isValid?me.invalid("missing or invalid start"):!e||!e.isValid?me.invalid("missing or invalid end"):e<t?me.invalid("end before start",`The end of an interval must be after its start, but you had start=${t.toISO()} and end=${e.toISO()}`):null}class me{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,r=null){if(!e)throw new Ne("need to specify a reason the Interval is invalid");const n=e instanceof Ke?e:new Ke(e,r);if(de.throwOnInvalid)throw new ip(n);return new me({invalid:n})}static fromDateTimes(e,r){const n=Or(e),s=Or(r),a=Pg(n,s);return a??new me({start:n,end:s})}static after(e,r){const n=te.fromDurationLike(r),s=Or(e);return me.fromDateTimes(s,s.plus(n))}static before(e,r){const n=te.fromDurationLike(r),s=Or(e);return me.fromDateTimes(s.minus(n),s)}static fromISO(e,r){const[n,s]=(e||"").split("/",2);if(n&&s){let a,i;try{a=I.fromISO(n,r),i=a.isValid}catch{i=!1}let o,c;try{o=I.fromISO(s,r),c=o.isValid}catch{c=!1}if(i&&c)return me.fromDateTimes(a,o);if(i){const u=te.fromISO(s,r);if(u.isValid)return me.after(a,u)}else if(c){const u=te.fromISO(n,r);if(u.isValid)return me.before(o,u)}}return me.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e="milliseconds"){return this.isValid?this.toDuration(e).get(e):NaN}count(e="milliseconds",r){if(!this.isValid)return NaN;const n=this.start.startOf(e,r);let s;return r?.useLocaleWeeks?s=this.end.reconfigure({locale:n.locale}):s=this.end,s=s.startOf(e,r),Math.floor(s.diff(n,e).get(e))+(s.valueOf()!==this.end.valueOf())}hasSame(e){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,e):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return this.isValid?this.s>e:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:r}={}){return this.isValid?me.fromDateTimes(e||this.s,r||this.e):this}splitAt(...e){if(!this.isValid)return[];const r=e.map(Or).filter(i=>this.contains(i)).sort((i,o)=>i.toMillis()-o.toMillis()),n=[];let{s}=this,a=0;for(;s<this.e;){const i=r[a]||this.e,o=+i>+this.e?this.e:i;n.push(me.fromDateTimes(s,o)),s=o,a+=1}return n}splitBy(e){const r=te.fromDurationLike(e);if(!this.isValid||!r.isValid||r.as("milliseconds")===0)return[];let{s:n}=this,s=1,a;const i=[];for(;n<this.e;){const o=this.start.plus(r.mapUnits(c=>c*s));a=+o>+this.e?this.e:o,i.push(me.fromDateTimes(n,a)),n=a,s+=1}return i}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s<e.e}abutsStart(e){return this.isValid?+this.e==+e.s:!1}abutsEnd(e){return this.isValid?+e.e==+this.s:!1}engulfs(e){return this.isValid?this.s<=e.s&&this.e>=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const r=this.s>e.s?this.s:e.s,n=this.e<e.e?this.e:e.e;return r>=n?null:me.fromDateTimes(r,n)}union(e){if(!this.isValid)return this;const r=this.s<e.s?this.s:e.s,n=this.e>e.e?this.e:e.e;return me.fromDateTimes(r,n)}static merge(e){const[r,n]=e.sort((s,a)=>s.s-a.s).reduce(([s,a],i)=>a?a.overlaps(i)||a.abutsStart(i)?[s,a.union(i)]:[s.concat([a]),i]:[s,i],[[],null]);return n&&r.push(n),r}static xor(e){let r=null,n=0;const s=[],a=e.map(c=>[{time:c.s,type:"s"},{time:c.e,type:"e"}]),i=Array.prototype.concat(...a),o=i.sort((c,u)=>c.time-u.time);for(const c of o)n+=c.type==="s"?1:-1,n===1?r=c.time:(r&&+r!=+c.time&&s.push(me.fromDateTimes(r,c.time)),r=null);return me.merge(s)}difference(...e){return me.xor([this].concat(e)).map(r=>this.intersection(r)).filter(r=>r&&!r.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:sr}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=Dn,r={}){return this.isValid?Ce.create(this.s.loc.clone(r),e).formatInterval(this):sr}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:sr}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:sr}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:sr}toFormat(e,{separator:r=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${r}${this.e.toFormat(e)}`:sr}toDuration(e,r){return this.isValid?this.e.diff(this.s,e,r):te.invalid(this.invalidReason)}mapEndpoints(e){return me.fromDateTimes(e(this.s),e(this.e))}}class hn{static hasDST(e=de.defaultZone){const r=I.now().setZone(e).set({month:12});return!e.isUniversal&&r.offset!==r.set({month:6}).offset}static isValidIANAZone(e){return dt.isValidZone(e)}static normalizeZone(e){return Ct(e,de.defaultZone)}static getStartOfWeek({locale:e=null,locObj:r=null}={}){return(r||ae.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:r=null}={}){return(r||ae.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:r=null}={}){return(r||ae.create(e)).getWeekendDays().slice()}static months(e="long",{locale:r=null,numberingSystem:n=null,locObj:s=null,outputCalendar:a="gregory"}={}){return(s||ae.create(r,n,a)).months(e)}static monthsFormat(e="long",{locale:r=null,numberingSystem:n=null,locObj:s=null,outputCalendar:a="gregory"}={}){return(s||ae.create(r,n,a)).months(e,!0)}static weekdays(e="long",{locale:r=null,numberingSystem:n=null,locObj:s=null}={}){return(s||ae.create(r,n,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:r=null,numberingSystem:n=null,locObj:s=null}={}){return(s||ae.create(r,n,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return ae.create(e).meridiems()}static eras(e="short",{locale:r=null}={}){return ae.create(r,null,"gregory").eras(e)}static features(){return{relative:Tc(),localeWeek:jc()}}}function ao(t,e){const r=s=>s.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),n=r(e)-r(t);return Math.floor(te.fromMillis(n).as("days"))}function Fg(t,e,r){const n=[["years",(c,u)=>u.year-c.year],["quarters",(c,u)=>u.quarter-c.quarter+(u.year-c.year)*4],["months",(c,u)=>u.month-c.month+(u.year-c.year)*12],["weeks",(c,u)=>{const f=ao(c,u);return(f-f%7)/7}],["days",ao]],s={},a=t;let i,o;for(const[c,u]of n)r.indexOf(c)>=0&&(i=c,s[c]=u(t,e),o=a.plus(s),o>e?(s[c]--,t=a.plus(s),t>e&&(o=t,s[c]--,t=a.plus(s))):t=o);return[t,s,o,i]}function Lg(t,e,r,n){let[s,a,i,o]=Fg(t,e,r);const c=e-s,u=r.filter(d=>["hours","minutes","seconds","milliseconds"].indexOf(d)>=0);u.length===0&&(i<e&&(i=s.plus({[o]:1})),i!==s&&(a[o]=(a[o]||0)+c/(i-s)));const f=te.fromObject(a,n);return u.length>0?te.fromMillis(c,n).shiftTo(...u).plus(f):f}const Vg="missing Intl.DateTimeFormat.formatToParts support";function se(t,e=r=>r){return{regex:t,deser:([r])=>e(Ep(r))}}const $g=" ",Hc=`[ ${$g}]`,qc=new RegExp(Hc,"g");function Wg(t){return t.replace(/\./g,"\\.?").replace(qc,Hc)}function io(t){return t.replace(/\./g,"").replace(qc," ").toLowerCase()}function Ge(t,e){return t===null?null:{regex:RegExp(t.map(Wg).join("|")),deser:([r])=>t.findIndex(n=>io(r)===io(n))+e}}function oo(t,e){return{regex:t,deser:([,r,n])=>ts(r,n),groups:e}}function mn(t){return{regex:t,deser:([e])=>e}}function zg(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Zg(t,e){const r=Ye(e),n=Ye(e,"{2}"),s=Ye(e,"{3}"),a=Ye(e,"{4}"),i=Ye(e,"{6}"),o=Ye(e,"{1,2}"),c=Ye(e,"{1,3}"),u=Ye(e,"{1,6}"),f=Ye(e,"{1,9}"),d=Ye(e,"{2,4}"),m=Ye(e,"{4,6}"),p=x=>({regex:RegExp(zg(x.val)),deser:([v])=>v,literal:!0}),g=(x=>{if(t.literal)return p(x);switch(x.val){case"G":return Ge(e.eras("short"),0);case"GG":return Ge(e.eras("long"),0);case"y":return se(u);case"yy":return se(d,ra);case"yyyy":return se(a);case"yyyyy":return se(m);case"yyyyyy":return se(i);case"M":return se(o);case"MM":return se(n);case"MMM":return Ge(e.months("short",!0),1);case"MMMM":return Ge(e.months("long",!0),1);case"L":return se(o);case"LL":return se(n);case"LLL":return Ge(e.months("short",!1),1);case"LLLL":return Ge(e.months("long",!1),1);case"d":return se(o);case"dd":return se(n);case"o":return se(c);case"ooo":return se(s);case"HH":return se(n);case"H":return se(o);case"hh":return se(n);case"h":return se(o);case"mm":return se(n);case"m":return se(o);case"q":return se(o);case"qq":return se(n);case"s":return se(o);case"ss":return se(n);case"S":return se(c);case"SSS":return se(s);case"u":return mn(f);case"uu":return mn(o);case"uuu":return se(r);case"a":return Ge(e.meridiems(),0);case"kkkk":return se(a);case"kk":return se(d,ra);case"W":return se(o);case"WW":return se(n);case"E":case"c":return se(r);case"EEE":return Ge(e.weekdays("short",!1),1);case"EEEE":return Ge(e.weekdays("long",!1),1);case"ccc":return Ge(e.weekdays("short",!0),1);case"cccc":return Ge(e.weekdays("long",!0),1);case"Z":case"ZZ":return oo(new RegExp(`([+-]${o.source})(?::(${n.source}))?`),2);case"ZZZ":return oo(new RegExp(`([+-]${o.source})(${n.source})?`),2);case"z":return mn(/[a-z_+-/]{1,256}?/i);case" ":return mn(/[^\S\n\r]/);default:return p(x)}})(t)||{invalidReason:Vg};return g.token=t,g}const Bg={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function Ug(t,e,r){const{type:n,value:s}=t;if(n==="literal"){const c=/^\s+$/.test(s);return{literal:!c,val:c?" ":s}}const a=e[n];let i=n;n==="hour"&&(e.hour12!=null?i=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?i="hour12":i="hour24":i=r.hour12?"hour12":"hour24");let o=Bg[i];if(typeof o=="object"&&(o=o[a]),o)return{literal:!1,val:o}}function Hg(t){return[`^${t.map(r=>r.regex).reduce((r,n)=>`${r}(${n.source})`,"")}$`,t]}function qg(t,e,r){const n=t.match(e);if(n){const s={};let a=1;for(const i in r)if(gr(r,i)){const o=r[i],c=o.groups?o.groups+1:1;!o.literal&&o.token&&(s[o.token.val[0]]=o.deser(n.slice(a,a+c))),a+=c}return[n,s]}else return[n,{}]}function Yg(t){const e=a=>{switch(a){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let r=null,n;return Z(t.z)||(r=dt.create(t.z)),Z(t.Z)||(r||(r=new je(t.Z)),n=t.Z),Z(t.q)||(t.M=(t.q-1)*3+1),Z(t.h)||(t.h<12&&t.a===1?t.h+=12:t.h===12&&t.a===0&&(t.h=0)),t.G===0&&t.y&&(t.y=-t.y),Z(t.u)||(t.S=Aa(t.u)),[Object.keys(t).reduce((a,i)=>{const o=e(i);return o&&(a[o]=t[i]),a},{}),r,n]}let Ds=null;function Gg(){return Ds||(Ds=I.fromMillis(1555555555555)),Ds}function Xg(t,e){if(t.literal)return t;const r=Ce.macroTokenToFormatOpts(t.val),n=Jc(r,e);return n==null||n.includes(void 0)?t:n}function Yc(t,e){return Array.prototype.concat(...t.map(r=>Xg(r,e)))}class Gc{constructor(e,r){if(this.locale=e,this.format=r,this.tokens=Yc(Ce.parseFormat(r),e),this.units=this.tokens.map(n=>Zg(n,e)),this.disqualifyingUnit=this.units.find(n=>n.invalidReason),!this.disqualifyingUnit){const[n,s]=Hg(this.units);this.regex=RegExp(n,"i"),this.handlers=s}}explainFromTokens(e){if(this.isValid){const[r,n]=qg(e,this.regex,this.handlers),[s,a,i]=n?Yg(n):[null,null,void 0];if(gr(n,"a")&&gr(n,"H"))throw new lr("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:r,matches:n,result:s,zone:a,specificOffset:i}}else return{input:e,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function Xc(t,e,r){return new Gc(t,r).explainFromTokens(e)}function Jg(t,e,r){const{result:n,zone:s,specificOffset:a,invalidReason:i}=Xc(t,e,r);return[n,s,a,i]}function Jc(t,e){if(!t)return null;const n=Ce.create(e,t).dtFormatter(Gg()),s=n.formatToParts(),a=n.resolvedOptions();return s.map(i=>Ug(i,t,a))}const Rs="Invalid DateTime",lo=864e13;function Rr(t){return new Ke("unsupported zone",`the zone "${t.name}" is not supported`)}function As(t){return t.weekData===null&&(t.weekData=Rn(t.c)),t.weekData}function Ms(t){return t.localWeekData===null&&(t.localWeekData=Rn(t.c,t.loc.getMinDaysInFirstWeek(),t.loc.getStartOfWeek())),t.localWeekData}function Lt(t,e){const r={ts:t.ts,zone:t.zone,c:t.c,o:t.o,loc:t.loc,invalid:t.invalid};return new I({...r,...e,old:r})}function Kc(t,e,r){let n=t-e*60*1e3;const s=r.offset(n);if(e===s)return[n,e];n-=(s-e)*60*1e3;const a=r.offset(n);return s===a?[n,s]:[t-Math.min(s,a)*60*1e3,Math.max(s,a)]}function pn(t,e){t+=e*60*1e3;const r=new Date(t);return{year:r.getUTCFullYear(),month:r.getUTCMonth()+1,day:r.getUTCDate(),hour:r.getUTCHours(),minute:r.getUTCMinutes(),second:r.getUTCSeconds(),millisecond:r.getUTCMilliseconds()}}function Sn(t,e,r){return Kc(es(t),e,r)}function co(t,e){const r=t.o,n=t.c.year+Math.trunc(e.years),s=t.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,a={...t.c,year:n,month:s,day:Math.min(t.c.day,An(n,s))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},i=te.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),o=es(a);let[c,u]=Kc(o,r,t.zone);return i!==0&&(c+=i,u=t.zone.offset(c)),{ts:c,o:u}}function ar(t,e,r,n,s,a){const{setZone:i,zone:o}=r;if(t&&Object.keys(t).length!==0||e){const c=e||o,u=I.fromObject(t,{...r,zone:c,specificOffset:a});return i?u:u.setZone(o)}else return I.invalid(new Ke("unparsable",`the input "${s}" can't be parsed as ${n}`))}function gn(t,e,r=!0){return t.isValid?Ce.create(ae.create("en-US"),{allowZ:r,forceSimple:!0}).formatDateTimeFromString(t,e):null}function Is(t,e,r){const n=t.c.year>9999||t.c.year<0;let s="";if(n&&t.c.year>=0&&(s+="+"),s+=ge(t.c.year,n?6:4),r==="year")return s;if(e){if(s+="-",s+=ge(t.c.month),r==="month")return s;s+="-"}else if(s+=ge(t.c.month),r==="month")return s;return s+=ge(t.c.day),s}function uo(t,e,r,n,s,a,i){let o=!r||t.c.millisecond!==0||t.c.second!==0,c="";switch(i){case"day":case"month":case"year":break;default:if(c+=ge(t.c.hour),i==="hour")break;if(e){if(c+=":",c+=ge(t.c.minute),i==="minute")break;o&&(c+=":",c+=ge(t.c.second))}else{if(c+=ge(t.c.minute),i==="minute")break;o&&(c+=ge(t.c.second))}if(i==="second")break;o&&(!n||t.c.millisecond!==0)&&(c+=".",c+=ge(t.c.millisecond,3))}return s&&(t.isOffsetFixed&&t.offset===0&&!a?c+="Z":t.o<0?(c+="-",c+=ge(Math.trunc(-t.o/60)),c+=":",c+=ge(Math.trunc(-t.o%60))):(c+="+",c+=ge(Math.trunc(t.o/60)),c+=":",c+=ge(Math.trunc(t.o%60)))),a&&(c+="["+t.zone.ianaName+"]"),c}const Qc={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Kg={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Qg={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Nn=["year","month","day","hour","minute","second","millisecond"],ey=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],ty=["year","ordinal","hour","minute","second","millisecond"];function Cn(t){const e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[t.toLowerCase()];if(!e)throw new Ql(t);return e}function fo(t){switch(t.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return Cn(t)}}function ry(t){if(Ar===void 0&&(Ar=de.now()),t.type!=="iana")return t.offset(Ar);const e=t.name;let r=na.get(e);return r===void 0&&(r=t.offset(Ar),na.set(e,r)),r}function ho(t,e){const r=Ct(e.zone,de.defaultZone);if(!r.isValid)return I.invalid(Rr(r));const n=ae.fromObject(e);let s,a;if(Z(t.year))s=de.now();else{for(const c of Nn)Z(t[c])&&(t[c]=Qc[c]);const i=Cc(t)||_c(t);if(i)return I.invalid(i);const o=ry(r);[s,a]=Sn(t,o,r)}return new I({ts:s,zone:r,loc:n,o:a})}function mo(t,e,r){const n=Z(r.round)?!0:r.round,s=Z(r.rounding)?"trunc":r.rounding,a=(o,c)=>(o=Ma(o,n||r.calendary?0:2,r.calendary?"round":s),e.loc.clone(r).relFormatter(r).format(o,c)),i=o=>r.calendary?e.hasSame(t,o)?0:e.startOf(o).diff(t.startOf(o),o).get(o):e.diff(t,o).get(o);if(r.unit)return a(i(r.unit),r.unit);for(const o of r.units){const c=i(o);if(Math.abs(c)>=1)return a(c,o)}return a(t>e?-0:0,r.units[r.units.length-1])}function po(t){let e={},r;return t.length>0&&typeof t[t.length-1]=="object"?(e=t[t.length-1],r=Array.from(t).slice(0,t.length-1)):r=Array.from(t),[e,r]}let Ar;const na=new Map;class I{constructor(e){const r=e.zone||de.defaultZone;let n=e.invalid||(Number.isNaN(e.ts)?new Ke("invalid input"):null)||(r.isValid?null:Rr(r));this.ts=Z(e.ts)?de.now():e.ts;let s=null,a=null;if(!n)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(r))[s,a]=[e.old.c,e.old.o];else{const o=_t(e.o)&&!e.old?e.o:r.offset(this.ts);s=pn(this.ts,o),n=Number.isNaN(s.year)?new Ke("invalid input"):null,s=n?null:s,a=n?null:o}this._zone=r,this.loc=e.loc||ae.create(),this.invalid=n,this.weekData=null,this.localWeekData=null,this.c=s,this.o=a,this.isLuxonDateTime=!0}static now(){return new I({})}static local(){const[e,r]=po(arguments),[n,s,a,i,o,c,u]=r;return ho({year:n,month:s,day:a,hour:i,minute:o,second:c,millisecond:u},e)}static utc(){const[e,r]=po(arguments),[n,s,a,i,o,c,u]=r;return e.zone=je.utcInstance,ho({year:n,month:s,day:a,hour:i,minute:o,second:c,millisecond:u},e)}static fromJSDate(e,r={}){const n=Mp(e)?e.valueOf():NaN;if(Number.isNaN(n))return I.invalid("invalid input");const s=Ct(r.zone,de.defaultZone);return s.isValid?new I({ts:n,zone:s,loc:ae.fromObject(r)}):I.invalid(Rr(s))}static fromMillis(e,r={}){if(_t(e))return e<-lo||e>lo?I.invalid("Timestamp out of range"):new I({ts:e,zone:Ct(r.zone,de.defaultZone),loc:ae.fromObject(r)});throw new Ne(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,r={}){if(_t(e))return new I({ts:e*1e3,zone:Ct(r.zone,de.defaultZone),loc:ae.fromObject(r)});throw new Ne("fromSeconds requires a numerical input")}static fromObject(e,r={}){e=e||{};const n=Ct(r.zone,de.defaultZone);if(!n.isValid)return I.invalid(Rr(n));const s=ae.fromObject(r),a=Mn(e,fo),{minDaysInFirstWeek:i,startOfWeek:o}=Ji(a,s),c=de.now(),u=Z(r.specificOffset)?n.offset(c):r.specificOffset,f=!Z(a.ordinal),d=!Z(a.year),m=!Z(a.month)||!Z(a.day),p=d||m,y=a.weekYear||a.weekNumber;if((p||f)&&y)throw new lr("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(m&&f)throw new lr("Can't mix ordinal dates with month/day");const g=y||a.weekday&&!p;let x,v,S=pn(c,u);g?(x=ey,v=Kg,S=Rn(S,i,o)):f?(x=ty,v=Qg,S=Os(S)):(x=Nn,v=Qc);let C=!1;for(const L of x){const z=a[L];Z(z)?C?a[L]=v[L]:a[L]=S[L]:C=!0}const k=g?Dp(a,i,o):f?Rp(a):Cc(a),w=k||_c(a);if(w)return I.invalid(w);const j=g?Gi(a,i,o):f?Xi(a):a,[T,A]=Sn(j,u,n),$=new I({ts:T,zone:n,o:A,loc:s});return a.weekday&&p&&e.weekday!==$.weekday?I.invalid("mismatched weekday",`you can't specify both a weekday of ${a.weekday} and a date of ${$.toISO()}`):$.isValid?$:I.invalid($.invalid)}static fromISO(e,r={}){const[n,s]=Sg(e);return ar(n,s,r,"ISO 8601",e)}static fromRFC2822(e,r={}){const[n,s]=Ng(e);return ar(n,s,r,"RFC 2822",e)}static fromHTTP(e,r={}){const[n,s]=Cg(e);return ar(n,s,r,"HTTP",r)}static fromFormat(e,r,n={}){if(Z(e)||Z(r))throw new Ne("fromFormat requires an input string and a format");const{locale:s=null,numberingSystem:a=null}=n,i=ae.fromOpts({locale:s,numberingSystem:a,defaultToEN:!0}),[o,c,u,f]=Jg(i,e,r);return f?I.invalid(f):ar(o,c,n,`format ${r}`,e,u)}static fromString(e,r,n={}){return I.fromFormat(e,r,n)}static fromSQL(e,r={}){const[n,s]=Rg(e);return ar(n,s,r,"SQL",e)}static invalid(e,r=null){if(!e)throw new Ne("need to specify a reason the DateTime is invalid");const n=e instanceof Ke?e:new Ke(e,r);if(de.throwOnInvalid)throw new ap(n);return new I({invalid:n})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,r={}){const n=Jc(e,ae.fromObject(r));return n?n.map(s=>s?s.val:null).join(""):null}static expandFormat(e,r={}){return Yc(Ce.parseFormat(e),ae.fromObject(r)).map(s=>s.val).join("")}static resetCache(){Ar=void 0,na.clear()}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?As(this).weekYear:NaN}get weekNumber(){return this.isValid?As(this).weekNumber:NaN}get weekday(){return this.isValid?As(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?Ms(this).weekday:NaN}get localWeekNumber(){return this.isValid?Ms(this).weekNumber:NaN}get localWeekYear(){return this.isValid?Ms(this).weekYear:NaN}get ordinal(){return this.isValid?Os(this.c).ordinal:NaN}get monthShort(){return this.isValid?hn.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?hn.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?hn.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?hn.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const e=864e5,r=6e4,n=es(this.c),s=this.zone.offset(n-e),a=this.zone.offset(n+e),i=this.zone.offset(n-s*r),o=this.zone.offset(n-a*r);if(i===o)return[this];const c=n-i*r,u=n-o*r,f=pn(c,i),d=pn(u,o);return f.hour===d.hour&&f.minute===d.minute&&f.second===d.second&&f.millisecond===d.millisecond?[Lt(this,{ts:c}),Lt(this,{ts:u})]:[this]}get isInLeapYear(){return Yr(this.year)}get daysInMonth(){return An(this.year,this.month)}get daysInYear(){return this.isValid?dr(this.year):NaN}get weeksInWeekYear(){return this.isValid?Vr(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Vr(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:r,numberingSystem:n,calendar:s}=Ce.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:r,numberingSystem:n,outputCalendar:s}}toUTC(e=0,r={}){return this.setZone(je.instance(e),r)}toLocal(){return this.setZone(de.defaultZone)}setZone(e,{keepLocalTime:r=!1,keepCalendarTime:n=!1}={}){if(e=Ct(e,de.defaultZone),e.equals(this.zone))return this;if(e.isValid){let s=this.ts;if(r||n){const a=e.offset(this.ts),i=this.toObject();[s]=Sn(i,a,e)}return Lt(this,{ts:s,zone:e})}else return I.invalid(Rr(e))}reconfigure({locale:e,numberingSystem:r,outputCalendar:n}={}){const s=this.loc.clone({locale:e,numberingSystem:r,outputCalendar:n});return Lt(this,{loc:s})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const r=Mn(e,fo),{minDaysInFirstWeek:n,startOfWeek:s}=Ji(r,this.loc),a=!Z(r.weekYear)||!Z(r.weekNumber)||!Z(r.weekday),i=!Z(r.ordinal),o=!Z(r.year),c=!Z(r.month)||!Z(r.day),u=o||c,f=r.weekYear||r.weekNumber;if((u||i)&&f)throw new lr("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(c&&i)throw new lr("Can't mix ordinal dates with month/day");let d;a?d=Gi({...Rn(this.c,n,s),...r},n,s):Z(r.ordinal)?(d={...this.toObject(),...r},Z(r.day)&&(d.day=Math.min(An(d.year,d.month),d.day))):d=Xi({...Os(this.c),...r});const[m,p]=Sn(d,this.o,this.zone);return Lt(this,{ts:m,o:p})}plus(e){if(!this.isValid)return this;const r=te.fromDurationLike(e);return Lt(this,co(this,r))}minus(e){if(!this.isValid)return this;const r=te.fromDurationLike(e).negate();return Lt(this,co(this,r))}startOf(e,{useLocaleWeeks:r=!1}={}){if(!this.isValid)return this;const n={},s=te.normalizeUnit(e);switch(s){case"years":n.month=1;case"quarters":case"months":n.day=1;case"weeks":case"days":n.hour=0;case"hours":n.minute=0;case"minutes":n.second=0;case"seconds":n.millisecond=0;break}if(s==="weeks")if(r){const a=this.loc.getStartOfWeek(),{weekday:i}=this;i<a&&(n.weekNumber=this.weekNumber-1),n.weekday=a}else n.weekday=1;if(s==="quarters"){const a=Math.ceil(this.month/3);n.month=(a-1)*3+1}return this.set(n)}endOf(e,r){return this.isValid?this.plus({[e]:1}).startOf(e,r).minus(1):this}toFormat(e,r={}){return this.isValid?Ce.create(this.loc.redefaultToEN(r)).formatDateTimeFromString(this,e):Rs}toLocaleString(e=Dn,r={}){return this.isValid?Ce.create(this.loc.clone(r),e).formatDateTime(this):Rs}toLocaleParts(e={}){return this.isValid?Ce.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:r=!1,suppressMilliseconds:n=!1,includeOffset:s=!0,extendedZone:a=!1,precision:i="milliseconds"}={}){if(!this.isValid)return null;i=Cn(i);const o=e==="extended";let c=Is(this,o,i);return Nn.indexOf(i)>=3&&(c+="T"),c+=uo(this,o,r,n,s,a,i),c}toISODate({format:e="extended",precision:r="day"}={}){return this.isValid?Is(this,e==="extended",Cn(r)):null}toISOWeekDate(){return gn(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:r=!1,includeOffset:n=!0,includePrefix:s=!1,extendedZone:a=!1,format:i="extended",precision:o="milliseconds"}={}){return this.isValid?(o=Cn(o),(s&&Nn.indexOf(o)>=3?"T":"")+uo(this,i==="extended",r,e,n,a,o)):null}toRFC2822(){return gn(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return gn(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?Is(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:r=!1,includeOffsetSpace:n=!0}={}){let s="HH:mm:ss.SSS";return(r||e)&&(n&&(s+=" "),r?s+="z":e&&(s+="ZZ")),gn(this,s,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():Rs}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const r={...this.c};return e.includeConfig&&(r.outputCalendar=this.outputCalendar,r.numberingSystem=this.loc.numberingSystem,r.locale=this.loc.locale),r}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,r="milliseconds",n={}){if(!this.isValid||!e.isValid)return te.invalid("created by diffing an invalid DateTime");const s={locale:this.locale,numberingSystem:this.numberingSystem,...n},a=Ip(r).map(te.normalizeUnit),i=e.valueOf()>this.valueOf(),o=i?this:e,c=i?e:this,u=Lg(o,c,a,s);return i?u.negate():u}diffNow(e="milliseconds",r={}){return this.diff(I.now(),e,r)}until(e){return this.isValid?me.fromDateTimes(this,e):this}hasSame(e,r,n){if(!this.isValid)return!1;const s=e.valueOf(),a=this.setZone(e.zone,{keepLocalTime:!0});return a.startOf(r,n)<=s&&s<=a.endOf(r,n)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const r=e.base||I.fromObject({},{zone:this.zone}),n=e.padding?this<r?-e.padding:e.padding:0;let s=["years","months","days","hours","minutes","seconds"],a=e.unit;return Array.isArray(e.unit)&&(s=e.unit,a=void 0),mo(r,this.plus(n),{...e,numeric:"always",units:s,unit:a})}toRelativeCalendar(e={}){return this.isValid?mo(e.base||I.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(!e.every(I.isDateTime))throw new Ne("min requires all arguments be DateTimes");return Ki(e,r=>r.valueOf(),Math.min)}static max(...e){if(!e.every(I.isDateTime))throw new Ne("max requires all arguments be DateTimes");return Ki(e,r=>r.valueOf(),Math.max)}static fromFormatExplain(e,r,n={}){const{locale:s=null,numberingSystem:a=null}=n,i=ae.fromOpts({locale:s,numberingSystem:a,defaultToEN:!0});return Xc(i,e,r)}static fromStringExplain(e,r,n={}){return I.fromFormatExplain(e,r,n)}static buildFormatParser(e,r={}){const{locale:n=null,numberingSystem:s=null}=r,a=ae.fromOpts({locale:n,numberingSystem:s,defaultToEN:!0});return new Gc(a,e)}static fromFormatParser(e,r,n={}){if(Z(e)||Z(r))throw new Ne("fromFormatParser requires an input string and a format parser");const{locale:s=null,numberingSystem:a=null}=n,i=ae.fromOpts({locale:s,numberingSystem:a,defaultToEN:!0});if(!i.equals(r.locale))throw new Ne(`fromFormatParser called with a locale of ${i}, but the format parser was created for ${r.locale}`);const{result:o,zone:c,specificOffset:u,invalidReason:f}=r.explainFromTokens(e);return f?I.invalid(f):ar(o,c,n,`format ${r.format}`,e,u)}static get DATE_SHORT(){return Dn}static get DATE_MED(){return ec}static get DATE_MED_WITH_WEEKDAY(){return lp}static get DATE_FULL(){return tc}static get DATE_HUGE(){return rc}static get TIME_SIMPLE(){return nc}static get TIME_WITH_SECONDS(){return sc}static get TIME_WITH_SHORT_OFFSET(){return ac}static get TIME_WITH_LONG_OFFSET(){return ic}static get TIME_24_SIMPLE(){return oc}static get TIME_24_WITH_SECONDS(){return lc}static get TIME_24_WITH_SHORT_OFFSET(){return cc}static get TIME_24_WITH_LONG_OFFSET(){return uc}static get DATETIME_SHORT(){return dc}static get DATETIME_SHORT_WITH_SECONDS(){return fc}static get DATETIME_MED(){return hc}static get DATETIME_MED_WITH_SECONDS(){return mc}static get DATETIME_MED_WITH_WEEKDAY(){return cp}static get DATETIME_FULL(){return pc}static get DATETIME_FULL_WITH_SECONDS(){return gc}static get DATETIME_HUGE(){return yc}static get DATETIME_HUGE_WITH_SECONDS(){return vc}}function Or(t){if(I.isDateTime(t))return t;if(t&&t.valueOf&&_t(t.valueOf()))return I.fromJSDate(t);if(t&&typeof t=="object")return I.fromObject(t);throw new Ne(`Unknown datetime argument: ${t}, of type ${typeof t}`)}const In="Europe/Madrid";de.defaultZone=In;function Pn(t){return dt.isValidZone(t)}function Jr(t){if(t&&Pn(t))return t;const e=de.defaultZone.name||In;return Pn(e)?e:In}function ny(t){return Pn(t)?(de.defaultZone=t,!0):!1}function sy(t,e){const r=Jr(e);return typeof t=="string"?I.fromISO(t,{zone:r}):I.fromJSDate(t,{zone:r})}function eu(t,e){const r=Jr(e),n=I.isDateTime(t)?t.setZone(r):I.fromJSDate(t,{zone:r});return n.isValid?n.toISODate():null}function ay(t,e){const r=Jr(e),n=I.isDateTime(t)?t.setZone(r):I.fromJSDate(t,{zone:r});return n.isValid?n.toISO():null}const iy=["Do","Lu","Ma","Mi","Ju","Vi","Sa"],oy=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"];function ly(t,e,r){return I.fromObject({year:t,month:e,day:1},{zone:r}).daysInMonth??0}function cy(t,e,r){return I.fromObject({year:t,month:e,day:1},{zone:r}).weekday%7}function Ps(t,e){return t.hasSame(e,"day")}function Fs(t,e,r){return!!(e&&t<e||r&&t>r)}function uy(t){return t.toFormat("dd/LL/yyyy")}const ns=h.forwardRef(({value:t,defaultValue:e,onChange:r,disabled:n=!1,placeholder:s="Seleccionar fecha",min:a,max:i,className:o,isInvalid:c,timeZone:u},f)=>{const d=h.useMemo(()=>Jr(u),[u]),[m,p]=h.useState(!1),[y,g]=h.useState(e??null),[x,v]=h.useState(()=>{const D=t??e??new Date;return I.fromJSDate(D,{zone:d}).startOf("month")}),[S,C]=h.useState(null),k=t!==void 0,w=k?t:y,j=h.useMemo(()=>w?I.fromJSDate(w,{zone:d}):null,[w,d]),T=h.useMemo(()=>a?I.fromJSDate(a,{zone:d}).startOf("day"):null,[a,d]),A=h.useMemo(()=>i?I.fromJSDate(i,{zone:d}).startOf("day"):null,[i,d]),$=h.useRef(null),L=D=>{if(Fs(D,T,A))return;const ee=D.toJSDate();k||g(ee),r?.(ee),p(!1)},z=D=>{v(ee=>ee.plus({months:D}).startOf("month"))},B=D=>{v(ee=>ee.plus({years:D}).startOf("month"))},G=D=>{if(!m)return;const ee=S??j??I.now().setZone(d);let W=null;switch(D.key){case"ArrowLeft":D.preventDefault(),W=ee.minus({days:1});break;case"ArrowRight":D.preventDefault(),W=ee.plus({days:1});break;case"ArrowUp":D.preventDefault(),W=ee.minus({days:7});break;case"ArrowDown":D.preventDefault(),W=ee.plus({days:7});break;case"Enter":case" ":D.preventDefault(),S&&!Fs(S,T,A)&&L(S);return;case"Escape":D.preventDefault(),p(!1);return;case"Home":D.preventDefault(),W=ee.startOf("month");break;case"End":D.preventDefault(),W=ee.endOf("month");break;case"PageUp":D.preventDefault(),D.shiftKey?B(-1):z(-1);return;case"PageDown":D.preventDefault(),D.shiftKey?B(1):z(1);return;default:return}W&&(C(W),(W.month!==x.month||W.year!==x.year)&&v(W.startOf("month")))};h.useEffect(()=>{if(m){const D=j??I.now().setZone(d);C(D),v(D.startOf("month"))}},[m,d,j]);const Q=x.year,H=x.month,P=ly(Q,H,d),U=cy(Q,H,d),V=I.now().setZone(d),ie=!!j?.isValid,F=[];for(let D=0;D<U;D++)F.push(null);for(let D=1;D<=P;D++)F.push(D);return l.jsxs(tp,{open:m,onOpenChange:p,children:[l.jsx(rp,{asChild:!0,disabled:n,children:l.jsxs("button",{ref:f,type:"button",className:N("flex h-8 w-full items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent px-2.5 py-1 text-sm transition-[border-color,box-shadow,color,background-color] outline-none","focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50","disabled:cursor-not-allowed disabled:opacity-50","dark:bg-input/30 dark:hover:bg-input/50",!ie&&"text-muted-foreground",c&&"border-destructive focus-visible:border-destructive focus-visible:ring-destructive/20 dark:border-destructive/50 dark:focus-visible:ring-destructive/40",o),"aria-haspopup":"dialog","aria-expanded":m,children:[l.jsx("span",{children:ie&&j?uy(j):s}),l.jsx(J.Calendar,{className:"h-4 w-4 shrink-0 opacity-50"})]})}),l.jsx(np,{children:l.jsxs(sp,{ref:$,className:N("z-50 w-[18rem] rounded-xl bg-popover p-3 text-popover-foreground shadow-card-lg ring-1 ring-foreground/10 outline-none","transition-[opacity,transform] duration-100","data-[state=closed]:opacity-0 data-[state=closed]:scale-95","data-[state=open]:opacity-100 data-[state=open]:scale-100"),sideOffset:4,align:"start",onKeyDown:G,role:"dialog","aria-modal":"true","aria-label":"Calendario",children:[l.jsxs("div",{className:"flex items-center justify-between pb-2",children:[l.jsx("button",{type:"button",className:"inline-flex h-7 w-7 items-center justify-center rounded-md border border-border bg-background text-sm transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50",onClick:()=>z(-1),"aria-label":"Mes anterior",children:l.jsx(J.ChevronLeft,{className:"h-4 w-4"})}),l.jsxs("span",{className:"text-sm font-medium text-foreground",children:[oy[H-1]," ",Q]}),l.jsx("button",{type:"button",className:"inline-flex h-7 w-7 items-center justify-center rounded-md border border-border bg-background text-sm transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50",onClick:()=>z(1),"aria-label":"Mes siguiente",children:l.jsx(J.ChevronRight,{className:"h-4 w-4"})})]}),l.jsx("div",{className:"grid grid-cols-7 gap-1 pb-1",role:"row",children:iy.map(D=>l.jsx("span",{className:"flex h-8 w-8 items-center justify-center text-[11px] font-medium uppercase tracking-wide text-muted-foreground",role:"columnheader",children:D},D))}),l.jsx("div",{className:"grid grid-cols-7 gap-1",role:"grid",children:F.map((D,ee)=>{if(D===null)return l.jsx("span",{className:"h-8 w-8"},`empty-${ee}`);const W=x.set({day:D}).startOf("day"),oe=j?Ps(W,j):!1,ce=Ps(W,V),ve=Fs(W,T,A),Te=S?Ps(W,S):!1;return l.jsx("button",{type:"button",className:N("flex h-8 w-8 items-center justify-center rounded-md text-sm transition-colors outline-none","hover:bg-accent hover:text-accent-foreground","focus-visible:ring-3 focus-visible:ring-ring/50",oe&&"bg-primary text-primary-foreground hover:bg-primary/90",ce&&!oe&&"ring-1 ring-ring/40",ve&&"pointer-events-none opacity-30",Te&&!oe&&"bg-accent text-accent-foreground"),disabled:ve,onClick:()=>L(W),tabIndex:Te?0:-1,"aria-selected":!!oe,"aria-disabled":!!ve,children:D},D)})})]})})]})});ns.displayName="DatePicker";var ss="Dialog",[tu]=Un(ss),[dy,rt]=tu(ss),ru=t=>{const{__scopeDialog:e,children:r,open:n,defaultOpen:s,onOpenChange:a,modal:i=!0}=t,o=h.useRef(null),c=h.useRef(null),[u,f]=Ta({prop:n,defaultProp:s??!1,onChange:a,caller:ss});return l.jsx(dy,{scope:e,triggerRef:o,contentRef:c,contentId:xn(),titleId:xn(),descriptionId:xn(),open:u,onOpenChange:f,onOpenToggle:h.useCallback(()=>f(d=>!d),[f]),modal:i,children:r})};ru.displayName=ss;var nu="DialogTrigger",su=h.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,s=rt(nu,r),a=$e(e,s.triggerRef);return l.jsx(_e.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":$a(s.open),...n,ref:a,onClick:Re(t.onClick,s.onOpenToggle)})});su.displayName=nu;var La="DialogPortal",[fy,au]=tu(La,{forceMount:void 0}),iu=t=>{const{__scopeDialog:e,forceMount:r,children:n,container:s}=t,a=rt(La,e);return l.jsx(fy,{scope:e,forceMount:r,children:h.Children.map(n,i=>l.jsx(Nr,{present:r||a.open,children:l.jsx(_a,{asChild:!0,container:s,children:i})}))})};iu.displayName=La;var Fn="DialogOverlay",ou=h.forwardRef((t,e)=>{const r=au(Fn,t.__scopeDialog),{forceMount:n=r.forceMount,...s}=t,a=rt(Fn,t.__scopeDialog);return a.modal?l.jsx(Nr,{present:n||a.open,children:l.jsx(my,{...s,ref:e})}):null});ou.displayName=Fn;var hy=Zn("DialogOverlay.RemoveScroll"),my=h.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,s=rt(Fn,r);return l.jsx(ja,{as:hy,allowPinchZoom:!0,shards:[s.contentRef],children:l.jsx(_e.div,{"data-state":$a(s.open),...n,ref:e,style:{pointerEvents:"auto",...n.style}})})}),Bt="DialogContent",lu=h.forwardRef((t,e)=>{const r=au(Bt,t.__scopeDialog),{forceMount:n=r.forceMount,...s}=t,a=rt(Bt,t.__scopeDialog);return l.jsx(Nr,{present:n||a.open,children:a.modal?l.jsx(py,{...s,ref:e}):l.jsx(gy,{...s,ref:e})})});lu.displayName=Bt;var py=h.forwardRef((t,e)=>{const r=rt(Bt,t.__scopeDialog),n=h.useRef(null),s=$e(e,r.contentRef,n);return h.useEffect(()=>{const a=n.current;if(a)return Il(a)},[]),l.jsx(cu,{...t,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Re(t.onCloseAutoFocus,a=>{a.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:Re(t.onPointerDownOutside,a=>{const i=a.detail.originalEvent,o=i.button===0&&i.ctrlKey===!0;(i.button===2||o)&&a.preventDefault()}),onFocusOutside:Re(t.onFocusOutside,a=>a.preventDefault())})}),gy=h.forwardRef((t,e)=>{const r=rt(Bt,t.__scopeDialog),n=h.useRef(!1),s=h.useRef(!1);return l.jsx(cu,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{t.onCloseAutoFocus?.(a),a.defaultPrevented||(n.current||r.triggerRef.current?.focus(),a.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:a=>{t.onInteractOutside?.(a),a.defaultPrevented||(n.current=!0,a.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const i=a.target;r.triggerRef.current?.contains(i)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&s.current&&a.preventDefault()}})}),cu=h.forwardRef((t,e)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:a,...i}=t,o=rt(Bt,r),c=h.useRef(null),u=$e(e,c);return ll(),l.jsxs(l.Fragment,{children:[l.jsx(ya,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:a,children:l.jsx(ga,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":$a(o.open),...i,ref:u,onDismiss:()=>o.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(yy,{titleId:o.titleId}),l.jsx(xy,{contentRef:c,descriptionId:o.descriptionId})]})]})}),Va="DialogTitle",uu=h.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,s=rt(Va,r);return l.jsx(_e.h2,{id:s.titleId,...n,ref:e})});uu.displayName=Va;var du="DialogDescription",fu=h.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,s=rt(du,r);return l.jsx(_e.p,{id:s.descriptionId,...n,ref:e})});fu.displayName=du;var hu="DialogClose",mu=h.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,s=rt(hu,r);return l.jsx(_e.button,{type:"button",...n,ref:e,onClick:Re(t.onClick,()=>s.onOpenChange(!1))})});mu.displayName=hu;function $a(t){return t?"open":"closed"}var pu="DialogTitleWarning",[Zx,gu]=df(pu,{contentName:Bt,titleName:Va,docsSlug:"dialog"}),yy=({titleId:t})=>{const e=gu(pu),r=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
41
+ `)},zm=0,rr=[];function Wm(t){var e=h.useRef([]),r=h.useRef([0,0]),n=h.useRef(),s=h.useState(zm++)[0],a=h.useState(Vl)[0],i=h.useRef(t);h.useEffect(function(){i.current=t},[t]),h.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(s));var g=cm([t.lockRef.current],(t.shards||[]).map(Li),!0).filter(Boolean);return g.forEach(function(x){return x.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),g.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(s))})}}},[t.inert,t.lockRef.current,t.shards]);var o=h.useCallback(function(g,x){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!i.current.allowPinchZoom;var v=dn(g),S=r.current,C="deltaX"in g?g.deltaX:S[0]-v[0],k="deltaY"in g?g.deltaY:S[1]-v[1],w,j=g.target,T=Math.abs(C)>Math.abs(k)?"h":"v";if("touches"in g&&T==="h"&&j.type==="range")return!1;var A=window.getSelection(),$=A&&A.anchorNode,L=$?$===j||$.contains(j):!1;if(L)return!1;var W=Pi(T,j);if(!W)return!0;if(W?w=T:(w=T==="v"?"h":"v",W=Pi(T,j)),!W)return!1;if(!n.current&&"changedTouches"in g&&(C||k)&&(n.current=w),!w)return!0;var B=n.current||w;return Lm(B,x,g,B==="h"?C:k)},[]),c=h.useCallback(function(g){var x=g;if(!(!rr.length||rr[rr.length-1]!==a)){var v="deltaY"in x?Fi(x):dn(x),S=e.current.filter(function(w){return w.name===x.type&&(w.target===x.target||x.target===w.shadowParent)&&Vm(w.delta,v)})[0];if(S&&S.should){x.cancelable&&x.preventDefault();return}if(!S){var C=(i.current.shards||[]).map(Li).filter(Boolean).filter(function(w){return w.contains(x.target)}),k=C.length>0?o(x,C[0]):!i.current.noIsolation;k&&x.cancelable&&x.preventDefault()}}},[]),u=h.useCallback(function(g,x,v,S){var C={name:g,delta:x,target:v,should:S,shadowParent:Zm(v)};e.current.push(C),setTimeout(function(){e.current=e.current.filter(function(k){return k!==C})},1)},[]),f=h.useCallback(function(g){r.current=dn(g),n.current=void 0},[]),d=h.useCallback(function(g){u(g.type,Fi(g),g.target,o(g,t.lockRef.current))},[]),m=h.useCallback(function(g){u(g.type,dn(g),g.target,o(g,t.lockRef.current))},[]);h.useEffect(function(){return rr.push(a),t.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:m}),document.addEventListener("wheel",c,tr),document.addEventListener("touchmove",c,tr),document.addEventListener("touchstart",f,tr),function(){rr=rr.filter(function(g){return g!==a}),document.removeEventListener("wheel",c,tr),document.removeEventListener("touchmove",c,tr),document.removeEventListener("touchstart",f,tr)}},[]);var p=t.removeScrollBar,y=t.inert;return h.createElement(h.Fragment,null,y?h.createElement(a,{styles:$m(s)}):null,p?h.createElement(Dm,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function Zm(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const Bm=vm(Ll,Wm);var ja=h.forwardRef(function(t,e){return h.createElement(Xn,it({},t,{ref:e,sideCar:Bm}))});ja.classNames=Xn.classNames;var Jn="Popover",[Zl]=Un(Jn,[Nl]),Hr=Nl(),[Um,At]=Zl(Jn),Bl=t=>{const{__scopePopover:e,children:r,open:n,defaultOpen:s,onOpenChange:a,modal:i=!1}=t,o=Hr(e),c=h.useRef(null),[u,f]=h.useState(!1),[d,m]=Ta({prop:n,defaultProp:s??!1,onChange:a,caller:Jn});return l.jsx(Xh,{...o,children:l.jsx(Um,{scope:e,contentId:xn(),triggerRef:c,open:d,onOpenChange:m,onOpenToggle:h.useCallback(()=>m(p=>!p),[m]),hasCustomAnchor:u,onCustomAnchorAdd:h.useCallback(()=>f(!0),[]),onCustomAnchorRemove:h.useCallback(()=>f(!1),[]),modal:i,children:r})})};Bl.displayName=Jn;var Ul="PopoverAnchor",Hm=h.forwardRef((t,e)=>{const{__scopePopover:r,...n}=t,s=At(Ul,r),a=Hr(r),{onCustomAnchorAdd:i,onCustomAnchorRemove:o}=s;return h.useEffect(()=>(i(),()=>o()),[i,o]),l.jsx(Al,{...a,...n,ref:e})});Hm.displayName=Ul;var Hl="PopoverTrigger",ql=h.forwardRef((t,e)=>{const{__scopePopover:r,...n}=t,s=At(Hl,r),a=Hr(r),i=$e(e,s.triggerRef),o=l.jsx(_e.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Kl(s.open),...n,ref:i,onClick:Re(t.onClick,s.onOpenToggle)});return s.hasCustomAnchor?o:l.jsx(Al,{asChild:!0,...a,children:o})});ql.displayName=Hl;var Ea="PopoverPortal",[qm,Ym]=Zl(Ea,{forceMount:void 0}),Yl=t=>{const{__scopePopover:e,forceMount:r,children:n,container:s}=t,a=At(Ea,e);return l.jsx(qm,{scope:e,forceMount:r,children:l.jsx(Nr,{present:r||a.open,children:l.jsx(_a,{asChild:!0,container:s,children:n})})})};Yl.displayName=Ea;var pr="PopoverContent",Gl=h.forwardRef((t,e)=>{const r=Ym(pr,t.__scopePopover),{forceMount:n=r.forceMount,...s}=t,a=At(pr,t.__scopePopover);return l.jsx(Nr,{present:n||a.open,children:a.modal?l.jsx(Xm,{...s,ref:e}):l.jsx(Jm,{...s,ref:e})})});Gl.displayName=pr;var Gm=Zn("PopoverContent.RemoveScroll"),Xm=h.forwardRef((t,e)=>{const r=At(pr,t.__scopePopover),n=h.useRef(null),s=$e(e,n),a=h.useRef(!1);return h.useEffect(()=>{const i=n.current;if(i)return Il(i)},[]),l.jsx(ja,{as:Gm,allowPinchZoom:!0,children:l.jsx(Xl,{...t,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Re(t.onCloseAutoFocus,i=>{i.preventDefault(),a.current||r.triggerRef.current?.focus()}),onPointerDownOutside:Re(t.onPointerDownOutside,i=>{const o=i.detail.originalEvent,c=o.button===0&&o.ctrlKey===!0,u=o.button===2||c;a.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:Re(t.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),Jm=h.forwardRef((t,e)=>{const r=At(pr,t.__scopePopover),n=h.useRef(!1),s=h.useRef(!1);return l.jsx(Xl,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{t.onCloseAutoFocus?.(a),a.defaultPrevented||(n.current||r.triggerRef.current?.focus(),a.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:a=>{t.onInteractOutside?.(a),a.defaultPrevented||(n.current=!0,a.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const i=a.target;r.triggerRef.current?.contains(i)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&s.current&&a.preventDefault()}})}),Xl=h.forwardRef((t,e)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:i,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:f,...d}=t,m=At(pr,r),p=Hr(r);return ll(),l.jsx(ya,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:a,children:l.jsx(ga,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:f,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>m.onOpenChange(!1),children:l.jsx(Jh,{"data-state":Kl(m.open),role:"dialog",id:m.contentId,...p,...d,ref:e,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)"}})})})}),Jl="PopoverClose",Km=h.forwardRef((t,e)=>{const{__scopePopover:r,...n}=t,s=At(Jl,r);return l.jsx(_e.button,{type:"button",...n,ref:e,onClick:Re(t.onClick,()=>s.onOpenChange(!1))})});Km.displayName=Jl;var Qm="PopoverArrow",ep=h.forwardRef((t,e)=>{const{__scopePopover:r,...n}=t,s=Hr(r);return l.jsx(Kh,{...s,...n,ref:e})});ep.displayName=Qm;function Kl(t){return t?"open":"closed"}var tp=Bl,rp=ql,np=Yl,sp=Gl;class qt extends Error{}class ap extends qt{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class ip extends qt{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class op extends qt{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class lr extends qt{}class Ql extends qt{constructor(e){super(`Invalid unit ${e}`)}}class Ne extends qt{}class wt extends qt{constructor(){super("Zone is an abstract class")}}const E="numeric",tt="short",Fe="long",Dn={year:E,month:E,day:E},ec={year:E,month:tt,day:E},lp={year:E,month:tt,day:E,weekday:tt},tc={year:E,month:Fe,day:E},rc={year:E,month:Fe,day:E,weekday:Fe},nc={hour:E,minute:E},sc={hour:E,minute:E,second:E},ac={hour:E,minute:E,second:E,timeZoneName:tt},ic={hour:E,minute:E,second:E,timeZoneName:Fe},oc={hour:E,minute:E,hourCycle:"h23"},lc={hour:E,minute:E,second:E,hourCycle:"h23"},cc={hour:E,minute:E,second:E,hourCycle:"h23",timeZoneName:tt},uc={hour:E,minute:E,second:E,hourCycle:"h23",timeZoneName:Fe},dc={year:E,month:E,day:E,hour:E,minute:E},fc={year:E,month:E,day:E,hour:E,minute:E,second:E},hc={year:E,month:tt,day:E,hour:E,minute:E},mc={year:E,month:tt,day:E,hour:E,minute:E,second:E},cp={year:E,month:tt,day:E,weekday:tt,hour:E,minute:E},pc={year:E,month:Fe,day:E,hour:E,minute:E,timeZoneName:tt},gc={year:E,month:Fe,day:E,hour:E,minute:E,second:E,timeZoneName:tt},yc={year:E,month:Fe,day:E,weekday:Fe,hour:E,minute:E,timeZoneName:Fe},vc={year:E,month:Fe,day:E,weekday:Fe,hour:E,minute:E,second:E,timeZoneName:Fe};class qr{get type(){throw new wt}get name(){throw new wt}get ianaName(){return this.name}get isUniversal(){throw new wt}offsetName(e,r){throw new wt}formatOffset(e,r){throw new wt}offset(e){throw new wt}equals(e){throw new wt}get isValid(){throw new wt}}let Ts=null;class Kn extends qr{static get instance(){return Ts===null&&(Ts=new Kn),Ts}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:r,locale:n}){return Ec(e,r,n)}formatOffset(e,r){return Pr(this.offset(e),r)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}const qs=new Map;function up(t){let e=qs.get(t);return e===void 0&&(e=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),qs.set(t,e)),e}const dp={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function fp(t,e){const r=t.format(e).replace(/\u200E/g,""),n=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(r),[,s,a,i,o,c,u,f]=n;return[i,s,a,o,c,u,f]}function hp(t,e){const r=t.formatToParts(e),n=[];for(let s=0;s<r.length;s++){const{type:a,value:i}=r[s],o=dp[a];a==="era"?n[o]=i:Z(o)||(n[o]=parseInt(i,10))}return n}const js=new Map;class dt extends qr{static create(e){let r=js.get(e);return r===void 0&&js.set(e,r=new dt(e)),r}static resetCache(){js.clear(),qs.clear()}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch{return!1}}constructor(e){super(),this.zoneName=e,this.valid=dt.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:r,locale:n}){return Ec(e,r,n,this.name)}formatOffset(e,r){return Pr(this.offset(e),r)}offset(e){if(!this.valid)return NaN;const r=new Date(e);if(isNaN(r))return NaN;const n=up(this.name);let[s,a,i,o,c,u,f]=n.formatToParts?hp(n,r):fp(n,r);o==="BC"&&(s=-Math.abs(s)+1);const m=es({year:s,month:a,day:i,hour:c===24?0:c,minute:u,second:f,millisecond:0});let p=+r;const y=p%1e3;return p-=y>=0?y:1e3+y,(m-p)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let Vi={};function mp(t,e={}){const r=JSON.stringify([t,e]);let n=Vi[r];return n||(n=new Intl.ListFormat(t,e),Vi[r]=n),n}const Ys=new Map;function Gs(t,e={}){const r=JSON.stringify([t,e]);let n=Ys.get(r);return n===void 0&&(n=new Intl.DateTimeFormat(t,e),Ys.set(r,n)),n}const Xs=new Map;function pp(t,e={}){const r=JSON.stringify([t,e]);let n=Xs.get(r);return n===void 0&&(n=new Intl.NumberFormat(t,e),Xs.set(r,n)),n}const Js=new Map;function gp(t,e={}){const{base:r,...n}=e,s=JSON.stringify([t,n]);let a=Js.get(s);return a===void 0&&(a=new Intl.RelativeTimeFormat(t,e),Js.set(s,a)),a}let Dr=null;function yp(){return Dr||(Dr=new Intl.DateTimeFormat().resolvedOptions().locale,Dr)}const Ks=new Map;function xc(t){let e=Ks.get(t);return e===void 0&&(e=new Intl.DateTimeFormat(t).resolvedOptions(),Ks.set(t,e)),e}const Qs=new Map;function vp(t){let e=Qs.get(t);if(!e){const r=new Intl.Locale(t);e="getWeekInfo"in r?r.getWeekInfo():r.weekInfo,"minimalDays"in e||(e={...bc,...e}),Qs.set(t,e)}return e}function xp(t){const e=t.indexOf("-x-");e!==-1&&(t=t.substring(0,e));const r=t.indexOf("-u-");if(r===-1)return[t];{let n,s;try{n=Gs(t).resolvedOptions(),s=t}catch{const c=t.substring(0,r);n=Gs(c).resolvedOptions(),s=c}const{numberingSystem:a,calendar:i}=n;return[s,a,i]}}function bp(t,e,r){return(r||e)&&(t.includes("-u-")||(t+="-u"),r&&(t+=`-ca-${r}`),e&&(t+=`-nu-${e}`)),t}function wp(t){const e=[];for(let r=1;r<=12;r++){const n=I.utc(2009,r,1);e.push(t(n))}return e}function kp(t){const e=[];for(let r=1;r<=7;r++){const n=I.utc(2016,11,13+r);e.push(t(n))}return e}function fn(t,e,r,n){const s=t.listingMode();return s==="error"?null:s==="en"?r(e):n(e)}function Sp(t){return t.numberingSystem&&t.numberingSystem!=="latn"?!1:t.numberingSystem==="latn"||!t.locale||t.locale.startsWith("en")||xc(t.locale).numberingSystem==="latn"}class Np{constructor(e,r,n){this.padTo=n.padTo||0,this.floor=n.floor||!1;const{padTo:s,floor:a,...i}=n;if(!r||Object.keys(i).length>0){const o={useGrouping:!1,...n};n.padTo>0&&(o.minimumIntegerDigits=n.padTo),this.inf=pp(e,o)}}format(e){if(this.inf){const r=this.floor?Math.floor(e):e;return this.inf.format(r)}else{const r=this.floor?Math.floor(e):Ma(e,3);return ge(r,this.padTo)}}}class Cp{constructor(e,r,n){this.opts=n,this.originalZone=void 0;let s;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){const i=-1*(e.offset/60),o=i>=0?`Etc/GMT+${i}`:`Etc/GMT${i}`;e.offset!==0&&dt.create(o).valid?(s=o,this.dt=e):(s="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,s=e.zone.name):(s="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const a={...this.opts};a.timeZone=a.timeZone||s,this.dtf=Gs(r,a)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(r=>{if(r.type==="timeZoneName"){const n=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...r,value:n}}else return r}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class _p{constructor(e,r,n){this.opts={style:"long",...n},!r&&Tc()&&(this.rtf=gp(e,n))}format(e,r){return this.rtf?this.rtf.format(e,r):Yp(r,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,r){return this.rtf?this.rtf.formatToParts(e,r):[]}}const bc={firstDay:1,minimalDays:4,weekend:[6,7]};class ae{static fromOpts(e){return ae.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,r,n,s,a=!1){const i=e||de.defaultLocale,o=i||(a?"en-US":yp()),c=r||de.defaultNumberingSystem,u=n||de.defaultOutputCalendar,f=ta(s)||de.defaultWeekSettings;return new ae(o,c,u,f,i)}static resetCache(){Dr=null,Ys.clear(),Xs.clear(),Js.clear(),Ks.clear(),Qs.clear()}static fromObject({locale:e,numberingSystem:r,outputCalendar:n,weekSettings:s}={}){return ae.create(e,r,n,s)}constructor(e,r,n,s,a){const[i,o,c]=xp(e);this.locale=i,this.numberingSystem=r||o||null,this.outputCalendar=n||c||null,this.weekSettings=s,this.intl=bp(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=a,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=Sp(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),r=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&r?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:ae.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,ta(e.weekSettings)||this.weekSettings,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,r=!1){return fn(this,e,Rc,()=>{const n=this.intl==="ja"||this.intl.startsWith("ja-");r&=!n;const s=r?{month:e,day:"numeric"}:{month:e},a=r?"format":"standalone";if(!this.monthsCache[a][e]){const i=n?o=>this.dtFormatter(o,s).format():o=>this.extract(o,s,"month");this.monthsCache[a][e]=wp(i)}return this.monthsCache[a][e]})}weekdays(e,r=!1){return fn(this,e,Ic,()=>{const n=r?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},s=r?"format":"standalone";return this.weekdaysCache[s][e]||(this.weekdaysCache[s][e]=kp(a=>this.extract(a,n,"weekday"))),this.weekdaysCache[s][e]})}meridiems(){return fn(this,void 0,()=>Pc,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[I.utc(2016,11,13,9),I.utc(2016,11,13,19)].map(r=>this.extract(r,e,"dayperiod"))}return this.meridiemCache})}eras(e){return fn(this,e,Fc,()=>{const r={era:e};return this.eraCache[e]||(this.eraCache[e]=[I.utc(-40,1,1),I.utc(2017,1,1)].map(n=>this.extract(n,r,"era"))),this.eraCache[e]})}extract(e,r,n){const s=this.dtFormatter(e,r),a=s.formatToParts(),i=a.find(o=>o.type.toLowerCase()===n);return i?i.value:null}numberFormatter(e={}){return new Np(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,r={}){return new Cp(e,this.intl,r)}relFormatter(e={}){return new _p(this.intl,this.isEnglish(),e)}listFormatter(e={}){return mp(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||xc(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:jc()?vp(this.locale):bc}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let Es=null;class je extends qr{static get utcInstance(){return Es===null&&(Es=new je(0)),Es}static instance(e){return e===0?je.utcInstance:new je(e)}static parseSpecifier(e){if(e){const r=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(r)return new je(ts(r[1],r[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Pr(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Pr(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,r){return Pr(this.fixed,r)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class Tp extends qr{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Ct(t,e){if(Z(t)||t===null)return e;if(t instanceof qr)return t;if(Ap(t)){const r=t.toLowerCase();return r==="default"?e:r==="local"||r==="system"?Kn.instance:r==="utc"||r==="gmt"?je.utcInstance:je.parseSpecifier(r)||dt.create(t)}else return _t(t)?je.instance(t):typeof t=="object"&&"offset"in t&&typeof t.offset=="function"?t:new Tp(t)}const Oa={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},$i={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},jp=Oa.hanidec.replace(/[\[|\]]/g,"").split("");function Ep(t){let e=parseInt(t,10);if(isNaN(e)){e="";for(let r=0;r<t.length;r++){const n=t.charCodeAt(r);if(t[r].search(Oa.hanidec)!==-1)e+=jp.indexOf(t[r]);else for(const s in $i){const[a,i]=$i[s];n>=a&&n<=i&&(e+=n-a)}}return parseInt(e,10)}else return e}const ea=new Map;function Op(){ea.clear()}function Ye({numberingSystem:t},e=""){const r=t||"latn";let n=ea.get(r);n===void 0&&(n=new Map,ea.set(r,n));let s=n.get(e);return s===void 0&&(s=new RegExp(`${Oa[r]}${e}`),n.set(e,s)),s}let zi=()=>Date.now(),Wi="system",Zi=null,Bi=null,Ui=null,Hi=60,qi,Yi=null;class de{static get now(){return zi}static set now(e){zi=e}static set defaultZone(e){Wi=e}static get defaultZone(){return Ct(Wi,Kn.instance)}static get defaultLocale(){return Zi}static set defaultLocale(e){Zi=e}static get defaultNumberingSystem(){return Bi}static set defaultNumberingSystem(e){Bi=e}static get defaultOutputCalendar(){return Ui}static set defaultOutputCalendar(e){Ui=e}static get defaultWeekSettings(){return Yi}static set defaultWeekSettings(e){Yi=ta(e)}static get twoDigitCutoffYear(){return Hi}static set twoDigitCutoffYear(e){Hi=e%100}static get throwOnInvalid(){return qi}static set throwOnInvalid(e){qi=e}static resetCaches(){ae.resetCache(),dt.resetCache(),I.resetCache(),Op()}}class Ke{constructor(e,r){this.reason=e,this.explanation=r}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const wc=[0,31,59,90,120,151,181,212,243,273,304,334],kc=[0,31,60,91,121,152,182,213,244,274,305,335];function Ze(t,e){return new Ke("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${t}, which is invalid`)}function Da(t,e,r){const n=new Date(Date.UTC(t,e-1,r));t<100&&t>=0&&n.setUTCFullYear(n.getUTCFullYear()-1900);const s=n.getUTCDay();return s===0?7:s}function Sc(t,e,r){return r+(Yr(t)?kc:wc)[e-1]}function Nc(t,e){const r=Yr(t)?kc:wc,n=r.findIndex(a=>a<e),s=e-r[n];return{month:n+1,day:s}}function Ra(t,e){return(t-e+7)%7+1}function Rn(t,e=4,r=1){const{year:n,month:s,day:a}=t,i=Sc(n,s,a),o=Ra(Da(n,s,a),r);let c=Math.floor((i-o+14-e)/7),u;return c<1?(u=n-1,c=Vr(u,e,r)):c>Vr(n,e,r)?(u=n+1,c=1):u=n,{weekYear:u,weekNumber:c,weekday:o,...rs(t)}}function Gi(t,e=4,r=1){const{weekYear:n,weekNumber:s,weekday:a}=t,i=Ra(Da(n,1,e),r),o=dr(n);let c=s*7+a-i-7+e,u;c<1?(u=n-1,c+=dr(u)):c>o?(u=n+1,c-=dr(n)):u=n;const{month:f,day:d}=Nc(u,c);return{year:u,month:f,day:d,...rs(t)}}function Os(t){const{year:e,month:r,day:n}=t,s=Sc(e,r,n);return{year:e,ordinal:s,...rs(t)}}function Xi(t){const{year:e,ordinal:r}=t,{month:n,day:s}=Nc(e,r);return{year:e,month:n,day:s,...rs(t)}}function Ji(t,e){if(!Z(t.localWeekday)||!Z(t.localWeekNumber)||!Z(t.localWeekYear)){if(!Z(t.weekday)||!Z(t.weekNumber)||!Z(t.weekYear))throw new lr("Cannot mix locale-based week fields with ISO-based week fields");return Z(t.localWeekday)||(t.weekday=t.localWeekday),Z(t.localWeekNumber)||(t.weekNumber=t.localWeekNumber),Z(t.localWeekYear)||(t.weekYear=t.localWeekYear),delete t.localWeekday,delete t.localWeekNumber,delete t.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function Dp(t,e=4,r=1){const n=Qn(t.weekYear),s=Be(t.weekNumber,1,Vr(t.weekYear,e,r)),a=Be(t.weekday,1,7);return n?s?a?!1:Ze("weekday",t.weekday):Ze("week",t.weekNumber):Ze("weekYear",t.weekYear)}function Rp(t){const e=Qn(t.year),r=Be(t.ordinal,1,dr(t.year));return e?r?!1:Ze("ordinal",t.ordinal):Ze("year",t.year)}function Cc(t){const e=Qn(t.year),r=Be(t.month,1,12),n=Be(t.day,1,An(t.year,t.month));return e?r?n?!1:Ze("day",t.day):Ze("month",t.month):Ze("year",t.year)}function _c(t){const{hour:e,minute:r,second:n,millisecond:s}=t,a=Be(e,0,23)||e===24&&r===0&&n===0&&s===0,i=Be(r,0,59),o=Be(n,0,59),c=Be(s,0,999);return a?i?o?c?!1:Ze("millisecond",s):Ze("second",n):Ze("minute",r):Ze("hour",e)}function Z(t){return typeof t>"u"}function _t(t){return typeof t=="number"}function Qn(t){return typeof t=="number"&&t%1===0}function Ap(t){return typeof t=="string"}function Mp(t){return Object.prototype.toString.call(t)==="[object Date]"}function Tc(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function jc(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function Ip(t){return Array.isArray(t)?t:[t]}function Ki(t,e,r){if(t.length!==0)return t.reduce((n,s)=>{const a=[e(s),s];return n&&r(n[0],a[0])===n[0]?n:a},null)[1]}function Pp(t,e){return e.reduce((r,n)=>(r[n]=t[n],r),{})}function gr(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function ta(t){if(t==null)return null;if(typeof t!="object")throw new Ne("Week settings must be an object");if(!Be(t.firstDay,1,7)||!Be(t.minimalDays,1,7)||!Array.isArray(t.weekend)||t.weekend.some(e=>!Be(e,1,7)))throw new Ne("Invalid week settings");return{firstDay:t.firstDay,minimalDays:t.minimalDays,weekend:Array.from(t.weekend)}}function Be(t,e,r){return Qn(t)&&t>=e&&t<=r}function Fp(t,e){return t-e*Math.floor(t/e)}function ge(t,e=2){const r=t<0;let n;return r?n="-"+(""+-t).padStart(e,"0"):n=(""+t).padStart(e,"0"),n}function St(t){if(!(Z(t)||t===null||t===""))return parseInt(t,10)}function Ft(t){if(!(Z(t)||t===null||t===""))return parseFloat(t)}function Aa(t){if(!(Z(t)||t===null||t==="")){const e=parseFloat("0."+t)*1e3;return Math.floor(e)}}function Ma(t,e,r="round"){const n=10**e;switch(r){case"expand":return t>0?Math.ceil(t*n)/n:Math.floor(t*n)/n;case"trunc":return Math.trunc(t*n)/n;case"round":return Math.round(t*n)/n;case"floor":return Math.floor(t*n)/n;case"ceil":return Math.ceil(t*n)/n;default:throw new RangeError(`Value rounding ${r} is out of range`)}}function Yr(t){return t%4===0&&(t%100!==0||t%400===0)}function dr(t){return Yr(t)?366:365}function An(t,e){const r=Fp(e-1,12)+1,n=t+(e-r)/12;return r===2?Yr(n)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][r-1]}function es(t){let e=Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second,t.millisecond);return t.year<100&&t.year>=0&&(e=new Date(e),e.setUTCFullYear(t.year,t.month-1,t.day)),+e}function Qi(t,e,r){return-Ra(Da(t,1,e),r)+e-1}function Vr(t,e=4,r=1){const n=Qi(t,e,r),s=Qi(t+1,e,r);return(dr(t)-n+s)/7}function ra(t){return t>99?t:t>de.twoDigitCutoffYear?1900+t:2e3+t}function Ec(t,e,r,n=null){const s=new Date(t),a={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};n&&(a.timeZone=n);const i={timeZoneName:e,...a},o=new Intl.DateTimeFormat(r,i).formatToParts(s).find(c=>c.type.toLowerCase()==="timezonename");return o?o.value:null}function ts(t,e){let r=parseInt(t,10);Number.isNaN(r)&&(r=0);const n=parseInt(e,10)||0,s=r<0||Object.is(r,-0)?-n:n;return r*60+s}function Oc(t){const e=Number(t);if(typeof t=="boolean"||t===""||!Number.isFinite(e))throw new Ne(`Invalid unit value ${t}`);return e}function Mn(t,e){const r={};for(const n in t)if(gr(t,n)){const s=t[n];if(s==null)continue;r[e(n)]=Oc(s)}return r}function Pr(t,e){const r=Math.trunc(Math.abs(t/60)),n=Math.trunc(Math.abs(t%60)),s=t>=0?"+":"-";switch(e){case"short":return`${s}${ge(r,2)}:${ge(n,2)}`;case"narrow":return`${s}${r}${n>0?`:${n}`:""}`;case"techie":return`${s}${ge(r,2)}${ge(n,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function rs(t){return Pp(t,["hour","minute","second","millisecond"])}const Lp=["January","February","March","April","May","June","July","August","September","October","November","December"],Dc=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Vp=["J","F","M","A","M","J","J","A","S","O","N","D"];function Rc(t){switch(t){case"narrow":return[...Vp];case"short":return[...Dc];case"long":return[...Lp];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const Ac=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Mc=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],$p=["M","T","W","T","F","S","S"];function Ic(t){switch(t){case"narrow":return[...$p];case"short":return[...Mc];case"long":return[...Ac];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Pc=["AM","PM"],zp=["Before Christ","Anno Domini"],Wp=["BC","AD"],Zp=["B","A"];function Fc(t){switch(t){case"narrow":return[...Zp];case"short":return[...Wp];case"long":return[...zp];default:return null}}function Bp(t){return Pc[t.hour<12?0:1]}function Up(t,e){return Ic(e)[t.weekday-1]}function Hp(t,e){return Rc(e)[t.month-1]}function qp(t,e){return Fc(e)[t.year<0?0:1]}function Yp(t,e,r="always",n=!1){const s={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},a=["hours","minutes","seconds"].indexOf(t)===-1;if(r==="auto"&&a){const d=t==="days";switch(e){case 1:return d?"tomorrow":`next ${s[t][0]}`;case-1:return d?"yesterday":`last ${s[t][0]}`;case 0:return d?"today":`this ${s[t][0]}`}}const i=Object.is(e,-0)||e<0,o=Math.abs(e),c=o===1,u=s[t],f=n?c?u[1]:u[2]||u[1]:c?s[t][0]:t;return i?`${o} ${f} ago`:`in ${o} ${f}`}function eo(t,e){let r="";for(const n of t)n.literal?r+=n.val:r+=e(n.val);return r}const Gp={D:Dn,DD:ec,DDD:tc,DDDD:rc,t:nc,tt:sc,ttt:ac,tttt:ic,T:oc,TT:lc,TTT:cc,TTTT:uc,f:dc,ff:hc,fff:pc,ffff:yc,F:fc,FF:mc,FFF:gc,FFFF:vc};class Ce{static create(e,r={}){return new Ce(e,r)}static parseFormat(e){let r=null,n="",s=!1;const a=[];for(let i=0;i<e.length;i++){const o=e.charAt(i);o==="'"?((n.length>0||s)&&a.push({literal:s||/^\s+$/.test(n),val:n===""?"'":n}),r=null,n="",s=!s):s||o===r?n+=o:(n.length>0&&a.push({literal:/^\s+$/.test(n),val:n}),n=o,r=o)}return n.length>0&&a.push({literal:s||/^\s+$/.test(n),val:n}),a}static macroTokenToFormatOpts(e){return Gp[e]}constructor(e,r){this.opts=r,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,r){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...r}).format()}dtFormatter(e,r={}){return this.loc.dtFormatter(e,{...this.opts,...r})}formatDateTime(e,r){return this.dtFormatter(e,r).format()}formatDateTimeParts(e,r){return this.dtFormatter(e,r).formatToParts()}formatInterval(e,r){return this.dtFormatter(e.start,r).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,r){return this.dtFormatter(e,r).resolvedOptions()}num(e,r=0,n=void 0){if(this.opts.forceSimple)return ge(e,r);const s={...this.opts};return r>0&&(s.padTo=r),n&&(s.signDisplay=n),this.loc.numberFormatter(s).format(e)}formatDateTimeFromString(e,r){const n=this.loc.listingMode()==="en",s=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",a=(p,y)=>this.loc.extract(e,p,y),i=p=>e.isOffsetFixed&&e.offset===0&&p.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,p.format):"",o=()=>n?Bp(e):a({hour:"numeric",hourCycle:"h12"},"dayperiod"),c=(p,y)=>n?Hp(e,p):a(y?{month:p}:{month:p,day:"numeric"},"month"),u=(p,y)=>n?Up(e,p):a(y?{weekday:p}:{weekday:p,month:"long",day:"numeric"},"weekday"),f=p=>{const y=Ce.macroTokenToFormatOpts(p);return y?this.formatWithSystemDefault(e,y):p},d=p=>n?qp(e,p):a({era:p},"era"),m=p=>{switch(p){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return i({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return i({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return i({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return o();case"d":return s?a({day:"numeric"},"day"):this.num(e.day);case"dd":return s?a({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return s?a({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return s?a({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return c("short",!0);case"LLLL":return c("long",!0);case"LLLLL":return c("narrow",!0);case"M":return s?a({month:"numeric"},"month"):this.num(e.month);case"MM":return s?a({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return c("short",!1);case"MMMM":return c("long",!1);case"MMMMM":return c("narrow",!1);case"y":return s?a({year:"numeric"},"year"):this.num(e.year);case"yy":return s?a({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return s?a({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return s?a({year:"numeric"},"year"):this.num(e.year,6);case"G":return d("short");case"GG":return d("long");case"GGGGG":return d("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return f(p)}};return eo(Ce.parseFormat(r),m)}formatDurationFromString(e,r){const n=this.opts.signMode==="negativeLargestOnly"?-1:1,s=f=>{switch(f[0]){case"S":return"milliseconds";case"s":return"seconds";case"m":return"minutes";case"h":return"hours";case"d":return"days";case"w":return"weeks";case"M":return"months";case"y":return"years";default:return null}},a=(f,d)=>m=>{const p=s(m);if(p){const y=d.isNegativeDuration&&p!==d.largestUnit?n:1;let g;return this.opts.signMode==="negativeLargestOnly"&&p!==d.largestUnit?g="never":this.opts.signMode==="all"?g="always":g="auto",this.num(f.get(p)*y,m.length,g)}else return m},i=Ce.parseFormat(r),o=i.reduce((f,{literal:d,val:m})=>d?f:f.concat(m),[]),c=e.shiftTo(...o.map(s).filter(f=>f)),u={isNegativeDuration:c<0,largestUnit:Object.keys(c.values)[0]};return eo(i,a(c,u))}}const Lc=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Cr(...t){const e=t.reduce((r,n)=>r+n.source,"");return RegExp(`^${e}$`)}function _r(...t){return e=>t.reduce(([r,n,s],a)=>{const[i,o,c]=a(e,s);return[{...r,...i},o||n,c]},[{},null,1]).slice(0,2)}function Tr(t,...e){if(t==null)return[null,null];for(const[r,n]of e){const s=r.exec(t);if(s)return n(s)}return[null,null]}function Vc(...t){return(e,r)=>{const n={};let s;for(s=0;s<t.length;s++)n[t[s]]=St(e[r+s]);return[n,null,r+s]}}const $c=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,Xp=`(?:${$c.source}?(?:\\[(${Lc.source})\\])?)?`,Ia=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,zc=RegExp(`${Ia.source}${Xp}`),Pa=RegExp(`(?:[Tt]${zc.source})?`),Jp=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Kp=/(\d{4})-?W(\d\d)(?:-?(\d))?/,Qp=/(\d{4})-?(\d{3})/,eg=Vc("weekYear","weekNumber","weekDay"),tg=Vc("year","ordinal"),rg=/(\d{4})-(\d\d)-(\d\d)/,Wc=RegExp(`${Ia.source} ?(?:${$c.source}|(${Lc.source}))?`),ng=RegExp(`(?: ${Wc.source})?`);function fr(t,e,r){const n=t[e];return Z(n)?r:St(n)}function sg(t,e){return[{year:fr(t,e),month:fr(t,e+1,1),day:fr(t,e+2,1)},null,e+3]}function jr(t,e){return[{hours:fr(t,e,0),minutes:fr(t,e+1,0),seconds:fr(t,e+2,0),milliseconds:Aa(t[e+3])},null,e+4]}function Gr(t,e){const r=!t[e]&&!t[e+1],n=ts(t[e+1],t[e+2]),s=r?null:je.instance(n);return[{},s,e+3]}function Xr(t,e){const r=t[e]?dt.create(t[e]):null;return[{},r,e+1]}const ag=RegExp(`^T?${Ia.source}$`),ig=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function og(t){const[e,r,n,s,a,i,o,c,u]=t,f=e[0]==="-",d=c&&c[0]==="-",m=(p,y=!1)=>p!==void 0&&(y||p&&f)?-p:p;return[{years:m(Ft(r)),months:m(Ft(n)),weeks:m(Ft(s)),days:m(Ft(a)),hours:m(Ft(i)),minutes:m(Ft(o)),seconds:m(Ft(c),c==="-0"),milliseconds:m(Aa(u),d)}]}const lg={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Fa(t,e,r,n,s,a,i){const o={year:e.length===2?ra(St(e)):St(e),month:Dc.indexOf(r)+1,day:St(n),hour:St(s),minute:St(a)};return i&&(o.second=St(i)),t&&(o.weekday=t.length>3?Ac.indexOf(t)+1:Mc.indexOf(t)+1),o}const cg=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function ug(t){const[,e,r,n,s,a,i,o,c,u,f,d]=t,m=Fa(e,s,n,r,a,i,o);let p;return c?p=lg[c]:u?p=0:p=ts(f,d),[m,new je(p)]}function dg(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const fg=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,hg=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,mg=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function to(t){const[,e,r,n,s,a,i,o]=t;return[Fa(e,s,n,r,a,i,o),je.utcInstance]}function pg(t){const[,e,r,n,s,a,i,o]=t;return[Fa(e,o,r,n,s,a,i),je.utcInstance]}const gg=Cr(Jp,Pa),yg=Cr(Kp,Pa),vg=Cr(Qp,Pa),xg=Cr(zc),Zc=_r(sg,jr,Gr,Xr),bg=_r(eg,jr,Gr,Xr),wg=_r(tg,jr,Gr,Xr),kg=_r(jr,Gr,Xr);function Sg(t){return Tr(t,[gg,Zc],[yg,bg],[vg,wg],[xg,kg])}function Ng(t){return Tr(dg(t),[cg,ug])}function Cg(t){return Tr(t,[fg,to],[hg,to],[mg,pg])}function _g(t){return Tr(t,[ig,og])}const Tg=_r(jr);function jg(t){return Tr(t,[ag,Tg])}const Eg=Cr(rg,ng),Og=Cr(Wc),Dg=_r(jr,Gr,Xr);function Rg(t){return Tr(t,[Eg,Zc],[Og,Dg])}const ro="Invalid Duration",Bc={weeks:{days:7,hours:168,minutes:10080,seconds:10080*60,milliseconds:10080*60*1e3},days:{hours:24,minutes:1440,seconds:1440*60,milliseconds:1440*60*1e3},hours:{minutes:60,seconds:3600,milliseconds:3600*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},Ag={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:2184*60,seconds:2184*60*60,milliseconds:2184*60*60*1e3},months:{weeks:4,days:30,hours:720,minutes:720*60,seconds:720*60*60,milliseconds:720*60*60*1e3},...Bc},We=146097/400,nr=146097/4800,Mg={years:{quarters:4,months:12,weeks:We/7,days:We,hours:We*24,minutes:We*24*60,seconds:We*24*60*60,milliseconds:We*24*60*60*1e3},quarters:{months:3,weeks:We/28,days:We/4,hours:We*24/4,minutes:We*24*60/4,seconds:We*24*60*60/4,milliseconds:We*24*60*60*1e3/4},months:{weeks:nr/7,days:nr,hours:nr*24,minutes:nr*24*60,seconds:nr*24*60*60,milliseconds:nr*24*60*60*1e3},...Bc},Vt=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Ig=Vt.slice(0).reverse();function mt(t,e,r=!1){const n={values:r?e.values:{...t.values,...e.values||{}},loc:t.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||t.conversionAccuracy,matrix:e.matrix||t.matrix};return new te(n)}function Uc(t,e){let r=e.milliseconds??0;for(const n of Ig.slice(1))e[n]&&(r+=e[n]*t[n].milliseconds);return r}function no(t,e){const r=Uc(t,e)<0?-1:1;Vt.reduceRight((n,s)=>{if(Z(e[s]))return n;if(n){const a=e[n]*r,i=t[s][n],o=Math.floor(a/i);e[s]+=o*r,e[n]-=o*i*r}return s},null),Vt.reduce((n,s)=>{if(Z(e[s]))return n;if(n){const a=e[n]%1;e[n]-=a,e[s]+=a*t[n][s]}return s},null)}function so(t){const e={};for(const[r,n]of Object.entries(t))n!==0&&(e[r]=n);return e}class te{constructor(e){const r=e.conversionAccuracy==="longterm"||!1;let n=r?Mg:Ag;e.matrix&&(n=e.matrix),this.values=e.values,this.loc=e.loc||ae.create(),this.conversionAccuracy=r?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=n,this.isLuxonDuration=!0}static fromMillis(e,r){return te.fromObject({milliseconds:e},r)}static fromObject(e,r={}){if(e==null||typeof e!="object")throw new Ne(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new te({values:Mn(e,te.normalizeUnit),loc:ae.fromObject(r),conversionAccuracy:r.conversionAccuracy,matrix:r.matrix})}static fromDurationLike(e){if(_t(e))return te.fromMillis(e);if(te.isDuration(e))return e;if(typeof e=="object")return te.fromObject(e);throw new Ne(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,r){const[n]=_g(e);return n?te.fromObject(n,r):te.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,r){const[n]=jg(e);return n?te.fromObject(n,r):te.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,r=null){if(!e)throw new Ne("need to specify a reason the Duration is invalid");const n=e instanceof Ke?e:new Ke(e,r);if(de.throwOnInvalid)throw new op(n);return new te({invalid:n})}static normalizeUnit(e){const r={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!r)throw new Ql(e);return r}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,r={}){const n={...r,floor:r.round!==!1&&r.floor!==!1};return this.isValid?Ce.create(this.loc,n).formatDurationFromString(this,e):ro}toHuman(e={}){if(!this.isValid)return ro;const r=e.showZeros!==!1,n=Vt.map(s=>{const a=this.values[s];return Z(a)||a===0&&!r?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:s.slice(0,-1)}).format(a)}).filter(s=>s);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=Ma(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const r=this.toMillis();return r<0||r>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},I.fromMillis(r,{zone:"UTC"}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?Uc(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const r=te.fromDurationLike(e),n={};for(const s of Vt)(gr(r.values,s)||gr(this.values,s))&&(n[s]=r.get(s)+this.get(s));return mt(this,{values:n},!0)}minus(e){if(!this.isValid)return this;const r=te.fromDurationLike(e);return this.plus(r.negate())}mapUnits(e){if(!this.isValid)return this;const r={};for(const n of Object.keys(this.values))r[n]=Oc(e(this.values[n],n));return mt(this,{values:r},!0)}get(e){return this[te.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const r={...this.values,...Mn(e,te.normalizeUnit)};return mt(this,{values:r})}reconfigure({locale:e,numberingSystem:r,conversionAccuracy:n,matrix:s}={}){const i={loc:this.loc.clone({locale:e,numberingSystem:r}),matrix:s,conversionAccuracy:n};return mt(this,i)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return no(this.matrix,e),mt(this,{values:e},!0)}rescale(){if(!this.isValid)return this;const e=so(this.normalize().shiftToAll().toObject());return mt(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(i=>te.normalizeUnit(i));const r={},n={},s=this.toObject();let a;for(const i of Vt)if(e.indexOf(i)>=0){a=i;let o=0;for(const u in n)o+=this.matrix[u][i]*n[u],n[u]=0;_t(s[i])&&(o+=s[i]);const c=Math.trunc(o);r[i]=c,n[i]=(o*1e3-c*1e3)/1e3}else _t(s[i])&&(n[i]=s[i]);for(const i in n)n[i]!==0&&(r[a]+=i===a?n[i]:n[i]/this.matrix[a][i]);return no(this.matrix,r),mt(this,{values:r},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const r of Object.keys(this.values))e[r]=this.values[r]===0?0:-this.values[r];return mt(this,{values:e},!0)}removeZeros(){if(!this.isValid)return this;const e=so(this.values);return mt(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function r(n,s){return n===void 0||n===0?s===void 0||s===0:n===s}for(const n of Vt)if(!r(this.values[n],e.values[n]))return!1;return!0}}const sr="Invalid Interval";function Pg(t,e){return!t||!t.isValid?me.invalid("missing or invalid start"):!e||!e.isValid?me.invalid("missing or invalid end"):e<t?me.invalid("end before start",`The end of an interval must be after its start, but you had start=${t.toISO()} and end=${e.toISO()}`):null}class me{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,r=null){if(!e)throw new Ne("need to specify a reason the Interval is invalid");const n=e instanceof Ke?e:new Ke(e,r);if(de.throwOnInvalid)throw new ip(n);return new me({invalid:n})}static fromDateTimes(e,r){const n=Or(e),s=Or(r),a=Pg(n,s);return a??new me({start:n,end:s})}static after(e,r){const n=te.fromDurationLike(r),s=Or(e);return me.fromDateTimes(s,s.plus(n))}static before(e,r){const n=te.fromDurationLike(r),s=Or(e);return me.fromDateTimes(s.minus(n),s)}static fromISO(e,r){const[n,s]=(e||"").split("/",2);if(n&&s){let a,i;try{a=I.fromISO(n,r),i=a.isValid}catch{i=!1}let o,c;try{o=I.fromISO(s,r),c=o.isValid}catch{c=!1}if(i&&c)return me.fromDateTimes(a,o);if(i){const u=te.fromISO(s,r);if(u.isValid)return me.after(a,u)}else if(c){const u=te.fromISO(n,r);if(u.isValid)return me.before(o,u)}}return me.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e="milliseconds"){return this.isValid?this.toDuration(e).get(e):NaN}count(e="milliseconds",r){if(!this.isValid)return NaN;const n=this.start.startOf(e,r);let s;return r?.useLocaleWeeks?s=this.end.reconfigure({locale:n.locale}):s=this.end,s=s.startOf(e,r),Math.floor(s.diff(n,e).get(e))+(s.valueOf()!==this.end.valueOf())}hasSame(e){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,e):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return this.isValid?this.s>e:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:r}={}){return this.isValid?me.fromDateTimes(e||this.s,r||this.e):this}splitAt(...e){if(!this.isValid)return[];const r=e.map(Or).filter(i=>this.contains(i)).sort((i,o)=>i.toMillis()-o.toMillis()),n=[];let{s}=this,a=0;for(;s<this.e;){const i=r[a]||this.e,o=+i>+this.e?this.e:i;n.push(me.fromDateTimes(s,o)),s=o,a+=1}return n}splitBy(e){const r=te.fromDurationLike(e);if(!this.isValid||!r.isValid||r.as("milliseconds")===0)return[];let{s:n}=this,s=1,a;const i=[];for(;n<this.e;){const o=this.start.plus(r.mapUnits(c=>c*s));a=+o>+this.e?this.e:o,i.push(me.fromDateTimes(n,a)),n=a,s+=1}return i}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s<e.e}abutsStart(e){return this.isValid?+this.e==+e.s:!1}abutsEnd(e){return this.isValid?+e.e==+this.s:!1}engulfs(e){return this.isValid?this.s<=e.s&&this.e>=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const r=this.s>e.s?this.s:e.s,n=this.e<e.e?this.e:e.e;return r>=n?null:me.fromDateTimes(r,n)}union(e){if(!this.isValid)return this;const r=this.s<e.s?this.s:e.s,n=this.e>e.e?this.e:e.e;return me.fromDateTimes(r,n)}static merge(e){const[r,n]=e.sort((s,a)=>s.s-a.s).reduce(([s,a],i)=>a?a.overlaps(i)||a.abutsStart(i)?[s,a.union(i)]:[s.concat([a]),i]:[s,i],[[],null]);return n&&r.push(n),r}static xor(e){let r=null,n=0;const s=[],a=e.map(c=>[{time:c.s,type:"s"},{time:c.e,type:"e"}]),i=Array.prototype.concat(...a),o=i.sort((c,u)=>c.time-u.time);for(const c of o)n+=c.type==="s"?1:-1,n===1?r=c.time:(r&&+r!=+c.time&&s.push(me.fromDateTimes(r,c.time)),r=null);return me.merge(s)}difference(...e){return me.xor([this].concat(e)).map(r=>this.intersection(r)).filter(r=>r&&!r.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:sr}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=Dn,r={}){return this.isValid?Ce.create(this.s.loc.clone(r),e).formatInterval(this):sr}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:sr}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:sr}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:sr}toFormat(e,{separator:r=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${r}${this.e.toFormat(e)}`:sr}toDuration(e,r){return this.isValid?this.e.diff(this.s,e,r):te.invalid(this.invalidReason)}mapEndpoints(e){return me.fromDateTimes(e(this.s),e(this.e))}}class hn{static hasDST(e=de.defaultZone){const r=I.now().setZone(e).set({month:12});return!e.isUniversal&&r.offset!==r.set({month:6}).offset}static isValidIANAZone(e){return dt.isValidZone(e)}static normalizeZone(e){return Ct(e,de.defaultZone)}static getStartOfWeek({locale:e=null,locObj:r=null}={}){return(r||ae.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:r=null}={}){return(r||ae.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:r=null}={}){return(r||ae.create(e)).getWeekendDays().slice()}static months(e="long",{locale:r=null,numberingSystem:n=null,locObj:s=null,outputCalendar:a="gregory"}={}){return(s||ae.create(r,n,a)).months(e)}static monthsFormat(e="long",{locale:r=null,numberingSystem:n=null,locObj:s=null,outputCalendar:a="gregory"}={}){return(s||ae.create(r,n,a)).months(e,!0)}static weekdays(e="long",{locale:r=null,numberingSystem:n=null,locObj:s=null}={}){return(s||ae.create(r,n,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:r=null,numberingSystem:n=null,locObj:s=null}={}){return(s||ae.create(r,n,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return ae.create(e).meridiems()}static eras(e="short",{locale:r=null}={}){return ae.create(r,null,"gregory").eras(e)}static features(){return{relative:Tc(),localeWeek:jc()}}}function ao(t,e){const r=s=>s.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),n=r(e)-r(t);return Math.floor(te.fromMillis(n).as("days"))}function Fg(t,e,r){const n=[["years",(c,u)=>u.year-c.year],["quarters",(c,u)=>u.quarter-c.quarter+(u.year-c.year)*4],["months",(c,u)=>u.month-c.month+(u.year-c.year)*12],["weeks",(c,u)=>{const f=ao(c,u);return(f-f%7)/7}],["days",ao]],s={},a=t;let i,o;for(const[c,u]of n)r.indexOf(c)>=0&&(i=c,s[c]=u(t,e),o=a.plus(s),o>e?(s[c]--,t=a.plus(s),t>e&&(o=t,s[c]--,t=a.plus(s))):t=o);return[t,s,o,i]}function Lg(t,e,r,n){let[s,a,i,o]=Fg(t,e,r);const c=e-s,u=r.filter(d=>["hours","minutes","seconds","milliseconds"].indexOf(d)>=0);u.length===0&&(i<e&&(i=s.plus({[o]:1})),i!==s&&(a[o]=(a[o]||0)+c/(i-s)));const f=te.fromObject(a,n);return u.length>0?te.fromMillis(c,n).shiftTo(...u).plus(f):f}const Vg="missing Intl.DateTimeFormat.formatToParts support";function se(t,e=r=>r){return{regex:t,deser:([r])=>e(Ep(r))}}const $g=" ",Hc=`[ ${$g}]`,qc=new RegExp(Hc,"g");function zg(t){return t.replace(/\./g,"\\.?").replace(qc,Hc)}function io(t){return t.replace(/\./g,"").replace(qc," ").toLowerCase()}function Ge(t,e){return t===null?null:{regex:RegExp(t.map(zg).join("|")),deser:([r])=>t.findIndex(n=>io(r)===io(n))+e}}function oo(t,e){return{regex:t,deser:([,r,n])=>ts(r,n),groups:e}}function mn(t){return{regex:t,deser:([e])=>e}}function Wg(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Zg(t,e){const r=Ye(e),n=Ye(e,"{2}"),s=Ye(e,"{3}"),a=Ye(e,"{4}"),i=Ye(e,"{6}"),o=Ye(e,"{1,2}"),c=Ye(e,"{1,3}"),u=Ye(e,"{1,6}"),f=Ye(e,"{1,9}"),d=Ye(e,"{2,4}"),m=Ye(e,"{4,6}"),p=x=>({regex:RegExp(Wg(x.val)),deser:([v])=>v,literal:!0}),g=(x=>{if(t.literal)return p(x);switch(x.val){case"G":return Ge(e.eras("short"),0);case"GG":return Ge(e.eras("long"),0);case"y":return se(u);case"yy":return se(d,ra);case"yyyy":return se(a);case"yyyyy":return se(m);case"yyyyyy":return se(i);case"M":return se(o);case"MM":return se(n);case"MMM":return Ge(e.months("short",!0),1);case"MMMM":return Ge(e.months("long",!0),1);case"L":return se(o);case"LL":return se(n);case"LLL":return Ge(e.months("short",!1),1);case"LLLL":return Ge(e.months("long",!1),1);case"d":return se(o);case"dd":return se(n);case"o":return se(c);case"ooo":return se(s);case"HH":return se(n);case"H":return se(o);case"hh":return se(n);case"h":return se(o);case"mm":return se(n);case"m":return se(o);case"q":return se(o);case"qq":return se(n);case"s":return se(o);case"ss":return se(n);case"S":return se(c);case"SSS":return se(s);case"u":return mn(f);case"uu":return mn(o);case"uuu":return se(r);case"a":return Ge(e.meridiems(),0);case"kkkk":return se(a);case"kk":return se(d,ra);case"W":return se(o);case"WW":return se(n);case"E":case"c":return se(r);case"EEE":return Ge(e.weekdays("short",!1),1);case"EEEE":return Ge(e.weekdays("long",!1),1);case"ccc":return Ge(e.weekdays("short",!0),1);case"cccc":return Ge(e.weekdays("long",!0),1);case"Z":case"ZZ":return oo(new RegExp(`([+-]${o.source})(?::(${n.source}))?`),2);case"ZZZ":return oo(new RegExp(`([+-]${o.source})(${n.source})?`),2);case"z":return mn(/[a-z_+-/]{1,256}?/i);case" ":return mn(/[^\S\n\r]/);default:return p(x)}})(t)||{invalidReason:Vg};return g.token=t,g}const Bg={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function Ug(t,e,r){const{type:n,value:s}=t;if(n==="literal"){const c=/^\s+$/.test(s);return{literal:!c,val:c?" ":s}}const a=e[n];let i=n;n==="hour"&&(e.hour12!=null?i=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?i="hour12":i="hour24":i=r.hour12?"hour12":"hour24");let o=Bg[i];if(typeof o=="object"&&(o=o[a]),o)return{literal:!1,val:o}}function Hg(t){return[`^${t.map(r=>r.regex).reduce((r,n)=>`${r}(${n.source})`,"")}$`,t]}function qg(t,e,r){const n=t.match(e);if(n){const s={};let a=1;for(const i in r)if(gr(r,i)){const o=r[i],c=o.groups?o.groups+1:1;!o.literal&&o.token&&(s[o.token.val[0]]=o.deser(n.slice(a,a+c))),a+=c}return[n,s]}else return[n,{}]}function Yg(t){const e=a=>{switch(a){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let r=null,n;return Z(t.z)||(r=dt.create(t.z)),Z(t.Z)||(r||(r=new je(t.Z)),n=t.Z),Z(t.q)||(t.M=(t.q-1)*3+1),Z(t.h)||(t.h<12&&t.a===1?t.h+=12:t.h===12&&t.a===0&&(t.h=0)),t.G===0&&t.y&&(t.y=-t.y),Z(t.u)||(t.S=Aa(t.u)),[Object.keys(t).reduce((a,i)=>{const o=e(i);return o&&(a[o]=t[i]),a},{}),r,n]}let Ds=null;function Gg(){return Ds||(Ds=I.fromMillis(1555555555555)),Ds}function Xg(t,e){if(t.literal)return t;const r=Ce.macroTokenToFormatOpts(t.val),n=Jc(r,e);return n==null||n.includes(void 0)?t:n}function Yc(t,e){return Array.prototype.concat(...t.map(r=>Xg(r,e)))}class Gc{constructor(e,r){if(this.locale=e,this.format=r,this.tokens=Yc(Ce.parseFormat(r),e),this.units=this.tokens.map(n=>Zg(n,e)),this.disqualifyingUnit=this.units.find(n=>n.invalidReason),!this.disqualifyingUnit){const[n,s]=Hg(this.units);this.regex=RegExp(n,"i"),this.handlers=s}}explainFromTokens(e){if(this.isValid){const[r,n]=qg(e,this.regex,this.handlers),[s,a,i]=n?Yg(n):[null,null,void 0];if(gr(n,"a")&&gr(n,"H"))throw new lr("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:r,matches:n,result:s,zone:a,specificOffset:i}}else return{input:e,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function Xc(t,e,r){return new Gc(t,r).explainFromTokens(e)}function Jg(t,e,r){const{result:n,zone:s,specificOffset:a,invalidReason:i}=Xc(t,e,r);return[n,s,a,i]}function Jc(t,e){if(!t)return null;const n=Ce.create(e,t).dtFormatter(Gg()),s=n.formatToParts(),a=n.resolvedOptions();return s.map(i=>Ug(i,t,a))}const Rs="Invalid DateTime",lo=864e13;function Rr(t){return new Ke("unsupported zone",`the zone "${t.name}" is not supported`)}function As(t){return t.weekData===null&&(t.weekData=Rn(t.c)),t.weekData}function Ms(t){return t.localWeekData===null&&(t.localWeekData=Rn(t.c,t.loc.getMinDaysInFirstWeek(),t.loc.getStartOfWeek())),t.localWeekData}function Lt(t,e){const r={ts:t.ts,zone:t.zone,c:t.c,o:t.o,loc:t.loc,invalid:t.invalid};return new I({...r,...e,old:r})}function Kc(t,e,r){let n=t-e*60*1e3;const s=r.offset(n);if(e===s)return[n,e];n-=(s-e)*60*1e3;const a=r.offset(n);return s===a?[n,s]:[t-Math.min(s,a)*60*1e3,Math.max(s,a)]}function pn(t,e){t+=e*60*1e3;const r=new Date(t);return{year:r.getUTCFullYear(),month:r.getUTCMonth()+1,day:r.getUTCDate(),hour:r.getUTCHours(),minute:r.getUTCMinutes(),second:r.getUTCSeconds(),millisecond:r.getUTCMilliseconds()}}function Sn(t,e,r){return Kc(es(t),e,r)}function co(t,e){const r=t.o,n=t.c.year+Math.trunc(e.years),s=t.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,a={...t.c,year:n,month:s,day:Math.min(t.c.day,An(n,s))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},i=te.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),o=es(a);let[c,u]=Kc(o,r,t.zone);return i!==0&&(c+=i,u=t.zone.offset(c)),{ts:c,o:u}}function ar(t,e,r,n,s,a){const{setZone:i,zone:o}=r;if(t&&Object.keys(t).length!==0||e){const c=e||o,u=I.fromObject(t,{...r,zone:c,specificOffset:a});return i?u:u.setZone(o)}else return I.invalid(new Ke("unparsable",`the input "${s}" can't be parsed as ${n}`))}function gn(t,e,r=!0){return t.isValid?Ce.create(ae.create("en-US"),{allowZ:r,forceSimple:!0}).formatDateTimeFromString(t,e):null}function Is(t,e,r){const n=t.c.year>9999||t.c.year<0;let s="";if(n&&t.c.year>=0&&(s+="+"),s+=ge(t.c.year,n?6:4),r==="year")return s;if(e){if(s+="-",s+=ge(t.c.month),r==="month")return s;s+="-"}else if(s+=ge(t.c.month),r==="month")return s;return s+=ge(t.c.day),s}function uo(t,e,r,n,s,a,i){let o=!r||t.c.millisecond!==0||t.c.second!==0,c="";switch(i){case"day":case"month":case"year":break;default:if(c+=ge(t.c.hour),i==="hour")break;if(e){if(c+=":",c+=ge(t.c.minute),i==="minute")break;o&&(c+=":",c+=ge(t.c.second))}else{if(c+=ge(t.c.minute),i==="minute")break;o&&(c+=ge(t.c.second))}if(i==="second")break;o&&(!n||t.c.millisecond!==0)&&(c+=".",c+=ge(t.c.millisecond,3))}return s&&(t.isOffsetFixed&&t.offset===0&&!a?c+="Z":t.o<0?(c+="-",c+=ge(Math.trunc(-t.o/60)),c+=":",c+=ge(Math.trunc(-t.o%60))):(c+="+",c+=ge(Math.trunc(t.o/60)),c+=":",c+=ge(Math.trunc(t.o%60)))),a&&(c+="["+t.zone.ianaName+"]"),c}const Qc={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Kg={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Qg={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Nn=["year","month","day","hour","minute","second","millisecond"],ey=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],ty=["year","ordinal","hour","minute","second","millisecond"];function Cn(t){const e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[t.toLowerCase()];if(!e)throw new Ql(t);return e}function fo(t){switch(t.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return Cn(t)}}function ry(t){if(Ar===void 0&&(Ar=de.now()),t.type!=="iana")return t.offset(Ar);const e=t.name;let r=na.get(e);return r===void 0&&(r=t.offset(Ar),na.set(e,r)),r}function ho(t,e){const r=Ct(e.zone,de.defaultZone);if(!r.isValid)return I.invalid(Rr(r));const n=ae.fromObject(e);let s,a;if(Z(t.year))s=de.now();else{for(const c of Nn)Z(t[c])&&(t[c]=Qc[c]);const i=Cc(t)||_c(t);if(i)return I.invalid(i);const o=ry(r);[s,a]=Sn(t,o,r)}return new I({ts:s,zone:r,loc:n,o:a})}function mo(t,e,r){const n=Z(r.round)?!0:r.round,s=Z(r.rounding)?"trunc":r.rounding,a=(o,c)=>(o=Ma(o,n||r.calendary?0:2,r.calendary?"round":s),e.loc.clone(r).relFormatter(r).format(o,c)),i=o=>r.calendary?e.hasSame(t,o)?0:e.startOf(o).diff(t.startOf(o),o).get(o):e.diff(t,o).get(o);if(r.unit)return a(i(r.unit),r.unit);for(const o of r.units){const c=i(o);if(Math.abs(c)>=1)return a(c,o)}return a(t>e?-0:0,r.units[r.units.length-1])}function po(t){let e={},r;return t.length>0&&typeof t[t.length-1]=="object"?(e=t[t.length-1],r=Array.from(t).slice(0,t.length-1)):r=Array.from(t),[e,r]}let Ar;const na=new Map;class I{constructor(e){const r=e.zone||de.defaultZone;let n=e.invalid||(Number.isNaN(e.ts)?new Ke("invalid input"):null)||(r.isValid?null:Rr(r));this.ts=Z(e.ts)?de.now():e.ts;let s=null,a=null;if(!n)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(r))[s,a]=[e.old.c,e.old.o];else{const o=_t(e.o)&&!e.old?e.o:r.offset(this.ts);s=pn(this.ts,o),n=Number.isNaN(s.year)?new Ke("invalid input"):null,s=n?null:s,a=n?null:o}this._zone=r,this.loc=e.loc||ae.create(),this.invalid=n,this.weekData=null,this.localWeekData=null,this.c=s,this.o=a,this.isLuxonDateTime=!0}static now(){return new I({})}static local(){const[e,r]=po(arguments),[n,s,a,i,o,c,u]=r;return ho({year:n,month:s,day:a,hour:i,minute:o,second:c,millisecond:u},e)}static utc(){const[e,r]=po(arguments),[n,s,a,i,o,c,u]=r;return e.zone=je.utcInstance,ho({year:n,month:s,day:a,hour:i,minute:o,second:c,millisecond:u},e)}static fromJSDate(e,r={}){const n=Mp(e)?e.valueOf():NaN;if(Number.isNaN(n))return I.invalid("invalid input");const s=Ct(r.zone,de.defaultZone);return s.isValid?new I({ts:n,zone:s,loc:ae.fromObject(r)}):I.invalid(Rr(s))}static fromMillis(e,r={}){if(_t(e))return e<-lo||e>lo?I.invalid("Timestamp out of range"):new I({ts:e,zone:Ct(r.zone,de.defaultZone),loc:ae.fromObject(r)});throw new Ne(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,r={}){if(_t(e))return new I({ts:e*1e3,zone:Ct(r.zone,de.defaultZone),loc:ae.fromObject(r)});throw new Ne("fromSeconds requires a numerical input")}static fromObject(e,r={}){e=e||{};const n=Ct(r.zone,de.defaultZone);if(!n.isValid)return I.invalid(Rr(n));const s=ae.fromObject(r),a=Mn(e,fo),{minDaysInFirstWeek:i,startOfWeek:o}=Ji(a,s),c=de.now(),u=Z(r.specificOffset)?n.offset(c):r.specificOffset,f=!Z(a.ordinal),d=!Z(a.year),m=!Z(a.month)||!Z(a.day),p=d||m,y=a.weekYear||a.weekNumber;if((p||f)&&y)throw new lr("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(m&&f)throw new lr("Can't mix ordinal dates with month/day");const g=y||a.weekday&&!p;let x,v,S=pn(c,u);g?(x=ey,v=Kg,S=Rn(S,i,o)):f?(x=ty,v=Qg,S=Os(S)):(x=Nn,v=Qc);let C=!1;for(const L of x){const W=a[L];Z(W)?C?a[L]=v[L]:a[L]=S[L]:C=!0}const k=g?Dp(a,i,o):f?Rp(a):Cc(a),w=k||_c(a);if(w)return I.invalid(w);const j=g?Gi(a,i,o):f?Xi(a):a,[T,A]=Sn(j,u,n),$=new I({ts:T,zone:n,o:A,loc:s});return a.weekday&&p&&e.weekday!==$.weekday?I.invalid("mismatched weekday",`you can't specify both a weekday of ${a.weekday} and a date of ${$.toISO()}`):$.isValid?$:I.invalid($.invalid)}static fromISO(e,r={}){const[n,s]=Sg(e);return ar(n,s,r,"ISO 8601",e)}static fromRFC2822(e,r={}){const[n,s]=Ng(e);return ar(n,s,r,"RFC 2822",e)}static fromHTTP(e,r={}){const[n,s]=Cg(e);return ar(n,s,r,"HTTP",r)}static fromFormat(e,r,n={}){if(Z(e)||Z(r))throw new Ne("fromFormat requires an input string and a format");const{locale:s=null,numberingSystem:a=null}=n,i=ae.fromOpts({locale:s,numberingSystem:a,defaultToEN:!0}),[o,c,u,f]=Jg(i,e,r);return f?I.invalid(f):ar(o,c,n,`format ${r}`,e,u)}static fromString(e,r,n={}){return I.fromFormat(e,r,n)}static fromSQL(e,r={}){const[n,s]=Rg(e);return ar(n,s,r,"SQL",e)}static invalid(e,r=null){if(!e)throw new Ne("need to specify a reason the DateTime is invalid");const n=e instanceof Ke?e:new Ke(e,r);if(de.throwOnInvalid)throw new ap(n);return new I({invalid:n})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,r={}){const n=Jc(e,ae.fromObject(r));return n?n.map(s=>s?s.val:null).join(""):null}static expandFormat(e,r={}){return Yc(Ce.parseFormat(e),ae.fromObject(r)).map(s=>s.val).join("")}static resetCache(){Ar=void 0,na.clear()}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?As(this).weekYear:NaN}get weekNumber(){return this.isValid?As(this).weekNumber:NaN}get weekday(){return this.isValid?As(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?Ms(this).weekday:NaN}get localWeekNumber(){return this.isValid?Ms(this).weekNumber:NaN}get localWeekYear(){return this.isValid?Ms(this).weekYear:NaN}get ordinal(){return this.isValid?Os(this.c).ordinal:NaN}get monthShort(){return this.isValid?hn.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?hn.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?hn.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?hn.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const e=864e5,r=6e4,n=es(this.c),s=this.zone.offset(n-e),a=this.zone.offset(n+e),i=this.zone.offset(n-s*r),o=this.zone.offset(n-a*r);if(i===o)return[this];const c=n-i*r,u=n-o*r,f=pn(c,i),d=pn(u,o);return f.hour===d.hour&&f.minute===d.minute&&f.second===d.second&&f.millisecond===d.millisecond?[Lt(this,{ts:c}),Lt(this,{ts:u})]:[this]}get isInLeapYear(){return Yr(this.year)}get daysInMonth(){return An(this.year,this.month)}get daysInYear(){return this.isValid?dr(this.year):NaN}get weeksInWeekYear(){return this.isValid?Vr(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Vr(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:r,numberingSystem:n,calendar:s}=Ce.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:r,numberingSystem:n,outputCalendar:s}}toUTC(e=0,r={}){return this.setZone(je.instance(e),r)}toLocal(){return this.setZone(de.defaultZone)}setZone(e,{keepLocalTime:r=!1,keepCalendarTime:n=!1}={}){if(e=Ct(e,de.defaultZone),e.equals(this.zone))return this;if(e.isValid){let s=this.ts;if(r||n){const a=e.offset(this.ts),i=this.toObject();[s]=Sn(i,a,e)}return Lt(this,{ts:s,zone:e})}else return I.invalid(Rr(e))}reconfigure({locale:e,numberingSystem:r,outputCalendar:n}={}){const s=this.loc.clone({locale:e,numberingSystem:r,outputCalendar:n});return Lt(this,{loc:s})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const r=Mn(e,fo),{minDaysInFirstWeek:n,startOfWeek:s}=Ji(r,this.loc),a=!Z(r.weekYear)||!Z(r.weekNumber)||!Z(r.weekday),i=!Z(r.ordinal),o=!Z(r.year),c=!Z(r.month)||!Z(r.day),u=o||c,f=r.weekYear||r.weekNumber;if((u||i)&&f)throw new lr("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(c&&i)throw new lr("Can't mix ordinal dates with month/day");let d;a?d=Gi({...Rn(this.c,n,s),...r},n,s):Z(r.ordinal)?(d={...this.toObject(),...r},Z(r.day)&&(d.day=Math.min(An(d.year,d.month),d.day))):d=Xi({...Os(this.c),...r});const[m,p]=Sn(d,this.o,this.zone);return Lt(this,{ts:m,o:p})}plus(e){if(!this.isValid)return this;const r=te.fromDurationLike(e);return Lt(this,co(this,r))}minus(e){if(!this.isValid)return this;const r=te.fromDurationLike(e).negate();return Lt(this,co(this,r))}startOf(e,{useLocaleWeeks:r=!1}={}){if(!this.isValid)return this;const n={},s=te.normalizeUnit(e);switch(s){case"years":n.month=1;case"quarters":case"months":n.day=1;case"weeks":case"days":n.hour=0;case"hours":n.minute=0;case"minutes":n.second=0;case"seconds":n.millisecond=0;break}if(s==="weeks")if(r){const a=this.loc.getStartOfWeek(),{weekday:i}=this;i<a&&(n.weekNumber=this.weekNumber-1),n.weekday=a}else n.weekday=1;if(s==="quarters"){const a=Math.ceil(this.month/3);n.month=(a-1)*3+1}return this.set(n)}endOf(e,r){return this.isValid?this.plus({[e]:1}).startOf(e,r).minus(1):this}toFormat(e,r={}){return this.isValid?Ce.create(this.loc.redefaultToEN(r)).formatDateTimeFromString(this,e):Rs}toLocaleString(e=Dn,r={}){return this.isValid?Ce.create(this.loc.clone(r),e).formatDateTime(this):Rs}toLocaleParts(e={}){return this.isValid?Ce.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:r=!1,suppressMilliseconds:n=!1,includeOffset:s=!0,extendedZone:a=!1,precision:i="milliseconds"}={}){if(!this.isValid)return null;i=Cn(i);const o=e==="extended";let c=Is(this,o,i);return Nn.indexOf(i)>=3&&(c+="T"),c+=uo(this,o,r,n,s,a,i),c}toISODate({format:e="extended",precision:r="day"}={}){return this.isValid?Is(this,e==="extended",Cn(r)):null}toISOWeekDate(){return gn(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:r=!1,includeOffset:n=!0,includePrefix:s=!1,extendedZone:a=!1,format:i="extended",precision:o="milliseconds"}={}){return this.isValid?(o=Cn(o),(s&&Nn.indexOf(o)>=3?"T":"")+uo(this,i==="extended",r,e,n,a,o)):null}toRFC2822(){return gn(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return gn(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?Is(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:r=!1,includeOffsetSpace:n=!0}={}){let s="HH:mm:ss.SSS";return(r||e)&&(n&&(s+=" "),r?s+="z":e&&(s+="ZZ")),gn(this,s,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():Rs}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const r={...this.c};return e.includeConfig&&(r.outputCalendar=this.outputCalendar,r.numberingSystem=this.loc.numberingSystem,r.locale=this.loc.locale),r}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,r="milliseconds",n={}){if(!this.isValid||!e.isValid)return te.invalid("created by diffing an invalid DateTime");const s={locale:this.locale,numberingSystem:this.numberingSystem,...n},a=Ip(r).map(te.normalizeUnit),i=e.valueOf()>this.valueOf(),o=i?this:e,c=i?e:this,u=Lg(o,c,a,s);return i?u.negate():u}diffNow(e="milliseconds",r={}){return this.diff(I.now(),e,r)}until(e){return this.isValid?me.fromDateTimes(this,e):this}hasSame(e,r,n){if(!this.isValid)return!1;const s=e.valueOf(),a=this.setZone(e.zone,{keepLocalTime:!0});return a.startOf(r,n)<=s&&s<=a.endOf(r,n)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const r=e.base||I.fromObject({},{zone:this.zone}),n=e.padding?this<r?-e.padding:e.padding:0;let s=["years","months","days","hours","minutes","seconds"],a=e.unit;return Array.isArray(e.unit)&&(s=e.unit,a=void 0),mo(r,this.plus(n),{...e,numeric:"always",units:s,unit:a})}toRelativeCalendar(e={}){return this.isValid?mo(e.base||I.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(!e.every(I.isDateTime))throw new Ne("min requires all arguments be DateTimes");return Ki(e,r=>r.valueOf(),Math.min)}static max(...e){if(!e.every(I.isDateTime))throw new Ne("max requires all arguments be DateTimes");return Ki(e,r=>r.valueOf(),Math.max)}static fromFormatExplain(e,r,n={}){const{locale:s=null,numberingSystem:a=null}=n,i=ae.fromOpts({locale:s,numberingSystem:a,defaultToEN:!0});return Xc(i,e,r)}static fromStringExplain(e,r,n={}){return I.fromFormatExplain(e,r,n)}static buildFormatParser(e,r={}){const{locale:n=null,numberingSystem:s=null}=r,a=ae.fromOpts({locale:n,numberingSystem:s,defaultToEN:!0});return new Gc(a,e)}static fromFormatParser(e,r,n={}){if(Z(e)||Z(r))throw new Ne("fromFormatParser requires an input string and a format parser");const{locale:s=null,numberingSystem:a=null}=n,i=ae.fromOpts({locale:s,numberingSystem:a,defaultToEN:!0});if(!i.equals(r.locale))throw new Ne(`fromFormatParser called with a locale of ${i}, but the format parser was created for ${r.locale}`);const{result:o,zone:c,specificOffset:u,invalidReason:f}=r.explainFromTokens(e);return f?I.invalid(f):ar(o,c,n,`format ${r.format}`,e,u)}static get DATE_SHORT(){return Dn}static get DATE_MED(){return ec}static get DATE_MED_WITH_WEEKDAY(){return lp}static get DATE_FULL(){return tc}static get DATE_HUGE(){return rc}static get TIME_SIMPLE(){return nc}static get TIME_WITH_SECONDS(){return sc}static get TIME_WITH_SHORT_OFFSET(){return ac}static get TIME_WITH_LONG_OFFSET(){return ic}static get TIME_24_SIMPLE(){return oc}static get TIME_24_WITH_SECONDS(){return lc}static get TIME_24_WITH_SHORT_OFFSET(){return cc}static get TIME_24_WITH_LONG_OFFSET(){return uc}static get DATETIME_SHORT(){return dc}static get DATETIME_SHORT_WITH_SECONDS(){return fc}static get DATETIME_MED(){return hc}static get DATETIME_MED_WITH_SECONDS(){return mc}static get DATETIME_MED_WITH_WEEKDAY(){return cp}static get DATETIME_FULL(){return pc}static get DATETIME_FULL_WITH_SECONDS(){return gc}static get DATETIME_HUGE(){return yc}static get DATETIME_HUGE_WITH_SECONDS(){return vc}}function Or(t){if(I.isDateTime(t))return t;if(t&&t.valueOf&&_t(t.valueOf()))return I.fromJSDate(t);if(t&&typeof t=="object")return I.fromObject(t);throw new Ne(`Unknown datetime argument: ${t}, of type ${typeof t}`)}const In="Europe/Madrid";de.defaultZone=In;function Pn(t){return dt.isValidZone(t)}function Jr(t){if(t&&Pn(t))return t;const e=de.defaultZone.name||In;return Pn(e)?e:In}function ny(t){return Pn(t)?(de.defaultZone=t,!0):!1}function sy(t,e){const r=Jr(e);return typeof t=="string"?I.fromISO(t,{zone:r}):I.fromJSDate(t,{zone:r})}function eu(t,e){const r=Jr(e),n=I.isDateTime(t)?t.setZone(r):I.fromJSDate(t,{zone:r});return n.isValid?n.toISODate():null}function ay(t,e){const r=Jr(e),n=I.isDateTime(t)?t.setZone(r):I.fromJSDate(t,{zone:r});return n.isValid?n.toISO():null}const iy=["Do","Lu","Ma","Mi","Ju","Vi","Sa"],oy=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"];function ly(t,e,r){return I.fromObject({year:t,month:e,day:1},{zone:r}).daysInMonth??0}function cy(t,e,r){return I.fromObject({year:t,month:e,day:1},{zone:r}).weekday%7}function Ps(t,e){return t.hasSame(e,"day")}function Fs(t,e,r){return!!(e&&t<e||r&&t>r)}function uy(t){return t.toFormat("dd/LL/yyyy")}const ns=h.forwardRef(({value:t,defaultValue:e,onChange:r,disabled:n=!1,placeholder:s="Seleccionar fecha",min:a,max:i,className:o,isInvalid:c,timeZone:u},f)=>{const d=h.useMemo(()=>Jr(u),[u]),[m,p]=h.useState(!1),[y,g]=h.useState(e??null),[x,v]=h.useState(()=>{const D=t??e??new Date;return I.fromJSDate(D,{zone:d}).startOf("month")}),[S,C]=h.useState(null),k=t!==void 0,w=k?t:y,j=h.useMemo(()=>w?I.fromJSDate(w,{zone:d}):null,[w,d]),T=h.useMemo(()=>a?I.fromJSDate(a,{zone:d}).startOf("day"):null,[a,d]),A=h.useMemo(()=>i?I.fromJSDate(i,{zone:d}).startOf("day"):null,[i,d]),$=h.useRef(null),L=D=>{if(Fs(D,T,A))return;const ee=D.toJSDate();k||g(ee),r?.(ee),p(!1)},W=D=>{v(ee=>ee.plus({months:D}).startOf("month"))},B=D=>{v(ee=>ee.plus({years:D}).startOf("month"))},G=D=>{if(!m)return;const ee=S??j??I.now().setZone(d);let z=null;switch(D.key){case"ArrowLeft":D.preventDefault(),z=ee.minus({days:1});break;case"ArrowRight":D.preventDefault(),z=ee.plus({days:1});break;case"ArrowUp":D.preventDefault(),z=ee.minus({days:7});break;case"ArrowDown":D.preventDefault(),z=ee.plus({days:7});break;case"Enter":case" ":D.preventDefault(),S&&!Fs(S,T,A)&&L(S);return;case"Escape":D.preventDefault(),p(!1);return;case"Home":D.preventDefault(),z=ee.startOf("month");break;case"End":D.preventDefault(),z=ee.endOf("month");break;case"PageUp":D.preventDefault(),D.shiftKey?B(-1):W(-1);return;case"PageDown":D.preventDefault(),D.shiftKey?B(1):W(1);return;default:return}z&&(C(z),(z.month!==x.month||z.year!==x.year)&&v(z.startOf("month")))};h.useEffect(()=>{if(m){const D=j??I.now().setZone(d);C(D),v(D.startOf("month"))}},[m,d,j]);const Q=x.year,H=x.month,P=ly(Q,H,d),U=cy(Q,H,d),V=I.now().setZone(d),ie=!!j?.isValid,F=[];for(let D=0;D<U;D++)F.push(null);for(let D=1;D<=P;D++)F.push(D);return l.jsxs(tp,{open:m,onOpenChange:p,children:[l.jsx(rp,{asChild:!0,disabled:n,children:l.jsxs("button",{ref:f,type:"button",className:N("flex h-8 w-full items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent px-2.5 py-1 text-sm transition-[border-color,box-shadow,color,background-color] outline-none","focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50","disabled:cursor-not-allowed disabled:opacity-50","dark:bg-input/30 dark:hover:bg-input/50",!ie&&"text-muted-foreground",c&&"border-destructive focus-visible:border-destructive focus-visible:ring-destructive/20 dark:border-destructive/50 dark:focus-visible:ring-destructive/40",o),"aria-haspopup":"dialog","aria-expanded":m,children:[l.jsx("span",{children:ie&&j?uy(j):s}),l.jsx(J.Calendar,{className:"h-4 w-4 shrink-0 opacity-50"})]})}),l.jsx(np,{children:l.jsxs(sp,{ref:$,className:N("z-50 w-[18rem] rounded-xl bg-popover p-3 text-popover-foreground shadow-card-lg ring-1 ring-foreground/10 outline-none","transition-[opacity,transform] duration-100","data-[state=closed]:opacity-0 data-[state=closed]:scale-95","data-[state=open]:opacity-100 data-[state=open]:scale-100"),sideOffset:4,align:"start",onKeyDown:G,role:"dialog","aria-modal":"true","aria-label":"Calendario",children:[l.jsxs("div",{className:"flex items-center justify-between pb-2",children:[l.jsx("button",{type:"button",className:"inline-flex h-7 w-7 items-center justify-center rounded-md border border-border bg-background text-sm transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50",onClick:()=>W(-1),"aria-label":"Mes anterior",children:l.jsx(J.ChevronLeft,{className:"h-4 w-4"})}),l.jsxs("span",{className:"text-sm font-medium text-foreground",children:[oy[H-1]," ",Q]}),l.jsx("button",{type:"button",className:"inline-flex h-7 w-7 items-center justify-center rounded-md border border-border bg-background text-sm transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50",onClick:()=>W(1),"aria-label":"Mes siguiente",children:l.jsx(J.ChevronRight,{className:"h-4 w-4"})})]}),l.jsx("div",{className:"grid grid-cols-7 gap-1 pb-1",role:"row",children:iy.map(D=>l.jsx("span",{className:"flex h-8 w-8 items-center justify-center text-[11px] font-medium uppercase tracking-wide text-muted-foreground",role:"columnheader",children:D},D))}),l.jsx("div",{className:"grid grid-cols-7 gap-1",role:"grid",children:F.map((D,ee)=>{if(D===null)return l.jsx("span",{className:"h-8 w-8"},`empty-${ee}`);const z=x.set({day:D}).startOf("day"),oe=j?Ps(z,j):!1,ce=Ps(z,V),ve=Fs(z,T,A),Te=S?Ps(z,S):!1;return l.jsx("button",{type:"button",className:N("flex h-8 w-8 items-center justify-center rounded-md text-sm transition-colors outline-none","hover:bg-accent hover:text-accent-foreground","focus-visible:ring-3 focus-visible:ring-ring/50",oe&&"bg-primary text-primary-foreground hover:bg-primary/90",ce&&!oe&&"ring-1 ring-ring/40",ve&&"pointer-events-none opacity-30",Te&&!oe&&"bg-accent text-accent-foreground"),disabled:ve,onClick:()=>L(z),tabIndex:Te?0:-1,"aria-selected":!!oe,"aria-disabled":!!ve,children:D},D)})})]})})]})});ns.displayName="DatePicker";var ss="Dialog",[tu]=Un(ss),[dy,rt]=tu(ss),ru=t=>{const{__scopeDialog:e,children:r,open:n,defaultOpen:s,onOpenChange:a,modal:i=!0}=t,o=h.useRef(null),c=h.useRef(null),[u,f]=Ta({prop:n,defaultProp:s??!1,onChange:a,caller:ss});return l.jsx(dy,{scope:e,triggerRef:o,contentRef:c,contentId:xn(),titleId:xn(),descriptionId:xn(),open:u,onOpenChange:f,onOpenToggle:h.useCallback(()=>f(d=>!d),[f]),modal:i,children:r})};ru.displayName=ss;var nu="DialogTrigger",su=h.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,s=rt(nu,r),a=$e(e,s.triggerRef);return l.jsx(_e.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":$a(s.open),...n,ref:a,onClick:Re(t.onClick,s.onOpenToggle)})});su.displayName=nu;var La="DialogPortal",[fy,au]=tu(La,{forceMount:void 0}),iu=t=>{const{__scopeDialog:e,forceMount:r,children:n,container:s}=t,a=rt(La,e);return l.jsx(fy,{scope:e,forceMount:r,children:h.Children.map(n,i=>l.jsx(Nr,{present:r||a.open,children:l.jsx(_a,{asChild:!0,container:s,children:i})}))})};iu.displayName=La;var Fn="DialogOverlay",ou=h.forwardRef((t,e)=>{const r=au(Fn,t.__scopeDialog),{forceMount:n=r.forceMount,...s}=t,a=rt(Fn,t.__scopeDialog);return a.modal?l.jsx(Nr,{present:n||a.open,children:l.jsx(my,{...s,ref:e})}):null});ou.displayName=Fn;var hy=Zn("DialogOverlay.RemoveScroll"),my=h.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,s=rt(Fn,r);return l.jsx(ja,{as:hy,allowPinchZoom:!0,shards:[s.contentRef],children:l.jsx(_e.div,{"data-state":$a(s.open),...n,ref:e,style:{pointerEvents:"auto",...n.style}})})}),Bt="DialogContent",lu=h.forwardRef((t,e)=>{const r=au(Bt,t.__scopeDialog),{forceMount:n=r.forceMount,...s}=t,a=rt(Bt,t.__scopeDialog);return l.jsx(Nr,{present:n||a.open,children:a.modal?l.jsx(py,{...s,ref:e}):l.jsx(gy,{...s,ref:e})})});lu.displayName=Bt;var py=h.forwardRef((t,e)=>{const r=rt(Bt,t.__scopeDialog),n=h.useRef(null),s=$e(e,r.contentRef,n);return h.useEffect(()=>{const a=n.current;if(a)return Il(a)},[]),l.jsx(cu,{...t,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Re(t.onCloseAutoFocus,a=>{a.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:Re(t.onPointerDownOutside,a=>{const i=a.detail.originalEvent,o=i.button===0&&i.ctrlKey===!0;(i.button===2||o)&&a.preventDefault()}),onFocusOutside:Re(t.onFocusOutside,a=>a.preventDefault())})}),gy=h.forwardRef((t,e)=>{const r=rt(Bt,t.__scopeDialog),n=h.useRef(!1),s=h.useRef(!1);return l.jsx(cu,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{t.onCloseAutoFocus?.(a),a.defaultPrevented||(n.current||r.triggerRef.current?.focus(),a.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:a=>{t.onInteractOutside?.(a),a.defaultPrevented||(n.current=!0,a.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const i=a.target;r.triggerRef.current?.contains(i)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&s.current&&a.preventDefault()}})}),cu=h.forwardRef((t,e)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:a,...i}=t,o=rt(Bt,r),c=h.useRef(null),u=$e(e,c);return ll(),l.jsxs(l.Fragment,{children:[l.jsx(ya,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:a,children:l.jsx(ga,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":$a(o.open),...i,ref:u,onDismiss:()=>o.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(yy,{titleId:o.titleId}),l.jsx(xy,{contentRef:c,descriptionId:o.descriptionId})]})]})}),Va="DialogTitle",uu=h.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,s=rt(Va,r);return l.jsx(_e.h2,{id:s.titleId,...n,ref:e})});uu.displayName=Va;var du="DialogDescription",fu=h.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,s=rt(du,r);return l.jsx(_e.p,{id:s.descriptionId,...n,ref:e})});fu.displayName=du;var hu="DialogClose",mu=h.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,s=rt(hu,r);return l.jsx(_e.button,{type:"button",...n,ref:e,onClick:Re(t.onClick,()=>s.onOpenChange(!1))})});mu.displayName=hu;function $a(t){return t?"open":"closed"}var pu="DialogTitleWarning",[Bx,gu]=df(pu,{contentName:Bt,titleName:Va,docsSlug:"dialog"}),yy=({titleId:t})=>{const e=gu(pu),r=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
42
42
 
43
43
  If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
44
44
 
45
- For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return h.useEffect(()=>{t&&(document.getElementById(t)||console.error(r))},[r,t]),null},vy="DialogDescriptionWarning",xy=({contentRef:t,descriptionId:e})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${gu(vy).contentName}}.`;return h.useEffect(()=>{const s=t.current?.getAttribute("aria-describedby");e&&s&&(document.getElementById(e)||console.warn(n))},[n,t,e]),null},yu=ru,vu=su,xu=iu,as=ou,is=lu,os=uu,ls=fu,cs=mu;const bu=yu,by=vu,wu=xu,wy=cs,Wa=h.forwardRef(({className:t,...e},r)=>l.jsx(as,{ref:r,className:N("fixed inset-0 isolate z-50 bg-black/10 backdrop-blur-[2px] transition-opacity duration-100","data-[state=closed]:opacity-0 data-[state=open]:opacity-100",t),...e}));Wa.displayName=as.displayName;const za=h.forwardRef(({className:t,children:e,hideClose:r,...n},s)=>l.jsxs(wu,{children:[l.jsx(Wa,{}),l.jsxs(is,{ref:s,className:N("fixed left-1/2 top-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-background p-4 text-sm","ring-1 ring-foreground/10 shadow-card-lg outline-none transition-[opacity,transform] duration-100 sm:max-w-md","data-[state=closed]:opacity-0 data-[state=closed]:scale-95","data-[state=open]:opacity-100 data-[state=open]:scale-100",t),...n,children:[e,!r&&l.jsx(cs,{asChild:!0,children:l.jsxs(Le,{variant:"ghost",size:"icon-sm",className:"absolute right-2 top-2","aria-label":"Cerrar",children:[l.jsx(J.X,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"Cerrar"})]})})]})]}));za.displayName=is.displayName;const Za=({className:t,...e})=>l.jsx("div",{className:N("flex flex-col gap-2",t),...e});Za.displayName="DialogHeader";const Ba=({className:t,...e})=>l.jsx("div",{className:N("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end",t),...e});Ba.displayName="DialogFooter";const Ua=h.forwardRef(({className:t,...e},r)=>l.jsx(os,{ref:r,className:N("text-base font-medium leading-none text-foreground",t),...e}));Ua.displayName=os.displayName;const Ha=h.forwardRef(({className:t,...e},r)=>l.jsx(ls,{ref:r,className:N("text-sm text-muted-foreground",t),...e}));Ha.displayName=ls.displayName;const ky=fe.Root,Sy=fe.Trigger,Ny=fe.Group,Cy=fe.Portal,_y=fe.Sub,Ty=fe.RadioGroup,ku=h.forwardRef(({className:t,sideOffset:e=6,...r},n)=>l.jsx(fe.Portal,{children:l.jsx(fe.Content,{ref:n,sideOffset:e,className:N("z-50 min-w-[10rem] overflow-hidden rounded-lg bg-popover p-1 text-popover-foreground shadow-card-sm ring-1 ring-foreground/10 outline-none","transition-[opacity,transform] duration-100","data-[state=closed]:opacity-0 data-[state=closed]:scale-95","data-[state=open]:opacity-100 data-[state=open]:scale-100",t),...r})}));ku.displayName=fe.Content.displayName;const Su=h.forwardRef(({className:t,inset:e,icon:r,destructive:n,children:s,...a},i)=>l.jsxs(fe.Item,{ref:i,className:N("relative flex cursor-default select-none items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-none transition-colors","focus:bg-accent focus:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e&&"pl-8",n&&"text-destructive focus:bg-destructive/10 focus:text-destructive",t),...a,children:[r&&l.jsx("span",{className:"h-4 w-4 shrink-0 [&>svg]:h-4 [&>svg]:w-4",children:r}),s]}));Su.displayName=fe.Item.displayName;const Nu=h.forwardRef(({className:t,children:e,checked:r,...n},s)=>l.jsxs(fe.CheckboxItem,{ref:s,className:N("relative flex cursor-default select-none items-center gap-1.5 rounded-md py-1 pl-1.5 pr-8 text-sm outline-none transition-colors","focus:bg-accent focus:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:r,...n,children:[l.jsx("span",{className:"absolute right-2 flex h-4 w-4 items-center justify-center",children:l.jsx(fe.ItemIndicator,{children:l.jsx(J.Check,{className:"h-4 w-4"})})}),e]}));Nu.displayName=fe.CheckboxItem.displayName;const Cu=h.forwardRef(({className:t,children:e,...r},n)=>l.jsxs(fe.RadioItem,{ref:n,className:N("relative flex cursor-default select-none items-center gap-1.5 rounded-md py-1 pl-1.5 pr-8 text-sm outline-none transition-colors","focus:bg-accent focus:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...r,children:[l.jsx("span",{className:"absolute right-2 flex h-4 w-4 items-center justify-center",children:l.jsx(fe.ItemIndicator,{children:l.jsx(J.Circle,{className:"h-2.5 w-2.5 fill-current"})})}),e]}));Cu.displayName=fe.RadioItem.displayName;const _u=h.forwardRef(({className:t,inset:e,...r},n)=>l.jsx(fe.Label,{ref:n,className:N("px-1.5 py-1 text-xs font-medium text-muted-foreground",e&&"pl-8",t),...r}));_u.displayName=fe.Label.displayName;const Tu=h.forwardRef(({className:t,...e},r)=>l.jsx(fe.Separator,{ref:r,className:N("-mx-1 my-1 h-px bg-border",t),...e}));Tu.displayName=fe.Separator.displayName;const ju=h.forwardRef(({className:t,inset:e,children:r,...n},s)=>l.jsxs(fe.SubTrigger,{ref:s,className:N("flex cursor-default select-none items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-none transition-colors","focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",e&&"pl-8",t),...n,children:[r,l.jsx(J.ChevronRight,{className:"ml-auto h-4 w-4"})]}));ju.displayName=fe.SubTrigger.displayName;const Eu=h.forwardRef(({className:t,...e},r)=>l.jsx(fe.SubContent,{ref:r,className:N("z-50 min-w-[8rem] overflow-hidden rounded-lg bg-popover p-1 text-popover-foreground shadow-card-sm ring-1 ring-foreground/10 outline-none","transition-[opacity,transform] duration-100","data-[state=closed]:opacity-0 data-[state=closed]:scale-95","data-[state=open]:opacity-100 data-[state=open]:scale-100",t),...e}));Eu.displayName=fe.SubContent.displayName;const Ou=({className:t,...e})=>l.jsx("span",{className:N("ml-auto text-xs tracking-widest text-muted-foreground",t),...e});Ou.displayName="DropdownMenuShortcut";const jy="Arrastra y suelta archivos aquí o selecciona desde tu dispositivo.",Ey=t=>{if(t===0)return"0 B";const e=1024,r=["B","KB","MB","GB","TB"],n=Math.floor(Math.log(t)/Math.log(e));return`${(t/Math.pow(e,n)).toFixed(n===0?0:1)} ${r[n]}`},ir=t=>`${t.name}-${t.size}-${t.lastModified}`,go=t=>t.type.startsWith("image/");function us({label:t,helperText:e,error:r,disabled:n=!1,multiple:s=!1,accept:a,files:i,defaultFiles:o=[],onFilesChange:c,id:u,name:f,allowDrop:d=!1,placeholder:m=jy,showPreview:p=!0,previewMode:y="auto",maxPreviewItems:g=4,defaultPreviewUrl:x}){const v=b.useId(),S=u??v,C=e?`${S}-helper`:void 0,k=r?`${S}-error`:void 0,w=[C,k].filter(Boolean).join(" ")||void 0,j=b.useRef(null),[T,A]=b.useState(o),[$,L]=b.useState(!1),z=i!==void 0,B=z?i:T,G=F=>{const D=s?F:F.slice(0,1);z||A(D),c?.(D)},Q=F=>{if(!s)return F.slice(0,1);const D=new Map(B.map(ee=>[ir(ee),ee]));for(const ee of F)D.set(ir(ee),ee);return Array.from(D.values())},H=F=>{const D=Array.from(F.target.files??[]);G(s?Q(D):D),F.target.value=""},P=F=>{G(B.filter(D=>ir(D)!==ir(F)))},U=F=>{if(!d||n)return;F.preventDefault(),L(!1);const D=Array.from(F.dataTransfer.files??[]);D.length!==0&&G(s?Q(D):D)},V=b.useMemo(()=>{if(!p)return[];const F=B.slice(0,g);return y==="image"||y==="auto"&&F.some(ee=>go(ee))?F.filter(ee=>go(ee)).map(ee=>({key:ir(ee),file:ee,url:URL.createObjectURL(ee)})):[]},[B,g,y,p]);b.useEffect(()=>()=>{for(const F of V)URL.revokeObjectURL(F.url)},[V]);const ie=!!x&&B.length===0;return l.jsxs("div",{className:N("flex flex-col gap-2",n&&"pointer-events-none opacity-60"),children:[t&&l.jsx("label",{htmlFor:S,className:"text-sm font-medium text-foreground",children:t}),l.jsx("input",{ref:j,id:S,name:f,type:"file",className:"sr-only",disabled:n,multiple:s,accept:a,"aria-invalid":r?"true":void 0,"aria-describedby":w,onChange:H}),l.jsxs("button",{type:"button",disabled:n,className:N("flex min-h-44 flex-col items-center justify-center gap-3 rounded-xl border border-dashed border-border bg-card px-6 py-8 text-center","transition-[border-color,background-color,box-shadow,transform] hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50 active:translate-y-px",d&&"cursor-pointer",$&&"border-ring bg-muted",r&&"border-destructive focus-visible:ring-destructive/20"),onClick:()=>j.current?.click(),onDragOver:F=>{!d||n||(F.preventDefault(),L(!0))},onDragLeave:()=>d&&L(!1),onDrop:U,children:[l.jsx(J.UploadCloud,{className:"h-8 w-8 text-muted-foreground"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium text-foreground",children:s?"Seleccionar archivos":"Seleccionar archivo"}),l.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground",children:m}),a&&l.jsxs("p",{className:"mt-0.5 text-xs text-muted-foreground",children:["Acepta: ",a]})]})]}),ie&&l.jsx("div",{className:"mt-2 flex gap-2",children:l.jsx("div",{className:"h-16 w-16 overflow-hidden rounded-lg bg-muted ring-1 ring-foreground/10",children:l.jsx("img",{src:x,alt:"Logo actual",className:"h-full w-full object-cover"})})}),V.length>0&&l.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:V.map(F=>l.jsx("div",{className:"h-16 w-16 overflow-hidden rounded-lg bg-muted ring-1 ring-foreground/10",children:l.jsx("img",{src:F.url,alt:F.file.name,className:"h-full w-full object-cover"})},F.key))}),e&&!r&&l.jsx("p",{id:C,className:"text-xs text-muted-foreground",children:e}),r&&l.jsx("p",{id:k,className:"text-xs text-destructive",children:r}),B.length>0&&l.jsx("ul",{className:"mt-2 flex flex-col gap-1",children:B.map(F=>l.jsxs("li",{className:"flex items-center justify-between gap-2 rounded-lg bg-muted/40 px-3 py-2 ring-1 ring-foreground/10",children:[l.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[l.jsx(J.FileIcon,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("p",{className:"truncate text-sm font-medium text-foreground",children:F.name}),l.jsx("p",{className:"text-xs text-muted-foreground",children:Ey(F.size)})]})]}),l.jsx("button",{type:"button",className:"shrink-0 rounded-md p-1 text-muted-foreground transition-colors hover:bg-background hover:text-foreground focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50",onClick:()=>P(F),"aria-label":`Eliminar ${F.name}`,children:l.jsx(J.X,{className:"h-4 w-4"})})]},ir(F)))})]})}const Oy=us,Du=h.createContext(null);function ds(){const t=h.useContext(Du);if(!t)throw new Error("Field components must be used inside <Field>");return t}function st({className:t,error:e,required:r,...n}){const s=h.useId();return l.jsx(Du.Provider,{value:{id:s,error:e,required:r},children:l.jsx("div",{className:N("flex flex-col gap-1.5",t),...n})})}const Xe=b.forwardRef((t,e)=>{const{id:r,error:n}=ds();return l.jsx(Go,{ref:e,id:r,"aria-invalid":!!n,...t})});Xe.displayName="FieldControl";const at=h.forwardRef(({className:t,children:e,...r},n)=>{const{id:s,required:a}=ds();return l.jsxs("label",{ref:n,htmlFor:s,className:N("text-sm font-medium text-foreground leading-none",t),...r,children:[e,a&&l.jsx("span",{className:"ml-0.5 text-destructive",children:"*"})]})});at.displayName="FieldLabel";const Je=h.forwardRef(({className:t,children:e,...r},n)=>{const{error:s}=ds(),a=s??e;return a?l.jsx("p",{ref:n,className:N("text-xs",s?"text-destructive":"text-muted-foreground",t),...r,children:a}):null});Je.displayName="FieldMessage";const Ru=b.forwardRef(({className:t,containerClassName:e,isInvalid:r,...n},s)=>{const[a,i]=b.useState(!1);return l.jsxs("div",{className:N("relative",e),children:[l.jsx("input",{ref:s,type:a?"text":"password","aria-invalid":r||void 0,className:N("flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 pr-10 text-sm text-foreground shadow-sm transition-colors","placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1","disabled:cursor-not-allowed disabled:opacity-50 disabled:bg-muted",r&&"border-destructive focus-visible:ring-destructive",t),...n}),l.jsx("button",{type:"button",className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",onClick:()=>i(o=>!o),children:a?l.jsx(J.EyeOff,{className:"h-4 w-4"}):l.jsx(J.EyeIcon,{className:"h-4 w-4"})})]})});Ru.displayName="PasswordInput";const $r=h.forwardRef(({className:t,isInvalid:e,"aria-invalid":r,...n},s)=>{const a=e??(r===!0||r==="true");return l.jsx("input",{ref:s,"aria-invalid":a||void 0,className:N("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-sm text-foreground transition-[border-color,box-shadow,color,background-color] outline-none","file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground","placeholder:text-muted-foreground","focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50","disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50","dark:bg-input/30 dark:disabled:bg-input/80",a&&"border-destructive focus-visible:border-destructive focus-visible:ring-destructive/20 dark:border-destructive/50 dark:focus-visible:ring-destructive/40",t),...n})});$r.displayName="Input";const Au=h.forwardRef(({className:t,...e},r)=>l.jsx("kbd",{ref:r,className:N("inline-flex min-h-6 items-center rounded-md border border-border bg-muted px-1.5 font-mono text-[11px] font-medium text-muted-foreground shadow-sm",t),...e}));Au.displayName="Kbd";const Dy=({lottieJson:t,title:e,description:r,actionLabel:n,onAction:s,fallbackIcon:a})=>l.jsxs("div",{className:"flex w-full flex-col items-center justify-center text-center",children:[t?l.jsx("div",{className:"mb-4 w-1/2",children:l.jsx(Rd,{animationData:t,loop:!0})}):a&&l.jsx("div",{className:"mb-4 text-[color:var(--oniratec-label-secondary)]",children:a}),l.jsx("h2",{className:"mb-2 text-lg font-semibold text-[color:var(--oniratec-label-primary)]",children:e}),r&&l.jsx("p",{className:"mb-6 max-w-md text-sm text-[color:var(--oniratec-label-secondary)]",children:r}),n&&s&&l.jsx(Le,{size:"md",onClick:s,children:n})]}),Mu=h.forwardRef(({className:t,indicatorClassName:e,max:r=100,value:n=0,...s},a)=>{const i=r>0?r:100,o=n==null?0:Math.min(Math.max(n,0),i),c=`${o/i*100}%`;return l.jsx("div",{ref:a,role:"progressbar","aria-valuemin":0,"aria-valuemax":i,"aria-valuenow":n==null?void 0:o,className:N("h-2 w-full overflow-hidden rounded-full bg-muted ring-1 ring-foreground/10",t),...s,children:l.jsx("div",{className:N("h-full rounded-full bg-primary transition-[width] duration-300",e),style:{width:c}})})});Mu.displayName="Progress";const Iu=h.createContext(null);function Ry(){const t=h.useContext(Iu);if(!t)throw new Error("RadioGroupItem must be used inside <RadioGroup>.");return t}function Ay({className:t,defaultValue:e,disabled:r,name:n,onValueChange:s,orientation:a="vertical",required:i,value:o,...c}){const u=h.useId(),[f,d]=h.useState(e),m=o!==void 0,p=m?o:f,y=h.useCallback(g=>{m||d(g),s?.(g)},[m,s]);return l.jsx(Iu.Provider,{value:{disabled:r,name:n??u,onValueChange:y,orientation:a,required:i,value:p},children:l.jsx("div",{role:"radiogroup","aria-required":i,"data-orientation":a,className:N("flex gap-3",a==="horizontal"?"flex-row flex-wrap items-center":"flex-col",t),...c})})}const Pu=h.forwardRef(({className:t,description:e,disabled:r,id:n,label:s,size:a="md",value:i,"aria-describedby":o,"aria-invalid":c,onChange:u,...f},d)=>{const m=h.useId(),p=n??m,y=e?`${p}-description`:void 0,g=c===!0||c==="true",x=Ry(),v=x.value===i,S=x.disabled||r;return l.jsxs("label",{htmlFor:p,className:N("inline-flex w-fit items-start gap-2.5 text-sm",S&&"cursor-not-allowed opacity-60",t),children:[l.jsx("input",{ref:d,id:p,type:"radio",name:x.name,value:i,checked:v,required:x.required,disabled:S,"aria-invalid":g||void 0,"aria-describedby":[o,y].filter(Boolean).join(" ")||void 0,className:"peer sr-only",onChange:C=>{C.target.checked&&x.onValueChange(i),u?.(C)},...f}),l.jsx("span",{className:N("flex shrink-0 items-center justify-center rounded-full border border-input bg-background text-primary transition-[background-color,border-color,box-shadow,color] outline-none","peer-focus-visible:border-ring peer-focus-visible:ring-3 peer-focus-visible:ring-ring/50","peer-disabled:border-input peer-disabled:bg-input/50","peer-checked:border-primary peer-checked:bg-primary/10 peer-checked:[&_span]:scale-100 peer-checked:[&_span]:opacity-100",g&&"border-destructive peer-focus-visible:border-destructive peer-focus-visible:ring-destructive/20",a==="sm"?"h-4 w-4":"h-5 w-5"),children:l.jsx("span",{className:N("rounded-full bg-primary opacity-0 transition-[opacity,transform]",a==="sm"?"h-2 w-2 scale-75":"h-2.5 w-2.5 scale-75")})}),(s||e)&&l.jsxs("span",{className:"grid gap-1 leading-tight",children:[s&&l.jsx("span",{className:"font-medium text-foreground",children:s}),e&&l.jsx("span",{id:y,className:"text-sm text-muted-foreground",children:e})]})]})});Pu.displayName="RadioGroupItem";const fs=pe.Root,My=pe.Group,hs=pe.Value,Kr=h.forwardRef(({className:t,hasError:e,children:r,...n},s)=>l.jsxs(pe.Trigger,{ref:s,"aria-invalid":e||void 0,className:N("flex h-8 w-full items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent px-2.5 py-1 pr-2 text-sm transition-[border-color,box-shadow,color,background-color] outline-none","data-[placeholder]:text-muted-foreground","focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50","disabled:cursor-not-allowed disabled:opacity-50","dark:bg-input/30 dark:hover:bg-input/50","[&>span]:line-clamp-1",e&&"border-destructive focus-visible:border-destructive focus-visible:ring-destructive/20 dark:border-destructive/50 dark:focus-visible:ring-destructive/40",t),...n,children:[r,l.jsx(pe.Icon,{asChild:!0,children:l.jsx(J.ChevronDown,{className:"h-4 w-4 shrink-0 text-muted-foreground"})})]}));Kr.displayName=pe.Trigger.displayName;const qa=h.forwardRef(({className:t,...e},r)=>l.jsx(pe.ScrollUpButton,{ref:r,className:N("flex cursor-default items-center justify-center bg-popover py-1",t),...e,children:l.jsx(J.ChevronUp,{className:"h-4 w-4"})}));qa.displayName=pe.ScrollUpButton.displayName;const Ya=h.forwardRef(({className:t,...e},r)=>l.jsx(pe.ScrollDownButton,{ref:r,className:N("flex cursor-default items-center justify-center bg-popover py-1",t),...e,children:l.jsx(J.ChevronDown,{className:"h-4 w-4"})}));Ya.displayName=pe.ScrollDownButton.displayName;const Qr=h.forwardRef(({className:t,children:e,position:r="popper",...n},s)=>l.jsx(pe.Portal,{children:l.jsxs(pe.Content,{ref:s,className:N("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-lg bg-popover text-popover-foreground shadow-card-sm ring-1 ring-foreground/10 outline-none","transition-[opacity,transform] duration-100","data-[state=closed]:opacity-0 data-[state=closed]:scale-95","data-[state=open]:opacity-100 data-[state=open]:scale-100",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:r,...n,children:[l.jsx(qa,{}),l.jsx(pe.Viewport,{className:N("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),l.jsx(Ya,{})]})}));Qr.displayName=pe.Content.displayName;const Fu=h.forwardRef(({className:t,...e},r)=>l.jsx(pe.Label,{ref:r,className:N("px-1.5 py-1 text-xs font-medium text-muted-foreground",t),...e}));Fu.displayName=pe.Label.displayName;const en=h.forwardRef(({className:t,children:e,...r},n)=>l.jsxs(pe.Item,{ref:n,className:N("relative flex w-full cursor-default select-none items-center gap-1.5 rounded-md py-1 pl-1.5 pr-8 text-sm outline-none transition-colors","focus:bg-accent focus:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...r,children:[l.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx(pe.ItemIndicator,{children:l.jsx(J.Check,{className:"h-4 w-4"})})}),l.jsx(pe.ItemText,{children:e})]}));en.displayName=pe.Item.displayName;const Lu=h.forwardRef(({className:t,...e},r)=>l.jsx(pe.Separator,{ref:r,className:N("-mx-1 my-1 h-px bg-border",t),...e}));Lu.displayName=pe.Separator.displayName;function Iy(t,e){const[r,n]=h.useState(t);return h.useEffect(()=>{const s=setTimeout(()=>n(t),e);return()=>clearTimeout(s)},[t,e]),r}function Ga({value:t,onValueChange:e,placeholder:r="Seleccionar",searchPlaceholder:n="Buscar...",disabled:s,hasError:a,minChars:i=2,debounceMs:o=300,fetcher:c,getOptionValue:u,getOptionLabel:f,emptyLabel:d="Sin resultados",loadingLabel:m="Buscando...",emptyActionLabel:p,onEmptyActionClick:y,contentClassName:g,triggerClassName:x}){const[v,S]=h.useState(!1),[C,k]=h.useState(""),[w,j]=h.useState(!1),[T,A]=h.useState([]),[$,L]=h.useState(""),z=Iy(C,o),B=z.trim().length>=i,G=h.useRef(null);h.useEffect(()=>{const H=P=>{G.current&&(G.current.contains(P.target)||S(!1))};return document.addEventListener("mousedown",H),()=>document.removeEventListener("mousedown",H)},[]),h.useEffect(()=>{let H=!0;return(async()=>{if(v){if(!B){A([]);return}j(!0);try{const U=await c(z.trim());if(!H)return;A(U??[])}finally{H&&j(!1)}}})(),()=>{H=!1}},[v,z,B,c]),h.useEffect(()=>{if(!t){L("");return}const H=T.find(P=>u(P)===t);H&&L(f(H))},[t,T,u,f]);const Q=$||r;return l.jsxs("div",{ref:G,className:"relative w-full",children:[l.jsxs("button",{type:"button",disabled:s,"aria-invalid":a?"true":"false","aria-expanded":v,"aria-haspopup":"listbox",onClick:()=>S(H=>!H),className:N("flex h-9 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm shadow-sm transition-colors","focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-1","disabled:cursor-not-allowed disabled:opacity-50",a&&"border-destructive focus:ring-destructive",x),children:[l.jsx("span",{className:N("truncate",!$&&"text-muted-foreground"),children:Q}),l.jsx(J.ChevronDown,{className:N("h-4 w-4 shrink-0 opacity-50 transition-transform",v&&"rotate-180")})]}),v&&l.jsxs("div",{className:N("absolute left-0 top-full z-50 mt-1 w-full rounded-md border border-border bg-popover shadow-card-sm",g),role:"listbox",children:[l.jsxs("div",{className:"flex items-center border-b border-border px-3",children:[l.jsx("input",{className:"flex h-9 w-full bg-transparent py-2 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",value:C,onChange:H=>k(H.target.value),placeholder:n,autoFocus:!0}),w&&l.jsx(J.Loader2,{className:"h-4 w-4 shrink-0 animate-spin text-muted-foreground"})]}),l.jsxs("div",{className:"max-h-60 overflow-y-auto p-1",children:[!B&&l.jsxs("p",{className:"py-2 text-center text-xs text-muted-foreground",children:["Escribe al menos ",i," caracteres"]}),B&&w&&l.jsx("p",{className:"py-2 text-center text-xs text-muted-foreground",children:m}),B&&!w&&T.length===0&&l.jsxs("div",{className:"flex flex-col items-center gap-2 py-3",children:[l.jsx("p",{className:"text-xs text-muted-foreground",children:d}),p&&y&&l.jsx("button",{type:"button",className:"text-xs font-medium text-primary hover:underline",onClick:y,children:p})]}),T.length>0&&l.jsx("ul",{children:T.map(H=>{const P=u(H),U=f(H),V=P===t;return l.jsx("li",{children:l.jsxs("button",{type:"button",role:"option","aria-selected":V,className:N("relative flex w-full cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors","hover:bg-accent hover:text-accent-foreground",V&&"bg-accent text-accent-foreground font-medium"),onClick:()=>{e(P),L(U),S(!1),k("")},children:[V&&l.jsx(J.Check,{className:"mr-2 h-4 w-4 shrink-0"}),l.jsx("span",{className:N(!V&&"ml-6"),children:U})]})},P)})})]})]})]})}const Vu=h.forwardRef(({className:t,decorative:e=!0,orientation:r="horizontal",...n},s)=>l.jsx("div",{ref:s,role:e?"none":"separator","aria-orientation":e?void 0:r,"data-orientation":r,className:N("shrink-0 bg-border",r==="horizontal"?"h-px w-full":"h-full w-px",t),...n}));Vu.displayName="Separator";const Py=yu,Fy=vu,Ly=cs,$u=xu,Xa=h.forwardRef(({className:t,...e},r)=>l.jsx(as,{ref:r,className:N("fixed inset-0 isolate z-50 bg-black/10 backdrop-blur-[2px] transition-opacity duration-100","data-[state=closed]:opacity-0 data-[state=open]:opacity-100",t),...e}));Xa.displayName=as.displayName;const Vy=Bn("fixed z-50 flex flex-col gap-4 bg-background p-4 text-sm ring-1 ring-foreground/10 shadow-card-lg outline-none transition-[opacity,transform] duration-100 data-[state=closed]:opacity-0 data-[state=open]:opacity-100",{variants:{side:{top:"inset-x-0 top-0 border-b border-border data-[state=closed]:-translate-y-6 data-[state=open]:translate-y-0",bottom:"inset-x-0 bottom-0 border-t border-border data-[state=closed]:translate-y-6 data-[state=open]:translate-y-0",left:"inset-y-0 left-0 h-full w-full max-w-sm border-r border-border data-[state=closed]:-translate-x-full data-[state=open]:translate-x-0",right:"inset-y-0 right-0 h-full w-full max-w-sm border-l border-border data-[state=closed]:translate-x-full data-[state=open]:translate-x-0"}},defaultVariants:{side:"right"}}),Wu=h.forwardRef(({side:t="right",className:e,children:r,hideClose:n,...s},a)=>l.jsxs($u,{children:[l.jsx(Xa,{}),l.jsxs(is,{ref:a,className:N(Vy({side:t}),e),...s,children:[!n&&l.jsx(cs,{asChild:!0,children:l.jsxs(Le,{variant:"ghost",size:"icon-sm",className:"absolute right-2 top-2","aria-label":"Cerrar",children:[l.jsx(J.X,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"Cerrar"})]})}),r]})]}));Wu.displayName=is.displayName;const zu=({className:t,...e})=>l.jsx("div",{className:N("flex flex-col gap-2",t),...e});zu.displayName="SheetHeader";const Zu=({className:t,...e})=>l.jsx("div",{className:N("-mx-4 -mb-4 mt-auto flex flex-col-reverse gap-2 border-t bg-muted/50 p-4 sm:flex-row sm:justify-end",t),...e});Zu.displayName="SheetFooter";const Bu=h.forwardRef(({className:t,...e},r)=>l.jsx(os,{ref:r,className:N("text-base font-medium leading-none text-foreground",t),...e}));Bu.displayName=os.displayName;const Uu=h.forwardRef(({className:t,...e},r)=>l.jsx(ls,{ref:r,className:N("text-sm text-muted-foreground",t),...e}));Uu.displayName=ls.displayName;function sa({className:t}){return l.jsx("div",{className:N("animate-pulse rounded-lg bg-muted/80",t)})}const Hu=h.forwardRef(({className:t,isInvalid:e,"aria-invalid":r,...n},s)=>{const a=e??(r===!0||r==="true");return l.jsx("textarea",{ref:s,"aria-invalid":a||void 0,className:N("min-h-20 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-sm text-foreground transition-[border-color,box-shadow,color,background-color] outline-none","placeholder:text-muted-foreground","focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50","disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50","dark:bg-input/30 dark:disabled:bg-input/80","resize-y",a&&"border-destructive focus-visible:border-destructive focus-visible:ring-destructive/20 dark:border-destructive/50 dark:focus-visible:ring-destructive/40",t),...n})});Hu.displayName="Textarea";const qu=h.createContext(null);function Ja(){const t=h.useContext(qu);if(!t)throw new Error("Tabs components must be used inside <Tabs>.");return t}function $y({children:t,className:e,defaultValue:r,onValueChange:n,orientation:s="horizontal",value:a,...i}){const o=h.useId(),[c,u]=h.useState(r),f=a!==void 0,d=f?a:c,m=h.useCallback(p=>{f||u(p),n?.(p)},[f,n]);return l.jsx(qu.Provider,{value:{baseId:o,onValueChange:m,orientation:s,value:d},children:l.jsx("div",{className:N("w-full",e),"data-orientation":s,...i,children:t})})}const Yu=h.forwardRef(({className:t,onKeyDown:e,...r},n)=>{const{onValueChange:s,orientation:a}=Ja();return l.jsx("div",{ref:n,role:"tablist","aria-orientation":a,className:N("inline-flex w-fit items-center gap-1 rounded-lg bg-muted p-1 text-muted-foreground ring-1 ring-foreground/10",a==="vertical"&&"flex-col items-stretch",t),onKeyDown:i=>{const o=a==="horizontal"?i.key==="ArrowRight":i.key==="ArrowDown",c=a==="horizontal"?i.key==="ArrowLeft":i.key==="ArrowUp",u=i.key==="Home"||i.key==="End";if(!o&&!c&&!u){e?.(i);return}const f=Array.from(i.currentTarget.querySelectorAll('[role="tab"]:not(:disabled)'));if(f.length===0){e?.(i);return}const d=f.findIndex(g=>g===document.activeElement);let m=d===-1?0:d;o&&(m=(d+1+f.length)%f.length),c&&(m=(d-1+f.length)%f.length),i.key==="Home"&&(m=0),i.key==="End"&&(m=f.length-1),i.preventDefault();const p=f[m];p?.focus();const y=p?.dataset.value;y&&s(y),e?.(i)},...r})});Yu.displayName="TabsList";const Gu=h.forwardRef(({children:t,className:e,value:r,...n},s)=>{const{baseId:a,onValueChange:i,orientation:o,value:c}=Ja(),u=r===c;return l.jsx("button",{ref:s,id:`${a}-trigger-${r}`,type:"button",role:"tab","aria-controls":`${a}-content-${r}`,"aria-selected":u,tabIndex:u?0:-1,"data-state":u?"active":"inactive","data-value":r,className:N("inline-flex h-8 items-center justify-center gap-1.5 rounded-md px-2.5 text-sm font-medium transition-[background-color,color,box-shadow,transform] outline-none","focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50","data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-card-sm","data-[state=inactive]:text-muted-foreground hover:text-foreground",o==="vertical"&&"justify-start",e),onClick:()=>i(r),...n,children:t})});Gu.displayName="TabsTrigger";const Xu=h.forwardRef(({className:t,forceMount:e=!1,value:r,...n},s)=>{const{baseId:a,value:i}=Ja(),o=r===i;return!o&&!e?null:l.jsx("div",{ref:s,id:`${a}-content-${r}`,role:"tabpanel","aria-labelledby":`${a}-trigger-${r}`,hidden:!o,tabIndex:0,"data-state":o?"active":"inactive",className:N("mt-4 outline-none focus-visible:ring-3 focus-visible:ring-ring/50",!o&&"hidden",t),...n})});Xu.displayName="TabsContent";function Wy(t){const e=h.useRef({value:t,previous:t});return h.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}var ms="Switch",[zy]=Un(ms),[Zy,By]=zy(ms),Ju=h.forwardRef((t,e)=>{const{__scopeSwitch:r,name:n,checked:s,defaultChecked:a,required:i,disabled:o,value:c="on",onCheckedChange:u,form:f,...d}=t,[m,p]=h.useState(null),y=$e(e,C=>p(C)),g=h.useRef(!1),x=m?f||!!m.closest("form"):!0,[v,S]=Ta({prop:s,defaultProp:a??!1,onChange:u,caller:ms});return l.jsxs(Zy,{scope:r,checked:v,disabled:o,children:[l.jsx(_e.button,{type:"button",role:"switch","aria-checked":v,"aria-required":i,"data-state":td(v),"data-disabled":o?"":void 0,disabled:o,value:c,...d,ref:y,onClick:Re(t.onClick,C=>{S(k=>!k),x&&(g.current=C.isPropagationStopped(),g.current||C.stopPropagation())})}),x&&l.jsx(ed,{control:m,bubbles:!g.current,name:n,value:c,checked:v,required:i,disabled:o,form:f,style:{transform:"translateX(-100%)"}})]})});Ju.displayName=ms;var Ku="SwitchThumb",Qu=h.forwardRef((t,e)=>{const{__scopeSwitch:r,...n}=t,s=By(Ku,r);return l.jsx(_e.span,{"data-state":td(s.checked),"data-disabled":s.disabled?"":void 0,...n,ref:e})});Qu.displayName=Ku;var Uy="SwitchBubbleInput",ed=h.forwardRef(({__scopeSwitch:t,control:e,checked:r,bubbles:n=!0,...s},a)=>{const i=h.useRef(null),o=$e(i,a),c=Wy(r),u=kl(e);return h.useEffect(()=>{const f=i.current;if(!f)return;const d=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(d,"checked").set;if(c!==r&&p){const y=new Event("click",{bubbles:n});p.call(f,r),f.dispatchEvent(y)}},[c,r,n]),l.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...s,tabIndex:-1,ref:o,style:{...s.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});ed.displayName=Uy;function td(t){return t?"checked":"unchecked"}var Hy=Ju,qy=Qu;const tn=h.forwardRef(({checked:t,defaultChecked:e=!1,onChange:r,size:n="md",disabled:s=!1,label:a,className:i,ariaLabel:o,id:c},u)=>{const f=h.useId(),d=c??f;return l.jsxs("div",{className:N("flex items-center gap-2",i),children:[l.jsx(Hy,{ref:u,id:d,checked:t,defaultChecked:e,onCheckedChange:r,disabled:s,"aria-label":o,className:N("peer inline-flex shrink-0 cursor-pointer items-center rounded-full border border-transparent transition-[background-color,box-shadow] outline-none","focus-visible:ring-3 focus-visible:ring-ring/50","disabled:cursor-not-allowed disabled:opacity-50","data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-muted/60",n==="sm"?"h-4 w-7":"h-5 w-9"),children:l.jsx(qy,{className:N("pointer-events-none block rounded-full bg-background shadow-sm ring-1 ring-black/10 transition-transform dark:ring-white/20",n==="sm"?"h-3 w-3 translate-x-0.5 data-[state=checked]:translate-x-3":"h-4 w-4 translate-x-0.5 data-[state=checked]:translate-x-4")})}),a&&l.jsx("label",{htmlFor:d,className:N("text-sm font-medium text-foreground",s&&"cursor-not-allowed opacity-50"),children:a})]})});tn.displayName="Toggle";const Yy=tn;function Gy(t){if(typeof document>"u")return;let e=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}const Xy=t=>{switch(t){case"success":return Qy;case"info":return tv;case"warning":return ev;case"error":return rv;default:return null}},Jy=Array(12).fill(0),Ky=({visible:t,className:e})=>b.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},b.createElement("div",{className:"sonner-spinner"},Jy.map((r,n)=>b.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),Qy=b.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},b.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),ev=b.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},b.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),tv=b.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},b.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),rv=b.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},b.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),nv=b.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},b.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),b.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),sv=()=>{const[t,e]=b.useState(document.hidden);return b.useEffect(()=>{const r=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),t};let aa=1;class av{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{const r=this.subscribers.indexOf(e);this.subscribers.splice(r,1)}),this.publish=e=>{this.subscribers.forEach(r=>r(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var r;const{message:n,...s}=e,a=typeof e?.id=="number"||((r=e.id)==null?void 0:r.length)>0?e.id:aa++,i=this.toasts.find(c=>c.id===a),o=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),i?this.toasts=this.toasts.map(c=>c.id===a?(this.publish({...c,...e,id:a,title:n}),{...c,...e,id:a,dismissible:o,title:n}):c):this.addToast({title:n,...s,dismissible:o,id:a}),a},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:e,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(n=>n({id:r.id,dismiss:!0}))}),e),this.message=(e,r)=>this.create({...r,message:e}),this.error=(e,r)=>this.create({...r,message:e,type:"error"}),this.success=(e,r)=>this.create({...r,type:"success",message:e}),this.info=(e,r)=>this.create({...r,type:"info",message:e}),this.warning=(e,r)=>this.create({...r,type:"warning",message:e}),this.loading=(e,r)=>this.create({...r,type:"loading",message:e}),this.promise=(e,r)=>{if(!r)return;let n;r.loading!==void 0&&(n=this.create({...r,promise:e,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const s=Promise.resolve(e instanceof Function?e():e);let a=n!==void 0,i;const o=s.then(async u=>{if(i=["resolve",u],b.isValidElement(u))a=!1,this.create({id:n,type:"default",message:u});else if(ov(u)&&!u.ok){a=!1;const d=typeof r.error=="function"?await r.error(`HTTP error! status: ${u.status}`):r.error,m=typeof r.description=="function"?await r.description(`HTTP error! status: ${u.status}`):r.description,y=typeof d=="object"&&!b.isValidElement(d)?d:{message:d};this.create({id:n,type:"error",description:m,...y})}else if(u instanceof Error){a=!1;const d=typeof r.error=="function"?await r.error(u):r.error,m=typeof r.description=="function"?await r.description(u):r.description,y=typeof d=="object"&&!b.isValidElement(d)?d:{message:d};this.create({id:n,type:"error",description:m,...y})}else if(r.success!==void 0){a=!1;const d=typeof r.success=="function"?await r.success(u):r.success,m=typeof r.description=="function"?await r.description(u):r.description,y=typeof d=="object"&&!b.isValidElement(d)?d:{message:d};this.create({id:n,type:"success",description:m,...y})}}).catch(async u=>{if(i=["reject",u],r.error!==void 0){a=!1;const f=typeof r.error=="function"?await r.error(u):r.error,d=typeof r.description=="function"?await r.description(u):r.description,p=typeof f=="object"&&!b.isValidElement(f)?f:{message:f};this.create({id:n,type:"error",description:d,...p})}}).finally(()=>{a&&(this.dismiss(n),n=void 0),r.finally==null||r.finally.call(r)}),c=()=>new Promise((u,f)=>o.then(()=>i[0]==="reject"?f(i[1]):u(i[1])).catch(f));return typeof n!="string"&&typeof n!="number"?{unwrap:c}:Object.assign(n,{unwrap:c})},this.custom=(e,r)=>{const n=r?.id||aa++;return this.create({jsx:e(n),id:n,...r}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const De=new av,iv=(t,e)=>{const r=e?.id||aa++;return De.addToast({title:t,...e,id:r}),r},ov=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",lv=iv,cv=()=>De.toasts,uv=()=>De.getActiveToasts(),dv=Object.assign(lv,{success:De.success,info:De.info,warning:De.warning,error:De.error,custom:De.custom,message:De.message,promise:De.promise,dismiss:De.dismiss,loading:De.loading},{getHistory:cv,getToasts:uv});Gy("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function yn(t){return t.label!==void 0}const fv=3,hv="24px",mv="16px",yo=4e3,pv=356,gv=14,yv=45,vv=200;function nt(...t){return t.filter(Boolean).join(" ")}function xv(t){const[e,r]=t.split("-"),n=[];return e&&n.push(e),r&&n.push(r),n}const bv=t=>{var e,r,n,s,a,i,o,c,u;const{invert:f,toast:d,unstyled:m,interacting:p,setHeights:y,visibleToasts:g,heights:x,index:v,toasts:S,expanded:C,removeToast:k,defaultRichColors:w,closeButton:j,style:T,cancelButtonStyle:A,actionButtonStyle:$,className:L="",descriptionClassName:z="",duration:B,position:G,gap:Q,expandByDefault:H,classNames:P,icons:U,closeButtonAriaLabel:V="Close toast"}=t,[ie,F]=b.useState(null),[D,ee]=b.useState(null),[W,oe]=b.useState(!1),[ce,ve]=b.useState(!1),[Te,le]=b.useState(!1),[vt,Yt]=b.useState(!1),[Gt,xt]=b.useState(!1),[Xt,ps]=b.useState(0),[bd,ri]=b.useState(0),Er=b.useRef(d.duration||B||yo),ni=b.useRef(null),ht=b.useRef(null),wd=v===0,kd=v+1<=g,Ae=d.type,Jt=d.dismissible!==!1,Sd=d.className||"",Nd=d.descriptionClassName||"",rn=b.useMemo(()=>x.findIndex(X=>X.toastId===d.id)||0,[x,d.id]),Cd=b.useMemo(()=>{var X;return(X=d.closeButton)!=null?X:j},[d.closeButton,j]),si=b.useMemo(()=>d.duration||B||yo,[d.duration,B]),gs=b.useRef(0),Kt=b.useRef(0),ai=b.useRef(0),Qt=b.useRef(null),[_d,Td]=G.split("-"),ii=b.useMemo(()=>x.reduce((X,xe,we)=>we>=rn?X:X+xe.height,0),[x,rn]),oi=sv(),jd=d.invert||f,ys=Ae==="loading";Kt.current=b.useMemo(()=>rn*Q+ii,[rn,ii]),b.useEffect(()=>{Er.current=si},[si]),b.useEffect(()=>{oe(!0)},[]),b.useEffect(()=>{const X=ht.current;if(X){const xe=X.getBoundingClientRect().height;return ri(xe),y(we=>[{toastId:d.id,height:xe,position:d.position},...we]),()=>y(we=>we.filter(Me=>Me.toastId!==d.id))}},[y,d.id]),b.useLayoutEffect(()=>{if(!W)return;const X=ht.current,xe=X.style.height;X.style.height="auto";const we=X.getBoundingClientRect().height;X.style.height=xe,ri(we),y(Me=>Me.find(be=>be.toastId===d.id)?Me.map(be=>be.toastId===d.id?{...be,height:we}:be):[{toastId:d.id,height:we,position:d.position},...Me])},[W,d.title,d.description,y,d.id,d.jsx,d.action,d.cancel]);const bt=b.useCallback(()=>{ve(!0),ps(Kt.current),y(X=>X.filter(xe=>xe.toastId!==d.id)),setTimeout(()=>{k(d)},vv)},[d,k,y,Kt]);b.useEffect(()=>{if(d.promise&&Ae==="loading"||d.duration===1/0||d.type==="loading")return;let X;return C||p||oi?(()=>{if(ai.current<gs.current){const Me=new Date().getTime()-gs.current;Er.current=Er.current-Me}ai.current=new Date().getTime()})():Er.current!==1/0&&(gs.current=new Date().getTime(),X=setTimeout(()=>{d.onAutoClose==null||d.onAutoClose.call(d,d),bt()},Er.current)),()=>clearTimeout(X)},[C,p,d,Ae,oi,bt]),b.useEffect(()=>{d.delete&&(bt(),d.onDismiss==null||d.onDismiss.call(d,d))},[bt,d.delete]);function Ed(){var X;if(U?.loading){var xe;return b.createElement("div",{className:nt(P?.loader,d==null||(xe=d.classNames)==null?void 0:xe.loader,"sonner-loader"),"data-visible":Ae==="loading"},U.loading)}return b.createElement(Ky,{className:nt(P?.loader,d==null||(X=d.classNames)==null?void 0:X.loader),visible:Ae==="loading"})}const Od=d.icon||U?.[Ae]||Xy(Ae);var li,ci;return b.createElement("li",{tabIndex:0,ref:ht,className:nt(L,Sd,P?.toast,d==null||(e=d.classNames)==null?void 0:e.toast,P?.default,P?.[Ae],d==null||(r=d.classNames)==null?void 0:r[Ae]),"data-sonner-toast":"","data-rich-colors":(li=d.richColors)!=null?li:w,"data-styled":!(d.jsx||d.unstyled||m),"data-mounted":W,"data-promise":!!d.promise,"data-swiped":Gt,"data-removed":ce,"data-visible":kd,"data-y-position":_d,"data-x-position":Td,"data-index":v,"data-front":wd,"data-swiping":Te,"data-dismissible":Jt,"data-type":Ae,"data-invert":jd,"data-swipe-out":vt,"data-swipe-direction":D,"data-expanded":!!(C||H&&W),"data-testid":d.testId,style:{"--index":v,"--toasts-before":v,"--z-index":S.length-v,"--offset":`${ce?Xt:Kt.current}px`,"--initial-height":H?"auto":`${bd}px`,...T,...d.style},onDragEnd:()=>{le(!1),F(null),Qt.current=null},onPointerDown:X=>{X.button!==2&&(ys||!Jt||(ni.current=new Date,ps(Kt.current),X.target.setPointerCapture(X.pointerId),X.target.tagName!=="BUTTON"&&(le(!0),Qt.current={x:X.clientX,y:X.clientY})))},onPointerUp:()=>{var X,xe,we;if(vt||!Jt)return;Qt.current=null;const Me=Number(((X=ht.current)==null?void 0:X.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),nn=Number(((xe=ht.current)==null?void 0:xe.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),be=new Date().getTime()-((we=ni.current)==null?void 0:we.getTime()),We=ie==="x"?Me:nn,sn=Math.abs(We)/be;if(Math.abs(We)>=yv||sn>.11){ps(Kt.current),d.onDismiss==null||d.onDismiss.call(d,d),ee(ie==="x"?Me>0?"right":"left":nn>0?"down":"up"),bt(),Yt(!0);return}else{var He,qe;(He=ht.current)==null||He.style.setProperty("--swipe-amount-x","0px"),(qe=ht.current)==null||qe.style.setProperty("--swipe-amount-y","0px")}xt(!1),le(!1),F(null)},onPointerMove:X=>{var xe,we,Me;if(!Qt.current||!Jt||((xe=window.getSelection())==null?void 0:xe.toString().length)>0)return;const be=X.clientY-Qt.current.y,We=X.clientX-Qt.current.x;var sn;const He=(sn=t.swipeDirections)!=null?sn:xv(G);!ie&&(Math.abs(We)>1||Math.abs(be)>1)&&F(Math.abs(We)>Math.abs(be)?"x":"y");let qe={x:0,y:0};const ui=Mt=>1/(1.5+Math.abs(Mt)/20);if(ie==="y"){if(He.includes("top")||He.includes("bottom"))if(He.includes("top")&&be<0||He.includes("bottom")&&be>0)qe.y=be;else{const Mt=be*ui(be);qe.y=Math.abs(Mt)<Math.abs(be)?Mt:be}}else if(ie==="x"&&(He.includes("left")||He.includes("right")))if(He.includes("left")&&We<0||He.includes("right")&&We>0)qe.x=We;else{const Mt=We*ui(We);qe.x=Math.abs(Mt)<Math.abs(We)?Mt:We}(Math.abs(qe.x)>0||Math.abs(qe.y)>0)&&xt(!0),(we=ht.current)==null||we.style.setProperty("--swipe-amount-x",`${qe.x}px`),(Me=ht.current)==null||Me.style.setProperty("--swipe-amount-y",`${qe.y}px`)}},Cd&&!d.jsx&&Ae!=="loading"?b.createElement("button",{"aria-label":V,"data-disabled":ys,"data-close-button":!0,onClick:ys||!Jt?()=>{}:()=>{bt(),d.onDismiss==null||d.onDismiss.call(d,d)},className:nt(P?.closeButton,d==null||(n=d.classNames)==null?void 0:n.closeButton)},(ci=U?.close)!=null?ci:nv):null,(Ae||d.icon||d.promise)&&d.icon!==null&&(U?.[Ae]!==null||d.icon)?b.createElement("div",{"data-icon":"",className:nt(P?.icon,d==null||(s=d.classNames)==null?void 0:s.icon)},d.promise||d.type==="loading"&&!d.icon?d.icon||Ed():null,d.type!=="loading"?Od:null):null,b.createElement("div",{"data-content":"",className:nt(P?.content,d==null||(a=d.classNames)==null?void 0:a.content)},b.createElement("div",{"data-title":"",className:nt(P?.title,d==null||(i=d.classNames)==null?void 0:i.title)},d.jsx?d.jsx:typeof d.title=="function"?d.title():d.title),d.description?b.createElement("div",{"data-description":"",className:nt(z,Nd,P?.description,d==null||(o=d.classNames)==null?void 0:o.description)},typeof d.description=="function"?d.description():d.description):null),b.isValidElement(d.cancel)?d.cancel:d.cancel&&yn(d.cancel)?b.createElement("button",{"data-button":!0,"data-cancel":!0,style:d.cancelButtonStyle||A,onClick:X=>{yn(d.cancel)&&Jt&&(d.cancel.onClick==null||d.cancel.onClick.call(d.cancel,X),bt())},className:nt(P?.cancelButton,d==null||(c=d.classNames)==null?void 0:c.cancelButton)},d.cancel.label):null,b.isValidElement(d.action)?d.action:d.action&&yn(d.action)?b.createElement("button",{"data-button":!0,"data-action":!0,style:d.actionButtonStyle||$,onClick:X=>{yn(d.action)&&(d.action.onClick==null||d.action.onClick.call(d.action,X),!X.defaultPrevented&&bt())},className:nt(P?.actionButton,d==null||(u=d.classNames)==null?void 0:u.actionButton)},d.action.label):null)};function vo(){if(typeof window>"u"||typeof document>"u")return"ltr";const t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function wv(t,e){const r={};return[t,e].forEach((n,s)=>{const a=s===1,i=a?"--mobile-offset":"--offset",o=a?mv:hv;function c(u){["top","right","bottom","left"].forEach(f=>{r[`${i}-${f}`]=typeof u=="number"?`${u}px`:u})}typeof n=="number"||typeof n=="string"?c(n):typeof n=="object"?["top","right","bottom","left"].forEach(u=>{n[u]===void 0?r[`${i}-${u}`]=o:r[`${i}-${u}`]=typeof n[u]=="number"?`${n[u]}px`:n[u]}):c(o)}),r}const kv=b.forwardRef(function(e,r){const{id:n,invert:s,position:a="bottom-right",hotkey:i=["altKey","KeyT"],expand:o,closeButton:c,className:u,offset:f,mobileOffset:d,theme:m="light",richColors:p,duration:y,style:g,visibleToasts:x=fv,toastOptions:v,dir:S=vo(),gap:C=gv,icons:k,containerAriaLabel:w="Notifications"}=e,[j,T]=b.useState([]),A=b.useMemo(()=>n?j.filter(W=>W.toasterId===n):j.filter(W=>!W.toasterId),[j,n]),$=b.useMemo(()=>Array.from(new Set([a].concat(A.filter(W=>W.position).map(W=>W.position)))),[A,a]),[L,z]=b.useState([]),[B,G]=b.useState(!1),[Q,H]=b.useState(!1),[P,U]=b.useState(m!=="system"?m:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),V=b.useRef(null),ie=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),F=b.useRef(null),D=b.useRef(!1),ee=b.useCallback(W=>{T(oe=>{var ce;return(ce=oe.find(ve=>ve.id===W.id))!=null&&ce.delete||De.dismiss(W.id),oe.filter(({id:ve})=>ve!==W.id)})},[]);return b.useEffect(()=>De.subscribe(W=>{if(W.dismiss){requestAnimationFrame(()=>{T(oe=>oe.map(ce=>ce.id===W.id?{...ce,delete:!0}:ce))});return}setTimeout(()=>{ma.flushSync(()=>{T(oe=>{const ce=oe.findIndex(ve=>ve.id===W.id);return ce!==-1?[...oe.slice(0,ce),{...oe[ce],...W},...oe.slice(ce+1)]:[W,...oe]})})})}),[j]),b.useEffect(()=>{if(m!=="system"){U(m);return}if(m==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?U("dark"):U("light")),typeof window>"u")return;const W=window.matchMedia("(prefers-color-scheme: dark)");try{W.addEventListener("change",({matches:oe})=>{U(oe?"dark":"light")})}catch{W.addListener(({matches:ce})=>{try{U(ce?"dark":"light")}catch(ve){console.error(ve)}})}},[m]),b.useEffect(()=>{j.length<=1&&G(!1)},[j]),b.useEffect(()=>{const W=oe=>{var ce;if(i.every(le=>oe[le]||oe.code===le)){var Te;G(!0),(Te=V.current)==null||Te.focus()}oe.code==="Escape"&&(document.activeElement===V.current||(ce=V.current)!=null&&ce.contains(document.activeElement))&&G(!1)};return document.addEventListener("keydown",W),()=>document.removeEventListener("keydown",W)},[i]),b.useEffect(()=>{if(V.current)return()=>{F.current&&(F.current.focus({preventScroll:!0}),F.current=null,D.current=!1)}},[V.current]),b.createElement("section",{ref:r,"aria-label":`${w} ${ie}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},$.map((W,oe)=>{var ce;const[ve,Te]=W.split("-");return A.length?b.createElement("ol",{key:W,dir:S==="auto"?vo():S,tabIndex:-1,ref:V,className:u,"data-sonner-toaster":!0,"data-sonner-theme":P,"data-y-position":ve,"data-x-position":Te,style:{"--front-toast-height":`${((ce=L[0])==null?void 0:ce.height)||0}px`,"--width":`${pv}px`,"--gap":`${C}px`,...g,...wv(f,d)},onBlur:le=>{D.current&&!le.currentTarget.contains(le.relatedTarget)&&(D.current=!1,F.current&&(F.current.focus({preventScroll:!0}),F.current=null))},onFocus:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||D.current||(D.current=!0,F.current=le.relatedTarget)},onMouseEnter:()=>G(!0),onMouseMove:()=>G(!0),onMouseLeave:()=>{Q||G(!1)},onDragEnd:()=>G(!1),onPointerDown:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||H(!0)},onPointerUp:()=>H(!1)},A.filter(le=>!le.position&&oe===0||le.position===W).map((le,vt)=>{var Yt,Gt;return b.createElement(bv,{key:le.id,icons:k,index:vt,toast:le,defaultRichColors:p,duration:(Yt=v?.duration)!=null?Yt:y,className:v?.className,descriptionClassName:v?.descriptionClassName,invert:s,visibleToasts:x,closeButton:(Gt=v?.closeButton)!=null?Gt:c,interacting:Q,position:W,style:v?.style,unstyled:v?.unstyled,classNames:v?.classNames,cancelButtonStyle:v?.cancelButtonStyle,actionButtonStyle:v?.actionButtonStyle,closeButtonAriaLabel:v?.closeButtonAriaLabel,removeToast:ee,toasts:A.filter(xt=>xt.position==le.position),heights:L.filter(xt=>xt.position==le.position),setHeights:z,expandByDefault:o,gap:C,expanded:B,swipeDirections:e.swipeDirections})})):null}))});function Sv({...t}){return l.jsx(kv,{position:"bottom-right",richColors:!1,toastOptions:{classNames:{toast:"group toast rounded-xl bg-background text-foreground shadow-card-sm ring-1 ring-foreground/10",title:"text-sm font-medium",description:"text-sm text-muted-foreground",actionButton:"!h-8 !rounded-md !border-0 !bg-primary !px-2.5 !text-sm !font-medium !text-primary-foreground",cancelButton:"!h-8 !rounded-md !border !border-border !bg-background !px-2.5 !text-sm !font-medium !text-foreground hover:!bg-muted",error:"!bg-destructive/10 !text-foreground !ring-destructive/20",success:"!bg-primary/5 !text-foreground !ring-primary/15",warning:"!bg-amber-500/10 !text-foreground !ring-amber-500/20",info:"!bg-accent !text-accent-foreground !ring-foreground/10"}},...t})}const Nv=Wt.Provider,Cv=Wt.Root,_v=Wt.Trigger,rd=b.forwardRef(({className:t,sideOffset:e=6,children:r,...n},s)=>l.jsx(Wt.Portal,{children:l.jsxs(Wt.Content,{ref:s,sideOffset:e,className:N("z-50 overflow-hidden rounded-md bg-foreground px-2.5 py-1 text-xs font-medium text-background shadow-card-sm","transition-[opacity,transform] duration-100","data-[state=closed]:opacity-0 data-[state=closed]:scale-95","data-[state=delayed-open]:opacity-100 data-[state=delayed-open]:scale-100",t),...n,children:[r,l.jsx(Wt.Arrow,{className:"fill-foreground"})]})}));rd.displayName=Wt.Content.displayName;const nd=({logo:t,children:e,footer:r,className:n})=>l.jsx("div",{className:"flex min-h-screen items-center justify-center bg-gradient-to-br from-[--surface-1] via-[--surface-2] to-[--surface-1] px-4 py-12",children:l.jsxs("div",{className:N("w-full max-w-sm rounded-xl bg-[--surface-1] p-8","shadow-[var(--shadow-card-xl)] border border-[--border-1]","flex flex-col gap-6",n),children:[t&&l.jsx("div",{className:"flex justify-center",children:t.href?l.jsx("a",{href:t.href,className:"focus-visible:outline-none focus-visible:ring-2",children:l.jsx("img",{src:t.src,alt:t.alt,className:"h-10 w-auto"})}):l.jsx("img",{src:t.src,alt:t.alt,className:"h-10 w-auto"})}),l.jsx("div",{className:"flex flex-col gap-4",children:e}),r&&l.jsx("div",{className:"border-t border-[--border-1] pt-4 text-center text-xs text-[--text-2]",children:r})]})});nd.displayName="AuthLayout";function Tv({items:t,className:e,separator:r,renderLink:n}){const s=r??l.jsx(J.ChevronRight,{className:"h-4 w-4 text-[color:var(--oniratec-label-secondary)]"});return l.jsx("nav",{"aria-label":"Breadcrumb",className:e,children:l.jsx("ol",{className:"flex flex-wrap items-center gap-2 text-sm",children:t.map((a,i)=>{const o=i===t.length-1,c=l.jsx("span",{className:N("transition-colors",o?"font-medium text-[color:var(--oniratec-label-primary)]":"text-[color:var(--oniratec-label-secondary)] hover:text-[color:var(--oniratec-label-primary)]"),children:a.label}),u="inline-flex items-center gap-1 rounded-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[color:var(--oniratec-focus)] focus-visible:ring-offset-2 focus-visible:ring-offset-[color:var(--oniratec-fill-primary)]";return l.jsxs("li",{className:"flex items-center gap-2",children:[o?l.jsx("span",{"aria-current":"page",children:c}):n?n({item:a,className:u,children:c}):a.href?l.jsx("a",{href:a.href,className:u,children:c}):l.jsx("button",{type:"button",onClick:a.onClick,className:u,children:c}),!o&&l.jsx("span",{"aria-hidden":"true",children:s})]},`${a.label}-${i}`)})})})}function jv({open:t,onOpenChange:e,title:r,description:n,confirmLabel:s="Confirmar",cancelLabel:a="Cancelar",variant:i="default",onConfirm:o,loading:c=!1}){const u=async()=>{await o()};return l.jsx(bu,{open:t,onOpenChange:e,children:l.jsxs(za,{className:"max-w-sm",hideClose:!0,children:[l.jsxs(Za,{children:[l.jsx(Ua,{children:r}),n&&l.jsx(Ha,{children:n})]}),l.jsxs(Ba,{children:[l.jsx(Le,{variant:"secondary",onClick:()=>e(!1),disabled:c,children:a}),l.jsxs(Le,{variant:i==="destructive"?"destructive":"default",onClick:u,disabled:c,children:[c&&l.jsx(J.Loader2,{className:"h-4 w-4 animate-spin"}),s]})]})]})})}const xo="onira-sidebar-collapsed",Ev=({to:t,children:e,className:r,onClick:n})=>l.jsx("a",{href:t,className:r,onClick:n,children:e});function Ov({item:t,collapsed:e,LinkComponent:r,onMobileClose:n}){const s=r??Ev,a=t.icon;return l.jsxs(s,{to:t.to,end:t.end,className:N("group flex items-center gap-3 rounded-md px-3 py-2 text-sm font-medium transition-colors","text-muted-foreground hover:bg-accent hover:text-accent-foreground","aria-[current=page]:bg-primary/10 aria-[current=page]:text-primary",e&&"justify-center px-2"),onClick:n,children:[a&&l.jsx(a,{className:N("h-4 w-4 shrink-0 transition-colors","group-[.active]:text-primary")}),!e&&l.jsx("span",{className:"flex-1 truncate",children:t.label}),!e&&t.badge!==void 0&&l.jsx(pa,{variant:"secondary",size:"sm",children:t.badge})]})}function bo({navSections:t,logo:e,appName:r,collapsed:n,LinkComponent:s,onMobileClose:a}){return l.jsxs("div",{className:"flex h-full flex-col overflow-hidden",children:[l.jsxs("div",{className:N("flex h-14 items-center border-b border-border px-4 shrink-0",n?"justify-center px-2":"gap-2"),children:[e&&l.jsx("div",{className:"shrink-0",children:e}),!n&&r&&l.jsx("span",{className:"truncate text-sm font-semibold text-foreground",children:r})]}),l.jsx("nav",{className:"flex-1 overflow-y-auto px-2 py-3 space-y-4",children:t.map((i,o)=>l.jsxs("div",{className:"space-y-1",children:[!n&&i.title&&l.jsx("p",{className:"px-3 pb-1 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:i.title}),i.items.map(c=>l.jsx(Ov,{item:c,collapsed:n,LinkComponent:s,onMobileClose:a},c.to))]},o))})]})}function Dv({navSections:t,logo:e,appName:r,headerActions:n,children:s,LinkComponent:a}){const[i,o]=h.useState(()=>{try{return localStorage.getItem(xo)==="true"}catch{return!1}}),[c,u]=h.useState(!1),f=()=>{const d=!i;o(d);try{localStorage.setItem(xo,String(d))}catch{return}};return l.jsxs("div",{className:"flex h-screen overflow-hidden bg-background",children:[l.jsxs("aside",{className:N("hidden md:flex flex-col border-r border-border bg-card transition-all duration-200 relative",i?"w-14":"w-60"),children:[l.jsx(bo,{navSections:t,logo:e,appName:r,collapsed:i,LinkComponent:a}),l.jsx("button",{type:"button",onClick:f,className:N("absolute -right-3 top-16 z-10 flex h-6 w-6 items-center justify-center rounded-full border border-border bg-background text-muted-foreground shadow-card-sm transition-colors hover:bg-accent hover:text-accent-foreground"),"aria-label":i?"Expandir sidebar":"Colapsar sidebar",children:i?l.jsx(J.ChevronRight,{className:"h-3 w-3"}):l.jsx(J.ChevronLeft,{className:"h-3 w-3"})})]}),c&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-40 bg-black/50 md:hidden",onClick:()=>u(!1)}),l.jsxs("div",{className:"fixed inset-y-0 left-0 z-50 w-72 bg-card shadow-card-xl md:hidden",children:[l.jsx("div",{className:"absolute right-3 top-3",children:l.jsx("button",{type:"button",onClick:()=>u(!1),className:"rounded-md p-1.5 text-muted-foreground hover:text-foreground",children:l.jsx(J.X,{className:"h-5 w-5"})})}),l.jsx(bo,{navSections:t,logo:e,appName:r,collapsed:!1,LinkComponent:a,onMobileClose:()=>u(!1)})]})]}),l.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[l.jsxs("header",{className:"flex h-14 shrink-0 items-center justify-between border-b border-border bg-card px-4 md:px-6",children:[l.jsx("button",{type:"button",className:"md:hidden rounded-md p-1.5 text-muted-foreground hover:text-foreground",onClick:()=>u(!0),"aria-label":"Abrir menú",children:l.jsx(J.Menu,{className:"h-5 w-5"})}),l.jsx("div",{className:"hidden md:block"}),n&&l.jsx("div",{className:"flex items-center gap-2",children:n})]}),l.jsx("main",{className:"flex-1 overflow-y-auto",children:s})]})]})}function wo(t){return t?Array.isArray(t)?t:[t]:[]}function Rv(t,e){return t==null&&e==null?0:t==null?1:e==null?-1:typeof t=="number"&&typeof e=="number"?t-e:typeof t=="boolean"&&typeof e=="boolean"?Number(t)-Number(e):t instanceof Date&&e instanceof Date?t.getTime()-e.getTime():String(t).localeCompare(String(e),void 0,{numeric:!0,sensitivity:"base"})}function sd({columns:t,data:e,enableSorting:r=!0,sortState:n,defaultSortState:s=null,onSortChange:a,unsortedIcon:i="muted",sortMode:o="single",manualSorting:c=!1,emptyContent:u,loadingContent:f,errorContent:d,isLoading:m=!1}){const[p,y]=b.useState(s),g=n!==void 0?n:p,x=wo(g),v=b.useMemo(()=>new Map(t.map(w=>[w.key,w])),[t]),S=b.useMemo(()=>{if(c||!r||x.length===0)return e;const w=[...e];return w.sort((j,T)=>{for(const A of x){const $=v.get(A.columnId);if(!$)continue;const z=($.sortFn??((B,G)=>{const Q=$.sortValue?.(B)??B[$.key],H=$.sortValue?.(G)??G[$.key];return Rv(Q,H)}))(j,T);if(z!==0)return A.direction==="asc"?z:-z}return 0}),w},[e,c,x,v,r]),C=w=>{n===void 0&&y(w),a?.(w)},k=(w,j)=>{if(!(r&&(w.sortable??!!(w.sortFn||w.sortValue))))return;const A=wo(g),$=A.find(z=>z.columnId===w.key),L=$?.direction==="asc"?"desc":$?.direction==="desc"?null:"asc";if(o==="multi"&&j){const z=A.filter(B=>B.columnId!==w.key);L&&z.push({columnId:w.key,direction:L}),C(z.length?z:null);return}if(!L){C(null);return}C({columnId:w.key,direction:L})};return l.jsx("div",{className:"oniratec-data-table",children:l.jsxs("table",{className:"oniratec-data-table__table",children:[l.jsx("thead",{className:"oniratec-data-table__head",children:l.jsx("tr",{className:"oniratec-data-table__head-row",children:t.map(w=>{const j=r&&(w.sortable??!!(w.sortFn||w.sortValue)),A=x.find(L=>L.columnId===w.key)?.direction,$=j?A==="asc"?"ascending":A==="desc"?"descending":"none":void 0;return l.jsx("th",{scope:"col","aria-sort":$,className:N("oniratec-data-table__th",w.headerClassName),children:j?l.jsxs("button",{type:"button",onClick:L=>k(w,L.shiftKey),className:"oniratec-data-table__sort-button",children:[l.jsx("span",{className:"flex-1",children:w.header}),l.jsxs("span",{className:N("oniratec-data-table__sort-icon",A&&"oniratec-data-table__sort-icon--active",!A&&i==="placeholder"&&"opacity-0",!A&&i==="hidden"&&"hidden"),"aria-hidden":"true",children:[A==="asc"&&l.jsx(J.ChevronUp,{className:"h-4 w-4"}),A==="desc"&&l.jsx(J.ChevronDown,{className:"h-4 w-4"}),!A&&i!=="hidden"&&l.jsx(J.ChevronsUpDown,{className:"h-4 w-4"})]})]}):w.header},w.key)})})}),l.jsx("tbody",{className:"oniratec-data-table__divider",children:d&&!m?l.jsx("tr",{children:l.jsx("td",{colSpan:t.length,className:"oniratec-data-table__empty",children:d})}):m?l.jsx("tr",{children:l.jsx("td",{colSpan:t.length,className:"oniratec-data-table__empty",children:f??"Cargando..."})}):S.length===0?l.jsx("tr",{children:l.jsx("td",{colSpan:t.length,className:"oniratec-data-table__empty",children:u??"No hay datos disponibles."})}):S.map((w,j)=>l.jsx("tr",{className:"oniratec-data-table__row",children:t.map(T=>l.jsx("td",{className:N("oniratec-data-table__td",T.className),children:T.render(w)},T.key))},j))})]})})}const Av=[5,10,25,50],ad=({value:t,onChange:e,options:r=Av})=>l.jsxs("div",{className:"flex items-center gap-2 text-[color:var(--oniratec-label-secondary)]",children:[l.jsx("span",{children:"Mostrar"}),l.jsxs(fs,{value:t.toString(),onValueChange:n=>{e(parseInt(n))},children:[l.jsx(Kr,{children:l.jsx(hs,{})}),l.jsx(Qr,{children:(r??[]).map(n=>l.jsx(en,{value:n.toString(),children:String(n)},n))})]}),l.jsx("span",{children:"por página"})]}),Mv=({page:t,pageSize:e,total:r,onPageChange:n,onPageSizeChange:s})=>{const a=Math.ceil(r/e);if(a<=1&&r<=e)return null;const i=t+1,o="rounded-md border border-[color:var(--border-1)] px-3 py-1 text-[color:var(--text-1)] transition-colors hover:bg-[color:color-mix(in srgb, var(--brand) 12%, transparent)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[color:var(--focus)] disabled:opacity-50 disabled:cursor-not-allowed";return l.jsxs("div",{className:"mt-4 flex flex-wrap items-center justify-between gap-4 text-sm text-[color:var(--text-2)]",children:[l.jsxs("span",{children:["Página ",i," de ",a]}),l.jsx(ad,{value:e,onChange:s}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("button",{disabled:t===0,onClick:()=>n(t-1),"aria-label":"Página anterior",className:o,children:"Anterior"}),l.jsx("button",{disabled:t+1>=a,onClick:()=>n(t+1),"aria-label":"Página siguiente",className:o,children:"Siguiente"})]})]})};function id({filters:t,value:e,onChange:r,onReset:n,resetLabel:s="Resetear filtros",showReset:a=!0,className:i,layout:o="inline",actions:c}){const u=(m,p)=>{r({...e,[m]:p})},f=a&&!!n,d=o==="stacked"?"grid gap-4":"grid gap-4 sm:grid-cols-2 lg:grid-cols-3";return l.jsxs("section",{className:N("rounded-xl border border-[color:var(--border-1)] bg-[color:var(--surface-2)] p-4 shadow-[var(--shadow-card-sm)]",i),children:[l.jsx("div",{className:d,children:t.map(m=>l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsxs("div",{className:"flex flex-col gap-1",children:[l.jsx("span",{className:"text-sm font-semibold text-[color:var(--text-1)]",children:m.label}),m.helperText&&l.jsx("span",{className:"text-xs text-[color:var(--text-2)]",children:m.helperText})]}),m.type==="text"&&l.jsx($r,{placeholder:m.placeholder,value:e[m.id]??"",onChange:p=>u(m.id,p.target.value),disabled:m.disabled}),m.type==="select"&&l.jsxs(fs,{value:e[m.id]??"",onValueChange:p=>u(m.id,p),disabled:m.disabled,children:[l.jsx(Kr,{children:l.jsx(hs,{placeholder:m.placeholder??"Seleccionar"})}),l.jsx(Qr,{children:m.options.map(p=>l.jsx(en,{value:p.value,children:p.label},p.value))})]}),m.type==="async-select"&&l.jsx(Ga,{value:e[m.id]??"",onValueChange:p=>u(m.id,p),placeholder:m.placeholder,searchPlaceholder:m.searchPlaceholder,minChars:m.minChars,debounceMs:m.debounceMs,fetcher:m.fetcher,getOptionLabel:m.getOptionLabel,getOptionValue:m.getOptionValue,emptyLabel:m.emptyLabel,loadingLabel:m.loadingLabel,emptyActionLabel:m.emptyActionLabel,onEmptyActionClick:m.onEmptyActionClick,disabled:m.disabled}),m.type==="toggle"&&l.jsx(tn,{checked:e[m.id]??!1,onChange:p=>u(m.id,p),disabled:m.disabled,ariaLabel:m.label,label:m.description}),m.type==="date"&&l.jsx(ns,{value:e[m.id]??null,onChange:p=>u(m.id,p??null),placeholder:m.placeholder,min:m.min,max:m.max,timeZone:m.timeZone,disabled:m.disabled})]},m.id))}),(f||c)&&l.jsxs("div",{className:"mt-4 flex flex-wrap items-center justify-between gap-3",children:[f&&l.jsx(Le,{type:"button",variant:"ghost",onClick:n,children:s}),c&&l.jsx("div",{className:"flex items-center gap-2",children:c})]})]})}function od({title:t="Filtros",description:e,children:r,isOpen:n,onOpenChange:s,onApply:a,applyLabel:i="Aplicar filtros",closeLabel:o="Cerrar",className:c}){const u=b.useId(),f=e?`${u}-description`:void 0,d=n,m=b.useCallback(p=>{s(p)},[s]);return b.useEffect(()=>{if(!d)return;const p=y=>{y.key==="Escape"&&m(!1)};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[d,m]),b.useEffect(()=>{if(!d)return;const p=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=p}},[d]),d?l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",children:l.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":u,"aria-describedby":f,className:N("w-full max-w-3xl rounded-2xl border border-[color:var(--border-1)] bg-[color:var(--surface-1)] p-6 shadow-[var(--shadow-card-lg)]",c),children:[l.jsxs("div",{className:"flex items-start justify-between gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx("h2",{id:u,className:"text-lg font-semibold text-[color:var(--text-1)]",children:t}),e&&l.jsx("p",{id:f,className:"text-sm text-[color:var(--text-2)]",children:e})]}),l.jsx("button",{type:"button",onClick:()=>m(!1),className:N("inline-flex h-9 w-9 items-center justify-center rounded-md","text-[color:var(--text-2)] transition-colors","hover:bg-[color:color-mix(in srgb, var(--brand) 12%, transparent)]","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[color:var(--focus)]"),"aria-label":o,children:l.jsx(J.X,{className:"h-4 w-4"})})]}),l.jsx("div",{className:"mt-6",children:r}),l.jsxs("div",{className:"mt-6 flex flex-wrap items-center justify-end gap-2",children:[l.jsx(Le,{type:"button",variant:"ghost",onClick:()=>m(!1),children:o}),l.jsx(Le,{type:"button",onClick:()=>{a?.(),m(!1)},children:i})]})]})}):null}const Iv=".csv,.xlsx";function Pv({title:t="Importar datos",description:e="Sube un fichero CSV o XLSX para ejecutar la importacion.",helperText:r="El sistema procesara cada fila de forma tolerante.",accept:n=Iv,className:s,actionLabel:a="Importar",disabled:i=!1,loading:o=!1,summary:c,onImport:u}){const[f,d]=b.useState([]),m=f[0]??null,p=b.useMemo(()=>c?`Resultado: ${c.created} creados, ${c.updated} actualizados, ${c.failed} fallidos`:null,[c]),y=async()=>{!m||i||o||await u(m)};return l.jsxs("section",{className:N("rounded-xl border border-slate-200 bg-white p-4 shadow-sm space-y-3",s),children:[l.jsxs("header",{className:"space-y-1",children:[l.jsx("h3",{className:"text-sm font-semibold text-slate-900",children:t}),l.jsx("p",{className:"text-sm text-slate-600",children:e})]}),l.jsx(us,{files:f,onFilesChange:d,multiple:!1,accept:n,helperText:r,allowDrop:!0,showPreview:!1,disabled:i||o}),p&&l.jsx("p",{className:"text-sm text-slate-700",children:p}),l.jsx("div",{className:"flex justify-end",children:l.jsx(Le,{type:"button",variant:"primary",onClick:()=>{y()},disabled:!m||i,loading:o,children:a})})]})}function Fv({title:t,value:e,delta:r,deltaLabel:n,icon:s,description:a,loading:i=!1,className:o}){const c=r!==void 0&&r>=0,u=r!==void 0&&r<0;return i?l.jsxs(Ws,{className:N("p-6",o),children:[l.jsx(sa,{className:"mb-2 h-4 w-24"}),l.jsx(sa,{className:"h-8 w-32"})]}):l.jsxs(Ws,{className:o,children:[l.jsx(Jo,{children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(Ko,{className:"text-sm font-medium text-muted-foreground",children:t}),s&&l.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-md bg-primary/10",children:l.jsx(s,{className:"h-4 w-4 text-primary"})})]})}),l.jsxs(Qo,{children:[l.jsx("div",{className:"text-2xl font-bold text-foreground",children:e}),(r!==void 0||a)&&l.jsxs("div",{className:"mt-1 flex items-center gap-1.5",children:[r!==void 0&&l.jsxs("span",{className:N("inline-flex items-center gap-0.5 text-xs font-medium",c&&"text-emerald-600",u&&"text-red-600"),children:[c?l.jsx(J.TrendingUp,{className:"h-3 w-3"}):l.jsx(J.TrendingDown,{className:"h-3 w-3"}),Math.abs(r),"%"]}),a&&l.jsx("p",{className:"text-xs text-muted-foreground",children:n??a})]})]})]})}function Lv({title:t,description:e,actions:r,className:n}){return l.jsxs("div",{className:N("flex items-start justify-between gap-4",n),children:[l.jsxs("div",{className:"flex flex-col gap-1",children:[l.jsx("h1",{className:"text-2xl font-semibold tracking-tight text-foreground",children:t}),e&&l.jsx("p",{className:"text-sm text-muted-foreground",children:e})]}),r&&l.jsx("div",{className:"flex shrink-0 items-center gap-2",children:r})]})}function Vv({mode:t="light",theme:e="nova",children:r}){return b.useEffect(()=>{const n=document.documentElement;n.dataset.mode=t,n.dataset.theme=e,n.classList.toggle("dark",t==="dark"),n.style.colorScheme=t},[t,e]),r}var ne;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function r(s){throw new Error}t.assertNever=r,t.arrayToEnum=s=>{const a={};for(const i of s)a[i]=i;return a},t.getValidEnumValues=s=>{const a=t.objectKeys(s).filter(o=>typeof s[s[o]]!="number"),i={};for(const o of a)i[o]=s[o];return t.objectValues(i)},t.objectValues=s=>t.objectKeys(s).map(function(a){return s[a]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const a=[];for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&a.push(i);return a},t.find=(s,a)=>{for(const i of s)if(a(i))return i},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function n(s,a=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}t.joinValues=n,t.jsonStringifyReplacer=(s,a)=>typeof a=="bigint"?a.toString():a})(ne||(ne={}));var ko;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(ko||(ko={}));const R=ne.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Nt=t=>{switch(typeof t){case"undefined":return R.undefined;case"string":return R.string;case"number":return Number.isNaN(t)?R.nan:R.number;case"boolean":return R.boolean;case"function":return R.function;case"bigint":return R.bigint;case"symbol":return R.symbol;case"object":return Array.isArray(t)?R.array:t===null?R.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?R.promise:typeof Map<"u"&&t instanceof Map?R.map:typeof Set<"u"&&t instanceof Set?R.set:typeof Date<"u"&&t instanceof Date?R.date:R.object;default:return R.unknown}},_=ne.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class yt extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){const r=e||function(a){return a.message},n={_errors:[]},s=a=>{for(const i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)n._errors.push(r(i));else{let o=n,c=0;for(;c<i.path.length;){const u=i.path[c];c===i.path.length-1?(o[u]=o[u]||{_errors:[]},o[u]._errors.push(r(i))):o[u]=o[u]||{_errors:[]},o=o[u],c++}}};return s(this),n}static assert(e){if(!(e instanceof yt))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ne.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){const r={},n=[];for(const s of this.issues)if(s.path.length>0){const a=s.path[0];r[a]=r[a]||[],r[a].push(e(s))}else n.push(e(s));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}yt.create=t=>new yt(t);const ia=(t,e)=>{let r;switch(t.code){case _.invalid_type:t.received===R.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case _.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,ne.jsonStringifyReplacer)}`;break;case _.unrecognized_keys:r=`Unrecognized key(s) in object: ${ne.joinValues(t.keys,", ")}`;break;case _.invalid_union:r="Invalid input";break;case _.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${ne.joinValues(t.options)}`;break;case _.invalid_enum_value:r=`Invalid enum value. Expected ${ne.joinValues(t.options)}, received '${t.received}'`;break;case _.invalid_arguments:r="Invalid function arguments";break;case _.invalid_return_type:r="Invalid function return type";break;case _.invalid_date:r="Invalid date";break;case _.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:ne.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case _.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case _.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case _.custom:r="Invalid input";break;case _.invalid_intersection_types:r="Intersection results could not be merged";break;case _.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case _.not_finite:r="Number must be finite";break;default:r=e.defaultError,ne.assertNever(t)}return{message:r}};let $v=ia;function Wv(){return $v}const zv=t=>{const{data:e,path:r,errorMaps:n,issueData:s}=t,a=[...r,...s.path||[]],i={...s,path:a};if(s.message!==void 0)return{...s,path:a,message:s.message};let o="";const c=n.filter(u=>!!u).slice().reverse();for(const u of c)o=u(i,{data:e,defaultError:o}).message;return{...s,path:a,message:o}};function O(t,e){const r=Wv(),n=zv({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===ia?void 0:ia].filter(s=>!!s)});t.common.issues.push(n)}class Ve{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){const n=[];for(const s of r){if(s.status==="aborted")return q;s.status==="dirty"&&e.dirty(),n.push(s.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){const n=[];for(const s of r){const a=await s.key,i=await s.value;n.push({key:a,value:i})}return Ve.mergeObjectSync(e,n)}static mergeObjectSync(e,r){const n={};for(const s of r){const{key:a,value:i}=s;if(a.status==="aborted"||i.status==="aborted")return q;a.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||s.alwaysSet)&&(n[a.value]=i.value)}return{status:e.value,value:n}}}const q=Object.freeze({status:"aborted"}),Mr=t=>({status:"dirty",value:t}),Ue=t=>({status:"valid",value:t}),So=t=>t.status==="aborted",No=t=>t.status==="dirty",yr=t=>t.status==="valid",Ln=t=>typeof Promise<"u"&&t instanceof Promise;var M;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(M||(M={}));class Dt{constructor(e,r,n,s){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Co=(t,e)=>{if(yr(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new yt(t.common.issues);return this._error=r,this._error}}};function K(t){if(!t)return{};const{errorMap:e,invalid_type_error:r,required_error:n,description:s}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(i,o)=>{const{message:c}=t;return i.code==="invalid_enum_value"?{message:c??o.defaultError}:typeof o.data>"u"?{message:c??n??o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:c??r??o.defaultError}},description:s}}class re{get description(){return this._def.description}_getType(e){return Nt(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Nt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ve,ctx:{common:e.parent.common,data:e.data,parsedType:Nt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const r=this._parse(e);if(Ln(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){const r=this._parse(e);return Promise.resolve(r)}parse(e,r){const n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){const n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Nt(e)},s=this._parseSync({data:e,path:n.path,parent:n});return Co(n,s)}"~validate"(e){const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Nt(e)};if(!this["~standard"].async)try{const n=this._parseSync({data:e,path:[],parent:r});return yr(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(n=>yr(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(e,r){const n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){const n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Nt(e)},s=this._parse({data:e,path:n.path,parent:n}),a=await(Ln(s)?s:Promise.resolve(s));return Co(n,a)}refine(e,r){const n=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,a)=>{const i=e(s),o=()=>a.addIssue({code:_.custom,...n(s)});return typeof Promise<"u"&&i instanceof Promise?i.then(c=>c?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,r){return this._refinement((n,s)=>e(n)?!0:(s.addIssue(typeof r=="function"?r(n,s):r),!1))}_refinement(e){return new xr({schema:this,typeName:Y.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Tt.create(this,this._def)}nullable(){return br.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ct.create(this)}promise(){return zn.create(this,this._def)}or(e){return $n.create([this,e],this._def)}and(e){return Wn.create(this,e,this._def)}transform(e){return new xr({...K(this._def),schema:this,typeName:Y.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const r=typeof e=="function"?e:()=>e;return new ca({...K(this._def),innerType:this,defaultValue:r,typeName:Y.ZodDefault})}brand(){return new dx({typeName:Y.ZodBranded,type:this,...K(this._def)})}catch(e){const r=typeof e=="function"?e:()=>e;return new ua({...K(this._def),innerType:this,catchValue:r,typeName:Y.ZodCatch})}describe(e){const r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Ka.create(this,e)}readonly(){return da.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Zv=/^c[^\s-]{8,}$/i,Bv=/^[0-9a-z]+$/,Uv=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Hv=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,qv=/^[a-z0-9_-]{21}$/i,Yv=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Gv=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Xv=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Jv="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ls;const Kv=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Qv=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ex=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,tx=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,rx=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,nx=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ld="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",sx=new RegExp(`^${ld}$`);function cd(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function ax(t){return new RegExp(`^${cd(t)}$`)}function ix(t){let e=`${ld}T${cd(t)}`;const r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function ox(t,e){return!!((e==="v4"||!e)&&Kv.test(t)||(e==="v6"||!e)&&ex.test(t))}function lx(t,e){if(!Yv.test(t))return!1;try{const[r]=t.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(n));return!(typeof s!="object"||s===null||"typ"in s&&s?.typ!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return!1}}function cx(t,e){return!!((e==="v4"||!e)&&Qv.test(t)||(e==="v6"||!e)&&tx.test(t))}class $t extends re{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==R.string){const a=this._getOrReturnCtx(e);return O(a,{code:_.invalid_type,expected:R.string,received:a.parsedType}),q}const n=new Ve;let s;for(const a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(s=this._getOrReturnCtx(e,s),O(s,{code:_.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")e.data.length>a.value&&(s=this._getOrReturnCtx(e,s),O(s,{code:_.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){const i=e.data.length>a.value,o=e.data.length<a.value;(i||o)&&(s=this._getOrReturnCtx(e,s),i?O(s,{code:_.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&O(s,{code:_.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")Xv.test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"email",code:_.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")Ls||(Ls=new RegExp(Jv,"u")),Ls.test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"emoji",code:_.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")Hv.test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"uuid",code:_.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")qv.test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"nanoid",code:_.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")Zv.test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"cuid",code:_.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")Bv.test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"cuid2",code:_.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")Uv.test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"ulid",code:_.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),O(s,{validation:"url",code:_.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"regex",code:_.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(s=this._getOrReturnCtx(e,s),O(s,{code:_.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(s=this._getOrReturnCtx(e,s),O(s,{code:_.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(s=this._getOrReturnCtx(e,s),O(s,{code:_.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?ix(a).test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{code:_.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?sx.test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{code:_.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?ax(a).test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{code:_.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?Gv.test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"duration",code:_.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?ox(e.data,a.version)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"ip",code:_.invalid_string,message:a.message}),n.dirty()):a.kind==="jwt"?lx(e.data,a.alg)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"jwt",code:_.invalid_string,message:a.message}),n.dirty()):a.kind==="cidr"?cx(e.data,a.version)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"cidr",code:_.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?rx.test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"base64",code:_.invalid_string,message:a.message}),n.dirty()):a.kind==="base64url"?nx.test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"base64url",code:_.invalid_string,message:a.message}),n.dirty()):ne.assertNever(a);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(s=>e.test(s),{validation:r,code:_.invalid_string,...M.errToObj(n)})}_addCheck(e){return new $t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...M.errToObj(e)})}url(e){return this._addCheck({kind:"url",...M.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...M.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...M.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...M.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...M.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...M.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...M.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...M.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...M.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...M.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...M.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...M.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...M.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...M.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...M.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...M.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...M.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...M.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...M.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...M.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...M.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...M.errToObj(r)})}nonempty(e){return this.min(1,M.errToObj(e))}trim(){return new $t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new $t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new $t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}$t.create=t=>new $t({checks:[],typeName:Y.ZodString,coerce:t?.coerce??!1,...K(t)});function ux(t,e){const r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,s=r>n?r:n,a=Number.parseInt(t.toFixed(s).replace(".","")),i=Number.parseInt(e.toFixed(s).replace(".",""));return a%i/10**s}class Wr extends re{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==R.number){const a=this._getOrReturnCtx(e);return O(a,{code:_.invalid_type,expected:R.number,received:a.parsedType}),q}let n;const s=new Ve;for(const a of this._def.checks)a.kind==="int"?ne.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),O(n,{code:_.invalid_type,expected:"integer",received:"float",message:a.message}),s.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),O(n,{code:_.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),O(n,{code:_.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="multipleOf"?ux(e.data,a.value)!==0&&(n=this._getOrReturnCtx(e,n),O(n,{code:_.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),O(n,{code:_.not_finite,message:a.message}),s.dirty()):ne.assertNever(a);return{status:s.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,M.toString(r))}gt(e,r){return this.setLimit("min",e,!1,M.toString(r))}lte(e,r){return this.setLimit("max",e,!0,M.toString(r))}lt(e,r){return this.setLimit("max",e,!1,M.toString(r))}setLimit(e,r,n,s){return new Wr({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:M.toString(s)}]})}_addCheck(e){return new Wr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:M.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:M.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:M.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:M.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:M.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:M.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:M.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:M.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:M.toString(e)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&ne.isInteger(e.value))}get isFinite(){let e=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}}Wr.create=t=>new Wr({checks:[],typeName:Y.ZodNumber,coerce:t?.coerce||!1,...K(t)});class zr extends re{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==R.bigint)return this._getInvalidInput(e);let n;const s=new Ve;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),O(n,{code:_.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),O(n,{code:_.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),O(n,{code:_.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):ne.assertNever(a);return{status:s.value,value:e.data}}_getInvalidInput(e){const r=this._getOrReturnCtx(e);return O(r,{code:_.invalid_type,expected:R.bigint,received:r.parsedType}),q}gte(e,r){return this.setLimit("min",e,!0,M.toString(r))}gt(e,r){return this.setLimit("min",e,!1,M.toString(r))}lte(e,r){return this.setLimit("max",e,!0,M.toString(r))}lt(e,r){return this.setLimit("max",e,!1,M.toString(r))}setLimit(e,r,n,s){return new zr({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:M.toString(s)}]})}_addCheck(e){return new zr({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:M.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:M.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:M.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:M.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:M.toString(r)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}zr.create=t=>new zr({checks:[],typeName:Y.ZodBigInt,coerce:t?.coerce??!1,...K(t)});class _o extends re{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==R.boolean){const n=this._getOrReturnCtx(e);return O(n,{code:_.invalid_type,expected:R.boolean,received:n.parsedType}),q}return Ue(e.data)}}_o.create=t=>new _o({typeName:Y.ZodBoolean,coerce:t?.coerce||!1,...K(t)});class Vn extends re{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==R.date){const a=this._getOrReturnCtx(e);return O(a,{code:_.invalid_type,expected:R.date,received:a.parsedType}),q}if(Number.isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return O(a,{code:_.invalid_date}),q}const n=new Ve;let s;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(s=this._getOrReturnCtx(e,s),O(s,{code:_.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(s=this._getOrReturnCtx(e,s),O(s,{code:_.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):ne.assertNever(a);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Vn({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:M.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:M.toString(r)})}get minDate(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}}Vn.create=t=>new Vn({checks:[],coerce:t?.coerce||!1,typeName:Y.ZodDate,...K(t)});class To extends re{_parse(e){if(this._getType(e)!==R.symbol){const n=this._getOrReturnCtx(e);return O(n,{code:_.invalid_type,expected:R.symbol,received:n.parsedType}),q}return Ue(e.data)}}To.create=t=>new To({typeName:Y.ZodSymbol,...K(t)});class jo extends re{_parse(e){if(this._getType(e)!==R.undefined){const n=this._getOrReturnCtx(e);return O(n,{code:_.invalid_type,expected:R.undefined,received:n.parsedType}),q}return Ue(e.data)}}jo.create=t=>new jo({typeName:Y.ZodUndefined,...K(t)});class Eo extends re{_parse(e){if(this._getType(e)!==R.null){const n=this._getOrReturnCtx(e);return O(n,{code:_.invalid_type,expected:R.null,received:n.parsedType}),q}return Ue(e.data)}}Eo.create=t=>new Eo({typeName:Y.ZodNull,...K(t)});class oa extends re{constructor(){super(...arguments),this._any=!0}_parse(e){return Ue(e.data)}}oa.create=t=>new oa({typeName:Y.ZodAny,...K(t)});class Oo extends re{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ue(e.data)}}Oo.create=t=>new Oo({typeName:Y.ZodUnknown,...K(t)});class Rt extends re{_parse(e){const r=this._getOrReturnCtx(e);return O(r,{code:_.invalid_type,expected:R.never,received:r.parsedType}),q}}Rt.create=t=>new Rt({typeName:Y.ZodNever,...K(t)});class Do extends re{_parse(e){if(this._getType(e)!==R.undefined){const n=this._getOrReturnCtx(e);return O(n,{code:_.invalid_type,expected:R.void,received:n.parsedType}),q}return Ue(e.data)}}Do.create=t=>new Do({typeName:Y.ZodVoid,...K(t)});class ct extends re{_parse(e){const{ctx:r,status:n}=this._processInputParams(e),s=this._def;if(r.parsedType!==R.array)return O(r,{code:_.invalid_type,expected:R.array,received:r.parsedType}),q;if(s.exactLength!==null){const i=r.data.length>s.exactLength.value,o=r.data.length<s.exactLength.value;(i||o)&&(O(r,{code:i?_.too_big:_.too_small,minimum:o?s.exactLength.value:void 0,maximum:i?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&r.data.length<s.minLength.value&&(O(r,{code:_.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&r.data.length>s.maxLength.value&&(O(r,{code:_.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((i,o)=>s.type._parseAsync(new Dt(r,i,r.path,o)))).then(i=>Ve.mergeArray(n,i));const a=[...r.data].map((i,o)=>s.type._parseSync(new Dt(r,i,r.path,o)));return Ve.mergeArray(n,a)}get element(){return this._def.type}min(e,r){return new ct({...this._def,minLength:{value:e,message:M.toString(r)}})}max(e,r){return new ct({...this._def,maxLength:{value:e,message:M.toString(r)}})}length(e,r){return new ct({...this._def,exactLength:{value:e,message:M.toString(r)}})}nonempty(e){return this.min(1,e)}}ct.create=(t,e)=>new ct({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Y.ZodArray,...K(e)});function or(t){if(t instanceof ye){const e={};for(const r in t.shape){const n=t.shape[r];e[r]=Tt.create(or(n))}return new ye({...t._def,shape:()=>e})}else return t instanceof ct?new ct({...t._def,type:or(t.element)}):t instanceof Tt?Tt.create(or(t.unwrap())):t instanceof br?br.create(or(t.unwrap())):t instanceof Ut?Ut.create(t.items.map(e=>or(e))):t}class ye extends re{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),r=ne.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==R.object){const u=this._getOrReturnCtx(e);return O(u,{code:_.invalid_type,expected:R.object,received:u.parsedType}),q}const{status:n,ctx:s}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof Rt&&this._def.unknownKeys==="strip"))for(const u in s.data)i.includes(u)||o.push(u);const c=[];for(const u of i){const f=a[u],d=s.data[u];c.push({key:{status:"valid",value:u},value:f._parse(new Dt(s,d,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof Rt){const u=this._def.unknownKeys;if(u==="passthrough")for(const f of o)c.push({key:{status:"valid",value:f},value:{status:"valid",value:s.data[f]}});else if(u==="strict")o.length>0&&(O(s,{code:_.unrecognized_keys,keys:o}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const f of o){const d=s.data[f];c.push({key:{status:"valid",value:f},value:u._parse(new Dt(s,d,s.path,f)),alwaysSet:f in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const u=[];for(const f of c){const d=await f.key,m=await f.value;u.push({key:d,value:m,alwaysSet:f.alwaysSet})}return u}).then(u=>Ve.mergeObjectSync(n,u)):Ve.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return M.errToObj,new ye({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{const s=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:M.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new ye({...this._def,unknownKeys:"strip"})}passthrough(){return new ye({...this._def,unknownKeys:"passthrough"})}extend(e){return new ye({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ye({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Y.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new ye({...this._def,catchall:e})}pick(e){const r={};for(const n of ne.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new ye({...this._def,shape:()=>r})}omit(e){const r={};for(const n of ne.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new ye({...this._def,shape:()=>r})}deepPartial(){return or(this)}partial(e){const r={};for(const n of ne.objectKeys(this.shape)){const s=this.shape[n];e&&!e[n]?r[n]=s:r[n]=s.optional()}return new ye({...this._def,shape:()=>r})}required(e){const r={};for(const n of ne.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof Tt;)a=a._def.innerType;r[n]=a}return new ye({...this._def,shape:()=>r})}keyof(){return ud(ne.objectKeys(this.shape))}}ye.create=(t,e)=>new ye({shape:()=>t,unknownKeys:"strip",catchall:Rt.create(),typeName:Y.ZodObject,...K(e)});ye.strictCreate=(t,e)=>new ye({shape:()=>t,unknownKeys:"strict",catchall:Rt.create(),typeName:Y.ZodObject,...K(e)});ye.lazycreate=(t,e)=>new ye({shape:t,unknownKeys:"strip",catchall:Rt.create(),typeName:Y.ZodObject,...K(e)});class $n extends re{_parse(e){const{ctx:r}=this._processInputParams(e),n=this._def.options;function s(a){for(const o of a)if(o.result.status==="valid")return o.result;for(const o of a)if(o.result.status==="dirty")return r.common.issues.push(...o.ctx.common.issues),o.result;const i=a.map(o=>new yt(o.ctx.common.issues));return O(r,{code:_.invalid_union,unionErrors:i}),q}if(r.common.async)return Promise.all(n.map(async a=>{const i={...r,common:{...r.common,issues:[]},parent:null};return{result:await a._parseAsync({data:r.data,path:r.path,parent:i}),ctx:i}})).then(s);{let a;const i=[];for(const c of n){const u={...r,common:{...r.common,issues:[]},parent:null},f=c._parseSync({data:r.data,path:r.path,parent:u});if(f.status==="valid")return f;f.status==="dirty"&&!a&&(a={result:f,ctx:u}),u.common.issues.length&&i.push(u.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;const o=i.map(c=>new yt(c));return O(r,{code:_.invalid_union,unionErrors:o}),q}}get options(){return this._def.options}}$n.create=(t,e)=>new $n({options:t,typeName:Y.ZodUnion,...K(e)});function la(t,e){const r=Nt(t),n=Nt(e);if(t===e)return{valid:!0,data:t};if(r===R.object&&n===R.object){const s=ne.objectKeys(e),a=ne.objectKeys(t).filter(o=>s.indexOf(o)!==-1),i={...t,...e};for(const o of a){const c=la(t[o],e[o]);if(!c.valid)return{valid:!1};i[o]=c.data}return{valid:!0,data:i}}else if(r===R.array&&n===R.array){if(t.length!==e.length)return{valid:!1};const s=[];for(let a=0;a<t.length;a++){const i=t[a],o=e[a],c=la(i,o);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else return r===R.date&&n===R.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Wn extends re{_parse(e){const{status:r,ctx:n}=this._processInputParams(e),s=(a,i)=>{if(So(a)||So(i))return q;const o=la(a.value,i.value);return o.valid?((No(a)||No(i))&&r.dirty(),{status:r.value,value:o.data}):(O(n,{code:_.invalid_intersection_types}),q)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,i])=>s(a,i)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Wn.create=(t,e,r)=>new Wn({left:t,right:e,typeName:Y.ZodIntersection,...K(r)});class Ut extends re{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==R.array)return O(n,{code:_.invalid_type,expected:R.array,received:n.parsedType}),q;if(n.data.length<this._def.items.length)return O(n,{code:_.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),q;!this._def.rest&&n.data.length>this._def.items.length&&(O(n,{code:_.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const a=[...n.data].map((i,o)=>{const c=this._def.items[o]||this._def.rest;return c?c._parse(new Dt(n,i,n.path,o)):null}).filter(i=>!!i);return n.common.async?Promise.all(a).then(i=>Ve.mergeArray(r,i)):Ve.mergeArray(r,a)}get items(){return this._def.items}rest(e){return new Ut({...this._def,rest:e})}}Ut.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ut({items:t,typeName:Y.ZodTuple,rest:null,...K(e)})};class Ro extends re{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==R.map)return O(n,{code:_.invalid_type,expected:R.map,received:n.parsedType}),q;const s=this._def.keyType,a=this._def.valueType,i=[...n.data.entries()].map(([o,c],u)=>({key:s._parse(new Dt(n,o,n.path,[u,"key"])),value:a._parse(new Dt(n,c,n.path,[u,"value"]))}));if(n.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const c of i){const u=await c.key,f=await c.value;if(u.status==="aborted"||f.status==="aborted")return q;(u.status==="dirty"||f.status==="dirty")&&r.dirty(),o.set(u.value,f.value)}return{status:r.value,value:o}})}else{const o=new Map;for(const c of i){const u=c.key,f=c.value;if(u.status==="aborted"||f.status==="aborted")return q;(u.status==="dirty"||f.status==="dirty")&&r.dirty(),o.set(u.value,f.value)}return{status:r.value,value:o}}}}Ro.create=(t,e,r)=>new Ro({valueType:e,keyType:t,typeName:Y.ZodMap,...K(r)});class Zr extends re{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==R.set)return O(n,{code:_.invalid_type,expected:R.set,received:n.parsedType}),q;const s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(O(n,{code:_.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),r.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&(O(n,{code:_.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());const a=this._def.valueType;function i(c){const u=new Set;for(const f of c){if(f.status==="aborted")return q;f.status==="dirty"&&r.dirty(),u.add(f.value)}return{status:r.value,value:u}}const o=[...n.data.values()].map((c,u)=>a._parse(new Dt(n,c,n.path,u)));return n.common.async?Promise.all(o).then(c=>i(c)):i(o)}min(e,r){return new Zr({...this._def,minSize:{value:e,message:M.toString(r)}})}max(e,r){return new Zr({...this._def,maxSize:{value:e,message:M.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}}Zr.create=(t,e)=>new Zr({valueType:t,minSize:null,maxSize:null,typeName:Y.ZodSet,...K(e)});class Ao extends re{get schema(){return this._def.getter()}_parse(e){const{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}Ao.create=(t,e)=>new Ao({getter:t,typeName:Y.ZodLazy,...K(e)});class Mo extends re{_parse(e){if(e.data!==this._def.value){const r=this._getOrReturnCtx(e);return O(r,{received:r.data,code:_.invalid_literal,expected:this._def.value}),q}return{status:"valid",value:e.data}}get value(){return this._def.value}}Mo.create=(t,e)=>new Mo({value:t,typeName:Y.ZodLiteral,...K(e)});function ud(t,e){return new vr({values:t,typeName:Y.ZodEnum,...K(e)})}class vr extends re{_parse(e){if(typeof e.data!="string"){const r=this._getOrReturnCtx(e),n=this._def.values;return O(r,{expected:ne.joinValues(n),received:r.parsedType,code:_.invalid_type}),q}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const r=this._getOrReturnCtx(e),n=this._def.values;return O(r,{received:r.data,code:_.invalid_enum_value,options:n}),q}return Ue(e.data)}get options(){return this._def.values}get enum(){const e={};for(const r of this._def.values)e[r]=r;return e}get Values(){const e={};for(const r of this._def.values)e[r]=r;return e}get Enum(){const e={};for(const r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return vr.create(e,{...this._def,...r})}exclude(e,r=this._def){return vr.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}}vr.create=ud;class Io extends re{_parse(e){const r=ne.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==R.string&&n.parsedType!==R.number){const s=ne.objectValues(r);return O(n,{expected:ne.joinValues(s),received:n.parsedType,code:_.invalid_type}),q}if(this._cache||(this._cache=new Set(ne.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const s=ne.objectValues(r);return O(n,{received:n.data,code:_.invalid_enum_value,options:s}),q}return Ue(e.data)}get enum(){return this._def.values}}Io.create=(t,e)=>new Io({values:t,typeName:Y.ZodNativeEnum,...K(e)});class zn extends re{unwrap(){return this._def.type}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==R.promise&&r.common.async===!1)return O(r,{code:_.invalid_type,expected:R.promise,received:r.parsedType}),q;const n=r.parsedType===R.promise?r.data:Promise.resolve(r.data);return Ue(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}}zn.create=(t,e)=>new zn({type:t,typeName:Y.ZodPromise,...K(e)});class xr extends re{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Y.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:r,ctx:n}=this._processInputParams(e),s=this._def.effect||null,a={addIssue:i=>{O(n,i),i.fatal?r.abort():r.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),s.type==="preprocess"){const i=s.transform(n.data,a);if(n.common.async)return Promise.resolve(i).then(async o=>{if(r.value==="aborted")return q;const c=await this._def.schema._parseAsync({data:o,path:n.path,parent:n});return c.status==="aborted"?q:c.status==="dirty"||r.value==="dirty"?Mr(c.value):c});{if(r.value==="aborted")return q;const o=this._def.schema._parseSync({data:i,path:n.path,parent:n});return o.status==="aborted"?q:o.status==="dirty"||r.value==="dirty"?Mr(o.value):o}}if(s.type==="refinement"){const i=o=>{const c=s.refinement(o,a);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?q:(o.status==="dirty"&&r.dirty(),i(o.value),{status:r.value,value:o.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>o.status==="aborted"?q:(o.status==="dirty"&&r.dirty(),i(o.value).then(()=>({status:r.value,value:o.value}))))}if(s.type==="transform")if(n.common.async===!1){const i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!yr(i))return q;const o=s.transform(i.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:o}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>yr(i)?Promise.resolve(s.transform(i.value,a)).then(o=>({status:r.value,value:o})):q);ne.assertNever(s)}}xr.create=(t,e,r)=>new xr({schema:t,typeName:Y.ZodEffects,effect:e,...K(r)});xr.createWithPreprocess=(t,e,r)=>new xr({schema:e,effect:{type:"preprocess",transform:t},typeName:Y.ZodEffects,...K(r)});class Tt extends re{_parse(e){return this._getType(e)===R.undefined?Ue(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Tt.create=(t,e)=>new Tt({innerType:t,typeName:Y.ZodOptional,...K(e)});class br extends re{_parse(e){return this._getType(e)===R.null?Ue(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}br.create=(t,e)=>new br({innerType:t,typeName:Y.ZodNullable,...K(e)});class ca extends re{_parse(e){const{ctx:r}=this._processInputParams(e);let n=r.data;return r.parsedType===R.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}ca.create=(t,e)=>new ca({innerType:t,typeName:Y.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...K(e)});class ua extends re{_parse(e){const{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Ln(s)?s.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new yt(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new yt(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}ua.create=(t,e)=>new ua({innerType:t,typeName:Y.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...K(e)});class Po extends re{_parse(e){if(this._getType(e)!==R.nan){const n=this._getOrReturnCtx(e);return O(n,{code:_.invalid_type,expected:R.nan,received:n.parsedType}),q}return{status:"valid",value:e.data}}}Po.create=t=>new Po({typeName:Y.ZodNaN,...K(t)});class dx extends re{_parse(e){const{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class Ka extends re{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?q:a.status==="dirty"?(r.dirty(),Mr(a.value)):this._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{const s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?q:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(e,r){return new Ka({in:e,out:r,typeName:Y.ZodPipeline})}}class da extends re{_parse(e){const r=this._def.innerType._parse(e),n=s=>(yr(s)&&(s.value=Object.freeze(s.value)),s);return Ln(r)?r.then(s=>n(s)):n(r)}unwrap(){return this._def.innerType}}da.create=(t,e)=>new da({innerType:t,typeName:Y.ZodReadonly,...K(e)});var Y;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(Y||(Y={}));const fx=oa.create;Rt.create;ct.create;const hx=ye.create;$n.create;Wn.create;Ut.create;vr.create;zn.create;Tt.create;br.create;function mx(t){const e=[];for(const r of t.sections)for(const n of r.fields)Array.isArray(n)?e.push(...n):e.push(n);return e}function px(t){const e={};for(const n of t.sections)for(const s of n.fields){const a=Array.isArray(s)?s:[s];for(const i of a)e[i.name]=i.schema??fx().optional()}let r=hx(e);return t.crossRules?.length&&(r=r.superRefine((n,s)=>{for(const a of t.crossRules)a(n,s)})),r}function gx(t,e){const r=t.defaultValues?.(e)??{},n=mx(t),s={...r};for(const a of n)a.defaultValue!==void 0&&s[a.name]===void 0&&(s[a.name]=a.defaultValue);return s}var yx=t=>t.type==="checkbox",Ir=t=>t instanceof Date,Qa=t=>t==null;const dd=t=>typeof t=="object";var Ht=t=>!Qa(t)&&!Array.isArray(t)&&dd(t)&&!Ir(t),vx=t=>Ht(t)&&t.target?yx(t.target)?t.target.checked:t.target.value:t,xx=t=>t.substring(0,t.search(/\.\d+(\.|$)/))||t,bx=(t,e)=>t.has(xx(e)),wx=t=>{const e=t.constructor&&t.constructor.prototype;return Ht(e)&&e.hasOwnProperty("isPrototypeOf")},kx=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function fd(t){if(t instanceof Date)return new Date(t);const e=typeof FileList<"u"&&t instanceof FileList;if(kx&&(t instanceof Blob||e))return t;const r=Array.isArray(t);if(!r&&!(Ht(t)&&wx(t)))return t;const n=r?[]:Object.create(Object.getPrototypeOf(t));for(const s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[s]=fd(t[s]));return n}var hd=t=>/^\w*$/.test(t),fa=t=>t===void 0,Sx=t=>Array.isArray(t)?t.filter(Boolean):[],md=t=>Sx(t.replace(/["|']|\]/g,"").split(/\.|\[/)),Oe=(t,e,r)=>{if(!e||!Ht(t))return r;const n=(hd(e)?[e]:md(e)).reduce((s,a)=>Qa(s)?s:s[a],t);return fa(n)||n===t?fa(t[e])?r:t[e]:n},Vs=t=>typeof t=="boolean",vn=t=>typeof t=="function",Fo=(t,e,r)=>{let n=-1;const s=hd(e)?[e]:md(e),a=s.length,i=a-1;for(;++n<a;){const o=s[n];let c=r;if(n!==i){const u=t[o];c=Ht(u)||Array.isArray(u)?u:isNaN(+s[n+1])?{}:[]}if(o==="__proto__"||o==="constructor"||o==="prototype")return;t[o]=c,t=t[o]}};const Lo={BLUR:"blur",CHANGE:"change"},Vo={all:"all"},ei=b.createContext(null);ei.displayName="HookFormContext";const ti=()=>b.useContext(ei),Nx=t=>{const{children:e,...r}=t;return b.createElement(ei.Provider,{value:r},e)};var Cx=(t,e,r,n=!0)=>{const s={defaultValues:e._defaultValues};for(const a in t)Object.defineProperty(s,a,{get:()=>{const i=a;return e._proxyFormState[i]!==Vo.all&&(e._proxyFormState[i]=!n||Vo.all),r&&(r[i]=!0),t[i]}});return s};const pd=typeof window<"u"?b.useLayoutEffect:b.useEffect;function _x(t){const e=ti(),{control:r=e.control,disabled:n,name:s,exact:a}=t||{},[i,o]=b.useState(r._formState),c=b.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return pd(()=>r._subscribe({name:s,formState:c.current,exact:a,callback:u=>{!n&&o({...r._formState,...u})}}),[s,n,a]),b.useEffect(()=>{c.current.isValid&&r._setValid(!0)},[r]),b.useMemo(()=>Cx(i,r,c.current,!1),[i,r])}var Tx=t=>typeof t=="string",$o=(t,e,r,n,s)=>Tx(t)?Oe(r,t,s):Array.isArray(t)?t.map(a=>Oe(r,a)):r,Wo=t=>Qa(t)||!dd(t);function _n(t,e,r=new WeakSet){if(Wo(t)||Wo(e))return Object.is(t,e);if(Ir(t)&&Ir(e))return Object.is(t.getTime(),e.getTime());const n=Object.keys(t),s=Object.keys(e);if(n.length!==s.length)return!1;if(r.has(t)||r.has(e))return!0;r.add(t),r.add(e);for(const a of n){const i=t[a];if(!s.includes(a))return!1;if(a!=="ref"){const o=e[a];if(Ir(i)&&Ir(o)||Ht(i)&&Ht(o)||Array.isArray(i)&&Array.isArray(o)?!_n(i,o,r):!Object.is(i,o))return!1}}return!0}function gd(t){const e=ti(),{control:r=e.control,name:n,defaultValue:s,disabled:a,exact:i,compute:o}=t||{},c=b.useRef(s),u=b.useRef(o),f=b.useRef(void 0),d=b.useRef(r),m=b.useRef(n);u.current=o;const[p,y]=b.useState(()=>{const k=r._getWatch(n,c.current);return u.current?u.current(k):k}),g=b.useCallback(k=>{const w=$o(n,r._names,k||r._formValues,!1,c.current);return u.current?u.current(w):w},[r._formValues,r._names,n]),x=b.useCallback(k=>{if(!a){const w=$o(n,r._names,k||r._formValues,!1,c.current);if(u.current){const j=u.current(w);_n(j,f.current)||(y(j),f.current=j)}else y(w)}},[r._formValues,r._names,a,n]);pd(()=>((d.current!==r||!_n(m.current,n))&&(d.current=r,m.current=n,x()),r._subscribe({name:n,formState:{values:!0},exact:i,callback:k=>{x(k.values)}})),[r,i,n,x]),b.useEffect(()=>r._removeUnmounted());const v=d.current!==r,S=m.current,C=b.useMemo(()=>{if(a)return null;const k=!v&&!_n(S,n);return v||k?g():null},[a,v,n,S,g]);return C!==null?C:p}function jx(t){const e=ti(),{name:r,disabled:n,control:s=e.control,shouldUnregister:a,defaultValue:i,exact:o=!0}=t,c=bx(s._names.array,r),u=b.useMemo(()=>Oe(s._formValues,r,Oe(s._defaultValues,r,i)),[s,r,i]),f=gd({control:s,name:r,defaultValue:u,exact:o}),d=_x({control:s,name:r,exact:o}),m=b.useRef(t),p=b.useRef(void 0),y=b.useRef(s.register(r,{...t.rules,value:f,...Vs(t.disabled)?{disabled:t.disabled}:{}}));m.current=t;const g=b.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Oe(d.errors,r)},isDirty:{enumerable:!0,get:()=>!!Oe(d.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!Oe(d.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!Oe(d.validatingFields,r)},error:{enumerable:!0,get:()=>Oe(d.errors,r)}}),[d,r]),x=b.useCallback(k=>y.current.onChange({target:{value:vx(k),name:r},type:Lo.CHANGE}),[r]),v=b.useCallback(()=>y.current.onBlur({target:{value:Oe(s._formValues,r),name:r},type:Lo.BLUR}),[r,s._formValues]),S=b.useCallback(k=>{const w=Oe(s._fields,r);w&&w._f&&k&&(w._f.ref={focus:()=>vn(k.focus)&&k.focus(),select:()=>vn(k.select)&&k.select(),setCustomValidity:j=>vn(k.setCustomValidity)&&k.setCustomValidity(j),reportValidity:()=>vn(k.reportValidity)&&k.reportValidity()})},[s._fields,r]),C=b.useMemo(()=>({name:r,value:f,...Vs(n)||d.disabled?{disabled:d.disabled||n}:{},onChange:x,onBlur:v,ref:S}),[r,n,d.disabled,x,v,S,f]);return b.useEffect(()=>{const k=s._options.shouldUnregister||a,w=p.current;w&&w!==r&&!c&&s.unregister(w),s.register(r,{...m.current.rules,...Vs(m.current.disabled)?{disabled:m.current.disabled}:{}});const j=(T,A)=>{const $=Oe(s._fields,T);$&&$._f&&($._f.mount=A)};if(j(r,!0),k){const T=fd(Oe(s._options.defaultValues,r,m.current.defaultValue));Fo(s._defaultValues,r,T),fa(Oe(s._formValues,r))&&Fo(s._formValues,r,T)}return!c&&s.register(r),p.current=r,()=>{(c?k&&!s._state.action:k)?s.unregister(r):j(r,!1)}},[r,s,c,a]),b.useEffect(()=>{s._setDisabledField({disabled:n,name:r})},[n,r,s]),b.useMemo(()=>({field:C,formState:d,fieldState:g}),[C,d,g])}const Ex=t=>t.render(jx(t));function Ox({form:t,field:e}){const[r,n]=b.useState(!1);return l.jsx(Ex,{control:t.control,name:e.name,render:({field:s,fieldState:{error:a}})=>{const i=u=>e.normalize?e.normalize(u):u,o=()=>{e.deps?.onChangeTrigger&&t.trigger(e.deps.onChangeTrigger)},c={className:e.className,error:a?.message,required:!e.schema?.isOptional?.()};switch(e.kind){case"custom":if(!e.render)throw new Error(`Field ${e.name} marked as custom but has no render function`);return l.jsx("div",{className:e.className,children:e.render({form:t})});case"input":return l.jsxs(st,{...c,children:[l.jsx(at,{children:e.label}),l.jsx(Xe,{children:l.jsx($r,{type:"text",placeholder:e.placeholder,value:s.value??"",onChange:u=>{s.onChange(i(u.target.value)),o()},onBlur:s.onBlur})}),l.jsx(Je,{})]});case"password":return l.jsxs(st,{...c,children:[l.jsx(at,{children:e.label}),l.jsx(Xe,{children:l.jsxs("div",{className:"relative flex w-full items-center",children:[l.jsx($r,{type:r?"text":"password",placeholder:e.placeholder,value:s.value??"",className:"pr-10",onChange:u=>{const f=u.target.value;s.onChange(i(f)),o()},onBlur:s.onBlur}),l.jsx(Le,{type:"button",variant:"ghost",className:"absolute right-3 flex items-center justify-center text-slate-400 hover:text-slate-600 focus:outline-none",onClick:()=>n(!r),tabIndex:-1,children:r?l.jsx(J.EyeOff,{className:"h-4 w-4"}):l.jsx(J.Eye,{className:"h-4 w-4"})})]})}),l.jsx(Je,{})]});case"textarea":return l.jsxs(st,{...c,children:[l.jsx(at,{children:e.label}),l.jsx(Xe,{children:l.jsx("textarea",{className:"oniratec-field__textarea",value:s.value??"",placeholder:e.placeholder,rows:4,onChange:u=>{s.onChange(i(u.target.value)),o()},onBlur:s.onBlur})}),l.jsx(Je,{})]});case"select":return l.jsxs(st,{...c,children:[l.jsx(at,{children:e.label}),l.jsx(Xe,{children:l.jsxs(fs,{value:s.value||void 0,onValueChange:u=>{s.onChange(i(u||void 0)),o()},children:[l.jsx(Kr,{children:l.jsx(hs,{})}),l.jsx(Qr,{children:(e.options??[]).map(u=>l.jsx(en,{value:String(u.value),children:u.label},u.value))})]})}),l.jsx(Je,{})]});case"asyncSelect":return l.jsxs(st,{...c,children:[l.jsx(at,{children:e.label}),l.jsx(Xe,{children:l.jsx(Ga,{value:s.value||void 0,onValueChange:u=>{s.onChange(i(u)),o()},placeholder:e.placeholder,searchPlaceholder:e.searchPlaceholder,minChars:e.minChars,debounceMs:e.debounceMs,fetcher:e.fetcher,getOptionValue:e.getOptionValue,getOptionLabel:e.getOptionLabel,emptyLabel:e.emptyLabel,emptyActionLabel:e.emptyActionLabel,onEmptyActionClick:e.onEmptyActionClick,hasError:!!a?.message})}),l.jsx(Je,{})]});case"toggle":return l.jsxs(st,{...c,children:[l.jsx(at,{children:e.label}),l.jsx(Xe,{children:l.jsx(tn,{checked:!!s.value,onChange:u=>{s.onChange(i(u)),o()}})}),l.jsx(Je,{})]});case"checkbox":return l.jsxs(st,{...c,children:[l.jsx(Xe,{children:l.jsxs("label",{className:"oniratec-checkbox",children:[l.jsx("input",{type:"checkbox",checked:!!s.value,onChange:u=>{s.onChange(i(u.target.checked)),o()},onBlur:s.onBlur}),l.jsx("span",{children:e.label})]})}),l.jsx(Je,{})]});case"date":return l.jsxs(st,{...c,children:[l.jsx(at,{children:e.label}),l.jsx(Xe,{children:l.jsx(ns,{value:s.value,onChange:u=>{s.onChange(i(u)),o()},placeholder:e.placeholder,min:e.min,max:e.max,timeZone:e.timeZone,isInvalid:!!a?.message})}),l.jsx(Je,{})]});case"fileUpload":{const u=Array.isArray(s.value)?s.value:[];return l.jsxs(st,{...c,children:[l.jsx(at,{children:e.label}),l.jsx(Xe,{children:l.jsx(us,{files:u,onFilesChange:f=>{s.onChange(i(f)),o()},accept:e.accept,multiple:e.multiple,helperText:e.helperText,allowDrop:e.allowDrop,placeholder:e.placeholder,defaultPreviewUrl:e.defaultPreviewUrl})}),l.jsx(Je,{})]})}}}})}function Dx(t){return Array.isArray(t)?t:[t]}function yd({config:t,form:e,onSubmitAction:r,handleErrors:n,submitLabel:s,maxWidthClass:a,children:i}){const o=gd({control:e.control});return l.jsx(Nx,{...e,children:l.jsxs("form",{onSubmit:e.handleSubmit(r,c=>n(c)),className:N("space-y-8",a),children:[t.sections.map((c,u)=>l.jsxs(b.Fragment,{children:[l.jsxs("section",{className:"space-y-4",children:[l.jsx("h3",{className:"oniratec-form__section-title",children:c.title}),l.jsx("div",{className:"space-y-4",children:c.fields.map((f,d)=>{const m=Dx(f).filter(g=>!g.hidden?.(o));if(!m.length)return null;const p=m.reduce((g,x)=>g+(x.colSpan??1),0),y=p>1?N("grid gap-4",p===2&&"grid-cols-2",p===3&&"grid-cols-3",p===4&&"grid-cols-4"):"";return l.jsx("div",{className:y,children:m.map(g=>l.jsx("div",{className:g.colSpan?`col-span-${g.colSpan}`:void 0,children:l.jsx(Ox,{form:e,field:g})},g.name))},d)})})]},c.title),u<t.sections.length-1&&l.jsx(b.Fragment,{children:l.jsx("hr",{className:"oniratec-form__separator"})})]},`fragment-${c.title}`)),i,l.jsx("div",{className:"oniratec-form__actions",children:l.jsx(Le,{type:"submit",loading:e.formState.isSubmitting,children:s})})]})})}function Rx(t){return l.jsx(yd,{...t})}const Ax=t=>t==="center"?"text-center":t==="right"?"text-right":"text-left",Mx=t=>{if(t)return typeof t=="number"?`w-[${t}px]`:t.startsWith("w-")?t:`w-[${t}]`},Ix=t=>t?Array.isArray(t)?t:[t]:[];function vd(t){return{columns:t.columns.map(n=>{const s=Ax(n.align),a=Mx(n.width),i=[s,a,n.className].filter(Boolean).join(" "),o=[s,a,n.headerClassName].filter(Boolean).join(" ");return{key:n.id,header:n.header,render:n.cell??(c=>String(n.accessor?.(c)??"")),className:i||void 0,headerClassName:o||void 0,sortable:n.sortable??!!(n.sortFn||n.accessor),sortFn:n.sortFn,sortValue:n.accessor}}),getSortDirection:(n,s)=>Ix(n).find(o=>o.columnId===s)?.direction??null}}function Px(t,e,r){const{columns:n}=vd(t);return l.jsx(sd,{columns:n,data:e,...r})}const Fx=t=>t.reduce((e,r)=>r.type==="toggle"?(e[r.id]=r.value??!1,e):r.type==="date"?(e[r.id]=r.value??null,e):(e[r.id]=r.value??"",e),{});function Lx(t){const e=Fx(t.filters),r=(a,i,o)=>({...a,[i]:o}),n=()=>({...e}),s=a=>t.buildQueryParams?t.buildQueryParams(a):a;return{filters:t.filters,initialState:e,updateFilter:r,resetState:n,buildQueryParams:s}}function xd(t,e,r,n){return l.jsx(id,{filters:t.filters,value:e,onChange:r,onReset:n?.onReset,resetLabel:n?.resetLabel,showReset:n?.showReset,className:n?.className,layout:n?.layout,actions:n?.actions})}function Vx(t,e,r,n){return l.jsx(od,{title:n.title,description:n.description,isOpen:n.isOpen,onOpenChange:n.onOpenChange,onApply:n.onApply,applyLabel:n.applyLabel,closeLabel:n.closeLabel,className:n.className,children:xd(t,e,r,n.panel)})}function $x(t,e,r){const n=new Set(t.filter(s=>s.type==="date").map(s=>s.id));return Object.entries(e).reduce((s,[a,i])=>i==null?(s[a]=void 0,s):n.has(a)&&i instanceof Date?(s[a]=eu(i,r?.timeZone)??void 0,s):(s[a]=i,s),{})}function Wx(...t){return zo.twMerge(ha.clsx(t))}exports.Alert=tl;exports.AlertDescription=nl;exports.AlertTitle=rl;exports.AsyncSelect=Ga;exports.AuthLayout=nd;exports.Badge=pa;exports.Box=Qd;exports.Breadcrumbs=Tv;exports.Button=Le;exports.Card=Ws;exports.CardAction=lf;exports.CardContent=Qo;exports.CardDescription=of;exports.CardFooter=cf;exports.CardHeader=Jo;exports.CardTitle=Ko;exports.Checkbox=al;exports.ConfirmDialog=jv;exports.DEFAULT_TIME_ZONE=In;exports.DashboardLayout=Dv;exports.DataTable=sd;exports.DatePicker=ns;exports.Dialog=bu;exports.DialogClose=wy;exports.DialogContent=za;exports.DialogDescription=Ha;exports.DialogFooter=Ba;exports.DialogHeader=Za;exports.DialogOverlay=Wa;exports.DialogPortal=wu;exports.DialogTitle=Ua;exports.DialogTrigger=by;exports.DropdownMenu=ky;exports.DropdownMenuCheckboxItem=Nu;exports.DropdownMenuContent=ku;exports.DropdownMenuGroup=Ny;exports.DropdownMenuItem=Su;exports.DropdownMenuLabel=_u;exports.DropdownMenuPortal=Cy;exports.DropdownMenuRadioGroup=Ty;exports.DropdownMenuRadioItem=Cu;exports.DropdownMenuSeparator=Tu;exports.DropdownMenuShortcut=Ou;exports.DropdownMenuSub=_y;exports.DropdownMenuSubContent=Eu;exports.DropdownMenuSubTrigger=ju;exports.DropdownMenuTrigger=Sy;exports.Field=st;exports.FieldControl=Xe;exports.FieldLabel=at;exports.FieldMessage=Je;exports.FilePicker=Oy;exports.FileUpload=us;exports.FiltersModal=od;exports.FiltersPanel=id;exports.FormFactoryRenderer=yd;exports.ImportFileCard=Pv;exports.Input=$r;exports.Kbd=Au;exports.KpiCard=Fv;exports.Logo=af;exports.NotFoundState=Dy;exports.PageHeader=Lv;exports.PageSizeSelector=ad;exports.Pagination=Mv;exports.PasswordInput=Ru;exports.PersonAvatar=Jd;exports.ProfileAvatar=Kd;exports.Progress=Mu;exports.RadioGroup=Ay;exports.RadioGroupItem=Pu;exports.Select=fs;exports.SelectContent=Qr;exports.SelectGroup=My;exports.SelectItem=en;exports.SelectLabel=Fu;exports.SelectScrollDownButton=Ya;exports.SelectScrollUpButton=qa;exports.SelectSeparator=Lu;exports.SelectTrigger=Kr;exports.SelectValue=hs;exports.Separator=Vu;exports.Sheet=Py;exports.SheetClose=Ly;exports.SheetContent=Wu;exports.SheetDescription=Uu;exports.SheetFooter=Zu;exports.SheetHeader=zu;exports.SheetOverlay=Xa;exports.SheetPortal=$u;exports.SheetTitle=Bu;exports.SheetTrigger=Fy;exports.Skeleton=sa;exports.Switch=Yy;exports.Tabs=$y;exports.TabsContent=Xu;exports.TabsList=Yu;exports.TabsTrigger=Gu;exports.Textarea=Hu;exports.ThemeProvider=Vv;exports.Toaster=Sv;exports.Toggle=tn;exports.Tooltip=Cv;exports.TooltipContent=rd;exports.TooltipProvider=Nv;exports.TooltipTrigger=_v;exports.alertVariants=el;exports.badgeVariants=sl;exports.buildDefaultValues=gx;exports.buildFiltersQueryParams=$x;exports.buildZodSchema=px;exports.buttonVariants=Xo;exports.cn=Wx;exports.createFiltersFactory=Lx;exports.createTableFactory=vd;exports.isValidTimeZone=Pn;exports.renderFiltersModal=Vx;exports.renderFiltersPanel=xd;exports.renderFormFactory=Rx;exports.renderTable=Px;exports.resolveTimeZone=Jr;exports.setDefaultTimeZone=ny;exports.toDateTime=sy;exports.toISODate=eu;exports.toISODateTime=ay;exports.toast=dv;exports.useField=ds;
45
+ For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return h.useEffect(()=>{t&&(document.getElementById(t)||console.error(r))},[r,t]),null},vy="DialogDescriptionWarning",xy=({contentRef:t,descriptionId:e})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${gu(vy).contentName}}.`;return h.useEffect(()=>{const s=t.current?.getAttribute("aria-describedby");e&&s&&(document.getElementById(e)||console.warn(n))},[n,t,e]),null},yu=ru,vu=su,xu=iu,as=ou,is=lu,os=uu,ls=fu,cs=mu;const bu=yu,by=vu,wu=xu,wy=cs,za=h.forwardRef(({className:t,...e},r)=>l.jsx(as,{ref:r,className:N("fixed inset-0 isolate z-50 bg-black/10 backdrop-blur-[2px] transition-opacity duration-100","data-[state=closed]:opacity-0 data-[state=open]:opacity-100",t),...e}));za.displayName=as.displayName;const ky={sm:"sm:max-w-sm",md:"sm:max-w-md",lg:"sm:max-w-lg",xl:"sm:max-w-xl","2xl":"sm:max-w-2xl",full:"sm:max-w-full"},Wa=h.forwardRef(({className:t,children:e,hideClose:r,size:n="md",...s},a)=>l.jsxs(wu,{children:[l.jsx(za,{}),l.jsxs(is,{ref:a,className:N("fixed left-1/2 top-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-background p-4 text-sm","ring-1 ring-foreground/10 shadow-card-lg outline-none transition-[opacity,transform] duration-100",ky[n],"data-[state=closed]:opacity-0 data-[state=closed]:scale-95","data-[state=open]:opacity-100 data-[state=open]:scale-100",t),...s,children:[e,!r&&l.jsx(cs,{asChild:!0,children:l.jsxs(Le,{variant:"ghost",size:"icon-sm",className:"absolute right-2 top-2","aria-label":"Cerrar",children:[l.jsx(J.X,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"Cerrar"})]})})]})]}));Wa.displayName=is.displayName;const Za=({className:t,...e})=>l.jsx("div",{className:N("flex flex-col gap-2",t),...e});Za.displayName="DialogHeader";const Ba=({className:t,...e})=>l.jsx("div",{className:N("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end",t),...e});Ba.displayName="DialogFooter";const Ua=h.forwardRef(({className:t,...e},r)=>l.jsx(os,{ref:r,className:N("text-base font-medium leading-none text-foreground",t),...e}));Ua.displayName=os.displayName;const Ha=h.forwardRef(({className:t,...e},r)=>l.jsx(ls,{ref:r,className:N("text-sm text-muted-foreground",t),...e}));Ha.displayName=ls.displayName;const Sy=fe.Root,Ny=fe.Trigger,Cy=fe.Group,_y=fe.Portal,Ty=fe.Sub,jy=fe.RadioGroup,ku=h.forwardRef(({className:t,sideOffset:e=6,...r},n)=>l.jsx(fe.Portal,{children:l.jsx(fe.Content,{ref:n,sideOffset:e,className:N("z-50 min-w-[10rem] overflow-hidden rounded-lg bg-popover p-1 text-popover-foreground shadow-card-sm ring-1 ring-foreground/10 outline-none","transition-[opacity,transform] duration-100","data-[state=closed]:opacity-0 data-[state=closed]:scale-95","data-[state=open]:opacity-100 data-[state=open]:scale-100",t),...r})}));ku.displayName=fe.Content.displayName;const Su=h.forwardRef(({className:t,inset:e,icon:r,destructive:n,children:s,...a},i)=>l.jsxs(fe.Item,{ref:i,className:N("relative flex cursor-default select-none items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-none transition-colors","focus:bg-accent focus:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e&&"pl-8",n&&"text-destructive focus:bg-destructive/10 focus:text-destructive",t),...a,children:[r&&l.jsx("span",{className:"h-4 w-4 shrink-0 [&>svg]:h-4 [&>svg]:w-4",children:r}),s]}));Su.displayName=fe.Item.displayName;const Nu=h.forwardRef(({className:t,children:e,checked:r,...n},s)=>l.jsxs(fe.CheckboxItem,{ref:s,className:N("relative flex cursor-default select-none items-center gap-1.5 rounded-md py-1 pl-1.5 pr-8 text-sm outline-none transition-colors","focus:bg-accent focus:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:r,...n,children:[l.jsx("span",{className:"absolute right-2 flex h-4 w-4 items-center justify-center",children:l.jsx(fe.ItemIndicator,{children:l.jsx(J.Check,{className:"h-4 w-4"})})}),e]}));Nu.displayName=fe.CheckboxItem.displayName;const Cu=h.forwardRef(({className:t,children:e,...r},n)=>l.jsxs(fe.RadioItem,{ref:n,className:N("relative flex cursor-default select-none items-center gap-1.5 rounded-md py-1 pl-1.5 pr-8 text-sm outline-none transition-colors","focus:bg-accent focus:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...r,children:[l.jsx("span",{className:"absolute right-2 flex h-4 w-4 items-center justify-center",children:l.jsx(fe.ItemIndicator,{children:l.jsx(J.Circle,{className:"h-2.5 w-2.5 fill-current"})})}),e]}));Cu.displayName=fe.RadioItem.displayName;const _u=h.forwardRef(({className:t,inset:e,...r},n)=>l.jsx(fe.Label,{ref:n,className:N("px-1.5 py-1 text-xs font-medium text-muted-foreground",e&&"pl-8",t),...r}));_u.displayName=fe.Label.displayName;const Tu=h.forwardRef(({className:t,...e},r)=>l.jsx(fe.Separator,{ref:r,className:N("-mx-1 my-1 h-px bg-border",t),...e}));Tu.displayName=fe.Separator.displayName;const ju=h.forwardRef(({className:t,inset:e,children:r,...n},s)=>l.jsxs(fe.SubTrigger,{ref:s,className:N("flex cursor-default select-none items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-none transition-colors","focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",e&&"pl-8",t),...n,children:[r,l.jsx(J.ChevronRight,{className:"ml-auto h-4 w-4"})]}));ju.displayName=fe.SubTrigger.displayName;const Eu=h.forwardRef(({className:t,...e},r)=>l.jsx(fe.SubContent,{ref:r,className:N("z-50 min-w-[8rem] overflow-hidden rounded-lg bg-popover p-1 text-popover-foreground shadow-card-sm ring-1 ring-foreground/10 outline-none","transition-[opacity,transform] duration-100","data-[state=closed]:opacity-0 data-[state=closed]:scale-95","data-[state=open]:opacity-100 data-[state=open]:scale-100",t),...e}));Eu.displayName=fe.SubContent.displayName;const Ou=({className:t,...e})=>l.jsx("span",{className:N("ml-auto text-xs tracking-widest text-muted-foreground",t),...e});Ou.displayName="DropdownMenuShortcut";const Ey="Arrastra y suelta archivos aquí o selecciona desde tu dispositivo.",Oy=t=>{if(t===0)return"0 B";const e=1024,r=["B","KB","MB","GB","TB"],n=Math.floor(Math.log(t)/Math.log(e));return`${(t/Math.pow(e,n)).toFixed(n===0?0:1)} ${r[n]}`},ir=t=>`${t.name}-${t.size}-${t.lastModified}`,go=t=>t.type.startsWith("image/");function us({label:t,helperText:e,error:r,disabled:n=!1,multiple:s=!1,accept:a,files:i,defaultFiles:o=[],onFilesChange:c,id:u,name:f,allowDrop:d=!1,placeholder:m=Ey,showPreview:p=!0,previewMode:y="auto",maxPreviewItems:g=4,defaultPreviewUrl:x}){const v=b.useId(),S=u??v,C=e?`${S}-helper`:void 0,k=r?`${S}-error`:void 0,w=[C,k].filter(Boolean).join(" ")||void 0,j=b.useRef(null),[T,A]=b.useState(o),[$,L]=b.useState(!1),W=i!==void 0,B=W?i:T,G=F=>{const D=s?F:F.slice(0,1);W||A(D),c?.(D)},Q=F=>{if(!s)return F.slice(0,1);const D=new Map(B.map(ee=>[ir(ee),ee]));for(const ee of F)D.set(ir(ee),ee);return Array.from(D.values())},H=F=>{const D=Array.from(F.target.files??[]);G(s?Q(D):D),F.target.value=""},P=F=>{G(B.filter(D=>ir(D)!==ir(F)))},U=F=>{if(!d||n)return;F.preventDefault(),L(!1);const D=Array.from(F.dataTransfer.files??[]);D.length!==0&&G(s?Q(D):D)},V=b.useMemo(()=>{if(!p)return[];const F=B.slice(0,g);return y==="image"||y==="auto"&&F.some(ee=>go(ee))?F.filter(ee=>go(ee)).map(ee=>({key:ir(ee),file:ee,url:URL.createObjectURL(ee)})):[]},[B,g,y,p]);b.useEffect(()=>()=>{for(const F of V)URL.revokeObjectURL(F.url)},[V]);const ie=!!x&&B.length===0;return l.jsxs("div",{className:N("flex flex-col gap-2",n&&"pointer-events-none opacity-60"),children:[t&&l.jsx("label",{htmlFor:S,className:"text-sm font-medium text-foreground",children:t}),l.jsx("input",{ref:j,id:S,name:f,type:"file",className:"sr-only",disabled:n,multiple:s,accept:a,"aria-invalid":r?"true":void 0,"aria-describedby":w,onChange:H}),l.jsxs("button",{type:"button",disabled:n,className:N("flex min-h-44 flex-col items-center justify-center gap-3 rounded-xl border border-dashed border-border bg-card px-6 py-8 text-center","transition-[border-color,background-color,box-shadow,transform] hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50 active:translate-y-px",d&&"cursor-pointer",$&&"border-ring bg-muted",r&&"border-destructive focus-visible:ring-destructive/20"),onClick:()=>j.current?.click(),onDragOver:F=>{!d||n||(F.preventDefault(),L(!0))},onDragLeave:()=>d&&L(!1),onDrop:U,children:[l.jsx(J.UploadCloud,{className:"h-8 w-8 text-muted-foreground"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium text-foreground",children:s?"Seleccionar archivos":"Seleccionar archivo"}),l.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground",children:m}),a&&l.jsxs("p",{className:"mt-0.5 text-xs text-muted-foreground",children:["Acepta: ",a]})]})]}),ie&&l.jsx("div",{className:"mt-2 flex gap-2",children:l.jsx("div",{className:"h-16 w-16 overflow-hidden rounded-lg bg-muted ring-1 ring-foreground/10",children:l.jsx("img",{src:x,alt:"Logo actual",className:"h-full w-full object-cover"})})}),V.length>0&&l.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:V.map(F=>l.jsx("div",{className:"h-16 w-16 overflow-hidden rounded-lg bg-muted ring-1 ring-foreground/10",children:l.jsx("img",{src:F.url,alt:F.file.name,className:"h-full w-full object-cover"})},F.key))}),e&&!r&&l.jsx("p",{id:C,className:"text-xs text-muted-foreground",children:e}),r&&l.jsx("p",{id:k,className:"text-xs text-destructive",children:r}),B.length>0&&l.jsx("ul",{className:"mt-2 flex flex-col gap-1",children:B.map(F=>l.jsxs("li",{className:"flex items-center justify-between gap-2 rounded-lg bg-muted/40 px-3 py-2 ring-1 ring-foreground/10",children:[l.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[l.jsx(J.FileIcon,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("p",{className:"truncate text-sm font-medium text-foreground",children:F.name}),l.jsx("p",{className:"text-xs text-muted-foreground",children:Oy(F.size)})]})]}),l.jsx("button",{type:"button",className:"shrink-0 rounded-md p-1 text-muted-foreground transition-colors hover:bg-background hover:text-foreground focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50",onClick:()=>P(F),"aria-label":`Eliminar ${F.name}`,children:l.jsx(J.X,{className:"h-4 w-4"})})]},ir(F)))})]})}const Dy=us,Du=h.createContext(null);function ds(){const t=h.useContext(Du);if(!t)throw new Error("Field components must be used inside <Field>");return t}function st({className:t,error:e,required:r,...n}){const s=h.useId();return l.jsx(Du.Provider,{value:{id:s,error:e,required:r},children:l.jsx("div",{className:N("flex flex-col gap-1.5",t),...n})})}const Xe=b.forwardRef((t,e)=>{const{id:r,error:n}=ds();return l.jsx(Go,{ref:e,id:r,"aria-invalid":!!n,...t})});Xe.displayName="FieldControl";const at=h.forwardRef(({className:t,children:e,...r},n)=>{const{id:s,required:a}=ds();return l.jsxs("label",{ref:n,htmlFor:s,className:N("text-sm font-medium text-foreground leading-none",t),...r,children:[e,a&&l.jsx("span",{className:"ml-0.5 text-destructive",children:"*"})]})});at.displayName="FieldLabel";const Je=h.forwardRef(({className:t,children:e,...r},n)=>{const{error:s}=ds(),a=s??e;return a?l.jsx("p",{ref:n,className:N("text-xs",s?"text-destructive":"text-muted-foreground",t),...r,children:a}):null});Je.displayName="FieldMessage";const Ru=b.forwardRef(({className:t,containerClassName:e,isInvalid:r,...n},s)=>{const[a,i]=b.useState(!1);return l.jsxs("div",{className:N("relative",e),children:[l.jsx("input",{ref:s,type:a?"text":"password","aria-invalid":r||void 0,className:N("flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 pr-10 text-sm text-foreground shadow-sm transition-colors","placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1","disabled:cursor-not-allowed disabled:opacity-50 disabled:bg-muted",r&&"border-destructive focus-visible:ring-destructive",t),...n}),l.jsx("button",{type:"button",className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",onClick:()=>i(o=>!o),children:a?l.jsx(J.EyeOff,{className:"h-4 w-4"}):l.jsx(J.EyeIcon,{className:"h-4 w-4"})})]})});Ru.displayName="PasswordInput";const $r=h.forwardRef(({className:t,isInvalid:e,"aria-invalid":r,...n},s)=>{const a=e??(r===!0||r==="true");return l.jsx("input",{ref:s,"aria-invalid":a||void 0,className:N("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-sm text-foreground transition-[border-color,box-shadow,color,background-color] outline-none","file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground","placeholder:text-muted-foreground","focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50","disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50","dark:bg-input/30 dark:disabled:bg-input/80",a&&"border-destructive focus-visible:border-destructive focus-visible:ring-destructive/20 dark:border-destructive/50 dark:focus-visible:ring-destructive/40",t),...n})});$r.displayName="Input";const Au=h.forwardRef(({className:t,...e},r)=>l.jsx("kbd",{ref:r,className:N("inline-flex min-h-6 items-center rounded-md border border-border bg-muted px-1.5 font-mono text-[11px] font-medium text-muted-foreground shadow-sm",t),...e}));Au.displayName="Kbd";const Ry=({lottieJson:t,title:e,description:r,actionLabel:n,onAction:s,fallbackIcon:a})=>l.jsxs("div",{className:"flex w-full flex-col items-center justify-center text-center",children:[t?l.jsx("div",{className:"mb-4 w-1/2",children:l.jsx(Rd,{animationData:t,loop:!0})}):a&&l.jsx("div",{className:"mb-4 text-[color:var(--oniratec-label-secondary)]",children:a}),l.jsx("h2",{className:"mb-2 text-lg font-semibold text-[color:var(--oniratec-label-primary)]",children:e}),r&&l.jsx("p",{className:"mb-6 max-w-md text-sm text-[color:var(--oniratec-label-secondary)]",children:r}),n&&s&&l.jsx(Le,{size:"md",onClick:s,children:n})]}),Mu=h.forwardRef(({className:t,indicatorClassName:e,max:r=100,value:n=0,...s},a)=>{const i=r>0?r:100,o=n==null?0:Math.min(Math.max(n,0),i),c=`${o/i*100}%`;return l.jsx("div",{ref:a,role:"progressbar","aria-valuemin":0,"aria-valuemax":i,"aria-valuenow":n==null?void 0:o,className:N("h-2 w-full overflow-hidden rounded-full bg-muted ring-1 ring-foreground/10",t),...s,children:l.jsx("div",{className:N("h-full rounded-full bg-primary transition-[width] duration-300",e),style:{width:c}})})});Mu.displayName="Progress";const Iu=h.createContext(null);function Ay(){const t=h.useContext(Iu);if(!t)throw new Error("RadioGroupItem must be used inside <RadioGroup>.");return t}function My({className:t,defaultValue:e,disabled:r,name:n,onValueChange:s,orientation:a="vertical",required:i,value:o,...c}){const u=h.useId(),[f,d]=h.useState(e),m=o!==void 0,p=m?o:f,y=h.useCallback(g=>{m||d(g),s?.(g)},[m,s]);return l.jsx(Iu.Provider,{value:{disabled:r,name:n??u,onValueChange:y,orientation:a,required:i,value:p},children:l.jsx("div",{role:"radiogroup","aria-required":i,"data-orientation":a,className:N("flex gap-3",a==="horizontal"?"flex-row flex-wrap items-center":"flex-col",t),...c})})}const Pu=h.forwardRef(({className:t,description:e,disabled:r,id:n,label:s,size:a="md",value:i,"aria-describedby":o,"aria-invalid":c,onChange:u,...f},d)=>{const m=h.useId(),p=n??m,y=e?`${p}-description`:void 0,g=c===!0||c==="true",x=Ay(),v=x.value===i,S=x.disabled||r;return l.jsxs("label",{htmlFor:p,className:N("inline-flex w-fit items-start gap-2.5 text-sm",S&&"cursor-not-allowed opacity-60",t),children:[l.jsx("input",{ref:d,id:p,type:"radio",name:x.name,value:i,checked:v,required:x.required,disabled:S,"aria-invalid":g||void 0,"aria-describedby":[o,y].filter(Boolean).join(" ")||void 0,className:"peer sr-only",onChange:C=>{C.target.checked&&x.onValueChange(i),u?.(C)},...f}),l.jsx("span",{className:N("flex shrink-0 items-center justify-center rounded-full border border-input bg-background text-primary transition-[background-color,border-color,box-shadow,color] outline-none","peer-focus-visible:border-ring peer-focus-visible:ring-3 peer-focus-visible:ring-ring/50","peer-disabled:border-input peer-disabled:bg-input/50","peer-checked:border-primary peer-checked:bg-primary/10 peer-checked:[&_span]:scale-100 peer-checked:[&_span]:opacity-100",g&&"border-destructive peer-focus-visible:border-destructive peer-focus-visible:ring-destructive/20",a==="sm"?"h-4 w-4":"h-5 w-5"),children:l.jsx("span",{className:N("rounded-full bg-primary opacity-0 transition-[opacity,transform]",a==="sm"?"h-2 w-2 scale-75":"h-2.5 w-2.5 scale-75")})}),(s||e)&&l.jsxs("span",{className:"grid gap-1 leading-tight",children:[s&&l.jsx("span",{className:"font-medium text-foreground",children:s}),e&&l.jsx("span",{id:y,className:"text-sm text-muted-foreground",children:e})]})]})});Pu.displayName="RadioGroupItem";const fs=pe.Root,Iy=pe.Group,hs=pe.Value,Kr=h.forwardRef(({className:t,hasError:e,children:r,...n},s)=>l.jsxs(pe.Trigger,{ref:s,"aria-invalid":e||void 0,className:N("flex h-8 w-full items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent px-2.5 py-1 pr-2 text-sm transition-[border-color,box-shadow,color,background-color] outline-none","data-[placeholder]:text-muted-foreground","focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50","disabled:cursor-not-allowed disabled:opacity-50","dark:bg-input/30 dark:hover:bg-input/50","[&>span]:line-clamp-1",e&&"border-destructive focus-visible:border-destructive focus-visible:ring-destructive/20 dark:border-destructive/50 dark:focus-visible:ring-destructive/40",t),...n,children:[r,l.jsx(pe.Icon,{asChild:!0,children:l.jsx(J.ChevronDown,{className:"h-4 w-4 shrink-0 text-muted-foreground"})})]}));Kr.displayName=pe.Trigger.displayName;const qa=h.forwardRef(({className:t,...e},r)=>l.jsx(pe.ScrollUpButton,{ref:r,className:N("flex cursor-default items-center justify-center bg-popover py-1",t),...e,children:l.jsx(J.ChevronUp,{className:"h-4 w-4"})}));qa.displayName=pe.ScrollUpButton.displayName;const Ya=h.forwardRef(({className:t,...e},r)=>l.jsx(pe.ScrollDownButton,{ref:r,className:N("flex cursor-default items-center justify-center bg-popover py-1",t),...e,children:l.jsx(J.ChevronDown,{className:"h-4 w-4"})}));Ya.displayName=pe.ScrollDownButton.displayName;const Qr=h.forwardRef(({className:t,children:e,position:r="popper",...n},s)=>l.jsx(pe.Portal,{children:l.jsxs(pe.Content,{ref:s,className:N("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-lg bg-popover text-popover-foreground shadow-card-sm ring-1 ring-foreground/10 outline-none","transition-[opacity,transform] duration-100","data-[state=closed]:opacity-0 data-[state=closed]:scale-95","data-[state=open]:opacity-100 data-[state=open]:scale-100",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:r,...n,children:[l.jsx(qa,{}),l.jsx(pe.Viewport,{className:N("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),l.jsx(Ya,{})]})}));Qr.displayName=pe.Content.displayName;const Fu=h.forwardRef(({className:t,...e},r)=>l.jsx(pe.Label,{ref:r,className:N("px-1.5 py-1 text-xs font-medium text-muted-foreground",t),...e}));Fu.displayName=pe.Label.displayName;const en=h.forwardRef(({className:t,children:e,...r},n)=>l.jsxs(pe.Item,{ref:n,className:N("relative flex w-full cursor-default select-none items-center gap-1.5 rounded-md py-1 pl-1.5 pr-8 text-sm outline-none transition-colors","focus:bg-accent focus:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...r,children:[l.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx(pe.ItemIndicator,{children:l.jsx(J.Check,{className:"h-4 w-4"})})}),l.jsx(pe.ItemText,{children:e})]}));en.displayName=pe.Item.displayName;const Lu=h.forwardRef(({className:t,...e},r)=>l.jsx(pe.Separator,{ref:r,className:N("-mx-1 my-1 h-px bg-border",t),...e}));Lu.displayName=pe.Separator.displayName;function Py(t,e){const[r,n]=h.useState(t);return h.useEffect(()=>{const s=setTimeout(()=>n(t),e);return()=>clearTimeout(s)},[t,e]),r}function Ga({value:t,onValueChange:e,placeholder:r="Seleccionar",searchPlaceholder:n="Buscar...",disabled:s,hasError:a,minChars:i=2,debounceMs:o=300,fetcher:c,getOptionValue:u,getOptionLabel:f,emptyLabel:d="Sin resultados",loadingLabel:m="Buscando...",emptyActionLabel:p,onEmptyActionClick:y,contentClassName:g,triggerClassName:x}){const[v,S]=h.useState(!1),[C,k]=h.useState(""),[w,j]=h.useState(!1),[T,A]=h.useState([]),[$,L]=h.useState(""),W=Py(C,o),B=W.trim().length>=i,G=h.useRef(null);h.useEffect(()=>{const H=P=>{G.current&&(G.current.contains(P.target)||S(!1))};return document.addEventListener("mousedown",H),()=>document.removeEventListener("mousedown",H)},[]),h.useEffect(()=>{let H=!0;return(async()=>{if(v){if(!B){A([]);return}j(!0);try{const U=await c(W.trim());if(!H)return;A(U??[])}finally{H&&j(!1)}}})(),()=>{H=!1}},[v,W,B,c]),h.useEffect(()=>{if(!t){L("");return}const H=T.find(P=>u(P)===t);H&&L(f(H))},[t,T,u,f]);const Q=$||r;return l.jsxs("div",{ref:G,className:"relative w-full",children:[l.jsxs("button",{type:"button",disabled:s,"aria-invalid":a?"true":"false","aria-expanded":v,"aria-haspopup":"listbox",onClick:()=>S(H=>!H),className:N("flex h-9 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm shadow-sm transition-colors","focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-1","disabled:cursor-not-allowed disabled:opacity-50",a&&"border-destructive focus:ring-destructive",x),children:[l.jsx("span",{className:N("truncate",!$&&"text-muted-foreground"),children:Q}),l.jsx(J.ChevronDown,{className:N("h-4 w-4 shrink-0 opacity-50 transition-transform",v&&"rotate-180")})]}),v&&l.jsxs("div",{className:N("absolute left-0 top-full z-50 mt-1 w-full rounded-md border border-border bg-popover shadow-card-sm",g),role:"listbox",children:[l.jsxs("div",{className:"flex items-center border-b border-border px-3",children:[l.jsx("input",{className:"flex h-9 w-full bg-transparent py-2 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",value:C,onChange:H=>k(H.target.value),placeholder:n,autoFocus:!0}),w&&l.jsx(J.Loader2,{className:"h-4 w-4 shrink-0 animate-spin text-muted-foreground"})]}),l.jsxs("div",{className:"max-h-60 overflow-y-auto p-1",children:[!B&&l.jsxs("p",{className:"py-2 text-center text-xs text-muted-foreground",children:["Escribe al menos ",i," caracteres"]}),B&&w&&l.jsx("p",{className:"py-2 text-center text-xs text-muted-foreground",children:m}),B&&!w&&T.length===0&&l.jsxs("div",{className:"flex flex-col items-center gap-2 py-3",children:[l.jsx("p",{className:"text-xs text-muted-foreground",children:d}),p&&y&&l.jsx("button",{type:"button",className:"text-xs font-medium text-primary hover:underline",onClick:y,children:p})]}),T.length>0&&l.jsx("ul",{children:T.map(H=>{const P=u(H),U=f(H),V=P===t;return l.jsx("li",{children:l.jsxs("button",{type:"button",role:"option","aria-selected":V,className:N("relative flex w-full cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors","hover:bg-accent hover:text-accent-foreground",V&&"bg-accent text-accent-foreground font-medium"),onClick:()=>{e(P),L(U),S(!1),k("")},children:[V&&l.jsx(J.Check,{className:"mr-2 h-4 w-4 shrink-0"}),l.jsx("span",{className:N(!V&&"ml-6"),children:U})]})},P)})})]})]})]})}const Vu=h.forwardRef(({className:t,decorative:e=!0,orientation:r="horizontal",...n},s)=>l.jsx("div",{ref:s,role:e?"none":"separator","aria-orientation":e?void 0:r,"data-orientation":r,className:N("shrink-0 bg-border",r==="horizontal"?"h-px w-full":"h-full w-px",t),...n}));Vu.displayName="Separator";const Fy=yu,Ly=vu,Vy=cs,$u=xu,Xa=h.forwardRef(({className:t,...e},r)=>l.jsx(as,{ref:r,className:N("fixed inset-0 isolate z-50 bg-black/10 backdrop-blur-[2px] transition-opacity duration-100","data-[state=closed]:opacity-0 data-[state=open]:opacity-100",t),...e}));Xa.displayName=as.displayName;const $y=Bn("fixed z-50 flex flex-col gap-4 bg-background p-4 text-sm ring-1 ring-foreground/10 shadow-card-lg outline-none transition-[opacity,transform] duration-100 data-[state=closed]:opacity-0 data-[state=open]:opacity-100",{variants:{side:{top:"inset-x-0 top-0 border-b border-border data-[state=closed]:-translate-y-6 data-[state=open]:translate-y-0",bottom:"inset-x-0 bottom-0 border-t border-border data-[state=closed]:translate-y-6 data-[state=open]:translate-y-0",left:"inset-y-0 left-0 h-full w-full max-w-sm border-r border-border data-[state=closed]:-translate-x-full data-[state=open]:translate-x-0",right:"inset-y-0 right-0 h-full w-full max-w-sm border-l border-border data-[state=closed]:translate-x-full data-[state=open]:translate-x-0"}},defaultVariants:{side:"right"}}),zu=h.forwardRef(({side:t="right",className:e,children:r,hideClose:n,...s},a)=>l.jsxs($u,{children:[l.jsx(Xa,{}),l.jsxs(is,{ref:a,className:N($y({side:t}),e),...s,children:[!n&&l.jsx(cs,{asChild:!0,children:l.jsxs(Le,{variant:"ghost",size:"icon-sm",className:"absolute right-2 top-2","aria-label":"Cerrar",children:[l.jsx(J.X,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"Cerrar"})]})}),r]})]}));zu.displayName=is.displayName;const Wu=({className:t,...e})=>l.jsx("div",{className:N("flex flex-col gap-2",t),...e});Wu.displayName="SheetHeader";const Zu=({className:t,...e})=>l.jsx("div",{className:N("-mx-4 -mb-4 mt-auto flex flex-col-reverse gap-2 border-t bg-muted/50 p-4 sm:flex-row sm:justify-end",t),...e});Zu.displayName="SheetFooter";const Bu=h.forwardRef(({className:t,...e},r)=>l.jsx(os,{ref:r,className:N("text-base font-medium leading-none text-foreground",t),...e}));Bu.displayName=os.displayName;const Uu=h.forwardRef(({className:t,...e},r)=>l.jsx(ls,{ref:r,className:N("text-sm text-muted-foreground",t),...e}));Uu.displayName=ls.displayName;function sa({className:t}){return l.jsx("div",{className:N("animate-pulse rounded-lg bg-muted/80",t)})}const Hu=h.forwardRef(({className:t,isInvalid:e,"aria-invalid":r,...n},s)=>{const a=e??(r===!0||r==="true");return l.jsx("textarea",{ref:s,"aria-invalid":a||void 0,className:N("min-h-20 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-sm text-foreground transition-[border-color,box-shadow,color,background-color] outline-none","placeholder:text-muted-foreground","focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50","disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50","dark:bg-input/30 dark:disabled:bg-input/80","resize-y",a&&"border-destructive focus-visible:border-destructive focus-visible:ring-destructive/20 dark:border-destructive/50 dark:focus-visible:ring-destructive/40",t),...n})});Hu.displayName="Textarea";const qu=h.createContext(null);function Ja(){const t=h.useContext(qu);if(!t)throw new Error("Tabs components must be used inside <Tabs>.");return t}function zy({children:t,className:e,defaultValue:r,onValueChange:n,orientation:s="horizontal",value:a,...i}){const o=h.useId(),[c,u]=h.useState(r),f=a!==void 0,d=f?a:c,m=h.useCallback(p=>{f||u(p),n?.(p)},[f,n]);return l.jsx(qu.Provider,{value:{baseId:o,onValueChange:m,orientation:s,value:d},children:l.jsx("div",{className:N("w-full",e),"data-orientation":s,...i,children:t})})}const Yu=h.forwardRef(({className:t,onKeyDown:e,...r},n)=>{const{onValueChange:s,orientation:a}=Ja();return l.jsx("div",{ref:n,role:"tablist","aria-orientation":a,className:N("inline-flex w-fit items-center gap-1 rounded-lg bg-muted p-1 text-muted-foreground ring-1 ring-foreground/10",a==="vertical"&&"flex-col items-stretch",t),onKeyDown:i=>{const o=a==="horizontal"?i.key==="ArrowRight":i.key==="ArrowDown",c=a==="horizontal"?i.key==="ArrowLeft":i.key==="ArrowUp",u=i.key==="Home"||i.key==="End";if(!o&&!c&&!u){e?.(i);return}const f=Array.from(i.currentTarget.querySelectorAll('[role="tab"]:not(:disabled)'));if(f.length===0){e?.(i);return}const d=f.findIndex(g=>g===document.activeElement);let m=d===-1?0:d;o&&(m=(d+1+f.length)%f.length),c&&(m=(d-1+f.length)%f.length),i.key==="Home"&&(m=0),i.key==="End"&&(m=f.length-1),i.preventDefault();const p=f[m];p?.focus();const y=p?.dataset.value;y&&s(y),e?.(i)},...r})});Yu.displayName="TabsList";const Gu=h.forwardRef(({children:t,className:e,value:r,...n},s)=>{const{baseId:a,onValueChange:i,orientation:o,value:c}=Ja(),u=r===c;return l.jsx("button",{ref:s,id:`${a}-trigger-${r}`,type:"button",role:"tab","aria-controls":`${a}-content-${r}`,"aria-selected":u,tabIndex:u?0:-1,"data-state":u?"active":"inactive","data-value":r,className:N("inline-flex h-8 items-center justify-center gap-1.5 rounded-md px-2.5 text-sm font-medium transition-[background-color,color,box-shadow,transform] outline-none","focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50","data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-card-sm","data-[state=inactive]:text-muted-foreground hover:text-foreground",o==="vertical"&&"justify-start",e),onClick:()=>i(r),...n,children:t})});Gu.displayName="TabsTrigger";const Xu=h.forwardRef(({className:t,forceMount:e=!1,value:r,...n},s)=>{const{baseId:a,value:i}=Ja(),o=r===i;return!o&&!e?null:l.jsx("div",{ref:s,id:`${a}-content-${r}`,role:"tabpanel","aria-labelledby":`${a}-trigger-${r}`,hidden:!o,tabIndex:0,"data-state":o?"active":"inactive",className:N("mt-4 outline-none focus-visible:ring-3 focus-visible:ring-ring/50",!o&&"hidden",t),...n})});Xu.displayName="TabsContent";function Wy(t){const e=h.useRef({value:t,previous:t});return h.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}var ms="Switch",[Zy]=Un(ms),[By,Uy]=Zy(ms),Ju=h.forwardRef((t,e)=>{const{__scopeSwitch:r,name:n,checked:s,defaultChecked:a,required:i,disabled:o,value:c="on",onCheckedChange:u,form:f,...d}=t,[m,p]=h.useState(null),y=$e(e,C=>p(C)),g=h.useRef(!1),x=m?f||!!m.closest("form"):!0,[v,S]=Ta({prop:s,defaultProp:a??!1,onChange:u,caller:ms});return l.jsxs(By,{scope:r,checked:v,disabled:o,children:[l.jsx(_e.button,{type:"button",role:"switch","aria-checked":v,"aria-required":i,"data-state":td(v),"data-disabled":o?"":void 0,disabled:o,value:c,...d,ref:y,onClick:Re(t.onClick,C=>{S(k=>!k),x&&(g.current=C.isPropagationStopped(),g.current||C.stopPropagation())})}),x&&l.jsx(ed,{control:m,bubbles:!g.current,name:n,value:c,checked:v,required:i,disabled:o,form:f,style:{transform:"translateX(-100%)"}})]})});Ju.displayName=ms;var Ku="SwitchThumb",Qu=h.forwardRef((t,e)=>{const{__scopeSwitch:r,...n}=t,s=Uy(Ku,r);return l.jsx(_e.span,{"data-state":td(s.checked),"data-disabled":s.disabled?"":void 0,...n,ref:e})});Qu.displayName=Ku;var Hy="SwitchBubbleInput",ed=h.forwardRef(({__scopeSwitch:t,control:e,checked:r,bubbles:n=!0,...s},a)=>{const i=h.useRef(null),o=$e(i,a),c=Wy(r),u=kl(e);return h.useEffect(()=>{const f=i.current;if(!f)return;const d=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(d,"checked").set;if(c!==r&&p){const y=new Event("click",{bubbles:n});p.call(f,r),f.dispatchEvent(y)}},[c,r,n]),l.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...s,tabIndex:-1,ref:o,style:{...s.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});ed.displayName=Hy;function td(t){return t?"checked":"unchecked"}var qy=Ju,Yy=Qu;const tn=h.forwardRef(({checked:t,defaultChecked:e=!1,onChange:r,size:n="md",disabled:s=!1,label:a,className:i,ariaLabel:o,id:c},u)=>{const f=h.useId(),d=c??f;return l.jsxs("div",{className:N("flex items-center gap-2",i),children:[l.jsx(qy,{ref:u,id:d,checked:t,defaultChecked:e,onCheckedChange:r,disabled:s,"aria-label":o,className:N("peer inline-flex shrink-0 cursor-pointer items-center rounded-full border border-transparent transition-[background-color,box-shadow] outline-none","focus-visible:ring-3 focus-visible:ring-ring/50","disabled:cursor-not-allowed disabled:opacity-50","data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-muted/60",n==="sm"?"h-4 w-7":"h-5 w-9"),children:l.jsx(Yy,{className:N("pointer-events-none block rounded-full bg-background shadow-sm ring-1 ring-black/10 transition-transform dark:ring-white/20",n==="sm"?"h-3 w-3 translate-x-0.5 data-[state=checked]:translate-x-3":"h-4 w-4 translate-x-0.5 data-[state=checked]:translate-x-4")})}),a&&l.jsx("label",{htmlFor:d,className:N("text-sm font-medium text-foreground",s&&"cursor-not-allowed opacity-50"),children:a})]})});tn.displayName="Toggle";const Gy=tn;function Xy(t){if(typeof document>"u")return;let e=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}const Jy=t=>{switch(t){case"success":return ev;case"info":return rv;case"warning":return tv;case"error":return nv;default:return null}},Ky=Array(12).fill(0),Qy=({visible:t,className:e})=>b.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},b.createElement("div",{className:"sonner-spinner"},Ky.map((r,n)=>b.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),ev=b.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},b.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),tv=b.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},b.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),rv=b.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},b.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),nv=b.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},b.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),sv=b.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},b.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),b.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),av=()=>{const[t,e]=b.useState(document.hidden);return b.useEffect(()=>{const r=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),t};let aa=1;class iv{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{const r=this.subscribers.indexOf(e);this.subscribers.splice(r,1)}),this.publish=e=>{this.subscribers.forEach(r=>r(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var r;const{message:n,...s}=e,a=typeof e?.id=="number"||((r=e.id)==null?void 0:r.length)>0?e.id:aa++,i=this.toasts.find(c=>c.id===a),o=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),i?this.toasts=this.toasts.map(c=>c.id===a?(this.publish({...c,...e,id:a,title:n}),{...c,...e,id:a,dismissible:o,title:n}):c):this.addToast({title:n,...s,dismissible:o,id:a}),a},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:e,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(n=>n({id:r.id,dismiss:!0}))}),e),this.message=(e,r)=>this.create({...r,message:e}),this.error=(e,r)=>this.create({...r,message:e,type:"error"}),this.success=(e,r)=>this.create({...r,type:"success",message:e}),this.info=(e,r)=>this.create({...r,type:"info",message:e}),this.warning=(e,r)=>this.create({...r,type:"warning",message:e}),this.loading=(e,r)=>this.create({...r,type:"loading",message:e}),this.promise=(e,r)=>{if(!r)return;let n;r.loading!==void 0&&(n=this.create({...r,promise:e,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const s=Promise.resolve(e instanceof Function?e():e);let a=n!==void 0,i;const o=s.then(async u=>{if(i=["resolve",u],b.isValidElement(u))a=!1,this.create({id:n,type:"default",message:u});else if(lv(u)&&!u.ok){a=!1;const d=typeof r.error=="function"?await r.error(`HTTP error! status: ${u.status}`):r.error,m=typeof r.description=="function"?await r.description(`HTTP error! status: ${u.status}`):r.description,y=typeof d=="object"&&!b.isValidElement(d)?d:{message:d};this.create({id:n,type:"error",description:m,...y})}else if(u instanceof Error){a=!1;const d=typeof r.error=="function"?await r.error(u):r.error,m=typeof r.description=="function"?await r.description(u):r.description,y=typeof d=="object"&&!b.isValidElement(d)?d:{message:d};this.create({id:n,type:"error",description:m,...y})}else if(r.success!==void 0){a=!1;const d=typeof r.success=="function"?await r.success(u):r.success,m=typeof r.description=="function"?await r.description(u):r.description,y=typeof d=="object"&&!b.isValidElement(d)?d:{message:d};this.create({id:n,type:"success",description:m,...y})}}).catch(async u=>{if(i=["reject",u],r.error!==void 0){a=!1;const f=typeof r.error=="function"?await r.error(u):r.error,d=typeof r.description=="function"?await r.description(u):r.description,p=typeof f=="object"&&!b.isValidElement(f)?f:{message:f};this.create({id:n,type:"error",description:d,...p})}}).finally(()=>{a&&(this.dismiss(n),n=void 0),r.finally==null||r.finally.call(r)}),c=()=>new Promise((u,f)=>o.then(()=>i[0]==="reject"?f(i[1]):u(i[1])).catch(f));return typeof n!="string"&&typeof n!="number"?{unwrap:c}:Object.assign(n,{unwrap:c})},this.custom=(e,r)=>{const n=r?.id||aa++;return this.create({jsx:e(n),id:n,...r}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const De=new iv,ov=(t,e)=>{const r=e?.id||aa++;return De.addToast({title:t,...e,id:r}),r},lv=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",cv=ov,uv=()=>De.toasts,dv=()=>De.getActiveToasts(),fv=Object.assign(cv,{success:De.success,info:De.info,warning:De.warning,error:De.error,custom:De.custom,message:De.message,promise:De.promise,dismiss:De.dismiss,loading:De.loading},{getHistory:uv,getToasts:dv});Xy("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function yn(t){return t.label!==void 0}const hv=3,mv="24px",pv="16px",yo=4e3,gv=356,yv=14,vv=45,xv=200;function nt(...t){return t.filter(Boolean).join(" ")}function bv(t){const[e,r]=t.split("-"),n=[];return e&&n.push(e),r&&n.push(r),n}const wv=t=>{var e,r,n,s,a,i,o,c,u;const{invert:f,toast:d,unstyled:m,interacting:p,setHeights:y,visibleToasts:g,heights:x,index:v,toasts:S,expanded:C,removeToast:k,defaultRichColors:w,closeButton:j,style:T,cancelButtonStyle:A,actionButtonStyle:$,className:L="",descriptionClassName:W="",duration:B,position:G,gap:Q,expandByDefault:H,classNames:P,icons:U,closeButtonAriaLabel:V="Close toast"}=t,[ie,F]=b.useState(null),[D,ee]=b.useState(null),[z,oe]=b.useState(!1),[ce,ve]=b.useState(!1),[Te,le]=b.useState(!1),[vt,Yt]=b.useState(!1),[Gt,xt]=b.useState(!1),[Xt,ps]=b.useState(0),[bd,ri]=b.useState(0),Er=b.useRef(d.duration||B||yo),ni=b.useRef(null),ht=b.useRef(null),wd=v===0,kd=v+1<=g,Ae=d.type,Jt=d.dismissible!==!1,Sd=d.className||"",Nd=d.descriptionClassName||"",rn=b.useMemo(()=>x.findIndex(X=>X.toastId===d.id)||0,[x,d.id]),Cd=b.useMemo(()=>{var X;return(X=d.closeButton)!=null?X:j},[d.closeButton,j]),si=b.useMemo(()=>d.duration||B||yo,[d.duration,B]),gs=b.useRef(0),Kt=b.useRef(0),ai=b.useRef(0),Qt=b.useRef(null),[_d,Td]=G.split("-"),ii=b.useMemo(()=>x.reduce((X,xe,we)=>we>=rn?X:X+xe.height,0),[x,rn]),oi=av(),jd=d.invert||f,ys=Ae==="loading";Kt.current=b.useMemo(()=>rn*Q+ii,[rn,ii]),b.useEffect(()=>{Er.current=si},[si]),b.useEffect(()=>{oe(!0)},[]),b.useEffect(()=>{const X=ht.current;if(X){const xe=X.getBoundingClientRect().height;return ri(xe),y(we=>[{toastId:d.id,height:xe,position:d.position},...we]),()=>y(we=>we.filter(Me=>Me.toastId!==d.id))}},[y,d.id]),b.useLayoutEffect(()=>{if(!z)return;const X=ht.current,xe=X.style.height;X.style.height="auto";const we=X.getBoundingClientRect().height;X.style.height=xe,ri(we),y(Me=>Me.find(be=>be.toastId===d.id)?Me.map(be=>be.toastId===d.id?{...be,height:we}:be):[{toastId:d.id,height:we,position:d.position},...Me])},[z,d.title,d.description,y,d.id,d.jsx,d.action,d.cancel]);const bt=b.useCallback(()=>{ve(!0),ps(Kt.current),y(X=>X.filter(xe=>xe.toastId!==d.id)),setTimeout(()=>{k(d)},xv)},[d,k,y,Kt]);b.useEffect(()=>{if(d.promise&&Ae==="loading"||d.duration===1/0||d.type==="loading")return;let X;return C||p||oi?(()=>{if(ai.current<gs.current){const Me=new Date().getTime()-gs.current;Er.current=Er.current-Me}ai.current=new Date().getTime()})():Er.current!==1/0&&(gs.current=new Date().getTime(),X=setTimeout(()=>{d.onAutoClose==null||d.onAutoClose.call(d,d),bt()},Er.current)),()=>clearTimeout(X)},[C,p,d,Ae,oi,bt]),b.useEffect(()=>{d.delete&&(bt(),d.onDismiss==null||d.onDismiss.call(d,d))},[bt,d.delete]);function Ed(){var X;if(U?.loading){var xe;return b.createElement("div",{className:nt(P?.loader,d==null||(xe=d.classNames)==null?void 0:xe.loader,"sonner-loader"),"data-visible":Ae==="loading"},U.loading)}return b.createElement(Qy,{className:nt(P?.loader,d==null||(X=d.classNames)==null?void 0:X.loader),visible:Ae==="loading"})}const Od=d.icon||U?.[Ae]||Jy(Ae);var li,ci;return b.createElement("li",{tabIndex:0,ref:ht,className:nt(L,Sd,P?.toast,d==null||(e=d.classNames)==null?void 0:e.toast,P?.default,P?.[Ae],d==null||(r=d.classNames)==null?void 0:r[Ae]),"data-sonner-toast":"","data-rich-colors":(li=d.richColors)!=null?li:w,"data-styled":!(d.jsx||d.unstyled||m),"data-mounted":z,"data-promise":!!d.promise,"data-swiped":Gt,"data-removed":ce,"data-visible":kd,"data-y-position":_d,"data-x-position":Td,"data-index":v,"data-front":wd,"data-swiping":Te,"data-dismissible":Jt,"data-type":Ae,"data-invert":jd,"data-swipe-out":vt,"data-swipe-direction":D,"data-expanded":!!(C||H&&z),"data-testid":d.testId,style:{"--index":v,"--toasts-before":v,"--z-index":S.length-v,"--offset":`${ce?Xt:Kt.current}px`,"--initial-height":H?"auto":`${bd}px`,...T,...d.style},onDragEnd:()=>{le(!1),F(null),Qt.current=null},onPointerDown:X=>{X.button!==2&&(ys||!Jt||(ni.current=new Date,ps(Kt.current),X.target.setPointerCapture(X.pointerId),X.target.tagName!=="BUTTON"&&(le(!0),Qt.current={x:X.clientX,y:X.clientY})))},onPointerUp:()=>{var X,xe,we;if(vt||!Jt)return;Qt.current=null;const Me=Number(((X=ht.current)==null?void 0:X.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),nn=Number(((xe=ht.current)==null?void 0:xe.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),be=new Date().getTime()-((we=ni.current)==null?void 0:we.getTime()),ze=ie==="x"?Me:nn,sn=Math.abs(ze)/be;if(Math.abs(ze)>=vv||sn>.11){ps(Kt.current),d.onDismiss==null||d.onDismiss.call(d,d),ee(ie==="x"?Me>0?"right":"left":nn>0?"down":"up"),bt(),Yt(!0);return}else{var He,qe;(He=ht.current)==null||He.style.setProperty("--swipe-amount-x","0px"),(qe=ht.current)==null||qe.style.setProperty("--swipe-amount-y","0px")}xt(!1),le(!1),F(null)},onPointerMove:X=>{var xe,we,Me;if(!Qt.current||!Jt||((xe=window.getSelection())==null?void 0:xe.toString().length)>0)return;const be=X.clientY-Qt.current.y,ze=X.clientX-Qt.current.x;var sn;const He=(sn=t.swipeDirections)!=null?sn:bv(G);!ie&&(Math.abs(ze)>1||Math.abs(be)>1)&&F(Math.abs(ze)>Math.abs(be)?"x":"y");let qe={x:0,y:0};const ui=Mt=>1/(1.5+Math.abs(Mt)/20);if(ie==="y"){if(He.includes("top")||He.includes("bottom"))if(He.includes("top")&&be<0||He.includes("bottom")&&be>0)qe.y=be;else{const Mt=be*ui(be);qe.y=Math.abs(Mt)<Math.abs(be)?Mt:be}}else if(ie==="x"&&(He.includes("left")||He.includes("right")))if(He.includes("left")&&ze<0||He.includes("right")&&ze>0)qe.x=ze;else{const Mt=ze*ui(ze);qe.x=Math.abs(Mt)<Math.abs(ze)?Mt:ze}(Math.abs(qe.x)>0||Math.abs(qe.y)>0)&&xt(!0),(we=ht.current)==null||we.style.setProperty("--swipe-amount-x",`${qe.x}px`),(Me=ht.current)==null||Me.style.setProperty("--swipe-amount-y",`${qe.y}px`)}},Cd&&!d.jsx&&Ae!=="loading"?b.createElement("button",{"aria-label":V,"data-disabled":ys,"data-close-button":!0,onClick:ys||!Jt?()=>{}:()=>{bt(),d.onDismiss==null||d.onDismiss.call(d,d)},className:nt(P?.closeButton,d==null||(n=d.classNames)==null?void 0:n.closeButton)},(ci=U?.close)!=null?ci:sv):null,(Ae||d.icon||d.promise)&&d.icon!==null&&(U?.[Ae]!==null||d.icon)?b.createElement("div",{"data-icon":"",className:nt(P?.icon,d==null||(s=d.classNames)==null?void 0:s.icon)},d.promise||d.type==="loading"&&!d.icon?d.icon||Ed():null,d.type!=="loading"?Od:null):null,b.createElement("div",{"data-content":"",className:nt(P?.content,d==null||(a=d.classNames)==null?void 0:a.content)},b.createElement("div",{"data-title":"",className:nt(P?.title,d==null||(i=d.classNames)==null?void 0:i.title)},d.jsx?d.jsx:typeof d.title=="function"?d.title():d.title),d.description?b.createElement("div",{"data-description":"",className:nt(W,Nd,P?.description,d==null||(o=d.classNames)==null?void 0:o.description)},typeof d.description=="function"?d.description():d.description):null),b.isValidElement(d.cancel)?d.cancel:d.cancel&&yn(d.cancel)?b.createElement("button",{"data-button":!0,"data-cancel":!0,style:d.cancelButtonStyle||A,onClick:X=>{yn(d.cancel)&&Jt&&(d.cancel.onClick==null||d.cancel.onClick.call(d.cancel,X),bt())},className:nt(P?.cancelButton,d==null||(c=d.classNames)==null?void 0:c.cancelButton)},d.cancel.label):null,b.isValidElement(d.action)?d.action:d.action&&yn(d.action)?b.createElement("button",{"data-button":!0,"data-action":!0,style:d.actionButtonStyle||$,onClick:X=>{yn(d.action)&&(d.action.onClick==null||d.action.onClick.call(d.action,X),!X.defaultPrevented&&bt())},className:nt(P?.actionButton,d==null||(u=d.classNames)==null?void 0:u.actionButton)},d.action.label):null)};function vo(){if(typeof window>"u"||typeof document>"u")return"ltr";const t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function kv(t,e){const r={};return[t,e].forEach((n,s)=>{const a=s===1,i=a?"--mobile-offset":"--offset",o=a?pv:mv;function c(u){["top","right","bottom","left"].forEach(f=>{r[`${i}-${f}`]=typeof u=="number"?`${u}px`:u})}typeof n=="number"||typeof n=="string"?c(n):typeof n=="object"?["top","right","bottom","left"].forEach(u=>{n[u]===void 0?r[`${i}-${u}`]=o:r[`${i}-${u}`]=typeof n[u]=="number"?`${n[u]}px`:n[u]}):c(o)}),r}const Sv=b.forwardRef(function(e,r){const{id:n,invert:s,position:a="bottom-right",hotkey:i=["altKey","KeyT"],expand:o,closeButton:c,className:u,offset:f,mobileOffset:d,theme:m="light",richColors:p,duration:y,style:g,visibleToasts:x=hv,toastOptions:v,dir:S=vo(),gap:C=yv,icons:k,containerAriaLabel:w="Notifications"}=e,[j,T]=b.useState([]),A=b.useMemo(()=>n?j.filter(z=>z.toasterId===n):j.filter(z=>!z.toasterId),[j,n]),$=b.useMemo(()=>Array.from(new Set([a].concat(A.filter(z=>z.position).map(z=>z.position)))),[A,a]),[L,W]=b.useState([]),[B,G]=b.useState(!1),[Q,H]=b.useState(!1),[P,U]=b.useState(m!=="system"?m:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),V=b.useRef(null),ie=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),F=b.useRef(null),D=b.useRef(!1),ee=b.useCallback(z=>{T(oe=>{var ce;return(ce=oe.find(ve=>ve.id===z.id))!=null&&ce.delete||De.dismiss(z.id),oe.filter(({id:ve})=>ve!==z.id)})},[]);return b.useEffect(()=>De.subscribe(z=>{if(z.dismiss){requestAnimationFrame(()=>{T(oe=>oe.map(ce=>ce.id===z.id?{...ce,delete:!0}:ce))});return}setTimeout(()=>{ma.flushSync(()=>{T(oe=>{const ce=oe.findIndex(ve=>ve.id===z.id);return ce!==-1?[...oe.slice(0,ce),{...oe[ce],...z},...oe.slice(ce+1)]:[z,...oe]})})})}),[j]),b.useEffect(()=>{if(m!=="system"){U(m);return}if(m==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?U("dark"):U("light")),typeof window>"u")return;const z=window.matchMedia("(prefers-color-scheme: dark)");try{z.addEventListener("change",({matches:oe})=>{U(oe?"dark":"light")})}catch{z.addListener(({matches:ce})=>{try{U(ce?"dark":"light")}catch(ve){console.error(ve)}})}},[m]),b.useEffect(()=>{j.length<=1&&G(!1)},[j]),b.useEffect(()=>{const z=oe=>{var ce;if(i.every(le=>oe[le]||oe.code===le)){var Te;G(!0),(Te=V.current)==null||Te.focus()}oe.code==="Escape"&&(document.activeElement===V.current||(ce=V.current)!=null&&ce.contains(document.activeElement))&&G(!1)};return document.addEventListener("keydown",z),()=>document.removeEventListener("keydown",z)},[i]),b.useEffect(()=>{if(V.current)return()=>{F.current&&(F.current.focus({preventScroll:!0}),F.current=null,D.current=!1)}},[V.current]),b.createElement("section",{ref:r,"aria-label":`${w} ${ie}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},$.map((z,oe)=>{var ce;const[ve,Te]=z.split("-");return A.length?b.createElement("ol",{key:z,dir:S==="auto"?vo():S,tabIndex:-1,ref:V,className:u,"data-sonner-toaster":!0,"data-sonner-theme":P,"data-y-position":ve,"data-x-position":Te,style:{"--front-toast-height":`${((ce=L[0])==null?void 0:ce.height)||0}px`,"--width":`${gv}px`,"--gap":`${C}px`,...g,...kv(f,d)},onBlur:le=>{D.current&&!le.currentTarget.contains(le.relatedTarget)&&(D.current=!1,F.current&&(F.current.focus({preventScroll:!0}),F.current=null))},onFocus:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||D.current||(D.current=!0,F.current=le.relatedTarget)},onMouseEnter:()=>G(!0),onMouseMove:()=>G(!0),onMouseLeave:()=>{Q||G(!1)},onDragEnd:()=>G(!1),onPointerDown:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||H(!0)},onPointerUp:()=>H(!1)},A.filter(le=>!le.position&&oe===0||le.position===z).map((le,vt)=>{var Yt,Gt;return b.createElement(wv,{key:le.id,icons:k,index:vt,toast:le,defaultRichColors:p,duration:(Yt=v?.duration)!=null?Yt:y,className:v?.className,descriptionClassName:v?.descriptionClassName,invert:s,visibleToasts:x,closeButton:(Gt=v?.closeButton)!=null?Gt:c,interacting:Q,position:z,style:v?.style,unstyled:v?.unstyled,classNames:v?.classNames,cancelButtonStyle:v?.cancelButtonStyle,actionButtonStyle:v?.actionButtonStyle,closeButtonAriaLabel:v?.closeButtonAriaLabel,removeToast:ee,toasts:A.filter(xt=>xt.position==le.position),heights:L.filter(xt=>xt.position==le.position),setHeights:W,expandByDefault:o,gap:C,expanded:B,swipeDirections:e.swipeDirections})})):null}))});function Nv({...t}){return l.jsx(Sv,{position:"bottom-right",richColors:!1,toastOptions:{classNames:{toast:"group toast rounded-xl bg-background text-foreground shadow-card-sm ring-1 ring-foreground/10",title:"text-sm font-medium",description:"text-sm text-muted-foreground",actionButton:"!h-8 !rounded-md !border-0 !bg-primary !px-2.5 !text-sm !font-medium !text-primary-foreground",cancelButton:"!h-8 !rounded-md !border !border-border !bg-background !px-2.5 !text-sm !font-medium !text-foreground hover:!bg-muted",error:"!bg-destructive/10 !text-foreground !ring-destructive/20",success:"!bg-primary/5 !text-foreground !ring-primary/15",warning:"!bg-amber-500/10 !text-foreground !ring-amber-500/20",info:"!bg-accent !text-accent-foreground !ring-foreground/10"}},...t})}const Cv=zt.Provider,_v=zt.Root,Tv=zt.Trigger,rd=b.forwardRef(({className:t,sideOffset:e=6,children:r,...n},s)=>l.jsx(zt.Portal,{children:l.jsxs(zt.Content,{ref:s,sideOffset:e,className:N("z-50 overflow-hidden rounded-md bg-foreground px-2.5 py-1 text-xs font-medium text-background shadow-card-sm","transition-[opacity,transform] duration-100","data-[state=closed]:opacity-0 data-[state=closed]:scale-95","data-[state=delayed-open]:opacity-100 data-[state=delayed-open]:scale-100",t),...n,children:[r,l.jsx(zt.Arrow,{className:"fill-foreground"})]})}));rd.displayName=zt.Content.displayName;const nd=({logo:t,children:e,footer:r,className:n})=>l.jsx("div",{className:"flex min-h-screen items-center justify-center bg-gradient-to-br from-[--surface-1] via-[--surface-2] to-[--surface-1] px-4 py-12",children:l.jsxs("div",{className:N("w-full max-w-sm rounded-xl bg-[--surface-1] p-8","shadow-[var(--shadow-card-xl)] border border-[--border-1]","flex flex-col gap-6",n),children:[t&&l.jsx("div",{className:"flex justify-center",children:t.href?l.jsx("a",{href:t.href,className:"focus-visible:outline-none focus-visible:ring-2",children:l.jsx("img",{src:t.src,alt:t.alt,className:"h-10 w-auto"})}):l.jsx("img",{src:t.src,alt:t.alt,className:"h-10 w-auto"})}),l.jsx("div",{className:"flex flex-col gap-4",children:e}),r&&l.jsx("div",{className:"border-t border-[--border-1] pt-4 text-center text-xs text-[--text-2]",children:r})]})});nd.displayName="AuthLayout";function jv({items:t,className:e,separator:r,renderLink:n}){const s=r??l.jsx(J.ChevronRight,{className:"h-4 w-4 text-[color:var(--oniratec-label-secondary)]"});return l.jsx("nav",{"aria-label":"Breadcrumb",className:e,children:l.jsx("ol",{className:"flex flex-wrap items-center gap-2 text-sm",children:t.map((a,i)=>{const o=i===t.length-1,c=l.jsx("span",{className:N("transition-colors",o?"font-medium text-[color:var(--oniratec-label-primary)]":"text-[color:var(--oniratec-label-secondary)] hover:text-[color:var(--oniratec-label-primary)]"),children:a.label}),u="inline-flex items-center gap-1 rounded-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[color:var(--oniratec-focus)] focus-visible:ring-offset-2 focus-visible:ring-offset-[color:var(--oniratec-fill-primary)]";return l.jsxs("li",{className:"flex items-center gap-2",children:[o?l.jsx("span",{"aria-current":"page",children:c}):n?n({item:a,className:u,children:c}):a.href?l.jsx("a",{href:a.href,className:u,children:c}):l.jsx("button",{type:"button",onClick:a.onClick,className:u,children:c}),!o&&l.jsx("span",{"aria-hidden":"true",children:s})]},`${a.label}-${i}`)})})})}function Ev({open:t,onOpenChange:e,title:r,description:n,confirmLabel:s="Confirmar",cancelLabel:a="Cancelar",variant:i="default",onConfirm:o,loading:c=!1}){const u=async()=>{await o()};return l.jsx(bu,{open:t,onOpenChange:e,children:l.jsxs(Wa,{size:"sm",hideClose:!0,children:[l.jsxs(Za,{children:[l.jsx(Ua,{children:r}),n&&l.jsx(Ha,{children:n})]}),l.jsxs(Ba,{children:[l.jsx(Le,{variant:"secondary",onClick:()=>e(!1),disabled:c,children:a}),l.jsxs(Le,{variant:i==="destructive"?"destructive":"default",onClick:u,disabled:c,children:[c&&l.jsx(J.Loader2,{className:"h-4 w-4 animate-spin"}),s]})]})]})})}const xo="onira-sidebar-collapsed",Ov=({to:t,children:e,className:r,onClick:n})=>l.jsx("a",{href:t,className:r,onClick:n,children:e});function Dv({item:t,collapsed:e,LinkComponent:r,onMobileClose:n}){const s=r??Ov,a=t.icon;return l.jsxs(s,{to:t.to,end:t.end,className:N("group flex items-center gap-3 rounded-md px-3 py-2 text-sm font-medium transition-colors","text-muted-foreground hover:bg-accent hover:text-accent-foreground","aria-[current=page]:bg-primary/10 aria-[current=page]:text-primary",e&&"justify-center px-2"),onClick:n,children:[a&&l.jsx(a,{className:N("h-4 w-4 shrink-0 transition-colors","group-[.active]:text-primary")}),!e&&l.jsx("span",{className:"flex-1 truncate",children:t.label}),!e&&t.badge!==void 0&&l.jsx(pa,{variant:"secondary",size:"sm",children:t.badge})]})}function bo({navSections:t,logo:e,appName:r,collapsed:n,LinkComponent:s,onMobileClose:a}){return l.jsxs("div",{className:"flex h-full flex-col overflow-hidden",children:[l.jsxs("div",{className:N("flex h-14 items-center border-b border-border px-4 shrink-0",n?"justify-center px-2":"gap-2"),children:[e&&l.jsx("div",{className:"shrink-0",children:e}),!n&&r&&l.jsx("span",{className:"truncate text-sm font-semibold text-foreground",children:r})]}),l.jsx("nav",{className:"flex-1 overflow-y-auto px-2 py-3 space-y-4",children:t.map((i,o)=>l.jsxs("div",{className:"space-y-1",children:[!n&&i.title&&l.jsx("p",{className:"px-3 pb-1 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:i.title}),i.items.map(c=>l.jsx(Dv,{item:c,collapsed:n,LinkComponent:s,onMobileClose:a},c.to))]},o))})]})}function Rv({navSections:t,logo:e,appName:r,headerActions:n,children:s,LinkComponent:a}){const[i,o]=h.useState(()=>{try{return localStorage.getItem(xo)==="true"}catch{return!1}}),[c,u]=h.useState(!1),f=()=>{const d=!i;o(d);try{localStorage.setItem(xo,String(d))}catch{return}};return l.jsxs("div",{className:"flex h-screen overflow-hidden bg-background",children:[l.jsxs("aside",{className:N("hidden md:flex flex-col border-r border-border bg-card transition-all duration-200 relative",i?"w-14":"w-60"),children:[l.jsx(bo,{navSections:t,logo:e,appName:r,collapsed:i,LinkComponent:a}),l.jsx("button",{type:"button",onClick:f,className:N("absolute -right-3 top-16 z-10 flex h-6 w-6 items-center justify-center rounded-full border border-border bg-background text-muted-foreground shadow-card-sm transition-colors hover:bg-accent hover:text-accent-foreground"),"aria-label":i?"Expandir sidebar":"Colapsar sidebar",children:i?l.jsx(J.ChevronRight,{className:"h-3 w-3"}):l.jsx(J.ChevronLeft,{className:"h-3 w-3"})})]}),c&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-40 bg-black/50 md:hidden",onClick:()=>u(!1)}),l.jsxs("div",{className:"fixed inset-y-0 left-0 z-50 w-72 bg-card shadow-card-xl md:hidden",children:[l.jsx("div",{className:"absolute right-3 top-3",children:l.jsx("button",{type:"button",onClick:()=>u(!1),className:"rounded-md p-1.5 text-muted-foreground hover:text-foreground",children:l.jsx(J.X,{className:"h-5 w-5"})})}),l.jsx(bo,{navSections:t,logo:e,appName:r,collapsed:!1,LinkComponent:a,onMobileClose:()=>u(!1)})]})]}),l.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[l.jsxs("header",{className:"flex h-14 shrink-0 items-center justify-between border-b border-border bg-card px-4 md:px-6",children:[l.jsx("button",{type:"button",className:"md:hidden rounded-md p-1.5 text-muted-foreground hover:text-foreground",onClick:()=>u(!0),"aria-label":"Abrir menú",children:l.jsx(J.Menu,{className:"h-5 w-5"})}),l.jsx("div",{className:"hidden md:block"}),n&&l.jsx("div",{className:"flex items-center gap-2",children:n})]}),l.jsx("main",{className:"flex-1 overflow-y-auto",children:s})]})]})}function wo(t){return t?Array.isArray(t)?t:[t]:[]}function Av(t,e){return t==null&&e==null?0:t==null?1:e==null?-1:typeof t=="number"&&typeof e=="number"?t-e:typeof t=="boolean"&&typeof e=="boolean"?Number(t)-Number(e):t instanceof Date&&e instanceof Date?t.getTime()-e.getTime():String(t).localeCompare(String(e),void 0,{numeric:!0,sensitivity:"base"})}function sd({columns:t,data:e,enableSorting:r=!0,sortState:n,defaultSortState:s=null,onSortChange:a,unsortedIcon:i="muted",sortMode:o="single",manualSorting:c=!1,emptyContent:u,loadingContent:f,errorContent:d,isLoading:m=!1}){const[p,y]=b.useState(s),g=n!==void 0?n:p,x=wo(g),v=b.useMemo(()=>new Map(t.map(w=>[w.key,w])),[t]),S=b.useMemo(()=>{if(c||!r||x.length===0)return e;const w=[...e];return w.sort((j,T)=>{for(const A of x){const $=v.get(A.columnId);if(!$)continue;const W=($.sortFn??((B,G)=>{const Q=$.sortValue?.(B)??B[$.key],H=$.sortValue?.(G)??G[$.key];return Av(Q,H)}))(j,T);if(W!==0)return A.direction==="asc"?W:-W}return 0}),w},[e,c,x,v,r]),C=w=>{n===void 0&&y(w),a?.(w)},k=(w,j)=>{if(!(r&&(w.sortable??!!(w.sortFn||w.sortValue))))return;const A=wo(g),$=A.find(W=>W.columnId===w.key),L=$?.direction==="asc"?"desc":$?.direction==="desc"?null:"asc";if(o==="multi"&&j){const W=A.filter(B=>B.columnId!==w.key);L&&W.push({columnId:w.key,direction:L}),C(W.length?W:null);return}if(!L){C(null);return}C({columnId:w.key,direction:L})};return l.jsx("div",{className:"oniratec-data-table",children:l.jsxs("table",{className:"oniratec-data-table__table",children:[l.jsx("thead",{className:"oniratec-data-table__head",children:l.jsx("tr",{className:"oniratec-data-table__head-row",children:t.map(w=>{const j=r&&(w.sortable??!!(w.sortFn||w.sortValue)),A=x.find(L=>L.columnId===w.key)?.direction,$=j?A==="asc"?"ascending":A==="desc"?"descending":"none":void 0;return l.jsx("th",{scope:"col","aria-sort":$,className:N("oniratec-data-table__th",w.headerClassName),children:j?l.jsxs("button",{type:"button",onClick:L=>k(w,L.shiftKey),className:"oniratec-data-table__sort-button",children:[l.jsx("span",{className:"flex-1",children:w.header}),l.jsxs("span",{className:N("oniratec-data-table__sort-icon",A&&"oniratec-data-table__sort-icon--active",!A&&i==="placeholder"&&"opacity-0",!A&&i==="hidden"&&"hidden"),"aria-hidden":"true",children:[A==="asc"&&l.jsx(J.ChevronUp,{className:"h-4 w-4"}),A==="desc"&&l.jsx(J.ChevronDown,{className:"h-4 w-4"}),!A&&i!=="hidden"&&l.jsx(J.ChevronsUpDown,{className:"h-4 w-4"})]})]}):w.header},w.key)})})}),l.jsx("tbody",{className:"oniratec-data-table__divider",children:d&&!m?l.jsx("tr",{children:l.jsx("td",{colSpan:t.length,className:"oniratec-data-table__empty",children:d})}):m?l.jsx("tr",{children:l.jsx("td",{colSpan:t.length,className:"oniratec-data-table__empty",children:f??"Cargando..."})}):S.length===0?l.jsx("tr",{children:l.jsx("td",{colSpan:t.length,className:"oniratec-data-table__empty",children:u??"No hay datos disponibles."})}):S.map((w,j)=>l.jsx("tr",{className:"oniratec-data-table__row",children:t.map(T=>l.jsx("td",{className:N("oniratec-data-table__td",T.className),children:T.render(w)},T.key))},j))})]})})}const Mv=[5,10,25,50],ad=({value:t,onChange:e,options:r=Mv})=>l.jsxs("div",{className:"flex items-center gap-2 text-[color:var(--oniratec-label-secondary)]",children:[l.jsx("span",{children:"Mostrar"}),l.jsxs(fs,{value:t.toString(),onValueChange:n=>{e(parseInt(n))},children:[l.jsx(Kr,{children:l.jsx(hs,{})}),l.jsx(Qr,{children:(r??[]).map(n=>l.jsx(en,{value:n.toString(),children:String(n)},n))})]}),l.jsx("span",{children:"por página"})]}),Iv=({page:t,pageSize:e,total:r,onPageChange:n,onPageSizeChange:s})=>{const a=Math.ceil(r/e);if(a<=1&&r<=e)return null;const i=t+1,o="rounded-md border border-[color:var(--border-1)] px-3 py-1 text-[color:var(--text-1)] transition-colors hover:bg-[color:color-mix(in srgb, var(--brand) 12%, transparent)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[color:var(--focus)] disabled:opacity-50 disabled:cursor-not-allowed";return l.jsxs("div",{className:"mt-4 flex flex-wrap items-center justify-between gap-4 text-sm text-[color:var(--text-2)]",children:[l.jsxs("span",{children:["Página ",i," de ",a]}),l.jsx(ad,{value:e,onChange:s}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("button",{disabled:t===0,onClick:()=>n(t-1),"aria-label":"Página anterior",className:o,children:"Anterior"}),l.jsx("button",{disabled:t+1>=a,onClick:()=>n(t+1),"aria-label":"Página siguiente",className:o,children:"Siguiente"})]})]})};function id({filters:t,value:e,onChange:r,onReset:n,resetLabel:s="Resetear filtros",showReset:a=!0,className:i,layout:o="inline",actions:c}){const u=(m,p)=>{r({...e,[m]:p})},f=a&&!!n,d=o==="stacked"?"grid gap-4":"grid gap-4 sm:grid-cols-2 lg:grid-cols-3";return l.jsxs("section",{className:N("rounded-xl border border-[color:var(--border-1)] bg-[color:var(--surface-2)] p-4 shadow-[var(--shadow-card-sm)]",i),children:[l.jsx("div",{className:d,children:t.map(m=>l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsxs("div",{className:"flex flex-col gap-1",children:[l.jsx("span",{className:"text-sm font-semibold text-[color:var(--text-1)]",children:m.label}),m.helperText&&l.jsx("span",{className:"text-xs text-[color:var(--text-2)]",children:m.helperText})]}),m.type==="text"&&l.jsx($r,{placeholder:m.placeholder,value:e[m.id]??"",onChange:p=>u(m.id,p.target.value),disabled:m.disabled}),m.type==="select"&&l.jsxs(fs,{value:e[m.id]??"",onValueChange:p=>u(m.id,p),disabled:m.disabled,children:[l.jsx(Kr,{children:l.jsx(hs,{placeholder:m.placeholder??"Seleccionar"})}),l.jsx(Qr,{children:m.options.map(p=>l.jsx(en,{value:p.value,children:p.label},p.value))})]}),m.type==="async-select"&&l.jsx(Ga,{value:e[m.id]??"",onValueChange:p=>u(m.id,p),placeholder:m.placeholder,searchPlaceholder:m.searchPlaceholder,minChars:m.minChars,debounceMs:m.debounceMs,fetcher:m.fetcher,getOptionLabel:m.getOptionLabel,getOptionValue:m.getOptionValue,emptyLabel:m.emptyLabel,loadingLabel:m.loadingLabel,emptyActionLabel:m.emptyActionLabel,onEmptyActionClick:m.onEmptyActionClick,disabled:m.disabled}),m.type==="toggle"&&l.jsx(tn,{checked:e[m.id]??!1,onChange:p=>u(m.id,p),disabled:m.disabled,ariaLabel:m.label,label:m.description}),m.type==="date"&&l.jsx(ns,{value:e[m.id]??null,onChange:p=>u(m.id,p??null),placeholder:m.placeholder,min:m.min,max:m.max,timeZone:m.timeZone,disabled:m.disabled})]},m.id))}),(f||c)&&l.jsxs("div",{className:"mt-4 flex flex-wrap items-center justify-between gap-3",children:[f&&l.jsx(Le,{type:"button",variant:"ghost",onClick:n,children:s}),c&&l.jsx("div",{className:"flex items-center gap-2",children:c})]})]})}function od({title:t="Filtros",description:e,children:r,isOpen:n,onOpenChange:s,onApply:a,applyLabel:i="Aplicar filtros",closeLabel:o="Cerrar",className:c}){const u=b.useId(),f=e?`${u}-description`:void 0,d=n,m=b.useCallback(p=>{s(p)},[s]);return b.useEffect(()=>{if(!d)return;const p=y=>{y.key==="Escape"&&m(!1)};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[d,m]),b.useEffect(()=>{if(!d)return;const p=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=p}},[d]),d?l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",children:l.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":u,"aria-describedby":f,className:N("w-full max-w-3xl rounded-2xl border border-[color:var(--border-1)] bg-[color:var(--surface-1)] p-6 shadow-[var(--shadow-card-lg)]",c),children:[l.jsxs("div",{className:"flex items-start justify-between gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx("h2",{id:u,className:"text-lg font-semibold text-[color:var(--text-1)]",children:t}),e&&l.jsx("p",{id:f,className:"text-sm text-[color:var(--text-2)]",children:e})]}),l.jsx("button",{type:"button",onClick:()=>m(!1),className:N("inline-flex h-9 w-9 items-center justify-center rounded-md","text-[color:var(--text-2)] transition-colors","hover:bg-[color:color-mix(in srgb, var(--brand) 12%, transparent)]","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[color:var(--focus)]"),"aria-label":o,children:l.jsx(J.X,{className:"h-4 w-4"})})]}),l.jsx("div",{className:"mt-6",children:r}),l.jsxs("div",{className:"mt-6 flex flex-wrap items-center justify-end gap-2",children:[l.jsx(Le,{type:"button",variant:"ghost",onClick:()=>m(!1),children:o}),l.jsx(Le,{type:"button",onClick:()=>{a?.(),m(!1)},children:i})]})]})}):null}const Pv=".csv,.xlsx";function Fv({title:t="Importar datos",description:e="Sube un fichero CSV o XLSX para ejecutar la importacion.",helperText:r="El sistema procesara cada fila de forma tolerante.",accept:n=Pv,className:s,actionLabel:a="Importar",disabled:i=!1,loading:o=!1,summary:c,onImport:u}){const[f,d]=b.useState([]),m=f[0]??null,p=b.useMemo(()=>c?`Resultado: ${c.created} creados, ${c.updated} actualizados, ${c.failed} fallidos`:null,[c]),y=async()=>{!m||i||o||await u(m)};return l.jsxs("section",{className:N("rounded-xl border border-slate-200 bg-white p-4 shadow-sm space-y-3",s),children:[l.jsxs("header",{className:"space-y-1",children:[l.jsx("h3",{className:"text-sm font-semibold text-slate-900",children:t}),l.jsx("p",{className:"text-sm text-slate-600",children:e})]}),l.jsx(us,{files:f,onFilesChange:d,multiple:!1,accept:n,helperText:r,allowDrop:!0,showPreview:!1,disabled:i||o}),p&&l.jsx("p",{className:"text-sm text-slate-700",children:p}),l.jsx("div",{className:"flex justify-end",children:l.jsx(Le,{type:"button",variant:"primary",onClick:()=>{y()},disabled:!m||i,loading:o,children:a})})]})}function Lv({title:t,value:e,delta:r,deltaLabel:n,icon:s,description:a,loading:i=!1,className:o}){const c=r!==void 0&&r>=0,u=r!==void 0&&r<0;return i?l.jsxs(zs,{className:N("p-6",o),children:[l.jsx(sa,{className:"mb-2 h-4 w-24"}),l.jsx(sa,{className:"h-8 w-32"})]}):l.jsxs(zs,{className:o,children:[l.jsx(Jo,{children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(Ko,{className:"text-sm font-medium text-muted-foreground",children:t}),s&&l.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-md bg-primary/10",children:l.jsx(s,{className:"h-4 w-4 text-primary"})})]})}),l.jsxs(Qo,{children:[l.jsx("div",{className:"text-2xl font-bold text-foreground",children:e}),(r!==void 0||a)&&l.jsxs("div",{className:"mt-1 flex items-center gap-1.5",children:[r!==void 0&&l.jsxs("span",{className:N("inline-flex items-center gap-0.5 text-xs font-medium",c&&"text-emerald-600",u&&"text-red-600"),children:[c?l.jsx(J.TrendingUp,{className:"h-3 w-3"}):l.jsx(J.TrendingDown,{className:"h-3 w-3"}),Math.abs(r),"%"]}),a&&l.jsx("p",{className:"text-xs text-muted-foreground",children:n??a})]})]})]})}function Vv({title:t,description:e,actions:r,className:n}){return l.jsxs("div",{className:N("flex items-start justify-between gap-4",n),children:[l.jsxs("div",{className:"flex flex-col gap-1",children:[l.jsx("h1",{className:"text-2xl font-semibold tracking-tight text-foreground",children:t}),e&&l.jsx("p",{className:"text-sm text-muted-foreground",children:e})]}),r&&l.jsx("div",{className:"flex shrink-0 items-center gap-2",children:r})]})}function $v({mode:t="light",theme:e="nova",children:r}){return b.useEffect(()=>{const n=document.documentElement;n.dataset.mode=t,n.dataset.theme=e,n.classList.toggle("dark",t==="dark"),n.style.colorScheme=t},[t,e]),r}var ne;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function r(s){throw new Error}t.assertNever=r,t.arrayToEnum=s=>{const a={};for(const i of s)a[i]=i;return a},t.getValidEnumValues=s=>{const a=t.objectKeys(s).filter(o=>typeof s[s[o]]!="number"),i={};for(const o of a)i[o]=s[o];return t.objectValues(i)},t.objectValues=s=>t.objectKeys(s).map(function(a){return s[a]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const a=[];for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&a.push(i);return a},t.find=(s,a)=>{for(const i of s)if(a(i))return i},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function n(s,a=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}t.joinValues=n,t.jsonStringifyReplacer=(s,a)=>typeof a=="bigint"?a.toString():a})(ne||(ne={}));var ko;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(ko||(ko={}));const R=ne.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Nt=t=>{switch(typeof t){case"undefined":return R.undefined;case"string":return R.string;case"number":return Number.isNaN(t)?R.nan:R.number;case"boolean":return R.boolean;case"function":return R.function;case"bigint":return R.bigint;case"symbol":return R.symbol;case"object":return Array.isArray(t)?R.array:t===null?R.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?R.promise:typeof Map<"u"&&t instanceof Map?R.map:typeof Set<"u"&&t instanceof Set?R.set:typeof Date<"u"&&t instanceof Date?R.date:R.object;default:return R.unknown}},_=ne.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class yt extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){const r=e||function(a){return a.message},n={_errors:[]},s=a=>{for(const i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)n._errors.push(r(i));else{let o=n,c=0;for(;c<i.path.length;){const u=i.path[c];c===i.path.length-1?(o[u]=o[u]||{_errors:[]},o[u]._errors.push(r(i))):o[u]=o[u]||{_errors:[]},o=o[u],c++}}};return s(this),n}static assert(e){if(!(e instanceof yt))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ne.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){const r={},n=[];for(const s of this.issues)if(s.path.length>0){const a=s.path[0];r[a]=r[a]||[],r[a].push(e(s))}else n.push(e(s));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}yt.create=t=>new yt(t);const ia=(t,e)=>{let r;switch(t.code){case _.invalid_type:t.received===R.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case _.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,ne.jsonStringifyReplacer)}`;break;case _.unrecognized_keys:r=`Unrecognized key(s) in object: ${ne.joinValues(t.keys,", ")}`;break;case _.invalid_union:r="Invalid input";break;case _.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${ne.joinValues(t.options)}`;break;case _.invalid_enum_value:r=`Invalid enum value. Expected ${ne.joinValues(t.options)}, received '${t.received}'`;break;case _.invalid_arguments:r="Invalid function arguments";break;case _.invalid_return_type:r="Invalid function return type";break;case _.invalid_date:r="Invalid date";break;case _.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:ne.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case _.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case _.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case _.custom:r="Invalid input";break;case _.invalid_intersection_types:r="Intersection results could not be merged";break;case _.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case _.not_finite:r="Number must be finite";break;default:r=e.defaultError,ne.assertNever(t)}return{message:r}};let zv=ia;function Wv(){return zv}const Zv=t=>{const{data:e,path:r,errorMaps:n,issueData:s}=t,a=[...r,...s.path||[]],i={...s,path:a};if(s.message!==void 0)return{...s,path:a,message:s.message};let o="";const c=n.filter(u=>!!u).slice().reverse();for(const u of c)o=u(i,{data:e,defaultError:o}).message;return{...s,path:a,message:o}};function O(t,e){const r=Wv(),n=Zv({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===ia?void 0:ia].filter(s=>!!s)});t.common.issues.push(n)}class Ve{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){const n=[];for(const s of r){if(s.status==="aborted")return q;s.status==="dirty"&&e.dirty(),n.push(s.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){const n=[];for(const s of r){const a=await s.key,i=await s.value;n.push({key:a,value:i})}return Ve.mergeObjectSync(e,n)}static mergeObjectSync(e,r){const n={};for(const s of r){const{key:a,value:i}=s;if(a.status==="aborted"||i.status==="aborted")return q;a.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||s.alwaysSet)&&(n[a.value]=i.value)}return{status:e.value,value:n}}}const q=Object.freeze({status:"aborted"}),Mr=t=>({status:"dirty",value:t}),Ue=t=>({status:"valid",value:t}),So=t=>t.status==="aborted",No=t=>t.status==="dirty",yr=t=>t.status==="valid",Ln=t=>typeof Promise<"u"&&t instanceof Promise;var M;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(M||(M={}));class Dt{constructor(e,r,n,s){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Co=(t,e)=>{if(yr(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new yt(t.common.issues);return this._error=r,this._error}}};function K(t){if(!t)return{};const{errorMap:e,invalid_type_error:r,required_error:n,description:s}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(i,o)=>{const{message:c}=t;return i.code==="invalid_enum_value"?{message:c??o.defaultError}:typeof o.data>"u"?{message:c??n??o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:c??r??o.defaultError}},description:s}}class re{get description(){return this._def.description}_getType(e){return Nt(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Nt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ve,ctx:{common:e.parent.common,data:e.data,parsedType:Nt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const r=this._parse(e);if(Ln(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){const r=this._parse(e);return Promise.resolve(r)}parse(e,r){const n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){const n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Nt(e)},s=this._parseSync({data:e,path:n.path,parent:n});return Co(n,s)}"~validate"(e){const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Nt(e)};if(!this["~standard"].async)try{const n=this._parseSync({data:e,path:[],parent:r});return yr(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(n=>yr(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(e,r){const n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){const n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Nt(e)},s=this._parse({data:e,path:n.path,parent:n}),a=await(Ln(s)?s:Promise.resolve(s));return Co(n,a)}refine(e,r){const n=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,a)=>{const i=e(s),o=()=>a.addIssue({code:_.custom,...n(s)});return typeof Promise<"u"&&i instanceof Promise?i.then(c=>c?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,r){return this._refinement((n,s)=>e(n)?!0:(s.addIssue(typeof r=="function"?r(n,s):r),!1))}_refinement(e){return new xr({schema:this,typeName:Y.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Tt.create(this,this._def)}nullable(){return br.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ct.create(this)}promise(){return Wn.create(this,this._def)}or(e){return $n.create([this,e],this._def)}and(e){return zn.create(this,e,this._def)}transform(e){return new xr({...K(this._def),schema:this,typeName:Y.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const r=typeof e=="function"?e:()=>e;return new ca({...K(this._def),innerType:this,defaultValue:r,typeName:Y.ZodDefault})}brand(){return new fx({typeName:Y.ZodBranded,type:this,...K(this._def)})}catch(e){const r=typeof e=="function"?e:()=>e;return new ua({...K(this._def),innerType:this,catchValue:r,typeName:Y.ZodCatch})}describe(e){const r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Ka.create(this,e)}readonly(){return da.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Bv=/^c[^\s-]{8,}$/i,Uv=/^[0-9a-z]+$/,Hv=/^[0-9A-HJKMNP-TV-Z]{26}$/i,qv=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Yv=/^[a-z0-9_-]{21}$/i,Gv=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Xv=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Jv=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Kv="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ls;const Qv=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ex=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,tx=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,rx=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,nx=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,sx=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ld="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",ax=new RegExp(`^${ld}$`);function cd(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function ix(t){return new RegExp(`^${cd(t)}$`)}function ox(t){let e=`${ld}T${cd(t)}`;const r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function lx(t,e){return!!((e==="v4"||!e)&&Qv.test(t)||(e==="v6"||!e)&&tx.test(t))}function cx(t,e){if(!Gv.test(t))return!1;try{const[r]=t.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(n));return!(typeof s!="object"||s===null||"typ"in s&&s?.typ!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return!1}}function ux(t,e){return!!((e==="v4"||!e)&&ex.test(t)||(e==="v6"||!e)&&rx.test(t))}class $t extends re{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==R.string){const a=this._getOrReturnCtx(e);return O(a,{code:_.invalid_type,expected:R.string,received:a.parsedType}),q}const n=new Ve;let s;for(const a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(s=this._getOrReturnCtx(e,s),O(s,{code:_.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")e.data.length>a.value&&(s=this._getOrReturnCtx(e,s),O(s,{code:_.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){const i=e.data.length>a.value,o=e.data.length<a.value;(i||o)&&(s=this._getOrReturnCtx(e,s),i?O(s,{code:_.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&O(s,{code:_.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")Jv.test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"email",code:_.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")Ls||(Ls=new RegExp(Kv,"u")),Ls.test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"emoji",code:_.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")qv.test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"uuid",code:_.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")Yv.test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"nanoid",code:_.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")Bv.test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"cuid",code:_.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")Uv.test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"cuid2",code:_.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")Hv.test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"ulid",code:_.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),O(s,{validation:"url",code:_.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"regex",code:_.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(s=this._getOrReturnCtx(e,s),O(s,{code:_.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(s=this._getOrReturnCtx(e,s),O(s,{code:_.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(s=this._getOrReturnCtx(e,s),O(s,{code:_.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?ox(a).test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{code:_.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?ax.test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{code:_.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?ix(a).test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{code:_.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?Xv.test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"duration",code:_.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?lx(e.data,a.version)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"ip",code:_.invalid_string,message:a.message}),n.dirty()):a.kind==="jwt"?cx(e.data,a.alg)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"jwt",code:_.invalid_string,message:a.message}),n.dirty()):a.kind==="cidr"?ux(e.data,a.version)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"cidr",code:_.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?nx.test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"base64",code:_.invalid_string,message:a.message}),n.dirty()):a.kind==="base64url"?sx.test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"base64url",code:_.invalid_string,message:a.message}),n.dirty()):ne.assertNever(a);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(s=>e.test(s),{validation:r,code:_.invalid_string,...M.errToObj(n)})}_addCheck(e){return new $t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...M.errToObj(e)})}url(e){return this._addCheck({kind:"url",...M.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...M.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...M.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...M.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...M.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...M.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...M.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...M.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...M.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...M.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...M.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...M.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...M.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...M.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...M.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...M.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...M.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...M.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...M.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...M.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...M.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...M.errToObj(r)})}nonempty(e){return this.min(1,M.errToObj(e))}trim(){return new $t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new $t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new $t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}$t.create=t=>new $t({checks:[],typeName:Y.ZodString,coerce:t?.coerce??!1,...K(t)});function dx(t,e){const r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,s=r>n?r:n,a=Number.parseInt(t.toFixed(s).replace(".","")),i=Number.parseInt(e.toFixed(s).replace(".",""));return a%i/10**s}class zr extends re{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==R.number){const a=this._getOrReturnCtx(e);return O(a,{code:_.invalid_type,expected:R.number,received:a.parsedType}),q}let n;const s=new Ve;for(const a of this._def.checks)a.kind==="int"?ne.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),O(n,{code:_.invalid_type,expected:"integer",received:"float",message:a.message}),s.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),O(n,{code:_.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),O(n,{code:_.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="multipleOf"?dx(e.data,a.value)!==0&&(n=this._getOrReturnCtx(e,n),O(n,{code:_.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),O(n,{code:_.not_finite,message:a.message}),s.dirty()):ne.assertNever(a);return{status:s.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,M.toString(r))}gt(e,r){return this.setLimit("min",e,!1,M.toString(r))}lte(e,r){return this.setLimit("max",e,!0,M.toString(r))}lt(e,r){return this.setLimit("max",e,!1,M.toString(r))}setLimit(e,r,n,s){return new zr({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:M.toString(s)}]})}_addCheck(e){return new zr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:M.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:M.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:M.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:M.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:M.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:M.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:M.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:M.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:M.toString(e)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&ne.isInteger(e.value))}get isFinite(){let e=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}}zr.create=t=>new zr({checks:[],typeName:Y.ZodNumber,coerce:t?.coerce||!1,...K(t)});class Wr extends re{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==R.bigint)return this._getInvalidInput(e);let n;const s=new Ve;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),O(n,{code:_.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),O(n,{code:_.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),O(n,{code:_.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):ne.assertNever(a);return{status:s.value,value:e.data}}_getInvalidInput(e){const r=this._getOrReturnCtx(e);return O(r,{code:_.invalid_type,expected:R.bigint,received:r.parsedType}),q}gte(e,r){return this.setLimit("min",e,!0,M.toString(r))}gt(e,r){return this.setLimit("min",e,!1,M.toString(r))}lte(e,r){return this.setLimit("max",e,!0,M.toString(r))}lt(e,r){return this.setLimit("max",e,!1,M.toString(r))}setLimit(e,r,n,s){return new Wr({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:M.toString(s)}]})}_addCheck(e){return new Wr({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:M.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:M.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:M.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:M.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:M.toString(r)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}Wr.create=t=>new Wr({checks:[],typeName:Y.ZodBigInt,coerce:t?.coerce??!1,...K(t)});class _o extends re{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==R.boolean){const n=this._getOrReturnCtx(e);return O(n,{code:_.invalid_type,expected:R.boolean,received:n.parsedType}),q}return Ue(e.data)}}_o.create=t=>new _o({typeName:Y.ZodBoolean,coerce:t?.coerce||!1,...K(t)});class Vn extends re{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==R.date){const a=this._getOrReturnCtx(e);return O(a,{code:_.invalid_type,expected:R.date,received:a.parsedType}),q}if(Number.isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return O(a,{code:_.invalid_date}),q}const n=new Ve;let s;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(s=this._getOrReturnCtx(e,s),O(s,{code:_.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(s=this._getOrReturnCtx(e,s),O(s,{code:_.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):ne.assertNever(a);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Vn({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:M.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:M.toString(r)})}get minDate(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}}Vn.create=t=>new Vn({checks:[],coerce:t?.coerce||!1,typeName:Y.ZodDate,...K(t)});class To extends re{_parse(e){if(this._getType(e)!==R.symbol){const n=this._getOrReturnCtx(e);return O(n,{code:_.invalid_type,expected:R.symbol,received:n.parsedType}),q}return Ue(e.data)}}To.create=t=>new To({typeName:Y.ZodSymbol,...K(t)});class jo extends re{_parse(e){if(this._getType(e)!==R.undefined){const n=this._getOrReturnCtx(e);return O(n,{code:_.invalid_type,expected:R.undefined,received:n.parsedType}),q}return Ue(e.data)}}jo.create=t=>new jo({typeName:Y.ZodUndefined,...K(t)});class Eo extends re{_parse(e){if(this._getType(e)!==R.null){const n=this._getOrReturnCtx(e);return O(n,{code:_.invalid_type,expected:R.null,received:n.parsedType}),q}return Ue(e.data)}}Eo.create=t=>new Eo({typeName:Y.ZodNull,...K(t)});class oa extends re{constructor(){super(...arguments),this._any=!0}_parse(e){return Ue(e.data)}}oa.create=t=>new oa({typeName:Y.ZodAny,...K(t)});class Oo extends re{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ue(e.data)}}Oo.create=t=>new Oo({typeName:Y.ZodUnknown,...K(t)});class Rt extends re{_parse(e){const r=this._getOrReturnCtx(e);return O(r,{code:_.invalid_type,expected:R.never,received:r.parsedType}),q}}Rt.create=t=>new Rt({typeName:Y.ZodNever,...K(t)});class Do extends re{_parse(e){if(this._getType(e)!==R.undefined){const n=this._getOrReturnCtx(e);return O(n,{code:_.invalid_type,expected:R.void,received:n.parsedType}),q}return Ue(e.data)}}Do.create=t=>new Do({typeName:Y.ZodVoid,...K(t)});class ct extends re{_parse(e){const{ctx:r,status:n}=this._processInputParams(e),s=this._def;if(r.parsedType!==R.array)return O(r,{code:_.invalid_type,expected:R.array,received:r.parsedType}),q;if(s.exactLength!==null){const i=r.data.length>s.exactLength.value,o=r.data.length<s.exactLength.value;(i||o)&&(O(r,{code:i?_.too_big:_.too_small,minimum:o?s.exactLength.value:void 0,maximum:i?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&r.data.length<s.minLength.value&&(O(r,{code:_.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&r.data.length>s.maxLength.value&&(O(r,{code:_.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((i,o)=>s.type._parseAsync(new Dt(r,i,r.path,o)))).then(i=>Ve.mergeArray(n,i));const a=[...r.data].map((i,o)=>s.type._parseSync(new Dt(r,i,r.path,o)));return Ve.mergeArray(n,a)}get element(){return this._def.type}min(e,r){return new ct({...this._def,minLength:{value:e,message:M.toString(r)}})}max(e,r){return new ct({...this._def,maxLength:{value:e,message:M.toString(r)}})}length(e,r){return new ct({...this._def,exactLength:{value:e,message:M.toString(r)}})}nonempty(e){return this.min(1,e)}}ct.create=(t,e)=>new ct({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Y.ZodArray,...K(e)});function or(t){if(t instanceof ye){const e={};for(const r in t.shape){const n=t.shape[r];e[r]=Tt.create(or(n))}return new ye({...t._def,shape:()=>e})}else return t instanceof ct?new ct({...t._def,type:or(t.element)}):t instanceof Tt?Tt.create(or(t.unwrap())):t instanceof br?br.create(or(t.unwrap())):t instanceof Ut?Ut.create(t.items.map(e=>or(e))):t}class ye extends re{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),r=ne.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==R.object){const u=this._getOrReturnCtx(e);return O(u,{code:_.invalid_type,expected:R.object,received:u.parsedType}),q}const{status:n,ctx:s}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof Rt&&this._def.unknownKeys==="strip"))for(const u in s.data)i.includes(u)||o.push(u);const c=[];for(const u of i){const f=a[u],d=s.data[u];c.push({key:{status:"valid",value:u},value:f._parse(new Dt(s,d,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof Rt){const u=this._def.unknownKeys;if(u==="passthrough")for(const f of o)c.push({key:{status:"valid",value:f},value:{status:"valid",value:s.data[f]}});else if(u==="strict")o.length>0&&(O(s,{code:_.unrecognized_keys,keys:o}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const f of o){const d=s.data[f];c.push({key:{status:"valid",value:f},value:u._parse(new Dt(s,d,s.path,f)),alwaysSet:f in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const u=[];for(const f of c){const d=await f.key,m=await f.value;u.push({key:d,value:m,alwaysSet:f.alwaysSet})}return u}).then(u=>Ve.mergeObjectSync(n,u)):Ve.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return M.errToObj,new ye({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{const s=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:M.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new ye({...this._def,unknownKeys:"strip"})}passthrough(){return new ye({...this._def,unknownKeys:"passthrough"})}extend(e){return new ye({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ye({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Y.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new ye({...this._def,catchall:e})}pick(e){const r={};for(const n of ne.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new ye({...this._def,shape:()=>r})}omit(e){const r={};for(const n of ne.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new ye({...this._def,shape:()=>r})}deepPartial(){return or(this)}partial(e){const r={};for(const n of ne.objectKeys(this.shape)){const s=this.shape[n];e&&!e[n]?r[n]=s:r[n]=s.optional()}return new ye({...this._def,shape:()=>r})}required(e){const r={};for(const n of ne.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof Tt;)a=a._def.innerType;r[n]=a}return new ye({...this._def,shape:()=>r})}keyof(){return ud(ne.objectKeys(this.shape))}}ye.create=(t,e)=>new ye({shape:()=>t,unknownKeys:"strip",catchall:Rt.create(),typeName:Y.ZodObject,...K(e)});ye.strictCreate=(t,e)=>new ye({shape:()=>t,unknownKeys:"strict",catchall:Rt.create(),typeName:Y.ZodObject,...K(e)});ye.lazycreate=(t,e)=>new ye({shape:t,unknownKeys:"strip",catchall:Rt.create(),typeName:Y.ZodObject,...K(e)});class $n extends re{_parse(e){const{ctx:r}=this._processInputParams(e),n=this._def.options;function s(a){for(const o of a)if(o.result.status==="valid")return o.result;for(const o of a)if(o.result.status==="dirty")return r.common.issues.push(...o.ctx.common.issues),o.result;const i=a.map(o=>new yt(o.ctx.common.issues));return O(r,{code:_.invalid_union,unionErrors:i}),q}if(r.common.async)return Promise.all(n.map(async a=>{const i={...r,common:{...r.common,issues:[]},parent:null};return{result:await a._parseAsync({data:r.data,path:r.path,parent:i}),ctx:i}})).then(s);{let a;const i=[];for(const c of n){const u={...r,common:{...r.common,issues:[]},parent:null},f=c._parseSync({data:r.data,path:r.path,parent:u});if(f.status==="valid")return f;f.status==="dirty"&&!a&&(a={result:f,ctx:u}),u.common.issues.length&&i.push(u.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;const o=i.map(c=>new yt(c));return O(r,{code:_.invalid_union,unionErrors:o}),q}}get options(){return this._def.options}}$n.create=(t,e)=>new $n({options:t,typeName:Y.ZodUnion,...K(e)});function la(t,e){const r=Nt(t),n=Nt(e);if(t===e)return{valid:!0,data:t};if(r===R.object&&n===R.object){const s=ne.objectKeys(e),a=ne.objectKeys(t).filter(o=>s.indexOf(o)!==-1),i={...t,...e};for(const o of a){const c=la(t[o],e[o]);if(!c.valid)return{valid:!1};i[o]=c.data}return{valid:!0,data:i}}else if(r===R.array&&n===R.array){if(t.length!==e.length)return{valid:!1};const s=[];for(let a=0;a<t.length;a++){const i=t[a],o=e[a],c=la(i,o);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else return r===R.date&&n===R.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class zn extends re{_parse(e){const{status:r,ctx:n}=this._processInputParams(e),s=(a,i)=>{if(So(a)||So(i))return q;const o=la(a.value,i.value);return o.valid?((No(a)||No(i))&&r.dirty(),{status:r.value,value:o.data}):(O(n,{code:_.invalid_intersection_types}),q)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,i])=>s(a,i)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}zn.create=(t,e,r)=>new zn({left:t,right:e,typeName:Y.ZodIntersection,...K(r)});class Ut extends re{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==R.array)return O(n,{code:_.invalid_type,expected:R.array,received:n.parsedType}),q;if(n.data.length<this._def.items.length)return O(n,{code:_.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),q;!this._def.rest&&n.data.length>this._def.items.length&&(O(n,{code:_.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const a=[...n.data].map((i,o)=>{const c=this._def.items[o]||this._def.rest;return c?c._parse(new Dt(n,i,n.path,o)):null}).filter(i=>!!i);return n.common.async?Promise.all(a).then(i=>Ve.mergeArray(r,i)):Ve.mergeArray(r,a)}get items(){return this._def.items}rest(e){return new Ut({...this._def,rest:e})}}Ut.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ut({items:t,typeName:Y.ZodTuple,rest:null,...K(e)})};class Ro extends re{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==R.map)return O(n,{code:_.invalid_type,expected:R.map,received:n.parsedType}),q;const s=this._def.keyType,a=this._def.valueType,i=[...n.data.entries()].map(([o,c],u)=>({key:s._parse(new Dt(n,o,n.path,[u,"key"])),value:a._parse(new Dt(n,c,n.path,[u,"value"]))}));if(n.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const c of i){const u=await c.key,f=await c.value;if(u.status==="aborted"||f.status==="aborted")return q;(u.status==="dirty"||f.status==="dirty")&&r.dirty(),o.set(u.value,f.value)}return{status:r.value,value:o}})}else{const o=new Map;for(const c of i){const u=c.key,f=c.value;if(u.status==="aborted"||f.status==="aborted")return q;(u.status==="dirty"||f.status==="dirty")&&r.dirty(),o.set(u.value,f.value)}return{status:r.value,value:o}}}}Ro.create=(t,e,r)=>new Ro({valueType:e,keyType:t,typeName:Y.ZodMap,...K(r)});class Zr extends re{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==R.set)return O(n,{code:_.invalid_type,expected:R.set,received:n.parsedType}),q;const s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(O(n,{code:_.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),r.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&(O(n,{code:_.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());const a=this._def.valueType;function i(c){const u=new Set;for(const f of c){if(f.status==="aborted")return q;f.status==="dirty"&&r.dirty(),u.add(f.value)}return{status:r.value,value:u}}const o=[...n.data.values()].map((c,u)=>a._parse(new Dt(n,c,n.path,u)));return n.common.async?Promise.all(o).then(c=>i(c)):i(o)}min(e,r){return new Zr({...this._def,minSize:{value:e,message:M.toString(r)}})}max(e,r){return new Zr({...this._def,maxSize:{value:e,message:M.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}}Zr.create=(t,e)=>new Zr({valueType:t,minSize:null,maxSize:null,typeName:Y.ZodSet,...K(e)});class Ao extends re{get schema(){return this._def.getter()}_parse(e){const{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}Ao.create=(t,e)=>new Ao({getter:t,typeName:Y.ZodLazy,...K(e)});class Mo extends re{_parse(e){if(e.data!==this._def.value){const r=this._getOrReturnCtx(e);return O(r,{received:r.data,code:_.invalid_literal,expected:this._def.value}),q}return{status:"valid",value:e.data}}get value(){return this._def.value}}Mo.create=(t,e)=>new Mo({value:t,typeName:Y.ZodLiteral,...K(e)});function ud(t,e){return new vr({values:t,typeName:Y.ZodEnum,...K(e)})}class vr extends re{_parse(e){if(typeof e.data!="string"){const r=this._getOrReturnCtx(e),n=this._def.values;return O(r,{expected:ne.joinValues(n),received:r.parsedType,code:_.invalid_type}),q}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const r=this._getOrReturnCtx(e),n=this._def.values;return O(r,{received:r.data,code:_.invalid_enum_value,options:n}),q}return Ue(e.data)}get options(){return this._def.values}get enum(){const e={};for(const r of this._def.values)e[r]=r;return e}get Values(){const e={};for(const r of this._def.values)e[r]=r;return e}get Enum(){const e={};for(const r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return vr.create(e,{...this._def,...r})}exclude(e,r=this._def){return vr.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}}vr.create=ud;class Io extends re{_parse(e){const r=ne.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==R.string&&n.parsedType!==R.number){const s=ne.objectValues(r);return O(n,{expected:ne.joinValues(s),received:n.parsedType,code:_.invalid_type}),q}if(this._cache||(this._cache=new Set(ne.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const s=ne.objectValues(r);return O(n,{received:n.data,code:_.invalid_enum_value,options:s}),q}return Ue(e.data)}get enum(){return this._def.values}}Io.create=(t,e)=>new Io({values:t,typeName:Y.ZodNativeEnum,...K(e)});class Wn extends re{unwrap(){return this._def.type}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==R.promise&&r.common.async===!1)return O(r,{code:_.invalid_type,expected:R.promise,received:r.parsedType}),q;const n=r.parsedType===R.promise?r.data:Promise.resolve(r.data);return Ue(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}}Wn.create=(t,e)=>new Wn({type:t,typeName:Y.ZodPromise,...K(e)});class xr extends re{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Y.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:r,ctx:n}=this._processInputParams(e),s=this._def.effect||null,a={addIssue:i=>{O(n,i),i.fatal?r.abort():r.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),s.type==="preprocess"){const i=s.transform(n.data,a);if(n.common.async)return Promise.resolve(i).then(async o=>{if(r.value==="aborted")return q;const c=await this._def.schema._parseAsync({data:o,path:n.path,parent:n});return c.status==="aborted"?q:c.status==="dirty"||r.value==="dirty"?Mr(c.value):c});{if(r.value==="aborted")return q;const o=this._def.schema._parseSync({data:i,path:n.path,parent:n});return o.status==="aborted"?q:o.status==="dirty"||r.value==="dirty"?Mr(o.value):o}}if(s.type==="refinement"){const i=o=>{const c=s.refinement(o,a);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?q:(o.status==="dirty"&&r.dirty(),i(o.value),{status:r.value,value:o.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>o.status==="aborted"?q:(o.status==="dirty"&&r.dirty(),i(o.value).then(()=>({status:r.value,value:o.value}))))}if(s.type==="transform")if(n.common.async===!1){const i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!yr(i))return q;const o=s.transform(i.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:o}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>yr(i)?Promise.resolve(s.transform(i.value,a)).then(o=>({status:r.value,value:o})):q);ne.assertNever(s)}}xr.create=(t,e,r)=>new xr({schema:t,typeName:Y.ZodEffects,effect:e,...K(r)});xr.createWithPreprocess=(t,e,r)=>new xr({schema:e,effect:{type:"preprocess",transform:t},typeName:Y.ZodEffects,...K(r)});class Tt extends re{_parse(e){return this._getType(e)===R.undefined?Ue(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Tt.create=(t,e)=>new Tt({innerType:t,typeName:Y.ZodOptional,...K(e)});class br extends re{_parse(e){return this._getType(e)===R.null?Ue(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}br.create=(t,e)=>new br({innerType:t,typeName:Y.ZodNullable,...K(e)});class ca extends re{_parse(e){const{ctx:r}=this._processInputParams(e);let n=r.data;return r.parsedType===R.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}ca.create=(t,e)=>new ca({innerType:t,typeName:Y.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...K(e)});class ua extends re{_parse(e){const{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Ln(s)?s.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new yt(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new yt(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}ua.create=(t,e)=>new ua({innerType:t,typeName:Y.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...K(e)});class Po extends re{_parse(e){if(this._getType(e)!==R.nan){const n=this._getOrReturnCtx(e);return O(n,{code:_.invalid_type,expected:R.nan,received:n.parsedType}),q}return{status:"valid",value:e.data}}}Po.create=t=>new Po({typeName:Y.ZodNaN,...K(t)});class fx extends re{_parse(e){const{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class Ka extends re{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?q:a.status==="dirty"?(r.dirty(),Mr(a.value)):this._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{const s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?q:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(e,r){return new Ka({in:e,out:r,typeName:Y.ZodPipeline})}}class da extends re{_parse(e){const r=this._def.innerType._parse(e),n=s=>(yr(s)&&(s.value=Object.freeze(s.value)),s);return Ln(r)?r.then(s=>n(s)):n(r)}unwrap(){return this._def.innerType}}da.create=(t,e)=>new da({innerType:t,typeName:Y.ZodReadonly,...K(e)});var Y;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(Y||(Y={}));const hx=oa.create;Rt.create;ct.create;const mx=ye.create;$n.create;zn.create;Ut.create;vr.create;Wn.create;Tt.create;br.create;function px(t){const e=[];for(const r of t.sections)for(const n of r.fields)Array.isArray(n)?e.push(...n):e.push(n);return e}function gx(t){const e={};for(const n of t.sections)for(const s of n.fields){const a=Array.isArray(s)?s:[s];for(const i of a)e[i.name]=i.schema??hx().optional()}let r=mx(e);return t.crossRules?.length&&(r=r.superRefine((n,s)=>{for(const a of t.crossRules)a(n,s)})),r}function yx(t,e){const r=t.defaultValues?.(e)??{},n=px(t),s={...r};for(const a of n)a.defaultValue!==void 0&&s[a.name]===void 0&&(s[a.name]=a.defaultValue);return s}var vx=t=>t.type==="checkbox",Ir=t=>t instanceof Date,Qa=t=>t==null;const dd=t=>typeof t=="object";var Ht=t=>!Qa(t)&&!Array.isArray(t)&&dd(t)&&!Ir(t),xx=t=>Ht(t)&&t.target?vx(t.target)?t.target.checked:t.target.value:t,bx=t=>t.substring(0,t.search(/\.\d+(\.|$)/))||t,wx=(t,e)=>t.has(bx(e)),kx=t=>{const e=t.constructor&&t.constructor.prototype;return Ht(e)&&e.hasOwnProperty("isPrototypeOf")},Sx=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function fd(t){if(t instanceof Date)return new Date(t);const e=typeof FileList<"u"&&t instanceof FileList;if(Sx&&(t instanceof Blob||e))return t;const r=Array.isArray(t);if(!r&&!(Ht(t)&&kx(t)))return t;const n=r?[]:Object.create(Object.getPrototypeOf(t));for(const s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[s]=fd(t[s]));return n}var hd=t=>/^\w*$/.test(t),fa=t=>t===void 0,Nx=t=>Array.isArray(t)?t.filter(Boolean):[],md=t=>Nx(t.replace(/["|']|\]/g,"").split(/\.|\[/)),Oe=(t,e,r)=>{if(!e||!Ht(t))return r;const n=(hd(e)?[e]:md(e)).reduce((s,a)=>Qa(s)?s:s[a],t);return fa(n)||n===t?fa(t[e])?r:t[e]:n},Vs=t=>typeof t=="boolean",vn=t=>typeof t=="function",Fo=(t,e,r)=>{let n=-1;const s=hd(e)?[e]:md(e),a=s.length,i=a-1;for(;++n<a;){const o=s[n];let c=r;if(n!==i){const u=t[o];c=Ht(u)||Array.isArray(u)?u:isNaN(+s[n+1])?{}:[]}if(o==="__proto__"||o==="constructor"||o==="prototype")return;t[o]=c,t=t[o]}};const Lo={BLUR:"blur",CHANGE:"change"},Vo={all:"all"},ei=b.createContext(null);ei.displayName="HookFormContext";const ti=()=>b.useContext(ei),Cx=t=>{const{children:e,...r}=t;return b.createElement(ei.Provider,{value:r},e)};var _x=(t,e,r,n=!0)=>{const s={defaultValues:e._defaultValues};for(const a in t)Object.defineProperty(s,a,{get:()=>{const i=a;return e._proxyFormState[i]!==Vo.all&&(e._proxyFormState[i]=!n||Vo.all),r&&(r[i]=!0),t[i]}});return s};const pd=typeof window<"u"?b.useLayoutEffect:b.useEffect;function Tx(t){const e=ti(),{control:r=e.control,disabled:n,name:s,exact:a}=t||{},[i,o]=b.useState(r._formState),c=b.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return pd(()=>r._subscribe({name:s,formState:c.current,exact:a,callback:u=>{!n&&o({...r._formState,...u})}}),[s,n,a]),b.useEffect(()=>{c.current.isValid&&r._setValid(!0)},[r]),b.useMemo(()=>_x(i,r,c.current,!1),[i,r])}var jx=t=>typeof t=="string",$o=(t,e,r,n,s)=>jx(t)?Oe(r,t,s):Array.isArray(t)?t.map(a=>Oe(r,a)):r,zo=t=>Qa(t)||!dd(t);function _n(t,e,r=new WeakSet){if(zo(t)||zo(e))return Object.is(t,e);if(Ir(t)&&Ir(e))return Object.is(t.getTime(),e.getTime());const n=Object.keys(t),s=Object.keys(e);if(n.length!==s.length)return!1;if(r.has(t)||r.has(e))return!0;r.add(t),r.add(e);for(const a of n){const i=t[a];if(!s.includes(a))return!1;if(a!=="ref"){const o=e[a];if(Ir(i)&&Ir(o)||Ht(i)&&Ht(o)||Array.isArray(i)&&Array.isArray(o)?!_n(i,o,r):!Object.is(i,o))return!1}}return!0}function gd(t){const e=ti(),{control:r=e.control,name:n,defaultValue:s,disabled:a,exact:i,compute:o}=t||{},c=b.useRef(s),u=b.useRef(o),f=b.useRef(void 0),d=b.useRef(r),m=b.useRef(n);u.current=o;const[p,y]=b.useState(()=>{const k=r._getWatch(n,c.current);return u.current?u.current(k):k}),g=b.useCallback(k=>{const w=$o(n,r._names,k||r._formValues,!1,c.current);return u.current?u.current(w):w},[r._formValues,r._names,n]),x=b.useCallback(k=>{if(!a){const w=$o(n,r._names,k||r._formValues,!1,c.current);if(u.current){const j=u.current(w);_n(j,f.current)||(y(j),f.current=j)}else y(w)}},[r._formValues,r._names,a,n]);pd(()=>((d.current!==r||!_n(m.current,n))&&(d.current=r,m.current=n,x()),r._subscribe({name:n,formState:{values:!0},exact:i,callback:k=>{x(k.values)}})),[r,i,n,x]),b.useEffect(()=>r._removeUnmounted());const v=d.current!==r,S=m.current,C=b.useMemo(()=>{if(a)return null;const k=!v&&!_n(S,n);return v||k?g():null},[a,v,n,S,g]);return C!==null?C:p}function Ex(t){const e=ti(),{name:r,disabled:n,control:s=e.control,shouldUnregister:a,defaultValue:i,exact:o=!0}=t,c=wx(s._names.array,r),u=b.useMemo(()=>Oe(s._formValues,r,Oe(s._defaultValues,r,i)),[s,r,i]),f=gd({control:s,name:r,defaultValue:u,exact:o}),d=Tx({control:s,name:r,exact:o}),m=b.useRef(t),p=b.useRef(void 0),y=b.useRef(s.register(r,{...t.rules,value:f,...Vs(t.disabled)?{disabled:t.disabled}:{}}));m.current=t;const g=b.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Oe(d.errors,r)},isDirty:{enumerable:!0,get:()=>!!Oe(d.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!Oe(d.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!Oe(d.validatingFields,r)},error:{enumerable:!0,get:()=>Oe(d.errors,r)}}),[d,r]),x=b.useCallback(k=>y.current.onChange({target:{value:xx(k),name:r},type:Lo.CHANGE}),[r]),v=b.useCallback(()=>y.current.onBlur({target:{value:Oe(s._formValues,r),name:r},type:Lo.BLUR}),[r,s._formValues]),S=b.useCallback(k=>{const w=Oe(s._fields,r);w&&w._f&&k&&(w._f.ref={focus:()=>vn(k.focus)&&k.focus(),select:()=>vn(k.select)&&k.select(),setCustomValidity:j=>vn(k.setCustomValidity)&&k.setCustomValidity(j),reportValidity:()=>vn(k.reportValidity)&&k.reportValidity()})},[s._fields,r]),C=b.useMemo(()=>({name:r,value:f,...Vs(n)||d.disabled?{disabled:d.disabled||n}:{},onChange:x,onBlur:v,ref:S}),[r,n,d.disabled,x,v,S,f]);return b.useEffect(()=>{const k=s._options.shouldUnregister||a,w=p.current;w&&w!==r&&!c&&s.unregister(w),s.register(r,{...m.current.rules,...Vs(m.current.disabled)?{disabled:m.current.disabled}:{}});const j=(T,A)=>{const $=Oe(s._fields,T);$&&$._f&&($._f.mount=A)};if(j(r,!0),k){const T=fd(Oe(s._options.defaultValues,r,m.current.defaultValue));Fo(s._defaultValues,r,T),fa(Oe(s._formValues,r))&&Fo(s._formValues,r,T)}return!c&&s.register(r),p.current=r,()=>{(c?k&&!s._state.action:k)?s.unregister(r):j(r,!1)}},[r,s,c,a]),b.useEffect(()=>{s._setDisabledField({disabled:n,name:r})},[n,r,s]),b.useMemo(()=>({field:C,formState:d,fieldState:g}),[C,d,g])}const Ox=t=>t.render(Ex(t));function Dx({form:t,field:e}){const[r,n]=b.useState(!1);return l.jsx(Ox,{control:t.control,name:e.name,render:({field:s,fieldState:{error:a}})=>{const i=u=>e.normalize?e.normalize(u):u,o=()=>{e.deps?.onChangeTrigger&&t.trigger(e.deps.onChangeTrigger)},c={className:e.className,error:a?.message,required:!e.schema?.isOptional?.()};switch(e.kind){case"custom":if(!e.render)throw new Error(`Field ${e.name} marked as custom but has no render function`);return l.jsx("div",{className:e.className,children:e.render({form:t})});case"input":return l.jsxs(st,{...c,children:[l.jsx(at,{children:e.label}),l.jsx(Xe,{children:l.jsx($r,{type:"text",placeholder:e.placeholder,value:s.value??"",onChange:u=>{s.onChange(i(u.target.value)),o()},onBlur:s.onBlur})}),l.jsx(Je,{})]});case"password":return l.jsxs(st,{...c,children:[l.jsx(at,{children:e.label}),l.jsx(Xe,{children:l.jsxs("div",{className:"relative flex w-full items-center",children:[l.jsx($r,{type:r?"text":"password",placeholder:e.placeholder,value:s.value??"",className:"pr-10",onChange:u=>{const f=u.target.value;s.onChange(i(f)),o()},onBlur:s.onBlur}),l.jsx(Le,{type:"button",variant:"ghost",className:"absolute right-3 flex items-center justify-center text-slate-400 hover:text-slate-600 focus:outline-none",onClick:()=>n(!r),tabIndex:-1,children:r?l.jsx(J.EyeOff,{className:"h-4 w-4"}):l.jsx(J.Eye,{className:"h-4 w-4"})})]})}),l.jsx(Je,{})]});case"textarea":return l.jsxs(st,{...c,children:[l.jsx(at,{children:e.label}),l.jsx(Xe,{children:l.jsx("textarea",{className:"oniratec-field__textarea",value:s.value??"",placeholder:e.placeholder,rows:4,onChange:u=>{s.onChange(i(u.target.value)),o()},onBlur:s.onBlur})}),l.jsx(Je,{})]});case"select":return l.jsxs(st,{...c,children:[l.jsx(at,{children:e.label}),l.jsx(Xe,{children:l.jsxs(fs,{value:s.value||void 0,onValueChange:u=>{s.onChange(i(u||void 0)),o()},children:[l.jsx(Kr,{children:l.jsx(hs,{})}),l.jsx(Qr,{children:(e.options??[]).map(u=>l.jsx(en,{value:String(u.value),children:u.label},u.value))})]})}),l.jsx(Je,{})]});case"asyncSelect":return l.jsxs(st,{...c,children:[l.jsx(at,{children:e.label}),l.jsx(Xe,{children:l.jsx(Ga,{value:s.value||void 0,onValueChange:u=>{s.onChange(i(u)),o()},placeholder:e.placeholder,searchPlaceholder:e.searchPlaceholder,minChars:e.minChars,debounceMs:e.debounceMs,fetcher:e.fetcher,getOptionValue:e.getOptionValue,getOptionLabel:e.getOptionLabel,emptyLabel:e.emptyLabel,emptyActionLabel:e.emptyActionLabel,onEmptyActionClick:e.onEmptyActionClick,hasError:!!a?.message})}),l.jsx(Je,{})]});case"toggle":return l.jsxs(st,{...c,children:[l.jsx(at,{children:e.label}),l.jsx(Xe,{children:l.jsx(tn,{checked:!!s.value,onChange:u=>{s.onChange(i(u)),o()}})}),l.jsx(Je,{})]});case"checkbox":return l.jsxs(st,{...c,children:[l.jsx(Xe,{children:l.jsxs("label",{className:"oniratec-checkbox",children:[l.jsx("input",{type:"checkbox",checked:!!s.value,onChange:u=>{s.onChange(i(u.target.checked)),o()},onBlur:s.onBlur}),l.jsx("span",{children:e.label})]})}),l.jsx(Je,{})]});case"date":return l.jsxs(st,{...c,children:[l.jsx(at,{children:e.label}),l.jsx(Xe,{children:l.jsx(ns,{value:s.value,onChange:u=>{s.onChange(i(u)),o()},placeholder:e.placeholder,min:e.min,max:e.max,timeZone:e.timeZone,isInvalid:!!a?.message})}),l.jsx(Je,{})]});case"fileUpload":{const u=Array.isArray(s.value)?s.value:[];return l.jsxs(st,{...c,children:[l.jsx(at,{children:e.label}),l.jsx(Xe,{children:l.jsx(us,{files:u,onFilesChange:f=>{s.onChange(i(f)),o()},accept:e.accept,multiple:e.multiple,helperText:e.helperText,allowDrop:e.allowDrop,placeholder:e.placeholder,defaultPreviewUrl:e.defaultPreviewUrl})}),l.jsx(Je,{})]})}}}})}function Rx(t){return Array.isArray(t)?t:[t]}function yd({config:t,form:e,onSubmitAction:r,handleErrors:n,submitLabel:s,maxWidthClass:a,children:i}){const o=gd({control:e.control});return l.jsx(Cx,{...e,children:l.jsxs("form",{onSubmit:e.handleSubmit(r,c=>n(c)),className:N("space-y-8",a),children:[t.sections.map((c,u)=>l.jsxs(b.Fragment,{children:[l.jsxs("section",{className:"space-y-4",children:[l.jsx("h3",{className:"oniratec-form__section-title",children:c.title}),l.jsx("div",{className:"space-y-4",children:c.fields.map((f,d)=>{const m=Rx(f).filter(g=>!g.hidden?.(o));if(!m.length)return null;const p=m.reduce((g,x)=>g+(x.colSpan??1),0),y=p>1?N("grid gap-4",p===2&&"grid-cols-2",p===3&&"grid-cols-3",p===4&&"grid-cols-4"):"";return l.jsx("div",{className:y,children:m.map(g=>l.jsx("div",{className:g.colSpan?`col-span-${g.colSpan}`:void 0,children:l.jsx(Dx,{form:e,field:g})},g.name))},d)})})]},c.title),u<t.sections.length-1&&l.jsx(b.Fragment,{children:l.jsx("hr",{className:"oniratec-form__separator"})})]},`fragment-${c.title}`)),i,l.jsx("div",{className:"oniratec-form__actions",children:l.jsx(Le,{type:"submit",loading:e.formState.isSubmitting,children:s})})]})})}function Ax(t){return l.jsx(yd,{...t})}const Mx=t=>t==="center"?"text-center":t==="right"?"text-right":"text-left",Ix=t=>{if(t)return typeof t=="number"?`w-[${t}px]`:t.startsWith("w-")?t:`w-[${t}]`},Px=t=>t?Array.isArray(t)?t:[t]:[];function vd(t){return{columns:t.columns.map(n=>{const s=Mx(n.align),a=Ix(n.width),i=[s,a,n.className].filter(Boolean).join(" "),o=[s,a,n.headerClassName].filter(Boolean).join(" ");return{key:n.id,header:n.header,render:n.cell??(c=>String(n.accessor?.(c)??"")),className:i||void 0,headerClassName:o||void 0,sortable:n.sortable??!!(n.sortFn||n.accessor),sortFn:n.sortFn,sortValue:n.accessor}}),getSortDirection:(n,s)=>Px(n).find(o=>o.columnId===s)?.direction??null}}function Fx(t,e,r){const{columns:n}=vd(t);return l.jsx(sd,{columns:n,data:e,...r})}const Lx=t=>t.reduce((e,r)=>r.type==="toggle"?(e[r.id]=r.value??!1,e):r.type==="date"?(e[r.id]=r.value??null,e):(e[r.id]=r.value??"",e),{});function Vx(t){const e=Lx(t.filters),r=(a,i,o)=>({...a,[i]:o}),n=()=>({...e}),s=a=>t.buildQueryParams?t.buildQueryParams(a):a;return{filters:t.filters,initialState:e,updateFilter:r,resetState:n,buildQueryParams:s}}function xd(t,e,r,n){return l.jsx(id,{filters:t.filters,value:e,onChange:r,onReset:n?.onReset,resetLabel:n?.resetLabel,showReset:n?.showReset,className:n?.className,layout:n?.layout,actions:n?.actions})}function $x(t,e,r,n){return l.jsx(od,{title:n.title,description:n.description,isOpen:n.isOpen,onOpenChange:n.onOpenChange,onApply:n.onApply,applyLabel:n.applyLabel,closeLabel:n.closeLabel,className:n.className,children:xd(t,e,r,n.panel)})}function zx(t,e,r){const n=new Set(t.filter(s=>s.type==="date").map(s=>s.id));return Object.entries(e).reduce((s,[a,i])=>i==null?(s[a]=void 0,s):n.has(a)&&i instanceof Date?(s[a]=eu(i,r?.timeZone)??void 0,s):(s[a]=i,s),{})}function Wx(...t){return Wo.twMerge(ha.clsx(t))}exports.Alert=tl;exports.AlertDescription=nl;exports.AlertTitle=rl;exports.AsyncSelect=Ga;exports.AuthLayout=nd;exports.Badge=pa;exports.Box=Qd;exports.Breadcrumbs=jv;exports.Button=Le;exports.Card=zs;exports.CardAction=lf;exports.CardContent=Qo;exports.CardDescription=of;exports.CardFooter=cf;exports.CardHeader=Jo;exports.CardTitle=Ko;exports.Checkbox=al;exports.ConfirmDialog=Ev;exports.DEFAULT_TIME_ZONE=In;exports.DashboardLayout=Rv;exports.DataTable=sd;exports.DatePicker=ns;exports.Dialog=bu;exports.DialogClose=wy;exports.DialogContent=Wa;exports.DialogDescription=Ha;exports.DialogFooter=Ba;exports.DialogHeader=Za;exports.DialogOverlay=za;exports.DialogPortal=wu;exports.DialogTitle=Ua;exports.DialogTrigger=by;exports.DropdownMenu=Sy;exports.DropdownMenuCheckboxItem=Nu;exports.DropdownMenuContent=ku;exports.DropdownMenuGroup=Cy;exports.DropdownMenuItem=Su;exports.DropdownMenuLabel=_u;exports.DropdownMenuPortal=_y;exports.DropdownMenuRadioGroup=jy;exports.DropdownMenuRadioItem=Cu;exports.DropdownMenuSeparator=Tu;exports.DropdownMenuShortcut=Ou;exports.DropdownMenuSub=Ty;exports.DropdownMenuSubContent=Eu;exports.DropdownMenuSubTrigger=ju;exports.DropdownMenuTrigger=Ny;exports.Field=st;exports.FieldControl=Xe;exports.FieldLabel=at;exports.FieldMessage=Je;exports.FilePicker=Dy;exports.FileUpload=us;exports.FiltersModal=od;exports.FiltersPanel=id;exports.FormFactoryRenderer=yd;exports.ImportFileCard=Fv;exports.Input=$r;exports.Kbd=Au;exports.KpiCard=Lv;exports.Logo=af;exports.NotFoundState=Ry;exports.PageHeader=Vv;exports.PageSizeSelector=ad;exports.Pagination=Iv;exports.PasswordInput=Ru;exports.PersonAvatar=Jd;exports.ProfileAvatar=Kd;exports.Progress=Mu;exports.RadioGroup=My;exports.RadioGroupItem=Pu;exports.Select=fs;exports.SelectContent=Qr;exports.SelectGroup=Iy;exports.SelectItem=en;exports.SelectLabel=Fu;exports.SelectScrollDownButton=Ya;exports.SelectScrollUpButton=qa;exports.SelectSeparator=Lu;exports.SelectTrigger=Kr;exports.SelectValue=hs;exports.Separator=Vu;exports.Sheet=Fy;exports.SheetClose=Vy;exports.SheetContent=zu;exports.SheetDescription=Uu;exports.SheetFooter=Zu;exports.SheetHeader=Wu;exports.SheetOverlay=Xa;exports.SheetPortal=$u;exports.SheetTitle=Bu;exports.SheetTrigger=Ly;exports.Skeleton=sa;exports.Switch=Gy;exports.Tabs=zy;exports.TabsContent=Xu;exports.TabsList=Yu;exports.TabsTrigger=Gu;exports.Textarea=Hu;exports.ThemeProvider=$v;exports.Toaster=Nv;exports.Toggle=tn;exports.Tooltip=_v;exports.TooltipContent=rd;exports.TooltipProvider=Cv;exports.TooltipTrigger=Tv;exports.alertVariants=el;exports.badgeVariants=sl;exports.buildDefaultValues=yx;exports.buildFiltersQueryParams=zx;exports.buildZodSchema=gx;exports.buttonVariants=Xo;exports.cn=Wx;exports.createFiltersFactory=Vx;exports.createTableFactory=vd;exports.isValidTimeZone=Pn;exports.renderFiltersModal=$x;exports.renderFiltersPanel=xd;exports.renderFormFactory=Ax;exports.renderTable=Fx;exports.resolveTimeZone=Jr;exports.setDefaultTimeZone=ny;exports.toDateTime=sy;exports.toISODate=eu;exports.toISODateTime=ay;exports.toast=fv;exports.useField=ds;
46
46
  //# sourceMappingURL=index.cjs.map