sonamu 0.15.0 → 0.15.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/template/implementations/services.template.d.ts.map +1 -1
- package/dist/template/implementations/services.template.js +4 -6
- package/dist/ui-web/assets/{index-CdZtV4yt.js → index-WNemA9iY.js} +1 -1
- package/dist/ui-web/index.html +1 -1
- package/package.json +1 -1
- package/src/template/implementations/services.template.ts +5 -7
|
@@ -40,7 +40,7 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
|
|
|
40
40
|
.allow-interactivity-${e} {pointer-events: all;}
|
|
41
41
|
`},Gi=0,Ki=[];function qi(e){var t=f.useRef([]),n=f.useRef([0,0]),r=f.useRef(),i=f.useState(Gi++)[0],a=f.useState(hi)[0],o=f.useRef(e);f.useEffect(function(){o.current=e},[e]),f.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Gr([e.lockRef.current],(e.shards||[]).map(Hi),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=f.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Bi(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Ni(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Ni(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return zi(h,t,e,h===`h`?s:c,!0)},[]),c=f.useCallback(function(e){var n=e;if(Ki.length&&Ki[Ki.length-1]===a){var r=`deltaY`in n?Vi(n):Bi(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Ui(e.delta,r)})[0];if(i&&i.should)n.cancelable&&n.preventDefault();else if(!i){var c=(o.current.shards||[]).map(Hi).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=f.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Ji(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=f.useCallback(function(e){n.current=Bi(e),r.current=void 0},[]),d=f.useCallback(function(t){l(t.type,Vi(t),t.target,s(t,e.lockRef.current))},[]),p=f.useCallback(function(t){l(t.type,Bi(t),t.target,s(t,e.lockRef.current))},[]);f.useEffect(function(){return Ki.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener(`wheel`,c,Oi),document.addEventListener(`touchmove`,c,Oi),document.addEventListener(`touchstart`,u,Oi),function(){Ki=Ki.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Oi),document.removeEventListener(`touchmove`,c,Oi),document.removeEventListener(`touchstart`,u,Oi)}},[]);var m=e.removeScrollBar,h=e.inert;return f.createElement(f.Fragment,null,h?f.createElement(a,{styles:Wi(i)}):null,m?f.createElement(Ti,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Ji(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Yi=ai(oi,qi),Xi=f.forwardRef(function(e,t){return f.createElement(ci,Ur({},e,{ref:t,sideCar:Yi}))});Xi.classNames=ci.classNames;var Zi=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Qi=new WeakMap,$i=new WeakMap,ea={},ta=0,na=function(e){return e&&(e.host||na(e.parentNode))},ra=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=na(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},ia=function(e,t,n,r){var i=ra(t,Array.isArray(e)?e:[e]);ea[n]||(ea[n]=new WeakMap);var a=ea[n],o=[],s=new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Qi.get(e)||0)+1,l=(a.get(e)||0)+1;Qi.set(e,c),a.set(e,l),o.push(e),c===1&&i&&$i.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),ta++,function(){o.forEach(function(e){var t=Qi.get(e)-1,i=a.get(e)-1;Qi.set(e,t),a.set(e,i),t||($i.has(e)||e.removeAttribute(r),$i.delete(e)),i||e.removeAttribute(n)}),ta--,ta||(Qi=new WeakMap,Qi=new WeakMap,$i=new WeakMap,ea={})}},aa=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Zi(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),ia(r,i,n,`aria-hidden`)):function(){return null}},oa=Object.defineProperty,sa=(e,t)=>oa(e,`name`,{value:t,configurable:!0}),ca=`Dialog`,[la,ua]=st(ca),[da,fa]=la(ca),pa=sa(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=f.useRef(null),c=f.useRef(null),{nodes:l,registry:u}=xr(),[d,p]=un({prop:r,defaultProp:i??!1,onChange:a,caller:ca}),[m,h]=f.useState(0),[g,_]=f.useState(0);return(0,H.jsx)(da,{scope:t,triggerRef:s,contentRef:c,contentId:Fn(),titleId:Fn(),descriptionId:Fn(),titlePresent:m>0,descriptionPresent:g>0,setTitleCount:h,setDescriptionCount:_,open:d,onOpenChange:p,onOpenToggle:f.useCallback(()=>p(e=>!e),[p]),modal:o,branchNodes:l,branchRegistry:u,children:n})},`Dialog`),ma=`DialogTrigger`,ha=f.forwardRef(sa(function(e,t){let{__scopeDialog:n,...r}=e,i=fa(ma,n),a=pt(t,i.triggerRef);return(0,H.jsx)(bn.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Pa(i.open),...r,ref:a,onClick:Xt(e.onClick,i.onOpenToggle)})},`DialogTrigger`)),ga=`DialogPortal`,[_a,va]=la(ga,{forceMount:void 0}),ya=sa(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=fa(ga,t);return(0,H.jsx)(_a,{scope:t,forceMount:n,children:f.Children.map(r,e=>(0,H.jsx)(Tn,{present:n||a.open,children:(0,H.jsx)(Fr,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),ba=`DialogOverlay`,xa=f.forwardRef(sa(function(e,t){let n=va(ba,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=fa(ba,e.__scopeDialog);return a.modal?(0,H.jsx)(Tn,{present:r||a.open,children:(0,H.jsx)(Ca,{...i,ref:t})}):null},`DialogOverlay`)),Sa=gt(`DialogOverlay.RemoveScroll`),Ca=f.forwardRef(sa(function(e,t){let{__scopeDialog:n,...r}=e,i=fa(ba,n),a=pt(t,sr());return(0,H.jsx)(Xi,{as:Sa,allowPinchZoom:!0,shards:f.useMemo(()=>[i.contentRef,...i.branchNodes.map(e=>({current:e}))],[i.contentRef,i.branchNodes]),children:(0,H.jsx)(bn.div,{"data-state":Pa(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),wa=`DialogContent`,Ta=f.forwardRef(sa(function(e,t){let n=va(wa,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=fa(wa,e.__scopeDialog);return(0,H.jsx)(Tn,{present:r||a.open,children:a.modal?(0,H.jsx)(Ea,{...i,ref:t}):(0,H.jsx)(Da,{...i,ref:t})})},`DialogContent`)),Ea=f.forwardRef(sa(function(e,t){let n=fa(wa,e.__scopeDialog),r=f.useRef(null),i=pt(t,n.contentRef,r);return f.useEffect(()=>{let e=r.current;if(e)return aa(e)},[]),(0,H.jsx)(Oa,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:Xt(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Xt(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:Xt(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),Da=f.forwardRef(sa(function(e,t){let n=fa(wa,e.__scopeDialog),r=f.useRef(!1),i=f.useRef(!1);return(0,H.jsx)(Oa,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),Oa=f.forwardRef(sa(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,"aria-describedby":o,children:s,...c}=e,l=fa(wa,n);return Vr(),(0,H.jsx)(br,{registry:l.branchRegistry,children:(0,H.jsx)(vr,{asChild:!0,loop:!0,trapped:r,branches:l.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,H.jsx)(or,{role:`dialog`,id:l.contentId,"aria-labelledby":l.titlePresent?l.titleId:void 0,"aria-describedby":l.descriptionPresent?Na(o,l.descriptionId):o,"data-state":Pa(l.open),...c,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1),children:s})})})},`DialogContentImpl`)),ka=f.forwardRef(sa(function(e,t){let{__scopeDialog:n,...r}=e,i=fa(`DialogTitle`,n),{setTitleCount:a}=i;return Mt(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,H.jsx)(bn.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),Aa=f.forwardRef(sa(function(e,t){let{__scopeDialog:n,...r}=e,i=fa(`DialogDescription`,n),{setDescriptionCount:a}=i;return Mt(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,H.jsx)(bn.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),ja=`DialogClose`,Ma=f.forwardRef(sa(function(e,t){let{__scopeDialog:n,...r}=e,i=fa(ja,n);return(0,H.jsx)(bn.button,{type:`button`,...r,ref:t,onClick:Xt(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function Na(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}sa(Na,`concatAriaDescribedby`);function Pa(e){return e?`open`:`closed`}sa(Pa,`getState`);var Fa=Object.defineProperty,Ia=(e,t)=>Fa(e,`name`,{value:t,configurable:!0}),[La,Ra]=st(`AlertDialog`,[ua]),za=ua(),Ba=Ia(e=>{let{__scopeAlertDialog:t,...n}=e,r=za(t);return(0,H.jsx)(pa,{...r,...n,modal:!0})},`AlertDialog`);f.forwardRef(Ia(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=za(n);return(0,H.jsx)(ha,{...i,...r,ref:t})},`AlertDialogTrigger`));var Va=Ia(e=>{let{__scopeAlertDialog:t,...n}=e,r=za(t);return(0,H.jsx)(ya,{...r,...n})},`AlertDialogPortal`),Ha=f.forwardRef(Ia(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=za(n);return(0,H.jsx)(xa,{...i,...r,ref:t})},`AlertDialogOverlay`)),[Ua,Wa]=La(`AlertDialogContent`),Ga=f.forwardRef(Ia(function(e,t){let{__scopeAlertDialog:n,children:r,...i}=e,a=za(n),o=pt(t,f.useRef(null)),s=f.useRef(null);return(0,H.jsx)(Ua,{scope:n,cancelRef:s,children:(0,H.jsx)(Ta,{role:`alertdialog`,...a,...i,ref:o,onOpenAutoFocus:Xt(i.onOpenAutoFocus,e=>{e.preventDefault(),s.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:r})})},`AlertDialogContent`)),Ka=f.forwardRef(Ia(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=za(n);return(0,H.jsx)(ka,{...i,...r,ref:t})},`AlertDialogTitle`)),qa=f.forwardRef(Ia(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=za(n);return(0,H.jsx)(Aa,{...i,...r,ref:t})},`AlertDialogDescription`)),Ja=f.forwardRef(Ia(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=za(n);return(0,H.jsx)(Ma,{...i,...r,ref:t})},`AlertDialogAction`)),Ya=`AlertDialogCancel`,Xa=f.forwardRef(Ia(function(e,t){let{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=Wa(Ya,n),a=za(n),o=pt(t,i);return(0,H.jsx)(Ma,{...a,...r,ref:o})},`AlertDialogCancel`)),Za=Ba;function Qa({container:e,...t}){let n=Gn();return(0,H.jsx)(Va,{container:e??n,...t})}var $a=f.forwardRef(({className:e,...t},n)=>(0,H.jsx)(Ha,{className:V(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...t,ref:n}));$a.displayName=Ha.displayName;var eo=f.forwardRef(({className:e,...t},n)=>(0,H.jsxs)(Qa,{children:[(0,H.jsx)($a,{}),(0,H.jsx)(Ga,{ref:n,className:V(`fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg`,e),...t})]}));eo.displayName=Ga.displayName;var to=({className:e,...t})=>(0,H.jsx)(`div`,{className:V(`flex flex-col space-y-2 text-center sm:text-left`,e),...t});to.displayName=`AlertDialogHeader`;var no=({className:e,...t})=>(0,H.jsx)(`div`,{className:V(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,e),...t});no.displayName=`AlertDialogFooter`;var ro=f.forwardRef(({className:e,...t},n)=>(0,H.jsx)(Ka,{ref:n,className:V(`text-lg font-semibold`,e),...t}));ro.displayName=Ka.displayName;var io=f.forwardRef(({className:e,...t},n)=>(0,H.jsx)(qa,{ref:n,className:V(`text-sm text-muted-foreground`,e),...t}));io.displayName=qa.displayName;var ao=f.forwardRef(({className:e,...t},n)=>(0,H.jsx)(Ja,{ref:n,className:V(qn(),e),...t}));ao.displayName=Ja.displayName;var oo=f.forwardRef(({className:e,...t},n)=>(0,H.jsx)(Xa,{ref:n,className:V(qn({variant:`outline`}),`mt-2 sm:mt-0`,e),...t}));oo.displayName=Xa.displayName;var so=Un(`inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden`,{variants:{variant:{default:`border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90`,secondary:`border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90`,destructive:`border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60`,outline:`text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground`}},defaultVariants:{variant:`default`}});function co({className:e,variant:t,asChild:n=!1,...r}){return(0,H.jsx)(n?_t:`span`,{"data-slot":`badge`,className:V(so({variant:t}),e),...r})}var lo=(0,f.forwardRef)(({title:e,titleId:t,...n},r)=>(0,H.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,H.jsx)(`title`,{id:t,children:e}):null,(0,H.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`m9 18l6-6l-6-6`})]})),uo=(0,f.forwardRef)(({title:e,titleId:t,...n},r)=>(0,H.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,H.jsx)(`title`,{id:t,children:e}):null,(0,H.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`m15 18l-6-6l6-6`})]}));function fo(e,t,n=`long`){return new Intl.DateTimeFormat(`en-US`,{hour:`numeric`,timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(` `)}var po={},mo={};function ho(e,t){try{let n=(po[e]||=new Intl.DateTimeFormat(`en-US`,{timeZone:e,timeZoneName:`longOffset`}).format)(t).split(`GMT`)[1];return n in mo?mo[n]:_o(n,n.split(`:`))}catch{if(e in mo)return mo[e];let t=e?.match(go);return t?_o(e,t.slice(1)):NaN}}var go=/([+-]\d\d):?(\d\d)?/;function _o(e,t){let n=+(t[0]||0),r=+(t[1]||0),i=(t[2]||0)/60;return mo[e]=n*60+r>0?n*60+r+i:n*60-r-i}var vo=class e extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]==`string`&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(ho(this.timeZone,this))?this.setTime(NaN):e.length?typeof e[0]==`number`&&(e.length===1||e.length===2&&typeof e[1]!=`number`)?this.setTime(e[0]):typeof e[0]==`string`?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),So(this,e)):this.setTime(Date.now())}static tz(t,...n){return n.length?new e(...n,t):new e(Date.now(),t)}withTimeZone(t){return new e(+this,t)}getTimezoneOffset(){let e=-ho(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),bo(this),+this}[Symbol.for(`constructDateFrom`)](t){return new e(+new Date(t),this.timeZone)}},yo=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!yo.test(e))return;let t=e.replace(yo,`$1UTC`);vo.prototype[t]&&(e.startsWith(`get`)?vo.prototype[e]=function(){return this.internal[t]()}:(vo.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),xo(this),+this},vo.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),bo(this),+this}))});function bo(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-ho(e.timeZone,e)*60))}function xo(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),So(e)}function So(e,t){let n=Array.isArray(t)?Co(t):+e.internal,r=ho(e.timeZone,e),i=r>0?Math.floor(r):Math.ceil(r),a=new Date(+e);a.setUTCHours(a.getUTCHours()-1);let o=-new Date(+e).getTimezoneOffset(),s=-new Date(+a).getTimezoneOffset(),c=o-s,l=o;if(c&&o!==i&&Date.prototype.getHours.apply(e)!==(Array.isArray(t)?t[3]||0:e.internal.getUTCHours())){let t=new Date(+e),n=o-i;n&&t.setUTCMinutes(t.getUTCMinutes()+n);let r=ho(e.timeZone,t);(r>0?Math.floor(r):Math.ceil(r))===i&&(l=s)}let u=l-i;u&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+u);let d=new Date(+e);d.setUTCSeconds(0);let f=o>0?d.getSeconds():(d.getSeconds()-60)%60,p=Math.round(-(ho(e.timeZone,e)*60))%60;(p||f)&&Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+p+f);let m=ho(e.timeZone,e),h=m>0?Math.floor(m):Math.ceil(m),g=-new Date(+e).getTimezoneOffset()-h,_=h!==i,v=g-u,y=h-i,b=n-h*60*1e3,x=y>0&&wo(e)-n===y*60*1e3&&wo(e,b)!==n;if(_&&v&&!x){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+v);let t=ho(e.timeZone,e),n=h-(t>0?Math.floor(t):Math.ceil(t));n&&v<0&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+n)}bo(e);let S=(t?n:n+p*1e3)-+e.internal;S&&Math.abs(S)<18e5&&(Date.prototype.setTime.call(e,+e+S),bo(e))}function Co(e){return Date.UTC(e[0],e.length>1?e[1]:0,e.length>2?e[2]:1,...e.slice(3))}function wo(e,t){let n=new Date(t??+e);return n.setUTCSeconds(n.getUTCSeconds()-Math.round(-ho(e.timeZone,n)*60)),+n}var To=class e extends vo{static tz(t,...n){return n.length?new e(...n,t):new e(Date.now(),t)}toISOString(){let[e,t,n]=this.tzComponents(),r=`${e}${t}:${n}`;return this.internal.toISOString().slice(0,-1)+r}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){let[e,t,n,r]=this.internal.toUTCString().split(` `);return`${e?.slice(0,-1)} ${n} ${t} ${r}`}toTimeString(){let e=this.internal.toUTCString().split(` `)[4],[t,n,r]=this.tzComponents();return`${e} GMT${t}${n}${r} (${fo(this.timeZone,this)})`}toLocaleString(e,t){return Date.prototype.toLocaleString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleDateString(e,t){return Date.prototype.toLocaleDateString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleTimeString(e,t){return Date.prototype.toLocaleTimeString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}tzComponents(){let e=this.getTimezoneOffset();return[e>0?`-`:`+`,String(Math.floor(Math.abs(e)/60)).padStart(2,`0`),String(Math.abs(e)%60).padStart(2,`0`)]}withTimeZone(t){return new e(+this,t)}[Symbol.for(`constructDateFrom`)](t){return new e(+new Date(t),this.timeZone)}},Eo=6048e5,Do=864e5,Oo=Symbol.for(`constructDateFrom`);function ko(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&Oo in e?e[Oo](t):e instanceof Date?new e.constructor(t):new Date(t)}function Ao(e,t){return ko(t||e,e)}function jo(e,t,n){let r=Ao(e,n?.in);return isNaN(t)?ko(n?.in||e,NaN):(t&&r.setDate(r.getDate()+t),r)}function Mo(e,t,n){let r=Ao(e,n?.in);if(isNaN(t))return ko(n?.in||e,NaN);if(!t)return r;let i=r.getDate(),a=ko(n?.in||e,r.getTime());return a.setMonth(r.getMonth()+t+1,0),i>=a.getDate()?a:(r.setFullYear(a.getFullYear(),a.getMonth(),i),r)}function No(e,t,n){return jo(e,t*7,n)}function Po(e,t,n){return Mo(e,t*12,n)}function Fo(e){let t=Ao(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-n}function Io(e,...t){let n=ko.bind(null,e||t.find(e=>typeof e==`object`));return t.map(n)}function Lo(e,t){let n=Ao(e,t?.in);return n.setHours(0,0,0,0),n}function Ro(e,t,n){let[r,i]=Io(n?.in,e,t),a=Lo(r),o=Lo(i),s=+a-Fo(a),c=+o-Fo(o);return Math.round((s-c)/Do)}function zo(e,t,n){let[r,i]=Io(n?.in,e,t),a=r.getFullYear()-i.getFullYear(),o=r.getMonth()-i.getMonth();return a*12+o}function Bo(e,t){let[n,r]=Io(e,t.start,t.end);return{start:n,end:r}}function Vo(e,t){let{start:n,end:r}=Bo(t?.in,e),i=+n>+r,a=i?+n:+r,o=i?r:n;o.setHours(0,0,0,0),o.setDate(1);let s=t?.step??1;if(!s)return[];s<0&&(s=-s,i=!i);let c=[];for(;+o<=a;)c.push(ko(n,o)),o.setMonth(o.getMonth()+s);return i?c.reverse():c}function Ho(e,t){let{start:n,end:r}=Bo(t?.in,e),i=+n>+r,a=i?+n:+r,o=i?r:n;o.setHours(0,0,0,0),o.setMonth(0,1);let s=t?.step??1;if(!s)return[];s<0&&(s=-s,i=!i);let c=[];for(;+o<=a;)c.push(ko(n,o)),o.setFullYear(o.getFullYear()+s);return i?c.reverse():c}var Uo={};function Wo(){return Uo}function Go(e,t){let n=Wo(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=Ao(e,t?.in),a=i.getDay(),o=(a<r?-7:0)+6-(a-r);return i.setDate(i.getDate()+o),i.setHours(23,59,59,999),i}function Ko(e,t){return Go(e,{...t,weekStartsOn:1})}function qo(e,t){let n=Ao(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function Jo(e,t){let n=Ao(e,t?.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}var Yo={lessThanXSeconds:{one:`less than a second`,other:`less than {{count}} seconds`},xSeconds:{one:`1 second`,other:`{{count}} seconds`},halfAMinute:`half a minute`,lessThanXMinutes:{one:`less than a minute`,other:`less than {{count}} minutes`},xMinutes:{one:`1 minute`,other:`{{count}} minutes`},aboutXHours:{one:`about 1 hour`,other:`about {{count}} hours`},xHours:{one:`1 hour`,other:`{{count}} hours`},xDays:{one:`1 day`,other:`{{count}} days`},aboutXWeeks:{one:`about 1 week`,other:`about {{count}} weeks`},xWeeks:{one:`1 week`,other:`{{count}} weeks`},aboutXMonths:{one:`about 1 month`,other:`about {{count}} months`},xMonths:{one:`1 month`,other:`{{count}} months`},aboutXYears:{one:`about 1 year`,other:`about {{count}} years`},xYears:{one:`1 year`,other:`{{count}} years`},overXYears:{one:`over 1 year`,other:`over {{count}} years`},almostXYears:{one:`almost 1 year`,other:`almost {{count}} years`}},Xo=(e,t,n)=>{let r,i=Yo[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:r+` ago`:r};function Zo(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var Qo={date:Zo({formats:{full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},defaultWidth:`full`}),time:Zo({formats:{full:`h:mm:ss a zzzz`,long:`h:mm:ss a z`,medium:`h:mm:ss a`,short:`h:mm a`},defaultWidth:`full`}),dateTime:Zo({formats:{full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},$o={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},es=(e,t,n,r)=>$o[e];function ts(e){return(t,n)=>{let r=n?.context?String(n.context):`standalone`,i;if(r===`formatting`&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}var ns={ordinalNumber:(e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+`st`;case 2:return n+`nd`;case 3:return n+`rd`}return n+`th`},era:ts({values:{narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},defaultWidth:`wide`}),quarter:ts({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1st quarter`,`2nd quarter`,`3rd quarter`,`4th quarter`]},defaultWidth:`wide`,argumentCallback:e=>e-1}),month:ts({values:{narrow:[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],wide:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`]},defaultWidth:`wide`}),day:ts({values:{narrow:[`S`,`M`,`T`,`W`,`T`,`F`,`S`],short:[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],abbreviated:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],wide:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`]},defaultWidth:`wide`}),dayPeriod:ts({values:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`}},defaultWidth:`wide`,formattingValues:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`}},defaultFormattingWidth:`wide`})};function rs(e){return(t,n={})=>{let r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;let o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?as(s,e=>e.test(o)):is(s,e=>e.test(o)),l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;let u=t.slice(o.length);return{value:l,rest:u}}}function is(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function as(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function os(e){return(t,n={})=>{let r=t.match(e.matchPattern);if(!r)return null;let i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;let s=t.slice(i.length);return{value:o,rest:s}}}var ss={code:`en-US`,formatDistance:Xo,formatLong:Qo,formatRelative:es,localize:ns,match:{ordinalNumber:os({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:rs({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:`any`}),quarter:rs({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:rs({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:`any`}),day:rs({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:`any`}),dayPeriod:rs({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:`any`,parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:`any`})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function cs(e,t){let n=Ao(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function ls(e,t){let n=Ao(e,t?.in);return Ro(n,cs(n))+1}function us(e,t){let n=Wo(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=Ao(e,t?.in),a=i.getDay(),o=(a<r?7:0)+a-r;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function ds(e,t){return us(e,{...t,weekStartsOn:1})}function fs(e,t){let n=Ao(e,t?.in),r=n.getFullYear(),i=ko(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);let a=ds(i),o=ko(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);let s=ds(o);return n.getTime()>=a.getTime()?r+1:n.getTime()>=s.getTime()?r:r-1}function ps(e,t){let n=fs(e,t),r=ko(t?.in||e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),ds(r)}function ms(e,t){let n=Ao(e,t?.in),r=+ds(n)-ps(n);return Math.round(r/Eo)+1}function hs(e,t){let n=Ao(e,t?.in),r=n.getFullYear(),i=Wo(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,o=ko(t?.in||e,0);o.setFullYear(r+1,0,a),o.setHours(0,0,0,0);let s=us(o,t),c=ko(t?.in||e,0);c.setFullYear(r,0,a),c.setHours(0,0,0,0);let l=us(c,t);return+n>=+s?r+1:+n>=+l?r:r-1}function gs(e,t){let n=Wo(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=hs(e,t),a=ko(t?.in||e,0);return a.setFullYear(i,0,r),a.setHours(0,0,0,0),us(a,t)}function _s(e,t){let n=Ao(e,t?.in),r=+us(n,t)-gs(n,t);return Math.round(r/Eo)+1}function vs(e,t){return(e<0?`-`:``)+Math.abs(e).toString().padStart(t,`0`)}var ys={y(e,t){let n=e.getFullYear(),r=n>0?n:1-n;return vs(t===`yy`?r%100:r,t.length)},M(e,t){let n=e.getMonth();return t===`M`?String(n+1):vs(n+1,2)},d(e,t){return vs(e.getDate(),t.length)},a(e,t){let n=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.toUpperCase();case`aaa`:return n;case`aaaaa`:return n[0];default:return n===`am`?`a.m.`:`p.m.`}},h(e,t){return vs(e.getHours()%12||12,t.length)},H(e,t){return vs(e.getHours(),t.length)},m(e,t){return vs(e.getMinutes(),t.length)},s(e,t){return vs(e.getSeconds(),t.length)},S(e,t){let n=t.length,r=e.getMilliseconds();return vs(Math.trunc(r*10**(n-3)),t.length)}},bs={am:`am`,pm:`pm`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},xs={G:function(e,t,n){let r=+(e.getFullYear()>0);switch(t){case`G`:case`GG`:case`GGG`:return n.era(r,{width:`abbreviated`});case`GGGGG`:return n.era(r,{width:`narrow`});default:return n.era(r,{width:`wide`})}},y:function(e,t,n){if(t===`yo`){let t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:`year`})}return ys.y(e,t)},Y:function(e,t,n,r){let i=hs(e,r),a=i>0?i:1-i;return t===`YY`?vs(a%100,2):t===`Yo`?n.ordinalNumber(a,{unit:`year`}):vs(a,t.length)},R:function(e,t){return vs(fs(e),t.length)},u:function(e,t){return vs(e.getFullYear(),t.length)},Q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`Q`:return String(r);case`QQ`:return vs(r,2);case`Qo`:return n.ordinalNumber(r,{unit:`quarter`});case`QQQ`:return n.quarter(r,{width:`abbreviated`,context:`formatting`});case`QQQQQ`:return n.quarter(r,{width:`narrow`,context:`formatting`});default:return n.quarter(r,{width:`wide`,context:`formatting`})}},q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`q`:return String(r);case`qq`:return vs(r,2);case`qo`:return n.ordinalNumber(r,{unit:`quarter`});case`qqq`:return n.quarter(r,{width:`abbreviated`,context:`standalone`});case`qqqqq`:return n.quarter(r,{width:`narrow`,context:`standalone`});default:return n.quarter(r,{width:`wide`,context:`standalone`})}},M:function(e,t,n){let r=e.getMonth();switch(t){case`M`:case`MM`:return ys.M(e,t);case`Mo`:return n.ordinalNumber(r+1,{unit:`month`});case`MMM`:return n.month(r,{width:`abbreviated`,context:`formatting`});case`MMMMM`:return n.month(r,{width:`narrow`,context:`formatting`});default:return n.month(r,{width:`wide`,context:`formatting`})}},L:function(e,t,n){let r=e.getMonth();switch(t){case`L`:return String(r+1);case`LL`:return vs(r+1,2);case`Lo`:return n.ordinalNumber(r+1,{unit:`month`});case`LLL`:return n.month(r,{width:`abbreviated`,context:`standalone`});case`LLLLL`:return n.month(r,{width:`narrow`,context:`standalone`});default:return n.month(r,{width:`wide`,context:`standalone`})}},w:function(e,t,n,r){let i=_s(e,r);return t===`wo`?n.ordinalNumber(i,{unit:`week`}):vs(i,t.length)},I:function(e,t,n){let r=ms(e);return t===`Io`?n.ordinalNumber(r,{unit:`week`}):vs(r,t.length)},d:function(e,t,n){return t===`do`?n.ordinalNumber(e.getDate(),{unit:`date`}):ys.d(e,t)},D:function(e,t,n){let r=ls(e);return t===`Do`?n.ordinalNumber(r,{unit:`dayOfYear`}):vs(r,t.length)},E:function(e,t,n){let r=e.getDay();switch(t){case`E`:case`EE`:case`EEE`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`EEEEE`:return n.day(r,{width:`narrow`,context:`formatting`});case`EEEEEE`:return n.day(r,{width:`short`,context:`formatting`});default:return n.day(r,{width:`wide`,context:`formatting`})}},e:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`e`:return String(a);case`ee`:return vs(a,2);case`eo`:return n.ordinalNumber(a,{unit:`day`});case`eee`:return n.day(i,{width:`abbreviated`,context:`formatting`});case`eeeee`:return n.day(i,{width:`narrow`,context:`formatting`});case`eeeeee`:return n.day(i,{width:`short`,context:`formatting`});default:return n.day(i,{width:`wide`,context:`formatting`})}},c:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`c`:return String(a);case`cc`:return vs(a,t.length);case`co`:return n.ordinalNumber(a,{unit:`day`});case`ccc`:return n.day(i,{width:`abbreviated`,context:`standalone`});case`ccccc`:return n.day(i,{width:`narrow`,context:`standalone`});case`cccccc`:return n.day(i,{width:`short`,context:`standalone`});default:return n.day(i,{width:`wide`,context:`standalone`})}},i:function(e,t,n){let r=e.getDay(),i=r===0?7:r;switch(t){case`i`:return String(i);case`ii`:return vs(i,t.length);case`io`:return n.ordinalNumber(i,{unit:`day`});case`iii`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`iiiii`:return n.day(r,{width:`narrow`,context:`formatting`});case`iiiiii`:return n.day(r,{width:`short`,context:`formatting`});default:return n.day(r,{width:`wide`,context:`formatting`})}},a:function(e,t,n){let r=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`});case`aaa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`aaaaa`:return n.dayPeriod(r,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(r,{width:`wide`,context:`formatting`})}},b:function(e,t,n){let r=e.getHours(),i;switch(i=r===12?bs.noon:r===0?bs.midnight:r/12>=1?`pm`:`am`,t){case`b`:case`bb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`bbb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`bbbbb`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},B:function(e,t,n){let r=e.getHours(),i;switch(i=r>=17?bs.evening:r>=12?bs.afternoon:r>=4?bs.morning:bs.night,t){case`B`:case`BB`:case`BBB`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`BBBBB`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},h:function(e,t,n){if(t===`ho`){let t=e.getHours()%12;return t===0&&(t=12),n.ordinalNumber(t,{unit:`hour`})}return ys.h(e,t)},H:function(e,t,n){return t===`Ho`?n.ordinalNumber(e.getHours(),{unit:`hour`}):ys.H(e,t)},K:function(e,t,n){let r=e.getHours()%12;return t===`Ko`?n.ordinalNumber(r,{unit:`hour`}):vs(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t===`ko`?n.ordinalNumber(r,{unit:`hour`}):vs(r,t.length)},m:function(e,t,n){return t===`mo`?n.ordinalNumber(e.getMinutes(),{unit:`minute`}):ys.m(e,t)},s:function(e,t,n){return t===`so`?n.ordinalNumber(e.getSeconds(),{unit:`second`}):ys.s(e,t)},S:function(e,t){return ys.S(e,t)},X:function(e,t,n){let r=e.getTimezoneOffset();if(r===0)return`Z`;switch(t){case`X`:return Cs(r);case`XXXX`:case`XX`:return ws(r);default:return ws(r,`:`)}},x:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`x`:return Cs(r);case`xxxx`:case`xx`:return ws(r);default:return ws(r,`:`)}},O:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`O`:case`OO`:case`OOO`:return`GMT`+Ss(r,`:`);default:return`GMT`+ws(r,`:`)}},z:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`z`:case`zz`:case`zzz`:return`GMT`+Ss(r,`:`);default:return`GMT`+ws(r,`:`)}},t:function(e,t,n){return vs(Math.trunc(e/1e3),t.length)},T:function(e,t,n){return vs(+e,t.length)}};function Ss(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=Math.trunc(r/60),a=r%60;return a===0?n+String(i):n+String(i)+t+vs(a,2)}function Cs(e,t){return e%60==0?(e>0?`-`:`+`)+vs(Math.abs(e)/60,2):ws(e,t)}function ws(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=vs(Math.trunc(r/60),2),a=vs(r%60,2);return n+i+t+a}var Ts=(e,t)=>{switch(e){case`P`:return t.date({width:`short`});case`PP`:return t.date({width:`medium`});case`PPP`:return t.date({width:`long`});default:return t.date({width:`full`})}},Es=(e,t)=>{switch(e){case`p`:return t.time({width:`short`});case`pp`:return t.time({width:`medium`});case`ppp`:return t.time({width:`long`});default:return t.time({width:`full`})}},Ds={p:Es,P:(e,t)=>{let n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return Ts(e,t);let a;switch(r){case`P`:a=t.dateTime({width:`short`});break;case`PP`:a=t.dateTime({width:`medium`});break;case`PPP`:a=t.dateTime({width:`long`});break;default:a=t.dateTime({width:`full`})}return a.replace(`{{date}}`,Ts(r,t)).replace(`{{time}}`,Es(i,t))}},Os=/^D+$/,ks=/^Y+$/,As=[`D`,`DD`,`YY`,`YYYY`];function js(e){return Os.test(e)}function Ms(e){return ks.test(e)}function Ns(e,t,n){let r=Ps(e,t,n);if(console.warn(r),As.includes(e))throw RangeError(r)}function Ps(e,t,n){let r=e[0]===`Y`?`years`:`days of the month`;return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function Fs(e){return e instanceof Date||typeof e==`object`&&Object.prototype.toString.call(e)===`[object Date]`}function Is(e){return!(!Fs(e)&&typeof e!=`number`||isNaN(+Ao(e)))}var Ls=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Rs=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,zs=/^'([^]*?)'?$/,Bs=/''/g,Vs=/[a-zA-Z]/;function Hs(e,t,n){let r=Wo(),i=n?.locale??r.locale??ss,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=Ao(e,n?.in);if(!Is(s))throw RangeError(`Invalid time value`);let c=t.match(Rs).map(e=>{let t=e[0];if(t===`p`||t===`P`){let n=Ds[t];return n(e,i.formatLong)}return e}).join(``).match(Ls).map(e=>{if(e===`''`)return{isToken:!1,value:`'`};let t=e[0];if(t===`'`)return{isToken:!1,value:Us(e)};if(xs[t])return{isToken:!0,value:e};if(t.match(Vs))throw RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});i.localize.preprocessor&&(c=i.localize.preprocessor(s,c));let l={firstWeekContainsDate:a,weekStartsOn:o,locale:i};return c.map(r=>{if(!r.isToken)return r.value;let a=r.value;(!n?.useAdditionalWeekYearTokens&&Ms(a)||!n?.useAdditionalDayOfYearTokens&&js(a))&&Ns(a,t,String(e));let o=xs[a[0]];return o(s,a,i.localize,l)}).join(``)}function Us(e){let t=e.match(zs);return t?t[1].replace(Bs,`'`):e}function Ws(e,t){return Ao(e,t?.in).getMonth()}function Gs(e,t){return Ao(e,t?.in).getFullYear()}function Ks(e,t){return+Ao(e)>+Ao(t)}function qs(e,t){return+Ao(e)<+Ao(t)}function Js(e,t,n){let[r,i]=Io(n?.in,e,t);return+Lo(r)==+Lo(i)}function Ys(e,t,n){let[r,i]=Io(n?.in,e,t);return r.getFullYear()===i.getFullYear()&&r.getMonth()===i.getMonth()}function Xs(e,t,n){let[r,i]=Io(n?.in,e,t);return r.getFullYear()===i.getFullYear()}function Zs(e,t){let n,r=t?.in;return e.forEach(e=>{!r&&typeof e==`object`&&(r=ko.bind(null,e));let t=Ao(e,r);(!n||n<t||isNaN(+t))&&(n=t)}),ko(r,n||NaN)}function Qs(e,t){let n,r=t?.in;return e.forEach(e=>{!r&&typeof e==`object`&&(r=ko.bind(null,e));let t=Ao(e,r);(!n||n>t||isNaN(+t))&&(n=t)}),ko(r,n||NaN)}function $s(e,t){let n=Ao(e,t?.in),r=n.getFullYear(),i=n.getMonth(),a=ko(n,0);return a.setFullYear(r,i+1,0),a.setHours(0,0,0,0),a.getDate()}function ec(e,t,n){let r=Ao(e,n?.in),i=r.getFullYear(),a=r.getDate(),o=ko(n?.in||e,0);o.setFullYear(i,t,15),o.setHours(0,0,0,0);let s=$s(o);return r.setMonth(t,Math.min(a,s)),r}function tc(e,t,n){let r=Ao(e,n?.in);return isNaN(+r)?ko(n?.in||e,NaN):(r.setFullYear(t),r)}function nc(e,t){let n=Ao(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}var rc=5,ic=4;function ac(e,t){let n=t.startOfMonth(e),r=n.getDay()>0?n.getDay():7,i=t.addDays(e,-r+1),a=t.addDays(i,34);return t.getMonth(e)===t.getMonth(a)?rc:ic}function oc(e,t){let n=t.startOfMonth(e),r=n.getDay();return r===1?n:r===0?t.addDays(n,-6):t.addDays(n,-1*(r-1))}function sc(e,t){let n=oc(e,t),r=ac(e,t);return t.addDays(n,r*7-1)}var cc={...ss,labels:{labelDayButton:(e,t,n,r)=>{let i;i=r&&typeof r.format==`function`?r.format.bind(r):(e,t)=>Hs(e,t,{locale:ss,...n});let a=i(e,`PPPP`);return t.today&&(a=`Today, ${a}`),t.selected&&(a=`${a}, selected`),a},labelMonthDropdown:`Choose the Month`,labelNext:`Go to the Next Month`,labelPrevious:`Go to the Previous Month`,labelWeekNumber:e=>`Week ${e}`,labelYearDropdown:`Choose the Year`,labelGrid:(e,t,n)=>{let r;return r=n&&typeof n.format==`function`?n.format.bind(n):(e,n)=>Hs(e,n,{locale:ss,...t}),r(e,`LLLL yyyy`)},labelGridcell:(e,t,n,r)=>{let i;i=r&&typeof r.format==`function`?r.format.bind(r):(e,t)=>Hs(e,t,{locale:ss,...n});let a=i(e,`PPPP`);return t?.today&&(a=`Today, ${a}`),a},labelNav:`Navigation bar`,labelWeekNumberHeader:`Week Number`,labelWeekday:(e,t,n)=>{let r;return r=n&&typeof n.format==`function`?n.format.bind(n):(e,n)=>Hs(e,n,{locale:ss,...t}),r(e,`cccc`)}}},lc=class e{constructor(e,t){this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?To.tz(this.options.timeZone):new(this.options.Date??Date),this.newDate=(e,t,n)=>this.overrides?.newDate?this.overrides.newDate(e,t,n):this.options.timeZone?new To(e,t,n,this.options.timeZone):new Date(e,t,n),this.addDays=(e,t)=>this.overrides?.addDays?this.overrides.addDays(e,t):jo(e,t),this.addMonths=(e,t)=>this.overrides?.addMonths?this.overrides.addMonths(e,t):Mo(e,t),this.addWeeks=(e,t)=>this.overrides?.addWeeks?this.overrides.addWeeks(e,t):No(e,t),this.addYears=(e,t)=>this.overrides?.addYears?this.overrides.addYears(e,t):Po(e,t),this.differenceInCalendarDays=(e,t)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(e,t):Ro(e,t),this.differenceInCalendarMonths=(e,t)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(e,t):zo(e,t),this.eachMonthOfInterval=e=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(e):Vo(e),this.eachYearOfInterval=e=>{let t=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(e):Ho(e),n=new Set(t.map(e=>this.getYear(e)));if(n.size===t.length)return t;let r=[];return n.forEach(e=>{r.push(new Date(e,0,1))}),r},this.endOfBroadcastWeek=e=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(e):sc(e,this),this.endOfISOWeek=e=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(e):Ko(e),this.endOfMonth=e=>this.overrides?.endOfMonth?this.overrides.endOfMonth(e):qo(e),this.endOfWeek=(e,t)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(e,t):Go(e,this.options),this.endOfYear=e=>this.overrides?.endOfYear?this.overrides.endOfYear(e):Jo(e),this.format=(e,t,n)=>{let r=this.overrides?.format?this.overrides.format(e,t,this.options):Hs(e,t,this.options);return this.options.numerals&&this.options.numerals!==`latn`?this.replaceDigits(r):r},this.getISOWeek=e=>this.overrides?.getISOWeek?this.overrides.getISOWeek(e):ms(e),this.getMonth=(e,t)=>this.overrides?.getMonth?this.overrides.getMonth(e,this.options):Ws(e,this.options),this.getYear=(e,t)=>this.overrides?.getYear?this.overrides.getYear(e,this.options):Gs(e,this.options),this.getWeek=(e,t)=>this.overrides?.getWeek?this.overrides.getWeek(e,this.options):_s(e,this.options),this.isAfter=(e,t)=>this.overrides?.isAfter?this.overrides.isAfter(e,t):Ks(e,t),this.isBefore=(e,t)=>this.overrides?.isBefore?this.overrides.isBefore(e,t):qs(e,t),this.isDate=e=>this.overrides?.isDate?this.overrides.isDate(e):Fs(e),this.isSameDay=(e,t)=>this.overrides?.isSameDay?this.overrides.isSameDay(e,t):Js(e,t),this.isSameMonth=(e,t)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(e,t):Ys(e,t),this.isSameYear=(e,t)=>this.overrides?.isSameYear?this.overrides.isSameYear(e,t):Xs(e,t),this.max=e=>this.overrides?.max?this.overrides.max(e):Zs(e),this.min=e=>this.overrides?.min?this.overrides.min(e):Qs(e),this.setMonth=(e,t)=>this.overrides?.setMonth?this.overrides.setMonth(e,t):ec(e,t),this.setYear=(e,t)=>this.overrides?.setYear?this.overrides.setYear(e,t):tc(e,t),this.startOfBroadcastWeek=(e,t)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(e,this):oc(e,this),this.startOfDay=e=>this.overrides?.startOfDay?this.overrides.startOfDay(e):Lo(e),this.startOfISOWeek=e=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(e):ds(e),this.startOfMonth=e=>this.overrides?.startOfMonth?this.overrides.startOfMonth(e):nc(e),this.startOfWeek=(e,t)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(e,this.options):us(e,this.options),this.startOfYear=e=>this.overrides?.startOfYear?this.overrides.startOfYear(e):cs(e),this.options={locale:cc,...e},this.overrides=t}getDigitMap(){let{numerals:e=`latn`}=this.options,t=new Intl.NumberFormat(`en-US`,{numberingSystem:e}),n={};for(let e=0;e<10;e++)n[e.toString()]=t.format(e);return n}replaceDigits(e){let t=this.getDigitMap();return e.replace(/\d/g,e=>t[e]||e)}formatNumber(e){return this.replaceDigits(e.toString())}getMonthYearOrder(){let t=this.options.locale?.code;return t&&e.yearFirstLocales.has(t)?`year-first`:`month-first`}formatMonthYear(t){let{locale:n,timeZone:r,numerals:i}=this.options,a=n?.code;if(a&&e.yearFirstLocales.has(a))try{return new Intl.DateTimeFormat(a,{month:`long`,year:`numeric`,timeZone:r,numberingSystem:i}).format(t)}catch{}let o=this.getMonthYearOrder()===`year-first`?`y LLLL`:`LLLL y`;return this.format(t,o)}};lc.yearFirstLocales=new Set([`eu`,`hu`,`ja`,`ja-Hira`,`ja-JP`,`ko`,`ko-KR`,`lt`,`lt-LT`,`lv`,`lv-LV`,`mn`,`mn-MN`,`zh`,`zh-CN`,`zh-HK`,`zh-TW`]);var uc=new lc,dc=class{constructor(e,t,n=uc){this.date=e,this.displayMonth=t,this.outside=!(!t||n.isSameMonth(e,t)),this.dateLib=n,this.isoDate=n.format(e,`yyyy-MM-dd`),this.displayMonthId=n.format(t,`yyyy-MM`),this.dateMonthId=n.format(e,`yyyy-MM`)}isEqualTo(e){return this.dateLib.isSameDay(e.date,this.date)&&this.dateLib.isSameMonth(e.displayMonth,this.displayMonth)}},fc=class{constructor(e,t){this.date=e,this.weeks=t}},pc=class{constructor(e,t){this.days=t,this.weekNumber=e}};function mc(e){return f.createElement(`span`,{...e})}function hc(e){let{size:t=24,orientation:n=`left`,className:r,style:i}=e;return f.createElement(`svg`,{className:r,style:i,width:t,height:t,viewBox:`0 0 24 24`},n===`up`&&f.createElement(`polygon`,{points:`6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28`}),n===`down`&&f.createElement(`polygon`,{points:`6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72`}),n===`left`&&f.createElement(`polygon`,{points:`16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20`}),n===`right`&&f.createElement(`polygon`,{points:`8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20`}))}function gc(e){let{day:t,modifiers:n,...r}=e;return f.createElement(`td`,{...r})}function _c(e){let{day:t,modifiers:n,...r}=e,i=f.useRef(null);return f.useEffect(()=>{n.focused&&i.current?.focus()},[n.focused]),f.createElement(`button`,{ref:i,...r})}var W;(function(e){e.Root=`root`,e.Chevron=`chevron`,e.Day=`day`,e.DayButton=`day_button`,e.CaptionLabel=`caption_label`,e.Dropdowns=`dropdowns`,e.Dropdown=`dropdown`,e.DropdownRoot=`dropdown_root`,e.Footer=`footer`,e.MonthGrid=`month_grid`,e.MonthCaption=`month_caption`,e.MonthsDropdown=`months_dropdown`,e.Month=`month`,e.Months=`months`,e.Nav=`nav`,e.NextMonthButton=`button_next`,e.PreviousMonthButton=`button_previous`,e.Week=`week`,e.Weeks=`weeks`,e.Weekday=`weekday`,e.Weekdays=`weekdays`,e.WeekNumber=`week_number`,e.WeekNumberHeader=`week_number_header`,e.YearsDropdown=`years_dropdown`})(W||={});var vc;(function(e){e.disabled=`disabled`,e.hidden=`hidden`,e.outside=`outside`,e.focused=`focused`,e.today=`today`})(vc||={});var yc;(function(e){e.range_end=`range_end`,e.range_middle=`range_middle`,e.range_start=`range_start`,e.selected=`selected`})(yc||={});var bc;(function(e){e.weeks_before_enter=`weeks_before_enter`,e.weeks_before_exit=`weeks_before_exit`,e.weeks_after_enter=`weeks_after_enter`,e.weeks_after_exit=`weeks_after_exit`,e.caption_after_enter=`caption_after_enter`,e.caption_after_exit=`caption_after_exit`,e.caption_before_enter=`caption_before_enter`,e.caption_before_exit=`caption_before_exit`})(bc||={});var xc=(0,f.createContext)(void 0);function Sc(){let e=(0,f.useContext)(xc);if(e===void 0)throw Error(`useDayPicker() must be used within a custom component.`);return e}function Cc(e){let{options:t,className:n,...r}=e,{classNames:i,components:a,styles:o}=Sc(),s=[i[W.Dropdown],n].join(` `),c=t?.find(({value:e})=>e===r.value);return f.createElement(`span`,{"data-disabled":r.disabled,className:i[W.DropdownRoot],style:o?.[W.DropdownRoot]},f.createElement(a.Select,{className:s,...r},t?.map(({value:e,label:t,disabled:n})=>f.createElement(a.Option,{key:e,value:e,disabled:n},t))),f.createElement(`span`,{className:i[W.CaptionLabel],style:o?.[W.CaptionLabel],"aria-hidden":!0},c?.label,f.createElement(a.Chevron,{orientation:`down`,size:18,className:i[W.Chevron],style:o?.[W.Chevron]})))}function wc(e){return f.createElement(`div`,{...e})}function Tc(e){return f.createElement(`div`,{...e})}function Ec(e){let{calendarMonth:t,displayIndex:n,...r}=e;return f.createElement(`div`,{...r},e.children)}function Dc(e){let{calendarMonth:t,displayIndex:n,...r}=e;return f.createElement(`div`,{...r})}function Oc(e){return f.createElement(`table`,{...e})}function kc(e){return f.createElement(`div`,{...e})}function Ac(e){let{components:t}=Sc();return f.createElement(t.Dropdown,{...e})}function jc(e){let{onPreviousClick:t,onNextClick:n,previousMonth:r,nextMonth:i,...a}=e,{components:o,classNames:s,styles:c,labels:{labelPrevious:l,labelNext:u}}=Sc(),d=(0,f.useCallback)(e=>{i&&n?.(e)},[i,n]),p=(0,f.useCallback)(e=>{r&&t?.(e)},[r,t]);return f.createElement(`nav`,{...a},f.createElement(o.PreviousMonthButton,{type:`button`,className:s[W.PreviousMonthButton],style:c?.[W.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":!r||void 0,"aria-label":l(r),onClick:p},f.createElement(o.Chevron,{disabled:!r||void 0,className:s[W.Chevron],style:c?.[W.Chevron],orientation:`left`})),f.createElement(o.NextMonthButton,{type:`button`,className:s[W.NextMonthButton],style:c?.[W.NextMonthButton],tabIndex:i?void 0:-1,"aria-disabled":!i||void 0,"aria-label":u(i),onClick:d},f.createElement(o.Chevron,{disabled:!i||void 0,orientation:`right`,className:s[W.Chevron],style:c?.[W.Chevron]})))}function Mc(e){return f.createElement(`button`,{...e})}function Nc(e){return f.createElement(`option`,{...e})}function Pc(e){return f.createElement(`button`,{...e})}function Fc(e){let{rootRef:t,...n}=e;return f.createElement(`div`,{...n,ref:t})}function Ic(e){return f.createElement(`select`,{...e})}function Lc(e){let{week:t,...n}=e;return f.createElement(`tr`,{...n})}function Rc(e){return f.createElement(`th`,{...e})}function zc(e){return f.createElement(`thead`,{"aria-hidden":!0},f.createElement(`tr`,{...e}))}function Bc(e){let{week:t,...n}=e;return f.createElement(`th`,{...n})}function Vc(e){return f.createElement(`th`,{...e})}function Hc(e){return f.createElement(`tbody`,{...e})}function Uc(e){let{components:t}=Sc();return f.createElement(t.Dropdown,{...e})}var Wc=s({CaptionLabel:()=>mc,Chevron:()=>hc,Day:()=>gc,DayButton:()=>_c,Dropdown:()=>Cc,DropdownNav:()=>wc,Footer:()=>Tc,Month:()=>Ec,MonthCaption:()=>Dc,MonthGrid:()=>Oc,Months:()=>kc,MonthsDropdown:()=>Ac,Nav:()=>jc,NextMonthButton:()=>Mc,Option:()=>Nc,PreviousMonthButton:()=>Pc,Root:()=>Fc,Select:()=>Ic,Week:()=>Lc,WeekNumber:()=>Bc,WeekNumberHeader:()=>Vc,Weekday:()=>Rc,Weekdays:()=>zc,Weeks:()=>Hc,YearsDropdown:()=>Uc});function Gc(e,t,n=!1,r=uc){let{from:i,to:a}=e,{differenceInCalendarDays:o,isSameDay:s}=r;return i&&a?(o(a,i)<0&&([i,a]=[a,i]),o(t,i)>=+!!n&&o(a,t)>=+!!n):!n&&a?s(a,t):!n&&i?s(i,t):!1}function Kc(e){return!!(e&&typeof e==`object`&&`before`in e&&`after`in e)}function qc(e){return!!(e&&typeof e==`object`&&`from`in e)}function Jc(e){return!!(e&&typeof e==`object`&&`after`in e)}function Yc(e){return!!(e&&typeof e==`object`&&`before`in e)}function Xc(e){return!!(e&&typeof e==`object`&&`dayOfWeek`in e)}function Zc(e,t){return Array.isArray(e)&&e.every(t.isDate)}function Qc(e,t,n=uc){let r=Array.isArray(t)?t:[t],{isSameDay:i,differenceInCalendarDays:a,isAfter:o}=n;return r.some(t=>{if(typeof t==`boolean`)return t;if(n.isDate(t))return i(e,t);if(Zc(t,n))return t.some(t=>i(e,t));if(qc(t))return Gc(t,e,!1,n);if(Xc(t))return Array.isArray(t.dayOfWeek)?t.dayOfWeek.includes(e.getDay()):t.dayOfWeek===e.getDay();if(Kc(t)){let n=a(t.before,e),r=a(t.after,e),i=n>0,s=r<0;return o(t.before,t.after)?s&&i:i||s}return Jc(t)?a(e,t.after)>0:Yc(t)?a(t.before,e)>0:typeof t==`function`&&t(e)})}function $c(e,t,n,r,i){let{disabled:a,hidden:o,modifiers:s,showOutsideDays:c,broadcastCalendar:l,today:u=i.today()}=t,{isSameDay:d,isSameMonth:f,startOfMonth:p,isBefore:m,endOfMonth:h,isAfter:g}=i,_=n&&p(n),v=r&&h(r),y={[vc.focused]:[],[vc.outside]:[],[vc.disabled]:[],[vc.hidden]:[],[vc.today]:[]},b={};for(let t of e){let{date:e,displayMonth:n}=t,r=!(!n||f(e,n)),p=!!(_&&m(e,_)),h=!!(v&&g(e,v)),x=!!(a&&Qc(e,a,i)),S=!!(o&&Qc(e,o,i))||p||h||!l&&!c&&r||l&&c===!1&&r,C=d(e,u);r&&y.outside.push(t),x&&y.disabled.push(t),S&&y.hidden.push(t),C&&y.today.push(t),s&&Object.keys(s).forEach(n=>{let r=s?.[n];r&&Qc(e,r,i)&&(b[n]?b[n].push(t):b[n]=[t])})}return e=>{let t={[vc.focused]:!1,[vc.disabled]:!1,[vc.hidden]:!1,[vc.outside]:!1,[vc.today]:!1},n={};for(let n in y)t[n]=y[n].some(t=>t===e);for(let t in b)n[t]=b[t].some(t=>t===e);return{...t,...n}}}function el(e,t,n={}){return Object.entries(e).filter(([,e])=>e===!0).reduce((e,[r])=>(n[r]?e.push(n[r]):t[vc[r]]?e.push(t[vc[r]]):t[yc[r]]&&e.push(t[yc[r]]),e),[t[W.Day]])}function tl(e){return{...Wc,...e}}function nl(e){let t={"data-mode":e.mode??void 0,"data-required":`required`in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0,"data-nav-layout":e.navLayout||void 0};return Object.entries(e).forEach(([e,n])=>{e.startsWith(`data-`)&&(t[e]=n)}),t}function rl(){let e={};for(let t in W)e[W[t]]=`rdp-${W[t]}`;for(let t in vc)e[vc[t]]=`rdp-${vc[t]}`;for(let t in yc)e[yc[t]]=`rdp-${yc[t]}`;for(let t in bc)e[bc[t]]=`rdp-${bc[t]}`;return e}function il(e,t,n){return(n??new lc(t)).formatMonthYear(e)}function al(e,t,n){return(n??new lc(t)).format(e,`d`)}function ol(e,t=uc){return t.format(e,`LLLL`)}function sl(e,t,n){return(n??new lc(t)).format(e,`cccccc`)}function cl(e,t=uc){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function ll(){return``}function ul(e,t=uc){return t.format(e,`yyyy`)}var dl=s({formatCaption:()=>il,formatDay:()=>al,formatMonthDropdown:()=>ol,formatWeekNumber:()=>cl,formatWeekNumberHeader:()=>ll,formatWeekdayName:()=>sl,formatYearDropdown:()=>ul});function fl(e){return{...dl,...e}}function pl(e,t,n,r){let i=(r??new lc(n)).format(e,`PPPP`);return t.today&&(i=`Today, ${i}`),t.selected&&(i=`${i}, selected`),i}function ml(e,t,n){return(n??new lc(t)).formatMonthYear(e)}function hl(e,t,n,r){let i=(r??new lc(n)).format(e,`PPPP`);return t?.today&&(i=`Today, ${i}`),i}function gl(e){return`Choose the Month`}function _l(){return``}var vl=`Go to the Next Month`;function yl(e,t){return vl}function bl(e){return`Go to the Previous Month`}function xl(e,t,n){return(n??new lc(t)).format(e,`cccc`)}function Sl(e,t){return`Week ${e}`}function Cl(e){return`Week Number`}function wl(e){return`Choose the Year`}var Tl=s({labelDayButton:()=>pl,labelGrid:()=>ml,labelGridcell:()=>hl,labelMonthDropdown:()=>gl,labelNav:()=>_l,labelNext:()=>yl,labelPrevious:()=>bl,labelWeekNumber:()=>Sl,labelWeekNumberHeader:()=>Cl,labelWeekday:()=>xl,labelYearDropdown:()=>wl}),El=(e,t,n)=>t||(n?typeof n==`function`?n:(...e)=>n:e);function Dl(e,t){let n=t.locale?.labels??{};return{...Tl,...e??{},labelDayButton:El(pl,e?.labelDayButton,n.labelDayButton),labelMonthDropdown:El(gl,e?.labelMonthDropdown,n.labelMonthDropdown),labelNext:El(yl,e?.labelNext,n.labelNext),labelPrevious:El(bl,e?.labelPrevious,n.labelPrevious),labelWeekNumber:El(Sl,e?.labelWeekNumber,n.labelWeekNumber),labelYearDropdown:El(wl,e?.labelYearDropdown,n.labelYearDropdown),labelGrid:El(ml,e?.labelGrid,n.labelGrid),labelGridcell:El(hl,e?.labelGridcell,n.labelGridcell),labelNav:El(_l,e?.labelNav,n.labelNav),labelWeekNumberHeader:El(Cl,e?.labelWeekNumberHeader,n.labelWeekNumberHeader),labelWeekday:El(xl,e?.labelWeekday,n.labelWeekday)}}function Ol(e,t,n,r,i){let{startOfMonth:a,startOfYear:o,endOfYear:s,eachMonthOfInterval:c,getMonth:l}=i;return c({start:o(e),end:s(e)}).map(e=>{let o=r.formatMonthDropdown(e,i);return{value:l(e),label:o,disabled:t&&e<a(t)||n&&e>a(n)||!1}})}function kl(e,t={},n={}){let r={...t?.[W.Day]};return Object.entries(e).filter(([,e])=>e===!0).forEach(([e])=>{r={...r,...n?.[e]}}),r}function Al(e,t,n,r){let i=r??e.today(),a=n?e.startOfBroadcastWeek(i,e):t?e.startOfISOWeek(i):e.startOfWeek(i),o=[];for(let t=0;t<7;t++){let n=e.addDays(a,t);o.push(n)}return o}function jl(e,t,n,r,i=!1){if(!e||!t)return;let{startOfYear:a,endOfYear:o,eachYearOfInterval:s,getYear:c}=r,l=s({start:a(e),end:o(t)});return i&&l.reverse(),l.map(e=>{let t=n.formatYearDropdown(e,r);return{value:c(e),label:t,disabled:!1}})}function Ml(e,t={}){let{weekStartsOn:n,locale:r}=t,i=n??r?.options?.weekStartsOn??0,a=t=>{let n=typeof t==`number`||typeof t==`string`?new Date(t):t;return new To(n.getFullYear(),n.getMonth(),n.getDate(),12,0,0,e)},o=e=>{let t=a(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0,0)};return{today:()=>a(To.tz(e)),newDate:(t,n,r)=>new To(t,n,r,12,0,0,e),startOfDay:e=>a(e),startOfWeek:(e,t)=>{let n=a(e),r=t?.weekStartsOn??i,o=(n.getDay()-r+7)%7;return n.setDate(n.getDate()-o),n},startOfISOWeek:e=>{let t=a(e),n=(t.getDay()-1+7)%7;return t.setDate(t.getDate()-n),t},startOfMonth:e=>{let t=a(e);return t.setDate(1),t},startOfYear:e=>{let t=a(e);return t.setMonth(0,1),t},endOfWeek:(e,t)=>{let n=a(e),r=(((t?.weekStartsOn??i)+6)%7-n.getDay()+7)%7;return n.setDate(n.getDate()+r),n},endOfISOWeek:e=>{let t=a(e),n=(7-t.getDay())%7;return t.setDate(t.getDate()+n),t},endOfMonth:e=>{let t=a(e);return t.setMonth(t.getMonth()+1,0),t},endOfYear:e=>{let t=a(e);return t.setMonth(11,31),t},eachMonthOfInterval:t=>{let n=a(t.start),r=a(t.end),i=[],o=new To(n.getFullYear(),n.getMonth(),1,12,0,0,e),s=r.getFullYear()*12+r.getMonth();for(;o.getFullYear()*12+o.getMonth()<=s;)i.push(new To(o,e)),o.setMonth(o.getMonth()+1,1);return i},addDays:(e,t)=>{let n=a(e);return n.setDate(n.getDate()+t),n},addWeeks:(e,t)=>{let n=a(e);return n.setDate(n.getDate()+t*7),n},addMonths:(e,t)=>{let n=a(e);return n.setMonth(n.getMonth()+t),n},addYears:(e,t)=>{let n=a(e);return n.setFullYear(n.getFullYear()+t),n},eachYearOfInterval:t=>{let n=a(t.start),r=a(t.end),i=[],o=new To(n.getFullYear(),0,1,12,0,0,e);for(;o.getFullYear()<=r.getFullYear();)i.push(new To(o,e)),o.setFullYear(o.getFullYear()+1,0,1);return i},getWeek:(e,t)=>_s(o(e),{weekStartsOn:t?.weekStartsOn??i,firstWeekContainsDate:t?.firstWeekContainsDate??r?.options?.firstWeekContainsDate??1}),getISOWeek:e=>ms(o(e)),differenceInCalendarDays:(e,t)=>Ro(o(e),o(t)),differenceInCalendarMonths:(e,t)=>zo(o(e),o(t))}}var Nl=e=>e instanceof HTMLElement?e:null,Pl=e=>[...e.querySelectorAll(`[data-animated-month]`)??[]],Fl=e=>Nl(e.querySelector(`[data-animated-month]`)),Il=e=>Nl(e.querySelector(`[data-animated-caption]`)),Ll=e=>Nl(e.querySelector(`[data-animated-weeks]`)),Rl=e=>Nl(e.querySelector(`[data-animated-nav]`)),zl=e=>Nl(e.querySelector(`[data-animated-weekdays]`));function Bl(e,t,{classNames:n,months:r,focused:i,dateLib:a}){let o=(0,f.useRef)(null),s=(0,f.useRef)(r),c=(0,f.useRef)(!1);(0,f.useLayoutEffect)(()=>{let l=s.current;if(s.current=r,!t||!e.current||!(e.current instanceof HTMLElement)||r.length===0||l.length===0||r.length!==l.length)return;let u=a.isSameMonth(r[0].date,l[0].date),d=a.isAfter(r[0].date,l[0].date),f=d?n[bc.caption_after_enter]:n[bc.caption_before_enter],p=d?n[bc.weeks_after_enter]:n[bc.weeks_before_enter],m=o.current,h=e.current.cloneNode(!0);if(h instanceof HTMLElement?(Pl(h).forEach(e=>{if(!(e instanceof HTMLElement))return;let t=Fl(e);t&&e.contains(t)&&e.removeChild(t);let n=Il(e);n&&n.classList.remove(f);let r=Ll(e);r&&r.classList.remove(p)}),o.current=h):o.current=null,c.current||u||i)return;let g=m instanceof HTMLElement?Pl(m):[],_=Pl(e.current);if(_?.every(e=>e instanceof HTMLElement)&&g?.every(e=>e instanceof HTMLElement)){c.current=!0;let t=[];e.current.style.isolation=`isolate`;let r=Rl(e.current);r&&(r.style.zIndex=`1`),_.forEach((i,a)=>{let o=g[a];if(!o)return;i.style.position=`relative`,i.style.overflow=`hidden`;let s=Il(i);s&&s.classList.add(f);let l=Ll(i);l&&l.classList.add(p);let u=()=>{c.current=!1,e.current&&(e.current.style.isolation=``),r&&(r.style.zIndex=``),s&&s.classList.remove(f),l&&l.classList.remove(p),i.style.position=``,i.style.overflow=``,i.contains(o)&&i.removeChild(o)};t.push(u),o.style.pointerEvents=`none`,o.style.position=`absolute`,o.style.overflow=`hidden`,o.setAttribute(`aria-hidden`,`true`);let m=zl(o);m&&(m.style.opacity=`0`);let h=Il(o);h&&(h.classList.add(d?n[bc.caption_before_exit]:n[bc.caption_after_exit]),h.addEventListener(`animationend`,u));let _=Ll(o);_&&_.classList.add(d?n[bc.weeks_before_exit]:n[bc.weeks_after_exit]),i.insertBefore(o,i.firstChild)})}})}function Vl(e,t,n,r){let i=e[0],a=e[e.length-1],{ISOWeek:o,fixedWeeks:s,broadcastCalendar:c}=n??{},{addDays:l,differenceInCalendarDays:u,differenceInCalendarMonths:d,endOfBroadcastWeek:f,endOfISOWeek:p,endOfMonth:m,endOfWeek:h,isAfter:g,startOfBroadcastWeek:_,startOfISOWeek:v,startOfWeek:y}=r,b=c?_(i,r):o?v(i):y(i),x=c?f(a):o?p(m(a)):h(m(a)),S=t&&(c?f(t):o?p(t):h(t)),C=u(S&&g(x,S)?S:x,b),w=d(a,i)+1,T=[];for(let e=0;e<=C;e++){let t=l(b,e);T.push(t)}let E=(c?35:42)*w;if(s&&T.length<E){let e=E-T.length;for(let t=0;t<e;t++){let e=l(T[T.length-1],1);T.push(e)}}return T}function Hl(e){let t=[];return e.reduce((e,n)=>{let r=n.weeks.reduce((e,t)=>e.concat(t.days.slice()),t.slice());return e.concat(r.slice())},t.slice())}function Ul(e,t,n,r){let{numberOfMonths:i=1}=n,a=[];for(let n=0;n<i;n++){let i=r.addMonths(e,n);if(t&&i>t)break;a.push(i)}return a}function Wl(e,t,n,r){let{month:i,defaultMonth:a,today:o=r.today(),numberOfMonths:s=1}=e,c=i||a||o,{differenceInCalendarMonths:l,addMonths:u,startOfMonth:d}=r;return n&&l(n,c)<s-1&&(c=u(n,-1*(s-1))),t&&l(c,t)<0&&(c=t),d(c)}function Gl(e,t,n,r){let{addDays:i,endOfBroadcastWeek:a,endOfISOWeek:o,endOfMonth:s,endOfWeek:c,getISOWeek:l,getWeek:u,startOfBroadcastWeek:d,startOfISOWeek:f,startOfWeek:p}=r,m=e.reduce((e,m)=>{let h=n.broadcastCalendar?d(m,r):n.ISOWeek?f(m):p(m),g=n.broadcastCalendar?a(m):n.ISOWeek?o(s(m)):c(s(m)),_=t.filter(e=>e>=h&&e<=g),v=n.broadcastCalendar?35:42;if(n.fixedWeeks&&_.length<v){let e=t.filter(e=>{let t=v-_.length;return e>g&&e<=i(g,t)});_.push(...e)}let y=new fc(m,_.reduce((e,t)=>{let i=n.ISOWeek?l(t):u(t),a=e.find(e=>e.weekNumber===i),o=new dc(t,m,r);return a?a.days.push(o):e.push(new pc(i,[o])),e},[]));return e.push(y),e},[]);return n.reverseMonths?m.reverse():m}function Kl(e,t){let{startMonth:n,endMonth:r}=e,{startOfYear:i,startOfDay:a,startOfMonth:o,endOfMonth:s,addYears:c,endOfYear:l,today:u}=t,d=e.captionLayout===`dropdown`||e.captionLayout===`dropdown-years`;return n?n=o(n):!n&&d&&(n=i(c(e.today??u(),-100))),r?r=s(r):!r&&d&&(r=l(e.today??u())),[n&&a(n),r&&a(r)]}function ql(e,t,n,r){if(n.disableNavigation)return;let{pagedNavigation:i,numberOfMonths:a=1}=n,{startOfMonth:o,addMonths:s,differenceInCalendarMonths:c}=r,l=i?a:1,u=o(e);if(!t||!(c(t,e)<a))return s(u,l)}function Jl(e,t,n,r){if(n.disableNavigation)return;let{pagedNavigation:i,numberOfMonths:a}=n,{startOfMonth:o,addMonths:s,differenceInCalendarMonths:c}=r,l=i?a??1:1,u=o(e);if(!t||!(c(u,t)<=0))return s(u,-l)}function Yl(e){return e.reduce((e,t)=>e.concat(t.weeks.slice()),[].slice())}function Xl(e,t){let[n,r]=(0,f.useState)(e);return[t===void 0?n:t,r]}function Zl(e,t){let[n,r]=Kl(e,t),{startOfMonth:i,endOfMonth:a}=t,o=Wl(e,n,r,t),[s,c]=Xl(o,e.month?o:void 0);(0,f.useEffect)(()=>{let i=Wl(e,n,r,t);c(i)},[e.timeZone]);let{months:l,weeks:u,days:d,previousMonth:p,nextMonth:m}=(0,f.useMemo)(()=>{let i=Ul(s,r,{numberOfMonths:e.numberOfMonths},t),o=Gl(i,Vl(i,e.endMonth?a(e.endMonth):void 0,{ISOWeek:e.ISOWeek,fixedWeeks:e.fixedWeeks,broadcastCalendar:e.broadcastCalendar},t),{broadcastCalendar:e.broadcastCalendar,fixedWeeks:e.fixedWeeks,ISOWeek:e.ISOWeek,reverseMonths:e.reverseMonths},t);return{months:o,weeks:Yl(o),days:Hl(o),previousMonth:Jl(s,n,e,t),nextMonth:ql(s,r,e,t)}},[t,s.getTime(),r?.getTime(),n?.getTime(),e.disableNavigation,e.broadcastCalendar,e.endMonth?.getTime(),e.fixedWeeks,e.ISOWeek,e.numberOfMonths,e.pagedNavigation,e.reverseMonths]),{disableNavigation:h,onMonthChange:g}=e,_=e=>u.some(t=>t.days.some(t=>t.isEqualTo(e))),v=e=>{if(h)return;let t=i(e);n&&t<i(n)&&(t=i(n)),r&&t>i(r)&&(t=i(r)),c(t),g?.(t)};return{months:l,weeks:u,days:d,navStart:n,navEnd:r,previousMonth:p,nextMonth:m,goToMonth:v,goToDay:e=>{_(e)||v(e.date)}}}var Ql;(function(e){e[e.Today=0]=`Today`,e[e.Selected=1]=`Selected`,e[e.LastFocused=2]=`LastFocused`,e[e.FocusedModifier=3]=`FocusedModifier`})(Ql||={});function $l(e){return!e[vc.disabled]&&!e[vc.hidden]&&!e[vc.outside]}function eu(e,t,n,r){let i,a=-1;for(let o of e){let e=t(o);$l(e)&&(e[vc.focused]&&a<Ql.FocusedModifier?(i=o,a=Ql.FocusedModifier):r?.isEqualTo(o)&&a<Ql.LastFocused?(i=o,a=Ql.LastFocused):n(o.date)&&a<Ql.Selected?(i=o,a=Ql.Selected):e[vc.today]&&a<Ql.Today&&(i=o,a=Ql.Today))}return i||=e.find(e=>$l(t(e))),i}function tu(e,t,n,r,i,a,o){let{ISOWeek:s,broadcastCalendar:c}=a,{addDays:l,addMonths:u,addWeeks:d,addYears:f,endOfBroadcastWeek:p,endOfISOWeek:m,endOfWeek:h,max:g,min:_,startOfBroadcastWeek:v,startOfISOWeek:y,startOfWeek:b}=o,x={day:l,week:d,month:u,year:f,startOfWeek:e=>c?v(e,o):s?y(e):b(e),endOfWeek:e=>c?p(e):s?m(e):h(e)}[e](n,t===`after`?1:-1);return t===`before`&&r?x=g([r,x]):t===`after`&&i&&(x=_([i,x])),x}function nu(e,t,n,r,i,a,o,s=0){if(s>365)return;let c=tu(e,t,n.date,r,i,a,o),l=!!(a.disabled&&Qc(c,a.disabled,o)),u=!!(a.hidden&&Qc(c,a.hidden,o)),d=new dc(c,c,o);return!l&&!u?d:nu(e,t,d,r,i,a,o,s+1)}function ru(e,t,n,r,i){let{autoFocus:a}=e,[o,s]=(0,f.useState)(),c=eu(t.days,n,r||(()=>!1),o),[l,u]=(0,f.useState)(a?c:void 0);return(0,f.useEffect)(()=>{l&&c&&(t.days.some(e=>e.isEqualTo(l))||u(c))},[t.days,l,c]),{isFocusTarget:e=>!!c?.isEqualTo(e),setFocused:u,focused:l,blur:()=>{s(l),u(void 0)},moveFocus:(n,r)=>{if(!l)return;let a=nu(n,r,l,t.navStart,t.navEnd,e,i);a&&(!e.disableNavigation||t.days.some(e=>e.isEqualTo(a)))&&(t.goToDay(a),u(a))}}}function iu(e,t){let{selected:n,required:r,onSelect:i}=e,[a,o]=Xl(n,i?n:void 0),s=i?n:a,{isSameDay:c}=t,l=e=>s?.some(t=>c(t,e))??!1,{min:u,max:d}=e;return{selected:s,select:(e,t,n)=>{let a=[...s??[]];if(l(e)){if(s?.length===u||r&&s?.length===1)return;a=s?.filter(t=>!c(t,e))}else a=s?.length===d?[e]:[...a,e];return i||o(a),i?.(a,e,t,n),a},isSelected:l}}function au(e,t,n=0,r=0,i=!1,a=uc){let{from:o,to:s}=t||{},{isSameDay:c,isAfter:l,isBefore:u}=a,d;if(!o&&!s)d={from:e,to:n>0?void 0:e};else if(o&&!s)d=c(o,e)?n===0?{from:o,to:e}:i?{from:o,to:void 0}:void 0:u(e,o)?{from:e,to:o}:{from:o,to:e};else if(o&&s){if(c(o,e)&&c(s,e))d=i?{from:o,to:s}:void 0;else if(c(o,e))d={from:o,to:n>0?void 0:e};else if(c(s,e))d={from:e,to:n>0?void 0:e};else if(u(e,o))d={from:e,to:s};else if(l(e,o))d={from:o,to:e};else if(l(e,s))d={from:o,to:e};else throw Error(`Invalid range`)}if(d?.from&&d?.to){let t=a.differenceInCalendarDays(d.to,d.from);(r>0&&t>r||n>1&&t<n)&&(d={from:e,to:void 0})}return d}function ou(e,t,n=uc){let r=Array.isArray(t)?t:[t],i=e.from,a=n.differenceInCalendarDays(e.to,e.from),o=Math.min(a,6);for(let e=0;e<=o;e++){if(r.includes(i.getDay()))return!0;i=n.addDays(i,1)}return!1}function su(e,t,n=uc){return Gc(e,t.from,!1,n)||Gc(e,t.to,!1,n)||Gc(t,e.from,!1,n)||Gc(t,e.to,!1,n)}function cu(e,t,n=uc){let r=Array.isArray(t)?t:[t];if(r.filter(e=>typeof e!=`function`).some(t=>typeof t==`boolean`?t:n.isDate(t)?Gc(e,t,!1,n):Zc(t,n)?t.some(t=>Gc(e,t,!1,n)):qc(t)?t.from&&t.to?su(e,{from:t.from,to:t.to},n):!1:Xc(t)?ou(e,t.dayOfWeek,n):Kc(t)?n.isAfter(t.before,t.after)?su(e,{from:n.addDays(t.after,1),to:n.addDays(t.before,-1)},n):Qc(e.from,t,n)||Qc(e.to,t,n):Jc(t)||Yc(t)?Qc(e.from,t,n)||Qc(e.to,t,n):!1))return!0;let i=r.filter(e=>typeof e==`function`);if(i.length){let t=e.from,r=n.differenceInCalendarDays(e.to,e.from);for(let e=0;e<=r;e++){if(i.some(e=>e(t)))return!0;t=n.addDays(t,1)}}return!1}function lu(e,t){let{disabled:n,excludeDisabled:r,resetOnSelect:i,selected:a,required:o,onSelect:s}=e,[c,l]=Xl(a,s?a:void 0),u=s?a:c;return{selected:u,select:(a,c,d)=>{let{min:f,max:p}=e,m;if(a){let e=u?.from,n=u?.to,r=!!e&&!!n,s=!!e&&!!n&&t.isSameDay(e,n)&&t.isSameDay(a,e);m=i&&(r||!u?.from)?!o&&s?void 0:{from:a,to:void 0}:au(a,u,f,p,o,t)}return r&&n&&m?.from&&m.to&&cu({from:m.from,to:m.to},n,t)&&(m.from=a,m.to=void 0),s||l(m),s?.(m,a,c,d),m},isSelected:e=>u&&Gc(u,e,!1,t)}}function uu(e,t){let{selected:n,required:r,onSelect:i}=e,[a,o]=Xl(n,i?n:void 0),s=i?n:a,{isSameDay:c}=t;return{selected:s,select:(e,t,n)=>{let a=e;return!r&&s&&s&&c(e,s)&&(a=void 0),i||o(a),i?.(a,e,t,n),a},isSelected:e=>s?c(s,e):!1}}function du(e,t){let n=uu(e,t),r=iu(e,t),i=lu(e,t);switch(e.mode){case`single`:return n;case`multiple`:return r;case`range`:return i;default:return}}function fu(e,t){return e instanceof To&&e.timeZone===t?e:new To(e,t)}function pu(e,t,n){if(!n)return fu(e,t);let r=fu(e,t),i=new To(r.getFullYear(),r.getMonth(),r.getDate(),12,0,0,t);return new Date(i.getTime())}function mu(e,t,n){return typeof e==`boolean`||typeof e==`function`?e:e instanceof Date?pu(e,t,n):Array.isArray(e)?e.map(e=>e instanceof Date?pu(e,t,n):e):qc(e)?{...e,from:e.from?fu(e.from,t):e.from,to:e.to?fu(e.to,t):e.to}:Kc(e)?{before:pu(e.before,t,n),after:pu(e.after,t,n)}:Jc(e)?{after:pu(e.after,t,n)}:Yc(e)?{before:pu(e.before,t,n)}:e}function hu(e,t,n){return e&&(Array.isArray(e)?e.map(e=>mu(e,t,n)):mu(e,t,n))}function gu(e){let t=e,n=t.timeZone;if(n&&(t={...e,timeZone:n},t.today&&(t.today=fu(t.today,n)),t.month&&(t.month=fu(t.month,n)),t.defaultMonth&&(t.defaultMonth=fu(t.defaultMonth,n)),t.startMonth&&(t.startMonth=fu(t.startMonth,n)),t.endMonth&&(t.endMonth=fu(t.endMonth,n)),t.mode===`single`&&t.selected?t.selected=fu(t.selected,n):t.mode===`multiple`&&t.selected?t.selected=t.selected?.map(e=>fu(e,n)):t.mode===`range`&&t.selected&&(t.selected={from:t.selected.from?fu(t.selected.from,n):t.selected.from,to:t.selected.to?fu(t.selected.to,n):t.selected.to}),t.disabled!==void 0&&(t.disabled=hu(t.disabled,n)),t.hidden!==void 0&&(t.hidden=hu(t.hidden,n)),t.modifiers)){let e={};Object.keys(t.modifiers).forEach(r=>{e[r]=hu(t.modifiers?.[r],n)}),t.modifiers=e}let{components:r,formatters:i,labels:a,dateLib:o,locale:s,classNames:c}=(0,f.useMemo)(()=>{let e={...cc,...t.locale},n=t.broadcastCalendar?1:t.weekStartsOn,r=t.noonSafe&&t.timeZone?Ml(t.timeZone,{weekStartsOn:n,locale:e}):void 0,i=t.dateLib&&r?{...r,...t.dateLib}:t.dateLib??r,a=new lc({locale:e,weekStartsOn:n,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},i);return{dateLib:a,components:tl(t.components),formatters:fl(t.formatters),labels:Dl(t.labels,a.options),locale:e,classNames:{...rl(),...t.classNames}}},[t.locale,t.broadcastCalendar,t.weekStartsOn,t.firstWeekContainsDate,t.useAdditionalWeekYearTokens,t.useAdditionalDayOfYearTokens,t.timeZone,t.numerals,t.dateLib,t.noonSafe,t.components,t.formatters,t.labels,t.classNames]);t.today||(t={...t,today:o.today()});let{captionLayout:l,mode:u,navLayout:d,numberOfMonths:p=1,onDayBlur:m,onDayClick:h,onDayFocus:g,onDayKeyDown:_,onDayMouseEnter:v,onDayMouseLeave:y,onNextClick:b,onPrevClick:x,showWeekNumber:S,styles:C}=t,{formatCaption:w,formatDay:T,formatMonthDropdown:E,formatWeekNumber:D,formatWeekNumberHeader:O,formatWeekdayName:k,formatYearDropdown:A}=i,j=Zl(t,o),{days:M,months:N,navStart:P,navEnd:F,previousMonth:I,nextMonth:L,goToMonth:R}=j,z=$c(M,t,P,F,o),{isSelected:ee,select:te,selected:ne}=du(t,o)??{},{blur:re,focused:ie,isFocusTarget:ae,moveFocus:oe,setFocused:se}=ru(t,j,z,ee??(()=>!1),o),{labelDayButton:ce,labelGridcell:le,labelGrid:ue,labelMonthDropdown:de,labelNav:fe,labelPrevious:pe,labelNext:me,labelWeekday:he,labelWeekNumber:ge,labelWeekNumberHeader:_e,labelYearDropdown:ve}=a,ye=(0,f.useMemo)(()=>Al(o,t.ISOWeek,t.broadcastCalendar,t.today),[o,t.ISOWeek,t.broadcastCalendar,t.today]),be=u!==void 0||h!==void 0,xe=(0,f.useCallback)(()=>{I&&(R(I),x?.(I))},[I,R,x]),Se=(0,f.useCallback)(()=>{L&&(R(L),b?.(L))},[R,L,b]),Ce=(0,f.useCallback)((e,t)=>n=>{n.preventDefault(),n.stopPropagation(),se(e),!t.disabled&&(te?.(e.date,t,n),h?.(e.date,t,n))},[te,h,se]),we=(0,f.useCallback)((e,t)=>n=>{se(e),g?.(e.date,t,n)},[g,se]),Te=(0,f.useCallback)((e,t)=>n=>{re(),m?.(e.date,t,n)},[re,m]),Ee=(0,f.useCallback)((e,n)=>r=>{let i={ArrowLeft:[r.shiftKey?`month`:`day`,t.dir===`rtl`?`after`:`before`],ArrowRight:[r.shiftKey?`month`:`day`,t.dir===`rtl`?`before`:`after`],ArrowDown:[r.shiftKey?`year`:`week`,`after`],ArrowUp:[r.shiftKey?`year`:`week`,`before`],PageUp:[r.shiftKey?`year`:`month`,`before`],PageDown:[r.shiftKey?`year`:`month`,`after`],Home:[`startOfWeek`,`before`],End:[`endOfWeek`,`after`]};if(i[r.key]){r.preventDefault(),r.stopPropagation();let[e,t]=i[r.key];oe(e,t)}_?.(e.date,n,r)},[oe,_,t.dir]),De=(0,f.useCallback)((e,t)=>n=>{v?.(e.date,t,n)},[v]),Oe=(0,f.useCallback)((e,t)=>n=>{y?.(e.date,t,n)},[y]),ke=(0,f.useCallback)((e,t)=>n=>{let r=Number(n.target.value),i=o.setMonth(o.startOfMonth(e),r);R(o.addMonths(i,-t))},[o,R]),B=(0,f.useCallback)((e,t)=>n=>{let r=Number(n.target.value),i=o.setYear(o.startOfMonth(e),r);R(o.addMonths(i,-t))},[o,R]),{className:Ae,style:je}=(0,f.useMemo)(()=>({className:[c[W.Root],t.className].filter(Boolean).join(` `),style:{...C?.[W.Root],...t.style}}),[c,t.className,t.style,C]),Me=nl(t),Ne=e=>{let t=C?.[W.Dropdown],n=C?.[e];if(t||n)return{...t,...n}},Pe=(0,f.useRef)(null);Bl(Pe,!!t.animate,{classNames:c,months:N,focused:ie,dateLib:o});let Fe={dayPickerProps:t,selected:ne,select:te,isSelected:ee,months:N,nextMonth:L,previousMonth:I,goToMonth:R,getModifiers:z,components:r,classNames:c,styles:C,labels:a,formatters:i};return f.createElement(xc.Provider,{value:Fe},f.createElement(r.Root,{rootRef:t.animate?Pe:void 0,className:Ae,style:je,dir:t.dir,id:t.id,lang:t.lang??s.code,nonce:t.nonce,title:t.title,role:t.role,"aria-label":t[`aria-label`],"aria-labelledby":t[`aria-labelledby`],...Me},f.createElement(r.Months,{className:c[W.Months],style:C?.[W.Months]},!t.hideNavigation&&!d&&f.createElement(r.Nav,{"data-animated-nav":t.animate?`true`:void 0,className:c[W.Nav],style:C?.[W.Nav],"aria-label":fe(),onPreviousClick:xe,onNextClick:Se,previousMonth:I,nextMonth:L}),N.map((e,n)=>{let a=t.reverseMonths?N.length-1-n:n;return f.createElement(r.Month,{"data-animated-month":t.animate?`true`:void 0,className:c[W.Month],style:C?.[W.Month],key:n,displayIndex:n,calendarMonth:e},d===`around`&&!t.hideNavigation&&n===0&&f.createElement(r.PreviousMonthButton,{type:`button`,className:c[W.PreviousMonthButton],style:C?.[W.PreviousMonthButton],tabIndex:I?void 0:-1,"aria-disabled":!I||void 0,"aria-label":pe(I),onClick:xe,"data-animated-button":t.animate?`true`:void 0},f.createElement(r.Chevron,{disabled:!I||void 0,className:c[W.Chevron],style:C?.[W.Chevron],orientation:t.dir===`rtl`?`right`:`left`})),f.createElement(r.MonthCaption,{"data-animated-caption":t.animate?`true`:void 0,className:c[W.MonthCaption],style:C?.[W.MonthCaption],calendarMonth:e,displayIndex:n},l?.startsWith(`dropdown`)?f.createElement(r.DropdownNav,{className:c[W.Dropdowns],style:C?.[W.Dropdowns]},(()=>{let n=l===`dropdown`||l===`dropdown-months`?f.createElement(r.MonthsDropdown,{key:`month`,className:c[W.MonthsDropdown],"aria-label":de(),disabled:!!t.disableNavigation,onChange:ke(e.date,a),options:Ol(e.date,P,F,i,o),style:Ne(W.MonthsDropdown),value:o.getMonth(e.date)}):f.createElement(`span`,{key:`month`},E(e.date,o)),s=l===`dropdown`||l===`dropdown-years`?f.createElement(r.YearsDropdown,{key:`year`,className:c[W.YearsDropdown],"aria-label":ve(o.options),disabled:!!t.disableNavigation,onChange:B(e.date,a),options:jl(P,F,i,o,!!t.reverseYears),style:Ne(W.YearsDropdown),value:o.getYear(e.date)}):f.createElement(`span`,{key:`year`},A(e.date,o));return o.getMonthYearOrder()===`year-first`?[s,n]:[n,s]})(),f.createElement(`span`,{role:`status`,"aria-live":`polite`,style:{border:0,clip:`rect(0 0 0 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:0,position:`absolute`,width:`1px`,whiteSpace:`nowrap`,wordWrap:`normal`}},w(e.date,o.options,o))):f.createElement(r.CaptionLabel,{className:c[W.CaptionLabel],style:C?.[W.CaptionLabel],role:`status`,"aria-live":`polite`},w(e.date,o.options,o))),d===`around`&&!t.hideNavigation&&n===p-1&&f.createElement(r.NextMonthButton,{type:`button`,className:c[W.NextMonthButton],style:C?.[W.NextMonthButton],tabIndex:L?void 0:-1,"aria-disabled":!L||void 0,"aria-label":me(L),onClick:Se,"data-animated-button":t.animate?`true`:void 0},f.createElement(r.Chevron,{disabled:!L||void 0,className:c[W.Chevron],style:C?.[W.Chevron],orientation:t.dir===`rtl`?`left`:`right`})),n===p-1&&d===`after`&&!t.hideNavigation&&f.createElement(r.Nav,{"data-animated-nav":t.animate?`true`:void 0,className:c[W.Nav],style:C?.[W.Nav],"aria-label":fe(),onPreviousClick:xe,onNextClick:Se,previousMonth:I,nextMonth:L}),f.createElement(r.MonthGrid,{role:`grid`,"aria-multiselectable":u===`multiple`||u===`range`,"aria-label":ue(e.date,o.options,o)||void 0,className:c[W.MonthGrid],style:C?.[W.MonthGrid]},!t.hideWeekdays&&f.createElement(r.Weekdays,{"data-animated-weekdays":t.animate?`true`:void 0,className:c[W.Weekdays],style:C?.[W.Weekdays]},S&&f.createElement(r.WeekNumberHeader,{"aria-label":_e(o.options),className:c[W.WeekNumberHeader],style:C?.[W.WeekNumberHeader],scope:`col`},O()),ye.map(e=>f.createElement(r.Weekday,{"aria-label":he(e,o.options,o),className:c[W.Weekday],key:String(e),style:C?.[W.Weekday],scope:`col`},k(e,o.options,o)))),f.createElement(r.Weeks,{"data-animated-weeks":t.animate?`true`:void 0,className:c[W.Weeks],style:C?.[W.Weeks]},e.weeks.map(e=>f.createElement(r.Week,{className:c[W.Week],key:e.weekNumber,style:C?.[W.Week],week:e},S&&f.createElement(r.WeekNumber,{week:e,style:C?.[W.WeekNumber],"aria-label":ge(e.weekNumber,{locale:s}),className:c[W.WeekNumber],scope:`row`,role:`rowheader`},D(e.weekNumber,o)),e.days.map(e=>{let{date:n}=e,i=z(e);if(i[vc.focused]=!i.hidden&&!!ie?.isEqualTo(e),i[yc.selected]=ee?.(n)||i.selected,qc(ne)){let{from:e,to:t}=ne;i[yc.range_start]=!!(e&&t&&o.isSameDay(n,e)),i[yc.range_end]=!!(e&&t&&o.isSameDay(n,t)),i[yc.range_middle]=Gc(ne,n,!0,o)}let a=kl(i,C,t.modifiersStyles),s=el(i,c,t.modifiersClassNames),l=!be&&!i.hidden?le(n,i,o.options,o):void 0;return f.createElement(r.Day,{key:`${e.isoDate}_${e.displayMonthId}`,day:e,modifiers:i,className:s.join(` `),style:a,role:`gridcell`,"aria-selected":i.selected||void 0,"aria-label":l,"data-day":e.isoDate,"data-month":e.outside?e.dateMonthId:void 0,"data-selected":i.selected||void 0,"data-disabled":i.disabled||void 0,"data-hidden":i.hidden||void 0,"data-outside":e.outside||void 0,"data-focused":i.focused||void 0,"data-today":i.today||void 0},!i.hidden&&be?f.createElement(r.DayButton,{className:c[W.DayButton],style:C?.[W.DayButton],type:`button`,day:e,modifiers:i,disabled:!i.focused&&i.disabled||void 0,"aria-disabled":i.focused&&i.disabled||void 0,tabIndex:ae(e)?0:-1,"aria-label":ce(n,i,o.options,o),onClick:Ce(e,i),onBlur:Te(e,i),onFocus:we(e,i),onKeyDown:Ee(e,i),onMouseEnter:De(e,i),onMouseLeave:Oe(e,i)},T(n,o.options,o)):!i.hidden&&T(e.date,o.options,o))}))))))})),t.footer&&f.createElement(r.Footer,{className:c[W.Footer],style:C?.[W.Footer],role:`status`,"aria-live":`polite`},t.footer)))}function _u({orientation:e,className:t}){return(0,H.jsx)(e===`left`?uo:e===`down`?rt:lo,{className:V(`h-4 w-4`,t)})}function vu({className:e,classNames:t,showOutsideDays:n=!0,...r}){return(0,H.jsx)(gu,{showOutsideDays:n,className:V(`p-3`,e),classNames:{months:`flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0 relative`,month:`space-y-4`,month_caption:`flex justify-center pt-1 relative items-center w-full`,caption_label:`text-sm font-medium inline-flex items-center gap-1`,dropdowns:`flex items-center justify-center gap-1`,dropdown_root:`relative inline-flex items-center rounded-md border border-input px-2 h-7 text-sm has-[:focus-visible]:ring-1 has-[:focus-visible]:ring-ring`,dropdown:`absolute inset-0 opacity-0 cursor-pointer`,months_dropdown:``,years_dropdown:``,nav:`space-x-1 flex items-center absolute inset-x-0 top-0 justify-between z-10`,button_previous:V(qn({variant:`outline`}),`h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100 absolute left-1`),button_next:V(qn({variant:`outline`}),`h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100 absolute right-1`),month_grid:`w-full border-collapse space-y-1`,weekdays:`flex`,weekday:`text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]`,week:`flex w-full mt-2`,day:V(`h-9 w-9 text-center text-sm p-0 relative focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent/10`,r.mode===`range`?`[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md`:`[&:has([aria-selected])]:rounded-md`),day_button:V(qn({variant:`ghost`}),`h-9 w-9 p-0 font-normal aria-selected:opacity-100`),range_start:`day-range-start`,range_end:`day-range-end`,selected:`bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground`,today:`bg-accent/10 text-foreground`,outside:`day-outside text-muted-foreground opacity-50 aria-selected:bg-transparent aria-selected:opacity-100 aria-selected:text-foreground`,disabled:`text-muted-foreground opacity-50`,range_middle:`aria-selected:bg-transparent aria-selected:text-foreground`,hidden:`invisible`,...t},components:{Chevron:_u},...r})}var yu=(0,f.forwardRef)(({title:e,titleId:t,...n},r)=>(0,H.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,H.jsx)(`title`,{id:t,children:e}):null,(0,H.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M20 6L9 17l-5-5`})]})),bu=Object.defineProperty,xu=(e,t)=>bu(e,`name`,{value:t,configurable:!0});function Su(e){let[t,n]=f.useState(void 0);return Mt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=0,r=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;let i=r[0];window.cancelAnimationFrame(t),t=window.requestAnimationFrame(()=>{let t,r;if(`borderBoxSize`in i){let e=i.borderBoxSize,n=Array.isArray(e)?e[0]:e;t=n.inlineSize,r=n.blockSize}else t=e.offsetWidth,r=e.offsetHeight;n({width:t,height:r})})});return r.observe(e,{box:`border-box`}),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}n(void 0)},[e]),t}xu(Su,`useSize`);var Cu=Object.defineProperty,wu=(e,t)=>Cu(e,`name`,{value:t,configurable:!0}),Tu=`Checkbox`,[Eu,Du]=st(Tu),[Ou,ku]=Eu(Tu);function Au(e){let{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[p,m]=un({prop:n,defaultProp:i??!1,onChange:c,caller:Tu}),[h,g]=f.useState(null),[_,v]=f.useState(null),[y,b]=f.useState(null),x=!h||!!o||!!h.closest(`form`),S={checked:p,disabled:a,setChecked:m,control:h,setControl:g,name:s,form:o,value:u,userClick:y,onUserClick:b,required:l,defaultChecked:!zu(i)&&i,isFormControl:x,bubbleInput:_,setBubbleInput:v};return(0,H.jsx)(Ou,{scope:t,...S,children:Ru(d)?d(S):r})}wu(Au,`CheckboxProvider`);var ju=`CheckboxTrigger`,Mu=f.forwardRef(wu(function({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i){let{control:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,onUserClick:p,isFormControl:m,bubbleInput:h}=ku(ju,e),g=pt(i,u),_=f.useRef(c);return f.useEffect(()=>{let e=a?.form;if(e){let t=wu(()=>d(_.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[a,d]),(0,H.jsx)(bn.button,{type:`button`,role:`checkbox`,"aria-checked":zu(c)?`mixed`:c,"aria-required":l,"data-state":Bu(c),"data-disabled":s?``:void 0,disabled:s,value:o,...r,ref:g,onKeyDown:Xt(t,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:Xt(n,e=>{let t=e.isPropagationStopped();p({requestedChecked:zu(c)?!0:!c,hasConsumerStoppedPropagation:t}),d(e=>zu(e)?!0:!e),h&&m&&(t||e.stopPropagation())})})},`CheckboxTrigger`)),Nu=f.forwardRef(wu(function(e,t){let{__scopeCheckbox:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,H.jsx)(Au,{__scopeCheckbox:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Mu,{...d,ref:t,__scopeCheckbox:n}),e&&(0,H.jsx)(Lu,{__scopeCheckbox:n})]})})},`Checkbox`)),Pu=`CheckboxIndicator`,Fu=f.forwardRef(wu(function(e,t){let{__scopeCheckbox:n,forceMount:r,...i}=e,a=ku(Pu,n);return(0,H.jsx)(Tn,{present:r||zu(a.checked)||a.checked===!0,children:(0,H.jsx)(bn.span,{"data-state":Bu(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t,style:{pointerEvents:`none`,...e.style}})})},`CheckboxIndicator`)),Iu=`CheckboxBubbleInput`,Lu=f.forwardRef(wu(function({__scopeCheckbox:e,onClick:t,...n},r){let{control:i,userClick:a,checked:o,defaultChecked:s,required:c,disabled:l,name:u,value:d,form:p,bubbleInput:m,setBubbleInput:h}=ku(Iu,e),g=pt(r,h),_=Su(i),v=f.useRef(!1),y=f.useRef(o),b=f.useRef(a),x=f.useRef(null);f.useEffect(()=>{let e=m;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set;if(!n)return;let r=y.current!==o;y.current=o;let i=a!==null&&a!==b.current;if(b.current=a,i)x.current=r?null:a,r&&(e.indeterminate=zu(o),n.call(e,!zu(o)&&o)),e.dispatchEvent(new Event(`click`,{bubbles:!a.hasConsumerStoppedPropagation}));else if(r){let t=x.current;x.current=null;let r=t?.requestedChecked===o;v.current=!0,e.indeterminate=zu(o),n.call(e,!zu(o)&&o),e.dispatchEvent(new Event(`click`,{bubbles:!(r&&t.hasConsumerStoppedPropagation)})),v.current=!1}},[m,o,a]);let S=f.useRef(!zu(o)&&o);return(0,H.jsx)(bn.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:s??S.current,required:c,disabled:l,name:u,value:d,form:p,...n,tabIndex:-1,ref:g,onClick:Xt(t,e=>{v.current&&e.stopPropagation()}),style:{...n.style,..._,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`CheckboxBubbleInput`));function Ru(e){return typeof e==`function`}wu(Ru,`isFunction`);function zu(e){return e===`indeterminate`}wu(zu,`isIndeterminate`);function Bu(e){return zu(e)?`indeterminate`:e?`checked`:`unchecked`}wu(Bu,`getState`);var Vu=f.forwardRef(({className:e,name:t,checked:n,value:r,defaultChecked:i,onValueChange:a,onBlur:o,label:s,labelClassName:c,disabled:l,...u},d)=>{let p=r===void 0?n:r,m=f.useRef(null),h=f.useRef(null),g=f.useId();f.useImperativeHandle(d,()=>m.current);let _=e=>{a?.(e!==`indeterminate`&&e)},v=e=>{e.preventDefault(),!l&&h.current?.click()},y=(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`input`,{type:`checkbox`,ref:m,name:t,defaultChecked:i===!0,onBlur:o,className:`sr-only`,tabIndex:-1,"aria-hidden":`true`}),(0,H.jsx)(Nu,{ref:h,"data-slot":`checkbox`,checked:p,defaultChecked:i,onCheckedChange:_,disabled:l,"aria-labelledby":s?g:void 0,className:V(`peer border border-muted-foreground/30 bg-input-background dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50`,e),...u,children:(0,H.jsx)(Fu,{"data-slot":`checkbox-indicator`,className:`flex items-center justify-center text-current transition-none`,children:(0,H.jsx)(yu,{className:`size-3.5`})})})]});return s?(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[y,(0,H.jsx)(`button`,{type:`button`,id:g,className:V(`text-sm cursor-pointer select-none border-0 bg-transparent p-0 text-left font-[inherit] text-inherit`,l&&`cursor-not-allowed opacity-50`,c),onClick:v,disabled:l,children:s})]}):y});Vu.displayName=`Checkbox`;var Hu={"rc.asyncSelect.loading":`Loading...`,"rc.asyncSelect.noOptions":`No options`,"rc.asyncSelect.noResults":`No results`,"rc.asyncSelect.selectPlaceholder":`Select...`,"rc.combobox.noResults":`No results`,"rc.combobox.selectPlaceholder":`Select...`,"rc.datePicker.pickDate":`Pick date`,"rc.datePicker.placeholder":`Pick date`,"rc.datePicker.selectDate":`Select date`,"rc.dateSelectorMultiple.addDate":`Add date`,"rc.dateSelectorMultiple.dateRange":`Range`,"rc.dateSelectorMultiple.placeholder":`Pick date`,"rc.dateSelectorMultiple.singleDate":`Single`,"rc.fileInput.browseFiles":`Browse files`,"rc.fileInput.dropZone":`Drag files here or click to upload`,"rc.fileInput.filePlaceholder":`File`,"rc.fileInput.imagePlaceholder":`Image`,"rc.fileInput.maxFilesExceeded":e=>`Maximum ${e} files allowed`,"rc.fileInput.pending":`Pending`,"rc.fileInput.remove":`Remove`,"rc.fileInput.uploadFailed":`Upload failed`,"rc.fileInput.uploading":`Uploading...`,"rc.monthPickerMultiple.addMonth":`Add month`,"rc.monthPickerMultiple.dateRange":`Range`,"rc.monthPickerMultiple.endDate":`End date`,"rc.monthPickerMultiple.placeholder":`Pick month`,"rc.monthPickerMultiple.singleDate":`Single`,"rc.monthPickerMultiple.startDate":`Start date`,"rc.multiSelect.clear":`Clear all`,"rc.multiSelect.close":`Close`,"rc.multiSelect.moreItems":e=>`+${e} more`,"rc.multiSelect.noOptions":`No options`,"rc.multiSelect.noOptionsSelected":`No options selected`,"rc.multiSelect.noResults":`No results`,"rc.multiSelect.optionsCount":e=>`${e} options`,"rc.multiSelect.selectAll":`Select all`,"rc.multiSelect.selectPlaceholder":`Select...`,"rc.pagination.next":`Next`,"rc.pagination.previous":`Previous`,"rc.pagination.showing":(e,t,n)=>`Showing ${e}-${t} of ${n}`,"rc.calendar.month.0":`January`,"rc.calendar.month.1":`February`,"rc.calendar.month.2":`March`,"rc.calendar.month.3":`April`,"rc.calendar.month.4":`May`,"rc.calendar.month.5":`June`,"rc.calendar.month.6":`July`,"rc.calendar.month.7":`August`,"rc.calendar.month.8":`September`,"rc.calendar.month.9":`October`,"rc.calendar.month.10":`November`,"rc.calendar.month.11":`December`,"rc.sonamuFilter.title":`Sonamu Filter`,"rc.sonamuFilter.apply":`Apply`,"rc.sonamuFilter.reset":`Reset`,"rc.sonamuFilter.addRule":`Add Rule`,"rc.sonamuFilter.noRulesYet":`No rules yet. Click "+ Add Rule" to start.`,"rc.sonamuFilter.selectField":`Select field`,"rc.sonamuFilter.selectOperator":`Operator`,"rc.sonamuFilter.selectOperatorFirst":`Select operator first`,"rc.sonamuFilter.enterValue":`Enter value`,"rc.sonamuFilter.enterNumber":`Enter number`,"rc.sonamuFilter.notSupported":`Not supported`,"rc.sonamuFilter.startDate":`Start date`,"rc.sonamuFilter.endDate":`End date`,"rc.sonamuFilter.appliedFilters":`🌲 Applied SonamuFilters`,"rc.common.cancel":`Cancel`,"rc.common.save":`Save`},Uu=Object.create(null),Wu=e=>({}),Gu=new Proxy(Uu,{get(e,t){return Wu()[t]??Uu[t]},has(e,t){return t in Wu()||t in Uu},set(e,t,n){let r=Wu(!0);return r[t]=n,!0},deleteProperty(e,t){if(!t)return!1;let n=Wu(!0);return delete n[t],!0},ownKeys(){let e=Wu(!0);return Object.keys(e)}});Gu.NODE_ENV;function Ku(e,t){return typeof process<`u`?{}[e]??t:typeof Deno<`u`?Deno.env.get(e)??t:typeof Bun<`u`?Bun.env[e]??t:t}Object.freeze({get BETTER_AUTH_SECRET(){return Ku(`BETTER_AUTH_SECRET`)},get AUTH_SECRET(){return Ku(`AUTH_SECRET`)},get BETTER_AUTH_TELEMETRY(){return Ku(`BETTER_AUTH_TELEMETRY`)},get BETTER_AUTH_TELEMETRY_ID(){return Ku(`BETTER_AUTH_TELEMETRY_ID`)},get NODE_ENV(){return Ku(`NODE_ENV`,`development`)},get PACKAGE_VERSION(){return Ku(`PACKAGE_VERSION`,`0.0.0`)},get BETTER_AUTH_TELEMETRY_ENDPOINT(){return Ku(`BETTER_AUTH_TELEMETRY_ENDPOINT`,``)}});function qu(){let e=Object.getOwnPropertyDescriptor(Error,`stackTraceLimit`);return e===void 0?Object.isExtensible(Error):Object.prototype.hasOwnProperty.call(e,`writable`)?e.writable:e.set!==void 0}function Ju(e){let t=e.split(`
|
|
42
42
|
at `);return t.length<=1?e:(t.splice(1,1),t.join(`
|
|
43
|
-
at `))}function Yu(e,t){class n extends e{#e;constructor(...e){if(qu()){let t=Error.stackTraceLimit;Error.stackTraceLimit=0,super(...e),Error.stackTraceLimit=t}else super(...e);let t=Error().stack;t&&(this.#e=Ju(t.replace(/^Error/,this.name)))}get errorStack(){return this.#e}}return Object.defineProperty(n.prototype,"constructor",{get(){return t},enumerable:!1,configurable:!0}),n}var Xu={OK:200,CREATED:201,ACCEPTED:202,NO_CONTENT:204,MULTIPLE_CHOICES:300,MOVED_PERMANENTLY:301,FOUND:302,SEE_OTHER:303,NOT_MODIFIED:304,TEMPORARY_REDIRECT:307,BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,METHOD_NOT_ALLOWED:405,NOT_ACCEPTABLE:406,PROXY_AUTHENTICATION_REQUIRED:407,REQUEST_TIMEOUT:408,CONFLICT:409,GONE:410,LENGTH_REQUIRED:411,PRECONDITION_FAILED:412,PAYLOAD_TOO_LARGE:413,URI_TOO_LONG:414,UNSUPPORTED_MEDIA_TYPE:415,RANGE_NOT_SATISFIABLE:416,EXPECTATION_FAILED:417,"I'M_A_TEAPOT":418,MISDIRECTED_REQUEST:421,UNPROCESSABLE_ENTITY:422,LOCKED:423,FAILED_DEPENDENCY:424,TOO_EARLY:425,UPGRADE_REQUIRED:426,PRECONDITION_REQUIRED:428,TOO_MANY_REQUESTS:429,REQUEST_HEADER_FIELDS_TOO_LARGE:431,UNAVAILABLE_FOR_LEGAL_REASONS:451,INTERNAL_SERVER_ERROR:500,NOT_IMPLEMENTED:501,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,HTTP_VERSION_NOT_SUPPORTED:505,VARIANT_ALSO_NEGOTIATES:506,INSUFFICIENT_STORAGE:507,LOOP_DETECTED:508,NOT_EXTENDED:510,NETWORK_AUTHENTICATION_REQUIRED:511};Yu(class extends Error{status;body;headers;statusCode;constructor(e=`INTERNAL_SERVER_ERROR`,t=void 0,n={},r=typeof e==`number`?e:Xu[e]){super(t?.message,t?.cause?{cause:t.cause}:void 0),this.status=e,this.body=t,this.headers=n,this.statusCode=r,this.name=`APIError`,this.status=e,this.headers=n,this.statusCode=r,this.body=t}},Error);var Zu=class extends Error{constructor(e,t){super(e,t),this.name=`BetterAuthError`,this.message=e,this.stack=``}},Qu=47;function $u(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===Qu;)t--;return t===e.length?e:e.slice(0,t)}function ed(e){try{return($u(new URL(e).pathname)||`/`)!==`/`}catch{throw new Zu(`Invalid base URL: ${e}. Please provide a valid base URL.`)}}function td(e){try{let t=new URL(e);if(t.protocol!==`http:`&&t.protocol!==`https:`)throw new Zu(`Invalid base URL: ${e}. URL must include 'http://' or 'https://'`)}catch(t){throw t instanceof Zu?t:new Zu(`Invalid base URL: ${e}. Please provide a valid base URL.`,{cause:t})}}function nd(e,t=`/api/auth`){if(td(e),ed(e))return e;let n=$u(e);return!t||t===`/`?n:(t=t.startsWith(`/`)?t:`/${t}`,`${n}${t}`)}function rd(e,t){return!e||e.trim()===``?!1:t===`proto`?e===`http`||e===`https`:t===`host`?[/\.\./,/\0/,/[\s]/,/^[.]/,/[<>'"]/,/javascript:/i,/file:/i,/data:/i].some(t=>t.test(e))?!1:/^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*(:[0-9]{1,5})?$/.test(e)||/^(\d{1,3}\.){3}\d{1,3}(:[0-9]{1,5})?$/.test(e)||/^\[[0-9a-fA-F:]+\](:[0-9]{1,5})?$/.test(e)||/^localhost(:[0-9]{1,5})?$/i.test(e):!1}function id(e,t,n,r,i){if(e)return nd(e,t);if(r!==!1){let e=Gu.BETTER_AUTH_URL||Gu.NEXT_PUBLIC_BETTER_AUTH_URL||Gu.PUBLIC_BETTER_AUTH_URL||Gu.NUXT_PUBLIC_BETTER_AUTH_URL||Gu.NUXT_PUBLIC_AUTH_URL||(Gu.BASE_URL===`/`?void 0:Gu.BASE_URL);if(e)return nd(e,t)}let a=n?.headers.get(`x-forwarded-host`),o=n?.headers.get(`x-forwarded-proto`);if(a&&o&&i&&rd(o,`proto`)&&rd(a,`host`))try{return nd(`${o}://${a}`,t)}catch{}if(n){let e=ad(n.url);if(!e)throw new Zu(`Could not get origin from request. Please provide a valid base URL.`);return nd(e,t)}if(typeof window<`u`&&window.location)return nd(window.location.origin,t)}function ad(e){try{let t=new URL(e);return t.origin===`null`?null:t.origin}catch{return null}}var od={proto:/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,constructor:/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,protoShort:/"__proto__"\s*:/,constructorShort:/"constructor"\s*:/},sd=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,cd={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:1/0,"-infinity":-1/0},ld=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/;function ud(e){return e instanceof Date&&!isNaN(e.getTime())}function dd(e){let t=ld.exec(e);if(!t)return null;let[,n,r,i,a,o,s,c,l,u,d]=t,f=new Date(Date.UTC(parseInt(n,10),parseInt(r,10)-1,parseInt(i,10),parseInt(a,10),parseInt(o,10),parseInt(s,10),c?parseInt(c.padEnd(3,`0`),10):0));if(l){let e=(parseInt(u,10)*60+parseInt(d,10))*(l===`+`?-1:1);f.setUTCMinutes(f.getUTCMinutes()+e)}return ud(f)?f:null}function fd(e,t={}){let{strict:n=!1,warnings:r=!1,reviver:i,parseDates:a=!0}=t;if(typeof e!=`string`)return e;let o=e.trim(),s=o.toLowerCase();if(s.length<=9&&s in cd)return cd[s];if(!sd.test(o)){if(n)throw SyntaxError(`[better-json] Invalid JSON`);return e}if(Object.entries(od).some(([e,t])=>{let n=t.test(o);return n&&r&&console.warn(`[better-json] Detected potential prototype pollution attempt using ${e} pattern`),n})&&n)throw Error(`[better-json] Potential prototype pollution attempt detected`);try{return JSON.parse(o,(e,t)=>{if(e===`__proto__`||e===`constructor`&&t&&typeof t==`object`&&`prototype`in t)r&&console.warn(`[better-json] Dropping "${e}" key to prevent prototype pollution`);else{if(a&&typeof t==`string`){let e=dd(t);if(e)return e}return i?i(e,t):t}})}catch(t){if(n)throw t;return e}}function pd(e,t={strict:!0}){return fd(e,t)}var md=[`javascript:`,`data:`,`vbscript:`];function hd(e){let t;try{t=new URL(e)}catch{return!0}return!md.includes(t.protocol)}var gd={id:`redirect`,name:`Redirect`,hooks:{onSuccess(e){if(e.data?.url&&e.data?.redirect&&hd(e.data.url)&&typeof window<`u`&&window.location&&window.location)try{window.location.href=e.data.url}catch{}}}},_d=[],vd=0,yd=null,bd=4,xd=globalThis.nanostoresGlobal||={epoch:0},Sd=()=>{let e,t;for(;vd<_d.length;){t=vd,vd+=bd;let n=yd?.get(_d[t]);if(n){if(!n.has(_d[t+1]))continue;n.clear()}try{_d[t](_d[t+1].value,_d[t+2],_d[t+3])}catch(t){e=t}}if(_d.length=vd=0,e)throw e},Cd=e=>{let t=[],n={eq:Object.is,get(){return n.lc||n.listen(()=>{})(),n.value},init:e,lc:0,listen(e){return n.lc=t.push(e),()=>{yd?.get(e)?.delete(n);for(let t=vd;t<_d.length;)_d[t]===e&&_d[t+1]===n?_d.splice(t,bd):t+=bd;let r=t.indexOf(e);~r&&(t.splice(r,1),--n.lc||n.off())}},notify(e,r){xd.epoch++;let i=!_d.length&&!0;for(let i of t)_d.push(i,n,e,r);i&&Sd()},off(){},set(e){let t=n.value;n.eq(t,e)||(n.value=e,n.notify(t))},subscribe(e){let t=n.listen(e);return e(n.value),t},value:e};return n},wd=2,Td=5,Ed=6,Dd=10,Od=(e,t,n,r)=>(e.events=e.events||{},e.events[n+Dd]||(e.events[n+Dd]=r(t=>{e.events[n].reduceRight((e,t)=>(t(e),e),{shared:{},...t})})),e.events[n]=e.events[n]||[],e.events[n].push(t),()=>{let r=e.events[n],i=r.indexOf(t);~i&&(r.splice(i,1),r.length||(e.events[n+Dd](),delete e.events[n+Dd]))}),kd=(e,t)=>Od(e,t,wd,t=>{let n=e.set,r=e.setKey;return e.setKey&&=(n,i)=>{let a;if(t({abort:()=>{a=!0},changed:n,newValue:{...e.value,[n]:i}}),!a)return r(n,i)},e.set=e=>{let r;if(t({abort:()=>{r=!0},newValue:e}),!r)return n(e)},()=>{e.set=n,e.setKey=r}}),Ad=1e3,jd=(e,t)=>Od(e,n=>{let r=t(n);r&&e.events[Ed].push(r)},Td,t=>{let n=e.listen;e.listen=(...r)=>(!e.lc&&!e.active&&(e.active=!0,t()),n(...r));let r=e.off;return e.events[Ed]=[],e.off=()=>{r(),setTimeout(()=>{if(e.active&&!e.lc){e.active=!1;for(let t of e.events[Ed])t();e.events[Ed]=[]}},Ad)},()=>{e.listen=n,e.off=r}});function Md(e,t){let n=Pd(t),r=e;for(let e of n){if(r==null)return;r=r[e]}return r}var Nd=/(.*)\[(\d+)\]/;function Pd(e){return e.split(`.`).flatMap(e=>Fd(e))}function Fd(e){if(Nd.test(e)){let[,t,n]=e.match(Nd);return[...Fd(t),n]}return[e]}function Id(e,t,n){let r=new Set(t);return e.listen((i,a,o)=>{let s=e=>!Object.is(Md(i,e),Md(a,e));(o===void 0?t.some(t=>a===void 0||(e.eqKey?!e.eqKey(a[t],i[t],t):s(t))):r.has(o)||typeof o==`string`&&(r.has(o.split(/\.|\[/)[0])||!e.eqKey&&a!==void 0&&t.some(s)))&&n(i,a,o)})}function Ld(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Rd(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Rd(e[n],t[n]))return!1;return!0}if(Ld(e)&&Ld(t)){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!(r in t)||!Rd(e[r],t[r]))return!1;return!0}return!1}function zd(e,t){return kd(e,({newValue:n,abort:r})=>{t(e.value,n)&&r()})}var Bd=Symbol.for(`better-auth:auth-query`);function Vd(e){return Bd in e&&e[Bd]===!0}function Hd(e){let t=Cd(e);return Object.defineProperty(t,Bd,{value:!0}),t}var Ud=Symbol.for(`better-auth:broadcast-channel`),Wd=()=>Math.floor(Date.now()/1e3),Gd=class{listeners=new Set;name;constructor(e=`better-auth.message`){this.name=e}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}post(e){if(typeof window<`u`)try{localStorage.setItem(this.name,JSON.stringify({...e,timestamp:Wd()}))}catch{}}setup(){if(typeof window>`u`||window.addEventListener===void 0)return()=>{};let e=e=>{if(e.key!==this.name)return;let t=JSON.parse(e.newValue??`{}`);t?.event===`session`&&t?.data&&this.listeners.forEach(e=>e(t))};return window.addEventListener(`storage`,e),()=>{window.removeEventListener(`storage`,e)}}};function Kd(e=`better-auth.message`){return globalThis[Ud]||(globalThis[Ud]=new Gd(e)),globalThis[Ud]}var qd=Symbol.for(`better-auth:focus-manager`),Jd=class{listeners=new Set;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setFocused(e){this.listeners.forEach(t=>t(e))}setup(){if(typeof window>`u`||typeof document>`u`||window.addEventListener===void 0)return()=>{};let e=()=>{document.visibilityState===`visible`&&this.setFocused(!0)};return document.addEventListener(`visibilitychange`,e,!1),()=>{document.removeEventListener(`visibilitychange`,e,!1)}}};function Yd(){return globalThis[qd]||(globalThis[qd]=new Jd),globalThis[qd]}var Xd=Symbol.for(`better-auth:online-manager`),Zd=class{listeners=new Set;isOnline=typeof navigator<`u`?navigator.onLine:!0;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setOnline(e){this.isOnline=e,this.listeners.forEach(t=>t(e))}setup(){if(typeof window>`u`||window.addEventListener===void 0)return()=>{};let e=()=>this.setOnline(!0),t=()=>this.setOnline(!1);return window.addEventListener(`online`,e,!1),window.addEventListener(`offline`,t,!1),()=>{window.removeEventListener(`online`,e,!1),window.removeEventListener(`offline`,t,!1)}}};function Qd(){return globalThis[Xd]||(globalThis[Xd]=new Zd),globalThis[Xd]}var $d=()=>Math.floor(Date.now()/1e3),ef=5;function tf(e){let{fetchSession:t,shouldPollSession:n=()=>!0,sessionSignal:r,options:i={}}=e,a=i.sessionOptions?.refetchInterval??0,o=i.sessionOptions?.refetchOnWindowFocus??!0,s=i.sessionOptions?.refetchWhenOffline??!1,c={isInitialized:!1,lastSessionRequest:0},l=()=>s||Qd().isOnline,u=e=>{if(l()){if(e?.event===`storage`)t();else if(e?.event===`poll`)c.lastSessionRequest=$d(),t();else if(e?.event===`visibilitychange`){if($d()-c.lastSessionRequest<ef)return;c.lastSessionRequest=$d(),t()}else t()}},d=e=>{Kd().post({event:`session`,data:{trigger:e},clientId:Math.random().toString(36).substring(7)})},f=()=>{a&&a>0&&(c.pollInterval=setInterval(()=>{n()&&u({event:`poll`})},a*1e3))},p=()=>{c.unsubscribeBroadcast=Kd().subscribe(()=>{u({event:`storage`})})},m=()=>{o&&(c.unsubscribeFocus=Yd().subscribe(()=>{u({event:`visibilitychange`})}))},h=()=>{c.unsubscribeOnline=Qd().subscribe(e=>{e&&u({event:`visibilitychange`})})},g=()=>{c.unsubscribeSignal=r.listen(()=>{t()})};return{init:()=>{c.isInitialized||(c.isInitialized=!0,f(),p(),m(),h(),g(),c.cleanupBroadcastSetup=Kd().setup(),c.cleanupFocusSetup=Yd().setup(),c.cleanupOnlineSetup=Qd().setup())},cleanup:()=>{c.isInitialized&&(c.pollInterval&&=(clearInterval(c.pollInterval),void 0),c.unsubscribeBroadcast&&=(c.unsubscribeBroadcast(),void 0),c.unsubscribeFocus&&=(c.unsubscribeFocus(),void 0),c.unsubscribeOnline&&=(c.unsubscribeOnline(),void 0),c.unsubscribeSignal&&=(c.unsubscribeSignal(),void 0),c.cleanupBroadcastSetup&&=(c.cleanupBroadcastSetup(),void 0),c.cleanupFocusSetup&&=(c.cleanupFocusSetup(),void 0),c.cleanupOnlineSetup&&=(c.cleanupOnlineSetup(),void 0),c.isInitialized=!1,c.lastSessionRequest=0)},triggerRefetch:u,broadcastSessionUpdate:d}}var nf=()=>typeof window>`u`,rf=Ad;function af(e,t){if(typeof window>`u`)return;let n=e.get();n.data===null&&t!==null&&e.set({...n,data:t,error:null,isPending:!1})}function of(e){return typeof e==`object`&&e&&`data`in e&&`error`in e?e:{data:e,error:null}}function sf(e){return!e||e.session===null&&e.user===null?null:e}function cf(e,t){return Rd(e.data,t.data)&&e.error===t.error&&e.isPending===t.isPending&&e.isRefetching===t.isRefetching&&e.refetch===t.refetch}function lf(e,t){let n=Cd(!1),r,i=0,a=0;n.listen(()=>{a++,i=0});let o=e=>u(e),s=Hd({data:null,error:null,isPending:!0,isRefetching:!1,refetch:o});zd(s,cf);let c=async(t,n)=>{let r=s.value;if(s.set({...r,isPending:r.data===null,isRefetching:!0,error:null,refetch:o}),t.aborted)return`aborted`;try{let r=await e(`/get-session`,{method:`GET`,query:n?.query,signal:t});if(t.aborted)return`aborted`;let{data:i,error:a}=of(r),c=`fresh`;if(i?.needsRefresh)try{let n=await e(`/get-session`,{method:`POST`,signal:t});if(t.aborted)return`aborted`;({data:i,error:a}=of(n))}catch{if(t.aborted)return`aborted`;c=`stale`}if(a){let e=s.value,t=a?.status===401;return s.set({data:t?null:e.data,error:a,isPending:!1,isRefetching:!1,refetch:o}),`failed`}let l=sf(i),u=s.value,d=u.data!=null&&l!=null&&Rd(u.data,l)?u.data:l;return s.set({data:d,error:null,isPending:!1,isRefetching:!1,refetch:o}),c}catch(e){if(t.aborted)return`aborted`;let n=s.value;return s.set({data:n.data,error:e,isPending:!1,isRefetching:!1,refetch:o}),`failed`}},l=()=>{let e=s.value.data?.session?.expiresAt,t=e instanceof Date?e.getTime():1/0;return Math.min(Date.now()+rf,t)},u=e=>{i=0,r?.cancel();let t=new AbortController,n={cancel:()=>t.abort(),promise:Promise.resolve().then(()=>t.signal.aborted?`aborted`:c(t.signal,e)),revision:a};r=n;let o=e=>{r===n&&(r=void 0,e===`fresh`&&n.revision===a&&(i=l()))};return n.promise.then(o,()=>o(`failed`)),n.promise.then(()=>void 0)},d=()=>r?.revision===a?r.promise.then(()=>void 0):Date.now()<i?Promise.resolve():u(),f=()=>{};return jd(s,()=>{let e;nf()||(e=setTimeout(()=>{d()},0));let r=tf({fetchSession:u,shouldPollSession:()=>s.value.data!=null,sessionSignal:n,options:t});return r.init(),f=r.broadcastSessionUpdate,()=>{e&&clearTimeout(e),r.cleanup()}}),{session:s,$sessionSignal:n,broadcastSessionUpdate:e=>f(e)}}function uf(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)===`[object Module]`:!0}function df(e,t,n=`.`,r){if(!uf(t))return df(e,{},n,r);let i={...t};for(let t of Object.keys(e)){if(t===`__proto__`||t===`constructor`)continue;let a=e[t];a!=null&&(r&&r(i,t,a,n)||(i[t]=Array.isArray(a)&&Array.isArray(i[t])?[...a,...i[t]]:uf(a)&&uf(i[t])?df(a,i[t],(n?`${n}.`:``)+t.toString(),r):a))}return i}function ff(e){return(...t)=>t.reduce((t,n)=>df(t,n,``,e),{})}var pf=ff(),mf=class extends Error{constructor(e,t,n){super(t||e.toString(),{cause:n}),this.status=e,this.statusText=t,this.error=n,Error.captureStackTrace(this,this.constructor)}},hf=async(e,t)=>{let n=t||{},r={onRequest:[t?.onRequest],onResponse:[t?.onResponse],onSuccess:[t?.onSuccess],onError:[t?.onError],onRetry:[t?.onRetry]};if(!t||!t?.plugins)return{url:e,options:n,hooks:r};for(let i of t?.plugins||[]){if(i.init){let t=await i.init?.call(i,e.toString(),n);n=t.options||n,e=t.url}r.onRequest.push(i.hooks?.onRequest),r.onResponse.push(i.hooks?.onResponse),r.onSuccess.push(i.hooks?.onSuccess),r.onError.push(i.hooks?.onError),r.onRetry.push(i.hooks?.onRetry)}return{url:e,options:n,hooks:r}},gf=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(){return this.options.delay}},_f=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(e){return Math.min(this.options.maxDelay,this.options.baseDelay*2**e)}};function vf(e){if(typeof e==`number`)return new gf({type:`linear`,attempts:e,delay:1e3});switch(e.type){case`linear`:return new gf(e);case`exponential`:return new _f(e);default:throw Error(`Invalid retry strategy`)}}var yf=[`get`,`post`,`put`,`patch`,`delete`];function bf(e){if(!e.startsWith(`@`))return{method:void 0,path:e};let t=e.indexOf(`/`),n=e.slice(1,t===-1?void 0:t);return yf.includes(n)?{method:n,path:t===-1?e:e.slice(t+1)}:{method:void 0,path:e}}var xf=e=>e===`.`||e===`..`,Sf=e=>e.split(`:`).map(e=>encodeURIComponent(e)).join(`:`);function Cf(e,t){let n=t.get(e);if(n===void 0)return Sf(e);if(xf(n))throw TypeError(`Path parameters cannot be reserved path segments`);return encodeURIComponent(n)}function wf(e,t){let{baseURL:n,params:r,query:i}=t||{query:{},params:{},baseURL:``},a=e.startsWith(`http`)?e.split(`/`).slice(0,3).join(`/`):n||``,{path:o}=bf(e);o!==e&&(e=`/${o}`),a.endsWith(`/`)||(a+=`/`);let[s,c]=e.replace(a,``).split(`?`),l=new URLSearchParams(c);for(let[e,t]of Object.entries(i||{})){if(t==null)continue;let n;if(typeof t==`string`)n=t;else if(Array.isArray(t)){for(let n of t)l.append(e,n);continue}else n=JSON.stringify(t);l.set(e,n)}let u=new Map;if(r){if(Array.isArray(r)){let e=s.split(`/`).filter(e=>e.startsWith(`:`));for(let[t,n]of e.entries()){let e=r[t];u.set(n,String(e))}}else for(let[e,t]of Object.entries(r))u.set(`:${e}`,String(t))}s=s.split(`/`).map(e=>Cf(e,u)).join(`/`),s=s.replace(/^\/+/,``);let d=l.toString();return d=d.length>0?`?${d}`.replace(/\+/g,`%20`):``,a.startsWith(`http`)?new URL(`${s}${d}`,a):`${a}${s}${d}`}var Tf=async e=>{let t={},n=async e=>typeof e==`function`?await e():e;if(e?.auth){if(e.auth.type===`Bearer`){let r=await n(e.auth.token);if(!r)return t;t.authorization=`Bearer ${r}`}else if(e.auth.type===`Basic`){let[r,i]=await Promise.all([n(e.auth.username),n(e.auth.password)]);if(!r||!i)return t;t.authorization=`Basic ${btoa(`${r}:${i}`)}`}else if(e.auth.type===`Custom`){let[r,i]=await Promise.all([n(e.auth.prefix),n(e.auth.value)]);if(!i)return t;t.authorization=`${r??``} ${i}`}}return t},Ef=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function Df(e){let t=e.headers.get(`content-type`),n=new Set([`image/svg`,`application/xml`,`application/xhtml`,`application/html`]);if(!t)return`json`;let r=t.split(`;`).shift()||``;return Ef.test(r)?`json`:n.has(r)||r.startsWith(`text/`)?`text`:`blob`}function Of(e){try{return JSON.parse(e),!0}catch{return!1}}function kf(e){if(e===void 0)return!1;let t=typeof e;return t===`string`||t===`number`||t===`boolean`||t===null?!0:t===`object`?Array.isArray(e)?!0:e.buffer?!1:e.constructor&&e.constructor.name===`Object`||typeof e.toJSON==`function`:!1}function Af(e){try{return JSON.parse(e)}catch{return e}}function jf(e){return typeof e==`function`}function Mf(e){if(e?.customFetchImpl)return e.customFetchImpl;if(typeof globalThis<`u`&&jf(globalThis.fetch))return globalThis.fetch;if(typeof window<`u`&&jf(window.fetch))return window.fetch;throw Error(`No fetch implementation found`)}function Nf(...e){let t={};for(let n of e)if(n){if(n instanceof Headers)n.forEach((e,n)=>{t[n]=e});else{let e=Array.isArray(n)?n:Object.entries(n);for(let[n,r]of e)r!=null&&(t[n]=r)}}return t}async function Pf(e){let t=new Headers(Nf(e?.headers,await Tf(e)));if(!t.has(`content-type`)){let n=Ff(e?.body);n&&t.set(`content-type`,n)}return t}function Ff(e){return kf(e)?`application/json`:null}function If(e){let t=e.get(`content-type`);return t?t.split(`;`)[0].trim().toLowerCase():null}function Lf(e,t){let{body:n}=e;return n?!kf(n)||typeof n==`string`?n:If(t)===`application/x-www-form-urlencoded`?new URLSearchParams(n).toString():JSON.stringify(n):null}function Rf(e,t){if(t?.method)return t.method.toUpperCase();let{method:n}=bf(e);return n?n.toUpperCase():t?.body?`POST`:`GET`}function zf(e,t){let n;return!e?.signal&&e?.timeout&&(n=setTimeout(()=>t?.abort(),e?.timeout)),{abortTimeout:n,clearTimeout:()=>{n&&clearTimeout(n)}}}var Bf=class e extends Error{constructor(t,n){super(n||JSON.stringify(t,null,2)),this.issues=t,Object.setPrototypeOf(this,e.prototype)}};async function Vf(e,t){let n=await e[`~standard`].validate(t);if(n.issues)throw new Bf(n.issues);return n.value}function Hf(e){"@babel/helpers - typeof";return Hf=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Hf(e)}function Uf(e,t){if(Hf(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Hf(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Wf(e){var t=Uf(e,`string`);return Hf(t)==`symbol`?t:t+``}function Gf(e,t,n){return(t=Wf(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Kf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function qf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Kf(Object(n),!0).forEach(function(t){Gf(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Kf(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Jf=async(e,t)=>{var n;let{hooks:r,url:i,options:a}=await hf(e,t),o=Mf(a),s=new AbortController,c=a.signal??s.signal,l=wf(i,a),u=await Pf(a),d=Lf(a,u),f=Rf(i,a),p=qf(qf({},a),{},{url:l,headers:u,body:d,method:f,signal:c});for(let e of r.onRequest)if(e){let t=await e(p);typeof t==`object`&&t&&Object.assign(p,t)}(`pipeTo`in p&&typeof p.pipeTo==`function`||typeof(t==null||(n=t.body)==null?void 0:n.pipe)==`function`)&&(`duplex`in p||(p.duplex=`half`));let{clearTimeout:m}=zf(a,s),h=await o(p.url,p);m();let g={response:h,request:p};for(let e of r.onResponse)if(e){var _;let n=await e(qf(qf({},g),{},{response:t!=null&&(_=t.hookOptions)!=null&&_.cloneResponse?h.clone():h}));n instanceof Response?h=n:typeof n==`object`&&n&&(h=n.response)}if(h.ok){if(p.method===`HEAD`)return{data:``,error:null};let e=Df(h),n={data:null,response:h,request:p};if(e===`json`||e===`text`){let e=await h.text();n.data=await(p.jsonParser??Af)(e)}else n.data=await h[e]();p?.output&&p.output&&!p.disableValidation&&(n.data=await Vf(p.output,n.data));for(let e of r.onSuccess)if(e){var v;await e(qf(qf({},n),{},{response:t!=null&&(v=t.hookOptions)!=null&&v.cloneResponse?h.clone():h}))}return t?.throw?n.data:{data:n.data,error:null}}let y=t?.jsonParser??Af,b=await h.text(),x=Of(b),S=x?await y(b):null,C={response:h,responseText:b,request:p,error:qf(qf({},S),{},{status:h.status,statusText:h.statusText})};for(let e of r.onError)if(e){var w;await e(qf(qf({},C),{},{response:t!=null&&(w=t.hookOptions)!=null&&w.cloneResponse?h.clone():h}))}if(t?.retry){let n=vf(t.retry),i=t.retryAttempt??0;if(await n.shouldAttemptRetry(i,h)){for(let e of r.onRetry)e&&await e(g);let a=n.getDelay(i);return await new Promise(e=>setTimeout(e,a)),await Jf(e,qf(qf({},t),{},{retryAttempt:i+1}))}}if(t?.throw)throw new mf(h.status,h.statusText,x?S:b);return{data:null,error:qf(qf({},S),{},{status:h.status,statusText:h.statusText})}},Yf=e=>({id:`apply-schema`,name:`Apply Schema`,version:`1.0.0`,async init(t,n){var r;let i=qf(qf({},n),e.query!==void 0&&{query:qf(qf({},e.query),n?.query)}),a=((r=e.plugins)==null||(r=r.find(e=>e.schema?.config?t.startsWith(e.schema.config.baseURL||``)||t.startsWith(e.schema.config.prefix||``):!1))==null?void 0:r.schema)||e.schema;if(a){let r=t;a.config?.prefix&&r.startsWith(a.config.prefix)&&(r=r.replace(a.config.prefix,``),a.config.baseURL&&(t=t.replace(a.config.prefix,a.config.baseURL))),a.config?.baseURL&&r.startsWith(a.config.baseURL)&&(r=r.replace(a.config.baseURL,``)),r.startsWith(`/`)&&r.charAt(1)===`@`&&(r=r.substring(1));let o=a.schema[r];if(o){let{method:a,path:s}=bf(r);a&&(t=t.slice(0,t.length-r.length)+s);let c=n?.headers;if(o.headers&&!n?.disableValidation){let e={};if(n?.headers){if(n.headers instanceof Headers)n.headers.forEach((t,n)=>{e[n.toLowerCase()]=t});else if(typeof n.headers==`object`)for(let[t,r]of Object.entries(n.headers))r!=null&&(e[t.toLowerCase()]=r)}let t=await Vf(o.headers,e),r={};for(let[e,n]of Object.entries(t))r[e.toLowerCase()]=n;c=r}let l=o.method??a;if(i=qf(qf(qf(qf({},i),l!==void 0&&{method:l}),o.output!==void 0&&{output:o.output}),c!==void 0&&{headers:c}),!n?.disableValidation){if(o.query&&(i.query=await Vf(o.query,n?.query),i.query!==null&&typeof i.query==`object`)){let t=qf({},e.query);for(let e of Object.keys(t))n?.query&&Object.prototype.hasOwnProperty.call(n.query,e)&&(t[e]=n.query[e]);i.query=qf(qf({},t),i.query)}i=qf(qf({},i),{},{body:o.input?await Vf(o.input,n?.body):n?.body,params:o.params?await Vf(o.params,n?.params):n?.params})}return{url:t,options:i}}}return qf({url:t},(n!==void 0||e.query!==void 0)&&{options:i})}}),Xf=e=>{async function t(t,n){let r=qf(qf(qf({},e),n),{},{headers:Nf(e?.headers,n?.headers),plugins:[...e?.plugins||[],Yf(e||{}),...n?.plugins||[]]});if(e?.catchAllError)try{return await Jf(t,r)}catch(e){return{data:null,error:{status:500,statusText:`Fetch Error`,message:`Fetch related error. Captured by catchAllError option. See error property for more details.`,error:e}}}return await Jf(t,r)}return t},Zf=e=>{if(typeof process>`u`)return;let t=e??`/api/auth`;if({}.NEXT_PUBLIC_AUTH_URL)return{}.NEXT_PUBLIC_AUTH_URL;if(typeof window>`u`){if({}.NEXTAUTH_URL)try{return{}.NEXTAUTH_URL}catch{}if({}.VERCEL_URL)try{let e={}.VERCEL_URL.startsWith(`http`)?``:`https://`;return`${new URL(`${e}${{}.VERCEL_URL}`).origin}${t}`}catch{}}},Qf=e=>e===`/sign-out`||e===`/update-user`||e===`/update-session`||e===`/sign-up/email`||e===`/sign-in/email`||e===`/delete-user`||e===`/verify-email`||e===`/revoke-sessions`||e===`/revoke-session`||e===`/revoke-other-sessions`||e===`/change-email`||e===`/change-password`,$f=(e,t)=>{let n=`credentials`in Request.prototype,r=id(e?.baseURL,e?.basePath,void 0,t)??Zf(e?.basePath)??`/api/auth`,i=e?.plugins?.flatMap(e=>e.fetchPlugins).filter(e=>e!==void 0)||[],a={id:`lifecycle-hooks`,name:`lifecycle-hooks`,hooks:{onSuccess:e?.fetchOptions?.onSuccess,onError:e?.fetchOptions?.onError,onRequest:e?.fetchOptions?.onRequest,onResponse:e?.fetchOptions?.onResponse}},{onSuccess:o,onError:s,onRequest:c,onResponse:l,...u}=e?.fetchOptions||{},d=Xf({baseURL:r,...n?{credentials:`include`}:{},method:`GET`,jsonParser(e){return e?pd(e,{strict:!1}):null},customFetchImpl:fetch,...u,plugins:[a,...u.plugins||[],...e?.disableDefaultFetchPlugins?[]:[gd],...i]}),{$sessionSignal:f,session:p,broadcastSessionUpdate:m}=lf(d,e),h=!1,g=e=>{h||e===null||(h=!0,af(p,e))},_=e?.plugins||[],v={},y={$sessionSignal:f,session:p},b={"/sign-out":`POST`,"/revoke-sessions":`POST`,"/revoke-other-sessions":`POST`,"/delete-user":`POST`},x=[{signal:`$sessionSignal`,matcher:Qf,callback(e){e===`/sign-out`?m(`signout`):(e===`/update-user`||e===`/update-session`)&&m(`updateUser`)}}];for(let e of _)e.getAtoms&&Object.assign(y,e.getAtoms?.(d)),e.pathMethods&&Object.assign(b,e.pathMethods),e.atomListeners&&x.push(...e.atomListeners);let S={notify:e=>{y[e].set(!y[e].get())},listen:(e,t)=>{y[e].subscribe(t)},atoms:y};for(let t of _)t.getActions&&(v=pf(t.getActions?.(d,S,e)??{},v));return{get baseURL(){return r},pluginsActions:v,pluginsAtoms:y,pluginPathMethods:b,atomListeners:x,hydrateSession:g,$sessionSignal:f,$fetch:d,$store:S}};function ep(e){return typeof e==`object`&&!!e&&`get`in e&&typeof e.get==`function`&&`lc`in e&&typeof e.lc==`number`}function tp(e){return e.charAt(0).toUpperCase()+e.slice(1)}var np=/[\p{Ll}\d]+|\p{Lu}+(?!\p{Ll})|\p{Lu}[\p{Ll}\d]+|\p{Lo}+/gu,rp=/['\u2019]/g;function ip(e){return e.replace(rp,``).match(np)??[]}function ap(e){return ip(e).map(e=>e.toLowerCase()).join(`-`)}function op(e,t,n){let r=t[e],{fetchOptions:i,query:a,...o}=n||{};return r||(i?.method?i.method:o&&Object.keys(o).length>0?`POST`:`GET`)}function sp(e,t,n,r,i){function a(o=[]){return new Proxy(function(){},{get(t,n){if(typeof n!=`string`||n===`then`||n===`catch`||n===`finally`)return;let r=[...o,n],i=e;for(let e of r)if(i&&typeof i==`object`&&e in i)i=i[e];else{i=void 0;break}return typeof i==`function`||ep(i)?i:a(r)},apply:async(e,a,s)=>{let c=`/`+o.map(ap).join(`/`),l=s[0]||{},u=s[1]||{},{query:d,fetchOptions:f,...p}=l,m={...u,...f},h=op(c,n,l);return await t(c,{...m,body:h===`GET`?void 0:{...p,...m?.body||{}},query:d||m?.query,method:h,async onSuccess(e){if(await m?.onSuccess?.(e),!i||m.disableSignal)return;let t=i.filter(e=>e.matcher(c));if(!t.length)return;let n=new Set;for(let e of t){let t=r[e.signal];if(!t)return;if(n.has(e.signal))continue;n.add(e.signal);let i=t.get();setTimeout(()=>{t.set(!i)},10),e.callback?.(c)}}})}})}return a()}function cp(e,t={}){let n=(0,f.useRef)(e.get()),{keys:r,deps:i=[e,r]}=t,a=(0,f.useCallback)(t=>{let i=e=>{n.current!==e&&(n.current=e,t())};return i(e.value),r?.length?Id(e,r,i):e.listen(i)},i),o=()=>n.current;return(0,f.useSyncExternalStore)(a,o,Vd(e)?()=>e.init:o)}function lp(e){return`use${tp(e)}`}function up(e){let{pluginPathMethods:t,pluginsActions:n,pluginsAtoms:r,hydrateSession:i,$fetch:a,$store:o,atomListeners:s}=$f(e),c={};for(let[e,t]of Object.entries(r))c[lp(e)]=()=>cp(t);return sp({...n,...c,hydrateSession:i,$fetch:a,$store:o},a,t,r,s)}var dp=e=>`[SonamuProvider] ${e} is not configured. Please provide ${e} configuration to SonamuProvider.`,fp=()=>()=>{throw Error(dp(`uploader`))};function pp(){let e=new Map(Object.entries(Hu));return t=>e.get(t)??t}var mp=(0,f.createContext)({uploader:fp(),SD:pp()});function hp({children:e,auth:t,...n}){let r={uploader:n.uploader??fp(),auth:t,SD:n.SD??pp()};return(0,H.jsx)(mp.Provider,{value:r,children:e})}function gp({children:e,authOptions:t,...n}){let[r]=(0,f.useState)(()=>up(t));return(0,H.jsx)(hp,{...n,auth:n.auth??r,children:e})}function _p({children:e,authOptions:t,...n}){return t===void 0?(0,H.jsx)(hp,{...n,children:e}):(0,H.jsx)(gp,{...n,authOptions:t,children:e})}function vp(){return(0,f.useContext)(mp)}var yp=(0,f.forwardRef)(({title:e,titleId:t,...n},r)=>(0,H.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,H.jsx)(`title`,{id:t,children:e}):null,(0,H.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M18 6L6 18M6 6l12 12`})]})),bp=pa;function xp({container:e,...t}){let n=Gn();return(0,H.jsx)(ya,{container:e??n,...t})}var Sp=f.forwardRef(({className:e,...t},n)=>(0,H.jsx)(xa,{ref:n,className:V(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...t}));Sp.displayName=xa.displayName;var Cp=f.forwardRef(({className:e,children:t,...n},r)=>(0,H.jsxs)(xp,{children:[(0,H.jsx)(Sp,{}),(0,H.jsxs)(Ta,{ref:r,className:V(`fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg`,e),...n,children:[t,(0,H.jsxs)(Ma,{className:`absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground`,children:[(0,H.jsx)(yp,{className:`h-4 w-4`}),(0,H.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]}));Cp.displayName=Ta.displayName;var wp=({className:e,...t})=>(0,H.jsx)(`div`,{className:V(`flex flex-col space-y-1.5 text-center sm:text-left`,e),...t});wp.displayName=`DialogHeader`;var Tp=({className:e,...t})=>(0,H.jsx)(`div`,{className:V(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,e),...t});Tp.displayName=`DialogFooter`;var Ep=f.forwardRef(({className:e,...t},n)=>(0,H.jsx)(ka,{ref:n,className:V(`text-lg font-semibold leading-none tracking-tight`,e),...t}));Ep.displayName=ka.displayName;var Dp=f.forwardRef(({className:e,...t},n)=>(0,H.jsx)(Aa,{ref:n,className:V(`text-sm text-muted-foreground`,e),...t}));Dp.displayName=Aa.displayName;var Op=(0,f.forwardRef)(({title:e,titleId:t,...n},r)=>(0,H.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,H.jsx)(`title`,{id:t,children:e}):null,(0,H.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,H.jsx)(`path`,{d:`m21 21l-4.34-4.34`}),(0,H.jsx)(`circle`,{cx:11,cy:11,r:8})]})]})),kp=1,Ap=.9,jp=.8,Mp=.17,Np=.1,Pp=.999,Fp=.9999,Ip=.99,Lp=/[\\\/_+.#"@\[\(\{&]/,Rp=/[\\\/_+.#"@\[\(\{&]/g,zp=/[\s-]/,Bp=/[\s-]/g;function Vp(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?kp:Ip;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=Vp(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=kp:Lp.test(e.charAt(l-1))?(d*=jp,p=e.slice(i,l-1).match(Rp),p&&i>0&&(d*=Pp**+p.length)):zp.test(e.charAt(l-1))?(d*=Ap,m=e.slice(i,l-1).match(Bp),m&&i>0&&(d*=Pp**+m.length)):(d*=Mp,i>0&&(d*=Pp**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=Fp)),(d<Np&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=Vp(e,t,n,r,l+1,a+2,o),f*Np>d&&(d=f*Np)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function Hp(e){return e.toLowerCase().replace(Bp,` `)}function Up(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,Vp(e,t,Hp(e),Hp(t),0,0,{})}function Wp(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Gp(...e){return t=>{let n=!1,r=e.map(e=>{let r=Wp(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Wp(e[t],null)}}}}var Kp=Symbol.for(`react.lazy`),qp=f.use;function Jp(e){return typeof e==`object`&&!!e&&`then`in e}function Yp(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Kp&&`_payload`in e&&Jp(e._payload)}function Xp(e){let t=Zp(e),n=f.forwardRef((e,n)=>{let{children:r,...i}=e;Yp(r)&&typeof qp==`function`&&(r=qp(r._payload));let a=f.Children.toArray(r),o=a.find($p);if(o){let e=o.props.children,r=a.map(t=>t===o?f.Children.count(e)>1?f.Children.only(null):f.isValidElement(e)?e.props.children:null:t);return(0,H.jsx)(t,{...i,ref:n,children:f.isValidElement(e)?f.cloneElement(e,void 0,r):null})}return(0,H.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function Zp(e){let t=f.forwardRef((e,t)=>{let{children:n,...r}=e;if(Yp(n)&&typeof qp==`function`&&(n=qp(n._payload)),f.isValidElement(n)){let e=tm(n),i=em(r,n.props);return n.type!==f.Fragment&&(i.ref=t?Gp(t,e):e),f.cloneElement(n,i)}return f.Children.count(n)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Qp=Symbol(`radix.slottable`);function $p(e){return f.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Qp}function em(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function tm(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var nm=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Xp(`Primitive.${t}`),r=f.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,H.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),rm=globalThis?.document?f.useLayoutEffect:()=>{},im=f.useId||(()=>void 0),am=0;function om(e){let[t,n]=f.useState(im());return rm(()=>{e||n(e=>e??String(am++))},[e]),e||(t?`radix-${t}`:``)}var sm=`[cmdk-group=""]`,cm=`[cmdk-group-items=""]`,lm=`[cmdk-group-heading=""]`,um=`[cmdk-item=""]`,dm=`${um}:not([aria-disabled="true"])`,fm=`cmdk-item-select`,pm=`data-value`,mm=(e,t,n)=>Up(e,t,n),hm=f.createContext(void 0),gm=()=>f.useContext(hm),_m=f.createContext(void 0),vm=()=>f.useContext(_m),ym=f.createContext(void 0),bm=f.forwardRef((e,t)=>{let n=Pm(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=Pm(()=>new Set),i=Pm(()=>new Map),a=Pm(()=>new Map),o=Pm(()=>new Set),s=Mm(e),{label:c,children:l,value:u,onValueChange:d,filter:p,shouldFilter:m,loop:h,disablePointerSelection:g=!1,vimBindings:_=!0,...v}=e,y=om(),b=om(),x=om(),S=f.useRef(null),C=Lm();Nm(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,w.emit()}},[u]),Nm(()=>{C(6,A)},[]);let w=f.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)k(),D(),C(1,O);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(x);e?e.focus():(i=document.getElementById(y))==null||i.focus()}if(C(7,()=>{n.current.selectedItemId=j()?.id,w.emit()}),r||C(5,A),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}w.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),T=f.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,E(t,r)),C(2,()=>{D(),w.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),C(3,()=>{k(),D(),n.current.value||O(),w.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=j();C(4,()=>{k(),t?.getAttribute(`id`)===e&&O(),w.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:y,inputId:x,labelId:b,listInnerRef:S}),[]);function E(e,t){let r=s.current?.filter??mm;return e?r(e,n.current.search,t):0}function D(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=S.current;M().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(cm);t?t.appendChild(e.parentElement===t?e:e.closest(`${cm} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${cm} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=S.current?.querySelector(`${sm}[${pm}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function O(){let e=M().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(pm);w.setState(`value`,e||void 0)}function k(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=E(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function A(){var e;let t=j();t&&(t.parentElement?.firstChild===t&&((e=t.closest(sm)?.querySelector(lm))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function j(){return S.current?.querySelector(`${um}[aria-selected="true"]`)}function M(){return Array.from(S.current?.querySelectorAll(dm)||[])}function N(e){let t=M()[e];t&&w.setState(`value`,t.getAttribute(pm))}function P(e){var t;let n=j(),r=M(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&w.setState(`value`,a.getAttribute(pm))}function F(e){let t=j()?.closest(sm),n;for(;t&&!n;)t=e>0?Am(t,sm):jm(t,sm),n=t?.querySelector(dm);n?w.setState(`value`,n.getAttribute(pm)):P(e)}let I=()=>N(M().length-1),L=e=>{e.preventDefault(),e.metaKey?I():e.altKey?F(1):P(1)},R=e=>{e.preventDefault(),e.metaKey?N(0):e.altKey?F(-1):P(-1)};return f.createElement(nm.div,{ref:t,tabIndex:-1,...v,"cmdk-root":``,onKeyDown:e=>{var t;(t=v.onKeyDown)==null||t.call(v,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:_&&e.ctrlKey&&L(e);break;case`ArrowDown`:L(e);break;case`p`:case`k`:_&&e.ctrlKey&&R(e);break;case`ArrowUp`:R(e);break;case`Home`:e.preventDefault(),N(0);break;case`End`:e.preventDefault(),I();break;case`Enter`:{e.preventDefault();let t=j();if(t){let e=new Event(fm);t.dispatchEvent(e)}}}}},f.createElement(`label`,{"cmdk-label":``,htmlFor:T.inputId,id:T.labelId,style:Bm},c),zm(e,e=>f.createElement(_m.Provider,{value:w},f.createElement(hm.Provider,{value:T},e))))}),xm=f.forwardRef((e,t)=>{let n=om(),r=f.useRef(null),i=f.useContext(ym),a=gm(),o=Mm(e),s=o.current?.forceMount??i?.forceMount;Nm(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=Im(n,r,[e.value,e.children,r],e.keywords),l=vm(),u=Fm(e=>e.value&&e.value===c.current),d=Fm(e=>s||a.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);f.useEffect(()=>{let t=r.current;if(t&&!e.disabled)return t.addEventListener(fm,p),()=>t.removeEventListener(fm,p)},[d,e.onSelect,e.disabled]);function p(){var e,t;m(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function m(){l.setState(`value`,c.current,!0)}if(!d)return null;let{disabled:h,value:g,onSelect:_,forceMount:v,keywords:y,...b}=e;return f.createElement(nm.div,{ref:Gp(r,t),...b,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!h,"aria-selected":!!u,"data-disabled":!!h,"data-selected":!!u,onPointerMove:h||a.getDisablePointerSelection()?void 0:m,onClick:h?void 0:p},e.children)}),Sm=f.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=om(),s=f.useRef(null),c=f.useRef(null),l=om(),u=gm(),d=Fm(e=>i||u.filter()===!1?!0:!e.search||e.filtered.groups.has(o));Nm(()=>u.group(o),[]),Im(o,s,[e.value,e.heading,c]);let p=f.useMemo(()=>({id:o,forceMount:i}),[i]);return f.createElement(nm.div,{ref:Gp(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:!d||void 0},n&&f.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),zm(e,e=>f.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},f.createElement(ym.Provider,{value:p},e))))}),Cm=f.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=f.useRef(null),a=Fm(e=>!e.search);return!n&&!a?null:f.createElement(nm.div,{ref:Gp(i,t),...r,"cmdk-separator":``,role:`separator`})}),wm=f.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=vm(),o=Fm(e=>e.search),s=Fm(e=>e.selectedItemId),c=gm();return f.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),f.createElement(nm.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),Tm=f.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=f.useRef(null),o=f.useRef(null),s=Fm(e=>e.selectedItemId),c=gm();return f.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),f.createElement(nm.div,{ref:Gp(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},zm(e,e=>f.createElement(`div`,{ref:Gp(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),Em=f.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return f.createElement(pa,{open:n,onOpenChange:r},f.createElement(ya,{container:o},f.createElement(xa,{"cmdk-overlay":``,className:i}),f.createElement(Ta,{"aria-label":e.label,"cmdk-dialog":``,className:a},f.createElement(bm,{ref:t,...s}))))}),Dm=f.forwardRef((e,t)=>Fm(e=>e.filtered.count===0)?f.createElement(nm.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),Om=f.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return f.createElement(nm.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},zm(e,e=>f.createElement(`div`,{"aria-hidden":!0},e)))}),km=Object.assign(bm,{List:Tm,Item:xm,Input:wm,Group:Sm,Separator:Cm,Dialog:Em,Empty:Dm,Loading:Om});function Am(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function jm(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Mm(e){let t=f.useRef(e);return Nm(()=>{t.current=e}),t}var Nm=typeof window>`u`?f.useEffect:f.useLayoutEffect;function Pm(e){let t=f.useRef();return t.current===void 0&&(t.current=e()),t}function Fm(e){let t=vm(),n=()=>e(t.snapshot());return f.useSyncExternalStore(t.subscribe,n,n)}function Im(e,t,n,r=[]){let i=f.useRef(),a=gm();return Nm(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(pm,s),i.current=s}),i}var Lm=()=>{let[e,t]=f.useState(),n=Pm(()=>new Map);return Nm(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function Rm(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function zm({asChild:e,children:t},n){return e&&f.isValidElement(t)?f.cloneElement(Rm(t),{ref:t.ref},n(t.props.children)):n(t)}var Bm={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`},Vm=f.forwardRef(({className:e,...t},n)=>(0,H.jsx)(km,{ref:n,className:V(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,e),...t}));Vm.displayName=km.displayName;var Hm=({children:e,commandProps:t,...n})=>{let{className:r,...i}=t??{};return(0,H.jsx)(bp,{...n,children:(0,H.jsx)(Cp,{className:`overflow-hidden p-0 shadow-lg`,children:(0,H.jsx)(Vm,{className:V(`**:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 **:[[cmdk-group]]:px-2 **:[[cmdk-input-wrapper]_svg]:size-5 **:[[cmdk-input]]:h-12 **:[[cmdk-item]]:px-2 **:[[cmdk-item]]:py-3 **:[[cmdk-item]_svg]:size-5`,r),...i,children:e})})})},Um=f.forwardRef(({className:e,...t},n)=>(0,H.jsxs)(`div`,{className:`flex items-center border-b px-3`,"cmdk-input-wrapper":``,children:[(0,H.jsx)(Op,{className:`mr-2 h-4 w-4 shrink-0 opacity-50`}),(0,H.jsx)(km.Input,{ref:n,className:V(`flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50`,e),...t})]}));Um.displayName=km.Input.displayName;var Wm=f.forwardRef(({className:e,...t},n)=>(0,H.jsx)(km.List,{ref:n,className:V(`max-h-[300px] overflow-y-auto overflow-x-hidden`,e),...t}));Wm.displayName=km.List.displayName;var Gm=f.forwardRef((e,t)=>(0,H.jsx)(km.Empty,{ref:t,className:`py-6 text-center text-sm`,...e}));Gm.displayName=km.Empty.displayName;var Km=f.forwardRef(({className:e,...t},n)=>(0,H.jsx)(km.Group,{ref:n,className:V(`overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground`,e),...t}));Km.displayName=km.Group.displayName;var qm=f.forwardRef(({className:e,...t},n)=>(0,H.jsx)(km.Separator,{ref:n,className:V(`-mx-1 h-px bg-border`,e),...t}));qm.displayName=km.Separator.displayName;var Jm=f.forwardRef(({className:e,...t},n)=>(0,H.jsx)(km.Item,{ref:n,className:V(`relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 **:[svg]:pointer-events-none **:[svg]:size-4 **:[svg]:shrink-0`,e),...t}));Jm.displayName=km.Item.displayName;var Ym=[`top`,`right`,`bottom`,`left`],Xm=Math.min,Zm=Math.max,Qm=Math.round,$m=Math.floor,eh=e=>({x:e,y:e}),th={left:`right`,right:`left`,bottom:`top`,top:`bottom`},nh={start:`end`,end:`start`};function rh(e,t,n){return Zm(e,Xm(t,n))}function ih(e,t){return typeof e==`function`?e(t):e}function ah(e){return e.split(`-`)[0]}function oh(e){return e.split(`-`)[1]}function sh(e){return e===`x`?`y`:`x`}function ch(e){return e===`y`?`height`:`width`}var lh=new Set([`top`,`bottom`]);function uh(e){return lh.has(ah(e))?`y`:`x`}function dh(e){return sh(uh(e))}function fh(e,t,n){n===void 0&&(n=!1);let r=oh(e),i=dh(e),a=ch(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=xh(o)),[o,xh(o)]}function ph(e){let t=xh(e);return[mh(e),t,mh(t)]}function mh(e){return e.replace(/start|end/g,e=>nh[e])}var hh=[`left`,`right`],gh=[`right`,`left`],_h=[`top`,`bottom`],vh=[`bottom`,`top`];function yh(e,t,n){switch(e){case`top`:case`bottom`:return n?t?gh:hh:t?hh:gh;case`left`:case`right`:return t?_h:vh;default:return[]}}function bh(e,t,n,r){let i=oh(e),a=yh(ah(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(mh)))),a}function xh(e){return e.replace(/left|right|bottom|top/g,e=>th[e])}function Sh(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ch(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Sh(e)}function wh(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Th(e,t,n){let{reference:r,floating:i}=e,a=uh(t),o=dh(t),s=ch(o),c=ah(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(oh(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1)}return p}var Eh=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=a.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Th(l,r,c),f=r,p={},m=0;for(let n=0;n<s.length;n++){let{name:a,fn:h}=s[n],{x:g,y:_,data:v,reset:y}=await h({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:p,rects:l,platform:o,elements:{reference:e,floating:t}});u=g??u,d=_??d,p={...p,[a]:{...p[a],...v}},y&&m<=50&&(m++,typeof y==`object`&&(y.placement&&(f=y.placement),y.rects&&(l=y.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):y.rects),{x:u,y:d}=Th(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:p}};async function Dh(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=ih(t,e),p=Ch(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=wh(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=wh(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Oh=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=ih(e,t)||{};if(l==null)return{};let d=Ch(u),f={x:n,y:r},p=dh(i),m=ch(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;C&&await(o.isElement==null?void 0:o.isElement(S))||(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=Xm(d[_],T),D=Xm(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=rh(O,A,k),M=!c.arrow&&oh(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),kh=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=ih(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=ah(r),_=uh(o),v=ah(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[xh(o)]:ph(o)),x=p!==`none`;!d&&x&&b.push(...bh(o,m,p,y));let S=[o,...b],C=await Dh(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=fh(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===uh(t)||T.every(e=>uh(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=uh(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function Ah(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function jh(e){return Ym.some(t=>e[t]>=0)}var Mh=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n}=t,{strategy:r=`referenceHidden`,...i}=ih(e,t);switch(r){case`referenceHidden`:{let e=Ah(await Dh(t,{...i,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:jh(e)}}}case`escaped`:{let e=Ah(await Dh(t,{...i,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:jh(e)}}}default:return{}}}}},Nh=new Set([`left`,`top`]);async function Ph(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=ah(n),s=oh(n),c=uh(n)===`y`,l=Nh.has(o)?-1:1,u=a&&c?-1:1,d=ih(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Fh=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Ph(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Ih=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=ih(e,t),l={x:n,y:r},u=await Dh(t,c),d=uh(ah(i)),f=sh(d),p=l[f],m=l[d];if(a){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=p+u[e],r=p-u[t];p=rh(n,p,r)}if(o){let e=d===`y`?`top`:`left`,t=d===`y`?`bottom`:`right`,n=m+u[e],r=m-u[t];m=rh(n,m,r)}let h=s.fn({...t,[f]:p,[d]:m});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[f]:a,[d]:o}}}}}},Lh=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=ih(e,t),u={x:n,y:r},d=uh(i),f=sh(d),p=u[f],m=u[d],h=ih(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Nh.has(ah(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Rh=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=ih(e,t),u=await Dh(t,l),d=ah(i),f=oh(i),p=uh(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=Xm(h-u[g],v),x=Xm(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=Zm(u.left,0),t=Zm(u.right,0),n=Zm(u.top,0),r=Zm(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:Zm(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:Zm(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function zh(){return typeof window<`u`}function Bh(e){return Uh(e)?(e.nodeName||``).toLowerCase():`#document`}function Vh(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Hh(e){return((Uh(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Uh(e){return zh()?e instanceof Node||e instanceof Vh(e).Node:!1}function Wh(e){return zh()?e instanceof Element||e instanceof Vh(e).Element:!1}function Gh(e){return zh()?e instanceof HTMLElement||e instanceof Vh(e).HTMLElement:!1}function Kh(e){return!zh()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Vh(e).ShadowRoot}var qh=new Set([`inline`,`contents`]);function Jh(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=ag(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!qh.has(i)}var Yh=new Set([`table`,`td`,`th`]);function Xh(e){return Yh.has(Bh(e))}var Zh=[`:popover-open`,`:modal`];function Qh(e){return Zh.some(t=>{try{return e.matches(t)}catch{return!1}})}var $h=[`transform`,`translate`,`scale`,`rotate`,`perspective`],eg=[`transform`,`translate`,`scale`,`rotate`,`perspective`,`filter`],tg=[`paint`,`layout`,`strict`,`content`];function ng(e){let t=rg(),n=Wh(e)?ag(e):e;return $h.some(e=>n[e]?n[e]!==`none`:!1)||(n.containerType?n.containerType!==`normal`:!1)||!t&&(n.backdropFilter?n.backdropFilter!==`none`:!1)||!t&&(n.filter?n.filter!==`none`:!1)||eg.some(e=>(n.willChange||``).includes(e))||tg.some(e=>(n.contain||``).includes(e))}function eee(e){let t=sg(e);for(;Gh(t)&&!ig(t);){if(ng(t))return t;if(Qh(t))return null;t=sg(t)}return null}function rg(){return typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter`,`none`)}var tee=new Set([`html`,`body`,`#document`]);function ig(e){return tee.has(Bh(e))}function ag(e){return Vh(e).getComputedStyle(e)}function og(e){return Wh(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function sg(e){if(Bh(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Kh(e)&&e.host||Hh(e);return Kh(t)?t.host:t}function cg(e){let t=sg(e);return ig(t)?e.ownerDocument?e.ownerDocument.body:e.body:Gh(t)&&Jh(t)?t:cg(t)}function lg(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=cg(e),i=r===e.ownerDocument?.body,a=Vh(r);if(i){let e=ug(a);return t.concat(a,a.visualViewport||[],Jh(r)?r:[],e&&n?lg(e):[])}return t.concat(r,lg(r,[],n))}function ug(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function dg(e){let t=ag(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Gh(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Qm(n)!==a||Qm(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function fg(e){return Wh(e)?e:e.contextElement}function pg(e){let t=fg(e);if(!Gh(t))return eh(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=dg(t),o=(a?Qm(n.width):n.width)/r,s=(a?Qm(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}var nee=eh(0);function mg(e){let t=Vh(e);return!rg()||!t.visualViewport?nee:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ree(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Vh(e)?!1:t}function hg(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=fg(e),o=eh(1);t&&(r?Wh(r)&&(o=pg(r)):o=pg(e));let s=ree(a,n,r)?mg(a):eh(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=Vh(a),t=r&&Wh(r)?Vh(r):r,n=e,i=ug(n);for(;i&&r&&t!==n;){let e=pg(i),t=i.getBoundingClientRect(),r=ag(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Vh(i),i=ug(n)}}return wh({width:u,height:d,x:c,y:l})}function gg(e,t){let n=og(e).scrollLeft;return t?t.left+n:hg(Hh(e)).left+n}function _g(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-gg(e,n),y:n.top+t.scrollTop}}function iee(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Hh(r),s=t?Qh(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=eh(1),u=eh(0),d=Gh(r);if((d||!d&&!a)&&((Bh(r)!==`body`||Jh(o))&&(c=og(r)),Gh(r))){let e=hg(r);l=pg(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?_g(o,c):eh(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function aee(e){return Array.from(e.getClientRects())}function oee(e){let t=Hh(e),n=og(e),r=e.ownerDocument.body,i=Zm(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Zm(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+gg(e),s=-n.scrollTop;return ag(r).direction===`rtl`&&(o+=Zm(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var vg=25;function yg(e,t){let n=Vh(e),r=Hh(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=rg();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=gg(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=vg&&(a-=o)}else l<=vg&&(a+=l);return{width:a,height:o,x:s,y:c}}var bg=new Set([`absolute`,`fixed`]);function xg(e,t){let n=hg(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Gh(e)?pg(e):eh(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Sg(e,t,n){let r;if(t===`viewport`)r=yg(e,n);else if(t===`document`)r=oee(Hh(e));else if(Wh(t))r=xg(t,n);else{let n=mg(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return wh(r)}function Cg(e,t){let n=sg(e);return n===t||!Wh(n)||ig(n)?!1:ag(n).position===`fixed`||Cg(n,t)}function wg(e,t){let n=t.get(e);if(n)return n;let r=lg(e,[],!1).filter(e=>Wh(e)&&Bh(e)!==`body`),i=null,a=ag(e).position===`fixed`,o=a?sg(e):e;for(;Wh(o)&&!ig(o);){let t=ag(o),n=ng(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&bg.has(i.position)||Jh(o)&&!n&&Cg(e,o))?r=r.filter(e=>e!==o):i=t,o=sg(o)}return t.set(e,r),r}function Tg(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Qh(t)?[]:wg(t,this._c):[].concat(n),r],o=a[0],s=a.reduce((e,n)=>{let r=Sg(t,n,i);return e.top=Zm(r.top,e.top),e.right=Xm(r.right,e.right),e.bottom=Xm(r.bottom,e.bottom),e.left=Zm(r.left,e.left),e},Sg(t,o,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function Eg(e){let{width:t,height:n}=dg(e);return{width:t,height:n}}function Dg(e,t,n){let r=Gh(t),i=Hh(t),a=n===`fixed`,o=hg(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=eh(0);function l(){c.x=gg(i)}if(r||!r&&!a){if((Bh(t)!==`body`||Jh(i))&&(s=og(t)),r){let e=hg(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l()}a&&!r&&i&&l();let u=i&&!r&&!a?_g(i,s):eh(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Og(e){return ag(e).position===`static`}function kg(e,t){if(!Gh(e)||ag(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Hh(e)===n&&(n=n.ownerDocument.body),n}function Ag(e,t){let n=Vh(e);if(Qh(e))return n;if(!Gh(e)){let t=sg(e);for(;t&&!ig(t);){if(Wh(t)&&!Og(t))return t;t=sg(t)}return n}let r=kg(e,t);for(;r&&Xh(r)&&Og(r);)r=kg(r,t);return r&&ig(r)&&Og(r)&&!ng(r)?n:r||eee(e)||n}var jg=async function(e){let t=this.getOffsetParent||Ag,n=this.getDimensions,r=await n(e.floating);return{reference:Dg(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Mg(e){return ag(e).direction===`rtl`}var Ng={convertOffsetParentRelativeRectToViewportRelativeRect:iee,getDocumentElement:Hh,getClippingRect:Tg,getOffsetParent:Ag,getElementRects:jg,getClientRects:aee,getDimensions:Eg,getScale:pg,isElement:Wh,isRTL:Mg};function Pg(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Fg(e,t){let n=null,r,i=Hh(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=$m(d),h=$m(i.clientWidth-(u+f)),g=$m(i.clientHeight-(d+p)),_=$m(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Zm(0,Xm(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!Pg(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function Ig(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=fg(e),u=i||a?[...l?lg(l):[],...lg(t)]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Fg(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),p.observe(t));let m,h=c?hg(e):null;c&&g();function g(){let t=hg(e);h&&!Pg(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Lg=Fh,Rg=Ih,zg=kh,Bg=Rh,Vg=Mh,Hg=Oh,Ug=Lh,Wg=(e,t,n)=>{let r=new Map,i={platform:Ng,...n},a={...i.platform,_c:r};return Eh(e,t,{...i,platform:a})},Gg=typeof document<`u`?f.useLayoutEffect:function(){};function Kg(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Kg(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Kg(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function qg(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Jg(e,t){let n=qg(e);return Math.round(t*n)/n}function Yg(e){let t=f.useRef(e);return Gg(()=>{t.current=e}),t}function Xg(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=f.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=f.useState(r);Kg(p,r)||m(r);let[h,g]=f.useState(null),[_,v]=f.useState(null),y=f.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=f.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||h,S=o||_,C=f.useRef(null),w=f.useRef(null),T=f.useRef(u),E=c!=null,D=Yg(c),O=Yg(i),k=Yg(l),A=f.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:p};O.current&&(e.platform=O.current),Wg(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!Kg(T.current,t)&&(T.current=t,_n.flushSync(()=>{d(t)}))})},[p,t,n,O,k]);Gg(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=f.useRef(!1);Gg(()=>(j.current=!0,()=>{j.current=!1}),[]),Gg(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=f.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=f.useMemo(()=>({reference:x,floating:S}),[x,S]),P=f.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=Jg(N.floating,u.x),r=Jg(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...qg(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return f.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var Zg=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Hg({element:r.current,padding:i}).fn(n):r?Hg({element:r,padding:i}).fn(n):{}}}},Qg=(e,t)=>({...Lg(e),options:[e,t]}),$g=(e,t)=>({...Rg(e),options:[e,t]}),e_=(e,t)=>({...Ug(e),options:[e,t]}),t_=(e,t)=>({...zg(e),options:[e,t]}),n_=(e,t)=>({...Bg(e),options:[e,t]}),r_=(e,t)=>({...Vg(e),options:[e,t]}),i_=(e,t)=>({...Zg(e),options:[e,t]}),a_=Object.defineProperty,o_=(e,t)=>a_(e,`name`,{value:t,configurable:!0}),s_={Partial:`partial`,Always:`always`},c_={Optimized:`optimized`,Always:`always`},l_=`Popper`,[u_,d_]=st(l_),[f_,p_]=u_(l_),m_=o_(e=>{let{__scopePopper:t,children:n}=e,[r,i]=f.useState(null),[a,o]=f.useState(void 0);return(0,H.jsx)(f_,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),h_=`PopperAnchor`,g_=f.forwardRef(o_(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=p_(h_,n),o=f.useRef(null),s=a.onAnchorChange,c=pt(t,f.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=f.useRef(null);f.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&S_(a.placementState),d=u?.[0],p=u?.[1];return r?null:(0,H.jsx)(bn.div,{"data-radix-popper-side":d,"data-radix-popper-align":p,...i,ref:c})},`PopperAnchor`)),__=`PopperContent`,[v_,see]=u_(__),y_=f.forwardRef(o_(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=s_.Partial,hideWhenDetached:p=!1,updatePositionStrategy:m=c_.Optimized,onPlaced:h,...g}=e,_=p_(__,n),[v,y]=f.useState(null),b=pt(t,y),[x,S]=f.useState(null),C=Su(x),w=C?.width??0,T=C?.height??0,E=r+(a===`center`?``:`-`+a),D=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(l)?l:[l],k=O.length>0,A={padding:D,boundary:O.filter(b_),altBoundary:k},{refs:j,floatingStyles:M,placement:N,isPositioned:P,middlewareData:F}=Xg({strategy:`fixed`,placement:E,whileElementsMounted:o_((...e)=>Ig(...e,{animationFrame:m===c_.Always}),`whileElementsMounted`),elements:{reference:_.anchor},middleware:[Qg({mainAxis:i+T,alignmentAxis:o}),c&&$g({mainAxis:!0,crossAxis:!1,...d===s_.Partial?{limiter:e_()}:{},...A}),c&&t_({...A}),n_({...A,apply:o_(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),x&&i_({element:x,padding:s}),x_({arrowWidth:w,arrowHeight:T}),p&&r_(k?{strategy:`referenceHidden`,...A}:{strategy:`referenceHidden`,padding:A.padding,altBoundary:A.altBoundary})]}),I=_.setPlacementState;Mt(()=>(I(N),()=>{I(void 0)}),[N,I]);let[L,R]=S_(N),z=Qn(h);Mt(()=>{P&&z?.()},[P,z]);let ee=F.arrow?.x,te=F.arrow?.y,ne=F.arrow?.centerOffset!==0,[re,ie]=f.useState();return Mt(()=>{v&&ie(window.getComputedStyle(v).zIndex)},[v]),(0,H.jsx)(`div`,{ref:j.setFloating,"data-radix-popper-content-wrapper":``,style:{...M,transform:P?M.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:re,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(` `),...F.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,H.jsx)(v_,{scope:n,placedSide:L,placedAlign:R,onArrowChange:S,arrowX:ee,arrowY:te,shouldHideArrow:ne,children:(0,H.jsx)(bn.div,{"data-side":L,"data-align":R,...g,ref:b,style:{...g.style,animation:P?g.style?.animation:`none`}})})})},`PopperContent`));function b_(e){return e!==null}o_(b_,`isNotNull`);var x_=o_(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=S_(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function S_(e){let[t,n=`center`]=e.split(`-`);return[t,n]}o_(S_,`getSideAndAlignFromPlacement`);var C_=Object.defineProperty,w_=(e,t)=>C_(e,`name`,{value:t,configurable:!0}),T_=`Popover`,[E_,cee]=st(T_,[d_]),D_=d_(),[O_,k_]=E_(T_),A_=w_(e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=D_(t),c=f.useRef(null),[l,u]=f.useState(!1),[d,p]=f.useState(0),[m,h]=f.useState(0),[g,_]=un({prop:r,defaultProp:i??!1,onChange:a,caller:T_});return(0,H.jsx)(m_,{...s,children:(0,H.jsx)(O_,{scope:t,contentId:Fn(),titleId:Fn(),descriptionId:Fn(),titlePresent:d>0,descriptionPresent:m>0,setTitleCount:p,setDescriptionCount:h,triggerRef:c,open:g,onOpenChange:_,onOpenToggle:f.useCallback(()=>_(e=>!e),[_]),hasCustomAnchor:l,onCustomAnchorAdd:f.useCallback(()=>u(!0),[]),onCustomAnchorRemove:f.useCallback(()=>u(!1),[]),modal:o,children:n})})},`Popover`),j_=`PopoverTrigger`,M_=f.forwardRef(w_(function(e,t){let{__scopePopover:n,...r}=e,i=k_(j_,n),a=D_(n),o=pt(t,i.triggerRef),s=(0,H.jsx)(bn.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":V_(i.open),...r,ref:o,onClick:Xt(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,H.jsx)(g_,{asChild:!0,...a,children:s})},`PopoverTrigger`)),N_=`PopoverPortal`,[P_,F_]=E_(N_,{forceMount:void 0}),I_=w_(e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=k_(N_,t);return(0,H.jsx)(P_,{scope:t,forceMount:n,children:(0,H.jsx)(Tn,{present:n||a.open,children:(0,H.jsx)(Fr,{asChild:!0,container:i,children:r})})})},`PopoverPortal`),L_=`PopoverContent`,R_=f.forwardRef(w_(function(e,t){let n=F_(L_,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=k_(L_,e.__scopePopover);return(0,H.jsx)(Tn,{present:r||a.open,children:a.modal?(0,H.jsx)(lee,{...i,ref:t}):(0,H.jsx)(uee,{...i,ref:t})})},`PopoverContent`)),z_=gt(`PopoverContent.RemoveScroll`),lee=f.forwardRef(w_(function(e,t){let n=k_(L_,e.__scopePopover),r=f.useRef(null),i=pt(t,r),a=f.useRef(!1),{nodes:o,registry:s}=xr();return f.useEffect(()=>{let e=r.current;if(e)return aa(e)},[]),(0,H.jsx)(Xi,{as:z_,allowPinchZoom:!0,shards:f.useMemo(()=>[r,...o.map(e=>({current:e}))],[r,o]),children:(0,H.jsx)(B_,{...e,ref:i,branchNodes:o,branchRegistry:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Xt(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Xt(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;a.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:Xt(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),uee=f.forwardRef(w_(function(e,t){let n=k_(L_,e.__scopePopover),r=f.useRef(!1),i=f.useRef(!1);return(0,H.jsx)(B_,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`PopoverContentNonModal`)),B_=f.forwardRef(w_(function(e,t){let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,"aria-describedby":d,branchNodes:p,branchRegistry:m,...h}=e,g=k_(L_,n),_=D_(n),[v,y]=f.useState(null),b=pt(t,y);return Sr(v),Vr(),(0,H.jsx)(br,{registry:m,children:(0,H.jsx)(vr,{asChild:!0,loop:!0,trapped:r,branches:p,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,H.jsx)(or,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>g.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,H.jsx)(y_,{"data-state":V_(g.open),role:`dialog`,id:g.contentId,"aria-labelledby":g.titlePresent?g.titleId:void 0,"aria-describedby":g.descriptionPresent?H_(d,g.descriptionId):d,..._,...h,ref:b,style:{...h.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)`}})})})})},`PopoverContentImpl`));function V_(e){return e?`open`:`closed`}w_(V_,`getState`);function H_(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}w_(H_,`concatAriaDescribedby`);function U_({...e}){return(0,H.jsx)(A_,{"data-slot":`popover`,...e})}function W_({...e}){return(0,H.jsx)(M_,{"data-slot":`popover-trigger`,...e})}function G_({className:e,align:t=`center`,sideOffset:n=4,...r}){let i=Gn();return(0,H.jsx)(I_,{container:i,children:(0,H.jsx)(R_,{"data-slot":`popover-content`,align:t,sideOffset:n,className:V(`bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden`,e),...r})})}var K_=(0,f.forwardRef)(({title:e,titleId:t,...n},r)=>(0,H.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,H.jsx)(`title`,{id:t,children:e}):null,(0,H.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,H.jsx)(`circle`,{cx:12,cy:12,r:10}),(0,H.jsx)(`path`,{d:`m15 9l-6 6m0-6l6 6`})]})]})),dee=0;function q_(e,t){let n=`atom${++dee}`,r={toString(){return n}};return typeof e==`function`?r.read=e:(r.init=e,r.read=fee,r.write=pee),t&&(r.write=t),r}function fee(e){return e(this)}function pee(e,t,n){return t(this,typeof n==`function`?n(e(this)):n)}function J_(e){return`init`in e}function mee(e){return typeof e.write==`function`}function hee(e){return!!e.onMount}function Y_(e){return`v`in e||`e`in e}function X_(e){if(`e`in e)throw e.e;return e.v}function Z_(e){return typeof e?.then==`function`}function gee(e){if(!(e instanceof Error))return!1;let t=e.name,n=e.message.toLowerCase();return(t===`RangeError`||t===`InternalError`)&&(n.includes(`call stack`)||n.includes(`too much recursion`)||n.includes(`stack overflow`))}function Q_(e,t,n){if(!n.p.has(e)){n.p.add(e);let r=()=>n.p.delete(e);t.then(r,r)}}function $_(e,t,n){let r=n.get(e)?.t,i=t.p;if(!r?.size)return i;if(!i.size)return r;let a=new Set(r);for(let e of i)a.add(e);return a}function _ee(e){return!!e.INTERNAL_onInit}var vee=(e,t,n,...r)=>n.read(...r),yee=(e,t,n,...r)=>n.write(...r),bee=(e,t,n)=>n.INTERNAL_onInit(t),xee=(e,t,n,r)=>n.onMount?.(r),See=(e,t,n)=>{let r=e.a,i=r.get(n);if(!i){let a=e.h,o=e.I;i={d:new Map,p:new Set,n:0},r.set(n,i),a.i?.(n),_ee(n)&&o(e,t,n)}return i},Cee=(e,t)=>{let n=e.m,r=e.c,i=e.q,a=e.Q,o=e.h,s=e.C;if(!o.f&&!r.size&&!i.size&&!a.size)return;let c=[],l=e=>{try{e()}catch(e){c.push(e)}};do{o.f&&l(o.f);let c=new Set;for(let e of r){let t=n.get(e)?.l;if(t)for(let e of t)c.add(e)}r.clear();for(let e of a)c.add(e);a.clear();for(let e of i)c.add(e);i.clear();for(let e of c)l(e);r.size&&s(e,t)}while(r.size||a.size||i.size);if(c.length)throw typeof AggregateError==`function`?AggregateError(c):Object.assign(Error(),{errors:c})},wee=(e,t)=>{let n=e.m,r=e.i,i=e.c,a=e.e,o=e.r,s=e.D;if(!i.size)return;let c=[],l=[],u=new WeakSet,d=new WeakSet,f=[],p=[];for(let n of i)f.push(n),p.push(a(e,t,n));for(;f.length;){let i=f.length-1,o=f[i],s=p[i];if(d.has(o))f.pop(),p.pop();else if(u.has(o))r.get(o)===s.n&&(c.push(o),l.push(s)),d.add(o),f.pop(),p.pop();else{u.add(o);for(let r of $_(o,s,n))u.has(r)||(f.push(r),p.push(a(e,t,r)))}}for(let n=c.length-1;n>=0;--n){let a=c[n],u=l[n],d=!1;for(let e of u.d.keys())if(e!==a&&i.has(e)){d=!0;break}d&&(r.set(a,u.n),o(e,t,a),s(e,t,a)),r.delete(a)}},Tee=(e,t,n)=>{let r=e.m,i=e.i,a=e.c,o=e.h,s=e.R,c=e.e,l=e.f,u=e.C,d=e.r,f=e.D,p=e.v,m=e.H,h=e.E,g=c(e,t,n),_=h[0];if(Y_(g)){if(r.has(n)&&i.get(n)!==g.n||g.m===_)return g.m=_,g;let a=!1;for(let[n,r]of g.d)if(d(e,t,n).n!==r){a=!0;break}if(!a)return g.m=_,g}let v=!0,y=new Set(g.d.keys()),b=()=>{for(let e of y)g.d.delete(e)},x=()=>{if(r.has(n)){let r=!a.size;f(e,t,n),r&&(u(e,t),l(e,t))}},S=i=>{if(i===n){let n=c(e,t,i);if(!Y_(n)){if(J_(i))p(e,t,i,i.init);else throw Error(`no atom init`)}return X_(n)}let a=d(e,t,i);try{return X_(a)}finally{y.delete(i),g.d.set(i,a.n),Z_(g.v)&&Q_(n,g.v,a),r.has(n)&&r.get(i)?.t.add(n),v||x()}},C,w={get signal(){return C||=new AbortController,C.signal}},T=g.n,E=i.get(n)===T;try{let r=s(e,t,n,S,w);if(p(e,t,n,r),Z_(r)){m(e,t,r,()=>C?.abort());let n=()=>{b(),x()};r.then(n,n)}else b();return o.r?.(n),g.m=_,g}catch(e){if(gee(e))throw e;return delete g.v,g.e=e,++g.n,g.m=_,g}finally{v=!1,g.n!==T&&E&&(i.set(n,g.n),a.add(n),o.c?.(n))}},Eee=(e,t,n)=>{let r=e.m,i=e.i,a=e.e,o=[n];for(;o.length;){let n=o.pop(),s=a(e,t,n);for(let c of $_(n,s,r)){let n=a(e,t,c);i.get(c)!==n.n&&(i.set(c,n.n),o.push(c))}}},Dee=(e,t,n,r)=>{let i=e.c,a=e.h,o=e.W,s=e.e,c=e.f,l=e.C,u=e.r,d=e.d,f=e.w,p=e.D,m=e.v,h=e.E,g=!0,_=n=>X_(u(e,t,n)),v=(r,...o)=>{let u=s(e,t,r);try{if(r===n){if(!J_(r))throw Error(`atom not writable`);let n=u.n,s=o[0];m(e,t,r,s),p(e,t,r),n!==u.n&&(++h[0],i.add(r),d(e,t,r),a.c?.(r));return}return f(e,t,r,o)}finally{g||(l(e,t),c(e,t))}};try{return o(e,t,n,_,v,...r)}finally{g=!1}},Oee=(e,t,n)=>{let r=e.m,i=e.c,a=e.h,o=e.e,s=e.d,c=e.t,l=e.T,u=o(e,t,n),d=r.get(n);if(d&&u.d.size>0){for(let[r,l]of u.d)if(!d.d.has(r)){let u=o(e,t,r);c(e,t,r).t.add(n),d.d.add(r),l!==u.n&&(i.add(r),s(e,t,r),a.c?.(r))}for(let r of d.d)u.d.has(r)||(d.d.delete(r),l(e,t,r)?.t.delete(n))}},kee=(e,t,n)=>{let r=e.m,i=e.q,a=e.h,o=e.M,s=e.e,c=e.f,l=e.C,u=e.r,d=e.w,f=e.t,p=s(e,t,n),m=r.get(n);if(!m){u(e,t,n);for(let r of p.d.keys())f(e,t,r).t.add(n);m={l:new Set,d:new Set(p.d.keys()),t:new Set},r.set(n,m),mee(n)&&hee(n)&&i.add(()=>{let r=!0,i=(...i)=>{try{return d(e,t,n,i)}finally{r||(l(e,t),c(e,t))}};try{let a=o(e,t,n,i);a&&(m.u=()=>{r=!0;try{a()}finally{r=!1}})}finally{r=!1}}),a.m?.(n)}return m},Aee=(e,t,n)=>{let r=e.m,i=e.Q,a=e.h,o=e.e,s=e.T,c=o(e,t,n),l=r.get(n);if(!l||l.l.size)return l;let u=!1;for(let e of l.t)if(r.get(e)?.d.has(n)){u=!0;break}if(u)return l;l.u&&i.add(l.u),l=void 0,r.delete(n);for(let r of c.d.keys())s(e,t,r)?.t.delete(n);a.u?.(n)},jee=(e,t,n,r)=>{let i=e.e,a=e.A,o=i(e,t,n),s=`v`in o,c=o.v;if(Z_(r))for(let a of o.d.keys())Q_(n,r,i(e,t,a));o.v=r,delete o.e,s&&Object.is(c,o.v)||(++o.n,Z_(c)&&a(e,t,c))},Mee=(e,t,n)=>{let r=e.r;return X_(r(e,t,n))},Nee=(e,t,n,...r)=>{let i=e.c,a=e.f,o=e.C,s=e.w,c=i.size;try{return s(e,t,n,r)}finally{i.size!==c&&(o(e,t),a(e,t))}},Pee=(e,t,n,r)=>{let i=e.f,a=e.C,o=e.t,s=e.T,c=o(e,t,n).l;return c.add(r),a(e,t),i(e,t),()=>{c.delete(r),s(e,t,n),a(e,t),i(e,t)}},Fee=(e,t,n,r)=>{let i=e.p,a=i.get(n);if(!a){a=new Set,i.set(n,a);let e=()=>i.delete(n);n.then(e,e)}a.add(r)},Iee=(e,t,n)=>{e.p.get(n)?.forEach(e=>e())},ev=new WeakMap;function Lee(e){let t=ev.get(e),n=t.B;return n?n(t,e):t}function Ree(e){let t={get(e){return r(n,t,e)},set(e,...r){return i(n,t,e,...r)},sub(e,r){return a(n,t,e,r)}},n=Object.freeze({a:new WeakMap,m:new WeakMap,i:new WeakMap,c:new Set,q:new Set,Q:new Set,h:{},R:vee,W:yee,I:bee,M:xee,e:See,f:Cee,C:wee,r:Tee,d:Eee,w:Dee,D:Oee,t:kee,T:Aee,v:jee,g:Mee,s:Nee,b:Pee,B:void 0,p:new WeakMap,H:Fee,A:Iee,E:[0],...e});ev.set(t,n);let r=n.g,i=n.s,a=n.b;return t}function zee(){return Ree()}var tv;function Bee(){return tv||=zee(),tv}var Vee=(0,f.createContext)(void 0);function nv(e){let t=(0,f.useContext)(Vee);return e?.store||t||Bee()}var rv=e=>typeof e?.then==`function`,iv=new WeakMap,Hee=(e,t,n)=>{let r=Lee(e),i=r.H,a=iv.get(t);return a||(a=new Promise((o,s)=>{let c=t,l=e=>t=>{c===e&&o(t)},u=e=>t=>{c===e&&s(t)},d=()=>{try{let t=n();rv(t)?(iv.set(t,a),c=t,t.then(l(t),u(t)),i(r,e,t,d)):o(t)}catch(e){s(e)}};t.then(l(t),u(t)),i(r,e,t,d)}),iv.set(t,a)),a},av=(e,t,n)=>[n,e,t,r=>{let i=e.sub(t,r),a=!0;try{a=!Object.is(n,e.get(t))}catch{}return a&&r(),i}];function Uee(e,t){let n=nv(t),[[r,i,a,o],s]=(0,f.useReducer)(t=>{let r=n.get(e);return t[1]===n&&t[2]===e?Object.is(t[0],r)?t:[r,n,e,t[3]]:av(n,e,r)},void 0,()=>av(n,e,n.get(e))),c=r;return(i!==n||a!==e)&&(s(),c=n.get(e)),(0,f.useEffect)(()=>o(s),[o]),(0,f.useDebugValue)(c),rv(c)?Hee(n,c,()=>n.get(e)):c}var ov=e=>{e.status||(e.status=`pending`,e.then(t=>{e.status=`fulfilled`,e.value=t},t=>{e.status=`rejected`,e.reason=t}))},Wee=f.use||(e=>{if(e.status===`pending`)throw e;if(e.status===`fulfilled`)return e.value;throw e.status===`rejected`?e.reason:(ov(e),e)});function sv(e,t){let{unstable_promiseStatus:n=!f.use}=t||{},r=Uee(e,t);return rv(r)?(n&&ov(r),Wee(r)):r}function cv(e,t){let n=nv(t);return(0,f.useCallback)((...t)=>n.set(e,...t),[n,e])}function Gee(e,t){return[sv(e,t),cv(e,t)]}var Kee=q_({open:!1,reactNode:null});function qee({className:e}){let[t,n]=Gee(Kee),{open:r,reactNode:i,title:a,description:o,className:s,onControlledOpen:c,onControlledClose:l}=t,u=()=>{l&&l(),n({open:!1,reactNode:null})};return(0,f.useEffect)(()=>{r&&c&&c()},[r]),(0,H.jsx)(bp,{open:r,onOpenChange:e=>{e||u()},children:(0,H.jsxs)(Cp,{className:V(`max-w-4xl`,s,e),children:[(0,H.jsxs)(wp,{children:[(0,H.jsx)(Ep,{className:a?void 0:`sr-only`,children:a||`Modal`}),(0,H.jsx)(Dp,{className:o?void 0:`sr-only`,children:o||`Modal content`})]}),i]})})}var Jee=(0,f.forwardRef)(({title:e,titleId:t,...n},r)=>(0,H.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,H.jsx)(`title`,{id:t,children:e}):null,(0,H.jsx)(`circle`,{cx:12,cy:12,r:10,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2})]})),Yee=Object.defineProperty,lv=(e,t)=>Yee(e,`name`,{value:t,configurable:!0}),uv=!1;function dv(){let[e,t]=f.useState(uv);return f.useEffect(()=>{uv||(uv=!0,t(!0))},[]),e}lv(dv,`useIsHydrated`);var fv=f.useSyncExternalStore;function pv(){return()=>{}}lv(pv,`subscribe`);function mv(){return fv(pv,()=>!0,()=>!1)}lv(mv,`useIsHydratedModern`);var Xee=typeof fv==`function`?mv:dv,hv=Object.defineProperty,gv=(e,t)=>hv(e,`name`,{value:t,configurable:!0}),_v=`rovingFocusGroup.onEntryFocus`,vv={bubbles:!1,cancelable:!0},yv=`RovingFocusGroup`,[bv,xv,Sv]=Ft(yv),[Cv,wv]=st(yv,[Sv]),Tv={Vertical:`vertical`,Horizontal:`horizontal`},Zee={LTR:`ltr`,RTL:`rtl`},[Qee,$ee]=Cv(yv),Ev=f.forwardRef(gv(function(e,t){return(0,H.jsx)(bv.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,H.jsx)(bv.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,H.jsx)(Dv,{...e,ref:t})})})},`RovingFocusGroup`)),Dv=f.forwardRef(gv(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,p=f.useRef(null),m=pt(t,p),h=Bn(a),[g,_]=un({prop:o,defaultProp:s??null,onChange:c,caller:yv}),[v,y]=f.useState(!1),b=Qn(l),x=xv(n),S=f.useRef(!1),[C,w]=f.useState(0);return f.useEffect(()=>{let e=p.current;if(e)return e.addEventListener(_v,b),()=>e.removeEventListener(_v,b)},[b]),(0,H.jsx)(Qee,{scope:n,orientation:r,dir:h,loop:i,currentTabStopId:g,onItemFocus:f.useCallback(e=>_(e),[_]),onItemShiftTab:f.useCallback(()=>y(!0),[]),onFocusableItemAdd:f.useCallback(()=>w(e=>e+1),[]),onFocusableItemRemove:f.useCallback(()=>w(e=>e-1),[]),children:(0,H.jsx)(bn.div,{tabIndex:v||C===0?-1:0,"data-orientation":r,...d,ref:m,style:{outline:`none`,...e.style},onMouseDown:Xt(e.onMouseDown,()=>{S.current=!0}),onFocus:Xt(e.onFocus,e=>{let t=!S.current;if(e.target===e.currentTarget&&t&&!v){let t=new CustomEvent(_v,vv);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);Nv([e.find(e=>e.active),e.find(e=>e.id===g),...e].filter(Boolean).map(e=>e.ref.current),u)}}S.current=!1}),onBlur:Xt(e.onBlur,()=>y(!1))})})},`RovingFocusGroupImpl`)),Ov=`RovingFocusGroupItem`,kv=f.forwardRef(gv(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=Fn(),l=a||c,u=$ee(Ov,n),d=u.currentTabStopId===l,p=xv(n),{onFocusableItemAdd:m,onFocusableItemRemove:h,currentTabStopId:g}=u,_=Xee();return Mt(()=>{if(_&&r)return m(),()=>h()},[_,r,m,h]),f.useEffect(()=>{if(!_&&r)return m(),()=>h()},[_,r,m,h]),(0,H.jsx)(bv.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,H.jsx)(bn.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:Xt(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:Xt(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:Xt(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Mv(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=p().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?Pv(n,r+1):n.slice(r+1)}setTimeout(()=>Nv(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:g!=null}):o})})},`RovingFocusGroupItem`)),Av={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function jv(e,t){return t===Zee.RTL?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}gv(jv,`getDirectionAwareKey`);function Mv(e,t,n){let r=jv(e.key,n);if(!(t===Tv.Vertical&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===Tv.Horizontal&&[`ArrowUp`,`ArrowDown`].includes(r)))return Av[r]}gv(Mv,`getFocusIntent`);function Nv(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}gv(Nv,`focusFirst`);function Pv(e,t){return e.map((n,r)=>e[(t+r)%e.length])}gv(Pv,`wrapArray`);var ete=Object.defineProperty,Fv=(e,t)=>ete(e,`name`,{value:t,configurable:!0}),tte={LTR:`ltr`,RTL:`rtl`},Iv=[`Enter`,` `],nte=[`ArrowDown`,`PageUp`,`Home`],Lv=[`ArrowUp`,`PageDown`,`End`],rte=[...nte,...Lv],ite={ltr:[...Iv,`ArrowRight`],rtl:[...Iv,`ArrowLeft`]},ate={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},Rv=`Menu`,[zv,ote,ste]=Ft(Rv),[Bv,Vv]=st(Rv,[ste,d_,wv]),Hv=d_(),Uv=wv(),[cte,Wv]=Bv(Rv),[lte,Gv]=Bv(Rv),ute=Fv(e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=Hv(t),[c,l]=f.useState(null),u=f.useRef(!1),d=Qn(a),p=Bn(i);return f.useEffect(()=>{let e=Fv(()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},`handleKeyDown`),t=Fv(()=>u.current=!1,`handlePointer`);return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),f.useEffect(()=>{if(!n)return;let e=Fv(()=>d(!1),`handleBlur`);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,d]),(0,H.jsx)(m_,{...s,children:(0,H.jsx)(cte,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,H.jsx)(lte,{scope:t,onClose:f.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:p,modal:o,children:r})})})},`Menu`),Kv=f.forwardRef(Fv(function(e,t){let{__scopeMenu:n,...r}=e,i=Hv(n);return(0,H.jsx)(g_,{...i,...r,ref:t})},`MenuAnchor`)),qv=`MenuPortal`,[Jv,Yv]=Bv(qv,{forceMount:void 0}),Xv=Fv(e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=Wv(qv,t);return(0,H.jsx)(Jv,{scope:t,forceMount:n,children:(0,H.jsx)(Tn,{present:n||a.open,children:(0,H.jsx)(Fr,{asChild:!0,container:i,children:r})})})},`MenuPortal`),Zv=`MenuContent`,[Qv,$v]=Bv(Zv),ey=f.forwardRef(Fv(function(e,t){let n=Yv(Zv,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Wv(Zv,e.__scopeMenu),o=Gv(Zv,e.__scopeMenu);return(0,H.jsx)(zv.Provider,{scope:e.__scopeMenu,children:(0,H.jsx)(Tn,{present:r||a.open,children:(0,H.jsx)(zv.Slot,{scope:e.__scopeMenu,children:o.modal?(0,H.jsx)(ty,{...i,ref:t}):(0,H.jsx)(ny,{...i,ref:t})})})})},`MenuContent`)),ty=f.forwardRef(Fv(function(e,t){let n=Wv(Zv,e.__scopeMenu),r=f.useRef(null),i=pt(t,r);return f.useEffect(()=>{let e=r.current;if(e)return aa(e)},[]),(0,H.jsx)(iy,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Xt(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentModal`)),ny=f.forwardRef(Fv(function(e,t){let n=Wv(Zv,e.__scopeMenu);return(0,H.jsx)(iy,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentNonModal`)),ry=gt(`MenuContent.ScrollLock`),iy=f.forwardRef(Fv(function(e,t){let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:p,onDismiss:m,disableOutsideScroll:h,...g}=e,_=Wv(Zv,n),v=Gv(Zv,n),y=Hv(n),b=Uv(n),x=ote(n),[S,C]=f.useState(null),w=f.useRef(null),[T,E]=f.useState(null);Sr(T);let{nodes:D,registry:O}=xr(),k=!!(i||h),A=pt(t,w,_.onContentChange,E),j=f.useRef(0),M=f.useRef(``),N=f.useRef(0),P=f.useRef(null),F=f.useRef(`right`),I=f.useRef(0),L=f.useMemo(()=>h?[w,...D.map(e=>({current:e}))]:[],[w,D,h]),R=h?Xi:f.Fragment,z=h?{as:ry,allowPinchZoom:!0,shards:L}:void 0,ee=Fv(e=>{let t=M.current+e,n=x().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=by(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;function s(e){M.current=e,window.clearTimeout(j.current),e!==``&&(j.current=window.setTimeout(()=>s(``),1e3))}Fv(s,`updateSearch`),s(t),o&&setTimeout(()=>o.focus())},`handleTypeaheadSearch`);f.useEffect(()=>()=>window.clearTimeout(j.current),[]),Vr();let te=f.useCallback(e=>F.current===P.current?.side&&Sy(e,P.current?.area),[]);return(0,H.jsx)(Qv,{scope:n,searchRef:M,onItemEnter:f.useCallback(e=>{te(e)&&e.preventDefault()},[te]),onItemLeave:f.useCallback(e=>{te(e)||(w.current?.focus(),C(null))},[te]),onTriggerLeave:f.useCallback(e=>{te(e)&&e.preventDefault()},[te]),pointerGraceTimerRef:N,onPointerGraceIntentChange:f.useCallback(e=>{P.current=e},[]),children:(0,H.jsx)(br,{registry:k?O:null,children:(0,H.jsx)(R,{...z,children:(0,H.jsx)(vr,{asChild:!0,trapped:i,branches:D,onMountAutoFocus:Xt(a,e=>{e.preventDefault(),w.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,H.jsx)(or,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:p,onDismiss:m,children:(0,H.jsx)(Ev,{asChild:!0,...b,dir:v.dir,orientation:`vertical`,loop:r,currentTabStopId:S,onCurrentTabStopIdChange:C,onEntryFocus:Xt(c,e=>{v.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,H.jsx)(y_,{role:`menu`,"aria-orientation":`vertical`,"data-state":hy(_.open),"data-radix-menu-content":``,dir:v.dir,...y,...g,ref:A,style:{outline:`none`,...g.style},onKeyDown:Xt(g.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&ee(e.key));let i=w.current;if(e.target!==i||!rte.includes(e.key))return;e.preventDefault();let a=x().filter(e=>!e.disabled).map(e=>e.ref.current);Lv.includes(e.key)&&a.reverse(),vy(a)}),onBlur:Xt(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(j.current),M.current=``)}),onPointerMove:Xt(e.onPointerMove,Cy(e=>{let t=e.target,n=I.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>I.current?`right`:`left`;F.current=t,I.current=e.clientX}}))})})})})})})})},`MenuContentImpl`)),ay=f.forwardRef(Fv(function(e,t){let{__scopeMenu:n,...r}=e;return(0,H.jsx)(bn.div,{...r,ref:t})},`MenuLabel`)),oy=`MenuItem`,sy=`menu.itemSelect`,cy=f.forwardRef(Fv(function(e,t){let{disabled:n=!1,onSelect:r,...i}=e,a=f.useRef(null),o=Gv(oy,e.__scopeMenu),s=$v(oy,e.__scopeMenu),c=pt(t,a),l=f.useRef(!1),u=Fv(()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(sy,{bubbles:!0,cancelable:!0});e.addEventListener(sy,e=>r?.(e),{once:!0}),xn(e,t),t.defaultPrevented?l.current=!1:o.onClose()}},`handleSelect`);return(0,H.jsx)(ly,{...i,ref:c,disabled:n,onClick:Xt(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:Xt(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:Xt(e.onKeyDown,e=>{n||e.target!==e.currentTarget||(s.searchRef.current===``||e.key!==` `)&&Iv.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},`MenuItem`)),ly=f.forwardRef(Fv(function(e,t){let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=$v(oy,n),s=Uv(n),c=f.useRef(null),l=pt(t,c),[u,d]=f.useState(!1),[p,m]=f.useState(``);return f.useEffect(()=>{let e=c.current;e&&m((e.textContent??``).trim())},[a.children]),(0,H.jsx)(zv.ItemSlot,{scope:n,disabled:r,textValue:i??p,children:(0,H.jsx)(kv,{asChild:!0,...s,focusable:!r,children:(0,H.jsx)(bn.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:Xt(e.onPointerMove,Cy(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Xt(e.onPointerLeave,Cy(e=>o.onItemLeave(e))),onFocus:Xt(e.onFocus,()=>d(!0)),onBlur:Xt(e.onBlur,()=>d(!1))})})})},`MenuItemImpl`)),uy=f.forwardRef(Fv(function(e,t){let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,H.jsx)(fy,{scope:e.__scopeMenu,checked:n,children:(0,H.jsx)(cy,{role:`menuitemcheckbox`,"aria-checked":gy(n)?`mixed`:n,...i,ref:t,"data-state":_y(n),onSelect:Xt(i.onSelect,()=>r?.(gy(n)?!0:!n),{checkForDefaultPrevented:!1})})})},`MenuCheckboxItem`)),[dte,fte]=Bv(`MenuRadioGroup`,{value:void 0,onValueChange:Fv(()=>{},`onValueChange`)}),pte=`MenuRadioItem`,mte=f.forwardRef(Fv(function(e,t){let{value:n,...r}=e,i=fte(pte,e.__scopeMenu),a=n===i.value;return(0,H.jsx)(fy,{scope:e.__scopeMenu,checked:a,children:(0,H.jsx)(cy,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":_y(a),onSelect:Xt(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})},`MenuRadioItem`)),dy=`MenuItemIndicator`,[fy,hte]=Bv(dy,{checked:!1}),gte=f.forwardRef(Fv(function(e,t){let{__scopeMenu:n,forceMount:r,...i}=e,a=hte(dy,n);return(0,H.jsx)(Tn,{present:r||gy(a.checked)||a.checked===!0,children:(0,H.jsx)(bn.span,{...i,ref:t,"data-state":_y(a.checked)})})},`MenuItemIndicator`)),_te=f.forwardRef(Fv(function(e,t){let{__scopeMenu:n,...r}=e;return(0,H.jsx)(bn.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})},`MenuSeparator`)),[vte,py]=Bv(`MenuSub`),my=`MenuSubTrigger`,yte=f.forwardRef(Fv(function(e,t){let n=Wv(my,e.__scopeMenu),r=Gv(my,e.__scopeMenu),i=py(my,e.__scopeMenu),a=$v(my,e.__scopeMenu),o=f.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=f.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);f.useEffect(()=>u,[u]),f.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]);let d=pt(t,i.onTriggerChange);return(0,H.jsx)(Kv,{asChild:!0,...l,children:(0,H.jsx)(ly,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":n.open?i.contentId:void 0,"data-state":hy(n.open),...e,ref:d,onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Xt(e.onPointerMove,Cy(t=>{a.onItemEnter(t),t.defaultPrevented||e.disabled||n.open||o.current||(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:Xt(e.onPointerLeave,Cy(e=>{u();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:Xt(e.onKeyDown,t=>{e.disabled||t.target!==t.currentTarget||(a.searchRef.current===``||t.key!==` `)&&ite[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})},`MenuSubTrigger`)),bte=`MenuSubContent`,xte=f.forwardRef(Fv(function(e,t){let n=Yv(Zv,e.__scopeMenu),{forceMount:r=n.forceMount,align:i=`start`,...a}=e,o=Wv(Zv,e.__scopeMenu),s=Gv(Zv,e.__scopeMenu),c=py(bte,e.__scopeMenu),l=f.useRef(null),u=pt(t,l);return(0,H.jsx)(zv.Provider,{scope:e.__scopeMenu,children:(0,H.jsx)(Tn,{present:r||o.open,children:(0,H.jsx)(zv.Slot,{scope:e.__scopeMenu,children:(0,H.jsx)(iy,{id:c.contentId,"aria-labelledby":c.triggerId,...a,ref:u,align:i,side:s.dir===tte.RTL?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{s.isUsingKeyboardRef.current&&l.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:Xt(e.onFocusOutside,e=>{e.target!==c.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Xt(e.onEscapeKeyDown,e=>{s.onClose(),e.preventDefault()}),onKeyDown:Xt(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=ate[s.dir].includes(e.key);t&&n&&(o.onOpenChange(!1),c.trigger?.focus(),e.preventDefault())})})})})})},`MenuSubContent`));function hy(e){return e?`open`:`closed`}Fv(hy,`getOpenState`);function gy(e){return e===`indeterminate`}Fv(gy,`isIndeterminate`);function _y(e){return gy(e)?`indeterminate`:e?`checked`:`unchecked`}Fv(_y,`getCheckedState`);function vy(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}Fv(vy,`focusFirst`);function yy(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Fv(yy,`wrapArray`);function by(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=yy(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}Fv(by,`getNextMatch`);function xy(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}Fv(xy,`isPointInPolygon`);function Sy(e,t){return t?xy({x:e.clientX,y:e.clientY},t):!1}Fv(Sy,`isPointerInGraceArea`);function Cy(e){return t=>t.pointerType===`mouse`?e(t):void 0}Fv(Cy,`whenMouse`);function wy(e,t){let n=Object.create(null);return e.forEach((e,r)=>{let i=t(e,r);n[i]||(n[i]=[]),n[i].push(e)}),n}function Ty(e,t){if(t){let n=new Set;return e.reduce((e,r)=>{let i=t(r);return n.has(i)||(n.add(i),e.push(r)),e},[])}return[...new Set(e)]}function Ste(e){if(Oy(e))return e;if(typeof e==`function`)return e.bind({});let t=Object.getPrototypeOf(e),n=typeof t?.constructor==`function`?new t.constructor:Object.create(t);for(let t of Object.getOwnPropertyNames(e))n[t]=e[t];return n}function Ey(e,t,n){let r=t.split(/[\.\[\]]/g),i=e;for(let e of r){if(i==null)return n;let t=e.replace(/['"]/g,``);t.trim()!==``&&(i=i[t])}return i===void 0?n:i}function Cte(e,t){return!(t&&!Object.getPrototypeOf(t))&&(e===`__proto__`||e===`prototype`||e===`constructor`)}function wte(e,t,n){return e?!t||n===void 0?e:(function e(t,r,i){let a=r[i];if(t??=Ete(a)?[]:{},Cte(a,t))throw Error(`Unsafe key in path: `+a);return i<r.length-1&&(n=e(t[a],r,i+1)),Object.is(t[a],n)||(t=Ste(t),t[a]=n),t})(e,t.match(/[^.[\]]+/g),0):{}}new Map(Object.entries({Æ:`Ae`,Ð:`D`,Ø:`O`,Þ:`Th`,ß:`ss`,æ:`ae`,ð:`d`,ø:`o`,þ:`th`,Đ:`D`,đ:`d`,Ħ:`H`,ħ:`h`,ı:`i`,IJ:`IJ`,ij:`ij`,ĸ:`k`,Ŀ:`L`,ŀ:`l`,Ł:`L`,ł:`l`,ʼn:`'n`,Ŋ:`N`,ŋ:`n`,Œ:`Oe`,œ:`oe`,Ŧ:`T`,ŧ:`t`,ſ:`s`}));function Tte(e){return typeof e==`function`}function Ete(e){if(!ky(e))return!1;let t=+e;return Number.isInteger(t)&&`${t}`===e}function Dy(e){return Ay(e,`[object Object]`)}function Oy(e){return e==null||typeof e!=`object`&&typeof e!=`function`}function ky(e){return typeof e==`string`}function Ay(e,t){return Object.prototype.toString.call(e)===t}var jy=f.forwardRef(({className:e,type:t,onValueChange:n,onChange:r,clearable:i=!1,...a},o)=>{let s=f.useRef(null),c=f.useCallback(e=>{s.current=e,Tte(o)?o(e):o&&(o.current=e)},[o]),l=a.value!==void 0,[u,d]=f.useState(()=>String(a.defaultValue??``).length>0),p=l?String(a.value??``).length>0:u,m=e=>{l||d(e.target.value.length>0),n?.(e.target.value),r?.(e)},h=()=>{let e=s.current;e&&((Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,`value`)?.set)?.call(e,``),e.dispatchEvent(new Event(`input`,{bubbles:!0})),e.focus()),l||d(!1)},g=i&&p&&!a.disabled&&!a.readOnly,_=(0,H.jsx)(`input`,{type:t,"data-slot":`input`,className:V(`file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border px-3 py-1 text-base bg-input-background transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,`focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]`,`aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive`,i&&`pr-8`,e),ref:c,...a,onChange:m});return i?(0,H.jsxs)(`div`,{className:`relative w-full`,children:[_,g&&(0,H.jsx)(`button`,{type:`button`,tabIndex:-1,"aria-label":`Clear`,onMouseDown:e=>e.preventDefault(),onClick:h,className:`absolute right-2 top-1/2 -translate-y-1/2 flex items-center justify-center text-muted-foreground opacity-60 hover:opacity-100 transition-opacity cursor-pointer`,children:(0,H.jsx)(yp,{className:`h-4 w-4`})})]}):_});jy.displayName=`Input`;var My=(0,f.forwardRef)(({title:e,titleId:t,...n},r)=>(0,H.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,H.jsx)(`title`,{id:t,children:e}):null,(0,H.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,H.jsx)(`path`,{d:`M8 2v3m8-3v3`}),(0,H.jsx)(`rect`,{width:18,height:18,x:3,y:3,rx:2}),(0,H.jsx)(`path`,{d:`M3 9h18`})]})]}));function Ny({value:e,onValueChange:t,placeholder:n,disabled:r=!1,className:i}){let{SD:a}=vp(),o=n??a(`rc.datePicker.pickDate`);return(0,H.jsxs)(U_,{children:[(0,H.jsx)(W_,{asChild:!0,children:(0,H.jsxs)(U,{variant:`outline`,disabled:r,"data-empty":!e,className:V(`w-full justify-start text-left font-normal`,`data-[empty=true]:text-muted-foreground`,i),children:[(0,H.jsx)(My,{}),e?Hs(e,`PPP`):(0,H.jsx)(`span`,{children:o})]})}),(0,H.jsx)(G_,{className:`w-auto p-0`,align:`start`,children:(0,H.jsx)(vu,{mode:`single`,selected:e,onSelect:e=>{t?.(e)},autoFocus:!0})})]})}var Py=Object.defineProperty,Fy=(e,t)=>Py(e,`name`,{value:t,configurable:!0}),Iy=`DropdownMenu`,[Ly,Dte]=st(Iy,[Vv]),Ry=Vv(),[zy,By]=Ly(Iy),Vy=Fy(e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=Ry(t),l=f.useRef(null),[u,d]=un({prop:i,defaultProp:a??!1,onChange:o,caller:Iy});return(0,H.jsx)(zy,{scope:t,triggerId:Fn(),triggerRef:l,contentId:Fn(),open:u,onOpenChange:d,onOpenToggle:f.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,H.jsx)(ute,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})},`DropdownMenu`),Hy=`DropdownMenuTrigger`,Uy=f.forwardRef(Fy(function(e,t){let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=By(Hy,n),o=Ry(n),s=pt(t,a.triggerRef);return(0,H.jsx)(Kv,{asChild:!0,...o,children:(0,H.jsx)(bn.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:s,onPointerDown:Xt(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:Xt(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})},`DropdownMenuTrigger`)),Wy=Fy(e=>{let{__scopeDropdownMenu:t,...n}=e,r=Ry(t);return(0,H.jsx)(Xv,{...r,...n})},`DropdownMenuPortal`),Gy=`DropdownMenuContent`,Ky=f.forwardRef(Fy(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=By(Gy,n),a=Ry(n),o=f.useRef(!1);return(0,H.jsx)(ey,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:Xt(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:Xt(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`DropdownMenuContent`)),qy=f.forwardRef(Fy(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Ry(n);return(0,H.jsx)(ay,{...i,...r,ref:t})},`DropdownMenuLabel`)),Jy=f.forwardRef(Fy(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Ry(n);return(0,H.jsx)(cy,{...i,...r,ref:t})},`DropdownMenuItem`)),Yy=f.forwardRef(Fy(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Ry(n);return(0,H.jsx)(uy,{...i,...r,ref:t})},`DropdownMenuCheckboxItem`)),Xy=f.forwardRef(Fy(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Ry(n);return(0,H.jsx)(mte,{...i,...r,ref:t})},`DropdownMenuRadioItem`)),Zy=f.forwardRef(Fy(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Ry(n);return(0,H.jsx)(gte,{...i,...r,ref:t})},`DropdownMenuItemIndicator`)),Qy=f.forwardRef(Fy(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Ry(n);return(0,H.jsx)(_te,{...i,...r,ref:t})},`DropdownMenuSeparator`)),$y=f.forwardRef(Fy(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Ry(n);return(0,H.jsx)(yte,{...i,...r,ref:t})},`DropdownMenuSubTrigger`)),eb=f.forwardRef(Fy(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Ry(n);return(0,H.jsx)(xte,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`DropdownMenuSubContent`)),tb=Vy,nb=Uy;function rb({container:e,...t}){let n=Gn();return(0,H.jsx)(Wy,{container:e??n,...t})}var ib=f.forwardRef(({className:e,inset:t,children:n,...r},i)=>(0,H.jsxs)($y,{ref:i,className:V(`flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,t&&`pl-8`,e),...r,children:[n,(0,H.jsx)(lo,{className:`ml-auto`})]}));ib.displayName=$y.displayName;var ab=f.forwardRef(({className:e,...t},n)=>(0,H.jsx)(eb,{ref:n,className:V(`z-50 min-w-32 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]`,e),...t}));ab.displayName=eb.displayName;var ob=f.forwardRef(({className:e,sideOffset:t=4,...n},r)=>(0,H.jsx)(rb,{children:(0,H.jsx)(Ky,{ref:r,sideOffset:t,className:V(`z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-32 overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]`,e),...n})}));ob.displayName=Ky.displayName;var sb=f.forwardRef(({className:e,inset:t,...n},r)=>(0,H.jsx)(Jy,{ref:r,className:V(`relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,t&&`pl-8`,e),...n}));sb.displayName=Jy.displayName;var cb=f.forwardRef(({className:e,children:t,checked:n,...r},i)=>(0,H.jsxs)(Yy,{ref:i,className:V(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50`,e),checked:n,...r,children:[(0,H.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,H.jsx)(Zy,{children:(0,H.jsx)(yu,{className:`h-4 w-4`})})}),t]}));cb.displayName=Yy.displayName;var lb=f.forwardRef(({className:e,children:t,...n},r)=>(0,H.jsxs)(Xy,{ref:r,className:V(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50`,e),...n,children:[(0,H.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,H.jsx)(Zy,{children:(0,H.jsx)(Jee,{className:`h-2 w-2 fill-current`})})}),t]}));lb.displayName=Xy.displayName;var ub=f.forwardRef(({className:e,inset:t,...n},r)=>(0,H.jsx)(qy,{ref:r,className:V(`px-2 py-1.5 text-sm font-semibold`,t&&`pl-8`,e),...n}));ub.displayName=qy.displayName;var db=f.forwardRef(({className:e,...t},n)=>(0,H.jsx)(Qy,{ref:n,className:V(`-mx-1 my-1 h-px bg-muted`,e),...t}));db.displayName=Qy.displayName;var fb=(0,f.forwardRef)(({title:e,titleId:t,...n},r)=>(0,H.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,H.jsx)(`title`,{id:t,children:e}):null,(0,H.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M21 12a9 9 0 1 1-6.219-8.56`})]})),Ote=Object.defineProperty,pb=(e,t)=>Ote(e,`name`,{value:t,configurable:!0}),mb={Horizontal:`horizontal`,Vertical:`vertical`},hb=mb.Horizontal,kte=Object.values(mb),gb=f.forwardRef(pb(function(e,t){let{decorative:n,orientation:r=hb,...i}=e,a=_b(r)?r:hb,o=a===mb.Vertical?a:void 0,s=n?{role:`none`}:{"aria-orientation":o,role:`separator`};return(0,H.jsx)(bn.div,{"data-orientation":a,...s,...i,ref:t})},`Separator`));function _b(e){return kte.includes(e)}pb(_b,`isValidOrientation`);var vb=f.forwardRef(({className:e,orientation:t=`horizontal`,decorative:n=!0,...r},i)=>(0,H.jsx)(gb,{ref:i,decorative:n,orientation:t,className:V(`shrink-0 bg-border`,t===`horizontal`?`h-px w-full`:`h-full w-px`,e),...r}));vb.displayName=gb.displayName;function Ate(e){return Dy(e)&&`value`in e}function yb(e){return Ate(e)?e:{value:e}}var jte=class extends f.Component{state={labels:new Map,valueKeyIdentity:this.props.valueKeyIdentity};static getDerivedStateFromProps(e,t){let n=e.valueKeyIdentity!==t.valueKeyIdentity,r=new Map(e.labels);if(!n)for(let n of e.selectedKeys){let e=t.labels.get(n);!r.has(n)&&e!==void 0&&r.set(n,e)}return!n&&r.size===t.labels.size&&Array.from(r).every(([e,n])=>t.labels.get(e)===n)?null:{labels:r,valueKeyIdentity:e.valueKeyIdentity}}render(){return this.props.children(this.state.labels)}};function Mte(e,t,n){let r=e.multiple===!0,i=e.async===!0,a=e.valueKey,o=e.multiple?e.value:void 0,s=e.multiple?void 0:e.value,c=e.renderItem,l=(0,f.useRef)(null);(0,f.useImperativeHandle)(t,()=>{let e=l.current;if(!e)throw Error(`Select 요소가 아직 마운트되지 않았습니다.`);return e});let[u,d]=(0,f.useState)(!1),[p,m]=(0,f.useState)(``),h=i&&`onOpenChange`in e?e.onOpenChange:void 0,g=(0,f.useRef)(u);(0,f.useEffect)(()=>{g.current!==u&&(h&&h(u),g.current=u)},[u,h]);let _=(0,f.useCallback)(e=>e==null?``:a?a(e):String(e),[a]),v=(0,f.useMemo)(()=>e.items.map(yb),[e.items]),y=(0,f.useMemo)(()=>{let e=new Map;for(let t of v)e.set(_(t.value),t.value);return e},[v,_]),b=(0,f.useMemo)(()=>{if(!i)return new Map;let e=o||(s==null?[]:[s]),t=new Map;for(let r of e){let e=_(r),i=v.find(e=>e.value===r);if(i)t.set(e,i);else{let i=n.get(e);i!==void 0&&t.set(e,{value:r,label:i})}}return t},[i,o,s,v,_,n]),x=(0,f.useCallback)(e=>{if(c)return c(e);let t=v.find(t=>t.value===e);if(t?.label!==void 0)return t.label;if(i){let t=n.get(_(e));if(t!==void 0)return t}return String(e)},[c,v,i,n,_]),S=(0,f.useCallback)(e=>{m(e)},[]),C=(0,f.useCallback)(e=>{d(e),e||m(``)},[]),w=i&&`onSearch`in e?e.onSearch:void 0,T=i&&`searchDebounce`in e&&e.searchDebounce!==void 0?e.searchDebounce:300;return(0,f.useEffect)(()=>{if(!w)return;let e=setTimeout(()=>{w(p)},p===``?0:T);return()=>clearTimeout(e)},[p,w,T]),{isMultiple:r,isAsync:i,selectRef:l,isPopoverOpen:u,setIsPopoverOpen:C,searchValue:p,handleSearchChange:S,filteredOptions:(0,f.useMemo)(()=>{if(i){let e=new Map;for(let[t,n]of b)e.set(t,n);for(let t of v)e.set(_(t.value),t);return Array.from(e.values())}return p?v.filter(e=>{let t=x(e.value);return String(t).toLowerCase().includes(p.toLowerCase())}):v},[i,v,b,p,_,x]),normalizedItems:v,getKeyForValue:_,valueByKey:y,getItemLabel:x}}function Nte(e,t){if(!t||Object.prototype.toString.call(e)!==`[object String]`)return e;let n=String(e),r=n.toLowerCase(),i=t.toLowerCase(),a=r.indexOf(i);if(a===-1)return e;let o=n.slice(0,a),s=n.slice(a,a+t.length),c=n.slice(a+t.length);return(0,H.jsxs)(H.Fragment,{children:[o,(0,H.jsx)(`strong`,{className:`font-bold`,children:s}),c]})}function Pte({props:e,isMultiple:t,isAsync:n,isPopoverOpen:r,setIsPopoverOpen:i,searchValue:a,handleSearchChange:o,filteredOptions:s,getKeyForValue:c,getItemLabel:l}){let{SD:u}=vp(),[d,p]=(0,f.useState)(null),m=(0,f.useCallback)(e=>{p(e)},[]),[h,g]=(0,f.useState)(null),_=(0,f.useCallback)(e=>{g(e)},[]),v=n&&`onLoadMore`in e?e.onLoadMore:void 0,y=n&&`hasMore`in e?e.hasMore??!1:!1,b=n&&`isLoadingMore`in e?e.isLoadingMore??!1:!1,x=n&&v!==void 0;(0,f.useEffect)(()=>{if(!v||!y||b||!h||!d)return;let e=new IntersectionObserver(e=>{for(let t of e)t.isIntersecting&&v()},{root:d,threshold:0});return e.observe(h),()=>e.disconnect()},[h,d,v,y,b]);let S=e.searchable??n,C=(0,f.useCallback)(e=>{let t=d;if(!t)return;let n=t.scrollTop<t.scrollHeight-t.clientHeight,r=t.scrollTop>0;(e.deltaY>0&&n||e.deltaY<0&&r)&&e.stopPropagation()},[d]),w=(0,f.useCallback)(t=>{if(!e.disabled){if(e.multiple){let n=e.value;if(n.includes(t)){if(e.isRemovable?.(t)===!1)return;e.onValueChange(n.filter(e=>e!==t))}else e.onValueChange([...n,t])}else e.onValueChange?.(t),i(!1)}},[e,i]),T=(0,f.useCallback)(()=>{if(!e.multiple||e.disabled)return;let t=s.filter(e=>!e.disabled),n=e.value,r=n.filter(t=>e.isRemovable?.(t)===!1);if(n.length===t.length)e.onValueChange(r);else{let n=t.map(e=>e.value);e.onValueChange([...r.filter(e=>!n.includes(e)),...n])}},[e,s]),E=(0,f.useCallback)(()=>{e.disabled||(e.multiple?e.onValueChange(e.value.filter(t=>e.isRemovable?.(t)===!1)):e.onValueChange?.(void 0))},[e]),D=(0,f.useCallback)(t=>e.multiple?e.value.includes(t):e.value===t,[e]),O=n&&`loading`in e?e.loading:!1,k=n&&`error`in e?e.error:void 0,A=e.multiple?e.value.length>0:e.value!==void 0&&e.value!==null&&e.value!==``,j=e.multiple?e.value:[],M=e.multiple?void 0:e.value;return(0,H.jsxs)(U_,{open:r,onOpenChange:i,children:[(0,H.jsx)(W_,{asChild:!0,children:(0,H.jsx)(U,{variant:`outline`,role:`combobox`,"aria-expanded":r,disabled:e.disabled||O,className:V(`flex p-1 rounded-md border border-input min-h-10 h-auto items-center justify-between bg-white hover:bg-white hover:text-inherit [&_svg]:pointer-events-auto w-full`,e.className),children:t&&A?(0,H.jsxs)(`div`,{className:`flex justify-between items-center w-full`,children:[(0,H.jsx)(`div`,{className:`flex items-center gap-1 flex-wrap`,children:(()=>{if(!e.multiple)return null;let t=e.value;return(0,H.jsx)(H.Fragment,{children:t.map(t=>{let n=c(t);return(0,H.jsxs)(co,{variant:`outline`,className:`m-1 transition-all duration-300 ease-in-out`,children:[l(t),e.isRemovable?.(t)!==!1&&(0,H.jsx)(K_,{className:`ml-2 h-3 w-3 cursor-pointer !pointer-events-auto`,onPointerDownCapture:e=>{e.stopPropagation()},onMouseDownCapture:e=>{e.stopPropagation()},onClick:e=>{e.stopPropagation(),w(t)}})]},n)})})})()}),(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[e.clearable&&(0,H.jsx)(`div`,{role:`button`,tabIndex:0,onPointerDownCapture:e=>{e.stopPropagation()},onMouseDownCapture:e=>{e.stopPropagation()},onClick:e=>{e.stopPropagation(),E()},className:`flex items-center justify-center h-4 w-4 mx-2 cursor-pointer text-muted-foreground hover:text-foreground`,children:(0,H.jsx)(yp,{className:`h-4 w-4`})}),(0,H.jsx)(vb,{orientation:`vertical`,className:`flex min-h-6 h-full`}),(0,H.jsx)(rt,{className:`h-4 mx-2 cursor-pointer text-muted-foreground`})]})]}):!t&&A?(0,H.jsxs)(`div`,{className:`flex justify-between items-center w-full px-2 py-1`,children:[M==null?null:(0,H.jsx)(`span`,{className:`flex-1 truncate text-left text-sm`,children:l(M)}),(0,H.jsxs)(`div`,{className:`flex items-center gap-1 shrink-0`,children:[e.clearable&&A&&(0,H.jsx)(K_,{className:`h-4 w-4 cursor-pointer opacity-50 hover:opacity-100 transition-opacity`,onPointerDownCapture:E,onMouseDownCapture:E}),(0,H.jsx)(rt,{className:`h-4 w-4 opacity-50`})]})]}):(0,H.jsxs)(`div`,{className:`flex items-center justify-between w-full px-2 py-1`,children:[(0,H.jsx)(`span`,{className:`text-sm text-muted-foreground flex-1 truncate text-left`,children:e.placeholder}),(0,H.jsx)(rt,{className:`h-4 cursor-pointer text-muted-foreground`})]})})}),(0,H.jsx)(G_,{className:`min-w-40 p-0`,align:`start`,style:{width:`var(--radix-popover-trigger-width)`},children:(0,H.jsxs)(Vm,{shouldFilter:!1,children:[S&&(0,H.jsx)(Um,{placeholder:u(`common.searchPlaceholder`),value:a,onValueChange:o}),(0,H.jsx)(Wm,{ref:m,onWheel:C,children:O?(0,H.jsx)(Gm,{children:(0,H.jsx)(`div`,{className:`flex items-center justify-center`,children:(0,H.jsx)(fb,{className:`h-4 w-4 animate-spin mr-2`})})}):k?(0,H.jsxs)(Gm,{children:[`Error: `,k.message]}):s.length===0?(0,H.jsx)(Gm,{children:u(`rc.multiSelect.noResults`)}):(0,H.jsxs)(H.Fragment,{children:[t&&!(`hideSelectAll`in e&&e.hideSelectAll)&&(0,H.jsx)(Km,{children:(0,H.jsxs)(Jm,{onSelect:T,className:`cursor-pointer`,children:[(0,H.jsx)(`div`,{className:V(`mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary`,j.length===s.filter(e=>!e.disabled).length?`bg-primary text-primary-foreground`:`opacity-50 [&_svg]:invisible`),children:(0,H.jsx)(yu,{className:`h-4 w-4`})}),(0,H.jsxs)(`span`,{children:[`(`,u(`rc.multiSelect.selectAll`),`)`]})]})}),(0,H.jsx)(Km,{children:s.map(e=>{let n=c(e.value),r=D(e.value);return(0,H.jsxs)(Jm,{onSelect:()=>w(e.value),disabled:e.disabled,className:V(`cursor-pointer`,e.disabled&&`opacity-50 cursor-not-allowed`),children:[t&&(0,H.jsx)(`div`,{className:V(`mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary`,r?`bg-primary text-primary-foreground`:`opacity-50 [&_svg]:invisible`),children:(0,H.jsx)(yu,{className:`h-4 w-4`})}),!t&&(0,H.jsx)(yu,{className:V(`mr-2 h-4 w-4`,r?`opacity-100`:`opacity-0`)}),(0,H.jsx)(`span`,{children:Nte(l(e.value),a)})]},n)})}),x&&(0,H.jsx)(`div`,{ref:_,className:`flex items-center justify-center py-2 text-xs text-muted-foreground`,children:b?(0,H.jsx)(fb,{className:`h-3 w-3 animate-spin`}):null})]})})]})})]})}function Fte({props:e,forwardedRef:t,cachedLabels:n}){let r=Mte(e,t,n);return(0,H.jsx)(Pte,{props:e,isMultiple:r.isMultiple,isAsync:r.isAsync,isPopoverOpen:r.isPopoverOpen,setIsPopoverOpen:r.setIsPopoverOpen,searchValue:r.searchValue,handleSearchChange:r.handleSearchChange,filteredOptions:r.filteredOptions,getKeyForValue:r.getKeyForValue,getItemLabel:r.getItemLabel})}var bb=f.forwardRef(function(e,t){let n=new Map;for(let t of e.items){let r=yb(t);if(r.label===void 0)continue;let i=e.valueKey?e.valueKey(r.value):String(r.value);n.set(i,r.label)}let r=e.multiple?e.value:e.value===void 0||e.value===null?[]:[e.value],i=new Set(r.map(t=>e.valueKey?e.valueKey(t):String(t)));return(0,H.jsx)(jte,{labels:n,selectedKeys:i,valueKeyIdentity:e.valueKey,children:n=>(0,H.jsx)(Fte,{props:e,forwardedRef:t,cachedLabels:n})})}),Ite=Object.defineProperty,Lte=(e,t)=>Ite(e,`name`,{value:t,configurable:!0}),Rte=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),zte=f.forwardRef(Lte(function(e,t){return(0,H.jsx)(bn.span,{...e,ref:t,style:{...Rte,...e.style}})},`VisuallyHidden`));function xb({enum:e,labels:t,value:n,onValueChange:r,placeholder:i,textPrefix:a=``,clearable:o=!1,disabled:s=!1,className:c,multiple:l=!1}){let u=f.useMemo(()=>e.options.filter(e=>e!==``),[e]),d=f.useMemo(()=>u.map(e=>({value:e,label:a+t[e]})),[u,t,a]);return l?(0,H.jsx)(bb,{items:d,valueKey:e=>e,value:Array.isArray(n)?n:[],onValueChange:e=>{r?.(e)},placeholder:i,clearable:o,disabled:s,className:c,multiple:!0,async:!1}):(0,H.jsx)(bb,{items:d,valueKey:e=>e,value:Array.isArray(n)||n===``?void 0:n,onValueChange:e=>{r?.(e)},placeholder:i,clearable:o,disabled:s,className:c,multiple:!1,async:!1})}var Sb=f.createContext(void 0),Cb=e=>{let t=f.useContext(Sb);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Bte=({client:e,children:t})=>(f.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,H.jsx)(Sb.Provider,{value:e,children:t})),Vte={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},wb=new class{#e=Vte;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function Hte(e){setTimeout(e,0)}var Ute=typeof window>`u`||`Deno`in globalThis;function Tb(){}function Wte(e,t){return typeof e==`function`?e(t):e}function Eb(e){return typeof e==`number`&&e>=0&&e!==1/0}function Db(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ob(e,t){return typeof e==`function`?e(t):e}function kb(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==jb(o,t.options))return!1}else if(!Nb(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function Ab(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Mb(t.options.mutationKey)!==Mb(a))return!1}else if(!Nb(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function jb(e,t){return(t?.queryKeyHashFn||Mb)(e)}function Mb(e){return JSON.stringify(e,(e,t)=>Lb(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function Nb(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let n=0;n<t.length;n++)if(!Nb(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!Nb(e[r],t[r]))return!1;return!0}return!1}var Gte=Object.prototype.hasOwnProperty;function Pb(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=Ib(e)&&Ib(t);if(!r&&!(Lb(e)&&Lb(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:Gte.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=Pb(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function Fb(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function Ib(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Lb(e){if(!Rb(e))return!1;let t=Object.getPrototypeOf(e),n=t?.constructor;if(n===void 0)return!0;if(typeof n!=`function`)return!1;let r=n.prototype;return!(!Rb(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function Rb(e){return Object.prototype.toString.call(e)===`[object Object]`}function Kte(e){return new Promise(t=>{wb.setTimeout(t,e)})}function zb(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:Pb(e,t)}function qte(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function Jte(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Bb=Symbol();function Vb(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Bb?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Hb(e,t){return typeof e==`function`?e(...t):!!e}function Yte(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r||(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0})),i)}),e}var Xte=()=>Ute,Ub=()=>Xte(),Wb=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Gb=new class extends Wb{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},Zte=Hte;function Qte(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=Zte,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var Kb=Qte(),qb=new class extends Wb{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function $te(e){return Math.min(1e3*2**e,3e4)}function Jb(e){return(e??`online`)!==`online`||qb.isOnline()}var Yb=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Xb(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(Tb);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new Yb(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>Gb.isFocused()&&(e.networkMode===`always`||qb.isOnline())&&e.canRun(),p=()=>Jb(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=t=>new Promise(n=>{r=e=>{(c()||t())&&n(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(Ub()?0:3),a=e.retryDelay??$te,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);t||!s?h(r):(n++,e.onFail?.(n,r),Kte(o).then(()=>f()?void 0:g(f)).then(()=>{t?h(r):_()}))})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g(p).then(_),s)}}var Zb=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Eb(this.gcTime)&&(this.#e=wb.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ub()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(wb.clearTimeout(this.#e),this.#e=void 0)}};function ene(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{Yte(e,()=>t.signal,()=>n=!0)},u=Vb(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?Jte:qte;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?tne:Qb,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]===void 0?r.initialPageParam:o[0]:Qb(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function Qb(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function tne(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var nne=class extends Zb{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=tx(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=tx(this.options);e.data!==void 0&&(this.setState(ex(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=zb(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(Tb).catch(Tb):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Ob(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Bb||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>Ob(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!Db(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=Vb(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?ene(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=Xb({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof Yb&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof Yb){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...$b(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...ex(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),Kb.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function $b(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Jb(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function ex(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function tx(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var nx=class extends Wb{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),rx(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ix(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ix(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof Ob(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!Fb(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&ax(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||Ob(this.options.enabled,this.#t)!==Ob(t.enabled,this.#t)||Ob(this.options.staleTime,this.#t)!==Ob(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||Ob(this.options.enabled,this.#t)!==Ob(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return Fb(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch(t).then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Tb)),t}#h(e){return!Ub()&&Ob(this.options.enabled,this.#t)!==!1&&Eb(e)}#g(){this.#b();let e=Ob(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=Db(this.#r.dataUpdatedAt,e)+1;this.#u=wb.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return Ob(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=wb.setInterval(()=>{(this.options.refetchIntervalInBackground||Gb.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(wb.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(wb.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&rx(e,t),o=i&&ax(e,n,t,r);(a||o)&&(l={...l,...$b(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=zb(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=zb(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:ox(e,t),refetch:this.refetch,isEnabled:Ob(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),Fb(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();Kb.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function rne(e,t){return Ob(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||Ob(t.retryOnMount,e)!==!1)}function rx(e,t){return rne(e,t)||e.state.data!==void 0&&ix(e,t,t.refetchOnMount)}function ix(e,t,n){if(Ob(t.enabled,e)!==!1&&Ob(t.staleTime,e)!==`static`){let r=Ob(n,e);return r===`always`||r!==!1&&ox(e,t)}return!1}function ax(e,t,n,r){return(e!==t||Ob(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&ox(e,n)}function ox(e,t){return Ob(t.enabled,e)!==!1&&e.isStaleByTime(Ob(t.staleTime,e))}var ine=class extends Zb{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||ane(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=Xb({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),Kb.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function ane(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var one=class extends Wb{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new ine({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=sx(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=sx(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=sx(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=sx(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){Kb.batch(()=>{let e=this.getAll();this.#e.clear(),this.#t.clear(),e.forEach(e=>{this.notify({type:`removed`,mutation:e})})})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Ab(t,e))}findAll(e={}){return this.getAll().filter(t=>Ab(e,t))}notify(e){Kb.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return Kb.batch(()=>Promise.all(e.map(e=>e.continue().catch(Tb))))}};function sx(e){return e.options.scope?.id}function cx(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}var sne=class extends Wb{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=[];constructor(e,t,n){super(),this.#e=e,this.#r=n,this.#n=[],this.#i=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#r=t,Kb.batch(()=>{let e=this.#i,t=this.#p(this.#n);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let n=t.map(e=>e.observer),r=n.map(e=>e.getCurrentResult()),i=e.length!==n.length,a=n.some((t,n)=>t!==e[n]),o=i||a,s=o?!0:r.some((e,t)=>{let n=this.#t[t];return!n||!Fb(e,n)});(o||s)&&(o&&(this.#l=t,this.#i=n),this.#t=r,this.hasListeners()&&(o&&(cx(e,n).forEach(e=>{e.destroy()}),cx(n,e).forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})),this.#h()))})}getCurrentResult(){return this.#t}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){let n=this.#p(e),r=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),i=n.map(e=>e.defaultedQueryOptions.queryHash);return[r,e=>this.#d(e??r,t,i),()=>this.#u(r,n)]}#u(e,t){let n=new Set;return t.map((r,i)=>{let a=e[i];return r.defaultedQueryOptions.notifyOnChangeProps?a:r.observer.trackResult(a,e=>{n.has(e)||(n.add(e),t.forEach(t=>{t.observer.trackProp(e)}))})})}#d(e,t,n){if(t){let r=this.#c,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((e,t)=>e!==r[t]));return(this.#t!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#t,n!==void 0&&(this.#c=n),this.#a=Pb(this.#a,t(e))),this.#a}return e}#f(){return!this.#r?.combine||this.#i.some((e,t)=>e.options.suspense&&this.#t[t]?.data===void 0)}#p(e){let t=new Map;this.#i.forEach(e=>{let n=e.options.queryHash;if(!n)return;let r=t.get(n);r?r.push(e):t.set(n,[e])});let n=[];return e.forEach(e=>{let r=this.#e.defaultQueryOptions(e),i=t.get(r.queryHash)?.shift()??new nx(this.#e,r);n.push({defaultedQueryOptions:r,observer:i})}),n}#m(e,t){let n=this.#i.indexOf(e);n!==-1&&(this.#t=this.#t.slice(),this.#t[n]=t,this.#h())}#h(){if(this.hasListeners()){let e=this.#f(),t=this.#a,n=e?t:this.#d(this.#u(this.#t,this.#l),this.#r?.combine);(e||t!==n)&&Kb.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},cne=class extends Wb{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??jb(r,t),a=this.get(i);return a||(a=new nne({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){this.#e.get(e.queryHash)===e&&(e.destroy(),this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){Kb.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>kb(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>kb(e,t)):t}notify(e){Kb.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Kb.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Kb.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},lne=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new cne,this.#t=e.mutationCache||new one,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=Gb.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=qb.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Ob(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=Wte(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return Kb.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;Kb.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return Kb.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=Kb.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(Tb).catch(Tb)}invalidateQueries(e,t={}){return Kb.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=Kb.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(Tb)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(Tb)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(Ob(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(Ob(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Tb).catch(Tb)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Tb).catch(Tb)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return qb.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(Mb(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{Nb(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(Mb(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{Nb(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=jb(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===Bb&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},lx=f.createContext(!1),ux=()=>f.useContext(lx);lx.Provider;function une(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var dne=f.createContext(une()),dx=()=>f.useContext(dne),fx=(e,t,n)=>{let r=n?.state.status===`error`&&typeof e.throwOnError==`function`?Hb(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},px=e=>{f.useEffect(()=>{e.clearReset()},[e])},mx=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||Hb(n,[e.error,r])),hx=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},gx=(e,t)=>e?.suspense&&t.isPending,_x=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function vx({queries:e,...t},n){let r=Cb(n),i=ux(),a=dx(),o=t.subscribed!==!1,s=f.useMemo(()=>e.map(e=>{let t=r.defaultQueryOptions(e);return t._optimisticResults=i?`isRestoring`:o?`optimistic`:void 0,t}),[e,r,i,o]);s.forEach(e=>{hx(e);let t=r.getQueryCache().get(e.queryHash);fx(e,a,t)}),px(a);let[c]=f.useState(()=>new sne(r,s,t)),[l,u,d]=c.getOptimisticResult(s,t.combine),p=!i&&o;f.useSyncExternalStore(f.useCallback(e=>p?c.subscribe(Kb.batchCalls(e)):Tb,[c,p]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),f.useEffect(()=>{c.setQueries(s,t)},[s,t,c]);let m=l.some((e,t)=>gx(s[t],e))?l.flatMap((e,t)=>{let n=s[t];return n&&gx(n,e)?_x(n,new nx(r,n),a):[]}):[];if(m.length>0)throw Promise.all(m);let h=l.find((e,t)=>{let n=s[t];return n&&mx({result:e,errorResetBoundary:a,throwOnError:n.throwOnError,query:r.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(h)throw h.error;return u(d())}function yx(e,t,n){let r=ux(),i=dx(),a=Cb(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,hx(o),fx(o,i,s),px(i);let[l]=f.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&c;if(f.useSyncExternalStore(f.useCallback(e=>{let t=d?l.subscribe(Kb.batchCalls(e)):Tb;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),f.useEffect(()=>{l.setOptions(o)},[o,l]),gx(o,u))throw _x(o,l,i);if(mx({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function bx(e,t){return yx(e,nx,t)}function xx({className:e,...t}){return(0,H.jsx)(`div`,{className:V(`animate-pulse rounded-md bg-muted`,e),...t})}var Sx=Object.defineProperty,Cx=(e,t)=>Sx(e,`name`,{value:t,configurable:!0}),[wx,fne]=st(`Tooltip`,[d_]),Tx=d_(),Ex=`TooltipProvider`,Dx=700,Ox=`tooltip.open`,[kx,Ax]=wx(Ex),jx=Cx(e=>{let{__scopeTooltip:t,delayDuration:n=Dx,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=f.useRef(!0),s=f.useRef(!1),c=f.useRef(0);return f.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,H.jsx)(kx,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:f.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:f.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:f.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),Mx=`Tooltip`,[Nx,Px]=wx(Mx),Fx=Cx(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=Ax(Mx,e.__scopeTooltip),l=Tx(t),[u,d]=f.useState(null),[p,m]=f.useState(void 0),h=Fn(),g=f.useRef(0),_=o??c.disableHoverableContent,v=s??c.delayDuration,y=f.useRef(!1),[b,x]=un({prop:r,defaultProp:i??!1,onChange:Cx(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(Ox))):c.onClose(),a?.(e)},`onChange`),caller:Mx}),S=f.useMemo(()=>b?y.current?`delayed-open`:`instant-open`:`closed`,[b]),C=f.useCallback(()=>{window.clearTimeout(g.current),g.current=0,y.current=!1,x(!0)},[x]),w=f.useCallback(()=>{window.clearTimeout(g.current),g.current=0,x(!1)},[x]),T=f.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{y.current=!0,x(!0),g.current=0},v)},[v,x]);f.useEffect(()=>()=>{g.current&&=(window.clearTimeout(g.current),0)},[]);let E=p??h;return(0,H.jsx)(m_,{...l,children:(0,H.jsx)(Nx,{scope:t,contentId:E,setContentId:m,open:b,stateAttribute:S,trigger:u,onTriggerChange:d,onTriggerEnter:f.useCallback(()=>{c.isOpenDelayedRef.current?T():C()},[c.isOpenDelayedRef,T,C]),onTriggerLeave:f.useCallback(()=>{_?w():(window.clearTimeout(g.current),g.current=0)},[w,_]),onOpen:C,onClose:w,disableHoverableContent:_,children:n})})},`Tooltip`),Ix=`TooltipTrigger`,Lx=f.forwardRef(Cx(function(e,t){let{__scopeTooltip:n,"aria-describedby":r,...i}=e,a=Px(Ix,n),o=Ax(Ix,n),s=Tx(n),c=pt(t,f.useRef(null),a.onTriggerChange),l=f.useRef(!1),u=f.useRef(!1),d=f.useCallback(()=>l.current=!1,[]);return f.useEffect(()=>()=>document.removeEventListener(`pointerup`,d),[d]),(0,H.jsx)(g_,{asChild:!0,...s,children:(0,H.jsx)(bn.button,{"aria-describedby":a.open?Xx(r,a.contentId):r,"data-state":a.stateAttribute,...i,ref:c,onPointerMove:Xt(e.onPointerMove,e=>{e.pointerType!==`touch`&&!u.current&&!o.isPointerInTransitRef.current&&(a.onTriggerEnter(),u.current=!0)}),onPointerLeave:Xt(e.onPointerLeave,()=>{a.onTriggerLeave(),u.current=!1}),onPointerDown:Xt(e.onPointerDown,()=>{a.open&&a.onClose(),l.current=!0,document.addEventListener(`pointerup`,d,{once:!0})}),onFocus:Xt(e.onFocus,()=>{l.current||a.onOpen()}),onBlur:Xt(e.onBlur,a.onClose),onClick:Xt(e.onClick,a.onClose)})})},`TooltipTrigger`)),[pne,Rx]=wx(`TooltipPortal`,{forceMount:void 0}),zx=`TooltipContent`,Bx=f.forwardRef(Cx(function(e,t){let n=Rx(zx,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=Px(zx,e.__scopeTooltip);return(0,H.jsx)(Tn,{present:r||o.open,children:o.disableHoverableContent?(0,H.jsx)(Ux,{side:i,...a,ref:t}):(0,H.jsx)(Vx,{side:i,...a,ref:t})})},`TooltipContent`)),Vx=f.forwardRef(Cx(function(e,t){let n=Px(zx,e.__scopeTooltip),r=Ax(zx,e.__scopeTooltip),i=f.useRef(null),a=pt(t,i),[o,s]=f.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,p=f.useCallback(()=>{s(null),d(!1)},[d]),m=f.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=Gx(r,Wx(r,n.getBoundingClientRect())),a=Kx(t.getBoundingClientRect()),o=Jx([...i,...a]);s(o),d(!0)},[d]);return f.useEffect(()=>()=>p(),[p]),f.useEffect(()=>{if(c&&u){let e=Cx(e=>m(e,u),`handleTriggerLeave`),t=Cx(e=>m(e,c),`handleContentLeave`);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,m,p]),f.useEffect(()=>{if(o){let e=Cx(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!qx(n,o);r?p():i&&(p(),l())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,p]),(0,H.jsx)(Ux,{...e,ref:a})},`TooltipContentHoverable`)),Hx=yt(`TooltipContent`),Ux=f.forwardRef(Cx(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=Px(zx,n),u=Tx(n),{onClose:d}=l,[p,m]=f.useState(null),h=pt(t,m);Sr(p),f.useEffect(()=>(document.addEventListener(Ox,d),()=>document.removeEventListener(Ox,d)),[d]),f.useEffect(()=>{if(l.trigger){let e=Cx(e=>{e.target instanceof Node&&e.target.contains(l.trigger)&&d()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]);let{setContentId:g}=l;return Mt(()=>(g(a),()=>{g(void 0)}),[a,g]),(0,H.jsx)(or,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,H.jsxs)(y_,{"data-state":l.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:l.contentId,...u,...c,ref:h,style:{...c.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,H.jsx)(Hx,{children:r}),i?(0,H.jsx)(zte,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`));function Wx(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}Cx(Wx,`getExitSideFromRect`);function Gx(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}Cx(Gx,`getPaddedExitPoints`);function Kx(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}Cx(Kx,`getPointsFromRect`);function qx(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}Cx(qx,`isPointInPolygon`);function Jx(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),Yx(t)}Cx(Jx,`getHull`);function Yx(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}Cx(Yx,`getHullPresorted`);function Xx(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}Cx(Xx,`concatAriaDescribedby`);var Zx=jx,Qx=Fx,$x=Lx,eS=f.forwardRef(({className:e,sideOffset:t=4,...n},r)=>(0,H.jsx)(Bx,{ref:r,sideOffset:t,className:V(`z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]`,e),...n}));eS.displayName=Bx.displayName;function tS(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function nS(e,t=`|`){return e.map(e=>AS(e)).join(t)}function rS(e,t){return typeof t==`bigint`?t.toString():t}var iS=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function aS(e){return new iS(e)}function oS(e){return e==null}function sS(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function cS(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}var lS=Symbol(`evaluating`);function uS(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==lS)return r===void 0&&(r=lS,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function dS(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function fS(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function pS(e){return fS(e._zod.def)??e._zod.def.shape}function mS(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return dS(this,t,e),e},enumerable:!0,configurable:!0})}function hS(e,t,n){t in e?dS(e,t,n):e[t]=n}function gS(e,t,n,r){let i=pS(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?mS(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):hS(e,a,r?r(n.value,a):n.value))}}function _S(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?mS(e,n,()=>t[n]):hS(e,n,r.value))}}function vS(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function yS(e){return JSON.stringify(e)}function bS(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var xS=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function SS(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var CS=aS(()=>{if(bC.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function wS(e){if(SS(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return SS(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function TS(e){return wS(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var ES=new Set([`string`,`number`,`symbol`]);function DS(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function OS(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function kS(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function AS(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function jS(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var MS={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},NS={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function PS(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);let i={};return gS(i,e,FS(e,t)),OS(e,vS(n,{shape:i,checks:[]}))}function FS(e,t){let n=pS(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function IS(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);let i=new Set(FS(e,t)),a={};return gS(a,e,Reflect.ownKeys(pS(e)).filter(e=>!i.has(e))),OS(e,vS(n,{shape:a,checks:[]}))}function LS(e,t){if(!wS(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=pS(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return OS(e,vS(e._zod.def,{shape:RS(e,t)}))}function RS(e,t){let n={};return gS(n,e,Reflect.ownKeys(pS(e))),_S(n,t),n}function zS(e,t){if(!wS(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return OS(e,vS(e._zod.def,{shape:RS(e,t)}))}function BS(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let n={};return gS(n,e,Reflect.ownKeys(pS(e))),gS(n,t,Reflect.ownKeys(pS(t))),OS(e,vS(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function VS(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(FS(t,n)):void 0,o={};return gS(o,t,Reflect.ownKeys(pS(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),OS(t,vS(t._zod.def,{shape:o,checks:[]}))}function HS(e,t,n){let r=n?new Set(FS(t,n)):void 0,i={};return gS(i,t,Reflect.ownKeys(pS(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),OS(t,vS(t._zod.def,{shape:i}))}function US(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function WS(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function GS(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function KS(e){return typeof e==`string`?e:e?.message}function qS(e){let t=[];for(let n of e??[]){let e=n._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let r=e.maximum??e.length??e.size;r>=0&&t.push([r,n])}return t}function JS(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function YS(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:KS(e.inst?._zod.def?.error?.(e))??KS(a?.(e))??KS(t?.error?.(e))??KS(n.customError?.(e))??KS(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t!==`inst`&&t!==`schema`&&t!==`continue`&&t!==`input`&&t!==`__proto__`&&(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}var XS=/[\uD800-\uDBFF]/;function ZS(e){let t=e.length;if(!XS.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function QS(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function $S(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function eC(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function tC(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):aC(e,n,r.value)}}function nC(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function rC(e,t,n){return nC(e,t,n,!1)}function iC(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return nC(this,n,r(this))},set(e){nC(this,n,e)}})}return t}function aC(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:nC(this,t,n.bind(this))},set(e){nC(this,t,e)}})}function oC(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var sC,cC=!1,lC={configurable:!0,get(){cC=!0}};function uC(e,t,n){let r=Object.getPrototypeOf(e._zod);t in r&&sC!==e._zod?sC=void 0:(sC=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,lC);let e=cC;cC=!1;try{let r=n(this);return cC?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),cC||=e,r}catch(n){throw delete this[t],cC||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}}))}function dC(e,t,n,r){let i=oC(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}var fC=`~constantCatch`;function pC(e){let t=()=>e;return t[fC]=!0,t}var mC,hC={value:void 0,enumerable:!1},gC=`captureStackTrace`in Error?Error:null;function _C(e){let t=gC;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return gC=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function G(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){hC.value=new a(r);try{Object.defineProperty(n,"_zod",hC)}finally{hC.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),tC(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?_C(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var vC=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},yC=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(mC=globalThis).__zod_globalConfig??(mC.__zod_globalConfig={});var bC=globalThis.__zod_globalConfig;function xC(e){return e&&Object.assign(bC,e),bC}function SC(){let e=this._zod;return e.message??=JSON.stringify(e.def,rS,2),e.message}function CC(e){this._zod.message=e}var wC={get:SC,set:CC,enumerable:!0,configurable:!0},TC={value:void 0,enumerable:!1},EC=new WeakSet([Object.prototype,Error.prototype]),DC=G(`$ZodError`,(e,t)=>{e.name=`$ZodError`,TC.value=t,Object.defineProperty(e,"issues",TC),TC.value=void 0,Object.defineProperty(e,"message",wC);let n=Object.getPrototypeOf(e);EC.has(n)||(EC.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))});function OC(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function kC(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?OC(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function AC(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function jC(e,t){return{callee:t?.callee??e,Err:t?.Err}}var MC=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new vC;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>YS(e,o,xC())));throw xS(n,a?.callee??t),n}return s.value};return t},NC=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>YS(e,o,xC())));throw xS(n,a?.callee??t),n}return s.value};return t},PC=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new vC;return a.issues.length?FC(e,a.issues,i):{success:!0,data:a.value}};function FC(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>YS(e,n,xC()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}var IC=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?FC(e,a.issues,i):{success:!0,data:a.value}},LC=Symbol.for(`zod.compile.invalid`),RC=Symbol.for(`zod.compile.fallback`),zC=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==LC)return!0;if(r.definite===!0&&n===void 0)return!1}return BC(e,t,n)});function BC(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[RC]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new vC;return a.issues.length===0}var VC=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},HC=e=>{let t=MC(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,jC(n,a))};return n},UC=e=>{let t=MC(e),n=(e,r,i,a)=>t(e,r,i,jC(n,a));return n},WC=e=>{let t=NC(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,jC(n,a))};return n},GC=e=>{let t=NC(e),n=async(e,r,i,a)=>await t(e,r,i,jC(n,a));return n},KC=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return PC(e)(t,n,i)},qC=e=>(t,n,r)=>PC(e)(t,n,r),JC=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return IC(e)(t,n,i)},YC=e=>async(t,n,r)=>IC(e)(t,n,r),XC=/^[cC][0-9a-z]{6,}$/,ZC=/^[0-9a-z]+$/,QC=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,$C=/^[0-9a-vA-V]{20}$/,ew=/^[A-Za-z0-9]{27}$/,tw=/^[a-zA-Z0-9_-]{21}$/;function nw(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var rw=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,iw=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,aw=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,ow=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,sw=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function cw(){return new RegExp(sw,`u`)}var lw=/^(?:(?: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])$/,uw=/^(([0-9a-fA-F]{1,4}:){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}|:))$/,dw=/^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/,fw=/^(([0-9a-fA-F]{1,4}:){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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,pw=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,mw=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,hw=/^https?$/,gw=/^\+[1-9]\d{6,14}$/,_w=`(?:(?:\\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])))`;function vw(e){return RegExp(`^${e}$`)}var yw=vw(_w);function bw(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function xw(e){return RegExp(`^${bw(e)}$`)}function Sw(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${bw({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${bw({precision:e.precision})}`:n;return RegExp(`^${_w}T(?:${r})$`)}var Cw=/^[\s\S]{0,}$/,ww=/^-?\d+$/,Tw=/^-?\d+(?:\.\d+)?$/,Ew=/^(?:true|false)$/i,Dw=/^null$/i,Ow=/^[^A-Z]*$/,kw=/^[^a-z]*$/,Aw=G(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),jw=e=>{let t=e.value;return!oS(t)&&t.length!==void 0},Mw={number:`number`,bigint:`bigint`,object:`date`},Nw=G(`$ZodCheckLessThan`,(e,t)=>{Aw.init(e,t);let n=Mw[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:Mw[typeof r.value]??n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Pw=G(`$ZodCheckGreaterThan`,(e,t)=>{Aw.init(e,t);let n=Mw[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:Mw[typeof r.value]??n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Fw=G(`$ZodCheckMultipleOf`,(e,t)=>{Aw.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):cS(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Iw=G(`$ZodCheckNumberFormat`,(e,t)=>{Aw.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=MS[t.format];e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),Lw=G(`$ZodCheckMaxLength`,(e,t)=>{var n;Aw.init(e,t),(n=e._zod.def).when??(n.when=jw),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?ZS(r):i)<=t.maximum)return;let a=QS(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Rw=G(`$ZodCheckMinLength`,(e,t)=>{var n;Aw.init(e,t),(n=e._zod.def).when??(n.when=jw),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?ZS(r):i)>=t.minimum)return;let a=QS(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),zw=G(`$ZodCheckLengthEquals`,(e,t)=>{var n;Aw.init(e,t),(n=e._zod.def).when??(n.when=jw),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?ZS(r):i;if(a===t.length)return;let o=QS(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Bw=G(`$ZodCheckStringFormat`,(e,t)=>{var n,r;Aw.init(e,t),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Vw=G(`$ZodCheckRegex`,(e,t)=>{Bw.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Hw=G(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Ow,Bw.init(e,t)}),Uw=G(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=kw,Bw.init(e,t)}),Ww=G(`$ZodCheckIncludes`,(e,t)=>{Aw.init(e,t);let n=DS(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Gw=G(`$ZodCheckStartsWith`,(e,t)=>{Aw.init(e,t);let n=RegExp(`^${DS(t.prefix)}.*`);t.pattern??=n,e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Kw=G(`$ZodCheckEndsWith`,(e,t)=>{Aw.init(e,t);let n=RegExp(`.*${DS(t.suffix)}$`);t.pattern??=n,e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});function qw(e,t,n){e.issues.length&&t.issues.push(...GS(n,e.issues))}var Jw=G(`$ZodCheckProperties`,(e,t)=>{Aw.init(e,t),rC(e,Symbol.iterator,function*(){yield e});let n;e._zod.check=r=>{if(r.value==null){r.issues.push({expected:`object`,code:`invalid_type`,input:r.value,inst:e});return}n??=Reflect.ownKeys(t.shape).map(e=>[e,t.shape[e]]);let i=r.value,a;for(let[e,t]of n){let n=t._zod.run({value:i[e],issues:[]},{});n instanceof Promise?(a??=[],a.push(n.then(t=>qw(t,r,e)))):qw(n,r,e)}if(a)return Promise.all(a).then(()=>void 0)}}),Yw=G(`$ZodCheckOverwrite`,(e,t)=>{Aw.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),Xw=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--this.indent}}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
43
|
+
at `))}function Yu(e,t){class n extends e{#e;constructor(...e){if(qu()){let t=Error.stackTraceLimit;Error.stackTraceLimit=0,super(...e),Error.stackTraceLimit=t}else super(...e);let t=Error().stack;t&&(this.#e=Ju(t.replace(/^Error/,this.name)))}get errorStack(){return this.#e}}return Object.defineProperty(n.prototype,"constructor",{get(){return t},enumerable:!1,configurable:!0}),n}var Xu={OK:200,CREATED:201,ACCEPTED:202,NO_CONTENT:204,MULTIPLE_CHOICES:300,MOVED_PERMANENTLY:301,FOUND:302,SEE_OTHER:303,NOT_MODIFIED:304,TEMPORARY_REDIRECT:307,BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,METHOD_NOT_ALLOWED:405,NOT_ACCEPTABLE:406,PROXY_AUTHENTICATION_REQUIRED:407,REQUEST_TIMEOUT:408,CONFLICT:409,GONE:410,LENGTH_REQUIRED:411,PRECONDITION_FAILED:412,PAYLOAD_TOO_LARGE:413,URI_TOO_LONG:414,UNSUPPORTED_MEDIA_TYPE:415,RANGE_NOT_SATISFIABLE:416,EXPECTATION_FAILED:417,"I'M_A_TEAPOT":418,MISDIRECTED_REQUEST:421,UNPROCESSABLE_ENTITY:422,LOCKED:423,FAILED_DEPENDENCY:424,TOO_EARLY:425,UPGRADE_REQUIRED:426,PRECONDITION_REQUIRED:428,TOO_MANY_REQUESTS:429,REQUEST_HEADER_FIELDS_TOO_LARGE:431,UNAVAILABLE_FOR_LEGAL_REASONS:451,INTERNAL_SERVER_ERROR:500,NOT_IMPLEMENTED:501,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,HTTP_VERSION_NOT_SUPPORTED:505,VARIANT_ALSO_NEGOTIATES:506,INSUFFICIENT_STORAGE:507,LOOP_DETECTED:508,NOT_EXTENDED:510,NETWORK_AUTHENTICATION_REQUIRED:511};Yu(class extends Error{status;body;headers;statusCode;constructor(e=`INTERNAL_SERVER_ERROR`,t=void 0,n={},r=typeof e==`number`?e:Xu[e]){super(t?.message,t?.cause?{cause:t.cause}:void 0),this.status=e,this.body=t,this.headers=n,this.statusCode=r,this.name=`APIError`,this.status=e,this.headers=n,this.statusCode=r,this.body=t}},Error);var Zu=class extends Error{constructor(e,t){super(e,t),this.name=`BetterAuthError`,this.message=e,this.stack=``}},Qu=47;function $u(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===Qu;)t--;return t===e.length?e:e.slice(0,t)}function ed(e){try{return($u(new URL(e).pathname)||`/`)!==`/`}catch{throw new Zu(`Invalid base URL: ${e}. Please provide a valid base URL.`)}}function td(e){try{let t=new URL(e);if(t.protocol!==`http:`&&t.protocol!==`https:`)throw new Zu(`Invalid base URL: ${e}. URL must include 'http://' or 'https://'`)}catch(t){throw t instanceof Zu?t:new Zu(`Invalid base URL: ${e}. Please provide a valid base URL.`,{cause:t})}}function nd(e,t=`/api/auth`){if(td(e),ed(e))return e;let n=$u(e);return!t||t===`/`?n:(t=t.startsWith(`/`)?t:`/${t}`,`${n}${t}`)}function rd(e,t){return!e||e.trim()===``?!1:t===`proto`?e===`http`||e===`https`:t===`host`?[/\.\./,/\0/,/[\s]/,/^[.]/,/[<>'"]/,/javascript:/i,/file:/i,/data:/i].some(t=>t.test(e))?!1:/^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*(:[0-9]{1,5})?$/.test(e)||/^(\d{1,3}\.){3}\d{1,3}(:[0-9]{1,5})?$/.test(e)||/^\[[0-9a-fA-F:]+\](:[0-9]{1,5})?$/.test(e)||/^localhost(:[0-9]{1,5})?$/i.test(e):!1}function id(e,t,n,r,i){if(e)return nd(e,t);if(r!==!1){let e=Gu.BETTER_AUTH_URL||Gu.NEXT_PUBLIC_BETTER_AUTH_URL||Gu.PUBLIC_BETTER_AUTH_URL||Gu.NUXT_PUBLIC_BETTER_AUTH_URL||Gu.NUXT_PUBLIC_AUTH_URL||(Gu.BASE_URL===`/`?void 0:Gu.BASE_URL);if(e)return nd(e,t)}let a=n?.headers.get(`x-forwarded-host`),o=n?.headers.get(`x-forwarded-proto`);if(a&&o&&i&&rd(o,`proto`)&&rd(a,`host`))try{return nd(`${o}://${a}`,t)}catch{}if(n){let e=ad(n.url);if(!e)throw new Zu(`Could not get origin from request. Please provide a valid base URL.`);return nd(e,t)}if(typeof window<`u`&&window.location)return nd(window.location.origin,t)}function ad(e){try{let t=new URL(e);return t.origin===`null`?null:t.origin}catch{return null}}var od={proto:/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,constructor:/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,protoShort:/"__proto__"\s*:/,constructorShort:/"constructor"\s*:/},sd=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,cd={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:1/0,"-infinity":-1/0},ld=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/;function ud(e){return e instanceof Date&&!isNaN(e.getTime())}function dd(e){let t=ld.exec(e);if(!t)return null;let[,n,r,i,a,o,s,c,l,u,d]=t,f=new Date(Date.UTC(parseInt(n,10),parseInt(r,10)-1,parseInt(i,10),parseInt(a,10),parseInt(o,10),parseInt(s,10),c?parseInt(c.padEnd(3,`0`),10):0));if(l){let e=(parseInt(u,10)*60+parseInt(d,10))*(l===`+`?-1:1);f.setUTCMinutes(f.getUTCMinutes()+e)}return ud(f)?f:null}function fd(e,t={}){let{strict:n=!1,warnings:r=!1,reviver:i,parseDates:a=!0}=t;if(typeof e!=`string`)return e;let o=e.trim(),s=o.toLowerCase();if(s.length<=9&&s in cd)return cd[s];if(!sd.test(o)){if(n)throw SyntaxError(`[better-json] Invalid JSON`);return e}if(Object.entries(od).some(([e,t])=>{let n=t.test(o);return n&&r&&console.warn(`[better-json] Detected potential prototype pollution attempt using ${e} pattern`),n})&&n)throw Error(`[better-json] Potential prototype pollution attempt detected`);try{return JSON.parse(o,(e,t)=>{if(e===`__proto__`||e===`constructor`&&t&&typeof t==`object`&&`prototype`in t)r&&console.warn(`[better-json] Dropping "${e}" key to prevent prototype pollution`);else{if(a&&typeof t==`string`){let e=dd(t);if(e)return e}return i?i(e,t):t}})}catch(t){if(n)throw t;return e}}function pd(e,t={strict:!0}){return fd(e,t)}var md=[`javascript:`,`data:`,`vbscript:`];function hd(e){let t;try{t=new URL(e)}catch{return!0}return!md.includes(t.protocol)}var gd={id:`redirect`,name:`Redirect`,hooks:{onSuccess(e){if(e.data?.url&&e.data?.redirect&&hd(e.data.url)&&typeof window<`u`&&window.location&&window.location)try{window.location.href=e.data.url}catch{}}}},_d=[],vd=0,yd=null,bd=4,xd=globalThis.nanostoresGlobal||={epoch:0},Sd=()=>{let e,t;for(;vd<_d.length;){t=vd,vd+=bd;let n=yd?.get(_d[t]);if(n){if(!n.has(_d[t+1]))continue;n.clear()}try{_d[t](_d[t+1].value,_d[t+2],_d[t+3])}catch(t){e=t}}if(_d.length=vd=0,e)throw e},Cd=e=>{let t=[],n={eq:Object.is,get(){return n.lc||n.listen(()=>{})(),n.value},init:e,lc:0,listen(e){return n.lc=t.push(e),()=>{yd?.get(e)?.delete(n);for(let t=vd;t<_d.length;)_d[t]===e&&_d[t+1]===n?_d.splice(t,bd):t+=bd;let r=t.indexOf(e);~r&&(t.splice(r,1),--n.lc||n.off())}},notify(e,r){xd.epoch++;let i=!_d.length&&!0;for(let i of t)_d.push(i,n,e,r);i&&Sd()},off(){},set(e){let t=n.value;n.eq(t,e)||(n.value=e,n.notify(t))},subscribe(e){let t=n.listen(e);return e(n.value),t},value:e};return n},wd=2,Td=5,Ed=6,Dd=10,Od=(e,t,n,r)=>(e.events=e.events||{},e.events[n+Dd]||(e.events[n+Dd]=r(t=>{e.events[n].reduceRight((e,t)=>(t(e),e),{shared:{},...t})})),e.events[n]=e.events[n]||[],e.events[n].push(t),()=>{let r=e.events[n],i=r.indexOf(t);~i&&(r.splice(i,1),r.length||(e.events[n+Dd](),delete e.events[n+Dd]))}),kd=(e,t)=>Od(e,t,wd,t=>{let n=e.set,r=e.setKey;return e.setKey&&=(n,i)=>{let a;if(t({abort:()=>{a=!0},changed:n,newValue:{...e.value,[n]:i}}),!a)return r(n,i)},e.set=e=>{let r;if(t({abort:()=>{r=!0},newValue:e}),!r)return n(e)},()=>{e.set=n,e.setKey=r}}),Ad=1e3,jd=(e,t)=>Od(e,n=>{let r=t(n);r&&e.events[Ed].push(r)},Td,t=>{let n=e.listen;e.listen=(...r)=>(!e.lc&&!e.active&&(e.active=!0,t()),n(...r));let r=e.off;return e.events[Ed]=[],e.off=()=>{r(),setTimeout(()=>{if(e.active&&!e.lc){e.active=!1;for(let t of e.events[Ed])t();e.events[Ed]=[]}},Ad)},()=>{e.listen=n,e.off=r}});function Md(e,t){let n=Pd(t),r=e;for(let e of n){if(r==null)return;r=r[e]}return r}var Nd=/(.*)\[(\d+)\]/;function Pd(e){return e.split(`.`).flatMap(e=>Fd(e))}function Fd(e){if(Nd.test(e)){let[,t,n]=e.match(Nd);return[...Fd(t),n]}return[e]}function Id(e,t,n){let r=new Set(t);return e.listen((i,a,o)=>{let s=e=>!Object.is(Md(i,e),Md(a,e));(o===void 0?t.some(t=>a===void 0||(e.eqKey?!e.eqKey(a[t],i[t],t):s(t))):r.has(o)||typeof o==`string`&&(r.has(o.split(/\.|\[/)[0])||!e.eqKey&&a!==void 0&&t.some(s)))&&n(i,a,o)})}function Ld(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Rd(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Rd(e[n],t[n]))return!1;return!0}if(Ld(e)&&Ld(t)){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!(r in t)||!Rd(e[r],t[r]))return!1;return!0}return!1}function zd(e,t){return kd(e,({newValue:n,abort:r})=>{t(e.value,n)&&r()})}var Bd=Symbol.for(`better-auth:auth-query`);function Vd(e){return Bd in e&&e[Bd]===!0}function Hd(e){let t=Cd(e);return Object.defineProperty(t,Bd,{value:!0}),t}var Ud=Symbol.for(`better-auth:broadcast-channel`),Wd=()=>Math.floor(Date.now()/1e3),Gd=class{listeners=new Set;name;constructor(e=`better-auth.message`){this.name=e}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}post(e){if(typeof window<`u`)try{localStorage.setItem(this.name,JSON.stringify({...e,timestamp:Wd()}))}catch{}}setup(){if(typeof window>`u`||window.addEventListener===void 0)return()=>{};let e=e=>{if(e.key!==this.name)return;let t=JSON.parse(e.newValue??`{}`);t?.event===`session`&&t?.data&&this.listeners.forEach(e=>e(t))};return window.addEventListener(`storage`,e),()=>{window.removeEventListener(`storage`,e)}}};function Kd(e=`better-auth.message`){return globalThis[Ud]||(globalThis[Ud]=new Gd(e)),globalThis[Ud]}var qd=Symbol.for(`better-auth:focus-manager`),Jd=class{listeners=new Set;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setFocused(e){this.listeners.forEach(t=>t(e))}setup(){if(typeof window>`u`||typeof document>`u`||window.addEventListener===void 0)return()=>{};let e=()=>{document.visibilityState===`visible`&&this.setFocused(!0)};return document.addEventListener(`visibilitychange`,e,!1),()=>{document.removeEventListener(`visibilitychange`,e,!1)}}};function Yd(){return globalThis[qd]||(globalThis[qd]=new Jd),globalThis[qd]}var Xd=Symbol.for(`better-auth:online-manager`),Zd=class{listeners=new Set;isOnline=typeof navigator<`u`?navigator.onLine:!0;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setOnline(e){this.isOnline=e,this.listeners.forEach(t=>t(e))}setup(){if(typeof window>`u`||window.addEventListener===void 0)return()=>{};let e=()=>this.setOnline(!0),t=()=>this.setOnline(!1);return window.addEventListener(`online`,e,!1),window.addEventListener(`offline`,t,!1),()=>{window.removeEventListener(`online`,e,!1),window.removeEventListener(`offline`,t,!1)}}};function Qd(){return globalThis[Xd]||(globalThis[Xd]=new Zd),globalThis[Xd]}var $d=()=>Math.floor(Date.now()/1e3),ef=5;function tf(e){let{fetchSession:t,shouldPollSession:n=()=>!0,sessionSignal:r,options:i={}}=e,a=i.sessionOptions?.refetchInterval??0,o=i.sessionOptions?.refetchOnWindowFocus??!0,s=i.sessionOptions?.refetchWhenOffline??!1,c={isInitialized:!1,lastSessionRequest:0},l=()=>s||Qd().isOnline,u=e=>{if(l()){if(e?.event===`storage`)t();else if(e?.event===`poll`)c.lastSessionRequest=$d(),t();else if(e?.event===`visibilitychange`){if($d()-c.lastSessionRequest<ef)return;c.lastSessionRequest=$d(),t()}else t()}},d=e=>{Kd().post({event:`session`,data:{trigger:e},clientId:Math.random().toString(36).substring(7)})},f=()=>{a&&a>0&&(c.pollInterval=setInterval(()=>{n()&&u({event:`poll`})},a*1e3))},p=()=>{c.unsubscribeBroadcast=Kd().subscribe(()=>{u({event:`storage`})})},m=()=>{o&&(c.unsubscribeFocus=Yd().subscribe(()=>{u({event:`visibilitychange`})}))},h=()=>{c.unsubscribeOnline=Qd().subscribe(e=>{e&&u({event:`visibilitychange`})})},g=()=>{c.unsubscribeSignal=r.listen(()=>{t()})};return{init:()=>{c.isInitialized||(c.isInitialized=!0,f(),p(),m(),h(),g(),c.cleanupBroadcastSetup=Kd().setup(),c.cleanupFocusSetup=Yd().setup(),c.cleanupOnlineSetup=Qd().setup())},cleanup:()=>{c.isInitialized&&(c.pollInterval&&=(clearInterval(c.pollInterval),void 0),c.unsubscribeBroadcast&&=(c.unsubscribeBroadcast(),void 0),c.unsubscribeFocus&&=(c.unsubscribeFocus(),void 0),c.unsubscribeOnline&&=(c.unsubscribeOnline(),void 0),c.unsubscribeSignal&&=(c.unsubscribeSignal(),void 0),c.cleanupBroadcastSetup&&=(c.cleanupBroadcastSetup(),void 0),c.cleanupFocusSetup&&=(c.cleanupFocusSetup(),void 0),c.cleanupOnlineSetup&&=(c.cleanupOnlineSetup(),void 0),c.isInitialized=!1,c.lastSessionRequest=0)},triggerRefetch:u,broadcastSessionUpdate:d}}var nf=()=>typeof window>`u`,rf=Ad;function af(e,t){if(typeof window>`u`)return;let n=e.get();n.data===null&&t!==null&&e.set({...n,data:t,error:null,isPending:!1})}function of(e){return typeof e==`object`&&e&&`data`in e&&`error`in e?e:{data:e,error:null}}function sf(e){return!e||e.session===null&&e.user===null?null:e}function cf(e,t){return Rd(e.data,t.data)&&e.error===t.error&&e.isPending===t.isPending&&e.isRefetching===t.isRefetching&&e.refetch===t.refetch}function lf(e,t){let n=Cd(!1),r,i=0,a=0;n.listen(()=>{a++,i=0});let o=e=>u(e),s=Hd({data:null,error:null,isPending:!0,isRefetching:!1,refetch:o});zd(s,cf);let c=async(t,n)=>{let r=s.value;if(s.set({...r,isPending:r.data===null,isRefetching:!0,error:null,refetch:o}),t.aborted)return`aborted`;try{let r=await e(`/get-session`,{method:`GET`,query:n?.query,signal:t});if(t.aborted)return`aborted`;let{data:i,error:a}=of(r),c=`fresh`;if(i?.needsRefresh)try{let n=await e(`/get-session`,{method:`POST`,signal:t});if(t.aborted)return`aborted`;({data:i,error:a}=of(n))}catch{if(t.aborted)return`aborted`;c=`stale`}if(a){let e=s.value,t=a?.status===401;return s.set({data:t?null:e.data,error:a,isPending:!1,isRefetching:!1,refetch:o}),`failed`}let l=sf(i),u=s.value,d=u.data!=null&&l!=null&&Rd(u.data,l)?u.data:l;return s.set({data:d,error:null,isPending:!1,isRefetching:!1,refetch:o}),c}catch(e){if(t.aborted)return`aborted`;let n=s.value;return s.set({data:n.data,error:e,isPending:!1,isRefetching:!1,refetch:o}),`failed`}},l=()=>{let e=s.value.data?.session?.expiresAt,t=e instanceof Date?e.getTime():1/0;return Math.min(Date.now()+rf,t)},u=e=>{i=0,r?.cancel();let t=new AbortController,n={cancel:()=>t.abort(),promise:Promise.resolve().then(()=>t.signal.aborted?`aborted`:c(t.signal,e)),revision:a};r=n;let o=e=>{r===n&&(r=void 0,e===`fresh`&&n.revision===a&&(i=l()))};return n.promise.then(o,()=>o(`failed`)),n.promise.then(()=>void 0)},d=()=>r?.revision===a?r.promise.then(()=>void 0):Date.now()<i?Promise.resolve():u(),f=()=>{};return jd(s,()=>{let e;nf()||(e=setTimeout(()=>{d()},0));let r=tf({fetchSession:u,shouldPollSession:()=>s.value.data!=null,sessionSignal:n,options:t});return r.init(),f=r.broadcastSessionUpdate,()=>{e&&clearTimeout(e),r.cleanup()}}),{session:s,$sessionSignal:n,broadcastSessionUpdate:e=>f(e)}}function uf(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)===`[object Module]`:!0}function df(e,t,n=`.`,r){if(!uf(t))return df(e,{},n,r);let i={...t};for(let t of Object.keys(e)){if(t===`__proto__`||t===`constructor`)continue;let a=e[t];a!=null&&(r&&r(i,t,a,n)||(i[t]=Array.isArray(a)&&Array.isArray(i[t])?[...a,...i[t]]:uf(a)&&uf(i[t])?df(a,i[t],(n?`${n}.`:``)+t.toString(),r):a))}return i}function ff(e){return(...t)=>t.reduce((t,n)=>df(t,n,``,e),{})}var pf=ff(),mf=class extends Error{constructor(e,t,n){super(t||e.toString(),{cause:n}),this.status=e,this.statusText=t,this.error=n,Error.captureStackTrace(this,this.constructor)}},hf=async(e,t)=>{let n=t||{},r={onRequest:[t?.onRequest],onResponse:[t?.onResponse],onSuccess:[t?.onSuccess],onError:[t?.onError],onRetry:[t?.onRetry]};if(!t||!t?.plugins)return{url:e,options:n,hooks:r};for(let i of t?.plugins||[]){if(i.init){let t=await i.init?.call(i,e.toString(),n);n=t.options||n,e=t.url}r.onRequest.push(i.hooks?.onRequest),r.onResponse.push(i.hooks?.onResponse),r.onSuccess.push(i.hooks?.onSuccess),r.onError.push(i.hooks?.onError),r.onRetry.push(i.hooks?.onRetry)}return{url:e,options:n,hooks:r}},gf=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(){return this.options.delay}},_f=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(e){return Math.min(this.options.maxDelay,this.options.baseDelay*2**e)}};function vf(e){if(typeof e==`number`)return new gf({type:`linear`,attempts:e,delay:1e3});switch(e.type){case`linear`:return new gf(e);case`exponential`:return new _f(e);default:throw Error(`Invalid retry strategy`)}}var yf=[`get`,`post`,`put`,`patch`,`delete`];function bf(e){if(!e.startsWith(`@`))return{method:void 0,path:e};let t=e.indexOf(`/`),n=e.slice(1,t===-1?void 0:t);return yf.includes(n)?{method:n,path:t===-1?e:e.slice(t+1)}:{method:void 0,path:e}}var xf=e=>e===`.`||e===`..`,Sf=e=>e.split(`:`).map(e=>encodeURIComponent(e)).join(`:`);function Cf(e,t){let n=t.get(e);if(n===void 0)return Sf(e);if(xf(n))throw TypeError(`Path parameters cannot be reserved path segments`);return encodeURIComponent(n)}function wf(e,t){let{baseURL:n,params:r,query:i}=t||{query:{},params:{},baseURL:``},a=e.startsWith(`http`)?e.split(`/`).slice(0,3).join(`/`):n||``,{path:o}=bf(e);o!==e&&(e=`/${o}`),a.endsWith(`/`)||(a+=`/`);let[s,c]=e.replace(a,``).split(`?`),l=new URLSearchParams(c);for(let[e,t]of Object.entries(i||{})){if(t==null)continue;let n;if(typeof t==`string`)n=t;else if(Array.isArray(t)){for(let n of t)l.append(e,n);continue}else n=JSON.stringify(t);l.set(e,n)}let u=new Map;if(r){if(Array.isArray(r)){let e=s.split(`/`).filter(e=>e.startsWith(`:`));for(let[t,n]of e.entries()){let e=r[t];u.set(n,String(e))}}else for(let[e,t]of Object.entries(r))u.set(`:${e}`,String(t))}s=s.split(`/`).map(e=>Cf(e,u)).join(`/`),s=s.replace(/^\/+/,``);let d=l.toString();return d=d.length>0?`?${d}`.replace(/\+/g,`%20`):``,a.startsWith(`http`)?new URL(`${s}${d}`,a):`${a}${s}${d}`}var Tf=async e=>{let t={},n=async e=>typeof e==`function`?await e():e;if(e?.auth){if(e.auth.type===`Bearer`){let r=await n(e.auth.token);if(!r)return t;t.authorization=`Bearer ${r}`}else if(e.auth.type===`Basic`){let[r,i]=await Promise.all([n(e.auth.username),n(e.auth.password)]);if(!r||!i)return t;t.authorization=`Basic ${btoa(`${r}:${i}`)}`}else if(e.auth.type===`Custom`){let[r,i]=await Promise.all([n(e.auth.prefix),n(e.auth.value)]);if(!i)return t;t.authorization=`${r??``} ${i}`}}return t},Ef=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function Df(e){let t=e.headers.get(`content-type`),n=new Set([`image/svg`,`application/xml`,`application/xhtml`,`application/html`]);if(!t)return`json`;let r=t.split(`;`).shift()||``;return Ef.test(r)?`json`:n.has(r)||r.startsWith(`text/`)?`text`:`blob`}function Of(e){try{return JSON.parse(e),!0}catch{return!1}}function kf(e){if(e===void 0)return!1;let t=typeof e;return t===`string`||t===`number`||t===`boolean`||t===null?!0:t===`object`?Array.isArray(e)?!0:e.buffer?!1:e.constructor&&e.constructor.name===`Object`||typeof e.toJSON==`function`:!1}function Af(e){try{return JSON.parse(e)}catch{return e}}function jf(e){return typeof e==`function`}function Mf(e){if(e?.customFetchImpl)return e.customFetchImpl;if(typeof globalThis<`u`&&jf(globalThis.fetch))return globalThis.fetch;if(typeof window<`u`&&jf(window.fetch))return window.fetch;throw Error(`No fetch implementation found`)}function Nf(...e){let t={};for(let n of e)if(n){if(n instanceof Headers)n.forEach((e,n)=>{t[n]=e});else{let e=Array.isArray(n)?n:Object.entries(n);for(let[n,r]of e)r!=null&&(t[n]=r)}}return t}async function Pf(e){let t=new Headers(Nf(e?.headers,await Tf(e)));if(!t.has(`content-type`)){let n=Ff(e?.body);n&&t.set(`content-type`,n)}return t}function Ff(e){return kf(e)?`application/json`:null}function If(e){let t=e.get(`content-type`);return t?t.split(`;`)[0].trim().toLowerCase():null}function Lf(e,t){let{body:n}=e;return n?!kf(n)||typeof n==`string`?n:If(t)===`application/x-www-form-urlencoded`?new URLSearchParams(n).toString():JSON.stringify(n):null}function Rf(e,t){if(t?.method)return t.method.toUpperCase();let{method:n}=bf(e);return n?n.toUpperCase():t?.body?`POST`:`GET`}function zf(e,t){let n;return!e?.signal&&e?.timeout&&(n=setTimeout(()=>t?.abort(),e?.timeout)),{abortTimeout:n,clearTimeout:()=>{n&&clearTimeout(n)}}}var Bf=class e extends Error{constructor(t,n){super(n||JSON.stringify(t,null,2)),this.issues=t,Object.setPrototypeOf(this,e.prototype)}};async function Vf(e,t){let n=await e[`~standard`].validate(t);if(n.issues)throw new Bf(n.issues);return n.value}function Hf(e){"@babel/helpers - typeof";return Hf=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Hf(e)}function Uf(e,t){if(Hf(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Hf(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Wf(e){var t=Uf(e,`string`);return Hf(t)==`symbol`?t:t+``}function Gf(e,t,n){return(t=Wf(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Kf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function qf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Kf(Object(n),!0).forEach(function(t){Gf(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Kf(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Jf=async(e,t)=>{var n;let{hooks:r,url:i,options:a}=await hf(e,t),o=Mf(a),s=new AbortController,c=a.signal??s.signal,l=wf(i,a),u=await Pf(a),d=Lf(a,u),f=Rf(i,a),p=qf(qf({},a),{},{url:l,headers:u,body:d,method:f,signal:c});for(let e of r.onRequest)if(e){let t=await e(p);typeof t==`object`&&t&&Object.assign(p,t)}(`pipeTo`in p&&typeof p.pipeTo==`function`||typeof(t==null||(n=t.body)==null?void 0:n.pipe)==`function`)&&(`duplex`in p||(p.duplex=`half`));let{clearTimeout:m}=zf(a,s),h=await o(p.url,p);m();let g={response:h,request:p};for(let e of r.onResponse)if(e){var _;let n=await e(qf(qf({},g),{},{response:t!=null&&(_=t.hookOptions)!=null&&_.cloneResponse?h.clone():h}));n instanceof Response?h=n:typeof n==`object`&&n&&(h=n.response)}if(h.ok){if(p.method===`HEAD`)return{data:``,error:null};let e=Df(h),n={data:null,response:h,request:p};if(e===`json`||e===`text`){let e=await h.text();n.data=await(p.jsonParser??Af)(e)}else n.data=await h[e]();p?.output&&p.output&&!p.disableValidation&&(n.data=await Vf(p.output,n.data));for(let e of r.onSuccess)if(e){var v;await e(qf(qf({},n),{},{response:t!=null&&(v=t.hookOptions)!=null&&v.cloneResponse?h.clone():h}))}return t?.throw?n.data:{data:n.data,error:null}}let y=t?.jsonParser??Af,b=await h.text(),x=Of(b),S=x?await y(b):null,C={response:h,responseText:b,request:p,error:qf(qf({},S),{},{status:h.status,statusText:h.statusText})};for(let e of r.onError)if(e){var w;await e(qf(qf({},C),{},{response:t!=null&&(w=t.hookOptions)!=null&&w.cloneResponse?h.clone():h}))}if(t?.retry){let n=vf(t.retry),i=t.retryAttempt??0;if(await n.shouldAttemptRetry(i,h)){for(let e of r.onRetry)e&&await e(g);let a=n.getDelay(i);return await new Promise(e=>setTimeout(e,a)),await Jf(e,qf(qf({},t),{},{retryAttempt:i+1}))}}if(t?.throw)throw new mf(h.status,h.statusText,x?S:b);return{data:null,error:qf(qf({},S),{},{status:h.status,statusText:h.statusText})}},Yf=e=>({id:`apply-schema`,name:`Apply Schema`,version:`1.0.0`,async init(t,n){var r;let i=qf(qf({},n),e.query!==void 0&&{query:qf(qf({},e.query),n?.query)}),a=((r=e.plugins)==null||(r=r.find(e=>e.schema?.config?t.startsWith(e.schema.config.baseURL||``)||t.startsWith(e.schema.config.prefix||``):!1))==null?void 0:r.schema)||e.schema;if(a){let r=t;a.config?.prefix&&r.startsWith(a.config.prefix)&&(r=r.replace(a.config.prefix,``),a.config.baseURL&&(t=t.replace(a.config.prefix,a.config.baseURL))),a.config?.baseURL&&r.startsWith(a.config.baseURL)&&(r=r.replace(a.config.baseURL,``)),r.startsWith(`/`)&&r.charAt(1)===`@`&&(r=r.substring(1));let o=a.schema[r];if(o){let{method:a,path:s}=bf(r);a&&(t=t.slice(0,t.length-r.length)+s);let c=n?.headers;if(o.headers&&!n?.disableValidation){let e={};if(n?.headers){if(n.headers instanceof Headers)n.headers.forEach((t,n)=>{e[n.toLowerCase()]=t});else if(typeof n.headers==`object`)for(let[t,r]of Object.entries(n.headers))r!=null&&(e[t.toLowerCase()]=r)}let t=await Vf(o.headers,e),r={};for(let[e,n]of Object.entries(t))r[e.toLowerCase()]=n;c=r}let l=o.method??a;if(i=qf(qf(qf(qf({},i),l!==void 0&&{method:l}),o.output!==void 0&&{output:o.output}),c!==void 0&&{headers:c}),!n?.disableValidation){if(o.query&&(i.query=await Vf(o.query,n?.query),i.query!==null&&typeof i.query==`object`)){let t=qf({},e.query);for(let e of Object.keys(t))n?.query&&Object.prototype.hasOwnProperty.call(n.query,e)&&(t[e]=n.query[e]);i.query=qf(qf({},t),i.query)}i=qf(qf({},i),{},{body:o.input?await Vf(o.input,n?.body):n?.body,params:o.params?await Vf(o.params,n?.params):n?.params})}return{url:t,options:i}}}return qf({url:t},(n!==void 0||e.query!==void 0)&&{options:i})}}),Xf=e=>{async function t(t,n){let r=qf(qf(qf({},e),n),{},{headers:Nf(e?.headers,n?.headers),plugins:[...e?.plugins||[],Yf(e||{}),...n?.plugins||[]]});if(e?.catchAllError)try{return await Jf(t,r)}catch(e){return{data:null,error:{status:500,statusText:`Fetch Error`,message:`Fetch related error. Captured by catchAllError option. See error property for more details.`,error:e}}}return await Jf(t,r)}return t},Zf=e=>{if(typeof process>`u`)return;let t=e??`/api/auth`;if({}.NEXT_PUBLIC_AUTH_URL)return{}.NEXT_PUBLIC_AUTH_URL;if(typeof window>`u`){if({}.NEXTAUTH_URL)try{return{}.NEXTAUTH_URL}catch{}if({}.VERCEL_URL)try{let e={}.VERCEL_URL.startsWith(`http`)?``:`https://`;return`${new URL(`${e}${{}.VERCEL_URL}`).origin}${t}`}catch{}}},Qf=e=>e===`/sign-out`||e===`/update-user`||e===`/update-session`||e===`/sign-up/email`||e===`/sign-in/email`||e===`/delete-user`||e===`/verify-email`||e===`/revoke-sessions`||e===`/revoke-session`||e===`/revoke-other-sessions`||e===`/change-email`||e===`/change-password`,$f=(e,t)=>{let n=`credentials`in Request.prototype,r=id(e?.baseURL,e?.basePath,void 0,t)??Zf(e?.basePath)??`/api/auth`,i=e?.plugins?.flatMap(e=>e.fetchPlugins).filter(e=>e!==void 0)||[],a={id:`lifecycle-hooks`,name:`lifecycle-hooks`,hooks:{onSuccess:e?.fetchOptions?.onSuccess,onError:e?.fetchOptions?.onError,onRequest:e?.fetchOptions?.onRequest,onResponse:e?.fetchOptions?.onResponse}},{onSuccess:o,onError:s,onRequest:c,onResponse:l,...u}=e?.fetchOptions||{},d=Xf({baseURL:r,...n?{credentials:`include`}:{},method:`GET`,jsonParser(e){return e?pd(e,{strict:!1}):null},customFetchImpl:fetch,...u,plugins:[a,...u.plugins||[],...e?.disableDefaultFetchPlugins?[]:[gd],...i]}),{$sessionSignal:f,session:p,broadcastSessionUpdate:m}=lf(d,e),h=!1,g=e=>{h||e===null||(h=!0,af(p,e))},_=e?.plugins||[],v={},y={$sessionSignal:f,session:p},b={"/sign-out":`POST`,"/revoke-sessions":`POST`,"/revoke-other-sessions":`POST`,"/delete-user":`POST`},x=[{signal:`$sessionSignal`,matcher:Qf,callback(e){e===`/sign-out`?m(`signout`):(e===`/update-user`||e===`/update-session`)&&m(`updateUser`)}}];for(let e of _)e.getAtoms&&Object.assign(y,e.getAtoms?.(d)),e.pathMethods&&Object.assign(b,e.pathMethods),e.atomListeners&&x.push(...e.atomListeners);let S={notify:e=>{y[e].set(!y[e].get())},listen:(e,t)=>{y[e].subscribe(t)},atoms:y};for(let t of _)t.getActions&&(v=pf(t.getActions?.(d,S,e)??{},v));return{get baseURL(){return r},pluginsActions:v,pluginsAtoms:y,pluginPathMethods:b,atomListeners:x,hydrateSession:g,$sessionSignal:f,$fetch:d,$store:S}};function ep(e){return typeof e==`object`&&!!e&&`get`in e&&typeof e.get==`function`&&`lc`in e&&typeof e.lc==`number`}function tp(e){return e.charAt(0).toUpperCase()+e.slice(1)}var np=/[\p{Ll}\d]+|\p{Lu}+(?!\p{Ll})|\p{Lu}[\p{Ll}\d]+|\p{Lo}+/gu,rp=/['\u2019]/g;function ip(e){return e.replace(rp,``).match(np)??[]}function ap(e){return ip(e).map(e=>e.toLowerCase()).join(`-`)}function op(e,t,n){let r=t[e],{fetchOptions:i,query:a,...o}=n||{};return r||(i?.method?i.method:o&&Object.keys(o).length>0?`POST`:`GET`)}function sp(e,t,n,r,i){function a(o=[]){return new Proxy(function(){},{get(t,n){if(typeof n!=`string`||n===`then`||n===`catch`||n===`finally`)return;let r=[...o,n],i=e;for(let e of r)if(i&&typeof i==`object`&&e in i)i=i[e];else{i=void 0;break}return typeof i==`function`||ep(i)?i:a(r)},apply:async(e,a,s)=>{let c=`/`+o.map(ap).join(`/`),l=s[0]||{},u=s[1]||{},{query:d,fetchOptions:f,...p}=l,m={...u,...f},h=op(c,n,l);return await t(c,{...m,body:h===`GET`?void 0:{...p,...m?.body||{}},query:d||m?.query,method:h,async onSuccess(e){if(await m?.onSuccess?.(e),!i||m.disableSignal)return;let t=i.filter(e=>e.matcher(c));if(!t.length)return;let n=new Set;for(let e of t){let t=r[e.signal];if(!t)return;if(n.has(e.signal))continue;n.add(e.signal);let i=t.get();setTimeout(()=>{t.set(!i)},10),e.callback?.(c)}}})}})}return a()}function cp(e,t={}){let n=(0,f.useRef)(e.get()),{keys:r,deps:i=[e,r]}=t,a=(0,f.useCallback)(t=>{let i=e=>{n.current!==e&&(n.current=e,t())};return i(e.value),r?.length?Id(e,r,i):e.listen(i)},i),o=()=>n.current;return(0,f.useSyncExternalStore)(a,o,Vd(e)?()=>e.init:o)}function lp(e){return`use${tp(e)}`}function up(e){let{pluginPathMethods:t,pluginsActions:n,pluginsAtoms:r,hydrateSession:i,$fetch:a,$store:o,atomListeners:s}=$f(e),c={};for(let[e,t]of Object.entries(r))c[lp(e)]=()=>cp(t);return sp({...n,...c,hydrateSession:i,$fetch:a,$store:o},a,t,r,s)}var dp=e=>`[SonamuProvider] ${e} is not configured. Please provide ${e} configuration to SonamuProvider.`,fp=()=>()=>{throw Error(dp(`uploader`))};function pp(){let e=new Map(Object.entries(Hu));return t=>e.get(t)??t}var mp=(0,f.createContext)({uploader:fp(),SD:pp()});function hp({children:e,auth:t,...n}){let r={uploader:n.uploader??fp(),auth:t,SD:n.SD??pp()};return(0,H.jsx)(mp.Provider,{value:r,children:e})}function gp({children:e,authOptions:t,...n}){let[r]=(0,f.useState)(()=>up(t));return(0,H.jsx)(hp,{...n,auth:n.auth??r,children:e})}function _p({children:e,authOptions:t,...n}){return t===void 0?(0,H.jsx)(hp,{...n,children:e}):(0,H.jsx)(gp,{...n,authOptions:t,children:e})}function vp(){return(0,f.useContext)(mp)}var yp=(0,f.forwardRef)(({title:e,titleId:t,...n},r)=>(0,H.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,H.jsx)(`title`,{id:t,children:e}):null,(0,H.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M18 6L6 18M6 6l12 12`})]})),bp=pa;function xp({container:e,...t}){let n=Gn();return(0,H.jsx)(ya,{container:e??n,...t})}var Sp=f.forwardRef(({className:e,...t},n)=>(0,H.jsx)(xa,{ref:n,className:V(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...t}));Sp.displayName=xa.displayName;var Cp=f.forwardRef(({className:e,children:t,...n},r)=>(0,H.jsxs)(xp,{children:[(0,H.jsx)(Sp,{}),(0,H.jsxs)(Ta,{ref:r,className:V(`fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg`,e),...n,children:[t,(0,H.jsxs)(Ma,{className:`absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground`,children:[(0,H.jsx)(yp,{className:`h-4 w-4`}),(0,H.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]}));Cp.displayName=Ta.displayName;var wp=({className:e,...t})=>(0,H.jsx)(`div`,{className:V(`flex flex-col space-y-1.5 text-center sm:text-left`,e),...t});wp.displayName=`DialogHeader`;var Tp=({className:e,...t})=>(0,H.jsx)(`div`,{className:V(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,e),...t});Tp.displayName=`DialogFooter`;var Ep=f.forwardRef(({className:e,...t},n)=>(0,H.jsx)(ka,{ref:n,className:V(`text-lg font-semibold leading-none tracking-tight`,e),...t}));Ep.displayName=ka.displayName;var Dp=f.forwardRef(({className:e,...t},n)=>(0,H.jsx)(Aa,{ref:n,className:V(`text-sm text-muted-foreground`,e),...t}));Dp.displayName=Aa.displayName;var Op=(0,f.forwardRef)(({title:e,titleId:t,...n},r)=>(0,H.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,H.jsx)(`title`,{id:t,children:e}):null,(0,H.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,H.jsx)(`path`,{d:`m21 21l-4.34-4.34`}),(0,H.jsx)(`circle`,{cx:11,cy:11,r:8})]})]})),kp=1,Ap=.9,jp=.8,Mp=.17,Np=.1,Pp=.999,Fp=.9999,Ip=.99,Lp=/[\\\/_+.#"@\[\(\{&]/,Rp=/[\\\/_+.#"@\[\(\{&]/g,zp=/[\s-]/,Bp=/[\s-]/g;function Vp(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?kp:Ip;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=Vp(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=kp:Lp.test(e.charAt(l-1))?(d*=jp,p=e.slice(i,l-1).match(Rp),p&&i>0&&(d*=Pp**+p.length)):zp.test(e.charAt(l-1))?(d*=Ap,m=e.slice(i,l-1).match(Bp),m&&i>0&&(d*=Pp**+m.length)):(d*=Mp,i>0&&(d*=Pp**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=Fp)),(d<Np&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=Vp(e,t,n,r,l+1,a+2,o),f*Np>d&&(d=f*Np)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function Hp(e){return e.toLowerCase().replace(Bp,` `)}function Up(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,Vp(e,t,Hp(e),Hp(t),0,0,{})}function Wp(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Gp(...e){return t=>{let n=!1,r=e.map(e=>{let r=Wp(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Wp(e[t],null)}}}}var Kp=Symbol.for(`react.lazy`),qp=f.use;function Jp(e){return typeof e==`object`&&!!e&&`then`in e}function Yp(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Kp&&`_payload`in e&&Jp(e._payload)}function Xp(e){let t=Zp(e),n=f.forwardRef((e,n)=>{let{children:r,...i}=e;Yp(r)&&typeof qp==`function`&&(r=qp(r._payload));let a=f.Children.toArray(r),o=a.find($p);if(o){let e=o.props.children,r=a.map(t=>t===o?f.Children.count(e)>1?f.Children.only(null):f.isValidElement(e)?e.props.children:null:t);return(0,H.jsx)(t,{...i,ref:n,children:f.isValidElement(e)?f.cloneElement(e,void 0,r):null})}return(0,H.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function Zp(e){let t=f.forwardRef((e,t)=>{let{children:n,...r}=e;if(Yp(n)&&typeof qp==`function`&&(n=qp(n._payload)),f.isValidElement(n)){let e=tm(n),i=em(r,n.props);return n.type!==f.Fragment&&(i.ref=t?Gp(t,e):e),f.cloneElement(n,i)}return f.Children.count(n)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Qp=Symbol(`radix.slottable`);function $p(e){return f.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Qp}function em(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function tm(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var nm=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Xp(`Primitive.${t}`),r=f.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,H.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),rm=globalThis?.document?f.useLayoutEffect:()=>{},im=f.useId||(()=>void 0),am=0;function om(e){let[t,n]=f.useState(im());return rm(()=>{e||n(e=>e??String(am++))},[e]),e||(t?`radix-${t}`:``)}var sm=`[cmdk-group=""]`,cm=`[cmdk-group-items=""]`,lm=`[cmdk-group-heading=""]`,um=`[cmdk-item=""]`,dm=`${um}:not([aria-disabled="true"])`,fm=`cmdk-item-select`,pm=`data-value`,mm=(e,t,n)=>Up(e,t,n),hm=f.createContext(void 0),gm=()=>f.useContext(hm),_m=f.createContext(void 0),vm=()=>f.useContext(_m),ym=f.createContext(void 0),bm=f.forwardRef((e,t)=>{let n=Pm(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=Pm(()=>new Set),i=Pm(()=>new Map),a=Pm(()=>new Map),o=Pm(()=>new Set),s=Mm(e),{label:c,children:l,value:u,onValueChange:d,filter:p,shouldFilter:m,loop:h,disablePointerSelection:g=!1,vimBindings:_=!0,...v}=e,y=om(),b=om(),x=om(),S=f.useRef(null),C=Lm();Nm(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,w.emit()}},[u]),Nm(()=>{C(6,A)},[]);let w=f.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)k(),D(),C(1,O);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(x);e?e.focus():(i=document.getElementById(y))==null||i.focus()}if(C(7,()=>{n.current.selectedItemId=j()?.id,w.emit()}),r||C(5,A),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}w.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),T=f.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,E(t,r)),C(2,()=>{D(),w.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),C(3,()=>{k(),D(),n.current.value||O(),w.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=j();C(4,()=>{k(),t?.getAttribute(`id`)===e&&O(),w.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:y,inputId:x,labelId:b,listInnerRef:S}),[]);function E(e,t){let r=s.current?.filter??mm;return e?r(e,n.current.search,t):0}function D(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=S.current;M().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(cm);t?t.appendChild(e.parentElement===t?e:e.closest(`${cm} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${cm} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=S.current?.querySelector(`${sm}[${pm}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function O(){let e=M().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(pm);w.setState(`value`,e||void 0)}function k(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=E(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function A(){var e;let t=j();t&&(t.parentElement?.firstChild===t&&((e=t.closest(sm)?.querySelector(lm))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function j(){return S.current?.querySelector(`${um}[aria-selected="true"]`)}function M(){return Array.from(S.current?.querySelectorAll(dm)||[])}function N(e){let t=M()[e];t&&w.setState(`value`,t.getAttribute(pm))}function P(e){var t;let n=j(),r=M(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&w.setState(`value`,a.getAttribute(pm))}function F(e){let t=j()?.closest(sm),n;for(;t&&!n;)t=e>0?Am(t,sm):jm(t,sm),n=t?.querySelector(dm);n?w.setState(`value`,n.getAttribute(pm)):P(e)}let I=()=>N(M().length-1),L=e=>{e.preventDefault(),e.metaKey?I():e.altKey?F(1):P(1)},R=e=>{e.preventDefault(),e.metaKey?N(0):e.altKey?F(-1):P(-1)};return f.createElement(nm.div,{ref:t,tabIndex:-1,...v,"cmdk-root":``,onKeyDown:e=>{var t;(t=v.onKeyDown)==null||t.call(v,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:_&&e.ctrlKey&&L(e);break;case`ArrowDown`:L(e);break;case`p`:case`k`:_&&e.ctrlKey&&R(e);break;case`ArrowUp`:R(e);break;case`Home`:e.preventDefault(),N(0);break;case`End`:e.preventDefault(),I();break;case`Enter`:{e.preventDefault();let t=j();if(t){let e=new Event(fm);t.dispatchEvent(e)}}}}},f.createElement(`label`,{"cmdk-label":``,htmlFor:T.inputId,id:T.labelId,style:Bm},c),zm(e,e=>f.createElement(_m.Provider,{value:w},f.createElement(hm.Provider,{value:T},e))))}),xm=f.forwardRef((e,t)=>{let n=om(),r=f.useRef(null),i=f.useContext(ym),a=gm(),o=Mm(e),s=o.current?.forceMount??i?.forceMount;Nm(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=Im(n,r,[e.value,e.children,r],e.keywords),l=vm(),u=Fm(e=>e.value&&e.value===c.current),d=Fm(e=>s||a.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);f.useEffect(()=>{let t=r.current;if(t&&!e.disabled)return t.addEventListener(fm,p),()=>t.removeEventListener(fm,p)},[d,e.onSelect,e.disabled]);function p(){var e,t;m(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function m(){l.setState(`value`,c.current,!0)}if(!d)return null;let{disabled:h,value:g,onSelect:_,forceMount:v,keywords:y,...b}=e;return f.createElement(nm.div,{ref:Gp(r,t),...b,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!h,"aria-selected":!!u,"data-disabled":!!h,"data-selected":!!u,onPointerMove:h||a.getDisablePointerSelection()?void 0:m,onClick:h?void 0:p},e.children)}),Sm=f.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=om(),s=f.useRef(null),c=f.useRef(null),l=om(),u=gm(),d=Fm(e=>i||u.filter()===!1?!0:!e.search||e.filtered.groups.has(o));Nm(()=>u.group(o),[]),Im(o,s,[e.value,e.heading,c]);let p=f.useMemo(()=>({id:o,forceMount:i}),[i]);return f.createElement(nm.div,{ref:Gp(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:!d||void 0},n&&f.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),zm(e,e=>f.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},f.createElement(ym.Provider,{value:p},e))))}),Cm=f.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=f.useRef(null),a=Fm(e=>!e.search);return!n&&!a?null:f.createElement(nm.div,{ref:Gp(i,t),...r,"cmdk-separator":``,role:`separator`})}),wm=f.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=vm(),o=Fm(e=>e.search),s=Fm(e=>e.selectedItemId),c=gm();return f.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),f.createElement(nm.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),Tm=f.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=f.useRef(null),o=f.useRef(null),s=Fm(e=>e.selectedItemId),c=gm();return f.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),f.createElement(nm.div,{ref:Gp(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},zm(e,e=>f.createElement(`div`,{ref:Gp(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),Em=f.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return f.createElement(pa,{open:n,onOpenChange:r},f.createElement(ya,{container:o},f.createElement(xa,{"cmdk-overlay":``,className:i}),f.createElement(Ta,{"aria-label":e.label,"cmdk-dialog":``,className:a},f.createElement(bm,{ref:t,...s}))))}),Dm=f.forwardRef((e,t)=>Fm(e=>e.filtered.count===0)?f.createElement(nm.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),Om=f.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return f.createElement(nm.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},zm(e,e=>f.createElement(`div`,{"aria-hidden":!0},e)))}),km=Object.assign(bm,{List:Tm,Item:xm,Input:wm,Group:Sm,Separator:Cm,Dialog:Em,Empty:Dm,Loading:Om});function Am(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function jm(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Mm(e){let t=f.useRef(e);return Nm(()=>{t.current=e}),t}var Nm=typeof window>`u`?f.useEffect:f.useLayoutEffect;function Pm(e){let t=f.useRef();return t.current===void 0&&(t.current=e()),t}function Fm(e){let t=vm(),n=()=>e(t.snapshot());return f.useSyncExternalStore(t.subscribe,n,n)}function Im(e,t,n,r=[]){let i=f.useRef(),a=gm();return Nm(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(pm,s),i.current=s}),i}var Lm=()=>{let[e,t]=f.useState(),n=Pm(()=>new Map);return Nm(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function Rm(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function zm({asChild:e,children:t},n){return e&&f.isValidElement(t)?f.cloneElement(Rm(t),{ref:t.ref},n(t.props.children)):n(t)}var Bm={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`},Vm=f.forwardRef(({className:e,...t},n)=>(0,H.jsx)(km,{ref:n,className:V(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,e),...t}));Vm.displayName=km.displayName;var Hm=({children:e,commandProps:t,...n})=>{let{className:r,...i}=t??{};return(0,H.jsx)(bp,{...n,children:(0,H.jsx)(Cp,{className:`overflow-hidden p-0 shadow-lg`,children:(0,H.jsx)(Vm,{className:V(`**:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 **:[[cmdk-group]]:px-2 **:[[cmdk-input-wrapper]_svg]:size-5 **:[[cmdk-input]]:h-12 **:[[cmdk-item]]:px-2 **:[[cmdk-item]]:py-3 **:[[cmdk-item]_svg]:size-5`,r),...i,children:e})})})},Um=f.forwardRef(({className:e,...t},n)=>(0,H.jsxs)(`div`,{className:`flex items-center border-b px-3`,"cmdk-input-wrapper":``,children:[(0,H.jsx)(Op,{className:`mr-2 h-4 w-4 shrink-0 opacity-50`}),(0,H.jsx)(km.Input,{ref:n,className:V(`flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50`,e),...t})]}));Um.displayName=km.Input.displayName;var Wm=f.forwardRef(({className:e,...t},n)=>(0,H.jsx)(km.List,{ref:n,className:V(`max-h-[300px] overflow-y-auto overflow-x-hidden`,e),...t}));Wm.displayName=km.List.displayName;var Gm=f.forwardRef((e,t)=>(0,H.jsx)(km.Empty,{ref:t,className:`py-6 text-center text-sm`,...e}));Gm.displayName=km.Empty.displayName;var Km=f.forwardRef(({className:e,...t},n)=>(0,H.jsx)(km.Group,{ref:n,className:V(`overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground`,e),...t}));Km.displayName=km.Group.displayName;var qm=f.forwardRef(({className:e,...t},n)=>(0,H.jsx)(km.Separator,{ref:n,className:V(`-mx-1 h-px bg-border`,e),...t}));qm.displayName=km.Separator.displayName;var Jm=f.forwardRef(({className:e,...t},n)=>(0,H.jsx)(km.Item,{ref:n,className:V(`relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 **:[svg]:pointer-events-none **:[svg]:size-4 **:[svg]:shrink-0`,e),...t}));Jm.displayName=km.Item.displayName;var Ym=[`top`,`right`,`bottom`,`left`],Xm=Math.min,Zm=Math.max,Qm=Math.round,$m=Math.floor,eh=e=>({x:e,y:e}),th={left:`right`,right:`left`,bottom:`top`,top:`bottom`},nh={start:`end`,end:`start`};function rh(e,t,n){return Zm(e,Xm(t,n))}function ih(e,t){return typeof e==`function`?e(t):e}function ah(e){return e.split(`-`)[0]}function oh(e){return e.split(`-`)[1]}function sh(e){return e===`x`?`y`:`x`}function ch(e){return e===`y`?`height`:`width`}var lh=new Set([`top`,`bottom`]);function uh(e){return lh.has(ah(e))?`y`:`x`}function dh(e){return sh(uh(e))}function fh(e,t,n){n===void 0&&(n=!1);let r=oh(e),i=dh(e),a=ch(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=xh(o)),[o,xh(o)]}function ph(e){let t=xh(e);return[mh(e),t,mh(t)]}function mh(e){return e.replace(/start|end/g,e=>nh[e])}var hh=[`left`,`right`],gh=[`right`,`left`],_h=[`top`,`bottom`],vh=[`bottom`,`top`];function yh(e,t,n){switch(e){case`top`:case`bottom`:return n?t?gh:hh:t?hh:gh;case`left`:case`right`:return t?_h:vh;default:return[]}}function bh(e,t,n,r){let i=oh(e),a=yh(ah(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(mh)))),a}function xh(e){return e.replace(/left|right|bottom|top/g,e=>th[e])}function Sh(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ch(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Sh(e)}function wh(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Th(e,t,n){let{reference:r,floating:i}=e,a=uh(t),o=dh(t),s=ch(o),c=ah(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(oh(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1)}return p}var Eh=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=a.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Th(l,r,c),f=r,p={},m=0;for(let n=0;n<s.length;n++){let{name:a,fn:h}=s[n],{x:g,y:_,data:v,reset:y}=await h({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:p,rects:l,platform:o,elements:{reference:e,floating:t}});u=g??u,d=_??d,p={...p,[a]:{...p[a],...v}},y&&m<=50&&(m++,typeof y==`object`&&(y.placement&&(f=y.placement),y.rects&&(l=y.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):y.rects),{x:u,y:d}=Th(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:p}};async function Dh(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=ih(t,e),p=Ch(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=wh(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=wh(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Oh=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=ih(e,t)||{};if(l==null)return{};let d=Ch(u),f={x:n,y:r},p=dh(i),m=ch(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;C&&await(o.isElement==null?void 0:o.isElement(S))||(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=Xm(d[_],T),D=Xm(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=rh(O,A,k),M=!c.arrow&&oh(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),kh=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=ih(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=ah(r),_=uh(o),v=ah(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[xh(o)]:ph(o)),x=p!==`none`;!d&&x&&b.push(...bh(o,m,p,y));let S=[o,...b],C=await Dh(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=fh(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===uh(t)||T.every(e=>uh(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=uh(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function Ah(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function jh(e){return Ym.some(t=>e[t]>=0)}var Mh=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n}=t,{strategy:r=`referenceHidden`,...i}=ih(e,t);switch(r){case`referenceHidden`:{let e=Ah(await Dh(t,{...i,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:jh(e)}}}case`escaped`:{let e=Ah(await Dh(t,{...i,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:jh(e)}}}default:return{}}}}},Nh=new Set([`left`,`top`]);async function Ph(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=ah(n),s=oh(n),c=uh(n)===`y`,l=Nh.has(o)?-1:1,u=a&&c?-1:1,d=ih(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Fh=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Ph(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Ih=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=ih(e,t),l={x:n,y:r},u=await Dh(t,c),d=uh(ah(i)),f=sh(d),p=l[f],m=l[d];if(a){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=p+u[e],r=p-u[t];p=rh(n,p,r)}if(o){let e=d===`y`?`top`:`left`,t=d===`y`?`bottom`:`right`,n=m+u[e],r=m-u[t];m=rh(n,m,r)}let h=s.fn({...t,[f]:p,[d]:m});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[f]:a,[d]:o}}}}}},Lh=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=ih(e,t),u={x:n,y:r},d=uh(i),f=sh(d),p=u[f],m=u[d],h=ih(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Nh.has(ah(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Rh=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=ih(e,t),u=await Dh(t,l),d=ah(i),f=oh(i),p=uh(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=Xm(h-u[g],v),x=Xm(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=Zm(u.left,0),t=Zm(u.right,0),n=Zm(u.top,0),r=Zm(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:Zm(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:Zm(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function zh(){return typeof window<`u`}function Bh(e){return Uh(e)?(e.nodeName||``).toLowerCase():`#document`}function Vh(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Hh(e){return((Uh(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Uh(e){return zh()?e instanceof Node||e instanceof Vh(e).Node:!1}function Wh(e){return zh()?e instanceof Element||e instanceof Vh(e).Element:!1}function Gh(e){return zh()?e instanceof HTMLElement||e instanceof Vh(e).HTMLElement:!1}function Kh(e){return!zh()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Vh(e).ShadowRoot}var qh=new Set([`inline`,`contents`]);function Jh(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=ag(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!qh.has(i)}var Yh=new Set([`table`,`td`,`th`]);function Xh(e){return Yh.has(Bh(e))}var Zh=[`:popover-open`,`:modal`];function Qh(e){return Zh.some(t=>{try{return e.matches(t)}catch{return!1}})}var $h=[`transform`,`translate`,`scale`,`rotate`,`perspective`],eg=[`transform`,`translate`,`scale`,`rotate`,`perspective`,`filter`],tg=[`paint`,`layout`,`strict`,`content`];function ng(e){let t=rg(),n=Wh(e)?ag(e):e;return $h.some(e=>n[e]?n[e]!==`none`:!1)||(n.containerType?n.containerType!==`normal`:!1)||!t&&(n.backdropFilter?n.backdropFilter!==`none`:!1)||!t&&(n.filter?n.filter!==`none`:!1)||eg.some(e=>(n.willChange||``).includes(e))||tg.some(e=>(n.contain||``).includes(e))}function eee(e){let t=sg(e);for(;Gh(t)&&!ig(t);){if(ng(t))return t;if(Qh(t))return null;t=sg(t)}return null}function rg(){return typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter`,`none`)}var tee=new Set([`html`,`body`,`#document`]);function ig(e){return tee.has(Bh(e))}function ag(e){return Vh(e).getComputedStyle(e)}function og(e){return Wh(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function sg(e){if(Bh(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Kh(e)&&e.host||Hh(e);return Kh(t)?t.host:t}function cg(e){let t=sg(e);return ig(t)?e.ownerDocument?e.ownerDocument.body:e.body:Gh(t)&&Jh(t)?t:cg(t)}function lg(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=cg(e),i=r===e.ownerDocument?.body,a=Vh(r);if(i){let e=ug(a);return t.concat(a,a.visualViewport||[],Jh(r)?r:[],e&&n?lg(e):[])}return t.concat(r,lg(r,[],n))}function ug(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function dg(e){let t=ag(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Gh(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Qm(n)!==a||Qm(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function fg(e){return Wh(e)?e:e.contextElement}function pg(e){let t=fg(e);if(!Gh(t))return eh(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=dg(t),o=(a?Qm(n.width):n.width)/r,s=(a?Qm(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}var nee=eh(0);function mg(e){let t=Vh(e);return!rg()||!t.visualViewport?nee:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ree(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Vh(e)?!1:t}function hg(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=fg(e),o=eh(1);t&&(r?Wh(r)&&(o=pg(r)):o=pg(e));let s=ree(a,n,r)?mg(a):eh(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=Vh(a),t=r&&Wh(r)?Vh(r):r,n=e,i=ug(n);for(;i&&r&&t!==n;){let e=pg(i),t=i.getBoundingClientRect(),r=ag(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Vh(i),i=ug(n)}}return wh({width:u,height:d,x:c,y:l})}function gg(e,t){let n=og(e).scrollLeft;return t?t.left+n:hg(Hh(e)).left+n}function _g(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-gg(e,n),y:n.top+t.scrollTop}}function iee(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Hh(r),s=t?Qh(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=eh(1),u=eh(0),d=Gh(r);if((d||!d&&!a)&&((Bh(r)!==`body`||Jh(o))&&(c=og(r)),Gh(r))){let e=hg(r);l=pg(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?_g(o,c):eh(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function aee(e){return Array.from(e.getClientRects())}function oee(e){let t=Hh(e),n=og(e),r=e.ownerDocument.body,i=Zm(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Zm(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+gg(e),s=-n.scrollTop;return ag(r).direction===`rtl`&&(o+=Zm(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var vg=25;function yg(e,t){let n=Vh(e),r=Hh(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=rg();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=gg(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=vg&&(a-=o)}else l<=vg&&(a+=l);return{width:a,height:o,x:s,y:c}}var bg=new Set([`absolute`,`fixed`]);function xg(e,t){let n=hg(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Gh(e)?pg(e):eh(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Sg(e,t,n){let r;if(t===`viewport`)r=yg(e,n);else if(t===`document`)r=oee(Hh(e));else if(Wh(t))r=xg(t,n);else{let n=mg(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return wh(r)}function Cg(e,t){let n=sg(e);return n===t||!Wh(n)||ig(n)?!1:ag(n).position===`fixed`||Cg(n,t)}function wg(e,t){let n=t.get(e);if(n)return n;let r=lg(e,[],!1).filter(e=>Wh(e)&&Bh(e)!==`body`),i=null,a=ag(e).position===`fixed`,o=a?sg(e):e;for(;Wh(o)&&!ig(o);){let t=ag(o),n=ng(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&bg.has(i.position)||Jh(o)&&!n&&Cg(e,o))?r=r.filter(e=>e!==o):i=t,o=sg(o)}return t.set(e,r),r}function Tg(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Qh(t)?[]:wg(t,this._c):[].concat(n),r],o=a[0],s=a.reduce((e,n)=>{let r=Sg(t,n,i);return e.top=Zm(r.top,e.top),e.right=Xm(r.right,e.right),e.bottom=Xm(r.bottom,e.bottom),e.left=Zm(r.left,e.left),e},Sg(t,o,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function Eg(e){let{width:t,height:n}=dg(e);return{width:t,height:n}}function Dg(e,t,n){let r=Gh(t),i=Hh(t),a=n===`fixed`,o=hg(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=eh(0);function l(){c.x=gg(i)}if(r||!r&&!a){if((Bh(t)!==`body`||Jh(i))&&(s=og(t)),r){let e=hg(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l()}a&&!r&&i&&l();let u=i&&!r&&!a?_g(i,s):eh(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Og(e){return ag(e).position===`static`}function kg(e,t){if(!Gh(e)||ag(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Hh(e)===n&&(n=n.ownerDocument.body),n}function Ag(e,t){let n=Vh(e);if(Qh(e))return n;if(!Gh(e)){let t=sg(e);for(;t&&!ig(t);){if(Wh(t)&&!Og(t))return t;t=sg(t)}return n}let r=kg(e,t);for(;r&&Xh(r)&&Og(r);)r=kg(r,t);return r&&ig(r)&&Og(r)&&!ng(r)?n:r||eee(e)||n}var jg=async function(e){let t=this.getOffsetParent||Ag,n=this.getDimensions,r=await n(e.floating);return{reference:Dg(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Mg(e){return ag(e).direction===`rtl`}var Ng={convertOffsetParentRelativeRectToViewportRelativeRect:iee,getDocumentElement:Hh,getClippingRect:Tg,getOffsetParent:Ag,getElementRects:jg,getClientRects:aee,getDimensions:Eg,getScale:pg,isElement:Wh,isRTL:Mg};function Pg(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Fg(e,t){let n=null,r,i=Hh(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=$m(d),h=$m(i.clientWidth-(u+f)),g=$m(i.clientHeight-(d+p)),_=$m(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Zm(0,Xm(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!Pg(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function Ig(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=fg(e),u=i||a?[...l?lg(l):[],...lg(t)]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Fg(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),p.observe(t));let m,h=c?hg(e):null;c&&g();function g(){let t=hg(e);h&&!Pg(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Lg=Fh,Rg=Ih,zg=kh,Bg=Rh,Vg=Mh,Hg=Oh,Ug=Lh,Wg=(e,t,n)=>{let r=new Map,i={platform:Ng,...n},a={...i.platform,_c:r};return Eh(e,t,{...i,platform:a})},Gg=typeof document<`u`?f.useLayoutEffect:function(){};function Kg(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Kg(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Kg(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function qg(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Jg(e,t){let n=qg(e);return Math.round(t*n)/n}function Yg(e){let t=f.useRef(e);return Gg(()=>{t.current=e}),t}function Xg(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=f.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=f.useState(r);Kg(p,r)||m(r);let[h,g]=f.useState(null),[_,v]=f.useState(null),y=f.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=f.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||h,S=o||_,C=f.useRef(null),w=f.useRef(null),T=f.useRef(u),E=c!=null,D=Yg(c),O=Yg(i),k=Yg(l),A=f.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:p};O.current&&(e.platform=O.current),Wg(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!Kg(T.current,t)&&(T.current=t,_n.flushSync(()=>{d(t)}))})},[p,t,n,O,k]);Gg(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=f.useRef(!1);Gg(()=>(j.current=!0,()=>{j.current=!1}),[]),Gg(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=f.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=f.useMemo(()=>({reference:x,floating:S}),[x,S]),P=f.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=Jg(N.floating,u.x),r=Jg(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...qg(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return f.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var Zg=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Hg({element:r.current,padding:i}).fn(n):r?Hg({element:r,padding:i}).fn(n):{}}}},Qg=(e,t)=>({...Lg(e),options:[e,t]}),$g=(e,t)=>({...Rg(e),options:[e,t]}),e_=(e,t)=>({...Ug(e),options:[e,t]}),t_=(e,t)=>({...zg(e),options:[e,t]}),n_=(e,t)=>({...Bg(e),options:[e,t]}),r_=(e,t)=>({...Vg(e),options:[e,t]}),i_=(e,t)=>({...Zg(e),options:[e,t]}),a_=Object.defineProperty,o_=(e,t)=>a_(e,`name`,{value:t,configurable:!0}),s_={Partial:`partial`,Always:`always`},c_={Optimized:`optimized`,Always:`always`},l_=`Popper`,[u_,d_]=st(l_),[f_,p_]=u_(l_),m_=o_(e=>{let{__scopePopper:t,children:n}=e,[r,i]=f.useState(null),[a,o]=f.useState(void 0);return(0,H.jsx)(f_,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),h_=`PopperAnchor`,g_=f.forwardRef(o_(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=p_(h_,n),o=f.useRef(null),s=a.onAnchorChange,c=pt(t,f.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=f.useRef(null);f.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&S_(a.placementState),d=u?.[0],p=u?.[1];return r?null:(0,H.jsx)(bn.div,{"data-radix-popper-side":d,"data-radix-popper-align":p,...i,ref:c})},`PopperAnchor`)),__=`PopperContent`,[v_,see]=u_(__),y_=f.forwardRef(o_(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=s_.Partial,hideWhenDetached:p=!1,updatePositionStrategy:m=c_.Optimized,onPlaced:h,...g}=e,_=p_(__,n),[v,y]=f.useState(null),b=pt(t,y),[x,S]=f.useState(null),C=Su(x),w=C?.width??0,T=C?.height??0,E=r+(a===`center`?``:`-`+a),D=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(l)?l:[l],k=O.length>0,A={padding:D,boundary:O.filter(b_),altBoundary:k},{refs:j,floatingStyles:M,placement:N,isPositioned:P,middlewareData:F}=Xg({strategy:`fixed`,placement:E,whileElementsMounted:o_((...e)=>Ig(...e,{animationFrame:m===c_.Always}),`whileElementsMounted`),elements:{reference:_.anchor},middleware:[Qg({mainAxis:i+T,alignmentAxis:o}),c&&$g({mainAxis:!0,crossAxis:!1,...d===s_.Partial?{limiter:e_()}:{},...A}),c&&t_({...A}),n_({...A,apply:o_(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),x&&i_({element:x,padding:s}),x_({arrowWidth:w,arrowHeight:T}),p&&r_(k?{strategy:`referenceHidden`,...A}:{strategy:`referenceHidden`,padding:A.padding,altBoundary:A.altBoundary})]}),I=_.setPlacementState;Mt(()=>(I(N),()=>{I(void 0)}),[N,I]);let[L,R]=S_(N),z=Qn(h);Mt(()=>{P&&z?.()},[P,z]);let ee=F.arrow?.x,te=F.arrow?.y,ne=F.arrow?.centerOffset!==0,[re,ie]=f.useState();return Mt(()=>{v&&ie(window.getComputedStyle(v).zIndex)},[v]),(0,H.jsx)(`div`,{ref:j.setFloating,"data-radix-popper-content-wrapper":``,style:{...M,transform:P?M.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:re,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(` `),...F.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,H.jsx)(v_,{scope:n,placedSide:L,placedAlign:R,onArrowChange:S,arrowX:ee,arrowY:te,shouldHideArrow:ne,children:(0,H.jsx)(bn.div,{"data-side":L,"data-align":R,...g,ref:b,style:{...g.style,animation:P?g.style?.animation:`none`}})})})},`PopperContent`));function b_(e){return e!==null}o_(b_,`isNotNull`);var x_=o_(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=S_(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function S_(e){let[t,n=`center`]=e.split(`-`);return[t,n]}o_(S_,`getSideAndAlignFromPlacement`);var C_=Object.defineProperty,w_=(e,t)=>C_(e,`name`,{value:t,configurable:!0}),T_=`Popover`,[E_,cee]=st(T_,[d_]),D_=d_(),[O_,k_]=E_(T_),A_=w_(e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=D_(t),c=f.useRef(null),[l,u]=f.useState(!1),[d,p]=f.useState(0),[m,h]=f.useState(0),[g,_]=un({prop:r,defaultProp:i??!1,onChange:a,caller:T_});return(0,H.jsx)(m_,{...s,children:(0,H.jsx)(O_,{scope:t,contentId:Fn(),titleId:Fn(),descriptionId:Fn(),titlePresent:d>0,descriptionPresent:m>0,setTitleCount:p,setDescriptionCount:h,triggerRef:c,open:g,onOpenChange:_,onOpenToggle:f.useCallback(()=>_(e=>!e),[_]),hasCustomAnchor:l,onCustomAnchorAdd:f.useCallback(()=>u(!0),[]),onCustomAnchorRemove:f.useCallback(()=>u(!1),[]),modal:o,children:n})})},`Popover`),j_=`PopoverTrigger`,M_=f.forwardRef(w_(function(e,t){let{__scopePopover:n,...r}=e,i=k_(j_,n),a=D_(n),o=pt(t,i.triggerRef),s=(0,H.jsx)(bn.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":V_(i.open),...r,ref:o,onClick:Xt(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,H.jsx)(g_,{asChild:!0,...a,children:s})},`PopoverTrigger`)),N_=`PopoverPortal`,[P_,F_]=E_(N_,{forceMount:void 0}),I_=w_(e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=k_(N_,t);return(0,H.jsx)(P_,{scope:t,forceMount:n,children:(0,H.jsx)(Tn,{present:n||a.open,children:(0,H.jsx)(Fr,{asChild:!0,container:i,children:r})})})},`PopoverPortal`),L_=`PopoverContent`,R_=f.forwardRef(w_(function(e,t){let n=F_(L_,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=k_(L_,e.__scopePopover);return(0,H.jsx)(Tn,{present:r||a.open,children:a.modal?(0,H.jsx)(lee,{...i,ref:t}):(0,H.jsx)(uee,{...i,ref:t})})},`PopoverContent`)),z_=gt(`PopoverContent.RemoveScroll`),lee=f.forwardRef(w_(function(e,t){let n=k_(L_,e.__scopePopover),r=f.useRef(null),i=pt(t,r),a=f.useRef(!1),{nodes:o,registry:s}=xr();return f.useEffect(()=>{let e=r.current;if(e)return aa(e)},[]),(0,H.jsx)(Xi,{as:z_,allowPinchZoom:!0,shards:f.useMemo(()=>[r,...o.map(e=>({current:e}))],[r,o]),children:(0,H.jsx)(B_,{...e,ref:i,branchNodes:o,branchRegistry:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Xt(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Xt(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;a.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:Xt(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),uee=f.forwardRef(w_(function(e,t){let n=k_(L_,e.__scopePopover),r=f.useRef(!1),i=f.useRef(!1);return(0,H.jsx)(B_,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`PopoverContentNonModal`)),B_=f.forwardRef(w_(function(e,t){let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,"aria-describedby":d,branchNodes:p,branchRegistry:m,...h}=e,g=k_(L_,n),_=D_(n),[v,y]=f.useState(null),b=pt(t,y);return Sr(v),Vr(),(0,H.jsx)(br,{registry:m,children:(0,H.jsx)(vr,{asChild:!0,loop:!0,trapped:r,branches:p,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,H.jsx)(or,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>g.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,H.jsx)(y_,{"data-state":V_(g.open),role:`dialog`,id:g.contentId,"aria-labelledby":g.titlePresent?g.titleId:void 0,"aria-describedby":g.descriptionPresent?H_(d,g.descriptionId):d,..._,...h,ref:b,style:{...h.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)`}})})})})},`PopoverContentImpl`));function V_(e){return e?`open`:`closed`}w_(V_,`getState`);function H_(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}w_(H_,`concatAriaDescribedby`);function U_({...e}){return(0,H.jsx)(A_,{"data-slot":`popover`,...e})}function W_({...e}){return(0,H.jsx)(M_,{"data-slot":`popover-trigger`,...e})}function G_({className:e,align:t=`center`,sideOffset:n=4,...r}){let i=Gn();return(0,H.jsx)(I_,{container:i,children:(0,H.jsx)(R_,{"data-slot":`popover-content`,align:t,sideOffset:n,className:V(`bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden`,e),...r})})}var K_=(0,f.forwardRef)(({title:e,titleId:t,...n},r)=>(0,H.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,H.jsx)(`title`,{id:t,children:e}):null,(0,H.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,H.jsx)(`circle`,{cx:12,cy:12,r:10}),(0,H.jsx)(`path`,{d:`m15 9l-6 6m0-6l6 6`})]})]})),dee=0;function q_(e,t){let n=`atom${++dee}`,r={toString(){return n}};return typeof e==`function`?r.read=e:(r.init=e,r.read=fee,r.write=pee),t&&(r.write=t),r}function fee(e){return e(this)}function pee(e,t,n){return t(this,typeof n==`function`?n(e(this)):n)}function J_(e){return`init`in e}function mee(e){return typeof e.write==`function`}function hee(e){return!!e.onMount}function Y_(e){return`v`in e||`e`in e}function X_(e){if(`e`in e)throw e.e;return e.v}function Z_(e){return typeof e?.then==`function`}function gee(e){if(!(e instanceof Error))return!1;let t=e.name,n=e.message.toLowerCase();return(t===`RangeError`||t===`InternalError`)&&(n.includes(`call stack`)||n.includes(`too much recursion`)||n.includes(`stack overflow`))}function Q_(e,t,n){if(!n.p.has(e)){n.p.add(e);let r=()=>n.p.delete(e);t.then(r,r)}}function $_(e,t,n){let r=n.get(e)?.t,i=t.p;if(!r?.size)return i;if(!i.size)return r;let a=new Set(r);for(let e of i)a.add(e);return a}function _ee(e){return!!e.INTERNAL_onInit}var vee=(e,t,n,...r)=>n.read(...r),yee=(e,t,n,...r)=>n.write(...r),bee=(e,t,n)=>n.INTERNAL_onInit(t),xee=(e,t,n,r)=>n.onMount?.(r),See=(e,t,n)=>{let r=e.a,i=r.get(n);if(!i){let a=e.h,o=e.I;i={d:new Map,p:new Set,n:0},r.set(n,i),a.i?.(n),_ee(n)&&o(e,t,n)}return i},Cee=(e,t)=>{let n=e.m,r=e.c,i=e.q,a=e.Q,o=e.h,s=e.C;if(!o.f&&!r.size&&!i.size&&!a.size)return;let c=[],l=e=>{try{e()}catch(e){c.push(e)}};do{o.f&&l(o.f);let c=new Set;for(let e of r){let t=n.get(e)?.l;if(t)for(let e of t)c.add(e)}r.clear();for(let e of a)c.add(e);a.clear();for(let e of i)c.add(e);i.clear();for(let e of c)l(e);r.size&&s(e,t)}while(r.size||a.size||i.size);if(c.length)throw typeof AggregateError==`function`?AggregateError(c):Object.assign(Error(),{errors:c})},wee=(e,t)=>{let n=e.m,r=e.i,i=e.c,a=e.e,o=e.r,s=e.D;if(!i.size)return;let c=[],l=[],u=new WeakSet,d=new WeakSet,f=[],p=[];for(let n of i)f.push(n),p.push(a(e,t,n));for(;f.length;){let i=f.length-1,o=f[i],s=p[i];if(d.has(o))f.pop(),p.pop();else if(u.has(o))r.get(o)===s.n&&(c.push(o),l.push(s)),d.add(o),f.pop(),p.pop();else{u.add(o);for(let r of $_(o,s,n))u.has(r)||(f.push(r),p.push(a(e,t,r)))}}for(let n=c.length-1;n>=0;--n){let a=c[n],u=l[n],d=!1;for(let e of u.d.keys())if(e!==a&&i.has(e)){d=!0;break}d&&(r.set(a,u.n),o(e,t,a),s(e,t,a)),r.delete(a)}},Tee=(e,t,n)=>{let r=e.m,i=e.i,a=e.c,o=e.h,s=e.R,c=e.e,l=e.f,u=e.C,d=e.r,f=e.D,p=e.v,m=e.H,h=e.E,g=c(e,t,n),_=h[0];if(Y_(g)){if(r.has(n)&&i.get(n)!==g.n||g.m===_)return g.m=_,g;let a=!1;for(let[n,r]of g.d)if(d(e,t,n).n!==r){a=!0;break}if(!a)return g.m=_,g}let v=!0,y=new Set(g.d.keys()),b=()=>{for(let e of y)g.d.delete(e)},x=()=>{if(r.has(n)){let r=!a.size;f(e,t,n),r&&(u(e,t),l(e,t))}},S=i=>{if(i===n){let n=c(e,t,i);if(!Y_(n)){if(J_(i))p(e,t,i,i.init);else throw Error(`no atom init`)}return X_(n)}let a=d(e,t,i);try{return X_(a)}finally{y.delete(i),g.d.set(i,a.n),Z_(g.v)&&Q_(n,g.v,a),r.has(n)&&r.get(i)?.t.add(n),v||x()}},C,w={get signal(){return C||=new AbortController,C.signal}},T=g.n,E=i.get(n)===T;try{let r=s(e,t,n,S,w);if(p(e,t,n,r),Z_(r)){m(e,t,r,()=>C?.abort());let n=()=>{b(),x()};r.then(n,n)}else b();return o.r?.(n),g.m=_,g}catch(e){if(gee(e))throw e;return delete g.v,g.e=e,++g.n,g.m=_,g}finally{v=!1,g.n!==T&&E&&(i.set(n,g.n),a.add(n),o.c?.(n))}},Eee=(e,t,n)=>{let r=e.m,i=e.i,a=e.e,o=[n];for(;o.length;){let n=o.pop(),s=a(e,t,n);for(let c of $_(n,s,r)){let n=a(e,t,c);i.get(c)!==n.n&&(i.set(c,n.n),o.push(c))}}},Dee=(e,t,n,r)=>{let i=e.c,a=e.h,o=e.W,s=e.e,c=e.f,l=e.C,u=e.r,d=e.d,f=e.w,p=e.D,m=e.v,h=e.E,g=!0,_=n=>X_(u(e,t,n)),v=(r,...o)=>{let u=s(e,t,r);try{if(r===n){if(!J_(r))throw Error(`atom not writable`);let n=u.n,s=o[0];m(e,t,r,s),p(e,t,r),n!==u.n&&(++h[0],i.add(r),d(e,t,r),a.c?.(r));return}return f(e,t,r,o)}finally{g||(l(e,t),c(e,t))}};try{return o(e,t,n,_,v,...r)}finally{g=!1}},Oee=(e,t,n)=>{let r=e.m,i=e.c,a=e.h,o=e.e,s=e.d,c=e.t,l=e.T,u=o(e,t,n),d=r.get(n);if(d&&u.d.size>0){for(let[r,l]of u.d)if(!d.d.has(r)){let u=o(e,t,r);c(e,t,r).t.add(n),d.d.add(r),l!==u.n&&(i.add(r),s(e,t,r),a.c?.(r))}for(let r of d.d)u.d.has(r)||(d.d.delete(r),l(e,t,r)?.t.delete(n))}},kee=(e,t,n)=>{let r=e.m,i=e.q,a=e.h,o=e.M,s=e.e,c=e.f,l=e.C,u=e.r,d=e.w,f=e.t,p=s(e,t,n),m=r.get(n);if(!m){u(e,t,n);for(let r of p.d.keys())f(e,t,r).t.add(n);m={l:new Set,d:new Set(p.d.keys()),t:new Set},r.set(n,m),mee(n)&&hee(n)&&i.add(()=>{let r=!0,i=(...i)=>{try{return d(e,t,n,i)}finally{r||(l(e,t),c(e,t))}};try{let a=o(e,t,n,i);a&&(m.u=()=>{r=!0;try{a()}finally{r=!1}})}finally{r=!1}}),a.m?.(n)}return m},Aee=(e,t,n)=>{let r=e.m,i=e.Q,a=e.h,o=e.e,s=e.T,c=o(e,t,n),l=r.get(n);if(!l||l.l.size)return l;let u=!1;for(let e of l.t)if(r.get(e)?.d.has(n)){u=!0;break}if(u)return l;l.u&&i.add(l.u),l=void 0,r.delete(n);for(let r of c.d.keys())s(e,t,r)?.t.delete(n);a.u?.(n)},jee=(e,t,n,r)=>{let i=e.e,a=e.A,o=i(e,t,n),s=`v`in o,c=o.v;if(Z_(r))for(let a of o.d.keys())Q_(n,r,i(e,t,a));o.v=r,delete o.e,s&&Object.is(c,o.v)||(++o.n,Z_(c)&&a(e,t,c))},Mee=(e,t,n)=>{let r=e.r;return X_(r(e,t,n))},Nee=(e,t,n,...r)=>{let i=e.c,a=e.f,o=e.C,s=e.w,c=i.size;try{return s(e,t,n,r)}finally{i.size!==c&&(o(e,t),a(e,t))}},Pee=(e,t,n,r)=>{let i=e.f,a=e.C,o=e.t,s=e.T,c=o(e,t,n).l;return c.add(r),a(e,t),i(e,t),()=>{c.delete(r),s(e,t,n),a(e,t),i(e,t)}},Fee=(e,t,n,r)=>{let i=e.p,a=i.get(n);if(!a){a=new Set,i.set(n,a);let e=()=>i.delete(n);n.then(e,e)}a.add(r)},Iee=(e,t,n)=>{e.p.get(n)?.forEach(e=>e())},ev=new WeakMap;function Lee(e){let t=ev.get(e),n=t.B;return n?n(t,e):t}function Ree(e){let t={get(e){return r(n,t,e)},set(e,...r){return i(n,t,e,...r)},sub(e,r){return a(n,t,e,r)}},n=Object.freeze({a:new WeakMap,m:new WeakMap,i:new WeakMap,c:new Set,q:new Set,Q:new Set,h:{},R:vee,W:yee,I:bee,M:xee,e:See,f:Cee,C:wee,r:Tee,d:Eee,w:Dee,D:Oee,t:kee,T:Aee,v:jee,g:Mee,s:Nee,b:Pee,B:void 0,p:new WeakMap,H:Fee,A:Iee,E:[0],...e});ev.set(t,n);let r=n.g,i=n.s,a=n.b;return t}function zee(){return Ree()}var tv;function Bee(){return tv||=zee(),tv}var Vee=(0,f.createContext)(void 0);function nv(e){let t=(0,f.useContext)(Vee);return e?.store||t||Bee()}var rv=e=>typeof e?.then==`function`,iv=new WeakMap,Hee=(e,t,n)=>{let r=Lee(e),i=r.H,a=iv.get(t);return a||(a=new Promise((o,s)=>{let c=t,l=e=>t=>{c===e&&o(t)},u=e=>t=>{c===e&&s(t)},d=()=>{try{let t=n();rv(t)?(iv.set(t,a),c=t,t.then(l(t),u(t)),i(r,e,t,d)):o(t)}catch(e){s(e)}};t.then(l(t),u(t)),i(r,e,t,d)}),iv.set(t,a)),a},av=(e,t,n)=>[n,e,t,r=>{let i=e.sub(t,r),a=!0;try{a=!Object.is(n,e.get(t))}catch{}return a&&r(),i}];function Uee(e,t){let n=nv(t),[[r,i,a,o],s]=(0,f.useReducer)(t=>{let r=n.get(e);return t[1]===n&&t[2]===e?Object.is(t[0],r)?t:[r,n,e,t[3]]:av(n,e,r)},void 0,()=>av(n,e,n.get(e))),c=r;return(i!==n||a!==e)&&(s(),c=n.get(e)),(0,f.useEffect)(()=>o(s),[o]),(0,f.useDebugValue)(c),rv(c)?Hee(n,c,()=>n.get(e)):c}var ov=e=>{e.status||(e.status=`pending`,e.then(t=>{e.status=`fulfilled`,e.value=t},t=>{e.status=`rejected`,e.reason=t}))},Wee=f.use||(e=>{if(e.status===`pending`)throw e;if(e.status===`fulfilled`)return e.value;throw e.status===`rejected`?e.reason:(ov(e),e)});function sv(e,t){let{unstable_promiseStatus:n=!f.use}=t||{},r=Uee(e,t);return rv(r)?(n&&ov(r),Wee(r)):r}function cv(e,t){let n=nv(t);return(0,f.useCallback)((...t)=>n.set(e,...t),[n,e])}function Gee(e,t){return[sv(e,t),cv(e,t)]}var Kee=q_({open:!1,reactNode:null});function qee({className:e}){let[t,n]=Gee(Kee),{open:r,reactNode:i,title:a,description:o,className:s,onControlledOpen:c,onControlledClose:l}=t,u=()=>{l&&l(),n({open:!1,reactNode:null})};return(0,f.useEffect)(()=>{r&&c&&c()},[r]),(0,H.jsx)(bp,{open:r,onOpenChange:e=>{e||u()},children:(0,H.jsxs)(Cp,{className:V(`max-w-4xl`,s,e),children:[(0,H.jsxs)(wp,{children:[(0,H.jsx)(Ep,{className:a?void 0:`sr-only`,children:a||`Modal`}),(0,H.jsx)(Dp,{className:o?void 0:`sr-only`,children:o||`Modal content`})]}),i]})})}var Jee=(0,f.forwardRef)(({title:e,titleId:t,...n},r)=>(0,H.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,H.jsx)(`title`,{id:t,children:e}):null,(0,H.jsx)(`circle`,{cx:12,cy:12,r:10,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2})]})),Yee=Object.defineProperty,lv=(e,t)=>Yee(e,`name`,{value:t,configurable:!0}),uv=!1;function dv(){let[e,t]=f.useState(uv);return f.useEffect(()=>{uv||(uv=!0,t(!0))},[]),e}lv(dv,`useIsHydrated`);var fv=f.useSyncExternalStore;function pv(){return()=>{}}lv(pv,`subscribe`);function mv(){return fv(pv,()=>!0,()=>!1)}lv(mv,`useIsHydratedModern`);var Xee=typeof fv==`function`?mv:dv,hv=Object.defineProperty,gv=(e,t)=>hv(e,`name`,{value:t,configurable:!0}),_v=`rovingFocusGroup.onEntryFocus`,vv={bubbles:!1,cancelable:!0},yv=`RovingFocusGroup`,[bv,xv,Sv]=Ft(yv),[Cv,wv]=st(yv,[Sv]),Tv={Vertical:`vertical`,Horizontal:`horizontal`},Zee={LTR:`ltr`,RTL:`rtl`},[Qee,$ee]=Cv(yv),Ev=f.forwardRef(gv(function(e,t){return(0,H.jsx)(bv.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,H.jsx)(bv.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,H.jsx)(Dv,{...e,ref:t})})})},`RovingFocusGroup`)),Dv=f.forwardRef(gv(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,p=f.useRef(null),m=pt(t,p),h=Bn(a),[g,_]=un({prop:o,defaultProp:s??null,onChange:c,caller:yv}),[v,y]=f.useState(!1),b=Qn(l),x=xv(n),S=f.useRef(!1),[C,w]=f.useState(0);return f.useEffect(()=>{let e=p.current;if(e)return e.addEventListener(_v,b),()=>e.removeEventListener(_v,b)},[b]),(0,H.jsx)(Qee,{scope:n,orientation:r,dir:h,loop:i,currentTabStopId:g,onItemFocus:f.useCallback(e=>_(e),[_]),onItemShiftTab:f.useCallback(()=>y(!0),[]),onFocusableItemAdd:f.useCallback(()=>w(e=>e+1),[]),onFocusableItemRemove:f.useCallback(()=>w(e=>e-1),[]),children:(0,H.jsx)(bn.div,{tabIndex:v||C===0?-1:0,"data-orientation":r,...d,ref:m,style:{outline:`none`,...e.style},onMouseDown:Xt(e.onMouseDown,()=>{S.current=!0}),onFocus:Xt(e.onFocus,e=>{let t=!S.current;if(e.target===e.currentTarget&&t&&!v){let t=new CustomEvent(_v,vv);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);Nv([e.find(e=>e.active),e.find(e=>e.id===g),...e].filter(Boolean).map(e=>e.ref.current),u)}}S.current=!1}),onBlur:Xt(e.onBlur,()=>y(!1))})})},`RovingFocusGroupImpl`)),Ov=`RovingFocusGroupItem`,kv=f.forwardRef(gv(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=Fn(),l=a||c,u=$ee(Ov,n),d=u.currentTabStopId===l,p=xv(n),{onFocusableItemAdd:m,onFocusableItemRemove:h,currentTabStopId:g}=u,_=Xee();return Mt(()=>{if(_&&r)return m(),()=>h()},[_,r,m,h]),f.useEffect(()=>{if(!_&&r)return m(),()=>h()},[_,r,m,h]),(0,H.jsx)(bv.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,H.jsx)(bn.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:Xt(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:Xt(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:Xt(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Mv(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=p().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?Pv(n,r+1):n.slice(r+1)}setTimeout(()=>Nv(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:g!=null}):o})})},`RovingFocusGroupItem`)),Av={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function jv(e,t){return t===Zee.RTL?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}gv(jv,`getDirectionAwareKey`);function Mv(e,t,n){let r=jv(e.key,n);if(!(t===Tv.Vertical&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===Tv.Horizontal&&[`ArrowUp`,`ArrowDown`].includes(r)))return Av[r]}gv(Mv,`getFocusIntent`);function Nv(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}gv(Nv,`focusFirst`);function Pv(e,t){return e.map((n,r)=>e[(t+r)%e.length])}gv(Pv,`wrapArray`);var ete=Object.defineProperty,Fv=(e,t)=>ete(e,`name`,{value:t,configurable:!0}),tte={LTR:`ltr`,RTL:`rtl`},Iv=[`Enter`,` `],nte=[`ArrowDown`,`PageUp`,`Home`],Lv=[`ArrowUp`,`PageDown`,`End`],rte=[...nte,...Lv],ite={ltr:[...Iv,`ArrowRight`],rtl:[...Iv,`ArrowLeft`]},ate={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},Rv=`Menu`,[zv,ote,ste]=Ft(Rv),[Bv,Vv]=st(Rv,[ste,d_,wv]),Hv=d_(),Uv=wv(),[cte,Wv]=Bv(Rv),[lte,Gv]=Bv(Rv),ute=Fv(e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=Hv(t),[c,l]=f.useState(null),u=f.useRef(!1),d=Qn(a),p=Bn(i);return f.useEffect(()=>{let e=Fv(()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},`handleKeyDown`),t=Fv(()=>u.current=!1,`handlePointer`);return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),f.useEffect(()=>{if(!n)return;let e=Fv(()=>d(!1),`handleBlur`);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,d]),(0,H.jsx)(m_,{...s,children:(0,H.jsx)(cte,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,H.jsx)(lte,{scope:t,onClose:f.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:p,modal:o,children:r})})})},`Menu`),Kv=f.forwardRef(Fv(function(e,t){let{__scopeMenu:n,...r}=e,i=Hv(n);return(0,H.jsx)(g_,{...i,...r,ref:t})},`MenuAnchor`)),qv=`MenuPortal`,[Jv,Yv]=Bv(qv,{forceMount:void 0}),Xv=Fv(e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=Wv(qv,t);return(0,H.jsx)(Jv,{scope:t,forceMount:n,children:(0,H.jsx)(Tn,{present:n||a.open,children:(0,H.jsx)(Fr,{asChild:!0,container:i,children:r})})})},`MenuPortal`),Zv=`MenuContent`,[Qv,$v]=Bv(Zv),ey=f.forwardRef(Fv(function(e,t){let n=Yv(Zv,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Wv(Zv,e.__scopeMenu),o=Gv(Zv,e.__scopeMenu);return(0,H.jsx)(zv.Provider,{scope:e.__scopeMenu,children:(0,H.jsx)(Tn,{present:r||a.open,children:(0,H.jsx)(zv.Slot,{scope:e.__scopeMenu,children:o.modal?(0,H.jsx)(ty,{...i,ref:t}):(0,H.jsx)(ny,{...i,ref:t})})})})},`MenuContent`)),ty=f.forwardRef(Fv(function(e,t){let n=Wv(Zv,e.__scopeMenu),r=f.useRef(null),i=pt(t,r);return f.useEffect(()=>{let e=r.current;if(e)return aa(e)},[]),(0,H.jsx)(iy,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Xt(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentModal`)),ny=f.forwardRef(Fv(function(e,t){let n=Wv(Zv,e.__scopeMenu);return(0,H.jsx)(iy,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentNonModal`)),ry=gt(`MenuContent.ScrollLock`),iy=f.forwardRef(Fv(function(e,t){let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:p,onDismiss:m,disableOutsideScroll:h,...g}=e,_=Wv(Zv,n),v=Gv(Zv,n),y=Hv(n),b=Uv(n),x=ote(n),[S,C]=f.useState(null),w=f.useRef(null),[T,E]=f.useState(null);Sr(T);let{nodes:D,registry:O}=xr(),k=!!(i||h),A=pt(t,w,_.onContentChange,E),j=f.useRef(0),M=f.useRef(``),N=f.useRef(0),P=f.useRef(null),F=f.useRef(`right`),I=f.useRef(0),L=f.useMemo(()=>h?[w,...D.map(e=>({current:e}))]:[],[w,D,h]),R=h?Xi:f.Fragment,z=h?{as:ry,allowPinchZoom:!0,shards:L}:void 0,ee=Fv(e=>{let t=M.current+e,n=x().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=by(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;function s(e){M.current=e,window.clearTimeout(j.current),e!==``&&(j.current=window.setTimeout(()=>s(``),1e3))}Fv(s,`updateSearch`),s(t),o&&setTimeout(()=>o.focus())},`handleTypeaheadSearch`);f.useEffect(()=>()=>window.clearTimeout(j.current),[]),Vr();let te=f.useCallback(e=>F.current===P.current?.side&&Sy(e,P.current?.area),[]);return(0,H.jsx)(Qv,{scope:n,searchRef:M,onItemEnter:f.useCallback(e=>{te(e)&&e.preventDefault()},[te]),onItemLeave:f.useCallback(e=>{te(e)||(w.current?.focus(),C(null))},[te]),onTriggerLeave:f.useCallback(e=>{te(e)&&e.preventDefault()},[te]),pointerGraceTimerRef:N,onPointerGraceIntentChange:f.useCallback(e=>{P.current=e},[]),children:(0,H.jsx)(br,{registry:k?O:null,children:(0,H.jsx)(R,{...z,children:(0,H.jsx)(vr,{asChild:!0,trapped:i,branches:D,onMountAutoFocus:Xt(a,e=>{e.preventDefault(),w.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,H.jsx)(or,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:p,onDismiss:m,children:(0,H.jsx)(Ev,{asChild:!0,...b,dir:v.dir,orientation:`vertical`,loop:r,currentTabStopId:S,onCurrentTabStopIdChange:C,onEntryFocus:Xt(c,e=>{v.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,H.jsx)(y_,{role:`menu`,"aria-orientation":`vertical`,"data-state":hy(_.open),"data-radix-menu-content":``,dir:v.dir,...y,...g,ref:A,style:{outline:`none`,...g.style},onKeyDown:Xt(g.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&ee(e.key));let i=w.current;if(e.target!==i||!rte.includes(e.key))return;e.preventDefault();let a=x().filter(e=>!e.disabled).map(e=>e.ref.current);Lv.includes(e.key)&&a.reverse(),vy(a)}),onBlur:Xt(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(j.current),M.current=``)}),onPointerMove:Xt(e.onPointerMove,Cy(e=>{let t=e.target,n=I.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>I.current?`right`:`left`;F.current=t,I.current=e.clientX}}))})})})})})})})},`MenuContentImpl`)),ay=f.forwardRef(Fv(function(e,t){let{__scopeMenu:n,...r}=e;return(0,H.jsx)(bn.div,{...r,ref:t})},`MenuLabel`)),oy=`MenuItem`,sy=`menu.itemSelect`,cy=f.forwardRef(Fv(function(e,t){let{disabled:n=!1,onSelect:r,...i}=e,a=f.useRef(null),o=Gv(oy,e.__scopeMenu),s=$v(oy,e.__scopeMenu),c=pt(t,a),l=f.useRef(!1),u=Fv(()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(sy,{bubbles:!0,cancelable:!0});e.addEventListener(sy,e=>r?.(e),{once:!0}),xn(e,t),t.defaultPrevented?l.current=!1:o.onClose()}},`handleSelect`);return(0,H.jsx)(ly,{...i,ref:c,disabled:n,onClick:Xt(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:Xt(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:Xt(e.onKeyDown,e=>{n||e.target!==e.currentTarget||(s.searchRef.current===``||e.key!==` `)&&Iv.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},`MenuItem`)),ly=f.forwardRef(Fv(function(e,t){let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=$v(oy,n),s=Uv(n),c=f.useRef(null),l=pt(t,c),[u,d]=f.useState(!1),[p,m]=f.useState(``);return f.useEffect(()=>{let e=c.current;e&&m((e.textContent??``).trim())},[a.children]),(0,H.jsx)(zv.ItemSlot,{scope:n,disabled:r,textValue:i??p,children:(0,H.jsx)(kv,{asChild:!0,...s,focusable:!r,children:(0,H.jsx)(bn.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:Xt(e.onPointerMove,Cy(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Xt(e.onPointerLeave,Cy(e=>o.onItemLeave(e))),onFocus:Xt(e.onFocus,()=>d(!0)),onBlur:Xt(e.onBlur,()=>d(!1))})})})},`MenuItemImpl`)),uy=f.forwardRef(Fv(function(e,t){let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,H.jsx)(fy,{scope:e.__scopeMenu,checked:n,children:(0,H.jsx)(cy,{role:`menuitemcheckbox`,"aria-checked":gy(n)?`mixed`:n,...i,ref:t,"data-state":_y(n),onSelect:Xt(i.onSelect,()=>r?.(gy(n)?!0:!n),{checkForDefaultPrevented:!1})})})},`MenuCheckboxItem`)),[dte,fte]=Bv(`MenuRadioGroup`,{value:void 0,onValueChange:Fv(()=>{},`onValueChange`)}),pte=`MenuRadioItem`,mte=f.forwardRef(Fv(function(e,t){let{value:n,...r}=e,i=fte(pte,e.__scopeMenu),a=n===i.value;return(0,H.jsx)(fy,{scope:e.__scopeMenu,checked:a,children:(0,H.jsx)(cy,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":_y(a),onSelect:Xt(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})},`MenuRadioItem`)),dy=`MenuItemIndicator`,[fy,hte]=Bv(dy,{checked:!1}),gte=f.forwardRef(Fv(function(e,t){let{__scopeMenu:n,forceMount:r,...i}=e,a=hte(dy,n);return(0,H.jsx)(Tn,{present:r||gy(a.checked)||a.checked===!0,children:(0,H.jsx)(bn.span,{...i,ref:t,"data-state":_y(a.checked)})})},`MenuItemIndicator`)),_te=f.forwardRef(Fv(function(e,t){let{__scopeMenu:n,...r}=e;return(0,H.jsx)(bn.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})},`MenuSeparator`)),[vte,py]=Bv(`MenuSub`),my=`MenuSubTrigger`,yte=f.forwardRef(Fv(function(e,t){let n=Wv(my,e.__scopeMenu),r=Gv(my,e.__scopeMenu),i=py(my,e.__scopeMenu),a=$v(my,e.__scopeMenu),o=f.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=f.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);f.useEffect(()=>u,[u]),f.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]);let d=pt(t,i.onTriggerChange);return(0,H.jsx)(Kv,{asChild:!0,...l,children:(0,H.jsx)(ly,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":n.open?i.contentId:void 0,"data-state":hy(n.open),...e,ref:d,onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Xt(e.onPointerMove,Cy(t=>{a.onItemEnter(t),t.defaultPrevented||e.disabled||n.open||o.current||(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:Xt(e.onPointerLeave,Cy(e=>{u();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:Xt(e.onKeyDown,t=>{e.disabled||t.target!==t.currentTarget||(a.searchRef.current===``||t.key!==` `)&&ite[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})},`MenuSubTrigger`)),bte=`MenuSubContent`,xte=f.forwardRef(Fv(function(e,t){let n=Yv(Zv,e.__scopeMenu),{forceMount:r=n.forceMount,align:i=`start`,...a}=e,o=Wv(Zv,e.__scopeMenu),s=Gv(Zv,e.__scopeMenu),c=py(bte,e.__scopeMenu),l=f.useRef(null),u=pt(t,l);return(0,H.jsx)(zv.Provider,{scope:e.__scopeMenu,children:(0,H.jsx)(Tn,{present:r||o.open,children:(0,H.jsx)(zv.Slot,{scope:e.__scopeMenu,children:(0,H.jsx)(iy,{id:c.contentId,"aria-labelledby":c.triggerId,...a,ref:u,align:i,side:s.dir===tte.RTL?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{s.isUsingKeyboardRef.current&&l.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:Xt(e.onFocusOutside,e=>{e.target!==c.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Xt(e.onEscapeKeyDown,e=>{s.onClose(),e.preventDefault()}),onKeyDown:Xt(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=ate[s.dir].includes(e.key);t&&n&&(o.onOpenChange(!1),c.trigger?.focus(),e.preventDefault())})})})})})},`MenuSubContent`));function hy(e){return e?`open`:`closed`}Fv(hy,`getOpenState`);function gy(e){return e===`indeterminate`}Fv(gy,`isIndeterminate`);function _y(e){return gy(e)?`indeterminate`:e?`checked`:`unchecked`}Fv(_y,`getCheckedState`);function vy(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}Fv(vy,`focusFirst`);function yy(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Fv(yy,`wrapArray`);function by(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=yy(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}Fv(by,`getNextMatch`);function xy(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}Fv(xy,`isPointInPolygon`);function Sy(e,t){return t?xy({x:e.clientX,y:e.clientY},t):!1}Fv(Sy,`isPointerInGraceArea`);function Cy(e){return t=>t.pointerType===`mouse`?e(t):void 0}Fv(Cy,`whenMouse`);function wy(e,t){let n=Object.create(null);return e.forEach((e,r)=>{let i=t(e,r);n[i]||(n[i]=[]),n[i].push(e)}),n}function Ty(e,t){if(t){let n=new Set;return e.reduce((e,r)=>{let i=t(r);return n.has(i)||(n.add(i),e.push(r)),e},[])}return[...new Set(e)]}function Ste(e){if(Oy(e))return e;if(typeof e==`function`)return e.bind({});let t=Object.getPrototypeOf(e),n=typeof t?.constructor==`function`?new t.constructor:Object.create(t);for(let t of Object.getOwnPropertyNames(e))n[t]=e[t];return n}function Ey(e,t,n){let r=t.split(/[\.\[\]]/g),i=e;for(let e of r){if(i==null)return n;let t=e.replace(/['"]/g,``);t.trim()!==``&&(i=i[t])}return i===void 0?n:i}function Cte(e,t){return!(t&&!Object.getPrototypeOf(t))&&(e===`__proto__`||e===`prototype`||e===`constructor`)}function wte(e,t,n){return e?!t||n===void 0?e:(function e(t,r,i){let a=r[i];if(t??=Ete(a)?[]:{},Cte(a,t))throw Error(`Unsafe key in path: `+a);return i<r.length-1&&(n=e(t[a],r,i+1)),Object.is(t[a],n)||(t=Ste(t),t[a]=n),t})(e,t.match(/[^.[\]]+/g),0):{}}new Map(Object.entries({Æ:`Ae`,Ð:`D`,Ø:`O`,Þ:`Th`,ß:`ss`,æ:`ae`,ð:`d`,ø:`o`,þ:`th`,Đ:`D`,đ:`d`,Ħ:`H`,ħ:`h`,ı:`i`,IJ:`IJ`,ij:`ij`,ĸ:`k`,Ŀ:`L`,ŀ:`l`,Ł:`L`,ł:`l`,ʼn:`'n`,Ŋ:`N`,ŋ:`n`,Œ:`Oe`,œ:`oe`,Ŧ:`T`,ŧ:`t`,ſ:`s`}));function Tte(e){return typeof e==`function`}function Ete(e){if(!ky(e))return!1;let t=+e;return Number.isInteger(t)&&`${t}`===e}function Dy(e){return Ay(e,`[object Object]`)}function Oy(e){return e==null||typeof e!=`object`&&typeof e!=`function`}function ky(e){return typeof e==`string`}function Ay(e,t){return Object.prototype.toString.call(e)===t}var jy=f.forwardRef(({className:e,type:t,onValueChange:n,onChange:r,clearable:i=!1,...a},o)=>{let s=f.useRef(null),c=f.useCallback(e=>{s.current=e,Tte(o)?o(e):o&&(o.current=e)},[o]),l=a.value!==void 0,[u,d]=f.useState(()=>String(a.defaultValue??``).length>0),p=l?String(a.value??``).length>0:u,m=e=>{l||d(e.target.value.length>0),n?.(e.target.value),r?.(e)},h=()=>{let e=s.current;e&&((Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,`value`)?.set)?.call(e,``),e.dispatchEvent(new Event(`input`,{bubbles:!0})),e.focus()),l||d(!1)},g=i&&p&&!a.disabled&&!a.readOnly,_=(0,H.jsx)(`input`,{type:t,"data-slot":`input`,className:V(`file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border px-3 py-1 text-base bg-input-background transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,`focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]`,`aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive`,i&&`pr-8`,e),ref:c,...a,onChange:m});return i?(0,H.jsxs)(`div`,{className:`relative w-full`,children:[_,g&&(0,H.jsx)(`button`,{type:`button`,tabIndex:-1,"aria-label":`Clear`,onMouseDown:e=>e.preventDefault(),onClick:h,className:`absolute right-2 top-1/2 -translate-y-1/2 flex items-center justify-center text-muted-foreground opacity-60 hover:opacity-100 transition-opacity cursor-pointer`,children:(0,H.jsx)(yp,{className:`h-4 w-4`})})]}):_});jy.displayName=`Input`;var My=(0,f.forwardRef)(({title:e,titleId:t,...n},r)=>(0,H.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,H.jsx)(`title`,{id:t,children:e}):null,(0,H.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,H.jsx)(`path`,{d:`M8 2v3m8-3v3`}),(0,H.jsx)(`rect`,{width:18,height:18,x:3,y:3,rx:2}),(0,H.jsx)(`path`,{d:`M3 9h18`})]})]}));function Ny({value:e,onValueChange:t,placeholder:n,disabled:r=!1,className:i}){let{SD:a}=vp(),o=n??a(`rc.datePicker.pickDate`);return(0,H.jsxs)(U_,{children:[(0,H.jsx)(W_,{asChild:!0,children:(0,H.jsxs)(U,{variant:`outline`,disabled:r,"data-empty":!e,className:V(`w-full justify-start text-left font-normal`,`data-[empty=true]:text-muted-foreground`,i),children:[(0,H.jsx)(My,{}),e?Hs(e,`PPP`):(0,H.jsx)(`span`,{children:o})]})}),(0,H.jsx)(G_,{className:`w-auto p-0`,align:`start`,children:(0,H.jsx)(vu,{mode:`single`,selected:e,onSelect:e=>{t?.(e)},autoFocus:!0})})]})}var Py=Object.defineProperty,Fy=(e,t)=>Py(e,`name`,{value:t,configurable:!0}),Iy=`DropdownMenu`,[Ly,Dte]=st(Iy,[Vv]),Ry=Vv(),[zy,By]=Ly(Iy),Vy=Fy(e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=Ry(t),l=f.useRef(null),[u,d]=un({prop:i,defaultProp:a??!1,onChange:o,caller:Iy});return(0,H.jsx)(zy,{scope:t,triggerId:Fn(),triggerRef:l,contentId:Fn(),open:u,onOpenChange:d,onOpenToggle:f.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,H.jsx)(ute,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})},`DropdownMenu`),Hy=`DropdownMenuTrigger`,Uy=f.forwardRef(Fy(function(e,t){let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=By(Hy,n),o=Ry(n),s=pt(t,a.triggerRef);return(0,H.jsx)(Kv,{asChild:!0,...o,children:(0,H.jsx)(bn.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:s,onPointerDown:Xt(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:Xt(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})},`DropdownMenuTrigger`)),Wy=Fy(e=>{let{__scopeDropdownMenu:t,...n}=e,r=Ry(t);return(0,H.jsx)(Xv,{...r,...n})},`DropdownMenuPortal`),Gy=`DropdownMenuContent`,Ky=f.forwardRef(Fy(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=By(Gy,n),a=Ry(n),o=f.useRef(!1);return(0,H.jsx)(ey,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:Xt(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:Xt(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`DropdownMenuContent`)),qy=f.forwardRef(Fy(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Ry(n);return(0,H.jsx)(ay,{...i,...r,ref:t})},`DropdownMenuLabel`)),Jy=f.forwardRef(Fy(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Ry(n);return(0,H.jsx)(cy,{...i,...r,ref:t})},`DropdownMenuItem`)),Yy=f.forwardRef(Fy(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Ry(n);return(0,H.jsx)(uy,{...i,...r,ref:t})},`DropdownMenuCheckboxItem`)),Xy=f.forwardRef(Fy(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Ry(n);return(0,H.jsx)(mte,{...i,...r,ref:t})},`DropdownMenuRadioItem`)),Zy=f.forwardRef(Fy(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Ry(n);return(0,H.jsx)(gte,{...i,...r,ref:t})},`DropdownMenuItemIndicator`)),Qy=f.forwardRef(Fy(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Ry(n);return(0,H.jsx)(_te,{...i,...r,ref:t})},`DropdownMenuSeparator`)),$y=f.forwardRef(Fy(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Ry(n);return(0,H.jsx)(yte,{...i,...r,ref:t})},`DropdownMenuSubTrigger`)),eb=f.forwardRef(Fy(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Ry(n);return(0,H.jsx)(xte,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`DropdownMenuSubContent`)),tb=Vy,nb=Uy;function rb({container:e,...t}){let n=Gn();return(0,H.jsx)(Wy,{container:e??n,...t})}var ib=f.forwardRef(({className:e,inset:t,children:n,...r},i)=>(0,H.jsxs)($y,{ref:i,className:V(`flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,t&&`pl-8`,e),...r,children:[n,(0,H.jsx)(lo,{className:`ml-auto`})]}));ib.displayName=$y.displayName;var ab=f.forwardRef(({className:e,...t},n)=>(0,H.jsx)(eb,{ref:n,className:V(`z-50 min-w-32 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]`,e),...t}));ab.displayName=eb.displayName;var ob=f.forwardRef(({className:e,sideOffset:t=4,...n},r)=>(0,H.jsx)(rb,{children:(0,H.jsx)(Ky,{ref:r,sideOffset:t,className:V(`z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-32 overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]`,e),...n})}));ob.displayName=Ky.displayName;var sb=f.forwardRef(({className:e,inset:t,...n},r)=>(0,H.jsx)(Jy,{ref:r,className:V(`relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,t&&`pl-8`,e),...n}));sb.displayName=Jy.displayName;var cb=f.forwardRef(({className:e,children:t,checked:n,...r},i)=>(0,H.jsxs)(Yy,{ref:i,className:V(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50`,e),checked:n,...r,children:[(0,H.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,H.jsx)(Zy,{children:(0,H.jsx)(yu,{className:`h-4 w-4`})})}),t]}));cb.displayName=Yy.displayName;var lb=f.forwardRef(({className:e,children:t,...n},r)=>(0,H.jsxs)(Xy,{ref:r,className:V(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50`,e),...n,children:[(0,H.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,H.jsx)(Zy,{children:(0,H.jsx)(Jee,{className:`h-2 w-2 fill-current`})})}),t]}));lb.displayName=Xy.displayName;var ub=f.forwardRef(({className:e,inset:t,...n},r)=>(0,H.jsx)(qy,{ref:r,className:V(`px-2 py-1.5 text-sm font-semibold`,t&&`pl-8`,e),...n}));ub.displayName=qy.displayName;var db=f.forwardRef(({className:e,...t},n)=>(0,H.jsx)(Qy,{ref:n,className:V(`-mx-1 my-1 h-px bg-muted`,e),...t}));db.displayName=Qy.displayName;var fb=(0,f.forwardRef)(({title:e,titleId:t,...n},r)=>(0,H.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,H.jsx)(`title`,{id:t,children:e}):null,(0,H.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M21 12a9 9 0 1 1-6.219-8.56`})]})),Ote=Object.defineProperty,pb=(e,t)=>Ote(e,`name`,{value:t,configurable:!0}),mb={Horizontal:`horizontal`,Vertical:`vertical`},hb=mb.Horizontal,kte=Object.values(mb),gb=f.forwardRef(pb(function(e,t){let{decorative:n,orientation:r=hb,...i}=e,a=_b(r)?r:hb,o=a===mb.Vertical?a:void 0,s=n?{role:`none`}:{"aria-orientation":o,role:`separator`};return(0,H.jsx)(bn.div,{"data-orientation":a,...s,...i,ref:t})},`Separator`));function _b(e){return kte.includes(e)}pb(_b,`isValidOrientation`);var vb=f.forwardRef(({className:e,orientation:t=`horizontal`,decorative:n=!0,...r},i)=>(0,H.jsx)(gb,{ref:i,decorative:n,orientation:t,className:V(`shrink-0 bg-border`,t===`horizontal`?`h-px w-full`:`h-full w-px`,e),...r}));vb.displayName=gb.displayName;function Ate(e){return Dy(e)&&`value`in e}function yb(e){return Ate(e)?e:{value:e}}var jte=class extends f.Component{state={labels:new Map,valueKeyIdentity:this.props.valueKeyIdentity};static getDerivedStateFromProps(e,t){let n=e.valueKeyIdentity!==t.valueKeyIdentity,r=new Map(e.labels);if(!n)for(let n of e.selectedKeys){let e=t.labels.get(n);!r.has(n)&&e!==void 0&&r.set(n,e)}return!n&&r.size===t.labels.size&&Array.from(r).every(([e,n])=>t.labels.get(e)===n)?null:{labels:r,valueKeyIdentity:e.valueKeyIdentity}}render(){return this.props.children(this.state.labels)}};function Mte(e,t,n){let r=e.multiple===!0,i=e.async===!0,a=e.valueKey,o=e.multiple?e.value:void 0,s=e.multiple?void 0:e.value,c=e.renderItem,l=i&&`loading`in e&&e.loading===!0,u=(0,f.useRef)(null);(0,f.useImperativeHandle)(t,()=>{let e=u.current;if(!e)throw Error(`Select 요소가 아직 마운트되지 않았습니다.`);return e});let[d,p]=(0,f.useState)(!1),[m,h]=(0,f.useState)(``),g=i&&`onOpenChange`in e?e.onOpenChange:void 0,_=(0,f.useRef)(d);(0,f.useEffect)(()=>{_.current!==d&&(g&&g(d),_.current=d)},[d,g]);let v=(0,f.useCallback)(e=>e==null?``:a?a(e):String(e),[a]),y=(0,f.useMemo)(()=>e.items.map(yb),[e.items]),b=(0,f.useMemo)(()=>{let e=new Map;for(let t of y)e.set(v(t.value),t.value);return e},[y,v]),x=(0,f.useMemo)(()=>{if(!i)return new Map;let e=o||(s==null?[]:[s]),t=new Map;for(let r of e){let e=v(r),i=y.find(e=>e.value===r);if(i)t.set(e,i);else{let i=n.get(e);i!==void 0&&t.set(e,{value:r,label:i})}}return t},[i,o,s,y,v,n]),S=(0,f.useCallback)(e=>{if(c)return c(e);let t=y.find(t=>t.value===e);if(t?.label!==void 0)return t.label;if(i){let t=n.get(v(e));if(t!==void 0)return t}return l?(0,H.jsx)(`span`,{"aria-busy":`true`,"data-label-pending":``,className:`inline-block h-4 w-16 animate-pulse rounded-md bg-muted align-middle`}):String(e)},[c,y,i,l,n,v]),C=(0,f.useCallback)(e=>{h(e)},[]),w=(0,f.useCallback)(e=>{p(e),e||h(``)},[]),T=i&&`onSearch`in e?e.onSearch:void 0,E=i&&`searchDebounce`in e&&e.searchDebounce!==void 0?e.searchDebounce:300;return(0,f.useEffect)(()=>{if(!T)return;let e=setTimeout(()=>{T(m)},m===``?0:E);return()=>clearTimeout(e)},[m,T,E]),{isMultiple:r,isAsync:i,selectRef:u,isPopoverOpen:d,setIsPopoverOpen:w,searchValue:m,handleSearchChange:C,filteredOptions:(0,f.useMemo)(()=>{if(i){let e=new Map;for(let[t,n]of x)e.set(t,n);for(let t of y)e.set(v(t.value),t);return Array.from(e.values())}return m?y.filter(e=>{let t=S(e.value);return String(t).toLowerCase().includes(m.toLowerCase())}):y},[i,y,x,m,v,S]),normalizedItems:y,getKeyForValue:v,valueByKey:b,getItemLabel:S}}function Nte(e,t){if(!t||Object.prototype.toString.call(e)!==`[object String]`)return e;let n=String(e),r=n.toLowerCase(),i=t.toLowerCase(),a=r.indexOf(i);if(a===-1)return e;let o=n.slice(0,a),s=n.slice(a,a+t.length),c=n.slice(a+t.length);return(0,H.jsxs)(H.Fragment,{children:[o,(0,H.jsx)(`strong`,{className:`font-bold`,children:s}),c]})}function Pte({props:e,isMultiple:t,isAsync:n,isPopoverOpen:r,setIsPopoverOpen:i,searchValue:a,handleSearchChange:o,filteredOptions:s,getKeyForValue:c,getItemLabel:l}){let{SD:u}=vp(),[d,p]=(0,f.useState)(null),m=(0,f.useCallback)(e=>{p(e)},[]),[h,g]=(0,f.useState)(null),_=(0,f.useCallback)(e=>{g(e)},[]),v=n&&`onLoadMore`in e?e.onLoadMore:void 0,y=n&&`hasMore`in e?e.hasMore??!1:!1,b=n&&`isLoadingMore`in e?e.isLoadingMore??!1:!1,x=n&&v!==void 0;(0,f.useEffect)(()=>{if(!v||!y||b||!h||!d)return;let e=new IntersectionObserver(e=>{for(let t of e)t.isIntersecting&&v()},{root:d,threshold:0});return e.observe(h),()=>e.disconnect()},[h,d,v,y,b]);let S=e.searchable??n,C=(0,f.useCallback)(e=>{let t=d;if(!t)return;let n=t.scrollTop<t.scrollHeight-t.clientHeight,r=t.scrollTop>0;(e.deltaY>0&&n||e.deltaY<0&&r)&&e.stopPropagation()},[d]),w=(0,f.useCallback)(t=>{if(!e.disabled){if(e.multiple){let n=e.value;if(n.includes(t)){if(e.isRemovable?.(t)===!1)return;e.onValueChange(n.filter(e=>e!==t))}else e.onValueChange([...n,t])}else e.onValueChange?.(t),i(!1)}},[e,i]),T=(0,f.useCallback)(()=>{if(!e.multiple||e.disabled)return;let t=s.filter(e=>!e.disabled),n=e.value,r=n.filter(t=>e.isRemovable?.(t)===!1);if(n.length===t.length)e.onValueChange(r);else{let n=t.map(e=>e.value);e.onValueChange([...r.filter(e=>!n.includes(e)),...n])}},[e,s]),E=(0,f.useCallback)(()=>{e.disabled||(e.multiple?e.onValueChange(e.value.filter(t=>e.isRemovable?.(t)===!1)):e.onValueChange?.(void 0))},[e]),D=(0,f.useCallback)(t=>e.multiple?e.value.includes(t):e.value===t,[e]),O=n&&`loading`in e?e.loading:!1,k=n&&`error`in e?e.error:void 0,A=e.multiple?e.value.length>0:e.value!==void 0&&e.value!==null&&e.value!==``,j=e.multiple?e.value:[],M=e.multiple?void 0:e.value;return(0,H.jsxs)(U_,{open:r,onOpenChange:i,children:[(0,H.jsx)(W_,{asChild:!0,children:(0,H.jsx)(U,{variant:`outline`,role:`combobox`,"aria-expanded":r,disabled:e.disabled||O,className:V(`flex p-1 rounded-md border border-input min-h-10 h-auto items-center justify-between bg-white hover:bg-white hover:text-inherit [&_svg]:pointer-events-auto w-full`,e.className),children:t&&A?(0,H.jsxs)(`div`,{className:`flex justify-between items-center w-full`,children:[(0,H.jsx)(`div`,{className:`flex items-center gap-1 flex-wrap`,children:(()=>{if(!e.multiple)return null;let t=e.value;return(0,H.jsx)(H.Fragment,{children:t.map(t=>{let n=c(t);return(0,H.jsxs)(co,{variant:`outline`,className:`m-1 transition-all duration-300 ease-in-out`,children:[l(t),e.isRemovable?.(t)!==!1&&(0,H.jsx)(K_,{className:`ml-2 h-3 w-3 cursor-pointer !pointer-events-auto`,onPointerDownCapture:e=>{e.stopPropagation()},onMouseDownCapture:e=>{e.stopPropagation()},onClick:e=>{e.stopPropagation(),w(t)}})]},n)})})})()}),(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[e.clearable&&(0,H.jsx)(`div`,{role:`button`,tabIndex:0,onPointerDownCapture:e=>{e.stopPropagation()},onMouseDownCapture:e=>{e.stopPropagation()},onClick:e=>{e.stopPropagation(),E()},className:`flex items-center justify-center h-4 w-4 mx-2 cursor-pointer text-muted-foreground hover:text-foreground`,children:(0,H.jsx)(yp,{className:`h-4 w-4`})}),(0,H.jsx)(vb,{orientation:`vertical`,className:`flex min-h-6 h-full`}),(0,H.jsx)(rt,{className:`h-4 mx-2 cursor-pointer text-muted-foreground`})]})]}):!t&&A?(0,H.jsxs)(`div`,{className:`flex justify-between items-center w-full px-2 py-1`,children:[M==null?null:(0,H.jsx)(`span`,{className:`flex-1 truncate text-left text-sm`,children:l(M)}),(0,H.jsxs)(`div`,{className:`flex items-center gap-1 shrink-0`,children:[e.clearable&&A&&(0,H.jsx)(K_,{className:`h-4 w-4 cursor-pointer opacity-50 hover:opacity-100 transition-opacity`,onPointerDownCapture:E,onMouseDownCapture:E}),(0,H.jsx)(rt,{className:`h-4 w-4 opacity-50`})]})]}):(0,H.jsxs)(`div`,{className:`flex items-center justify-between w-full px-2 py-1`,children:[(0,H.jsx)(`span`,{className:`text-sm text-muted-foreground flex-1 truncate text-left`,children:e.placeholder}),(0,H.jsx)(rt,{className:`h-4 cursor-pointer text-muted-foreground`})]})})}),(0,H.jsx)(G_,{className:`min-w-40 p-0`,align:`start`,style:{width:`var(--radix-popover-trigger-width)`},children:(0,H.jsxs)(Vm,{shouldFilter:!1,children:[S&&(0,H.jsx)(Um,{placeholder:u(`common.searchPlaceholder`),value:a,onValueChange:o}),(0,H.jsx)(Wm,{ref:m,onWheel:C,children:O?(0,H.jsx)(Gm,{children:(0,H.jsx)(`div`,{className:`flex items-center justify-center`,children:(0,H.jsx)(fb,{className:`h-4 w-4 animate-spin mr-2`})})}):k?(0,H.jsxs)(Gm,{children:[`Error: `,k.message]}):s.length===0?(0,H.jsx)(Gm,{children:u(`rc.multiSelect.noResults`)}):(0,H.jsxs)(H.Fragment,{children:[t&&!(`hideSelectAll`in e&&e.hideSelectAll)&&(0,H.jsx)(Km,{children:(0,H.jsxs)(Jm,{onSelect:T,className:`cursor-pointer`,children:[(0,H.jsx)(`div`,{className:V(`mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary`,j.length===s.filter(e=>!e.disabled).length?`bg-primary text-primary-foreground`:`opacity-50 [&_svg]:invisible`),children:(0,H.jsx)(yu,{className:`h-4 w-4`})}),(0,H.jsxs)(`span`,{children:[`(`,u(`rc.multiSelect.selectAll`),`)`]})]})}),(0,H.jsx)(Km,{children:s.map(e=>{let n=c(e.value),r=D(e.value);return(0,H.jsxs)(Jm,{onSelect:()=>w(e.value),disabled:e.disabled,className:V(`cursor-pointer`,e.disabled&&`opacity-50 cursor-not-allowed`),children:[t&&(0,H.jsx)(`div`,{className:V(`mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary`,r?`bg-primary text-primary-foreground`:`opacity-50 [&_svg]:invisible`),children:(0,H.jsx)(yu,{className:`h-4 w-4`})}),!t&&(0,H.jsx)(yu,{className:V(`mr-2 h-4 w-4`,r?`opacity-100`:`opacity-0`)}),(0,H.jsx)(`span`,{children:Nte(l(e.value),a)})]},n)})}),x&&(0,H.jsx)(`div`,{ref:_,className:`flex items-center justify-center py-2 text-xs text-muted-foreground`,children:b?(0,H.jsx)(fb,{className:`h-3 w-3 animate-spin`}):null})]})})]})})]})}function Fte({props:e,forwardedRef:t,cachedLabels:n}){let r=Mte(e,t,n);return(0,H.jsx)(Pte,{props:e,isMultiple:r.isMultiple,isAsync:r.isAsync,isPopoverOpen:r.isPopoverOpen,setIsPopoverOpen:r.setIsPopoverOpen,searchValue:r.searchValue,handleSearchChange:r.handleSearchChange,filteredOptions:r.filteredOptions,getKeyForValue:r.getKeyForValue,getItemLabel:r.getItemLabel})}var bb=f.forwardRef(function(e,t){let n=new Map;for(let t of e.items){let r=yb(t);if(r.label===void 0)continue;let i=e.valueKey?e.valueKey(r.value):String(r.value);n.set(i,r.label)}let r=e.multiple?e.value:e.value===void 0||e.value===null?[]:[e.value],i=new Set(r.map(t=>e.valueKey?e.valueKey(t):String(t)));return(0,H.jsx)(jte,{labels:n,selectedKeys:i,valueKeyIdentity:e.valueKey,children:n=>(0,H.jsx)(Fte,{props:e,forwardedRef:t,cachedLabels:n})})}),Ite=Object.defineProperty,Lte=(e,t)=>Ite(e,`name`,{value:t,configurable:!0}),Rte=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),zte=f.forwardRef(Lte(function(e,t){return(0,H.jsx)(bn.span,{...e,ref:t,style:{...Rte,...e.style}})},`VisuallyHidden`));function xb({enum:e,labels:t,value:n,onValueChange:r,placeholder:i,textPrefix:a=``,clearable:o=!1,disabled:s=!1,className:c,multiple:l=!1}){let u=f.useMemo(()=>e.options.filter(e=>e!==``),[e]),d=f.useMemo(()=>u.map(e=>({value:e,label:a+t[e]})),[u,t,a]);return l?(0,H.jsx)(bb,{items:d,valueKey:e=>e,value:Array.isArray(n)?n:[],onValueChange:e=>{r?.(e)},placeholder:i,clearable:o,disabled:s,className:c,multiple:!0,async:!1}):(0,H.jsx)(bb,{items:d,valueKey:e=>e,value:Array.isArray(n)||n===``?void 0:n,onValueChange:e=>{r?.(e)},placeholder:i,clearable:o,disabled:s,className:c,multiple:!1,async:!1})}var Sb=f.createContext(void 0),Cb=e=>{let t=f.useContext(Sb);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Bte=({client:e,children:t})=>(f.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,H.jsx)(Sb.Provider,{value:e,children:t})),Vte={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},wb=new class{#e=Vte;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function Hte(e){setTimeout(e,0)}var Ute=typeof window>`u`||`Deno`in globalThis;function Tb(){}function Wte(e,t){return typeof e==`function`?e(t):e}function Eb(e){return typeof e==`number`&&e>=0&&e!==1/0}function Db(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ob(e,t){return typeof e==`function`?e(t):e}function kb(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==jb(o,t.options))return!1}else if(!Nb(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function Ab(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Mb(t.options.mutationKey)!==Mb(a))return!1}else if(!Nb(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function jb(e,t){return(t?.queryKeyHashFn||Mb)(e)}function Mb(e){return JSON.stringify(e,(e,t)=>Lb(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function Nb(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let n=0;n<t.length;n++)if(!Nb(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!Nb(e[r],t[r]))return!1;return!0}return!1}var Gte=Object.prototype.hasOwnProperty;function Pb(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=Ib(e)&&Ib(t);if(!r&&!(Lb(e)&&Lb(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:Gte.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=Pb(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function Fb(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function Ib(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Lb(e){if(!Rb(e))return!1;let t=Object.getPrototypeOf(e),n=t?.constructor;if(n===void 0)return!0;if(typeof n!=`function`)return!1;let r=n.prototype;return!(!Rb(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function Rb(e){return Object.prototype.toString.call(e)===`[object Object]`}function Kte(e){return new Promise(t=>{wb.setTimeout(t,e)})}function zb(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:Pb(e,t)}function qte(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function Jte(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Bb=Symbol();function Vb(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Bb?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Hb(e,t){return typeof e==`function`?e(...t):!!e}function Yte(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r||(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0})),i)}),e}var Xte=()=>Ute,Ub=()=>Xte(),Wb=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Gb=new class extends Wb{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},Zte=Hte;function Qte(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=Zte,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var Kb=Qte(),qb=new class extends Wb{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function $te(e){return Math.min(1e3*2**e,3e4)}function Jb(e){return(e??`online`)!==`online`||qb.isOnline()}var Yb=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Xb(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(Tb);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new Yb(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>Gb.isFocused()&&(e.networkMode===`always`||qb.isOnline())&&e.canRun(),p=()=>Jb(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=t=>new Promise(n=>{r=e=>{(c()||t())&&n(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(Ub()?0:3),a=e.retryDelay??$te,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);t||!s?h(r):(n++,e.onFail?.(n,r),Kte(o).then(()=>f()?void 0:g(f)).then(()=>{t?h(r):_()}))})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g(p).then(_),s)}}var Zb=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Eb(this.gcTime)&&(this.#e=wb.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ub()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(wb.clearTimeout(this.#e),this.#e=void 0)}};function ene(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{Yte(e,()=>t.signal,()=>n=!0)},u=Vb(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?Jte:qte;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?tne:Qb,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]===void 0?r.initialPageParam:o[0]:Qb(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function Qb(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function tne(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var nne=class extends Zb{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=tx(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=tx(this.options);e.data!==void 0&&(this.setState(ex(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=zb(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(Tb).catch(Tb):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Ob(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Bb||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>Ob(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!Db(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=Vb(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?ene(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=Xb({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof Yb&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof Yb){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...$b(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...ex(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),Kb.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function $b(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Jb(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function ex(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function tx(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var nx=class extends Wb{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),rx(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ix(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ix(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof Ob(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!Fb(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&ax(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||Ob(this.options.enabled,this.#t)!==Ob(t.enabled,this.#t)||Ob(this.options.staleTime,this.#t)!==Ob(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||Ob(this.options.enabled,this.#t)!==Ob(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return Fb(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch(t).then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Tb)),t}#h(e){return!Ub()&&Ob(this.options.enabled,this.#t)!==!1&&Eb(e)}#g(){this.#b();let e=Ob(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=Db(this.#r.dataUpdatedAt,e)+1;this.#u=wb.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return Ob(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=wb.setInterval(()=>{(this.options.refetchIntervalInBackground||Gb.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(wb.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(wb.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&rx(e,t),o=i&&ax(e,n,t,r);(a||o)&&(l={...l,...$b(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=zb(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=zb(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:ox(e,t),refetch:this.refetch,isEnabled:Ob(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),Fb(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();Kb.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function rne(e,t){return Ob(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||Ob(t.retryOnMount,e)!==!1)}function rx(e,t){return rne(e,t)||e.state.data!==void 0&&ix(e,t,t.refetchOnMount)}function ix(e,t,n){if(Ob(t.enabled,e)!==!1&&Ob(t.staleTime,e)!==`static`){let r=Ob(n,e);return r===`always`||r!==!1&&ox(e,t)}return!1}function ax(e,t,n,r){return(e!==t||Ob(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&ox(e,n)}function ox(e,t){return Ob(t.enabled,e)!==!1&&e.isStaleByTime(Ob(t.staleTime,e))}var ine=class extends Zb{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||ane(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=Xb({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),Kb.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function ane(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var one=class extends Wb{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new ine({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=sx(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=sx(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=sx(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=sx(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){Kb.batch(()=>{let e=this.getAll();this.#e.clear(),this.#t.clear(),e.forEach(e=>{this.notify({type:`removed`,mutation:e})})})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Ab(t,e))}findAll(e={}){return this.getAll().filter(t=>Ab(e,t))}notify(e){Kb.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return Kb.batch(()=>Promise.all(e.map(e=>e.continue().catch(Tb))))}};function sx(e){return e.options.scope?.id}function cx(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}var sne=class extends Wb{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=[];constructor(e,t,n){super(),this.#e=e,this.#r=n,this.#n=[],this.#i=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#r=t,Kb.batch(()=>{let e=this.#i,t=this.#p(this.#n);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let n=t.map(e=>e.observer),r=n.map(e=>e.getCurrentResult()),i=e.length!==n.length,a=n.some((t,n)=>t!==e[n]),o=i||a,s=o?!0:r.some((e,t)=>{let n=this.#t[t];return!n||!Fb(e,n)});(o||s)&&(o&&(this.#l=t,this.#i=n),this.#t=r,this.hasListeners()&&(o&&(cx(e,n).forEach(e=>{e.destroy()}),cx(n,e).forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})),this.#h()))})}getCurrentResult(){return this.#t}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){let n=this.#p(e),r=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),i=n.map(e=>e.defaultedQueryOptions.queryHash);return[r,e=>this.#d(e??r,t,i),()=>this.#u(r,n)]}#u(e,t){let n=new Set;return t.map((r,i)=>{let a=e[i];return r.defaultedQueryOptions.notifyOnChangeProps?a:r.observer.trackResult(a,e=>{n.has(e)||(n.add(e),t.forEach(t=>{t.observer.trackProp(e)}))})})}#d(e,t,n){if(t){let r=this.#c,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((e,t)=>e!==r[t]));return(this.#t!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#t,n!==void 0&&(this.#c=n),this.#a=Pb(this.#a,t(e))),this.#a}return e}#f(){return!this.#r?.combine||this.#i.some((e,t)=>e.options.suspense&&this.#t[t]?.data===void 0)}#p(e){let t=new Map;this.#i.forEach(e=>{let n=e.options.queryHash;if(!n)return;let r=t.get(n);r?r.push(e):t.set(n,[e])});let n=[];return e.forEach(e=>{let r=this.#e.defaultQueryOptions(e),i=t.get(r.queryHash)?.shift()??new nx(this.#e,r);n.push({defaultedQueryOptions:r,observer:i})}),n}#m(e,t){let n=this.#i.indexOf(e);n!==-1&&(this.#t=this.#t.slice(),this.#t[n]=t,this.#h())}#h(){if(this.hasListeners()){let e=this.#f(),t=this.#a,n=e?t:this.#d(this.#u(this.#t,this.#l),this.#r?.combine);(e||t!==n)&&Kb.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},cne=class extends Wb{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??jb(r,t),a=this.get(i);return a||(a=new nne({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){this.#e.get(e.queryHash)===e&&(e.destroy(),this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){Kb.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>kb(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>kb(e,t)):t}notify(e){Kb.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Kb.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Kb.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},lne=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new cne,this.#t=e.mutationCache||new one,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=Gb.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=qb.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Ob(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=Wte(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return Kb.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;Kb.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return Kb.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=Kb.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(Tb).catch(Tb)}invalidateQueries(e,t={}){return Kb.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=Kb.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(Tb)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(Tb)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(Ob(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(Ob(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Tb).catch(Tb)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Tb).catch(Tb)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return qb.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(Mb(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{Nb(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(Mb(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{Nb(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=jb(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===Bb&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},lx=f.createContext(!1),ux=()=>f.useContext(lx);lx.Provider;function une(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var dne=f.createContext(une()),dx=()=>f.useContext(dne),fx=(e,t,n)=>{let r=n?.state.status===`error`&&typeof e.throwOnError==`function`?Hb(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},px=e=>{f.useEffect(()=>{e.clearReset()},[e])},mx=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||Hb(n,[e.error,r])),hx=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},gx=(e,t)=>e?.suspense&&t.isPending,_x=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function vx({queries:e,...t},n){let r=Cb(n),i=ux(),a=dx(),o=t.subscribed!==!1,s=f.useMemo(()=>e.map(e=>{let t=r.defaultQueryOptions(e);return t._optimisticResults=i?`isRestoring`:o?`optimistic`:void 0,t}),[e,r,i,o]);s.forEach(e=>{hx(e);let t=r.getQueryCache().get(e.queryHash);fx(e,a,t)}),px(a);let[c]=f.useState(()=>new sne(r,s,t)),[l,u,d]=c.getOptimisticResult(s,t.combine),p=!i&&o;f.useSyncExternalStore(f.useCallback(e=>p?c.subscribe(Kb.batchCalls(e)):Tb,[c,p]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),f.useEffect(()=>{c.setQueries(s,t)},[s,t,c]);let m=l.some((e,t)=>gx(s[t],e))?l.flatMap((e,t)=>{let n=s[t];return n&&gx(n,e)?_x(n,new nx(r,n),a):[]}):[];if(m.length>0)throw Promise.all(m);let h=l.find((e,t)=>{let n=s[t];return n&&mx({result:e,errorResetBoundary:a,throwOnError:n.throwOnError,query:r.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(h)throw h.error;return u(d())}function yx(e,t,n){let r=ux(),i=dx(),a=Cb(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,hx(o),fx(o,i,s),px(i);let[l]=f.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&c;if(f.useSyncExternalStore(f.useCallback(e=>{let t=d?l.subscribe(Kb.batchCalls(e)):Tb;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),f.useEffect(()=>{l.setOptions(o)},[o,l]),gx(o,u))throw _x(o,l,i);if(mx({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function bx(e,t){return yx(e,nx,t)}function xx({className:e,...t}){return(0,H.jsx)(`div`,{className:V(`animate-pulse rounded-md bg-muted`,e),...t})}var Sx=Object.defineProperty,Cx=(e,t)=>Sx(e,`name`,{value:t,configurable:!0}),[wx,fne]=st(`Tooltip`,[d_]),Tx=d_(),Ex=`TooltipProvider`,Dx=700,Ox=`tooltip.open`,[kx,Ax]=wx(Ex),jx=Cx(e=>{let{__scopeTooltip:t,delayDuration:n=Dx,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=f.useRef(!0),s=f.useRef(!1),c=f.useRef(0);return f.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,H.jsx)(kx,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:f.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:f.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:f.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),Mx=`Tooltip`,[Nx,Px]=wx(Mx),Fx=Cx(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=Ax(Mx,e.__scopeTooltip),l=Tx(t),[u,d]=f.useState(null),[p,m]=f.useState(void 0),h=Fn(),g=f.useRef(0),_=o??c.disableHoverableContent,v=s??c.delayDuration,y=f.useRef(!1),[b,x]=un({prop:r,defaultProp:i??!1,onChange:Cx(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(Ox))):c.onClose(),a?.(e)},`onChange`),caller:Mx}),S=f.useMemo(()=>b?y.current?`delayed-open`:`instant-open`:`closed`,[b]),C=f.useCallback(()=>{window.clearTimeout(g.current),g.current=0,y.current=!1,x(!0)},[x]),w=f.useCallback(()=>{window.clearTimeout(g.current),g.current=0,x(!1)},[x]),T=f.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{y.current=!0,x(!0),g.current=0},v)},[v,x]);f.useEffect(()=>()=>{g.current&&=(window.clearTimeout(g.current),0)},[]);let E=p??h;return(0,H.jsx)(m_,{...l,children:(0,H.jsx)(Nx,{scope:t,contentId:E,setContentId:m,open:b,stateAttribute:S,trigger:u,onTriggerChange:d,onTriggerEnter:f.useCallback(()=>{c.isOpenDelayedRef.current?T():C()},[c.isOpenDelayedRef,T,C]),onTriggerLeave:f.useCallback(()=>{_?w():(window.clearTimeout(g.current),g.current=0)},[w,_]),onOpen:C,onClose:w,disableHoverableContent:_,children:n})})},`Tooltip`),Ix=`TooltipTrigger`,Lx=f.forwardRef(Cx(function(e,t){let{__scopeTooltip:n,"aria-describedby":r,...i}=e,a=Px(Ix,n),o=Ax(Ix,n),s=Tx(n),c=pt(t,f.useRef(null),a.onTriggerChange),l=f.useRef(!1),u=f.useRef(!1),d=f.useCallback(()=>l.current=!1,[]);return f.useEffect(()=>()=>document.removeEventListener(`pointerup`,d),[d]),(0,H.jsx)(g_,{asChild:!0,...s,children:(0,H.jsx)(bn.button,{"aria-describedby":a.open?Xx(r,a.contentId):r,"data-state":a.stateAttribute,...i,ref:c,onPointerMove:Xt(e.onPointerMove,e=>{e.pointerType!==`touch`&&!u.current&&!o.isPointerInTransitRef.current&&(a.onTriggerEnter(),u.current=!0)}),onPointerLeave:Xt(e.onPointerLeave,()=>{a.onTriggerLeave(),u.current=!1}),onPointerDown:Xt(e.onPointerDown,()=>{a.open&&a.onClose(),l.current=!0,document.addEventListener(`pointerup`,d,{once:!0})}),onFocus:Xt(e.onFocus,()=>{l.current||a.onOpen()}),onBlur:Xt(e.onBlur,a.onClose),onClick:Xt(e.onClick,a.onClose)})})},`TooltipTrigger`)),[pne,Rx]=wx(`TooltipPortal`,{forceMount:void 0}),zx=`TooltipContent`,Bx=f.forwardRef(Cx(function(e,t){let n=Rx(zx,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=Px(zx,e.__scopeTooltip);return(0,H.jsx)(Tn,{present:r||o.open,children:o.disableHoverableContent?(0,H.jsx)(Ux,{side:i,...a,ref:t}):(0,H.jsx)(Vx,{side:i,...a,ref:t})})},`TooltipContent`)),Vx=f.forwardRef(Cx(function(e,t){let n=Px(zx,e.__scopeTooltip),r=Ax(zx,e.__scopeTooltip),i=f.useRef(null),a=pt(t,i),[o,s]=f.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,p=f.useCallback(()=>{s(null),d(!1)},[d]),m=f.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=Gx(r,Wx(r,n.getBoundingClientRect())),a=Kx(t.getBoundingClientRect()),o=Jx([...i,...a]);s(o),d(!0)},[d]);return f.useEffect(()=>()=>p(),[p]),f.useEffect(()=>{if(c&&u){let e=Cx(e=>m(e,u),`handleTriggerLeave`),t=Cx(e=>m(e,c),`handleContentLeave`);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,m,p]),f.useEffect(()=>{if(o){let e=Cx(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!qx(n,o);r?p():i&&(p(),l())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,p]),(0,H.jsx)(Ux,{...e,ref:a})},`TooltipContentHoverable`)),Hx=yt(`TooltipContent`),Ux=f.forwardRef(Cx(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=Px(zx,n),u=Tx(n),{onClose:d}=l,[p,m]=f.useState(null),h=pt(t,m);Sr(p),f.useEffect(()=>(document.addEventListener(Ox,d),()=>document.removeEventListener(Ox,d)),[d]),f.useEffect(()=>{if(l.trigger){let e=Cx(e=>{e.target instanceof Node&&e.target.contains(l.trigger)&&d()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]);let{setContentId:g}=l;return Mt(()=>(g(a),()=>{g(void 0)}),[a,g]),(0,H.jsx)(or,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,H.jsxs)(y_,{"data-state":l.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:l.contentId,...u,...c,ref:h,style:{...c.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,H.jsx)(Hx,{children:r}),i?(0,H.jsx)(zte,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`));function Wx(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}Cx(Wx,`getExitSideFromRect`);function Gx(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}Cx(Gx,`getPaddedExitPoints`);function Kx(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}Cx(Kx,`getPointsFromRect`);function qx(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}Cx(qx,`isPointInPolygon`);function Jx(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),Yx(t)}Cx(Jx,`getHull`);function Yx(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}Cx(Yx,`getHullPresorted`);function Xx(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}Cx(Xx,`concatAriaDescribedby`);var Zx=jx,Qx=Fx,$x=Lx,eS=f.forwardRef(({className:e,sideOffset:t=4,...n},r)=>(0,H.jsx)(Bx,{ref:r,sideOffset:t,className:V(`z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]`,e),...n}));eS.displayName=Bx.displayName;function tS(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function nS(e,t=`|`){return e.map(e=>AS(e)).join(t)}function rS(e,t){return typeof t==`bigint`?t.toString():t}var iS=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function aS(e){return new iS(e)}function oS(e){return e==null}function sS(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function cS(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}var lS=Symbol(`evaluating`);function uS(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==lS)return r===void 0&&(r=lS,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function dS(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function fS(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function pS(e){return fS(e._zod.def)??e._zod.def.shape}function mS(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return dS(this,t,e),e},enumerable:!0,configurable:!0})}function hS(e,t,n){t in e?dS(e,t,n):e[t]=n}function gS(e,t,n,r){let i=pS(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?mS(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):hS(e,a,r?r(n.value,a):n.value))}}function _S(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?mS(e,n,()=>t[n]):hS(e,n,r.value))}}function vS(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function yS(e){return JSON.stringify(e)}function bS(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var xS=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function SS(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var CS=aS(()=>{if(bC.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function wS(e){if(SS(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return SS(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function TS(e){return wS(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var ES=new Set([`string`,`number`,`symbol`]);function DS(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function OS(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function kS(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function AS(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function jS(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var MS={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},NS={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function PS(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);let i={};return gS(i,e,FS(e,t)),OS(e,vS(n,{shape:i,checks:[]}))}function FS(e,t){let n=pS(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function IS(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);let i=new Set(FS(e,t)),a={};return gS(a,e,Reflect.ownKeys(pS(e)).filter(e=>!i.has(e))),OS(e,vS(n,{shape:a,checks:[]}))}function LS(e,t){if(!wS(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=pS(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return OS(e,vS(e._zod.def,{shape:RS(e,t)}))}function RS(e,t){let n={};return gS(n,e,Reflect.ownKeys(pS(e))),_S(n,t),n}function zS(e,t){if(!wS(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return OS(e,vS(e._zod.def,{shape:RS(e,t)}))}function BS(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let n={};return gS(n,e,Reflect.ownKeys(pS(e))),gS(n,t,Reflect.ownKeys(pS(t))),OS(e,vS(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function VS(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(FS(t,n)):void 0,o={};return gS(o,t,Reflect.ownKeys(pS(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),OS(t,vS(t._zod.def,{shape:o,checks:[]}))}function HS(e,t,n){let r=n?new Set(FS(t,n)):void 0,i={};return gS(i,t,Reflect.ownKeys(pS(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),OS(t,vS(t._zod.def,{shape:i}))}function US(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function WS(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function GS(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function KS(e){return typeof e==`string`?e:e?.message}function qS(e){let t=[];for(let n of e??[]){let e=n._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let r=e.maximum??e.length??e.size;r>=0&&t.push([r,n])}return t}function JS(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function YS(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:KS(e.inst?._zod.def?.error?.(e))??KS(a?.(e))??KS(t?.error?.(e))??KS(n.customError?.(e))??KS(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t!==`inst`&&t!==`schema`&&t!==`continue`&&t!==`input`&&t!==`__proto__`&&(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}var XS=/[\uD800-\uDBFF]/;function ZS(e){let t=e.length;if(!XS.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function QS(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function $S(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function eC(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function tC(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):aC(e,n,r.value)}}function nC(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function rC(e,t,n){return nC(e,t,n,!1)}function iC(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return nC(this,n,r(this))},set(e){nC(this,n,e)}})}return t}function aC(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:nC(this,t,n.bind(this))},set(e){nC(this,t,e)}})}function oC(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var sC,cC=!1,lC={configurable:!0,get(){cC=!0}};function uC(e,t,n){let r=Object.getPrototypeOf(e._zod);t in r&&sC!==e._zod?sC=void 0:(sC=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,lC);let e=cC;cC=!1;try{let r=n(this);return cC?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),cC||=e,r}catch(n){throw delete this[t],cC||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}}))}function dC(e,t,n,r){let i=oC(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}var fC=`~constantCatch`;function pC(e){let t=()=>e;return t[fC]=!0,t}var mC,hC={value:void 0,enumerable:!1},gC=`captureStackTrace`in Error?Error:null;function _C(e){let t=gC;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return gC=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function G(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){hC.value=new a(r);try{Object.defineProperty(n,"_zod",hC)}finally{hC.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),tC(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?_C(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var vC=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},yC=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(mC=globalThis).__zod_globalConfig??(mC.__zod_globalConfig={});var bC=globalThis.__zod_globalConfig;function xC(e){return e&&Object.assign(bC,e),bC}function SC(){let e=this._zod;return e.message??=JSON.stringify(e.def,rS,2),e.message}function CC(e){this._zod.message=e}var wC={get:SC,set:CC,enumerable:!0,configurable:!0},TC={value:void 0,enumerable:!1},EC=new WeakSet([Object.prototype,Error.prototype]),DC=G(`$ZodError`,(e,t)=>{e.name=`$ZodError`,TC.value=t,Object.defineProperty(e,"issues",TC),TC.value=void 0,Object.defineProperty(e,"message",wC);let n=Object.getPrototypeOf(e);EC.has(n)||(EC.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))});function OC(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function kC(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?OC(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function AC(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function jC(e,t){return{callee:t?.callee??e,Err:t?.Err}}var MC=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new vC;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>YS(e,o,xC())));throw xS(n,a?.callee??t),n}return s.value};return t},NC=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>YS(e,o,xC())));throw xS(n,a?.callee??t),n}return s.value};return t},PC=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new vC;return a.issues.length?FC(e,a.issues,i):{success:!0,data:a.value}};function FC(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>YS(e,n,xC()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}var IC=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?FC(e,a.issues,i):{success:!0,data:a.value}},LC=Symbol.for(`zod.compile.invalid`),RC=Symbol.for(`zod.compile.fallback`),zC=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==LC)return!0;if(r.definite===!0&&n===void 0)return!1}return BC(e,t,n)});function BC(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[RC]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new vC;return a.issues.length===0}var VC=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},HC=e=>{let t=MC(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,jC(n,a))};return n},UC=e=>{let t=MC(e),n=(e,r,i,a)=>t(e,r,i,jC(n,a));return n},WC=e=>{let t=NC(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,jC(n,a))};return n},GC=e=>{let t=NC(e),n=async(e,r,i,a)=>await t(e,r,i,jC(n,a));return n},KC=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return PC(e)(t,n,i)},qC=e=>(t,n,r)=>PC(e)(t,n,r),JC=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return IC(e)(t,n,i)},YC=e=>async(t,n,r)=>IC(e)(t,n,r),XC=/^[cC][0-9a-z]{6,}$/,ZC=/^[0-9a-z]+$/,QC=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,$C=/^[0-9a-vA-V]{20}$/,ew=/^[A-Za-z0-9]{27}$/,tw=/^[a-zA-Z0-9_-]{21}$/;function nw(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var rw=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,iw=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,aw=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,ow=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,sw=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function cw(){return new RegExp(sw,`u`)}var lw=/^(?:(?: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])$/,uw=/^(([0-9a-fA-F]{1,4}:){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}|:))$/,dw=/^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/,fw=/^(([0-9a-fA-F]{1,4}:){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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,pw=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,mw=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,hw=/^https?$/,gw=/^\+[1-9]\d{6,14}$/,_w=`(?:(?:\\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])))`;function vw(e){return RegExp(`^${e}$`)}var yw=vw(_w);function bw(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function xw(e){return RegExp(`^${bw(e)}$`)}function Sw(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${bw({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${bw({precision:e.precision})}`:n;return RegExp(`^${_w}T(?:${r})$`)}var Cw=/^[\s\S]{0,}$/,ww=/^-?\d+$/,Tw=/^-?\d+(?:\.\d+)?$/,Ew=/^(?:true|false)$/i,Dw=/^null$/i,Ow=/^[^A-Z]*$/,kw=/^[^a-z]*$/,Aw=G(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),jw=e=>{let t=e.value;return!oS(t)&&t.length!==void 0},Mw={number:`number`,bigint:`bigint`,object:`date`},Nw=G(`$ZodCheckLessThan`,(e,t)=>{Aw.init(e,t);let n=Mw[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:Mw[typeof r.value]??n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Pw=G(`$ZodCheckGreaterThan`,(e,t)=>{Aw.init(e,t);let n=Mw[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:Mw[typeof r.value]??n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Fw=G(`$ZodCheckMultipleOf`,(e,t)=>{Aw.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):cS(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Iw=G(`$ZodCheckNumberFormat`,(e,t)=>{Aw.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=MS[t.format];e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),Lw=G(`$ZodCheckMaxLength`,(e,t)=>{var n;Aw.init(e,t),(n=e._zod.def).when??(n.when=jw),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?ZS(r):i)<=t.maximum)return;let a=QS(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Rw=G(`$ZodCheckMinLength`,(e,t)=>{var n;Aw.init(e,t),(n=e._zod.def).when??(n.when=jw),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?ZS(r):i)>=t.minimum)return;let a=QS(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),zw=G(`$ZodCheckLengthEquals`,(e,t)=>{var n;Aw.init(e,t),(n=e._zod.def).when??(n.when=jw),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?ZS(r):i;if(a===t.length)return;let o=QS(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Bw=G(`$ZodCheckStringFormat`,(e,t)=>{var n,r;Aw.init(e,t),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Vw=G(`$ZodCheckRegex`,(e,t)=>{Bw.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Hw=G(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Ow,Bw.init(e,t)}),Uw=G(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=kw,Bw.init(e,t)}),Ww=G(`$ZodCheckIncludes`,(e,t)=>{Aw.init(e,t);let n=DS(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Gw=G(`$ZodCheckStartsWith`,(e,t)=>{Aw.init(e,t);let n=RegExp(`^${DS(t.prefix)}.*`);t.pattern??=n,e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Kw=G(`$ZodCheckEndsWith`,(e,t)=>{Aw.init(e,t);let n=RegExp(`.*${DS(t.suffix)}$`);t.pattern??=n,e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});function qw(e,t,n){e.issues.length&&t.issues.push(...GS(n,e.issues))}var Jw=G(`$ZodCheckProperties`,(e,t)=>{Aw.init(e,t),rC(e,Symbol.iterator,function*(){yield e});let n;e._zod.check=r=>{if(r.value==null){r.issues.push({expected:`object`,code:`invalid_type`,input:r.value,inst:e});return}n??=Reflect.ownKeys(t.shape).map(e=>[e,t.shape[e]]);let i=r.value,a;for(let[e,t]of n){let n=t._zod.run({value:i[e],issues:[]},{});n instanceof Promise?(a??=[],a.push(n.then(t=>qw(t,r,e)))):qw(n,r,e)}if(a)return Promise.all(a).then(()=>void 0)}}),Yw=G(`$ZodCheckOverwrite`,(e,t)=>{Aw.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),Xw=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--this.indent}}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
44
44
|
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.content??[``];return new e(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${t.join(`
|
|
45
45
|
`)}\n};`)(...Object.values(this.closed))}},Zw={major:4,minor:6,patch:7},Qw=G(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Zw;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=US(t),a;for(let o of n){if(o._zod.def.when){if(WS(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new vC;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(JS(t.issues,n,e),i||=US(t,n))});else{if(t.issues.length===n)continue;JS(t.issues,n,e),i||=US(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(US(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new vC;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new vC;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return rC(this,`~standard`,tT(this))},set"~standard"(e){nC(this,`~standard`,e)}}),$w=(e,t)=>e.issues.length?{issues:e.issues.map(e=>YS(e,t,xC()))}:{value:e.value};async function eT(e,t){let n={async:!0};return $w(await e._zod.run({value:t,issues:[]},n),n)}function tT(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return $w(r,n)}catch{}return eT(e,t)},vendor:`zod`,version:1}}var nT=G(`$ZodString`,(e,t)=>{Qw.init(e,t),e._zod.pattern=t.pattern??Cw,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),rT=G(`$ZodStringFormat`,(e,t)=>{Bw.init(e,t),nT.init(e,t)}),iT=G(`$ZodGUID`,(e,t)=>{t.pattern??=iw,rT.init(e,t)}),aT=G(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=aw(e)}else t.pattern??=aw();rT.init(e,t)}),oT=G(`$ZodEmail`,(e,t)=>{t.pattern??=ow,rT.init(e,t)});function sT(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function cT(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?sT(e)||2:lT(e,t)}function lT(e,t){if(!t.normalize&&t.protocol?.source===hw.source&&!/^https?:\/\//i.test(e))return 1;try{if(typeof URL<`u`){let t=URL;if(typeof t.parse==`function`)return t.parse(e)??2}return new URL(e)}catch{return 2}}var uT=/[\t\n\r]/g;function dT(e){return e.replace(uT,``)}function fT(e,t){return t.lastIndex=0,t.test(e.hostname)}function pT(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var mT=G(`$ZodURL`,(e,t)=>{rT.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=cT(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}if(i===!0){n.value=dT(r);return}t.hostname&&!fT(i,t.hostname)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!pT(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:dT(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),hT=G(`$ZodEmoji`,(e,t)=>{t.pattern??=cw(),rT.init(e,t)}),gT=G(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?tw:nw(t.length),rT.init(e,t)}),_T=G(`$ZodCUID`,(e,t)=>{t.pattern??=XC,rT.init(e,t)}),vT=G(`$ZodCUID2`,(e,t)=>{t.pattern??=ZC,rT.init(e,t)}),yT=G(`$ZodULID`,(e,t)=>{t.pattern??=QC,rT.init(e,t)}),bT=G(`$ZodXID`,(e,t)=>{t.pattern??=$C,rT.init(e,t)}),xT=G(`$ZodKSUID`,(e,t)=>{t.pattern??=ew,rT.init(e,t)}),ST=G(`$ZodISODateTime`,(e,t)=>{t.pattern??=Sw(t),rT.init(e,t)}),CT=G(`$ZodISODate`,(e,t)=>{t.pattern??=yw,rT.init(e,t)}),wT=G(`$ZodISOTime`,(e,t)=>{t.pattern??=xw(t),rT.init(e,t)}),TT=G(`$ZodISODuration`,(e,t)=>{t.pattern??=rw,rT.init(e,t)}),ET=G(`$ZodIPv4`,(e,t)=>{t.pattern??=lw,rT.init(e,t)}),DT=/^[0-9a-fA-F:.]+$/;function OT(e){return DT.test(e)?sT(`http://[${e}]`):!1}var kT=G(`$ZodIPv6`,(e,t)=>{t.pattern??=uw,rT.init(e,t),e._zod.check=n=>{OT(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),AT=G(`$ZodCIDRv4`,(e,t)=>{t.pattern??=dw,rT.init(e,t)});function jT(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:OT(n)}var MT=G(`$ZodCIDRv6`,(e,t)=>{t.pattern??=fw,rT.init(e,t),e._zod.check=n=>{jT(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function NT(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var PT=/^[0-9a-zA-Z+/]*={0,2}$/,FT=G(`$ZodBase64`,(e,t)=>{t.pattern??=PT,rT.init(e,t),e._zod.check=n=>{NT(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),IT=/^[A-Za-z0-9_-]*$/;function LT(e){if(!IT.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return NT(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var RT=G(`$ZodBase64URL`,(e,t)=>{t.pattern??=IT,rT.init(e,t),e._zod.check=n=>{LT(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),zT=G(`$ZodE164`,(e,t)=>{t.pattern??=gw,rT.init(e,t)});function BT(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var VT=G(`$ZodJWT`,(e,t)=>{rT.init(e,t),e._zod.check=n=>{BT(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),HT=G(`$ZodNumber`,(e,t)=>{Qw.init(e,t),e._zod.pattern=Tw,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:String(i):void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),UT=G(`$ZodNumberFormat`,(e,t)=>{Iw.init(e,t),HT.init(e,t)}),WT=G(`$ZodBoolean`,(e,t)=>{Qw.init(e,t),e._zod.pattern=Ew,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),GT=G(`$ZodNull`,(e,t)=>{Qw.init(e,t),e._zod.pattern=Dw,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),KT=G(`$ZodAny`,(e,t)=>{Qw.init(e,t),e._zod.parse=e=>e}),qT=G(`$ZodUnknown`,(e,t)=>{Qw.init(e,t),e._zod.parse=e=>e}),JT=G(`$ZodNever`,(e,t)=>{Qw.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function YT(e,t){let n=qS(e._zod.def.checks);if(!n.length)return;let r=Math.min(...n.map(e=>e[0])),i=e._zod.parse;e._zod.parse=(n,a)=>{let o=t(n.value);if(o>r&&!a?.skipChecks&&a?.direction!==`backward`){for(let[t,r]of qS(e._zod.def.checks))if(o>t&&r._zod.def.when(n)){let t=n.issues.length;return r._zod.check(n),n.issues[t].continue=!1,JS(n.issues,t,e),n}}return i(n,a)}}var XT=e=>Array.isArray(e)?e.length:-1;function ZT(e,t,n){e.issues.length&&t.issues.push(...GS(n,e.issues)),t.value[n]=e.value}var QT=G(`$ZodArray`,(e,t)=>{Qw.init(e,t);let n=bC.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i?.abortEarly;for(let e=0;e<a.length;e++){let n=a[e],c=t.element._zod.run({value:n,issues:[]},i);if(c instanceof Promise)o.push(c.then(t=>ZT(t,r,e)));else if(ZT(c,r,e),s&&c.issues.length!==0&&US(c))break}return o.length?Promise.all(o).then(()=>r):r},YT(e,XT)});function $T(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...GS(n,e.issues))}!o&&i===void 0?e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]}):e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}var eE=[];function tE(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:eE,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=jS(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function nE(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(US(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>$T(e,n,i,t,d,f))):$T(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var rE=G(`$ZodObject`,(e,t)=>{Qw.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=aS(()=>tE(t));uC(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||dS(n,e,new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let a=SS,o=t.catchall,s,c=bC.memoizer;c?.attach(e),e._zod.parse=(t,n)=>{s??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=c?c.alloc(e,t,{},n):{};let l=[],u=s.shape,d=n?.abortEarly,f=t.issues.length;for(let e of s.allKeys){if(d&&t.issues.length!==f){if(US(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,o=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(n=>$T(n,t,e,r,a,o))):$T(s,t,e,r,a,o)}return o?nE(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),iE=G(`$ZodObjectJIT`,(e,t)=>{rE.init(e,t);let n=e._zod.parse,r=aS(()=>tE(t)),i=bC.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new Xw([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
|
|
46
46
|
let ${e}_ab = false;
|